陈冉 před 6 roky
rodič
revize
55e1342a47

+ 17
- 2
src/App.vue Zobrazit soubor

@@ -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ární
src/assets/bgimg.jpg Zobrazit soubor


+ 8
- 0
src/assets/css/theme.scss Zobrazit soubor

@@ -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ární
src/assets/icon/yjs_icon_love.png Zobrazit soubor


binární
src/assets/icon/yjs_icon_music_close.png Zobrazit soubor


binární
src/assets/icon/yjs_icon_music_open.png Zobrazit soubor


binární
src/assets/icon/yjs_icon_pen.png Zobrazit soubor


binární
src/assets/icon/yjs_icon_phone.png Zobrazit soubor


+ 34
- 66
src/components/music.vue Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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 Zobrazit soubor

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

+ 120
- 52
src/views/vote/list.vue Zobrazit soubor

@@ -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> -->
@@ -55,7 +55,7 @@
55 55
 
56 56
 <script>
57 57
 import { createNamespacedHelpers } from "vuex";
58
-import toast from '../../components/toast.vue'
58
+import toast from "../../components/toast.vue";
59 59
 
60 60
 const {
61 61
   mapState: mapactivityState,
@@ -66,79 +66,109 @@ export default {
66 66
   name: "lotterylist",
67 67
   data() {
68 68
     return {
69
-      // AudioPlay: '',
70
-      IconSearch: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/voting/yttj_icon_search.png',
71
-      tab:'',
72
-      q:'',
69
+      // AudioPlay: ''
70
+      isOK:true,
71
+      searchs:'searchs',
72
+      searchb:'searchb',
73
+      IconSearch:
74
+        "https://spaceofcheng.oss-cn-beijing.aliyuncs.com/voting/yttj_icon_search.png",
75
+      tab: "",
76
+      q: "",
73 77
       loading: false,
74 78
       finished: false,
75
-      actid: '',
79
+      actid: "",
76 80
       newpage: 1,
77 81
       toppage: 1,
78
-      show: false,
82
+      show: false
79 83
     };
80 84
   },
81 85
   components: {
82
-    toast,
86
+    toast
87
+  },
88
+  mounted() {
89
+    window.addEventListener("scroll", this.handleScroll, true);
90
+    // 监听(绑定)滚轮 滚动事件
83 91
   },
84 92
   computed: {
85 93
     ...mapactivityState({
86 94
       activity: s => s.activity || {},
87 95
       newList: x => x.list,
88 96
       topList: x => x.toplist,
89
-      user: x => x.user,
97
+      user: x => x.user
90 98
     })
91 99
   },
92 100
   created() {
93
-    this.actid = this.$route.params.actid
101
+    this.actid = this.$route.params.actid;
94 102
     this.getActivity({
95
-      actid: this.actid,
96
-    })
97
-    this.newlist()
98
-    this.toplist()
103
+      actid: this.actid
104
+    });
105
+    this.newlist();
106
+    this.toplist();
99 107
   },
100 108
   methods: {
101
-    ...mapactivityActions([
102
-      'getList',
103
-      'getTopList',
104
-      'getActivity',
105
-      'vote',
106
-    ]),
109
+    handleScroll() {
110
+      // 页面滚动距顶部距离
111
+      var scrollTop =
112
+        window.pageYOffset ||
113
+        document.documentElement.scrollTop ||
114
+        document.body.scrollTop;
115
+         window.console.log(scrollTop);
116
+         if(scrollTop>=280){
117
+          this.isOK =false;
118
+        }else {
119
+          this.isOK=true;
120
+        }
121
+
122
+      var scroll = scrollTop - this.i;
123
+      this.i = scrollTop;
124
+     
125
+      // if (scroll < 0) {
126
+      //   this.isFixed =false;
127
+      //   console.log("up");
128
+      // } else {
129
+      //    if(this.i>=280){
130
+      //     this.isFixed =true;
131
+      //   }
132
+      //   console.log("down");
133
+      // }
134
+    },
135
+
136
+    ...mapactivityActions(["getList", "getTopList", "getActivity", "vote"]),
107 137
     newlist() {
108 138
       this.getList({
109 139
         actid: this.actid,
110 140
         page: this.newpage,
111
-        q: this.q,
112
-      })
141
+        q: this.q
142
+      });
113 143
     },
114 144
     toplist() {
115 145
       this.getTopList({
116 146
         actid: this.actid,
117 147
         page: this.toppage,
118
-        q: this.q,
119
-      })
148
+        q: this.q
149
+      });
120 150
     },
121 151
     Vote(memberid) {
122 152
       this.vote({
123 153
         actid: this.actid,
124 154
         memberid: memberid,
125
-        openid: this.user,
155
+        openid: this.user
126 156
       }).then(() => {
127 157
         const newlist = this.newList.map(x => {
128 158
           if (x.MemberId == memberid) {
129
-            x.Vote = x.Vote + 1
159
+            x.Vote = x.Vote + 1;
130 160
           }
131
-          return x
132
-        })
133
-        this.newList  = newlist
161
+          return x;
162
+        });
163
+        this.newList = newlist;
134 164
         const toplist = this.topList.map(x => {
135 165
           if (x.MemberId == memberid) {
136
-            x.Vote = x.Vote + 1
166
+            x.Vote = x.Vote + 1;
137 167
           }
138
-          return x
139
-        })
140
-        this.topList = toplist
141
-      })
168
+          return x;
169
+        });
170
+        this.topList = toplist;
171
+      });
142 172
     },
143 173
     onLoad() {
144 174
       // 异步更新数据
@@ -157,24 +187,24 @@ export default {
157 187
     },
158 188
     signup() {
159 189
       this.$router.push({
160
-        path: `/vote/signup/${this.actid}`,
190
+        path: `/vote/signup/${this.actid}`
161 191
       });
162 192
     },
163 193
     gotovotingdetails(memberid) {
164 194
       this.$router.push({
165 195
         path: `/detail/${this.actid}/${memberid}`
166
-      })
196
+      });
167 197
     },
168 198
     close() {
169
-      this.show = false
199
+      this.show = false;
170 200
     },
171 201
     tolink() {
172
-      window.location.href = this.info.AfterVote
202
+      window.location.href = this.info.AfterVote;
173 203
     },
174 204
     search() {
175
-      this.newlist()
176
-      this.toplist()
177
-    },
205
+      this.newlist();
206
+      this.toplist();
207
+    }
178 208
   }
179 209
 };
180 210
 </script>
@@ -190,7 +220,7 @@ export default {
190 220
 }
191 221
 .van-tabs__wrap {
192 222
   width: 100%;
193
-  z-index: 1;
223
+  z-index: 0;
194 224
 }
195 225
 .van-tabs__nav--card .van-tab.van-tab--active {
196 226
   background-color: rgba(166, 184, 201, 1);
@@ -231,11 +261,48 @@ export default {
231 261
 
232 262
   .BannerImage {
233 263
     width: 100%;
234
-    height: 2rem;
235
-    margin-bottom: 0.2rem;
264
+    height: 3.4rem;
236 265
   }
266
+.searchb{
267
+  width: 93%;
268
+    height: 0.44rem;
269
+    background-color: rgba(201, 214, 224, 1);
270
+    border-radius: 6px;
271
+    border: 0.01rem solid rgba(255, 255, 255, 1);
272
+    display: flex;
273
+    flex-direction: row;
274
+    justify-content: space-between;
275
+    align-items: center;
276
+    position: fixed;
277
+    top: 0;
278
+    left: calc(3.1%);
237 279
 
238
-  .search {
280
+    input {
281
+      // padding: 0.11rem 1.2rem 0.11rem 0.13rem;
282
+      background-color: rgba(255, 255, 255, 0);
283
+      color: rgba(255, 255, 255, 1);
284
+      font-size: 0.16rem;
285
+      font-family: PingFangSC-Regular;
286
+      font-weight: 400;
287
+      line-height: 0.22rem;
288
+      width: 5rem;
289
+      text-indent: 0.1rem;
290
+    }
291
+    input::-webkit-input-placeholder {
292
+      color: rgba(255, 255, 255, 1);
293
+      font-size: 0.16rem;
294
+      font-family: PingFangSC-Regular;
295
+      font-weight: 400;
296
+      line-height: 0.22rem;
297
+    }
298
+    .IconSearch {
299
+      width: 0.2rem;
300
+      height: 0.2rem;
301
+      margin-right: 0.1rem;
302
+    }
303
+
304
+}
305
+  .searchs {
239 306
     width: 93%;
240 307
     height: 0.44rem;
241 308
     background-color: rgba(201, 214, 224, 1);
@@ -245,7 +312,9 @@ export default {
245 312
     flex-direction: row;
246 313
     justify-content: space-between;
247 314
     align-items: center;
248
-    margin-bottom: 0.19rem;
315
+    position: absolute;
316
+    top: 2.8rem;
317
+    left: calc(3.1%);
249 318
 
250 319
     input {
251 320
       // padding: 0.11rem 1.2rem 0.11rem 0.13rem;
@@ -270,20 +339,17 @@ export default {
270 339
       width: 0.2rem;
271 340
       height: 0.2rem;
272 341
       margin-right: 0.1rem;
273
-      //   font-size: 0.3rem !important;
274
-      //   color: rgba(255, 255, 255, 1) !important;
275
-      //   padding-right: 0.1rem;
276 342
     }
277 343
   }
278 344
   .informationimg {
279 345
     width: 97%;
280 346
     height: 6.24rem;
281
-    margin: 0 0.1rem 0.35rem 0;
282 347
   }
283 348
 
284 349
   .box {
285 350
     width: 89%;
286 351
     height: 0.12rem;
352
+    margin-top: 0.35rem;
287 353
     background-color: rgba(255, 255, 255, 0.29);
288 354
     border-radius: 0.06rem 0.06rem 0 0;
289 355
   }
@@ -403,7 +469,9 @@ export default {
403 469
     font-weight: bold;
404 470
     color: rgba(255, 255, 255, 1);
405 471
     line-height: 0.28rem;
406
-    margin-bottom: 0.19rem;
472
+    position: fixed;
473
+    bottom: 0.19rem;
474
+    left: calc(4.25%);
407 475
   }
408 476
 }
409 477
 </style>

+ 4
- 3
src/views/vote/signup.vue Zobrazit soubor

@@ -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%;

+ 2
- 1
vue.config.js Zobrazit soubor

@@ -7,7 +7,8 @@ module.exports = {
7 7
     proxy: {
8 8
       '/api': {
9 9
         // target: 'http://wechatconfigdev.ycjcjy.com',
10
-        target: 'http://192.168.0.62:8080', // wf
10
+        // target: 'http://192.168.0.62:8080', // wf
11
+        target: 'http://192.168.0.11:8080', // wf
11 12
         // target: 'http://192.168.0.102:8080', // hyq
12 13
         // target: 'http://192.168.0.11', // zys
13 14
         // target: 'http://dev.ycjcjy.com', // frp