coupon_detail.js
951 Bytes
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
import util from '../../utils/util';
import App from '../../utils/api';
Page({
data:{
statuslist:{
0:{
status:'待使用'
},
1:{
status:'已核销'
},
}
},
onLoad(opt){
this.opt=opt;
this.getdetail();
},
getdetail(){
App.Activity.ActivityListByOpenid({aid:this.opt.aid}).then((json)=>{
console.log(json);
if(json.ret==200){
this.setData({
couponinfo:json.data[0]
})
if(!this.data.couponinfo.qrcode){
this.getcode();
}
}
})
},
clickSeller(){
let seller_tel=this.data.couponinfo.seller_tel||this.data.couponinfo.phone
if(typeof seller_tel=='string'){
seller_tel=seller_tel.split(',')
}
this.selectComponent('#as').show({
seller_tel:seller_tel,
});
},
getcode(){
App.Activity.UseCreateQrcode({aid:this.opt.aid}).then((json)=>{
console.log(json)
if(json.ret==200){
this.setData({
'couponinfo.qrcode':json.data
})
}
})
}
})