浏览代码

折扣显示字样

zaijin 2 年之前
父节点
当前提交
3be02f3658
共有 2 个文件被更改,包括 19 次插入2 次删除
  1. 8 1
      pages/choosePayment/choosePayment.scss
  2. 11 1
      pages/choosePayment/choosePayment.vue

+ 8 - 1
pages/choosePayment/choosePayment.scss

@@ -24,9 +24,16 @@
   }
   .pay-money {
     text-align: center;
-    font-size: 34rpx;
+    font-size: 38rpx;
     color: #008CFF;
     margin-top: 20rpx;
+    font-weight: bold;
+    .original-discount-money {
+      text-decoration: line-through;
+      color: #333;
+      font-size: 24rpx;
+      margin-left: 20rpx;
+    }
   }
   .pay-btn {
     margin-top: 34rpx;

+ 11 - 1
pages/choosePayment/choosePayment.vue

@@ -55,7 +55,14 @@
             ></u-cell-item>
           </u-cell-group>
         </view>
-        <view class="pay-money"> 金额:¥{{ orderMoney }} </view>
+        <view class="pay-money">
+          <text class="discount-money" v-if="couponPopup.currentCoupon.couponContent && radioCurrent === 'weixin'"
+            >¥ {{ getDifference(orderMoney, couponPopup.currentCoupon.couponContent).toFixed(2) }}</text
+          >
+          <text class="original-money" :class="couponPopup.currentCoupon.couponContent && radioCurrent === 'weixin' && 'original-discount-money'"
+            >¥ {{ orderMoney }}</text
+          >
+        </view>
         <view class="pay-btn">
           <u-button type="primary" shape="circle" :disabled="!radioCurrent" @click="immediatePayment">立即支付</u-button>
         </view>
@@ -619,6 +626,9 @@ export default {
         hourOver = dayOver % (3600 * 1000),
         minutes = Math.floor(hourOver / (60 * 1000));
       return `${day}天${hours}小时${minutes}分`;
+    },
+    getDifference(a, b) {
+      return a > b ? a - b : 0;
     }
   }
 };