my-card.js
1.06 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
import {
getBindtapData
} from '../../utils/util';
let app = getApp();
Page({
data: {
prizeInfo: []
},
onShareAppMessage() {},
onLoad(options) {
this.initData();
},
initData() {
app.post({
url: app.api.fishPrize,
data: {}
}).then((result) => {
let prizeInfo = result;
prizeInfo.forEach(element => {
element.endDateStr = new Date(element.endDate).toString("yy-MM-dd");
});
this.setData({
prizeInfo: prizeInfo
})
console.log("prizeInfo:", this.data.prizeInfo);
})
},
/**
* 显示券的详情
*/
onShowDetailHandler(evt) {
let curData = getBindtapData(evt);
app.globalData.curCoupon = curData;
// app.globalData.giftData = curData;
app.router.push({
path: "couponDetail"
})
console.log("curData:", curData);
console.log(JSON.stringify(curData));
},
// 子组件事件
evtcomp(evt) {
let {
name,
data
} = evt.detail;
switch (name) {
case "_evt_hide":
break;
default:
break;
}
},
})