feat: 增加礼品卡选择功能及相关逻辑

- 在 api/trade.js 中新增 selectGiftCard 函数以支持礼品卡选择
- 更新多个组件以集成礼品卡功能,包括购物车和订单页面
- 优化商品页面和订单详情展示,支持礼品卡抵扣信息
- 调整相关逻辑以确保礼品卡与其他促销活动的兼容性
This commit is contained in:
田香琪
2026-08-02 13:49:02 +08:00
parent a6ba2b3dbe
commit 94e846af6c
10 changed files with 246 additions and 62 deletions

View File

@@ -169,6 +169,20 @@ export function setAddressId(addressId,way) {
}
/**
* 选择礼品卡
* @param way 购物车购买CART/立即购买BUY_NOW/拼团PINTUAN / 积分POINTS / 砍价KANJIA
* @param credentialId 礼品卡凭证 idused=false 且不传则清空全部
*/
export function selectGiftCard(params) {
return http.request({
url: `/trade/carts/select/giftCard`,
method: Method.GET,
needToken: true,
params,
});
}
/**
* 创建交易
*/