From ed67c4f7fa223422b956960b68f3aa9027e126c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=96=B9=E6=88=90?= Date: Fri, 2 Jan 2026 17:31:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E5=89=8D=E8=AE=A2=E5=8D=95=E7=8A=B6=E6=80=81=E5=92=8C=E5=AE=9E?= =?UTF-8?q?=E9=99=85=E6=94=AF=E4=BB=98=E9=87=91=E9=A2=9D=E5=88=A4=E6=96=AD?= =?UTF-8?q?=EF=BC=8C=E9=81=BF=E5=85=8D=E4=B8=8D=E5=BF=85=E8=A6=81=E7=9A=84?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/YifanSelector.vue | 39 +++++++++++-------- pages-activity/activity/wuxianshang/index.vue | 29 ++++++++------ 2 files changed, 39 insertions(+), 29 deletions(-) diff --git a/components/YifanSelector.vue b/components/YifanSelector.vue index becae24..21395f2 100644 --- a/components/YifanSelector.vue +++ b/components/YifanSelector.vue @@ -289,24 +289,29 @@ async function onPaymentConfirm(paymentData) { } // 2. 使用返回的订单号去发起支付 - const payRes = await createWechatOrder({ - openid: openid, - order_no: orderNo - }) + // Check if order is already paid (e.g. via Game Pass or Points) + const isPaid = (joinRes?.status === 2) || (joinRes?.actual_amount <= 0) - // 调起微信支付 - await new Promise((resolve, reject) => { - uni.requestPayment({ - provider: 'wxpay', - timeStamp: payRes.timeStamp || payRes.timestamp, - nonceStr: payRes.nonceStr || payRes.noncestr, - package: payRes.package, - signType: payRes.signType || 'MD5', - paySign: payRes.paySign, - success: resolve, - fail: reject - }) - }) + if (!isPaid) { + const payRes = await createWechatOrder({ + openid: openid, + order_no: orderNo + }) + + // 调起微信支付 + await new Promise((resolve, reject) => { + uni.requestPayment({ + provider: 'wxpay', + timeStamp: payRes.timeStamp || payRes.timestamp, + nonceStr: payRes.nonceStr || payRes.noncestr, + package: payRes.package, + signType: payRes.signType || 'MD5', + paySign: payRes.paySign, + success: resolve, + fail: reject + }) + }) + } uni.hideLoading() uni.showLoading({ title: '查询结果...' }) diff --git a/pages-activity/activity/wuxianshang/index.vue b/pages-activity/activity/wuxianshang/index.vue index 8a1361d..085d7ae 100644 --- a/pages-activity/activity/wuxianshang/index.vue +++ b/pages-activity/activity/wuxianshang/index.vue @@ -378,19 +378,24 @@ async function onMachineDraw(count) { const orderNo = joinRes?.order_no || joinRes?.data?.order_no || joinRes?.result?.order_no if (!orderNo) throw new Error('未获取到订单号') - const payRes = await createWechatOrder({ openid, order_no: orderNo }) - await new Promise((resolve, reject) => { - uni.requestPayment({ - provider: 'wxpay', - timeStamp: payRes.timeStamp || payRes.timestamp, - nonceStr: payRes.nonceStr || payRes.noncestr, - package: payRes.package, - signType: payRes.signType || 'MD5', - paySign: payRes.paySign, - success: resolve, - fail: reject + // Check if order is already paid (e.g. via Game Pass or Points) + const isPaid = (joinRes?.status === 2) || (joinRes?.actual_amount <= 0) + + if (!isPaid) { + const payRes = await createWechatOrder({ openid, order_no: orderNo }) + await new Promise((resolve, reject) => { + uni.requestPayment({ + provider: 'wxpay', + timeStamp: payRes.timeStamp || payRes.timestamp, + nonceStr: payRes.nonceStr || payRes.noncestr, + package: payRes.package, + signType: payRes.signType || 'MD5', + paySign: payRes.paySign, + success: resolve, + fail: reject + }) }) - }) + } // 支付成功后立即显示开奖加载弹窗 drawTotal.value = times