|
@@ -175,17 +175,28 @@
|
|
|
}
|
|
|
this.OrderService.GetOrderPostage(params).then(response =>{
|
|
|
this.isFreight = true
|
|
|
+ this.isCheckedBeans = false
|
|
|
this.freightData = response.data
|
|
|
this.hanldFreePostFlag = response.data.freePostFlag
|
|
|
this.hanldFreight = response.data.freight
|
|
|
if(this.hanldFreePostFlag == 1){
|
|
|
- this.freightBeansMoney = response.data.freight
|
|
|
+ if( this.freightData.userBeans >= this.hanldFreight*100 ){
|
|
|
+ this.freightBeansMoney = this.hanldFreight
|
|
|
+ }else{
|
|
|
+ this.freightBeansMoney = 0
|
|
|
+ }
|
|
|
this.payAllPrice = this.allPrice + response.data.freight
|
|
|
this.attributePallPrice()
|
|
|
+ this.hanldFreightBeans(this.isCheckedBeans)
|
|
|
}else{
|
|
|
- this.freightBeansMoney = 30
|
|
|
+ if( this.freightData.userBeans >= 3000 ){
|
|
|
+ this.freightBeansMoney = 30
|
|
|
+ }else{
|
|
|
+ this.freightBeansMoney = 0
|
|
|
+ }
|
|
|
this.payAllPrice = this.allPrice
|
|
|
this.attributePallPrice()
|
|
|
+ this.hanldFreightBeans(this.isCheckedBeans)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -235,13 +246,20 @@
|
|
|
hanldFreightBeans(data){//是否勾选采美豆抵扣
|
|
|
this.isCheckedBeans = data;
|
|
|
if(this.isCheckedBeans){
|
|
|
- this.hanldUserBeans = this.freightBeansMoney*100
|
|
|
+ // 判断如果采美豆大于等于运费*100
|
|
|
+ if( this.freightData.userBeans >= this.hanldFreight*100 ){
|
|
|
+ this.hanldUserBeans = this.freightBeansMoney*100
|
|
|
+ }else{
|
|
|
+ this.hanldUserBeans = 0
|
|
|
+ }
|
|
|
+ // 计算抵扣后的总价
|
|
|
if(this.hanldFreePostFlag == 1){
|
|
|
this.payAllPrice = this.allPrice + this.hanldFreight - this.freightBeansMoney
|
|
|
console.log('抵扣',this.payAllPrice)
|
|
|
}
|
|
|
}else{
|
|
|
this.hanldUserBeans = 0
|
|
|
+ // 不抵扣时计算总价
|
|
|
if(this.hanldFreePostFlag == 1){
|
|
|
this.payAllPrice = this.allPrice + this.hanldFreight
|
|
|
console.log('不抵扣',this.payAllPrice)
|
|
@@ -254,6 +272,7 @@
|
|
|
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)
|