goodsCouponApi.js
3.31 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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
import { other_http } from '@/main'
const url = 'rop-scrm-coupon/router'
const defaultPath = 'scrm.api.coupon.'
/**商品分页查询*/
const getCouponsList = params => {
params.method = `${defaultPath}equity.list.merchant`
return other_http({
url,
data: params
})
}
const createCoupons = params => {
params.method = `${defaultPath}equity.batch.create`
return other_http({
url,
data: params
})
}
const getExportApi = params => {
params.method = `${defaultPath}equity.list.merchant.export`
return other_http({
url,
data: params,
sign: true
})
}
//领取记录列表
const getListReceiveRecordApi = params => {
params.method = `${defaultPath}listReceiveRecordByCouponId`
return other_http({
url,
method: 'GET',
data: params,
sign: true
})
}
//查看优惠券
const getCouponDetailApi = params => {
params.method = `${defaultPath}detail`
return other_http({
url,
method: 'GET',
data: params,
sign: true
})
}
//删除
const deleteCouponApi = params => {
params.method = `${defaultPath}delete`
return other_http({
url,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 优惠券-作废
const couponUserCancelApi = params => {
params.method = `${defaultPath}user.cancel`
return other_http({
url,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const detailExportApi = params => {
params.method = `${defaultPath}equity.exportReceiveRecord`
return other_http({
url,
data: params,
sign: true
})
}
//生效/失效
const effectiveCouponApi = params => {
params.method = `${defaultPath}effective`
return other_http({
url,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 获取模板配置
const getTemplateList = params => {
params.method = `${defaultPath}template.page`
return other_http({
url,
method: 'POST',
data: params,
sign: true
})
}
// 获取模板配置
const saveTemplate = params => {
params.method = `${defaultPath}template.save`
return other_http({
url,
method: 'POST',
data: params,
sign: true
})
}
// 保存模板下的优惠券
const saveCouponInfo = params => {
params.method = `${defaultPath}template.details.save`
return other_http({
url,
method: 'POST',
data: params,
sign: true
})
}
// 获取模板下的优惠券列表
const getCouponById = params => {
if(!params.templateId) {
return new Promise((resolve, reject)=>{
reject()
})
};
params.method = `${defaultPath}template.details.page`
return other_http({
url,
method: 'POST',
data: params,
sign: true
})
}
const delCouponById = params => {
params.method = `${defaultPath}template.details.delete`
return other_http({
url,
method: 'POST',
data: params,
sign: true
})
}
const delTemplateById = params => {
params.method = `${defaultPath}template.delete`
return other_http({
url,
method: 'POST',
data: params,
sign: true
})
}
export default {
getCouponsList,
createCoupons,
getExportApi,
getListReceiveRecordApi,
getCouponDetailApi,
deleteCouponApi,
couponUserCancelApi,
detailExportApi,
effectiveCouponApi,
getTemplateList,
saveTemplate,
saveCouponInfo,
getCouponById,
delCouponById,
delTemplateById
}