From ffd0073fdd149d3056bfdf5363bdc2b4e11a8a22 Mon Sep 17 00:00:00 2001 From: tsui110 Date: Thu, 18 Dec 2025 14:32:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E9=80=89=E6=8B=A9=E4=BC=98?= =?UTF-8?q?=E6=83=A0=E5=88=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/PaymentPopup.vue | 19 ++++++++++++++----- pages/activity/yifanshang/index.vue | 14 ++++++++++++++ 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/components/PaymentPopup.vue b/components/PaymentPopup.vue index efa2787..24f0afa 100644 --- a/components/PaymentPopup.vue +++ b/components/PaymentPopup.vue @@ -95,12 +95,21 @@ const selectedCard = computed(() => { return null }) -watch(() => props.visible, (val) => { - if (val) { - couponIndex.value = -1 +watch( + [() => props.visible, () => (Array.isArray(props.coupons) ? props.coupons.length : 0)], + ([vis, len]) => { + if (!vis) return cardIndex.value = -1 - } -}) + if (len <= 0) { + couponIndex.value = -1 + return + } + if (couponIndex.value < 0) { + couponIndex.value = 0 + } + }, + { immediate: true } +) function onCouponChange(e) { couponIndex.value = e.detail.value diff --git a/pages/activity/yifanshang/index.vue b/pages/activity/yifanshang/index.vue index d0446f5..b7bcf85 100644 --- a/pages/activity/yifanshang/index.vue +++ b/pages/activity/yifanshang/index.vue @@ -450,6 +450,20 @@ function onPaymentSuccess(payload) { console.log('Payment Success:', payload) const result = payload.result + const status = String((result && (result.status || result.data?.status || result.result?.status)) || '') + if (status === 'paid_waiting') { + const next = result && (result.next_draw_time || result.nextDrawTime || result.next_draw_at || result.nextDrawAt) + const nextText = next ? formatDateTime(next) : '' + const content = nextText ? `下单成功,等待系统自动开启本期赏品。\n预计开赏时间:${nextText}` : '下单成功,等待系统自动开启本期赏品。' + try { + uni.showModal({ + title: '下单成功', + content, + showCancel: false + }) + } catch (_) {} + return + } let wonItems = [] // 尝试解析返回结果中的奖励列表