Explorar o código

勾选使用余额抵扣

zhengjinyi %!s(int64=5) %!d(string=hai) anos
pai
achega
0eee026c7c
Modificáronse 2 ficheiros con 28 adicións e 22 borrados
  1. 27 18
      pages/user/order/create-order.vue
  2. 1 4
      seller/pages/order/create-order.vue

+ 27 - 18
pages/user/order/create-order.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-	<view class="container order clearfix">
+	<view class="container order clearfix" :style="{paddingBottom :isIphoneX ? '170rpx' : '134rpx'}">
 		<!-- 透明模态层 -->
 		<!-- 透明模态层 -->
 		<modal-layer v-if='modallayer'></modal-layer>
 		<modal-layer v-if='modallayer'></modal-layer>
 		<!-- 地址选择 -->
 		<!-- 地址选择 -->
@@ -226,26 +226,38 @@
 				}
 				}
 			},
 			},
 			attributeNofreight(){//计算没有邮费的支付价格
 			attributeNofreight(){//计算没有邮费的支付价格
-				if(this.userMoney>this.payAllPrice){
-					this.payAllPrice = 0.00
-					this.deductMoney = this.allPrice							//勾选后使用抵余额
-					this.surplusMoney = this.userMoney - this.deductMoney	    //勾选后的剩余抵扣
+				if(this.ischecked){
+					if(this.userMoney>this.payAllPrice){
+						this.payAllPrice = 0.00
+						this.deductMoney = this.allPrice							//勾选后使用抵余额
+						this.surplusMoney = this.userMoney - this.deductMoney	    //勾选后的剩余抵扣
+					}else{
+						this.payAllPrice = this.allPrice - this.userMoney       	//勾选后的总价
+						this.deductMoney = this.userMoney				            //勾选后使用抵余额
+						this.surplusMoney = this.userMoney - this.deductMoney	    //勾选后的剩余抵扣
+					}
 				}else{
 				}else{
-					this.payAllPrice = this.allPrice - this.userMoney       	//勾选后的总价
-					this.deductMoney = this.userMoney				            //勾选后使用抵余额
-					this.surplusMoney = this.userMoney - this.deductMoney	    //勾选后的剩余抵扣
+					this.payAllPrice = this.allPrice;
+					this.deductMoney = 0.00;
+					this.surplusMoney = this.userMoney;
 				}
 				}
 			},
 			},
 			attributeHashfreight(freight){//计算需要邮费的支付价格
 			attributeHashfreight(freight){//计算需要邮费的支付价格
 				this.payAllPrice = this.allPrice+parseInt(freight)//计算不包邮的价格 总价等于商品价格+邮费
 				this.payAllPrice = this.allPrice+parseInt(freight)//计算不包邮的价格 总价等于商品价格+邮费
-				if(this.userMoney>this.payAllPrice){							//余额大于支付金额
-					this.payAllPrice =0.00
-					this.deductMoney = this.allPrice+parseInt(freight)			//勾选后使用抵余额
-					this.surplusMoney = this.userMoney - this.deductMoney	    //勾选后的剩余抵扣
+				if(this.ischecked){
+					if(this.userMoney>this.payAllPrice){							//余额大于支付金额
+						this.payAllPrice =0.00
+						this.deductMoney = this.allPrice+parseInt(freight)			//勾选后使用抵余额
+						this.surplusMoney = this.userMoney - this.deductMoney	    //勾选后的剩余抵扣
+					}else{
+						this.payAllPrice = this.allPrice+parseInt(freight) - this.userMoney       	//勾选后的总价
+						this.deductMoney = this.userMoney				            //勾选后使用抵余额
+						this.surplusMoney = this.userMoney - this.deductMoney	    //勾选后的剩余抵扣
+					}
 				}else{
 				}else{
-					this.payAllPrice = this.allPrice+parseInt(freight) - this.userMoney       	//勾选后的总价
-					this.deductMoney = this.userMoney				            //勾选后使用抵余额
-					this.surplusMoney = this.userMoney - this.deductMoney	    //勾选后的剩余抵扣
+					this.payAllPrice = this.allPrice+parseInt(freight)
+					this.deductMoney = 0.00
+					this.surplusMoney = this.userMoney
 				}
 				}
 			},
 			},
 			orderSubmitMit(){//提交订单
 			orderSubmitMit(){//提交订单
@@ -336,9 +348,6 @@
 		transition-duration: 0.3s;
 		transition-duration: 0.3s;
 		transition-timing-function: ease;
 		transition-timing-function: ease;
 	}
 	}
-	.order{
-		padding-bottom: 134rpx;
-	}
 	.invoice-freight{
 	.invoice-freight{
 		width: 702rpx;
 		width: 702rpx;
 		padding: 0 24rpx;
 		padding: 0 24rpx;

+ 1 - 4
seller/pages/order/create-order.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-	<view class="container order clearfix">
+	<view class="container order clearfix" :style="{paddingBottom :isIphoneX ? '170rpx' : '134rpx'}">
 		<!-- 透明模态层 -->
 		<!-- 透明模态层 -->
 		<modal-layer v-if='modallayer'></modal-layer>
 		<modal-layer v-if='modallayer'></modal-layer>
 		<!-- 地址选择 -->
 		<!-- 地址选择 -->
@@ -330,9 +330,6 @@
 		transition-duration: 0.3s;
 		transition-duration: 0.3s;
 		transition-timing-function: ease;
 		transition-timing-function: ease;
 	}
 	}
-	.order{
-		padding-bottom: 134rpx;
-	}
 	.invoice-freight{
 	.invoice-freight{
 		width: 702rpx;
 		width: 702rpx;
 		padding: 0 24rpx;
 		padding: 0 24rpx;