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 = [] // 尝试解析返回结果中的奖励列表