zjxpcyc 6 lat temu
rodzic
commit
fbb4da50d4

+ 17
- 2
src/App.vue Wyświetl plik

@@ -1,19 +1,33 @@
1 1
 <template>
2 2
   <div id="app" v-if="showPage">
3 3
     <router-view/>
4
+    <music :url="activity.Music"> </music>
4 5
   </div>
5 6
 </template>
6 7
 
7 8
 <script>
8 9
 import './assets/css/reset.css'
9 10
 import { createNamespacedHelpers } from 'vuex'
11
+import music from './components/music.vue'
10 12
 const { mapActions: mapIndexActions } = createNamespacedHelpers('vote')
13
+const {
14
+  mapState: mapactivityState,
15
+} = createNamespacedHelpers("vote");
16
+
11 17
 export default {
12 18
   data () {
13 19
     return {
14
-      showPage: true
20
+      showPage: true,
15 21
     }
16 22
   },
23
+  components: {
24
+    music,
25
+  },
26
+  computed: {
27
+    ...mapactivityState({
28
+      activity: s => s.activity || {},
29
+    })
30
+  },
17 31
   created () {
18 32
     // if (location.search && this.toolClass.UrlSearch(location.search).code) {
19 33
     //   this.code = this.toolClass.UrlSearch(location.search).code
@@ -30,6 +44,7 @@ export default {
30 44
     // } else {
31 45
     //   this.toolClass.getCode('wx32e2e8c81f66070e')
32 46
     // }
47
+
33 48
   },
34 49
   methods: {
35 50
     ...mapIndexActions(['user'])
@@ -42,6 +57,6 @@ export default {
42 57
 #app {
43 58
   width: 100%;
44 59
   height: 100%;
45
-  position: relative;
60
+  // position: relative;
46 61
 }
47 62
 </style>

BIN
src/assets/bgimg.jpg Wyświetl plik


+ 8
- 0
src/assets/css/theme.scss Wyświetl plik

@@ -0,0 +1,8 @@
1
+/* 改变主题色变量 */
2
+$--background: rgba(220,229,236,1);
3
+/* 改变 icon 字体路径变量,必需 */
4
+$--font-path: '~element-ui/lib/theme-chalk/fonts';
5
+/*按钮颜色*/
6
+$btn_fastener:rgba(166,184,201,1);
7
+$input_box:rgba(201,214,224,1);
8
+

BIN
src/assets/icon/yjs_icon_love.png Wyświetl plik


BIN
src/assets/icon/yjs_icon_music_close.png Wyświetl plik


BIN
src/assets/icon/yjs_icon_music_open.png Wyświetl plik


BIN
src/assets/icon/yjs_icon_pen.png Wyświetl plik


BIN
src/assets/icon/yjs_icon_phone.png Wyświetl plik


+ 34
- 66
src/components/music.vue Wyświetl plik

@@ -1,53 +1,28 @@
1 1
 <template>
2
-    <div class="MusicComponents" >
3
-        <div class="musicbox">
4
-    <!-- 播放 -->
5
-     <div class="play" v-if="audioPlayShow" @click="audioState">
6
-      <img :src="MusicOn"/>
7
-    </div>
8
-    <!-- 暂停-->
9
-    <div class="play" v-else>
10
-      <img :src="MusicOff" @click="audioState">
11
-    </div>
12
-
13
-    <audio ref="player" :src="audioHttp"></audio>
14
-        </div>
15
-
2
+    <div class="musicbox">
3
+      <!-- 播放 -->
4
+      <div class="play" v-if="audioPlayShow" @click="audioState">
5
+        <img src="https://spaceofcheng.oss-cn-beijing.aliyuncs.com/voting/yttj_icon_music_open.png">
6
+        <!-- <img src="https://spaceofcheng.oss-cn-beijing.aliyuncs.com/voting/yjs_icon_music_open.png"> -->
7
+      </div>
8
+      <!-- 暂停-->
9
+      <div class="play" v-else @click="audioState">
10
+        <img src="https://spaceofcheng.oss-cn-beijing.aliyuncs.com/voting/yttj_icon_music_close.png" >
11
+         <!-- <img v-if="this.$route.query.actid===2" src="https://spaceofcheng.oss-cn-beijing.aliyuncs.com/voting/yttj_icon_music_close.png" > -->
12
+      </div>
13
+      <audio ref="player" :src="url" autoplay preload loop="loop"></audio>
16 14
     </div>
17 15
 </template>
18 16
 <script>
19
-import MusicOn from "../common/icon/yinyueon.png";
20
-import MusicOff from "../common/icon/yinyueoff.png";
21 17
 export default {
22
-     data() {
18
+  name:'music',
19
+  props:['url'],
20
+  data() {
23 21
     return {
24
-      MusicOn,
25
-      MusicOff,
26 22
       audioPlayShow: true,
27
-      cTime: "00:00", // 已播放时间
28
-      dTime: "00:00", // 总播放时间
29
-      audioHttp: "http://up.mcyt.net/?down/46426.mp3" // 音频链接
30 23
     };
31 24
   },
32
-   mounted() {
33
-    const music = this.$refs.player; // 音频所在对象
34
-    music.addEventListener("canplay", () => {
35
-      const musicTime = music.duration; // 获得音频时长
36
-      const branch = Math.floor(musicTime / 60); // 计算音频分钟
37
-      const second = Math.ceil(musicTime % 60); // 计算音频秒
38
-      if (branch < 10 && second < 10) {
39
-        // 四种情况判断音频总时间
40
-        this.dTime = `0${branch}:0${second}`;
41
-      } else if (branch < 10) {
42
-        this.dTime = `0${branch}:${second}`;
43
-      } else if (second < 10) {
44
-        this.dTime = `${branch}:0${second}`;
45
-      } else {
46
-        this.dTime = `${branch}:${second}`;
47
-      }
48
-    });
49
-  },
50
-    methods: {
25
+  methods: {
51 26
     // 点击播放暂停按钮时间
52 27
     audioState() {
53 28
       this.audioPlayShow = !this.audioPlayShow; // 更改播放暂停按钮状态
@@ -59,35 +34,28 @@ export default {
59 34
       }
60 35
     }
61 36
   }
62
-}
37
+};
63 38
 </script>
64 39
 
65 40
 <style lang="scss" scoped>
66
-.MusicComponents{
67
-    position: relative;
68
-    height: 100%;
69
-    width: 100%;
70
-
71
-    .musicbox{
72
-        position: absolute;
73
-        top:1.27rem;
74
-        right:0.09rem;
75
-        width: 0.24rem;
76
-        height: 0.24rem;
77
-        border-radius: 50%;
78
-
79
-        .play{
80
-            width: 100%;
81
-            height: 100%;
82
-
83
-            img{
84
-                width:100%;
85
-                height: 100%;
86
-            }
87
-        }
41
+  .musicbox {
42
+    position: fixed;
43
+    top: 1.27rem;
44
+    right: 0.09rem;
45
+    width: 0.24rem;
46
+    height: 0.24rem;
47
+    border-radius: 50%;
48
+
49
+    .play {
50
+      width: 100%;
51
+      height: 100%;
52
+
53
+      img {
54
+        width: 100%;
55
+        height: 100%;
56
+      }
88 57
     }
89
-   
90
-}
58
+  }
91 59
 </style>
92 60
 
93 61
 

+ 0
- 28
src/util/share.js Wyświetl plik

@@ -46,34 +46,6 @@ function wxsdk (params, config) {
46 46
     }).catch((err) => {
47 47
       reject(err)
48 48
     })
49
-
50
-    // axios.post(api.share.share.url + '?url=' + params.url)
51
-    //   .then(function (res) {
52
-    //     let result = JSON.parse(res.data)
53
-    //     wx.config({
54
-    //       debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
55
-    //       appId: result.appId, // 必填,公众号的唯一标识
56
-    //       timestamp: result.timestamp, // 必填,生成签名的时间戳
57
-    //       nonceStr: result.noncestr, // 必填,生成签名的随机串
58
-    //       signature: result.signature, // 必填,签名,见附录1
59
-    //       jsApiList: [
60
-    //         'onMenuShareTimeline',
61
-    //         'onMenuShareAppMessage',
62
-    //         'onMenuShareQQ',
63
-    //         'onMenuShareWeibo',
64
-    //         'onMenuShareQZone',
65
-    //         'openLocation'
66
-    //       ]
67
-    //     })
68
-    //     wx.ready(function () {
69
-    //       wx.onMenuShareTimeline(shareData)
70
-    //       wx.onMenuShareAppMessage(shareData)
71
-    //       // resolve()
72
-    //     })
73
-    //   })
74
-    //   .catch(function (error) {
75
-    //     console.log(error)
76
-    //   })
77 49
   })
78 50
 }
79 51
 

+ 5
- 5
src/views/vote/index.vue Wyświetl plik

@@ -54,19 +54,19 @@ export default {
54 54
     height: 100%;
55 55
   }
56 56
   .EnterActivity {
57
-    position: absolute;
58
-    top: 5.86rem;
59
-    left: 0.45rem;
60 57
     width: 75%;
61 58
     height: 0.5rem;
62 59
     border-radius: 0.25rem;
63
-    background-color: rgba(166,184,201,1);
60
+    background: #a6b8c9;
64 61
     border: none;
65 62
     font-size: 0.2rem;
66 63
     font-family: PingFangSC-Medium;
67 64
     font-weight: bold;
68
-    color: rgba(255, 255, 255, 1);
65
+    color: white;
69 66
     line-height: 0.28rem;
67
+    position: fixed;
68
+    bottom: 0.4rem;
69
+    left:calc(12.5%);
70 70
   }
71 71
 }
72 72
 </style>

+ 110
- 39
src/views/vote/list.vue Wyświetl plik

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div class="context">
3 3
     <img class="BannerImage" :src="activity.Banner">
4
-    <div class="search">
4
+    <div :class="isOK?searchs:searchb">
5 5
       <input placeholder="输入编号或姓名" v-model="q">
6 6
       <img class="IconSearch" :src="IconSearch" @click="search">
7 7
       <!-- <i class="iconfont icon-sousuo3 IconSearch"></i> -->
@@ -74,22 +74,29 @@ export default {
74 74
   name: "lotterylist",
75 75
   data() {
76 76
     return {
77
-      // AudioPlay: '',
78
-      IconSearch: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/voting/yttj_icon_search.png',
79
-      tab:'',
80
-      q:'',
77
+      // AudioPlay: ''
78
+      isOK:true,
79
+      searchs:'searchs',
80
+      searchb:'searchb',
81
+      IconSearch:
82
+        "https://spaceofcheng.oss-cn-beijing.aliyuncs.com/voting/yttj_icon_search.png",
83
+      tab: "",
84
+      q: "",
81 85
       loading: false,
82 86
       finished: false,
83
-      actid: '',
87
+      actid: "",
84 88
       newpage: 1,
85 89
       toppage: 1,
86 90
       show: false,
87
-      refreshing: false,
88 91
       pageSize: 10,
89 92
     };
90 93
   },
91 94
   components: {
92
-    toast,
95
+    toast
96
+  },
97
+  mounted() {
98
+    window.addEventListener("scroll", this.handleScroll, true);
99
+    // 监听(绑定)滚轮 滚动事件
93 100
   },
94 101
   computed: {
95 102
     ...mapactivityState({
@@ -139,41 +146,67 @@ export default {
139 146
       'vote',
140 147
       'getMine',
141 148
     ]),
149
+    handleScroll() {
150
+      // 页面滚动距顶部距离
151
+      var scrollTop =
152
+        window.pageYOffset ||
153
+        document.documentElement.scrollTop ||
154
+        document.body.scrollTop;
155
+         window.console.log(scrollTop);
156
+         if(scrollTop>=280){
157
+          this.isOK =false;
158
+        }else {
159
+          this.isOK=true;
160
+        }
161
+
162
+      var scroll = scrollTop - this.i;
163
+      this.i = scrollTop;
164
+     
165
+      // if (scroll < 0) {
166
+      //   this.isFixed =false;
167
+      //   console.log("up");
168
+      // } else {
169
+      //    if(this.i>=280){
170
+      //     this.isFixed =true;
171
+      //   }
172
+      //   console.log("down");
173
+      // }
174
+    },
142 175
     newlist() {
143 176
       return this.getList({
144 177
         actid: this.actid,
145 178
         page: this.newpage,
146
-        q: this.q,
147
-      })
179
+        q: this.q
180
+      });
148 181
     },
149 182
     toplist() {
150 183
       return this.getTopList({
151 184
         actid: this.actid,
152 185
         page: this.toppage,
153
-        q: this.q,
154
-      })
186
+        q: this.q
187
+      });
155 188
     },
156 189
     Vote(memberid) {
157 190
       this.vote({
158 191
         actid: this.actid,
159 192
         memberid: memberid,
160
-        openid: this.user,
193
+        openid: this.user
161 194
       }).then(() => {
162 195
         const newlist = this.newList.map(x => {
163 196
           if (x.MemberId == memberid) {
164
-            x.Vote = x.Vote + 1
197
+            x.Vote = x.Vote + 1;
165 198
           }
166
-          return x
167
-        })
168
-        this.newList  = newlist
199
+          return x;
200
+        });
201
+        this.newList = newlist;
169 202
         const toplist = this.topList.map(x => {
170 203
           if (x.MemberId == memberid) {
171
-            x.Vote = x.Vote + 1
204
+            x.Vote = x.Vote + 1;
172 205
           }
173
-          return x
174
-        })
175
-        this.topList = toplist
176
-      })
206
+          return x;
207
+        });
208
+        this.topList = toplist;
209
+      });
177 210
     },
178 211
     loadNewList() {
179 212
       this.newlist().then((res) => {
@@ -199,24 +232,24 @@ export default {
199 232
     },
200 233
     signup() {
201 234
       this.$router.push({
202
-        path: `/vote/signup/${this.actid}`,
235
+        path: `/vote/signup/${this.actid}`
203 236
       });
204 237
     },
205 238
     gotovotingdetails(memberid) {
206 239
       this.$router.push({
207 240
         path: `/detail/${this.actid}/${memberid}`
208
-      })
241
+      });
209 242
     },
210 243
     close() {
211
-      this.show = false
244
+      this.show = false;
212 245
     },
213 246
     tolink() {
214
-      window.location.href = this.info.AfterVote
247
+      window.location.href = this.info.AfterVote;
215 248
     },
216 249
     search() {
217
-      this.newlist()
218
-      this.toplist()
219
-    },
250
+      this.newlist();
251
+      this.toplist();
252
+    }
220 253
   }
221 254
 };
222 255
 </script>
@@ -232,7 +265,7 @@ export default {
232 265
 }
233 266
 .van-tabs__wrap {
234 267
   width: 100%;
235
-  z-index: 1;
268
+  z-index: 0;
236 269
 }
237 270
 .van-tabs__nav--card .van-tab.van-tab--active {
238 271
   background-color: rgba(166, 184, 201, 1);
@@ -273,11 +306,48 @@ export default {
273 306
 
274 307
   .BannerImage {
275 308
     width: 100%;
276
-    height: 2rem;
277
-    margin-bottom: 0.2rem;
309
+    height: 3.4rem;
278 310
   }
311
+.searchb{
312
+  width: 93%;
313
+    height: 0.44rem;
314
+    background-color: rgba(201, 214, 224, 1);
315
+    border-radius: 6px;
316
+    border: 0.01rem solid rgba(255, 255, 255, 1);
317
+    display: flex;
318
+    flex-direction: row;
319
+    justify-content: space-between;
320
+    align-items: center;
321
+    position: fixed;
322
+    top: 0;
323
+    left: calc(3.1%);
279 324
 
280
-  .search {
325
+    input {
326
+      // padding: 0.11rem 1.2rem 0.11rem 0.13rem;
327
+      background-color: rgba(255, 255, 255, 0);
328
+      color: rgba(255, 255, 255, 1);
329
+      font-size: 0.16rem;
330
+      font-family: PingFangSC-Regular;
331
+      font-weight: 400;
332
+      line-height: 0.22rem;
333
+      width: 5rem;
334
+      text-indent: 0.1rem;
335
+    }
336
+    input::-webkit-input-placeholder {
337
+      color: rgba(255, 255, 255, 1);
338
+      font-size: 0.16rem;
339
+      font-family: PingFangSC-Regular;
340
+      font-weight: 400;
341
+      line-height: 0.22rem;
342
+    }
343
+    .IconSearch {
344
+      width: 0.2rem;
345
+      height: 0.2rem;
346
+      margin-right: 0.1rem;
347
+    }
348
+
349
+}
350
+  .searchs {
281 351
     width: 93%;
282 352
     height: 0.44rem;
283 353
     background-color: rgba(201, 214, 224, 1);
@@ -287,7 +357,9 @@ export default {
287 357
     flex-direction: row;
288 358
     justify-content: space-between;
289 359
     align-items: center;
290
-    margin-bottom: 0.19rem;
360
+    position: absolute;
361
+    top: 2.8rem;
362
+    left: calc(3.1%);
291 363
 
292 364
     input {
293 365
       // padding: 0.11rem 1.2rem 0.11rem 0.13rem;
@@ -312,20 +384,17 @@ export default {
312 384
       width: 0.2rem;
313 385
       height: 0.2rem;
314 386
       margin-right: 0.1rem;
315
-      //   font-size: 0.3rem !important;
316
-      //   color: rgba(255, 255, 255, 1) !important;
317
-      //   padding-right: 0.1rem;
318 387
     }
319 388
   }
320 389
   .informationimg {
321 390
     width: 97%;
322 391
     height: 6.24rem;
323
-    margin: 0 0.1rem 0.35rem 0;
324 392
   }
325 393
 
326 394
   .box {
327 395
     width: 89%;
328 396
     height: 0.12rem;
397
+    margin-top: 0.35rem;
329 398
     background-color: rgba(255, 255, 255, 0.29);
330 399
     border-radius: 0.06rem 0.06rem 0 0;
331 400
   }
@@ -447,7 +516,9 @@ export default {
447 516
     font-weight: bold;
448 517
     color: rgba(255, 255, 255, 1);
449 518
     line-height: 0.28rem;
450
-    margin-bottom: 0.19rem;
519
+    position: fixed;
520
+    bottom: 0.19rem;
521
+    left: calc(4.25%);
451 522
   }
452 523
 }
453 524
 </style>

+ 4
- 3
src/views/vote/signup.vue Wyświetl plik

@@ -25,7 +25,7 @@
25 25
       </div>
26 26
       <input placeholder="输入手机号" v-model="postData.phone"/>
27 27
       <input placeholder="输入姓名" v-model="postData.name"/>
28
-      <!-- <textarea class="addressarea" placeholder="所在社区"></textarea> -->
28
+      <!-- <textarea class="addressarea" placeholder="所在社区" ></textarea> -->
29 29
       <div class="btn">
30 30
           <button class="SubmitBtn" @click="SubmitBtn">提交</button>
31 31
       </div>
@@ -70,6 +70,7 @@ export default {
70 70
       'voteMember',
71 71
     ]),
72 72
     onRead (file) {
73
+      console.log(file);
73 74
       let that = this
74 75
       this.isLoading = true
75 76
       let reader = new FileReader();
@@ -120,7 +121,7 @@ export default {
120 121
     height: 5.85rem;
121 122
     border-radius: 0.06rem;
122 123
     background-color: rgba(255, 255, 255, 1);
123
-    margin-top: 0.7rem;
124
+    margin-top: 0.12rem;
124 125
 
125 126
     .uploadimg {
126 127
       display: flex;
@@ -247,7 +248,7 @@ line-height:0.22rem;
247 248
     .addressarea{
248 249
          width: 84%;
249 250
         height: 0.8rem;
250
-        background-color:rgba(255,241,241,1);;
251
+        background-color:rgba(220,229,236,0.63);
251 252
 border-radius:0.06rem;
252 253
 padding: 0.02rem 0.1rem;
253 254
     margin: 0 0 2% 5%;