feat(coupon): 添加优惠券领取中心功能

- 新增优惠券领取中心页面,包含热门优惠券轮播、优惠券列表、筛选功能等
- 实现优惠券数据加载、搜索、下拉刷新、加载更多等功能
- 添加优惠券领取逻辑,支持用户领取优惠券
- 优化邀请小程序码生成和分享功能
-调整首页和用户订单组件的样式
This commit is contained in:
2025-08-22 11:46:12 +08:00
parent 40e282cf8f
commit 46761bdacd
14 changed files with 695 additions and 162 deletions

View File

@@ -99,3 +99,17 @@ export async function getShopCoupon(id: number) {
}
return Promise.reject(new Error(res.message));
}
/**
* 领取优惠券
*/
export async function receiveCoupon(params: { couponId: number; userId: number }) {
const res = await request.post<ApiResult<unknown>>(
'/shop/shop-coupon/receive',
params
);
if (res.code === 0) {
return res.message;
}
return Promise.reject(new Error(res.message));
}