junyuanz 4 rokov pred
rodič
commit
469dde0866
3 zmenil súbory, kde vykonal 31 pridanie a 48 odobranie
  1. 21 16
      pages/pay/pay.js
  2. 7 31
      pages/pay/pay.wxml
  3. 3 1
      project.config.json

+ 21 - 16
pages/pay/pay.js

@@ -53,7 +53,6 @@ Page({
   },
   onShow: function () {
     this.getUserInfo()
-	this.getOrderInfo()
 	var receivetype = wx.getStorageSync('receivetype');
 	if(receivetype == 0){
 		var address = wx.getStorageSync('use_address');
@@ -118,11 +117,16 @@ Page({
 	  var nousebalance = 0;
 	  for(var i in val.data.product_list){
 		  var item = val.data.product_list[i];
-		  if(item.pv >= item.price){
-			   canusebalance = canusebalance + (item.price * item.count);
+		  if(val.data.special_promotion){//新增双十一促销判断
+			  canusebalance = canusebalance + (item.price * item.count);
 		  }else{
-			  nousebalance = nousebalance + (item.price * item.count);
+			 if(item.pv >= item.price){
+			 			   canusebalance = canusebalance + (item.price * item.count);
+			 }else{
+			 			  nousebalance = nousebalance + (item.price * item.count);
+			 } 
 		  }
+		  
 	  }
 	  
 	  console.log('canusebalance',canusebalance);
@@ -485,7 +489,7 @@ Page({
 							that.setData({
 					      payFlag: false
 					    })
-					that.onShow()
+					that.getOrderInfo()
 	          }
 	        })
 	      } else {
@@ -502,12 +506,12 @@ Page({
 	      that.setData({
 		      payFlag: false
 		    })
-			that.onShow()
+			that.getOrderInfo()
     	}else{
     		that.setData({
 		      payFlag: false
 		    })
-			that.onShow()
+			that.getOrderInfo()
     	}
     }
     var fail = function(err){
@@ -546,20 +550,21 @@ Page({
   
   
   receivetbn(e){
-	  if(this.data.payData.pay_way != ''){
-		  wx.showToast({
-		    title: '当前订单内容已生效无法更改',
-		    icon: 'none',
-		    duration: 2000
-		  })
-	  }else{
+	  if(this.data.payData.pay_way == ''){
 		  this.setData({
-		  	receivetype: e.target.dataset.value,
-		  	yunfei : e.target.dataset.value == 0 ? this.data._yunfei : 0
+		  		receivetype: e.target.dataset.value,
+		  		yunfei : e.target.dataset.value == 0 ? this.data._yunfei : 0
 		  })
 		  wx.setStorageSync('receivetype', e.target.dataset.value) //存入
 		  this.getBalanceInfo()
+	  }else{
+		  wx.showToast({
+		    title: '当前提货方式已确定',
+		    icon: 'none',
+		    duration: 2000
+		  })
 	  }
+	  
 	
   },
   getpickdeparts: function () {

+ 7 - 31
pages/pay/pay.wxml

@@ -5,18 +5,7 @@
 	</view>
 <view wx:if="{{receivetype == 0}}">
 	<view class="pay-address" wx:if="{{selectaddress && address !== null}}">
-		<view wx:if="{{payData.pay_way != ''}}">
-			<view class="pay-font">
-			  <text class="fl">收件人: {{address.contact}}</text>
-			  <text class="fr">{{address.tel}}</text>
-			  <view class="clean"></view>
-			</view>
-			<view  class="pay-font">
-			  <text>收件地址:{{address.province}}{{address.city}}{{address.district}}{{address.address}}</text>
-			</view>
-			<image src="http://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/image/icon/arrow_right.jpg" class="pay-arrowR"></image>
-		</view>
-		<navigator url="/packageUser/pages/user/address/address" wx:else>
+		<navigator url="/packageUser/pages/user/address/address">
 			<view class="pay-font">
 			  <text class="fl">收件人: {{address.contact}}</text>
 			  <text class="fr">{{address.tel}}</text>
@@ -36,15 +25,7 @@
 </view>
 <view wx:else>
 	<view class="pay-address" wx:if="{{selectpickaddress && pick_address !== null}}">
-		<view wx:if="{{payData.pay_way != ''}}">
-			<view class="pay-font" style="line-height: 75rpx;margin-bottom:0">
-			  <text class="fl">自提人:{{pick_address.contact}}</text>
-			  <text class="fr">{{pick_address.tel}}</text>
-			  <view class="clean"></view>
-			</view>
-			<image src="http://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/image/icon/arrow_right.jpg" class="pay-arrowR"></image>
-		</view>
-		<navigator url="/packageUser/pages/user/selfReceive/selfReceive" wx:else>
+		<navigator url="/packageUser/pages/user/selfReceive/selfReceive">
 			<view class="pay-font" style="line-height: 75rpx;margin-bottom:0">
 			  <text class="fl">自提人:{{pick_address.contact}}</text>
 			  <text class="fr">{{pick_address.tel}}</text>
@@ -59,12 +40,7 @@
 		<navigator url="/packageUser/pages/user/selfReceive/selfReceive" class="pay-address-add">点击选择提货人</navigator>
 	</view>
 	
-	<view wx:if="{{payData.pay_way != ''}}">
-	    <view class="picker">
-	      {{pickid ? '自提点:'+repickdepartsList[pickindex] : '自提点:点击选择自提门店'}}
-	    </view>
-	</view>
-	<picker bindchange="bindPickerChange" value="{{index}}" range="{{repickdepartsList}}" wx:else>
+	<picker bindchange="bindPickerChange" value="{{index}}" range="{{repickdepartsList}}">
 	    <view class="picker">
 	      {{pickid ? '自提点:'+repickdepartsList[pickindex] : '自提点:点击选择自提门店'}}
 	    </view>
@@ -78,7 +54,7 @@
       <image class="pay-project-img" src="{{item.cover}}"></image>
       <view class="pay-project-info">
         <text class="pay-project-title ellipsisLn">{{item.product_name}}</text>
-		 <p wx:if="{{payData.pv < payData.total_price && item.pv < item.price}}" style="color:#F00">[该商品无法使用提货券兑换]</p>
+		 <p wx:if="{{!payData.special_promotion && payData.pv < payData.total_price && item.pv < item.price}}" style="color:#F00">[该商品无法使用提货券兑换]</p>
 		<view class="project-pack-list" wx:if="{{item.package}}">
 			<view wx:for="{{item.package_list}}" wx:for-item="pack" wx:for-index="ind">
 				<p>{{pack.item_title}} x{{pack.nums}}</p>
@@ -262,8 +238,7 @@
     </view>
 	
 	<view class="remark">
-		<text wx:if="{{payData.pay_way != ''}}">{{payData.remark}}</text>
-		<input type="text" class="nameText" placeholder="选填,请输入给商家的留言" placeholder-class="text-placeholder" bindinput="bindremark" wx:else/>
+		<input type="text" class="nameText" placeholder="选填,请输入给商家的留言" placeholder-class="text-placeholder" bindinput="bindremark"/>
 	</view>
 	
   </view>
@@ -283,7 +258,8 @@
         </view>
         <view wx:else style="display: inline;">
         	<currency wx:if="{{useBalance}}" symbol="¥" value="{{afterdec}}" class="red"></currency>
-	        <currency wx:else symbol="¥" value="{{payData.pay_way == '' ? total+yunfei : payData.paied_price}}" class="red"></currency>
+	        <!-- <currency wx:else symbol="¥" value="{{payData.pay_way == '' ? total+yunfei : payData.paied_price}}" class="red"></currency> -->
+	        <currency wx:else symbol="¥" value="{{payData.pay_way == '' ? total+yunfei : total+yunfei-payData.coupon_price}}" class="red"></currency>
 	        
 	        <text class="red" wx:if="{{curPayway === 'balance'}}">{{(total+yunfei) / 100}}<currency value="{{total}}" class="red"></currency>提货券</text>
 	        <text class="red" wx:if="{{curPayway === 'integral'}}">{{(total+yunfei) / 100}}提货券</text>

+ 3 - 1
project.config.json

@@ -27,7 +27,9 @@
     "packNpmManually": false,
     "packNpmRelationList": [],
     "minifyWXSS": true,
-    "showES6CompileOption": false
+    "disableUseStrict": false,
+    "showES6CompileOption": false,
+    "useCompilerPlugins": false
   },
   "compileType": "miniprogram",
   "libVersion": "2.0.7",