ソースを参照

pay页面-cash的判断调整和运费调整

junyuanz 3 年 前
コミット
7f5aecddef
共有2 個のファイルを変更した12 個の追加10 個の削除を含む
  1. 8 6
      pages/pay/pay.js
  2. 4 4
      pages/pay/pay.wxml

+ 8 - 6
pages/pay/pay.js

@@ -44,7 +44,8 @@ Page({
 	pickid:0,
 	has_unuse_quan:false,
 	use_silver:0,
-	pay_cash:0//佣金抵扣
+	pay_cash:0,//佣金抵扣
+	freight_limit:9900
   },
   onLoad: function (options) {
     this.data.orderId = options.orderId;
@@ -151,8 +152,8 @@ Page({
         payData: val.data,
         project: val.data.product_list,
         total:total,
-        yunfei:that.data.receivetype == 0 ? total<9900?val.data.freight:0 : 0,
-		_yunfei:total<9900?val.data.freight:0,
+        yunfei:that.data.receivetype == 0 ? total<that.data.freight_limit?val.data.freight:0 : 0,
+		_yunfei:total<that.data.freight_limit?val.data.freight:0,
 		canusebalance:canusebalance,
 		nousebalance:nousebalance,
 		has_unuse_quan:check_has_unuse_quan,
@@ -360,8 +361,8 @@ Page({
 		
 		var minus_cash = 0;
 		var trueafter = afterdec - that.data.payData.dis_amount;
-		if(that.data.cashInfo.total > 0 && trueafter > 0){
-			minus_cash = that.data.cashInfo.total < trueafter ? that.data.cashInfo.total : trueafter;
+		if(that.data.cashInfo.available > 0 && trueafter > 0){
+			minus_cash = that.data.cashInfo.available < trueafter ? that.data.cashInfo.available : trueafter;
 		}
 		console.log('minus_cash',minus_cash);
 		
@@ -378,7 +379,8 @@ Page({
 		minusTotal: sour_total,
 		discountBl: val.data.discount_bl,
 		sourceAfterdec: source_afterdec,
-		pay_cash: minus_cash
+		pay_cash: minus_cash,
+		freight_limit:val.data.freight_limit
 		// disAmount:dis_amount
       });
     }

+ 4 - 4
pages/pay/pay.wxml

@@ -259,11 +259,11 @@
         </view>
         <view class="clean"></view>
       </view> -->
-	  <view class="yunfei" wx:if="{{receivetype == 0 && payData.order_type != 3 && total<9900}}">
-		 订单小于99元,还需支付<text style="color:#F00">{{yunfei / 100}}</text> 元运费
+	  <view class="yunfei" wx:if="{{receivetype == 0 && payData.order_type != 3 && total<freight_limit}}">
+		 订单小于{{freight_limit/100}}元,还需支付<text style="color:#F00">{{yunfei / 100}}</text> 元运费
 	  </view>
-	  <view class="yunfei" wx:if="{{receivetype == 0 && payData.order_type != 3 && total>=9900}}">
-		订单已满99元以上(含99元)免除运费
+	  <view class="yunfei" wx:if="{{receivetype == 0 && payData.order_type != 3 && total>=freight_limit}}">
+		订单已满{{freight_limit/100}}元以上(含{{freight_limit/100}}元)免除运费
 	  </view>
 	  
 	  <view style="padding:15rpx;text-align:right">