feat: 在支付弹窗中实现多次卡与优惠券互斥,多次卡启用时禁用优惠券选择并清除已选优惠券。
This commit is contained in:
parent
66f5c343d8
commit
5dfb2c3ecb
@ -70,9 +70,12 @@
|
||||
range-key="name"
|
||||
@change="onCouponChange"
|
||||
:value="couponIndex"
|
||||
:disabled="!coupons || coupons.length === 0"
|
||||
:disabled="(!coupons || coupons.length === 0) || useGamePass"
|
||||
>
|
||||
<view class="picker-display">
|
||||
<view class="picker-display" :class="{ 'picker-disabled': useGamePass }">
|
||||
<text v-if="useGamePass" class="placeholder" style="color: #666;">
|
||||
多次卡不可与优惠券同享
|
||||
</text>
|
||||
<text v-if="selectedCoupon" class="selected-text">
|
||||
{{ selectedCoupon.name }} (-¥{{ effectiveCouponDiscount.toFixed(2) }})
|
||||
<text v-if="selectedCoupon.amount > maxDeductible" style="font-size: 20rpx; color: #FF9800;">(最高抵扣50%)</text>
|
||||
@ -216,6 +219,10 @@ watch(() => props.visible, (newVal) => {
|
||||
|
||||
function toggleGamePass() {
|
||||
useGamePass.value = !useGamePass.value
|
||||
// Mutually Exclusive: If Game Pass is ON, clear Coupon.
|
||||
if (useGamePass.value) {
|
||||
couponIndex.value = -1
|
||||
}
|
||||
}
|
||||
|
||||
const selectedCoupon = computed(() => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user