refactor: 优化促销商品列表和电子卡券逻辑

- 更新促销商品列表组件,简化商品详情页跳转逻辑
- 移除不必要的礼品卡相关状态管理,确保电子卡券逻辑的清晰性
- 调整 utils/goodsType.js 中的卡密处理函数,专注于当前订单的卡密履约行
- 优化订单详情页的卡密展示逻辑,确保信息准确性
This commit is contained in:
田香琪
2026-08-05 13:48:21 +08:00
parent 370c63afcd
commit eb40916cf7
4 changed files with 165 additions and 193 deletions

View File

@@ -312,19 +312,16 @@ const cancelList = ref<any[]>([])
const rogShow = ref(false)
const reason = ref('')
const orderPackage = ref<any>('')
const giftECouponOrders = ref<any[]>([])
// orderType=E_COUPON无物流/核销码,卡密见 cardKeyDetailAPI-B-01 orderItems[].cardKeys
// orderType=E_COUPON无物流/核销码;卡密见 cardKeyDetail仅本单 orderItems不含满赠子单
const isECouponOrder = computed(() => checkECouponOrder(order.value?.orderType))
const isNonPhysicalOrder = computed(() => checkNonPhysicalOrder(order.value?.orderType))
const ecouponCardKeyDelivered = computed(() =>
orderHasCardKeyContent(orderGoodsList.value, giftECouponOrders.value)
orderHasCardKeyContent(orderGoodsList.value)
)
const ecouponPendingMessage = computed(() => {
const pending = collectCardKeyFulfillLines(
orderGoodsList.value,
giftECouponOrders.value
).find((line) => line.status !== CARD_KEY_FULFILL_STATUS.DELIVERED)
const pending = collectCardKeyFulfillLines(orderGoodsList.value).find(
(line) => line.status !== CARD_KEY_FULFILL_STATUS.DELIVERED
)
return pending ? resolveCardKeyFulfillMessage(pending) : ''
})
@@ -412,7 +409,6 @@ function loadData(orderSnParam: string) {
order.value = result.order
orderGoodsList.value = result.orderItems
orderDetail.value = result
giftECouponOrders.value = result.giftECouponOrders || []
if (
result.order.deliveryMethod === 'LOGISTICS' &&
!checkECouponOrder(result.order.orderType) &&