Przeglądaj źródła

增加支付信息

sunshibo 4 tygodni temu
rodzic
commit
4442f5a829
1 zmienionych plików z 26 dodań i 3 usunięć
  1. 26 3
      pages/orderInfo/orderDetail.vue

+ 26 - 3
pages/orderInfo/orderDetail.vue

@@ -67,9 +67,21 @@
           <view class="price-line-label">合计</view>
           <view class="price-line-value">¥{{ priceDetail.total }}</view>
         </view>
+       
+      </view>
+    </view>
+    <!-- 已完成订单显示支付信息 -->
+    <view v-if="orderDetail.orderStatus === 3" 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">¥{{ priceDetail.total }}</view>
+        </view>
       </view>
     </view>
-
 
     <!-- 订单卡片 -->
     <view class="card">
@@ -136,7 +148,8 @@ const orderDetail = ref({
   createTime: '',
   contactPhone: '',
   remark: '',
-  orderStatus: null
+  orderStatus: null,
+  payType: ''  // 支付方式,如 wechatPayMininProgram
 });
 
 // 价格明细(两位小数)
@@ -152,6 +165,14 @@ const priceDetail = ref({
   total: '0.00'
 });
 
+// 支付方式展示:根据 payType 转为中文
+const payMethodText = computed(() => {
+  const t = orderDetail.value?.payType ?? '';
+  if (/wechat|微信/i.test(t)) return '微信支付';
+  if (/alipay|支付宝/i.test(t)) return '支付宝';
+  return t || '微信支付';
+});
+
 // 优惠券展示:满减券显示 nominalValue+元,折扣券显示 discountRate+折,否则显示 couponName 或 已使用优惠券(与 checkout 一致)
 const couponDisplayText = computed(() => {
   const p = priceDetail.value;
@@ -238,7 +259,8 @@ function applyOrderData(data) {
     createTime: raw?.createdTime ?? raw?.createTime ?? raw?.orderTime ?? '',
     contactPhone: raw?.contactPhone ?? raw?.phone ?? '',
     remark: raw?.remark ?? '',
-    orderStatus: raw?.orderStatus ?? raw?.status ?? null
+    orderStatus: raw?.orderStatus ?? raw?.status ?? null,
+    payType: raw?.payType ?? raw?.payMethod ?? ''
   };
   const dishTotal = raw?.totalAmount ?? raw?.dishTotal ?? raw?.orderAmount ?? raw?.foodAmount ?? 0;
   const tablewareFee = raw?.tablewareFee ?? raw?.tablewareAmount ?? 0;
@@ -492,6 +514,7 @@ onLoad(async (e) => {
     font-weight: bold;
     padding-top: 20rpx;
   }
+
 }
 
 .bottom-button {