coupons.js
3.71 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
import api from '../request/http'
module.exports = {
/**获取卡券列表 */
getCardData(data) {
return api.post({
method: `scrm.api.coupon.app.list`,
...data
// discountTypes: [3, 7]
})
},
/**获取卡券数量 */
getCouponNum() {
return api.post({
method: 'scrm.api.coupon.list.by.account.id',
useMemberType: 0
})
},
// 门店发现商城优惠券列表
getMerchantCouponsListApi(data) {
return api.post({
method: `scrm.api.coupon.discover.goods.list`,
...data
})
},
/**获取首页可以领取的券 */
getHomeCardData(data) {
let {
merchantId
} = wx.p.storage.get('merchant_info')
if (merchantId) {
merchantId = Number(JSON.parse(merchantId))
data.merchantId = merchantId
}
return api.post({
method: `scrm.api.coupon.list.merchant.account`,
...data
})
},
/**领取优惠券 */
toReciveCard(data) {
let {
merchantId
} = wx.p.storage.get('merchant_info')
if (merchantId) {
merchantId = Number(JSON.parse(merchantId))
data.merchantId = merchantId
}
return api.post({
method: `scrm.api.coupon.customer.receive`,
...data,
receiveWay: 1,
receiveSource: 3
})
},
/**卡券详情 */
couponsDetail(data) {
return api.post({
method: `scrm.api.coupon.verification.code.detail`,
...data
})
},
/**免费领取体验卡 */
tolqFreecard(data) {
return api.post({
method: `scrm.api.equity.h5.free.card.receive`,
...data
},
true
)
},
/**获取体验卡天数 */
getFreeCardDay(data) {
return api.post({
method: `scrm.api.equity.class.free.day.get`,
...data
})
},
/** 获取企微分享优惠卷信息 */
getCouponInfo(data) {
return api.post({
method: `scrm.api.coupon.share.info`,
...data
})
},
/**领取优惠券 */
receiveCoupon(data) {
return api.post({
method: `scrm.api.coupon.share.receive`,
...data,
receiveSource: 4
},
true
)
},
/**获取套餐详情(权益) */
packageInfo(data) {
return api.post({
method: `scrm.api.equity.main.page.package.detail.get`,
...data
})
},
/**获取门店单号(权益) */
createOrderNum(data) {
return api.post({
method: `scrm.api.equity.merchant.order.code.create`,
...data
})
},
/**创建门店订单(权益) */
createOrder(data) {
return api.post({
method: `scrm.api.equity.merchant.order.create`,
...data
})
},
/**获取折扣券 兑换券详情 */
getWWCoupon(data) {
return api.post({
method: `scrm.api.coupon.verification.code.detail`,
...data
})
},
/** 检查是否领取优惠券 */
checkCoupon(data) {
return api.post({
method: `scrm.api.coupon.share.receive.check`,
...data
})
},
// 定向礼包详情
giftsDetail(data) {
return api.post({
method: `scrm.api.coupon.directional.gift.detail`,
...data
})
},
// 定向礼包领取
giftsRecive(data) {
return api.post({
method: `scrm.api.coupon.user.directional.gift.create`,
...data
})
},
// 获取优惠券详情--道路救援
getDigitalCoupons(data) {
return api.post({
method: `scrm.api.coupon.detail`,
...data
})
},
// 领取发现模块的优惠券
toReciveDiscoverCard(data) {
let {
merchantId
} = wx.p.storage.get('merchant_info')
if (merchantId) {
merchantId = Number(JSON.parse(merchantId))
data.merchantId = merchantId
}
return api.post({
method: `scrm.api.coupon.customer.receive`,
...data,
receiveWay: 9,
receiveSource: 3
})
},
}