feat(buyer): 增强商品详情与支付逻辑

- 引入 buyerLogin 工具,优化商品详情页的链接跳转逻辑,确保未登录用户能正确重定向到登录页面
- 更新商品 SKU 详情 API,支持未登录状态下的访问
- 修改支付 API,新增 skipMessage 参数以控制支付提示信息
- 改进商品列表与支付页面的用户体验,确保更流畅的操作流程
- 规范化商品类型与库存提示,提升用户体验
This commit is contained in:
田香琪
2026-08-05 14:17:39 +08:00
parent c0b00999c5
commit d4cd6e0936
24 changed files with 700 additions and 511 deletions

View File

@@ -132,7 +132,7 @@
</template>
<div v-else style="color: #999; margin-left: 5px">未开发票</div>
</div>
<!-- 卡密信息(E_COUPON 主单或满赠子单,以 cardKeyFulfillStatus 为准 -->
<!-- 卡密信息(当前订单 orderItems满赠赠品卡密在赠品子单详情查看 -->
<div class="order-card ecoupon-card-keys" v-if="hasCardKeySection">
<h3>卡密信息</h3>
<div
@@ -140,9 +140,6 @@
:key="line.key"
class="ecoupon-fulfill-block"
>
<div v-if="cardKeyFulfillLines.length > 1" class="ecoupon-fulfill-title">
{{ line.goodsName || (line.isGift ? "满赠电子卡券" : "电子卡券") }}
</div>
<el-alert
v-if="line.status !== 'DELIVERED'"
:type="cardKeyFulfillAlertType(line.status)"
@@ -158,13 +155,6 @@
<div class="ecoupon-card-keys-pc">
<el-table border :data="lineCardKeyRows(line)" style="width: 100%">
<el-table-column type="index" label="序号" width="60" align="center" />
<el-table-column
v-if="cardKeyFulfillLines.length > 1"
prop="goodsName"
label="商品"
min-width="120"
show-overflow-tooltip
/>
<el-table-column prop="cardNo" label="卡号" min-width="140" show-overflow-tooltip />
<el-table-column prop="cardSecret" label="卡密" min-width="120" show-overflow-tooltip />
<el-table-column prop="allocatedTime" label="发卡时间" width="170" />
@@ -446,36 +436,25 @@ export default {
isNonPhysicalOrder() {
return this.isVirtualOrder || this.isECouponOrder;
},
/** 是否展示卡密区块(含满赠 E_COUPON 子单 giftECouponOrders */
/** 是否展示卡密区块(仅当前订单 orderItems */
hasCardKeySection() {
return orderHasCardKeySection({
orderItems: this.order.orderItems,
giftSummaries: this.order.giftECouponOrders,
isECouponOrder: this.isECouponOrder,
});
},
cardKeyFulfillLines() {
return collectCardKeyFulfillLines(
this.order.orderItems,
this.order.giftECouponOrders
);
return collectCardKeyFulfillLines(this.order.orderItems);
},
ecouponCardKeyRows() {
return flattenOrderCardKeys(
this.order.orderItems,
false,
this.order.giftECouponOrders
);
return flattenOrderCardKeys(this.order.orderItems, false);
},
},
methods: {
cardKeyFulfillAlertType,
resolveCardKeyFulfillMessage,
lineCardKeyRows(line) {
return (line.cardKeys || []).map((ck) => ({
...ck,
goodsName: line.goodsName,
}));
return line.cardKeys || [];
},
copyCardKey(row) {
const text = `卡号:${row.cardNo || ""}\n卡密${row.cardSecret || ""}`;
@@ -821,12 +800,6 @@ table {
border-top: 1px dashed #eee;
}
.ecoupon-fulfill-title {
font-weight: 600;
color: #333;
margin-bottom: 8px;
}
.ecoupon-card-keys-pc {
display: block;
}