docs: 更新优惠券相关文档- 新增优惠券API集成文档
- 新增优惠券卡片对齐修复文档 - 新增优惠券状态显示调试文档 - 新增优惠券组件警告修复文档- 更新用ShopInfo Hook字段迁移文档 - 更新Arguments关键字修复文档
This commit is contained in:
@@ -99,3 +99,42 @@ export async function getShopUserCoupon(id: number) {
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取我的可用优惠券
|
||||
*/
|
||||
export async function getMyAvailableCoupons() {
|
||||
const res = await request.get<ApiResult<ShopUserCoupon[]>>(
|
||||
'/shop/shop-user-coupon/my/available'
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取我的已使用优惠券
|
||||
*/
|
||||
export async function getMyUsedCoupons() {
|
||||
const res = await request.get<ApiResult<ShopUserCoupon[]>>(
|
||||
'/shop/shop-user-coupon/my/used'
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取我的已过期优惠券
|
||||
*/
|
||||
export async function getMyExpiredCoupons() {
|
||||
const res = await request.get<ApiResult<ShopUserCoupon[]>>(
|
||||
'/shop/shop-user-coupon/my/expired'
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user