|
...
|
...
|
@@ -19,6 +19,7 @@ Page({ |
|
|
|
},
|
|
|
|
sid: '', //扫码进入带的参数商家id
|
|
|
|
couponModal: '',
|
|
|
|
myToast:'',
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
|
*/
|
|
...
|
...
|
@@ -88,10 +89,10 @@ Page({ |
|
|
|
}
|
|
|
|
date.setHours(0, 0, 0, 0);
|
|
|
|
let newTimestamp = Math.floor(date.getTime() / 1000);
|
|
|
|
cdateText = util.unixtoTime(newTimestamp, 'YYYY-MM-DD HH:II')
|
|
|
|
cdateText = util.unixtoTime(newTimestamp, 'YYYY-MM-DD')
|
|
|
|
detail.cdateText = cdateText;
|
|
|
|
if (detail.aexpiration == '0' || detail.aexpiration == '') {
|
|
|
|
edateText = util.unixtoTime(detail.etime, 'YYYY-MM-DD HH:II')
|
|
|
|
edateText = util.unixtoTime(detail.etime, 'YYYY-MM-DD')
|
|
|
|
detail.deadlineDate = detail.etime
|
|
|
|
} else {
|
|
|
|
let time = new Date(detail.cdate * 1000);
|
|
...
|
...
|
@@ -99,7 +100,7 @@ Page({ |
|
|
|
time.setHours(23, 59, 0, 0);
|
|
|
|
let deadlineDate = Math.floor(time.getTime() / 1000);
|
|
|
|
detail.deadlineDate = deadlineDate
|
|
|
|
edateText = util.unixtoTime(deadlineDate, 'YYYY-MM-DD HH:II')
|
|
|
|
edateText = util.unixtoTime(deadlineDate, 'YYYY-MM-DD')
|
|
|
|
}
|
|
|
|
detail.endDateStr = cdateText + '至' + edateText
|
|
|
|
})
|
|
...
|
...
|
@@ -231,7 +232,7 @@ Page({ |
|
|
|
})
|
|
|
|
},
|
|
|
|
// 付款
|
|
|
|
confirmPayment() {
|
|
|
|
confirmPayment: util.throttle(function () {
|
|
|
|
let that = this;
|
|
|
|
let actualPrice = this.data.actualPrice
|
|
|
|
if (actualPrice <= 0) {
|
|
...
|
...
|
@@ -270,30 +271,19 @@ Page({ |
|
|
|
})
|
|
|
|
that.getCoupon()
|
|
|
|
console.log('支付成功', ress);
|
|
|
|
return wx.showToast({
|
|
|
|
title: '支付成功',
|
|
|
|
duration: 1000,
|
|
|
|
icon: 'none',
|
|
|
|
})
|
|
|
|
return that.myToast.showToast('支付成功', 2000)
|
|
|
|
}
|
|
|
|
console.log('支付失败', ress);
|
|
|
|
wx.showToast({
|
|
|
|
title: '支付失败,请重新下单',
|
|
|
|
duration: 1000,
|
|
|
|
})
|
|
|
|
return that.myToast.showToast('支付失败,请重新下单', 2000)
|
|
|
|
},
|
|
|
|
fail(ress) {
|
|
|
|
console.log('支付失败', ress);
|
|
|
|
wx.showToast({
|
|
|
|
title: '支付失败,请重新下单',
|
|
|
|
duration: 1000,
|
|
|
|
icon: 'none',
|
|
|
|
})
|
|
|
|
return that.myToast.showToast('支付失败,请重新下单', 2000)
|
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},3000),
|
|
|
|
// 核销所勾选的券
|
|
|
|
writeOff() {
|
|
|
|
console.log('勾选的券', this.data.finalList);
|
|
...
|
...
|
@@ -715,7 +705,7 @@ Page({ |
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
|
*/
|
|
|
|
onReady() {
|
|
|
|
|
|
|
|
this.myToast = this.selectComponent("#myToast")
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
...
|
...
|
|