feat(order,goods): 详情页促销模块独立拆分与实物赠品多端随单履约展示

- 详情页重构:ShowGoods.vue 价格卡片与促销卡片解耦,促销卡片独立分行展示优惠券与满额活动;
- 买家端结算页:Pay.vue 清单中直观展示随单 0 元实物赠品明细行与数量;
- 买家端订单中心:MyOrder.vue 与 OrderDetail.vue 标注【赠品】红色徽标、原价划线展示并屏蔽单独售后申请;
- 管理端与商家端后台:orderDetail.vue 商品表格与待发货弹窗中醒目标注【赠品】及满赠活动类型。
This commit is contained in:
pikachu1995@126.com
2026-11-10 15:20:26 +08:00
parent f33c969d1e
commit 9761479c82
6 changed files with 826 additions and 145 deletions

View File

@@ -269,40 +269,54 @@
@click="goodsDetail(goods.skuId, goods.goodsId)"
class="hover-color goods-name"
>
<el-tag v-if="isGiftItem(goods)" size="small" type="danger" effect="plain" class="mr_5">赠品</el-tag>
{{ goods.goodsName }}
</p>
<p class="goods-sn">货号:{{ goods.id }}</p>
</div>
<div class="goods-price">
<span class="unit-price">
{{ $filters.unitPrice(goods.goodsPrice, "¥") }} × {{ goods.num }}
</span>
<span class="subtotal">{{ $filters.unitPrice((goods.goodsPrice * goods.num), "¥") }}</span>
<template v-if="isGiftItem(goods)">
<span class="unit-price gift-original-price">
{{ $filters.unitPrice(goods.goodsPrice, "¥") }}
</span>
<span class="subtotal gift-subtotal">赠品 (¥0.00 × {{ goods.num }})</span>
</template>
<template v-else>
<span class="unit-price">
{{ $filters.unitPrice(goods.goodsPrice, "¥") }} × {{ goods.num }}
</span>
<span class="subtotal">{{ $filters.unitPrice((goods.goodsPrice * goods.num), "¥") }}</span>
</template>
</div>
<div class="goods-actions">
<button
v-if="goods.commentStatus == 'UNFINISHED'"
type="button"
class="comment-text"
@click="comment(order.order.sn, goodsIndex)"
>评价</button>
<el-button
v-if="goods.complainStatus == 'NO_APPLY'"
@click="complain(order.order.sn, goodsIndex)"
type="danger"
size="small"
>投诉</el-button
>
<el-button
v-if="
!isECouponOrder &&
(goods.afterSaleStatus.includes('NOT_APPLIED') ||
goods.afterSaleStatus.includes('PART_AFTER_SALE'))
"
@click="applyAfterSale(goods.sn)"
size="small"
>申请售后</el-button
>
<template v-if="!isGiftItem(goods)">
<button
v-if="goods.commentStatus == 'UNFINISHED'"
type="button"
class="comment-text"
@click="comment(order.order.sn, goodsIndex)"
>评价</button>
<el-button
v-if="goods.complainStatus == 'NO_APPLY'"
@click="complain(order.order.sn, goodsIndex)"
type="danger"
size="small"
>投诉</el-button
>
<el-button
v-if="
!isECouponOrder &&
(goods.afterSaleStatus.includes('NOT_APPLIED') ||
goods.afterSaleStatus.includes('PART_AFTER_SALE'))
"
@click="applyAfterSale(goods.sn)"
size="small"
>申请售后</el-button
>
</template>
<template v-else>
<span class="gift-action-tip">随单赠送,不支持售后</span>
</template>
</div>
</div>
</div>
@@ -726,6 +740,11 @@ function goPay(sn) {
});
}
function isGiftItem(goods) {
if (!goods) return false;
return goods.promotionType === 'GIFT' || (Number(goods.flowPrice) === 0 && goods.promotionType === 'GIFT');
}
function applyAfterSale(sn) {
// 申请售后
router.push({ name: "ApplyAfterSale", query: { sn: sn } });
@@ -1178,4 +1197,16 @@ onMounted(() => {
}
}
}
.gift-original-price {
text-decoration: line-through;
color: #999;
}
.gift-subtotal {
color: #e4393c;
font-weight: bold;
}
.gift-action-tip {
color: #999;
font-size: 12px;
}
</style>