|
@@ -12,8 +12,8 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="freight-bean" v-if="freePostFlag == 1">
|
|
|
- <view class="bean-le">可用{{ freightMoney*100 }}采美豆抵用{{ freightMoney }}元运费</view>
|
|
|
+ <view class="freight-bean" v-if="isBeansShow">
|
|
|
+ <view class="bean-le">可用{{ freightBeansMoney*100 }}采美豆抵用{{ freightBeansMoney }}元运费</view>
|
|
|
<view class="bean-ri">
|
|
|
<view class="checkbox-box">
|
|
|
<button class="checkbox iconfont"
|
|
@@ -45,7 +45,10 @@
|
|
|
isShowOption:false,
|
|
|
optionList:['到付'],
|
|
|
freePostFlag:'',
|
|
|
- ischecked:false
|
|
|
+ ischecked:false,
|
|
|
+ isBeansShow:false,
|
|
|
+ userBeans:0,
|
|
|
+ freightBeansMoney:0,
|
|
|
|
|
|
}
|
|
|
},
|
|
@@ -63,17 +66,31 @@
|
|
|
this.freightText = '包邮'
|
|
|
this.freightData.freight = 0
|
|
|
this.freePostFlag = res.freePostFlag
|
|
|
+ this.isBeansShow = false
|
|
|
break
|
|
|
case 1:
|
|
|
this.freightText = ''
|
|
|
- this.freightMoney = res.freight
|
|
|
+ this.freightMoney = this.freightBeansMoney = res.freight
|
|
|
+ this.userBeans = res.userBeans
|
|
|
this.freePostFlag = res.freePostFlag
|
|
|
this.optionList.unshift(this.orderPriceToFixed(this.freightMoney))
|
|
|
+ if( res.userBeans >= this.freightMoney*100 ){
|
|
|
+ this.isBeansShow = true
|
|
|
+ }else{
|
|
|
+ this.isBeansShow = false
|
|
|
+ }
|
|
|
break
|
|
|
case -1:
|
|
|
this.freightText = '到付'
|
|
|
+ this.userBeans = res.userBeans
|
|
|
this.freePostFlag = res.freePostFlag
|
|
|
this.freightData.freight = 0
|
|
|
+ if( res.userBeans >= 3000 ){
|
|
|
+ this.freightBeansMoney = 30
|
|
|
+ this.isBeansShow = true
|
|
|
+ }else{
|
|
|
+ this.isBeansShow = false
|
|
|
+ }
|
|
|
break
|
|
|
}
|
|
|
},
|
|
@@ -86,37 +103,39 @@
|
|
|
case 0:
|
|
|
self.freightMoney = self.infoData.freight
|
|
|
self.freePostFlag = 1
|
|
|
+ self.freightBeansMoney = self.freightMoney
|
|
|
+ if( self.userBeans >= self.freightMoney*100 ){
|
|
|
+ self.isBeansShow = true
|
|
|
+ }else{
|
|
|
+ self.isBeansShow = false
|
|
|
+ }
|
|
|
break
|
|
|
case 1:
|
|
|
self.freePostFlag = -1
|
|
|
- self.freightMoney ='到付'
|
|
|
+ self.freightMoney = '到付'
|
|
|
+ self.freightBeansMoney = 30
|
|
|
+ if( self.userBeans >= 3000 ){
|
|
|
+ self.freightBeansMoney = 30
|
|
|
+ self.isBeansShow = true
|
|
|
+ }else{
|
|
|
+ self.isBeansShow = false
|
|
|
+ }
|
|
|
break
|
|
|
}
|
|
|
- self.$emit('confirmFreight',self.freePostFlag);
|
|
|
+ let obj = {
|
|
|
+ freePostFlag :self.freePostFlag,
|
|
|
+ freightBeansMoney: self.freightBeansMoney
|
|
|
+ }
|
|
|
+ self.$emit('confirmFreight',obj);
|
|
|
},
|
|
|
fail: function (res) {
|
|
|
console.log(res.errMsg);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- checkedBalabce(){//勾选使用余额
|
|
|
+ checkedBalabce(){//勾选使用采美豆抵扣
|
|
|
this.ischecked = !this.ischecked
|
|
|
- if(this.userMoney > 0){
|
|
|
- this.ischecked = !this.ischecked
|
|
|
- if(this.ischecked){
|
|
|
- this.balanceDeductionFlag =1
|
|
|
- this.attributePallPrice()
|
|
|
- }else{
|
|
|
- if(this.hanldFreePostFlag == 1 || this.hanldFreePostFlag == '1'){
|
|
|
- this.payAllPrice = this.allPrice+parseInt(this.freightData.freight)
|
|
|
- }else{
|
|
|
- this.payAllPrice = this.allPrice
|
|
|
- }
|
|
|
- this.balanceDeductionFlag = 2
|
|
|
- }
|
|
|
- }else{
|
|
|
- return
|
|
|
- }
|
|
|
+ this.$emit('confirmFreightBeans',this.ischecked);
|
|
|
},
|
|
|
orderPriceToFixed (value){
|
|
|
let price ='';
|