|
@@ -19,6 +19,7 @@ Page({ |
|
@@ -19,6 +19,7 @@ Page({ |
|
19
|
},
|
19
|
},
|
|
20
|
sid: '', //扫码进入带的参数商家id
|
20
|
sid: '', //扫码进入带的参数商家id
|
|
21
|
couponModal: '',
|
21
|
couponModal: '',
|
|
|
|
22
|
+ myToast:'',
|
|
22
|
/**
|
23
|
/**
|
|
23
|
* 生命周期函数--监听页面加载
|
24
|
* 生命周期函数--监听页面加载
|
|
24
|
*/
|
25
|
*/
|
|
@@ -88,10 +89,10 @@ Page({ |
|
@@ -88,10 +89,10 @@ Page({ |
|
88
|
}
|
89
|
}
|
|
89
|
date.setHours(0, 0, 0, 0);
|
90
|
date.setHours(0, 0, 0, 0);
|
|
90
|
let newTimestamp = Math.floor(date.getTime() / 1000);
|
91
|
let newTimestamp = Math.floor(date.getTime() / 1000);
|
|
91
|
- cdateText = util.unixtoTime(newTimestamp, 'YYYY-MM-DD HH:II')
|
92
|
+ cdateText = util.unixtoTime(newTimestamp, 'YYYY-MM-DD')
|
|
92
|
detail.cdateText = cdateText;
|
93
|
detail.cdateText = cdateText;
|
|
93
|
if (detail.aexpiration == '0' || detail.aexpiration == '') {
|
94
|
if (detail.aexpiration == '0' || detail.aexpiration == '') {
|
|
94
|
- edateText = util.unixtoTime(detail.etime, 'YYYY-MM-DD HH:II')
|
95
|
+ edateText = util.unixtoTime(detail.etime, 'YYYY-MM-DD')
|
|
95
|
detail.deadlineDate = detail.etime
|
96
|
detail.deadlineDate = detail.etime
|
|
96
|
} else {
|
97
|
} else {
|
|
97
|
let time = new Date(detail.cdate * 1000);
|
98
|
let time = new Date(detail.cdate * 1000);
|
|
@@ -99,7 +100,7 @@ Page({ |
|
@@ -99,7 +100,7 @@ Page({ |
|
99
|
time.setHours(23, 59, 0, 0);
|
100
|
time.setHours(23, 59, 0, 0);
|
|
100
|
let deadlineDate = Math.floor(time.getTime() / 1000);
|
101
|
let deadlineDate = Math.floor(time.getTime() / 1000);
|
|
101
|
detail.deadlineDate = deadlineDate
|
102
|
detail.deadlineDate = deadlineDate
|
|
102
|
- edateText = util.unixtoTime(deadlineDate, 'YYYY-MM-DD HH:II')
|
103
|
+ edateText = util.unixtoTime(deadlineDate, 'YYYY-MM-DD')
|
|
103
|
}
|
104
|
}
|
|
104
|
detail.endDateStr = cdateText + '至' + edateText
|
105
|
detail.endDateStr = cdateText + '至' + edateText
|
|
105
|
})
|
106
|
})
|
|
@@ -231,7 +232,7 @@ Page({ |
|
@@ -231,7 +232,7 @@ Page({ |
|
231
|
})
|
232
|
})
|
|
232
|
},
|
233
|
},
|
|
233
|
// 付款
|
234
|
// 付款
|
|
234
|
- confirmPayment() {
|
235
|
+ confirmPayment: util.throttle(function () {
|
|
235
|
let that = this;
|
236
|
let that = this;
|
|
236
|
let actualPrice = this.data.actualPrice
|
237
|
let actualPrice = this.data.actualPrice
|
|
237
|
if (actualPrice <= 0) {
|
238
|
if (actualPrice <= 0) {
|
|
@@ -270,30 +271,19 @@ Page({ |
|
@@ -270,30 +271,19 @@ Page({ |
|
270
|
})
|
271
|
})
|
|
271
|
that.getCoupon()
|
272
|
that.getCoupon()
|
|
272
|
console.log('支付成功', ress);
|
273
|
console.log('支付成功', ress);
|
|
273
|
- return wx.showToast({
|
|
|
|
274
|
- title: '支付成功',
|
|
|
|
275
|
- duration: 1000,
|
|
|
|
276
|
- icon: 'none',
|
|
|
|
277
|
- })
|
274
|
+ return that.myToast.showToast('支付成功', 2000)
|
|
278
|
}
|
275
|
}
|
|
279
|
console.log('支付失败', ress);
|
276
|
console.log('支付失败', ress);
|
|
280
|
- wx.showToast({
|
|
|
|
281
|
- title: '支付失败,请重新下单',
|
|
|
|
282
|
- duration: 1000,
|
|
|
|
283
|
- })
|
277
|
+ return that.myToast.showToast('支付失败,请重新下单', 2000)
|
|
284
|
},
|
278
|
},
|
|
285
|
fail(ress) {
|
279
|
fail(ress) {
|
|
286
|
console.log('支付失败', ress);
|
280
|
console.log('支付失败', ress);
|
|
287
|
- wx.showToast({
|
|
|
|
288
|
- title: '支付失败,请重新下单',
|
|
|
|
289
|
- duration: 1000,
|
|
|
|
290
|
- icon: 'none',
|
|
|
|
291
|
- })
|
281
|
+ return that.myToast.showToast('支付失败,请重新下单', 2000)
|
|
292
|
},
|
282
|
},
|
|
293
|
})
|
283
|
})
|
|
294
|
}
|
284
|
}
|
|
295
|
})
|
285
|
})
|
|
296
|
- },
|
286
|
+ },3000),
|
|
297
|
// 核销所勾选的券
|
287
|
// 核销所勾选的券
|
|
298
|
writeOff() {
|
288
|
writeOff() {
|
|
299
|
console.log('勾选的券', this.data.finalList);
|
289
|
console.log('勾选的券', this.data.finalList);
|
|
@@ -715,7 +705,7 @@ Page({ |
|
@@ -715,7 +705,7 @@ Page({ |
|
715
|
* 生命周期函数--监听页面初次渲染完成
|
705
|
* 生命周期函数--监听页面初次渲染完成
|
|
716
|
*/
|
706
|
*/
|
|
717
|
onReady() {
|
707
|
onReady() {
|
|
718
|
-
|
708
|
+ this.myToast = this.selectComponent("#myToast")
|
|
719
|
},
|
709
|
},
|
|
720
|
|
710
|
|
|
721
|
/**
|
711
|
/**
|