修复确认订单余额支付,余额充足无法选择问题
This commit is contained in:
@@ -159,11 +159,14 @@
|
||||
</text>
|
||||
</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 class="favorable_right" v-if="item.type=='points'">
|
||||
<text class="favorable_right_text" style="color: #666;margin-right: 16rpx;"
|
||||
@@ -232,10 +235,6 @@
|
||||
</view>
|
||||
|
||||
|
||||
<IntegralInput :visible="calcUsablePointsData.showModal" :minValue="calcUsablePointsData.minIntegral"
|
||||
:maxValue="calcUsablePointsData.maxIntegral" :instructions="calcUsablePointsData.instructionText"
|
||||
@confirm="handleConfirm" @close="calcUsablePointsData.showModal = false"
|
||||
@IntegralInputclose="IntegralInputclose" />
|
||||
</view>
|
||||
|
||||
</template>
|
||||
@@ -439,6 +438,9 @@
|
||||
break;
|
||||
|
||||
case 'points':
|
||||
if (maxPointDiscount.value <= 0) {
|
||||
return
|
||||
}
|
||||
chnageIsUsePoints()
|
||||
return
|
||||
}
|
||||
@@ -472,7 +474,7 @@
|
||||
})
|
||||
Object.assign(pointsRes, res)
|
||||
maxPointDiscount.value = res.maxDeductionAmount
|
||||
cartStore.setUserPoints(res.maxUsablePoints||0)
|
||||
cartStore.setUserPoints(res.maxUsablePoints || 0)
|
||||
console.log('getMaxPointsDiscount:cartStore.orderCostSummary.pointUsed', cartStore.orderCostSummary.pointUsed);
|
||||
}
|
||||
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) => {
|
||||
|
||||
@@ -216,6 +216,7 @@
|
||||
|
||||
function updateChargeSel(newval) {
|
||||
rechargeItem.value = newval
|
||||
console.log('updateChargeSel',newval);
|
||||
//充值并付款时只能微信支付
|
||||
if (newval && newval.id) {
|
||||
disablePayType.value = ['余额支付']
|
||||
@@ -224,15 +225,14 @@
|
||||
disablePayType.value = []
|
||||
}
|
||||
|
||||
|
||||
if (!shopUserInfo.value.amount) {
|
||||
if (!orderVIP.value.amount) {
|
||||
disablePayType.value = ['余额支付']
|
||||
if (paymentMethodref.value) {
|
||||
paymentMethodref.value.groupChanges(2)
|
||||
}
|
||||
return
|
||||
}
|
||||
if (shopUserInfo.value.amount < newval) {
|
||||
if (orderVIP.value.amount < newval) {
|
||||
disablePayType.value = ['余额支付']
|
||||
if (paymentMethodref.value) {
|
||||
paymentMethodref.value.groupChanges(2)
|
||||
@@ -1103,10 +1103,8 @@
|
||||
}
|
||||
|
||||
}
|
||||
const shopUserInfo = ref({})
|
||||
onLoad((opt) => {
|
||||
init(opt)
|
||||
shopUserInfo.value = uni.cache.get('shopUserInfo')
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user