فهرست منبع

commit -m 优惠券

zhengjinyi 3 سال پیش
والد
کامیت
8ee21eabcb
2فایلهای تغییر یافته به همراه17 افزوده شده و 15 حذف شده
  1. 9 9
      pages/seller/order/create-order.vue
  2. 8 6
      pages/user/order/create-order.vue

+ 9 - 9
pages/seller/order/create-order.vue

@@ -357,7 +357,7 @@
 					}else{
 						this.balanceDeductionFlag = 2
 						if(this.freightData.freePostFlag == 1 || this.freightData.freePostFlag == '1'){
-							this.payAllPrice = this.allPrice+parseInt(this.freightData.freight) - this.couponAmount
+							this.payAllPrice = this.allPrice + parseInt(this.freightData.freight) - this.couponAmount
 						}else{
 							this.payAllPrice = this.allPrice - this.couponAmount
 						}
@@ -369,7 +369,6 @@
 				}
 			},	
 			attributePallPrice(){//计算价格
-				console.log('运费',this.freightData.freight)
 				if(this.freightData.freePostFlag == 1 || this.freightData.freePostFlag == '1'){
 					this.attributeHashfreight(this.freightData.freight)
 				}else{
@@ -378,28 +377,29 @@
 			},
 			attributeNofreight(){//计算没有邮费的支付价格
 				if(this.ischecked){
-					if(this.userMoney>this.payAllPrice){
+					let totalAmount = this.allPrice - this.couponAmount//计算不包邮的价格 总价等于商品价格+邮费
+					if(this.userMoney > totalAmount){
 						this.payAllPrice = 0.00
 						this.deductMoney = this.allPrice - this.couponAmount		// 勾选后使用抵余额
 						this.surplusMoney = this.userMoney - this.deductMoney	    // 勾选后的剩余抵扣
 					}else{
-						this.payAllPrice = this.allPrice - this.userMoney - this.couponAmount       	//勾选后的总价
+						this.payAllPrice = this.allPrice - this.userMoney -	this.couponAmount //勾选后的总价
 						this.deductMoney = this.userMoney				            // 勾选后使用抵余额
 						this.surplusMoney = this.userMoney - this.deductMoney	    // 勾选后的剩余抵扣
 					}
 				}else{
 					this.payAllPrice = this.allPrice  - this.couponAmount;
-					this.deductMoney = 0.00;
-					this.surplusMoney = this.userMoney;
+					this.deductMoney = 0.00
+					this.surplusMoney = this.userMoney
 				}
 				console.log('最终订单支付金额',this.payAllPrice)
 				console.log('优惠券金额',this.couponAmount)
 			},
 			attributeHashfreight(freight){//计算需要邮费的支付价格
-				this.payAllPrice = this.allPrice + parseInt(freight) - this.couponAmount//计算不包邮的价格 总价等于商品价格+邮费
+				let totalAmount = this.allPrice + parseInt(freight) - this.couponAmount//计算不包邮的价格 总价等于商品价格+邮费
 				if(this.ischecked){
-					if(this.userMoney>this.payAllPrice){							//余额大于支付金额
-						this.payAllPrice =0.00
+					if(this.userMoney > totalAmount ){							//余额大于支付金额
+						this.payAllPrice = 0.00
 						this.deductMoney = this.allPrice + parseInt(freight) - this.couponAmount			//勾选后使用抵余额
 						this.surplusMoney = this.userMoney - this.deductMoney	    //勾选后的剩余抵扣
 					}else{

+ 8 - 6
pages/user/order/create-order.vue

@@ -315,12 +315,13 @@
 					if(this.hanldFreePostFlag == 1){	
 						// 如果使用了余额 最终价格
 						if(this.ischecked){
-							if(this.userMoney>=this.payAllPrice){
+							let totalAmount = this.allPrice - this.couponAmount
+							if(this.userMoney >= totalAmount){
 								this.payAllPrice = 0.00
 								this.deductMoney = this.allPrice - this.couponAmount		// 当前使用金额等于订单金额
 								this.surplusMoney = this.userMoney - this.deductMoney	    // 剩余金额等于余额-当前使用金额
 							}else{
-								this.payAllPrice = this.allPrice - this.userMoney - this.couponAmount       	// 订单最终支付金额等于订单金额-账户余额
+								this.payAllPrice = this.allPrice - this.userMoney - this.couponAmount // 订单最终支付金额等于订单金额-账户余额
 								this.deductMoney = this.userMoney				            // 当前使用金额等于总余额
 								this.surplusMoney = this.userMoney - this.deductMoney	    // 剩余余额等于总余额-当前使用金额
 							}
@@ -378,12 +379,13 @@
 			},
 			attributeNofreight(){// 计算没有邮费的支付价格
 				if(this.ischecked){
-					if(this.userMoney>=this.payAllPrice){
+					let totalAmount = this.allPrice - this.couponAmount
+					if(this.userMoney >= totalAmount){
 						this.payAllPrice = 0.00
 						this.deductMoney = this.allPrice - this.couponAmount 		// 当前使用金额等于订单金额
 						this.surplusMoney = this.userMoney - this.deductMoney	    // 剩余金额等于余额-当前使用金额
 					}else{
-						this.payAllPrice = this.allPrice - this.userMoney - this.couponAmount       	// 订单最终支付金额等于订单金额-账户余额
+						this.payAllPrice = this.allPrice - this.userMoney - this.couponAmount // 订单最终支付金额等于订单金额-账户余额
 						this.deductMoney = this.userMoney				            // 当前使用金额等于总余额
 						this.surplusMoney = this.userMoney - this.deductMoney	    // 剩余余额等于总余额-当前使用金额
 					}
@@ -396,9 +398,9 @@
 				console.log('优惠券金额',this.couponAmount)
 			},
 			attributeHashfreight(freight){// 计算需要邮费的支付价格
-				this.payAllPrice = this.allPrice + parseInt(freight) - this.couponAmount // 计算不包邮的价格 总价等于商品价格+邮费
+				let totalAmount = this.allPrice + parseInt(freight) - this.couponAmount//计算不包邮的价格 总价等于商品价格+邮费
 				if(this.ischecked){
-					if(this.userMoney>=this.payAllPrice){// 全部抵扣
+					if(this.userMoney >= totalAmount){// 全部抵扣
 						this.payAllPrice =0.00
 						if(this.isCheckedBeans){// 抵扣运费了
 							this.deductMoney =  this.allPrice - this.couponAmount			// 当前使用金额等于订单金额