修复确认订单余额支付,余额充足无法选择问题
This commit is contained in:
@@ -159,11 +159,14 @@
|
|||||||
</text>
|
</text>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<template v-else>
|
||||||
|
<view v-if="maxPointDiscount>0" class="u-flex u-col-center">
|
||||||
|
<view class="round"></view>
|
||||||
|
<text class="color-333 font-12 no-wrap u-m-l-4">使用抵扣</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
<view v-else class="u-flex u-col-center">
|
|
||||||
<view class="round"></view>
|
|
||||||
<text class="color-333 font-12 no-wrap u-m-l-4">使用抵扣</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="favorable_right" v-if="item.type=='points'">
|
<!-- <view class="favorable_right" v-if="item.type=='points'">
|
||||||
<text class="favorable_right_text" style="color: #666;margin-right: 16rpx;"
|
<text class="favorable_right_text" style="color: #666;margin-right: 16rpx;"
|
||||||
@@ -232,10 +235,6 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<IntegralInput :visible="calcUsablePointsData.showModal" :minValue="calcUsablePointsData.minIntegral"
|
|
||||||
:maxValue="calcUsablePointsData.maxIntegral" :instructions="calcUsablePointsData.instructionText"
|
|
||||||
@confirm="handleConfirm" @close="calcUsablePointsData.showModal = false"
|
|
||||||
@IntegralInputclose="IntegralInputclose" />
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
@@ -439,6 +438,9 @@
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'points':
|
case 'points':
|
||||||
|
if (maxPointDiscount.value <= 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
chnageIsUsePoints()
|
chnageIsUsePoints()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -472,7 +474,7 @@
|
|||||||
})
|
})
|
||||||
Object.assign(pointsRes, res)
|
Object.assign(pointsRes, res)
|
||||||
maxPointDiscount.value = res.maxDeductionAmount
|
maxPointDiscount.value = res.maxDeductionAmount
|
||||||
cartStore.setUserPoints(res.maxUsablePoints||0)
|
cartStore.setUserPoints(res.maxUsablePoints || 0)
|
||||||
console.log('getMaxPointsDiscount:cartStore.orderCostSummary.pointUsed', cartStore.orderCostSummary.pointUsed);
|
console.log('getMaxPointsDiscount:cartStore.orderCostSummary.pointUsed', cartStore.orderCostSummary.pointUsed);
|
||||||
}
|
}
|
||||||
watch(() => maxMoney.value, (newval) => {
|
watch(() => maxMoney.value, (newval) => {
|
||||||
@@ -490,22 +492,6 @@
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const handleConfirm = async (integral) => {
|
|
||||||
//积分可抵扣最大金额
|
|
||||||
const maxMoney = cartStore.orderCostSummary.goodsRealAmount - cartStore.orderCostSummary
|
|
||||||
.couponDeductionAmount
|
|
||||||
calcUsablePointsData.integral = integral
|
|
||||||
props.listinfo.pointsDiscountAmount = await APImemberPointscalcDeductionAmount({
|
|
||||||
points: integral,
|
|
||||||
shopUserId: props.orderVIP.id,
|
|
||||||
orderAmount: maxMoney
|
|
||||||
})
|
|
||||||
cartStore.setUserPoints(integral)
|
|
||||||
emits('clickPointsamount', {
|
|
||||||
pointsDiscountAmount: props.listinfo.pointsDiscountAmount,
|
|
||||||
pointsNum: calcUsablePointsData.integral
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// * 获取积分相关信息
|
// * 获取积分相关信息
|
||||||
const getCalcUsablePoints = async (data) => {
|
const getCalcUsablePoints = async (data) => {
|
||||||
|
|||||||
@@ -216,6 +216,7 @@
|
|||||||
|
|
||||||
function updateChargeSel(newval) {
|
function updateChargeSel(newval) {
|
||||||
rechargeItem.value = newval
|
rechargeItem.value = newval
|
||||||
|
console.log('updateChargeSel',newval);
|
||||||
//充值并付款时只能微信支付
|
//充值并付款时只能微信支付
|
||||||
if (newval && newval.id) {
|
if (newval && newval.id) {
|
||||||
disablePayType.value = ['余额支付']
|
disablePayType.value = ['余额支付']
|
||||||
@@ -224,15 +225,14 @@
|
|||||||
disablePayType.value = []
|
disablePayType.value = []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!orderVIP.value.amount) {
|
||||||
if (!shopUserInfo.value.amount) {
|
|
||||||
disablePayType.value = ['余额支付']
|
disablePayType.value = ['余额支付']
|
||||||
if (paymentMethodref.value) {
|
if (paymentMethodref.value) {
|
||||||
paymentMethodref.value.groupChanges(2)
|
paymentMethodref.value.groupChanges(2)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (shopUserInfo.value.amount < newval) {
|
if (orderVIP.value.amount < newval) {
|
||||||
disablePayType.value = ['余额支付']
|
disablePayType.value = ['余额支付']
|
||||||
if (paymentMethodref.value) {
|
if (paymentMethodref.value) {
|
||||||
paymentMethodref.value.groupChanges(2)
|
paymentMethodref.value.groupChanges(2)
|
||||||
@@ -1103,10 +1103,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
const shopUserInfo = ref({})
|
|
||||||
onLoad((opt) => {
|
onLoad((opt) => {
|
||||||
init(opt)
|
init(opt)
|
||||||
shopUserInfo.value = uni.cache.get('shopUserInfo')
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user