|
@@ -39,14 +39,14 @@
|
|
<text class="price">¥{{Number(totalAmount).toFixed(2)}}</text>
|
|
<text class="price">¥{{Number(totalAmount).toFixed(2)}}</text>
|
|
</view>
|
|
</view>
|
|
<view class="product-price-item" v-if="showBalanceAuth&&subsidyAmount">
|
|
<view class="product-price-item" v-if="showBalanceAuth&&subsidyAmount">
|
|
- <view class="flex align_center" v-if="storeAccount">抵扣(余额:¥{{storeAccount.giveBalance}})</view>
|
|
|
|
|
|
+ <view class="flex align_center" v-if="storeAccount">抵扣(余额:¥{{Number(storeAccount.giveBalance).toFixed(2)}})</view>
|
|
<view class="flex align_center" v-if="!disKdk" @click="hasKdk=!hasKdk">
|
|
<view class="flex align_center" v-if="!disKdk" @click="hasKdk=!hasKdk">
|
|
<uni-icons size="18" :type="hasKdk?'checkbox-filled':'checkbox'" color="#2196f3"></uni-icons>
|
|
<uni-icons size="18" :type="hasKdk?'checkbox-filled':'checkbox'" color="#2196f3"></uni-icons>
|
|
- <text>¥{{subsidyAmount}}</text>
|
|
|
|
|
|
+ <text>¥{{Number(subsidyAmount).toFixed(2)}}</text>
|
|
</view>
|
|
</view>
|
|
<view class="flex align_center" v-else>
|
|
<view class="flex align_center" v-else>
|
|
<uni-icons size="18" type="circle-filled" color="#aaa"></uni-icons>
|
|
<uni-icons size="18" type="circle-filled" color="#aaa"></uni-icons>
|
|
- <text>¥{{subsidyAmount}}</text>
|
|
|
|
|
|
+ <text>¥{{Number(subsidyAmount).toFixed(2)}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="product-price-item" v-if="totalDiscount">
|
|
<view class="product-price-item" v-if="totalDiscount">
|
|
@@ -63,7 +63,7 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view style="margin-top: 10px;">
|
|
<view style="margin-top: 10px;">
|
|
- <payOptions v-model="payType" :hasBalancePay="hasBalancePay" :disableCz="disCzOption" :hasPay="shelfInfo&&shelfInfo.payOnlineFlag&&shelfInfo.payOnlineFlag=='1'" @change="v=>hasKdk=v!=2" :balance="storeAccount?storeAccount.rechargeBalance:0"></payOptions>
|
|
|
|
|
|
+ <payOptions v-model="payType" :hasBalancePay="showBalanceAuth" :disableCz="disCzOption" :hasPay="shelfInfo&&shelfInfo.payOnlineFlag&&shelfInfo.payOnlineFlag=='1'" @change="payTypeChange" :balance="storeAccount?storeAccount.rechargeBalance:0"></payOptions>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</scroll-view>
|
|
</scroll-view>
|
|
@@ -152,6 +152,9 @@
|
|
watch: {
|
|
watch: {
|
|
hasBalancePay(v){
|
|
hasBalancePay(v){
|
|
this.payType = v ? 0 : (this.hasPay ? 1 : 2)
|
|
this.payType = v ? 0 : (this.hasPay ? 1 : 2)
|
|
|
|
+ },
|
|
|
|
+ disKdk(v){
|
|
|
|
+ this.hasKdk = !v
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -179,12 +182,12 @@
|
|
storeAccount(){
|
|
storeAccount(){
|
|
return this.$store.state.vuex_storeAccount
|
|
return this.$store.state.vuex_storeAccount
|
|
},
|
|
},
|
|
- // 禁用抵扣金额
|
|
|
|
|
|
+ // 禁用抵扣金额,选择线上支付时,禁用抵扣金额
|
|
disKdk(){
|
|
disKdk(){
|
|
const kdk = this.storeAccount&&this.subsidyAmount>0&&this.subsidyAmount<=this.storeAccount.giveBalance
|
|
const kdk = this.storeAccount&&this.subsidyAmount>0&&this.subsidyAmount<=this.storeAccount.giveBalance
|
|
- return !kdk
|
|
|
|
|
|
+ return !kdk||this.payType==2
|
|
},
|
|
},
|
|
- // 禁用的支付选项
|
|
|
|
|
|
+ // 禁用的充值支付选项,合计金额大于充值余额禁用
|
|
disCzOption(){
|
|
disCzOption(){
|
|
const ta = this.hasKdk&&this.totalAmount?this.totalAmount-this.subsidyAmount:this.totalAmount
|
|
const ta = this.hasKdk&&this.totalAmount?this.totalAmount-this.subsidyAmount:this.totalAmount
|
|
return ta>this.storeAccount.rechargeBalance
|
|
return ta>this.storeAccount.rechargeBalance
|
|
@@ -208,6 +211,12 @@
|
|
goBack(){
|
|
goBack(){
|
|
uni.navigateBack()
|
|
uni.navigateBack()
|
|
},
|
|
},
|
|
|
|
+ payTypeChange(v){
|
|
|
|
+ // 线下支付,不可使用抵扣金额
|
|
|
|
+ if(v==2){
|
|
|
|
+ this.hasKdk = false
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// 去结算
|
|
// 去结算
|
|
settlement(){
|
|
settlement(){
|
|
if(this.totalAmount>0){
|
|
if(this.totalAmount>0){
|
|
@@ -407,10 +416,10 @@
|
|
item.giftQty = item.promoType=='BUY_PROD_GIVE_PROD' ? Math.floor(item.qty / item.conditionValue)*item.resultValue : 0
|
|
item.giftQty = item.promoType=='BUY_PROD_GIVE_PROD' ? Math.floor(item.qty / item.conditionValue)*item.resultValue : 0
|
|
})
|
|
})
|
|
})
|
|
})
|
|
- // 总可抵扣金额有余额支付权限,且总抵扣金额小于等于抵扣余额
|
|
|
|
- this.hasKdk = this.subsidyAmount>0&&this.storeAccount&&this.subsidyAmount<=this.storeAccount.giveBalance&&this.showBalanceAuth
|
|
|
|
// 默认支付方式
|
|
// 默认支付方式
|
|
this.payType = this.hasBalancePay ? 0 : (this.hasPay ? 1 : 2)
|
|
this.payType = this.hasBalancePay ? 0 : (this.hasPay ? 1 : 2)
|
|
|
|
+ // 总可抵扣金额有余额支付权限,且总抵扣金额小于等于抵扣余额,且支付方式不是线下支付
|
|
|
|
+ this.hasKdk = this.subsidyAmount>0&&this.storeAccount&&this.subsidyAmount<=this.storeAccount.giveBalance&&this.showBalanceAuth&&this.payType!=2
|
|
},
|
|
},
|
|
}
|
|
}
|
|
}
|
|
}
|