|
@@ -296,9 +296,11 @@
|
|
|
this.isFreight = true
|
|
|
this.freightData = response.data
|
|
|
if(response.data.freePostFlag== 1){
|
|
|
- this.payAllPrice = this.allPrice+response.data.freight
|
|
|
+ this.payAllPrice = this.allPrice + response.data.freight
|
|
|
+ this.attributePallPrice()
|
|
|
}else{
|
|
|
this.payAllPrice = this.allPrice
|
|
|
+ this.attributePallPrice()
|
|
|
}
|
|
|
})
|
|
|
})
|
|
@@ -328,7 +330,7 @@
|
|
|
handleChoiceaFreightData(data){//获取运费信息
|
|
|
if(data.freePostFlag == '1'){
|
|
|
this.freightData = data
|
|
|
- this.payAllPrice = this.allPrice+parseInt(data.freight)
|
|
|
+ this.payAllPrice = this.allPrice + parseInt(data.freight)
|
|
|
this.attributePallPrice()
|
|
|
}else{
|
|
|
this.freightData = data
|
|
@@ -355,16 +357,19 @@
|
|
|
}else{
|
|
|
this.balanceDeductionFlag = 2
|
|
|
if(this.freightData.freePostFlag == 1 || this.freightData.freePostFlag == '1'){
|
|
|
- this.payAllPrice = this.allPrice+parseInt(this.freightData.freight)
|
|
|
+ this.payAllPrice = this.allPrice+parseInt(this.freightData.freight) - this.couponAmount
|
|
|
}else{
|
|
|
- this.payAllPrice = this.allPrice
|
|
|
+ this.payAllPrice = this.allPrice - this.couponAmount
|
|
|
}
|
|
|
}
|
|
|
+ console.log('最终订单支付金额',this.payAllPrice)
|
|
|
+ console.log('优惠券金额',this.couponAmount)
|
|
|
}else{
|
|
|
return
|
|
|
}
|
|
|
},
|
|
|
attributePallPrice(){//计算价格
|
|
|
+ console.log('运费',this.freightData.freight)
|
|
|
if(this.freightData.freePostFlag == 1 || this.freightData.freePostFlag == '1'){
|
|
|
this.attributeHashfreight(this.freightData.freight)
|
|
|
}else{
|
|
@@ -375,36 +380,40 @@
|
|
|
if(this.ischecked){
|
|
|
if(this.userMoney>this.payAllPrice){
|
|
|
this.payAllPrice = 0.00
|
|
|
- this.deductMoney = this.allPrice //勾选后使用抵余额
|
|
|
- this.surplusMoney = this.userMoney - this.deductMoney //勾选后的剩余抵扣
|
|
|
+ this.deductMoney = this.allPrice - this.couponAmount // 勾选后使用抵余额
|
|
|
+ this.surplusMoney = this.userMoney - this.deductMoney // 勾选后的剩余抵扣
|
|
|
}else{
|
|
|
this.payAllPrice = this.allPrice - this.userMoney - this.couponAmount //勾选后的总价
|
|
|
- this.deductMoney = this.userMoney //勾选后使用抵余额
|
|
|
- this.surplusMoney = this.userMoney - this.deductMoney //勾选后的剩余抵扣
|
|
|
+ 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;
|
|
|
}
|
|
|
+ console.log('最终订单支付金额',this.payAllPrice)
|
|
|
+ console.log('优惠券金额',this.couponAmount)
|
|
|
},
|
|
|
attributeHashfreight(freight){//计算需要邮费的支付价格
|
|
|
- this.payAllPrice = this.allPrice+parseInt(freight)//计算不包邮的价格 总价等于商品价格+邮费
|
|
|
+ this.payAllPrice = this.allPrice + parseInt(freight) - this.couponAmount//计算不包邮的价格 总价等于商品价格+邮费
|
|
|
if(this.ischecked){
|
|
|
if(this.userMoney>this.payAllPrice){ //余额大于支付金额
|
|
|
this.payAllPrice =0.00
|
|
|
- this.deductMoney = this.allPrice+parseInt(freight) //勾选后使用抵余额
|
|
|
+ this.deductMoney = this.allPrice + parseInt(freight) - this.couponAmount //勾选后使用抵余额
|
|
|
this.surplusMoney = this.userMoney - this.deductMoney //勾选后的剩余抵扣
|
|
|
}else{
|
|
|
- this.payAllPrice = this.allPrice+parseInt(freight) - this.userMoney - this.couponAmount //勾选后的总价
|
|
|
+ this.payAllPrice = this.allPrice + parseInt(freight) - this.userMoney - this.couponAmount //勾选后的总价
|
|
|
this.deductMoney = this.userMoney //勾选后使用抵余额
|
|
|
this.surplusMoney = this.userMoney - this.deductMoney //勾选后的剩余抵扣
|
|
|
}
|
|
|
}else{
|
|
|
- this.payAllPrice = this.allPrice+parseInt(freight) - this.couponAmount
|
|
|
+ this.payAllPrice = this.allPrice + parseInt(freight) - this.couponAmount
|
|
|
this.deductMoney = 0.00
|
|
|
this.surplusMoney = this.userMoney
|
|
|
}
|
|
|
+ console.log('最终订单支付金额',this.payAllPrice)
|
|
|
+ console.log('优惠券金额',this.couponAmount)
|
|
|
},
|
|
|
orderSubmitMit(){//提交订单
|
|
|
if(this.addressID == ''){
|