coupon-detail.js
1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import {
getBindtapData
} from '../../utils/util';
import Date from '../../utils/date';
let app = getApp();
Page({
data: {
userInfo: {},
used: false, //优惠券已使用,另外的样式
couponInfo: {
"couponId": "20839",
"couponCode": "RLLL1IHG",
"rule": "RLLL1IHG",
"startDate": 1564479217000,
"endDate": 1567094399000,
"type": 4,
"name": "眼部护理体验券-7月24日",
"state": 0,
"endDateStr": "19-08-29"
}
},
onShareAppMessage() {},
onLoad(options) {
app.queryIndex().then((result) => {
let couponInfo = this.data.couponInfo;
couponInfo.startDateStr = new Date(couponInfo.startDate).toString("yyyy.MM.dd");
couponInfo.endDateStr = new Date(couponInfo.endDate).toString("yyyy.MM.dd");
this.setData({
userInfo: app.globalData.userInfo,
couponInfo: couponInfo
})
this.initData();
})
},
initData() {
// this.setData({
// couponInfo: app.globalData.curCoupon
// })
},
// 查看可用门店
onNearbyStoreHandler() {
},
// 子组件事件
evtcomp(evt) {
let {
name,
data
} = evt.detail;
switch (name) {
case "_evt_hide":
break;
default:
break;
}
},
})