|
@@ -138,7 +138,7 @@
|
|
|
特价<text>¥{{detail.orginPrice}}</text>
|
|
|
</view>
|
|
|
<view class="flex align_center rebate-tag"
|
|
|
- v-if="hasLogin&&detail.shopProductSubsidy&&detail.shopProductSubsidy.subsidyAmount<item.price&&!detail.shopPromoProduct">
|
|
|
+ v-if="hasLogin&&detail.shopProductSubsidy&&detail.shopProductSubsidy.subsidyAmount<detail.price&&!detail.shopPromoProduct">
|
|
|
可抵扣<text>¥{{detail.shopProductSubsidy.subsidyAmount}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -177,7 +177,7 @@
|
|
|
<text>配送商:{{shelfInfo.dealerName}}</text>
|
|
|
<view @click="callPhone()"><uni-icons size="18" type="phone" color="dodgerblue"></uni-icons><text style="font-size:12px;">拨打</text></view>
|
|
|
</view>
|
|
|
- <view v-if="hasBalancePay&&storeAccount.giveBalance&&!isAddCart">
|
|
|
+ <view v-if="hasBalancePay&&!isAddCart">
|
|
|
<view class="totalBar-box">
|
|
|
<view class="flex align_center justify_between">
|
|
|
<view>总金额</view>
|
|
@@ -185,17 +185,20 @@
|
|
|
</view>
|
|
|
<view class="flex align_center justify_between">
|
|
|
<view v-if="storeAccount">抵扣(余额:<text class="pf">¥</text>{{storeAccount.giveBalance}})</view>
|
|
|
- <view class="flex align_center" v-if="detail.shopProductSubsidy" @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>
|
|
|
<text class="pf">¥</text>{{detail.shopProductSubsidy.subsidyAmount}}
|
|
|
</view>
|
|
|
+ <view class="flex align_center" v-else>
|
|
|
+ <text class="pf">¥</text>{{detail.shopProductSubsidy.subsidyAmount}}
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <view class="flex align_center justify_between" v-if="detail.shopProductSubsidy">
|
|
|
- <view>合计</view>
|
|
|
- <view><text class="pf">¥</text>{{Number(totalAmount-(hasKdk?detail.shopProductSubsidy.subsidyAmount:0)).toFixed(2)}}</view>
|
|
|
+ <view class="flex align_center justify_end" v-if="detail.shopProductSubsidy">
|
|
|
+ <view>合计:</view>
|
|
|
+ <view><text class="pf">¥</text>{{payAmount}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <payOptions v-model="payType" :balance="storeAccount?storeAccount.rechargeBalance:0"></payOptions>
|
|
|
+ <payOptions v-model="payType" :hasBalancePay="hasBalancePay" :hasPay="hasPay" @change="v=>hasKdk=v!=2" :balance="storeAccount?storeAccount.rechargeBalance:0"></payOptions>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="popu-content-btn">
|
|
@@ -229,8 +232,11 @@
|
|
|
<view></view>
|
|
|
</view>
|
|
|
<view class="popu-content-pay flex align_center justify_between">
|
|
|
- <view class="flex align_center"><uni-icons size="20" type="weixin" color="#4CAF50"></uni-icons> <text style="margin-left: 5px;">微信支付</text></view>
|
|
|
- <view><uni-icons size="22" type="checkbox-filled" color="red"></uni-icons></view>
|
|
|
+ <view class="flex align_center">
|
|
|
+ <uni-icons size="20" type="weixin" color="#4CAF50"></uni-icons>
|
|
|
+ <text style="margin-left: 5px;">微信支付</text>
|
|
|
+ </view>
|
|
|
+ <view><uni-icons size="22" type="checkbox-filled" color="#2196f3"></uni-icons></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="popu-content-btn">
|
|
@@ -291,9 +297,8 @@
|
|
|
showPay: false, // 是否显示付款信息
|
|
|
isAddCart: false, // 是否加入购物车
|
|
|
payData: null, // 支付参数
|
|
|
- payType: 0, // 支付方式,抵扣、还是微信
|
|
|
+ payType: 0, // 支付方式,0抵扣、1微信,2线下
|
|
|
hasKdk: false,
|
|
|
- disKdk: false,
|
|
|
}
|
|
|
},
|
|
|
onLoad(option) {
|
|
@@ -324,10 +329,10 @@
|
|
|
shelfInfo(){
|
|
|
return this.$store.state.vuex_storeShelf
|
|
|
},
|
|
|
- //是否开启线上支付
|
|
|
+ //是否开启线上支付,支付方式不是线下支付
|
|
|
hasPay(){
|
|
|
const shelfInfo = this.shelfInfo
|
|
|
- return shelfInfo&&shelfInfo.payOnlineFlag&&shelfInfo.payOnlineFlag=='1'
|
|
|
+ return shelfInfo&&shelfInfo.payOnlineFlag&&shelfInfo.payOnlineFlag=='1'&&this.payType!=2
|
|
|
},
|
|
|
// 最小支付金额
|
|
|
minPayAmount(){
|
|
@@ -336,11 +341,16 @@
|
|
|
},
|
|
|
// 抵扣余额支付是否可用,有【余额支付权限】且该产品有抵扣金额
|
|
|
hasBalancePay(){
|
|
|
- return this.$store.state.vuex_showBalanceAuth
|
|
|
+ return this.$store.state.vuex_showBalanceAuth&&this.storeAccount.giveBalance&&this.detail&&!this.detail.shopPromoProduct
|
|
|
},
|
|
|
storeAccount(){
|
|
|
return this.$store.state.vuex_storeAccount
|
|
|
},
|
|
|
+ // 禁用抵扣金额
|
|
|
+ disKdk(){
|
|
|
+ const kdk = this.detail&&this.detail.shopProductSubsidy&&this.storeAccount&&this.detail.shopProductSubsidy.subsidyAmount>0&&this.detail.shopProductSubsidy.subsidyAmount<this.storeAccount.giveBalance
|
|
|
+ return this.payType==2 || !kdk
|
|
|
+ },
|
|
|
// 经销商电话
|
|
|
dealerPhone(){
|
|
|
const shelfInfo = this.shelfInfo
|
|
@@ -353,15 +363,14 @@
|
|
|
totalAmount(){
|
|
|
return this.hasLogin&&this.detail&&this.detail.price * this.qty
|
|
|
},
|
|
|
+ // 支付合计,结算金额
|
|
|
+ payAmount(){
|
|
|
+ return Number(this.totalAmount-(this.hasKdk&&this.detail&&this.detail.shopProductSubsidy?this.detail.shopProductSubsidy.subsidyAmount:0)).toFixed(2)
|
|
|
+ },
|
|
|
// 赠品数量
|
|
|
giftNum(){
|
|
|
return this.detail && this.detail.promoType=='BUY_PROD_GIVE_PROD' ? Math.floor(this.qty / this.detail.conditionValue)*this.detail.resultValue : 0
|
|
|
},
|
|
|
- // 支付总金额
|
|
|
- payAmount(){
|
|
|
- const price = this.detail && this.detail.priceStr ? this.detail.priceStr.join('.') : 0
|
|
|
- return price ? Number(price*this.qty).toFixed(2) : 0
|
|
|
- },
|
|
|
// 付款信息
|
|
|
payInfo(){
|
|
|
return this.$store.state.vuex_tempOrderData
|
|
@@ -443,7 +452,6 @@
|
|
|
// 可抵扣金额小于抵扣金额且大于0
|
|
|
const kdk = res.data.shopProductSubsidy&&res.data.shopProductSubsidy.subsidyAmount>0&&res.data.shopProductSubsidy.subsidyAmount<this.storeAccount.giveBalance
|
|
|
this.hasKdk = kdk
|
|
|
- this.disKdk = !kdk
|
|
|
}
|
|
|
}
|
|
|
uni.hideLoading()
|
|
@@ -524,6 +532,8 @@
|
|
|
// 打开数量选择弹框
|
|
|
if(!this.showPopu){
|
|
|
this.showPopu = true
|
|
|
+ this.payType = this.hasBalancePay ? 0 : (this.hasPay ? 1 : 2)
|
|
|
+ this.hasKdk = this.detail.shopProductSubsidy&&this.detail.shopProductSubsidy.subsidyAmount>0&&this.detail.shopProductSubsidy.subsidyAmount<this.storeAccount.giveBalance
|
|
|
}else{
|
|
|
if(this.hasPay && this.minPayAmount>this.payAmount){
|
|
|
uni.showModal({
|