2023-12-13 03:35:02 +00:00
|
|
|
import request from '@/sheep/request';
|
|
|
|
|
2023-12-16 02:40:04 +00:00
|
|
|
const CouponApi = {
|
2023-12-13 03:35:02 +00:00
|
|
|
// 获得优惠劵模板列表
|
|
|
|
getCouponTemplateListByIds: (ids) => {
|
|
|
|
return request({
|
|
|
|
url: '/app-api/promotion/coupon-template/list-by-ids',
|
|
|
|
method: 'GET',
|
|
|
|
params: { ids },
|
|
|
|
});
|
|
|
|
},
|
|
|
|
// 获得优惠劵模版列表
|
|
|
|
getCouponTemplateList: (spuId, productScope, count) => {
|
|
|
|
return request({
|
|
|
|
url: '/app-api/promotion/coupon-template/list',
|
|
|
|
method: 'GET',
|
|
|
|
params: { spuId, productScope, count },
|
|
|
|
});
|
|
|
|
},
|
2023-12-16 02:40:04 +00:00
|
|
|
// 获得优惠劵模版分页
|
|
|
|
getCouponTemplatePage: (params) => {
|
|
|
|
return request({
|
|
|
|
url: '/app-api/promotion/coupon-template/page',
|
|
|
|
method: 'GET',
|
|
|
|
params,
|
|
|
|
});
|
|
|
|
},
|
2023-12-16 04:46:11 +00:00
|
|
|
// 获得优惠劵模版
|
|
|
|
getCouponTemplate: (id) => {
|
|
|
|
return request({
|
|
|
|
url: '/app-api/promotion/coupon-template/get',
|
|
|
|
method: 'GET',
|
|
|
|
params: { id },
|
|
|
|
});
|
|
|
|
},
|
2023-12-16 02:40:04 +00:00
|
|
|
// 我的优惠劵列表
|
|
|
|
getCouponPage: (params) => {
|
|
|
|
return request({
|
|
|
|
url: '/app-api/promotion/coupon/page',
|
|
|
|
method: 'GET',
|
|
|
|
params,
|
|
|
|
});
|
|
|
|
},
|
|
|
|
// 领取优惠券
|
|
|
|
takeCoupon: (templateId) => {
|
|
|
|
return request({
|
|
|
|
url: '/app-api/promotion/coupon/take',
|
|
|
|
method: 'POST',
|
|
|
|
data: { templateId },
|
|
|
|
});
|
|
|
|
},
|
2023-12-16 04:46:11 +00:00
|
|
|
// 获得优惠劵
|
|
|
|
getCoupon: (id) => {
|
|
|
|
return request({
|
|
|
|
url: '/app-api/promotion/coupon/get',
|
|
|
|
method: 'GET',
|
|
|
|
params: { id },
|
|
|
|
});
|
|
|
|
},
|
2023-12-28 14:00:07 +00:00
|
|
|
// 获得未使用的优惠劵数量
|
|
|
|
getUnusedCouponCount: () => {
|
|
|
|
return request({
|
|
|
|
url: '/app-api/promotion/coupon/get-unused-count',
|
|
|
|
method: 'GET',
|
|
|
|
custom: {
|
|
|
|
showLoading: false,
|
|
|
|
auth: true,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
2023-12-13 03:35:02 +00:00
|
|
|
};
|
2023-12-16 02:40:04 +00:00
|
|
|
|
|
|
|
export default CouponApi;
|