陈冉 6 yıl önce
ebeveyn
işleme
643906dae2

+ 1
- 2
src/App.vue Dosyayı Görüntüle

@@ -37,7 +37,6 @@ export default {
37 37
   created() {
38 38
     const env = process.env.NODE_ENV || 'production'
39 39
     console.log("process.env.NODE_ENV =>", env)
40
-
41 40
     if (env === 'production' || env === 'test') {
42 41
       if (location.search && this.toolClass.UrlSearch(location.search).code) {
43 42
         this.code = this.toolClass.UrlSearch(location.search).code
@@ -56,7 +55,7 @@ export default {
56 55
         this.toolClass.getCode(this.appid[env])
57 56
       }
58 57
     } else {
59
-      this.showPage = true
58
+       this.showPage = true
60 59
     }
61 60
   },
62 61
   methods: {

+ 2
- 1
src/util/util.js Dosyayı Görüntüle

@@ -41,7 +41,8 @@ const toolClass = {
41 41
   },
42 42
   getCode: (appid) => {
43 43
     wechatConfig.appid = appid
44
-    let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(window.location.href)}&response_type=${wechatConfig.response_type}&scope=${wechatConfig.scope}&state=${wechatConfig.state}#wechat_redirect`
44
+    const refer = window.encodeURIComponent(window.location.href.replace(/code=[^?&=]+/, '').replace(/state=[^?&=]+/, '').replace('?&', '?'))
45
+    let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${refer}&response_type=${wechatConfig.response_type}&scope=${wechatConfig.scope}&state=${wechatConfig.state}#wechat_redirect`
45 46
     window.location.href = url
46 47
   },
47 48
   upload (item) {

+ 1
- 1
src/views/vote/detail.vue Dosyayı Görüntüle

@@ -49,7 +49,7 @@ export default {
49 49
   components: {
50 50
     toast,
51 51
   },
52
-  mounted() {
52
+  created() {
53 53
     this.actid = this.$route.params.actid;
54 54
     this.memberid = this.$route.params.memberid;
55 55
     this.getActivity({

+ 38
- 15
src/views/vote/list.vue Dosyayı Görüntüle

@@ -93,6 +93,7 @@ import wxsdk from "../../util/share.js";
93 93
 import toast from "../../components/toast.vue";
94 94
 // import BgImg from "../../assets/bgimg.jpg";
95 95
 // import BgImage from "../../assets/yttjbg.png";
96
+import { Toast } from 'vant';
96 97
 
97 98
 const {
98 99
   mapState: mapactivityState,
@@ -260,21 +261,21 @@ export default {
260 261
     },
261 262
     Vote(memberid) {
262 263
       // this.$dialog.confirm({ message: "确定投票给当前用户?" }).then(() => {
263
-      this.vote({
264
-        actid: this.actid,
265
-        memberid: memberid,
266
-        openid: this.user
267
-      }).then(() => {
268
-        if (this.activity.AfterVote) {
269
-          this.$dialog
270
-            .alert({ title: "投票成功", message: "恭喜您获得一次抽奖机会!" })
271
-            .then(() => {
272
-              window.location.href = this.activity.AfterVote;
273
-            });
274
-        } else {
275
-          this.$dialog.alert({ message: "投票成功" });
276
-        }
277
-      });
264
+        this.vote({
265
+          actid: this.actid,
266
+          memberid: memberid,
267
+          openid: this.user
268
+        }).then(() => {
269
+          if (this.activity.AfterVote) {
270
+            this.$dialog
271
+              .alert({ title: "投票成功", message: "恭喜您获得一次抽奖机会!" })
272
+              .then(() => {
273
+                window.location.href = this.activity.AfterVote;
274
+              });
275
+          } else {
276
+            this.$dialog.alert({ message: "投票成功" });
277
+          }
278
+        });
278 279
       // });
279 280
     },
280 281
     loadNewList(loaded) {
@@ -320,6 +321,28 @@ export default {
320 321
           path: `/detail/${this.actid}/${this.myID}`
321 322
         });
322 323
       } else {
324
+        var myDate = (new Date()).valueOf();
325
+        var begintime = (new Date(this.activity.StartTime)).valueOf()
326
+        var endtime = (new Date(this.activity.EndTime)).valueOf()
327
+        // console.log(begintime)
328
+        // console.log(endtime)
329
+        // console.log(myDate)
330
+        if(begintime > myDate){
331
+          Toast.fail({
332
+            duration: 2000, // 持续展示 toast
333
+            forbidClick: true, // 禁用背景点击
334
+            message: "活动未开始!"
335
+          })
336
+          return false
337
+        }
338
+        if(endtime < myDate){
339
+          Toast.fail({
340
+            duration: 2000, // 持续展示 toast
341
+            forbidClick: true, // 禁用背景点击
342
+            message: "活动已结束!"
343
+          })
344
+          return false
345
+        }
323 346
         this.$router.push({
324 347
           path: `/vote/signup/${this.actid}`
325 348
         });

+ 22
- 5
src/views/vote/signup.vue Dosyayı Görüntüle

@@ -147,15 +147,16 @@ export default {
147 147
         });
148 148
         return false;
149 149
       }
150
-      if (this.postData.name == "") {
150
+      if(this.theme === 1 && this.postData.message == '') {
151 151
         Toast.fail({
152 152
           duration: 2000, // 持续展示 toast
153 153
           forbidClick: true, // 禁用背景点击
154
-          message: "请输入您的姓名!"
155
-        });
156
-        return false;
154
+          message: "请先输入寄语!"
155
+        })
156
+        return false
157 157
       }
158
-      if (this.postData.phone == "") {
158
+
159
+      if(this.postData.phone == ""){
159 160
         Toast.fail({
160 161
           duration: 2000, // 持续展示 toast
161 162
           forbidClick: true, // 禁用背景点击
@@ -172,6 +173,22 @@ export default {
172 173
         });
173 174
         return false;
174 175
       }
176
+      if(this.postData.name == ""){
177
+        Toast.fail({
178
+          duration: 2000, // 持续展示 toast
179
+          forbidClick: true, // 禁用背景点击
180
+          message: "请输入您的姓名!"
181
+        })
182
+        return false
183
+      }
184
+      if(this.theme === 2 && this.postData.addr == '') {
185
+        Toast.fail({
186
+          duration: 2000, // 持续展示 toast
187
+          forbidClick: true, // 禁用背景点击
188
+          message: "请输入您的所在社区!"
189
+        })
190
+        return false
191
+      }
175 192
 
176 193
       this.voteMember({
177 194
         actid: this.actid,

+ 4
- 0
vue.config.js Dosyayı Görüntüle

@@ -7,7 +7,11 @@ module.exports = {
7 7
     proxy: {
8 8
       '/voteapi': {
9 9
         // target: 'http://wechatconfigdev.ycjcjy.com',
10
+<<<<<<< HEAD
10 11
         target: 'http://192.168.0.62:8080', // wf
12
+=======
13
+        target: 'http://localhost:8080', // wf
14
+>>>>>>> 83865c56adef1f6c6aea63317940c0a221574425
11 15
         // target: 'http://192.168.0.102:8080', // hyq
12 16
         // target: 'http://192.168.0.11:8080', // zys
13 17
         // target: 'http://dev.ycjcjy.com', // frp