|
@@ -177,8 +177,8 @@
|
|
|
<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&&!isAddCart">
|
|
|
- <view class="totalBar-box">
|
|
|
+ <view v-if="!isAddCart">
|
|
|
+ <view class="totalBar-box" v-if="hasBalancePay">
|
|
|
<view class="flex align_center justify_between">
|
|
|
<view>总金额</view>
|
|
|
<view><text class="pf">¥</text>{{totalAmount}}</view>
|
|
@@ -198,7 +198,7 @@
|
|
|
<view><text class="pf">¥</text>{{payAmount}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <payOptions v-model="payType" :hasBalancePay="hasBalancePay" :hasPay="hasPay" @change="v=>hasKdk=v!=2" :balance="storeAccount?storeAccount.rechargeBalance:0"></payOptions>
|
|
|
+ <payOptions v-model="payType" :hasBalancePay="showBalanceAuth" :hasPay="hasPay" @change="v=>hasKdk=v!=2" :balance="storeAccount?storeAccount.rechargeBalance:0"></payOptions>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="popu-content-btn">
|
|
@@ -339,6 +339,10 @@
|
|
|
const shelfInfo = this.shelfInfo
|
|
|
return shelfInfo&&shelfInfo.minAmount ? shelfInfo.minAmount : 0
|
|
|
},
|
|
|
+ // 抵扣余额支付是否可用
|
|
|
+ showBalanceAuth(){
|
|
|
+ return this.$store.state.vuex_showBalanceAuth
|
|
|
+ },
|
|
|
// 抵扣余额支付是否可用,有【余额支付权限】且该产品有抵扣金额
|
|
|
hasBalancePay(){
|
|
|
return this.$store.state.vuex_showBalanceAuth&&this.storeAccount.giveBalance&&this.detail&&!this.detail.shopPromoProduct
|
|
@@ -449,10 +453,12 @@
|
|
|
}
|
|
|
}
|
|
|
res.data.priceStr = Number(bprice).toFixed(2).toString().split('.')
|
|
|
+ res.data.price = bprice
|
|
|
// 可抵扣金额小于抵扣金额且大于0
|
|
|
const kdk = res.data.shopProductSubsidy&&res.data.shopProductSubsidy.subsidyAmount>0&&res.data.shopProductSubsidy.subsidyAmount<this.storeAccount.giveBalance
|
|
|
this.hasKdk = kdk
|
|
|
}
|
|
|
+ console.log(this.detail)
|
|
|
}
|
|
|
uni.hideLoading()
|
|
|
})
|
|
@@ -532,19 +538,33 @@
|
|
|
// 打开数量选择弹框
|
|
|
if(!this.showPopu){
|
|
|
this.showPopu = true
|
|
|
- this.payType = this.hasBalancePay ? 0 : (this.hasPay ? 1 : 2)
|
|
|
+ this.payType = this.showBalanceAuth ? 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({
|
|
|
- content: '支付金额不能小于'+this.minPayAmount+'元!',
|
|
|
- showCancel:false,
|
|
|
- confirmText:'知道了'
|
|
|
- })
|
|
|
- }else{
|
|
|
- // 去结算生产订单
|
|
|
- this.creatOrder()
|
|
|
+ // 充值余额支付
|
|
|
+ if(this.payType == 0){
|
|
|
+ if(this.storeAccount.rechargeBalance<this.payAmount){
|
|
|
+ uni.showModal({
|
|
|
+ content: '充值余额不足!',
|
|
|
+ showCancel:false,
|
|
|
+ confirmText:'知道了'
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
+ // 微信支付
|
|
|
+ if(this.payType == 1){
|
|
|
+ if(this.hasPay && this.minPayAmount>this.payAmount){
|
|
|
+ uni.showModal({
|
|
|
+ content: '支付金额不能小于'+this.minPayAmount+'元!',
|
|
|
+ showCancel:false,
|
|
|
+ confirmText:'知道了'
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 去结算生产订单
|
|
|
+ this.creatOrder()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -639,23 +659,39 @@
|
|
|
// 这里判断是否开通支付,如果开通打开确认付款弹框
|
|
|
if(this.hasPay){
|
|
|
// 计算待付款剩余倒计时
|
|
|
- res.data.timestamp = (new Date(res.data.createDate.replace(/-/g,'/')).getTime() + 1800000 - new Date().getTime())/1000
|
|
|
+ if(this.payType==1){
|
|
|
+ res.data.timestamp = (new Date(res.data.createDate.replace(/-/g,'/')).getTime() + 1800000 - new Date().getTime())/1000
|
|
|
+ }
|
|
|
purchasePay({
|
|
|
bizSn:res.data.purchaseSn,
|
|
|
bizNo:res.data.purchaseNo,
|
|
|
bizType:'SETTLE_BILL',
|
|
|
payUserOpenId: this.$store.state.vuex_openid || uni.getStorageSync('openid'),
|
|
|
- settleType: this.payType == 0 ? 'RECHARGE_BALANCE' : 'WXPAY_ONLINE'
|
|
|
- }).then(res=>{
|
|
|
- // 微信支付
|
|
|
- if(this.payType == 1){
|
|
|
- this.showPay = true
|
|
|
- this.payData = res.data?res.data.payRequestRest:null
|
|
|
+ settleType: this.payType == 0 ? 'RECHARGE_BALANCE' : 'PAY_WECHAT_ONLINE'
|
|
|
+ }).then(ret=>{
|
|
|
+ if(ret.status == 200){
|
|
|
+ // 微信支付
|
|
|
+ if(this.payType == 1){
|
|
|
+ if(ret.data){
|
|
|
+ this.showPay = true
|
|
|
+ this.payData = ret.data?ret.data.payRequestRest:null
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ title: '支付失败',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ // 余额支付
|
|
|
+ this.showPay = true
|
|
|
+ this.showPopu = false
|
|
|
+ this.submitOk = true
|
|
|
+ }
|
|
|
}else{
|
|
|
- // 余额支付
|
|
|
- this.showPay = true
|
|
|
- this.showPopu = false
|
|
|
- this.submitOk = true
|
|
|
+ uni.showToast({
|
|
|
+ title: ret.message,
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
}
|
|
|
uni.hideLoading()
|
|
|
})
|