element.js
2.12 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import {
couponsApi
} from "../../api/api"
import {componentsMixin } from '../../mixins/index'
Component({
behaviors: [componentsMixin],
properties: {
coupons: {
type: Object,
value: {}
},
mode: {
type: String,
value: 'coupon' //coupon卡券 center领券中心
},
btnStatus: {
type: Number,
value: 0
},
useMemberType: Number,
hideBtn: Boolean,
couponStyle: String
},
data: {
// 2 折扣券,3 代金券,4 兑换券,7 服务券
},
methods: {
toRecive() {
let para = {
couponIdList: [this.data.coupons.id],
}
couponsApi.toReciveCard(para).then(res => {
if (res) {
wx.navigateTo({
url: '/packageMine/pages/coupon/success/success'
})
}
})
},
toDetail() {
let temp = JSON.stringify(this.data.coupons)
let {
discountType,
useChannel,
// id,
// receiveWay,
// scopeApplication
} = this.data.coupons
let detailInfo = 1
if (discountType == 2 || discountType == 4) {
// wx.$router.go('packageMall.coupon', {
// userCouponId: id,
// useMemberType: this.data.useMemberType,
// detailInfo,
// receiveWay,
// scopeApplication
// })
// 修改跳转方式
wx.navigateTo({
url: '/packageMall/pages/coupon/coupon?item=' + temp + '&detailInfo=' + detailInfo + '&useMemberType=' + this.data.useMemberType
})
return
}
/**线上商品代金券 */
if (discountType == 3 && useChannel == 1) {
if(this.data.useMemberType == 1) {
wx.$util.showToast('代金券已使用')
return
}
// wx.$router.go('packageMine.coupon.recommend', {
// couponInfo: this.data.coupons
// })
// 修改跳转方式
wx.navigateTo({
url: '/packageMine/pages/coupon/recommend/recommend?item=' + temp
})
return
}
wx.navigateTo({
url: '/packageMine/pages/coupon/detail/detail?item=' + temp
})
}
}
})