|
@@ -253,16 +253,28 @@
|
|
|
this.hanldUserBeans = 0
|
|
|
}
|
|
|
// 计算抵扣后的总价
|
|
|
- if(this.hanldFreePostFlag == 1){
|
|
|
- this.payAllPrice = this.allPrice + this.hanldFreight - this.freightBeansMoney
|
|
|
+ if(this.hanldFreePostFlag == 1){
|
|
|
+ // 如果使用了余额 最终价格
|
|
|
+ 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{
|
|
|
+ this.payAllPrice = this.allPrice + this.hanldFreight - this.freightBeansMoney
|
|
|
+ }
|
|
|
console.log('抵扣',this.payAllPrice)
|
|
|
}
|
|
|
- }else{
|
|
|
+ }else{// 采美豆不抵扣运费
|
|
|
this.hanldUserBeans = 0
|
|
|
// 不抵扣时计算总价
|
|
|
if(this.hanldFreePostFlag == 1){
|
|
|
- this.payAllPrice = this.allPrice + this.hanldFreight
|
|
|
- console.log('不抵扣',this.payAllPrice)
|
|
|
+ this.attributeHashfreight(this.hanldFreight)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -272,10 +284,13 @@
|
|
|
if(this.ischecked){
|
|
|
this.balanceDeductionFlag =1
|
|
|
this.attributePallPrice()
|
|
|
- this.hanldFreightBeans(this.isCheckedBeans)
|
|
|
}else{
|
|
|
- if(this.hanldFreePostFlag == 1 || this.hanldFreePostFlag == '1'){
|
|
|
- this.payAllPrice = this.allPrice+parseInt(this.freightData.freight)
|
|
|
+ if(this.hanldFreePostFlag == 1 || this.hanldFreePostFlag == '1'){ //如果是有运费时
|
|
|
+ if(this.isCheckedBeans){
|
|
|
+ this.payAllPrice = this.allPrice
|
|
|
+ }else{
|
|
|
+ this.payAllPrice = this.allPrice+parseInt(this.freightData.freight)
|
|
|
+ }
|
|
|
}else{
|
|
|
this.payAllPrice = this.allPrice
|
|
|
}
|
|
@@ -285,49 +300,54 @@
|
|
|
return
|
|
|
}
|
|
|
},
|
|
|
- attributePallPrice(){//计算价格
|
|
|
+ attributePallPrice(){// 计算价格
|
|
|
if(this.hanldFreePostFlag == 1 || this.hanldFreePostFlag == '1'){
|
|
|
this.attributeHashfreight(this.freightData.freight)
|
|
|
}else{
|
|
|
this.attributeNofreight()
|
|
|
}
|
|
|
},
|
|
|
- attributeNofreight(){//计算没有邮费的支付价格
|
|
|
+ attributeNofreight(){// 计算没有邮费的支付价格
|
|
|
if(this.ischecked){
|
|
|
- if(this.userMoney>this.payAllPrice){
|
|
|
+ if(this.userMoney>=this.payAllPrice){
|
|
|
this.payAllPrice = 0.00
|
|
|
- this.deductMoney = this.allPrice //勾选后使用抵余额
|
|
|
- this.surplusMoney = this.userMoney - this.deductMoney //勾选后的剩余抵扣
|
|
|
+ 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 //勾选后的剩余抵扣
|
|
|
+ this.payAllPrice = this.allPrice - this.userMoney // 订单最终支付金额等于订单金额-账户余额
|
|
|
+ this.deductMoney = this.userMoney // 当前使用金额等于总余额
|
|
|
+ this.surplusMoney = this.userMoney - this.deductMoney // 剩余余额等于总余额-当前使用金额
|
|
|
}
|
|
|
}else{
|
|
|
this.payAllPrice = this.allPrice;
|
|
|
- this.deductMoney = 0.00;
|
|
|
- this.surplusMoney = this.userMoney;
|
|
|
+ this.deductMoney = 0.00; // 当前使用
|
|
|
+ this.surplusMoney = this.userMoney; // 剩余余额
|
|
|
}
|
|
|
},
|
|
|
- attributeHashfreight(freight){//计算需要邮费的支付价格
|
|
|
- this.payAllPrice = this.allPrice+parseInt(freight)//计算不包邮的价格 总价等于商品价格+邮费
|
|
|
+ attributeHashfreight(freight){// 计算需要邮费的支付价格
|
|
|
+ this.payAllPrice = this.allPrice+parseInt(freight)// 计算不包邮的价格 总价等于商品价格+邮费
|
|
|
if(this.ischecked){
|
|
|
- if(this.userMoney>this.payAllPrice){ //余额大于支付金额
|
|
|
+ if(this.userMoney>=this.payAllPrice){// 余额大于支付金额
|
|
|
this.payAllPrice =0.00
|
|
|
- this.deductMoney = this.allPrice+parseInt(freight) //勾选后使用抵余额
|
|
|
- this.surplusMoney = this.userMoney - this.deductMoney //勾选后的剩余抵扣
|
|
|
+ if(this.isCheckedBeans){
|
|
|
+ this.deductMoney = this.allPrice // 当前使用金额等于订单金额
|
|
|
+ this.surplusMoney = this.userMoney - this.deductMoney // 剩余金额等于余额减去当前使用金额
|
|
|
+ }else{
|
|
|
+ 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 //勾选后的剩余抵扣
|
|
|
+ this.payAllPrice = this.allPrice+parseInt(freight) - this.userMoney // 订单最终支付金额等于订单金额+运费-账户余额
|
|
|
+ this.deductMoney = this.userMoney // 当前使用金额等于账户余额
|
|
|
+ this.surplusMoney = this.userMoney - this.deductMoney // 剩余余额等于账户余额-当前使用金额
|
|
|
}
|
|
|
}else{
|
|
|
this.payAllPrice = this.allPrice+parseInt(freight)
|
|
|
- this.deductMoney = 0.00
|
|
|
- this.surplusMoney = this.userMoney
|
|
|
+ this.deductMoney = 0.00 // 当前使用金额
|
|
|
+ this.surplusMoney = this.userMoney // 剩余余额
|
|
|
}
|
|
|
},
|
|
|
- orderSubmitMit(){//提交订单
|
|
|
+ orderSubmitMit(){// 提交订单
|
|
|
if(this.isSubLoading){ return; }
|
|
|
if(this.addressID == ''){
|
|
|
this.$util.msg('请先添加收货地址~',2000)
|