|
@@ -39,7 +39,7 @@
|
|
<view class="flex align_center tejia-tag" v-if="detail.promoType=='PROMO_PROD'">
|
|
<view class="flex align_center tejia-tag" v-if="detail.promoType=='PROMO_PROD'">
|
|
特价<text>¥{{detail.orginPrice}}</text>
|
|
特价<text>¥{{detail.orginPrice}}</text>
|
|
</view>
|
|
</view>
|
|
- <view class="flex align_center rebate-tag" v-if="detail.shopProductSubsidy&&!detail.shopPromoProduct&&showBalanceAuth">
|
|
|
|
|
|
+ <view class="flex align_center rebate-tag" v-if="detail.shopProductSubsidy&&detail.shopProductSubsidy.subsidyAmount<detail.price&&!detail.shopPromoProduct&&showBalanceAuth">
|
|
可抵扣<text>¥{{detail.shopProductSubsidy.subsidyAmount}}</text>
|
|
可抵扣<text>¥{{detail.shopProductSubsidy.subsidyAmount}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -183,7 +183,7 @@
|
|
<view>总金额</view>
|
|
<view>总金额</view>
|
|
<view><text class="pf">¥</text>{{totalAmount}}</view>
|
|
<view><text class="pf">¥</text>{{totalAmount}}</view>
|
|
</view>
|
|
</view>
|
|
- <view class="flex align_center justify_between" v-if="subsidyAmount">
|
|
|
|
|
|
+ <view class="flex align_center justify_between">
|
|
<view v-if="storeAccount">抵扣(余额:<text class="pf">¥</text>{{storeAccount.giveBalance}})</view>
|
|
<view v-if="storeAccount">抵扣(余额:<text class="pf">¥</text>{{storeAccount.giveBalance}})</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>
|
|
@@ -194,7 +194,7 @@
|
|
<text class="pf">¥</text>{{subsidyAmount}}
|
|
<text class="pf">¥</text>{{subsidyAmount}}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="flex align_center justify_end" v-if="detail.shopProductSubsidy">
|
|
|
|
|
|
+ <view class="flex align_center justify_end" v-if="detail&&detail.shopProductSubsidy">
|
|
<view>合计:</view>
|
|
<view>合计:</view>
|
|
<view style="font-weight: bold;"><text class="pf">¥</text>{{payAmount}}</view>
|
|
<view style="font-weight: bold;"><text class="pf">¥</text>{{payAmount}}</view>
|
|
</view>
|
|
</view>
|
|
@@ -338,7 +338,7 @@
|
|
//是否开启线上支付,且支付方式不是线下支付
|
|
//是否开启线上支付,且支付方式不是线下支付
|
|
hasPay(){
|
|
hasPay(){
|
|
const shelfInfo = this.shelfInfo
|
|
const shelfInfo = this.shelfInfo
|
|
- return shelfInfo&&shelfInfo.payOnlineFlag&&shelfInfo.payOnlineFlag=='1'&&this.payType!=2
|
|
|
|
|
|
+ return shelfInfo&&shelfInfo.payOnlineFlag&&shelfInfo.payOnlineFlag=='1'
|
|
},
|
|
},
|
|
// 最小支付金额
|
|
// 最小支付金额
|
|
minPayAmount(){
|
|
minPayAmount(){
|
|
@@ -351,7 +351,13 @@
|
|
},
|
|
},
|
|
// 抵扣余额支付是否可用,有【余额支付权限】且该产品有抵扣金额
|
|
// 抵扣余额支付是否可用,有【余额支付权限】且该产品有抵扣金额
|
|
hasBalancePay(){
|
|
hasBalancePay(){
|
|
- return this.$store.state.vuex_showBalanceAuth&&this.storeAccount&&this.storeAccount.giveBalance&&this.detail&&!this.detail.shopPromoProduct
|
|
|
|
|
|
+ // 抵扣金额是否小于售价
|
|
|
|
+ const isXPrice = this.detail&&this.detail.shopProductSubsidy&&this.detail.shopProductSubsidy.subsidyAmount<=this.detail.price
|
|
|
|
+ // 是否有促销活动
|
|
|
|
+ const hasProm = this.detail&&!this.detail.shopPromoProduct
|
|
|
|
+ // 抵扣余额是否为零
|
|
|
|
+ const izYue = this.storeAccount&&this.storeAccount.giveBalance
|
|
|
|
+ return this.$store.state.vuex_showBalanceAuth&&izYue&&hasProm&&isXPrice
|
|
},
|
|
},
|
|
// 门店账户信息
|
|
// 门店账户信息
|
|
storeAccount(){
|
|
storeAccount(){
|
|
@@ -361,14 +367,18 @@
|
|
disCzOption(){
|
|
disCzOption(){
|
|
return this.storeAccount && this.payAmount>this.storeAccount.rechargeBalance
|
|
return this.storeAccount && this.payAmount>this.storeAccount.rechargeBalance
|
|
},
|
|
},
|
|
- // 禁用抵扣金额
|
|
|
|
|
|
+ // 是否禁用抵扣金额
|
|
disKdk(){
|
|
disKdk(){
|
|
const kdk = this.detail&&this.detail.shopProductSubsidy&&this.storeAccount&&this.subsidyAmount>0&&this.subsidyAmount<=this.storeAccount.giveBalance
|
|
const kdk = this.detail&&this.detail.shopProductSubsidy&&this.storeAccount&&this.subsidyAmount>0&&this.subsidyAmount<=this.storeAccount.giveBalance
|
|
- return this.payType=='2' || !kdk
|
|
|
|
|
|
+ return !kdk
|
|
|
|
+ },
|
|
|
|
+ // 总金额
|
|
|
|
+ totalAmount(){
|
|
|
|
+ return Number(this.hasLogin&&this.detail&&this.detail.price * this.qty).toFixed(2)
|
|
},
|
|
},
|
|
// 抵扣金额
|
|
// 抵扣金额
|
|
subsidyAmount(){
|
|
subsidyAmount(){
|
|
- return this.detail&&this.detail.shopProductSubsidy&&this.detail.shopProductSubsidy.subsidyAmount||0
|
|
|
|
|
|
+ return Number(this.hasBalancePay?(this.detail&&this.detail.shopProductSubsidy&&this.detail.shopProductSubsidy.subsidyAmount||0) * this.qty:0).toFixed(2)
|
|
},
|
|
},
|
|
// 经销商电话
|
|
// 经销商电话
|
|
dealerPhone(){
|
|
dealerPhone(){
|
|
@@ -379,10 +389,6 @@
|
|
totalNum(){
|
|
totalNum(){
|
|
return this.hasLogin&&this.userInfo.sysUserFlag == '1' ? this.$store.state.vuex_cartTotal : 0
|
|
return this.hasLogin&&this.userInfo.sysUserFlag == '1' ? this.$store.state.vuex_cartTotal : 0
|
|
},
|
|
},
|
|
- // 总金额
|
|
|
|
- totalAmount(){
|
|
|
|
- return Number(this.hasLogin&&this.detail&&this.detail.price * this.qty).toFixed(2)
|
|
|
|
- },
|
|
|
|
// 支付合计,结算金额
|
|
// 支付合计,结算金额
|
|
payAmount(){
|
|
payAmount(){
|
|
return Number(this.totalAmount-(this.hasKdk&&this.detail&&this.detail.shopProductSubsidy?this.subsidyAmount:0)).toFixed(2)
|
|
return Number(this.totalAmount-(this.hasKdk&&this.detail&&this.detail.shopProductSubsidy?this.subsidyAmount:0)).toFixed(2)
|
|
@@ -553,10 +559,10 @@
|
|
// 打开数量选择弹框
|
|
// 打开数量选择弹框
|
|
if(!this.showPopu){
|
|
if(!this.showPopu){
|
|
this.showPopu = true
|
|
this.showPopu = true
|
|
- this.payType = this.showBalanceAuth ? '0' : (this.hasPay ? '1' : '2')
|
|
|
|
- if(this.hasBalancePay){
|
|
|
|
- this.payType = this.storeAccount.rechargeBalance<this.payAmount ? (this.hasPay? '1' : '2'):'0'
|
|
|
|
- }
|
|
|
|
|
|
+ // 结算金额大于充值余额时不可使用充值余额
|
|
|
|
+ this.payType = this.storeAccount.rechargeBalance<this.payAmount ? (this.hasPay? '1' : '2'):'0'
|
|
|
|
+ // 没有充值余额权限
|
|
|
|
+ this.payType = this.showBalanceAuth ? this.payType : (this.hasPay? '1' : '2')
|
|
// 有余额支付权限,且没有促销活动,且有抵扣金额,且抵扣金额小于等于抵扣余额
|
|
// 有余额支付权限,且没有促销活动,且有抵扣金额,且抵扣金额小于等于抵扣余额
|
|
this.hasKdk = this.detail.shopProductSubsidy&&this.subsidyAmount>0&&this.subsidyAmount<this.storeAccount.giveBalance&&!this.detail.shopPromoProduct&&this.showBalanceAuth
|
|
this.hasKdk = this.detail.shopProductSubsidy&&this.subsidyAmount>0&&this.subsidyAmount<this.storeAccount.giveBalance&&!this.detail.shopPromoProduct&&this.showBalanceAuth
|
|
}else{
|
|
}else{
|
|
@@ -618,8 +624,8 @@
|
|
qty: this.qty,
|
|
qty: this.qty,
|
|
price:this.detail.price,
|
|
price:this.detail.price,
|
|
promoSn: this.detail.promoSn,
|
|
promoSn: this.detail.promoSn,
|
|
- shopProductSubsidy: this.detail.shopProductSubsidy,
|
|
|
|
- shopPromoProduct: this.detail.shopPromoProduct
|
|
|
|
|
|
+ promoProductSn: this.detail.shopProductSubsidy.productSubsidySn,
|
|
|
|
+ resultValue: this.detail.shopProductSubsidy.subsidyAmount
|
|
}]}).then(res => {
|
|
}]}).then(res => {
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
if(res.status == 200){
|
|
if(res.status == 200){
|
|
@@ -630,8 +636,8 @@
|
|
qty: item.qty,
|
|
qty: item.qty,
|
|
price:item.price,
|
|
price:item.price,
|
|
promoSn: item.promoSn,
|
|
promoSn: item.promoSn,
|
|
- shopProductSubsidy: item.shopProductSubsidy,
|
|
|
|
- shopPromoProduct: item.shopPromoProduct
|
|
|
|
|
|
+ promoProductSn: item.promoProductSn,
|
|
|
|
+ resultValue: item.resultValue
|
|
}
|
|
}
|
|
}) : []
|
|
}) : []
|
|
const removeList = res.data.removeList ? res.data.removeList.map(item => item.productCode) : []
|
|
const removeList = res.data.removeList ? res.data.removeList.map(item => item.productCode) : []
|
|
@@ -651,11 +657,12 @@
|
|
})
|
|
})
|
|
}else{
|
|
}else{
|
|
const promoChangeFlag = res.data.promoChangeFlag
|
|
const promoChangeFlag = res.data.promoChangeFlag
|
|
|
|
+ const subsidyChangeFlag = res.data.subsidyChangeFlag
|
|
// 活动变更
|
|
// 活动变更
|
|
- if(promoChangeFlag){
|
|
|
|
|
|
+ if(promoChangeFlag||subsidyChangeFlag){
|
|
uni.showModal({
|
|
uni.showModal({
|
|
title: '提示',
|
|
title: '提示',
|
|
- content: '促销活动已变更,请刷新?',
|
|
|
|
|
|
+ content: promoChangeFlag ? '促销活动已变更,请刷新!' : (subsidyChangeFlag?'抵扣规则已变更,请刷新!':''),
|
|
confirmText:'确定刷新',
|
|
confirmText:'确定刷新',
|
|
success(ret) {
|
|
success(ret) {
|
|
if(ret.confirm){
|
|
if(ret.confirm){
|