Showing
1 changed file
with
5 additions
and
3 deletions
| @@ -60,10 +60,10 @@ Page({ | @@ -60,10 +60,10 @@ Page({ | ||
| 60 | }, | 60 | }, |
| 61 | // 提交订单(免费券) | 61 | // 提交订单(免费券) |
| 62 | submitOrder: util.throttle(function () { | 62 | submitOrder: util.throttle(function () { |
| 63 | - let eTime = this.data.detail.useEtime ? new Date(this.data.detail.useEtime).getTime()/1000 : '0'; | ||
| 64 | - if (this.data.detail.aexpiration && this.data.detail.aexpiration.valid_forever != '1' && (this.data.dataStr > eTime )) { | 63 | + let info = this.data.detail.expiration_date |
| 64 | + if (info && info.valid_forever != '1' && (this.data.dataStr < info.stime || this.data.dataStr > info.etime)) { | ||
| 65 | return wx.showToast({ | 65 | return wx.showToast({ |
| 66 | - title: '优惠券已过期,不可购买!', | 66 | + title: '优惠券不在领取时间内!', |
| 67 | duration: 2000, | 67 | duration: 2000, |
| 68 | mask: true, | 68 | mask: true, |
| 69 | icon: 'none' | 69 | icon: 'none' |
| @@ -220,6 +220,8 @@ Page({ | @@ -220,6 +220,8 @@ Page({ | ||
| 220 | detail.arule = detail.arule ? util.determine(detail.arule) : ''; | 220 | detail.arule = detail.arule ? util.determine(detail.arule) : ''; |
| 221 | detail.use = detail.use ? util.determine(detail.use) : ''; | 221 | detail.use = detail.use ? util.determine(detail.use) : ''; |
| 222 | detail.exp_date = exp_date; | 222 | detail.exp_date = exp_date; |
| 223 | + // expiration_date 券可领取时间 | ||
| 224 | + // aexpiration 券使用时间 | ||
| 223 | detail.expiration_date = detail.expiration_date ? util.determine(detail.expiration_date) : ''; | 225 | detail.expiration_date = detail.expiration_date ? util.determine(detail.expiration_date) : ''; |
| 224 | detail.aexpiration = detail.aexpiration ? util.determine(detail.aexpiration) : ''; | 226 | detail.aexpiration = detail.aexpiration ? util.determine(detail.aexpiration) : ''; |
| 225 | detail.cdate = detail.cdate * 1; | 227 | detail.cdate = detail.cdate * 1; |
-
Please register or login to post a comment