refactor(礼品卡): 优化礼品卡相关功能和界面
- 修改 API 基础 URL以适应开发环境 - 移除未使用的 StoreCell 组件- 在 ShopGift 模型中添加核销时间字段 -调整 GiftCard 组件样式和布局 - 更新 goodsDetail 页面中的规格选择逻辑 - 优化 gift 组件中的有效期和类型显示 - 在 redeemGift 中添加礼品卡核销时间 - 重构 storeVerification 组件逻辑,优化核销流程
This commit is contained in:
@@ -82,7 +82,7 @@ const GoodsDetail = () => {
|
||||
};
|
||||
|
||||
// 规格选择确认回调
|
||||
const handleSpecConfirm = (sku: ShopGoodsSku, quantity: number, action: 'cart' | 'buy') => {
|
||||
const handleSpecConfirm = (sku: ShopGoodsSku, quantity: number, action?: 'cart' | 'buy') => {
|
||||
// setSelectedSku(sku);
|
||||
setShowSpecSelector(false);
|
||||
|
||||
@@ -96,7 +96,7 @@ const GoodsDetail = () => {
|
||||
image: goods!.image || '',
|
||||
specInfo: sku.sku, // sku字段包含规格信息
|
||||
}, quantity);
|
||||
} else {
|
||||
} else if (action === 'buy') {
|
||||
// 立即购买
|
||||
const orderData = {
|
||||
goodsId: goods!.goodsId!,
|
||||
@@ -105,6 +105,15 @@ const GoodsDetail = () => {
|
||||
price: sku.price || goods!.price || '0'
|
||||
};
|
||||
navTo(`/shop/orderConfirm/index?orderData=${encodeURIComponent(JSON.stringify(orderData))}`, true);
|
||||
} else {
|
||||
// 默认情况:如果action未定义,默认为立即购买
|
||||
const orderData = {
|
||||
goodsId: goods!.goodsId!,
|
||||
skuId: sku.id,
|
||||
quantity,
|
||||
price: sku.price || goods!.price || '0'
|
||||
};
|
||||
navTo(`/shop/orderConfirm/index?orderData=${encodeURIComponent(JSON.stringify(orderData))}`, true);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user