订单项目根据赛事类型显示费用字段

This commit is contained in:
马梓彭 2026-05-13 17:24:33 +08:00
parent 4486d2abc3
commit 99e7b89d2a
2 changed files with 7 additions and 3 deletions

View File

@ -46,6 +46,9 @@ Page({
formatDetail(item) {
const statusInfo = STATUS_MAP[item.orderStatus] || { text: item.orderStatus || '-', key: 'default' };
// ChargeMode 枚举:0=免费,1=定价,2=单价(赛事),3=单价(项目)
// 只有 3(单价项目)显示费用列
const shouldShowFee = item.chargeMode === 3;
return {
...item,
statusText: statusInfo.text,
@ -54,7 +57,8 @@ Page({
actualAmount: item.actualAmount != null ? item.actualAmount : '-',
refundAmount: item.refundAmount != null && item.refundAmount > 0 ? item.refundAmount : '',
payTimeStr: item.paymentTime ? formatTime(item.paymentTime) : '-',
refundTimeStr: item.refundTime ? formatTime(item.refundTime) : '-'
refundTimeStr: item.refundTime ? formatTime(item.refundTime) : '-',
shouldShowFee: shouldShowFee
};
},

View File

@ -65,13 +65,13 @@
<view class="table-head">
<text class="th">项目</text>
<text class="th">组别</text>
<text class="th th-right">费用(元)</text>
<text class="th th-right" wx:if="{{detail.shouldShowFee}}">费用(元)</text>
</view>
<view class="table-body">
<view class="tr" wx:for="{{detail.items}}" wx:key="id">
<text class="td">{{item.projectName}}</text>
<text class="td">{{item.groupName}}</text>
<text class="td td-right">{{item.fee}}</text>
<text class="td td-right" wx:if="{{detail.shouldShowFee}}">{{item.fee}}</text>
</view>
</view>
</view>