|
|
@@ -45,7 +45,7 @@
|
|
|
<view class="info-item-label">菜品总价</view>
|
|
|
<view class="info-item-value">¥{{ priceDetail.dishTotal }}</view>
|
|
|
</view>
|
|
|
- <view v-if="priceDetail.serviceFeeAmount > 0" class="info-item">
|
|
|
+ <view class="info-item">
|
|
|
<view class="info-item-label">服务费</view>
|
|
|
<view class="info-item-value">¥{{ priceDetail.serviceFee }}</view>
|
|
|
</view>
|
|
|
@@ -54,7 +54,7 @@
|
|
|
v-if="orderDetail.orderStatus === 3 && completedOrderDiscountDisplay > 0"
|
|
|
class="info-item info-item--coupon"
|
|
|
>
|
|
|
- <view class="info-item-label">优惠金额</view>
|
|
|
+ <view class="info-item-label">优惠劵</view>
|
|
|
<view class="info-item-value coupon-value">
|
|
|
<text class="coupon-amount">-¥{{ formatPrice(completedOrderDiscountDisplay) }}</text>
|
|
|
</view>
|
|
|
@@ -66,15 +66,23 @@
|
|
|
|
|
|
</view>
|
|
|
</view>
|
|
|
- <!-- 已完成订单显示支付信息 -->
|
|
|
- <view v-if="orderDetail.orderStatus === 3" class="card">
|
|
|
+ <!-- 已支付 / 已完成:支付信息(结算方式、支付方式、支付时间) -->
|
|
|
+ <view v-if="showPaidOrderPaymentCard" class="card">
|
|
|
<view class="card-header">
|
|
|
<view class="card-header-title">支付信息</view>
|
|
|
</view>
|
|
|
<view class="card-content">
|
|
|
<view class="info-item">
|
|
|
- <view class="info-item-label">{{ payMethodText }}</view>
|
|
|
- <view class="info-item-value">¥{{ formatPrice(orderSummaryDisplayAmount) }}</view>
|
|
|
+ <view class="info-item-label">结算方式</view>
|
|
|
+ <view class="info-item-value">{{ settlementMethodText }}</view>
|
|
|
+ </view>
|
|
|
+ <view class="info-item">
|
|
|
+ <view class="info-item-label">支付方式</view>
|
|
|
+ <view class="info-item-value">{{ payMethodText }}</view>
|
|
|
+ </view>
|
|
|
+ <view class="info-item">
|
|
|
+ <view class="info-item-label">支付时间</view>
|
|
|
+ <view class="info-item-value">{{ payTimeDisplay }}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -145,7 +153,11 @@ const orderDetail = ref({
|
|
|
contactPhone: '',
|
|
|
remark: '',
|
|
|
orderStatus: null,
|
|
|
- payType: '' // 支付方式,如 wechatPayMininProgram
|
|
|
+ payType: '', // 支付方式编码,如 wechatPayMininProgram
|
|
|
+ /** 结算方式文案,接口无则默认「手机支付」 */
|
|
|
+ settlementMethod: '',
|
|
|
+ /** 支付完成时间 */
|
|
|
+ payTime: ''
|
|
|
});
|
|
|
|
|
|
// 价格明细(两位小数)
|
|
|
@@ -162,12 +174,32 @@ const priceDetail = ref({
|
|
|
total: '0.00'
|
|
|
});
|
|
|
|
|
|
-// 支付方式展示:根据 payType 转为中文
|
|
|
+// 已支付(1) / 已完成(3) 展示支付信息卡片
|
|
|
+const showPaidOrderPaymentCard = computed(() => {
|
|
|
+ const s = orderDetail.value?.orderStatus;
|
|
|
+ return s === 1 || s === 3;
|
|
|
+});
|
|
|
+
|
|
|
+// 结算方式:优先接口 settlementMethod / settlementTypeName,小程序场景默认「手机支付」
|
|
|
+const settlementMethodText = computed(() => {
|
|
|
+ const m = orderDetail.value?.settlementMethod;
|
|
|
+ if (m != null && String(m).trim() !== '') return String(m).trim();
|
|
|
+ return '手机支付';
|
|
|
+});
|
|
|
+
|
|
|
+// 支付方式:根据 payType 转为中文
|
|
|
const payMethodText = computed(() => {
|
|
|
const t = orderDetail.value?.payType ?? '';
|
|
|
if (/wechat|微信/i.test(t)) return '微信支付';
|
|
|
if (/alipay|支付宝/i.test(t)) return '支付宝';
|
|
|
- return t || '微信支付';
|
|
|
+ return t && String(t).trim() !== '' ? String(t).trim() : '微信支付';
|
|
|
+});
|
|
|
+
|
|
|
+// 支付时间
|
|
|
+const payTimeDisplay = computed(() => {
|
|
|
+ const t = orderDetail.value?.payTime;
|
|
|
+ if (t != null && String(t).trim() !== '') return String(t).trim();
|
|
|
+ return '—';
|
|
|
});
|
|
|
|
|
|
// 优惠券展示:满减券显示 nominalValue+元,折扣券显示 discountRate+折,否则显示 couponName 或 已使用优惠券(与 checkout 一致)
|
|
|
@@ -314,7 +346,20 @@ function applyOrderData(data) {
|
|
|
contactPhone: raw?.contactPhone ?? raw?.phone ?? '',
|
|
|
remark: raw?.remark ?? '',
|
|
|
orderStatus: raw?.orderStatus ?? raw?.status ?? null,
|
|
|
- payType: raw?.payType ?? raw?.payMethod ?? ''
|
|
|
+ payType: raw?.payType ?? raw?.payMethod ?? '',
|
|
|
+ settlementMethod:
|
|
|
+ raw?.settlementMethod ??
|
|
|
+ raw?.settlementTypeName ??
|
|
|
+ raw?.settlementTypeDesc ??
|
|
|
+ raw?.payChannelName ??
|
|
|
+ '',
|
|
|
+ payTime:
|
|
|
+ raw?.payTime ??
|
|
|
+ raw?.paymentTime ??
|
|
|
+ raw?.paidTime ??
|
|
|
+ raw?.payFinishTime ??
|
|
|
+ raw?.paySuccessTime ??
|
|
|
+ ''
|
|
|
};
|
|
|
const couponInfo = raw?.couponInfo ?? raw?.coupon ?? {};
|
|
|
const dishTotal = raw?.totalAmount ?? raw?.dishTotal ?? raw?.orderAmount ?? raw?.foodAmount ?? 0;
|