|
@@ -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
|
});
|