coupon.js
2.74 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
import request from '@/sheep/request';
const CouponApi = {
// 获取可使用的优惠券
getCouponList: (data) => {
return request({
url: '/app/coupon/available',
method: 'GET',
params: {
...data,
},
});
},
// 获取我的优惠券列表
getMyCouponList: (couponType) => {
return request({
url: '/app/coupon/my-list',
method: 'POST',
params: {
couponType,
},
});
},
// 获取我的优惠券使用记录
getMyCouponRecordList: (status) => {
return request({
url: '/app/coupon/used-list',
method: 'POST',
params: {
status,
},
});
},
// // 获得优惠劵模板列表
// getCouponTemplateListByIds: (ids) => {
// return request({
// url: '/promotion/coupon-template/list-by-ids',
// method: 'GET',
// params: { ids },
// custom: {
// showLoading: false, // 不展示 Loading,避免领取优惠劵时,不成功提示
// showError: false,
// },
// });
// },
// // 获得优惠劵模版列表
// getCouponTemplateList: (spuId, productScope, count) => {
// return request({
// url: '/promotion/coupon-template/list',
// method: 'GET',
// params: { spuId, productScope, count },
// });
// },
// // 获得优惠劵模版分页
// getCouponTemplatePage: (params) => {
// return request({
// url: '/promotion/coupon-template/page',
// method: 'GET',
// params,
// });
// },
// // 获得优惠劵模版
// getCouponTemplate: (id) => {
// return request({
// url: '/promotion/coupon-template/get',
// method: 'GET',
// params: { id },
// });
// },
// // 我的优惠劵列表
// getCouponPage: (params) => {
// return request({
// url: '/promotion/coupon/page',
// method: 'GET',
// params,
// });
// },
// // 领取优惠券
// takeCoupon: (templateId) => {
// return request({
// url: '/promotion/coupon/take',
// method: 'POST',
// data: { templateId },
// custom: {
// auth: true,
// showLoading: true,
// loadingMsg: '领取中',
// showSuccess: true,
// successMsg: '领取成功',
// },
// });
// },
// // 获得优惠劵
// getCoupon: (id) => {
// return request({
// url: '/promotion/coupon/get',
// method: 'GET',
// params: { id },
// });
// },
// // 获得未使用的优惠劵数量
// getUnusedCouponCount: () => {
// return request({
// url: '/promotion/coupon/get-unused-count',
// method: 'GET',
// custom: {
// showLoading: false,
// auth: true,
// },
// });
// },
};
export default CouponApi;