Browse Source

修改购买优惠券

zhuliu 1 year ago
parent
commit
07a68010b3
3 changed files with 16 additions and 3 deletions
  1. 9 2
      pages/voucher/voucher.js
  2. 1 1
      pages/voucher/voucher.wxml
  3. 6 0
      pages/voucher/voucher.wxss

+ 9 - 2
pages/voucher/voucher.js

@@ -283,6 +283,10 @@ Page({
         ["voucherList["+index+"].buyNumber"]:value
       }
     )
+    var id = this.data.voucherList[index].id
+    if(this.data.buyVoucher.indexOf(id+'')==-1){
+      return
+    }
     this.getOrderDetail()
   },
   //获取订单详情
@@ -316,7 +320,8 @@ Page({
             payMoney:res.data.data.orderMessage.finalPrice,
             ["other.discount"]:res.data.data.orderMessage.discount,
             ["other.price"]:res.data.data.orderMessage.price,
-            // ["other.discountPrice"]:Decimal.sub([res.data.data.orderMessage.price,res.data.data.orderMessage.finalPrice]),
+            ["other.finalPrice"]:res.data.data.orderMessage.finalPrice,
+            ["other.discountPrice"]:Decimal.sub([res.data.data.orderMessage.price,res.data.data.orderMessage.finalPrice]),
           }
         )
       }
@@ -351,8 +356,10 @@ Page({
       type:'0',
       goods:goods,
       servicePrice:0.00,
-      price:this.data.payMoney,
+      price:this.data.other.price,
+      finalPrice:this.data.other.finalPrice,
       discount:this.data.other.discount,
+      discountPrice:this.data.other.discountPrice,
       activityId:this.data.other.activityId
     }
     pay.openPay(data)

+ 1 - 1
pages/voucher/voucher.wxml

@@ -33,7 +33,7 @@
       </scroll-view>
     </view>
     <view class="pay">
-      <view class="payBtn" bind:tap="pay">支付 <span wx:if="{{payMoney}}">¥{{payMoney}}</span> </view>
+      <view class="payBtn" bind:tap="pay">支付 <span wx:if="{{payMoney}}">¥{{payMoney}} <span  wx:if="{{payMoney != other.price}}" class="delete">¥{{other.price}}</span> </span> </view>
     </view>
   </view>
   <!-- 已拥有优惠券 -->

+ 6 - 0
pages/voucher/voucher.wxss

@@ -200,3 +200,9 @@
   line-height: 150px;
   color: darkgray;
 }
+
+.delete{
+  color: darkgray;
+  font-size: 26rpx;
+  text-decoration: line-through;
+}