feat(voucher): 兑换券业务严格隔离、前台全面去¥化、不足强拦截与售后闭环返还加固

1. 普通商品购买流程中严格禁止兑换券抵扣,仅限积分商城支持同等兑换
2. 积分商城卡片、详情、规格及结算页全面去除「¥」符号,强化「个兑换券 / 券」纯资产心智
3. 兑换券与积分逻辑完全对齐,兑换券不足时禁止掏现金补差,前端置灰禁用+后端抛出「兑换券不足」异常
4. 修复售后退款状态机识别偏差,并在订单失效/取消中增加已核销兑换券原路返还兜底
5. 新增及更新 6 套专项自动化测试(累计 200 项断言全部通过)
这个提交包含在:
chen
2026-09-21 11:49:28 +08:00
父节点 cc7bfe1301
当前提交 b598d56483
共有 14 个文件被更改,包括 594 次插入 和 78 次删除

查看文件

@@ -29,18 +29,21 @@
<!-- 价格+标题 -->
<view class="title-card detail-card ss-p-y-40 ss-p-x-20">
<view class="ss-flex ss-row-between ss-col-center ss-m-b-18">
<view class="price-box ss-flex ss-col-bottom">
<view v-if="goodsPrice.price > 0" class="price-text"> ¥{{ goodsPrice.price }} </view>
<text v-if="goodsPrice.price > 0 && goodsPrice.score > 0">+</text>
<image
v-if="goodsPrice.score > 0"
:src="sheep.$url.static('/assets/addons/shopro/uniapp/goods/score1.svg')"
class="score-img"
></image>
<view v-if="goodsPrice.score > 0" class="score-text ss-m-r-16">
{{ goodsPrice.score }}
<view class="price-box ss-flex ss-col-bottom ss-flex-wrap">
<view v-if="Number(goodsPrice.price) > 0" class="ss-flex ss-col-bottom">
<text class="price-text">{{ formatVoucher(goodsPrice.price) }}</text>
<text class="unit-text ss-m-l-6 ss-m-r-8">个兑换券</text>
</view>
<view v-if="goodsPrice.price > 0" class="voucher-tip-tag">支持兑换券全额抵扣</view>
<view v-if="Number(goodsPrice.price) > 0 && Number(goodsPrice.score) > 0" class="plus-text ss-m-r-8">+</view>
<view v-if="Number(goodsPrice.score) > 0" class="ss-flex ss-col-center">
<image
:src="sheep.$url.static('/assets/addons/shopro/uniapp/goods/score1.svg')"
class="score-img"
></image>
<text class="score-text ss-m-r-8">{{ goodsPrice.score }}</text>
<text class="unit-text ss-m-r-16">积分</text>
</view>
<view class="voucher-tip-tag">兑换专享</view>
</view>
<view class="sales-text">
{{ formatExchange(state.goodsInfo.sales_show_type, state.goodsInfo.sales) }}
@@ -106,6 +109,13 @@
import sheep from '@/sheep';
import { isEmpty } from 'lodash';
import { formatExchange, formatGoodsSwiper } from '@/sheep/hooks/useGoods';
function formatVoucher(val) {
if (val === '' || val === null || val === undefined || val === '--') return '0';
const num = Number(val);
if (isNaN(num)) return '0';
return num % 1 === 0 ? String(Math.round(num)) : String(Number(num.toFixed(2)));
}
import detailNavbar from './components/detail/detail-navbar.vue';
import detailCellSku from './components/detail/detail-cell-sku.vue';
import detailCellService from './components/detail/detail-cell-service.vue';
@@ -239,6 +249,18 @@
line-height: 36rpx;
font-family: OPPOSANS;
}
.unit-text {
font-size: 24rpx;
color: #ff3000;
font-weight: 500;
line-height: 36rpx;
}
.plus-text {
font-size: 32rpx;
color: #ff3000;
font-weight: 500;
line-height: 36rpx;
}
.voucher-tip-tag {
font-size: 20rpx;
color: #ff3000;