shish 19 часов назад
Родитель
Сommit
ebb71a2577
2 измененных файлов с 78 добавлено и 12 удалено
  1. 43 11
      mallApp/src/components/order/order-item.vue
  2. 35 1
      mallApp/src/pages/order/detail.vue

+ 43 - 11
mallApp/src/components/order/order-item.vue

@@ -77,18 +77,24 @@
             <view class="goods-title-row">
               <text class="goods-name">共 {{ info.goodsNum || 1 }} 件商品</text>
             </view>
-            <text class="goods-price">¥{{ totalPrice }}</text>
+            <text class="goods-price">¥{{ displayActPrice }}</text>
           </view>
         </view>
       </block>
     </view>
 
-    <!-- 合计(左)+ 操作按钮(右)同一行 -->
+    <!-- 合计(左)+ 操作按钮(右)同一行;金额对齐 ghs 列表:原价 vs actPrice-隔天退款 -->
     <view class="card-footer">
-      <text class="footer-text">
-        共{{ info.goodsNum || goodsCount }}件商品 合计:
-        <text class="footer-price">¥{{ totalPrice }}</text>
-      </text>
+      <view class="footer-text">
+        <text>共{{ info.goodsNum || goodsCount }}件,</text>
+        <block v-if="Number(info.orderPrice) == displayActPrice">
+          <text class="footer-price">¥{{ displayActPrice }}</text>
+        </block>
+        <block v-else>
+          <text class="footer-price-original">¥{{ orderOriginPrice }}</text>
+          <text class="footer-price footer-price--discount">¥{{ displayActPrice }}</text>
+        </block>
+      </view>
       <!-- 待付款:立即付款;待配送:联系客服 -->
       <view v-if="showActionBar" class="card-actions" @click.stop>
         <view
@@ -216,12 +222,23 @@ export default {
       }
       return Number(this.info.goodsNum) || 1;
     },
-    /** 订单合计金额 */
+    /**
+     * 列表展示价:actPrice - 封账后退款(nextDayTkPrice)
+     * 与 ghsApp OrderItem、详情「最终金额」一致
+     */
+    displayActPrice() {
+      const act = Number(this.info.actPrice) || 0
+      const next = Number(this.info.nextDayTkPrice) || 0
+      const pay = act - next
+      return parseFloat((pay > 0 ? pay : 0).toFixed(2))
+    },
+    /** 商品原价 orderPrice,用于与展示价对比划线 */
+    orderOriginPrice() {
+      return this.info.orderPrice ? parseFloat(this.info.orderPrice) : 0
+    },
+    /** 兼容旧引用:等同展示价 */
     totalPrice() {
-      const price = this.info.actPrice != null && this.info.actPrice !== ''
-        ? this.info.actPrice
-        : this.info.orderPrice;
-      return price ? parseFloat(price) : 0;
+      return this.displayActPrice
     }
   },
   methods: {
@@ -531,9 +548,12 @@ export default {
 }
 
 .footer-text {
+  display: flex;
   flex: 1;
   min-width: 0;
   margin-right: 16upx;
+  align-items: baseline;
+  flex-wrap: wrap;
   font-size: 26upx;
   color: $fontColor2;
 }
@@ -545,6 +565,18 @@ export default {
   color: $redColor;
 }
 
+/* 有优惠/隔天退款时:原价划线 + 展示价 */
+.footer-price-original {
+  margin-left: 4upx;
+  font-size: 26upx;
+  color: #847676;
+  text-decoration: line-through;
+}
+
+.footer-price--discount {
+  margin-left: 10upx;
+}
+
 /* 操作按钮靠右:主按钮实心绿、次按钮描边 */
 .card-actions {
   display: flex;

+ 35 - 1
mallApp/src/pages/order/detail.vue

@@ -132,14 +132,33 @@
             <text class="kv-label">红包减免</text>
             <text class="kv-value kv-value--minus">-¥{{ money(data.hbAmount) }}</text>
           </view>
+          <!-- 当天退款影响 actPrice,放在实付前展示 -->
+          <view v-if="Number(data.tkPrice) > 0" class="kv-row">
+            <text class="kv-label">当天退款</text>
+            <text class="kv-value kv-value--minus">
+              <text v-if="Number(data.refundSendCost) > 0">(含运费{{ money(data.refundSendCost) }}元)</text>
+              <text v-if="Number(data.refundPackCost) > 0">(含包装费{{ money(data.refundPackCost) }}元)</text>
+              -¥{{ money(data.tkPrice) }}
+            </text>
+          </view>
           <view class="kv-row kv-row--strong">
             <text class="kv-label">实付合计</text>
-            <text class="kv-value kv-value--pay">¥{{ money(data.mainPay) }}</text>
+            <text class="kv-value kv-value--pay">¥{{ money(data.actPrice) }}</text>
           </view>
           <view v-if="Number(data.remainDebtPrice) > 0" class="kv-row">
             <text class="kv-label">订单待结</text>
             <text class="kv-value kv-value--debt">¥{{ money(data.remainDebtPrice) }}</text>
           </view>
+          <!-- 隔天退款不改 actPrice;最终金额 = 实付 - 隔天退款 -->
+          <view v-if="Number(data.nextDayTkPrice) > 0" class="kv-row">
+            <text class="kv-label">隔天退款</text>
+            <text class="kv-value kv-value--minus">-¥{{ money(data.nextDayTkPrice) }}</text>
+          </view>
+          <view v-if="Number(data.nextDayTkPrice) > 0" class="kv-row kv-row--strong">
+            <text class="kv-label kv-label--final">最终金额</text>
+            <text class="kv-value kv-value--pay">¥{{ finalPriceAfterNextDayRefund }}</text>
+          </view>
+
         </view>
       </view>
 
@@ -267,6 +286,16 @@ export default {
       const date = this.data.reachDate || ''
       const period = this.reachPeriodInfo || this.data.reachPeriod || ''
       return (date + ' ' + period).trim() || '--'
+    },
+    /**
+     * 最终金额:实付 actPrice - 隔天退款 nextDayTkPrice
+     * 隔天退款不改 actPrice,用差值展示净额(对齐 ghs 封账后退款口径)
+     */
+    finalPriceAfterNextDayRefund() {
+      const act = Number(this.data.actPrice) || 0
+      const next = Number(this.data.nextDayTkPrice) || 0
+      const final = act - next
+      return parseFloat((final > 0 ? final : 0).toFixed(2))
     }
   },
   onShow() {
@@ -707,6 +736,11 @@ export default {
   color: $greenColor;
 }
 
+.kv-label--final {
+  color: $greenColor;
+  font-weight: 600;
+}
+
 .kv-value--debt {
   color: #e62e45;
   font-weight: 700;