From 7debb88d94f80cb545d77cd24241f1ea7af13617 Mon Sep 17 00:00:00 2001 From: bootx Date: Tue, 2 Sep 2025 00:05:00 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=BE=AE=E4=BF=A1=E8=81=9A=E5=90=88?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E9=99=90=E5=88=B6=E6=88=90=E4=BA=86=E5=9B=BA?= =?UTF-8?q?=E5=AE=9Ajsapi=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../h5/aggregate/wechat/WechatAggregate.vue | 42 +++++++++---------- .../h5/code/wechat/WechatCashierCode.vue | 2 +- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/src/views/daxpay/h5/aggregate/wechat/WechatAggregate.vue b/src/views/daxpay/h5/aggregate/wechat/WechatAggregate.vue index 9f672d2..5e4c0da 100644 --- a/src/views/daxpay/h5/aggregate/wechat/WechatAggregate.vue +++ b/src/views/daxpay/h5/aggregate/wechat/WechatAggregate.vue @@ -246,28 +246,26 @@ async function wxAuth() { */ function pay() { loading.value = true - if (orderAndConfig.value?.aggregateConfig.callType === GatewayCallTypeEnum.jsapi) { - const from = { - orderNo: orderNo as string, - aggregateType: AggregateEnum.WECHAT, - openId: openId.value, - } as AggregatePayParam - aggregatePay(from).then(({ data, code, msg }) => { - loading.value = false - if (code) { - router.replace({ name: 'payFail', query: { msg }, replace: true }) - return - } - // 根据类型拉起对应的支付。 支持跳转和jsapi - if (orderAndConfig.value?.aggregateConfig.callType === GatewayCallTypeEnum.jsapi) { - const json = JSON.parse(data.payBody) - jsapiPay(json) - } - if (orderAndConfig.value?.aggregateConfig.callType === GatewayCallTypeEnum.link) { - location.replace(data.payBody as any) - } - }) - } + const from = { + orderNo: orderNo as string, + aggregateType: AggregateEnum.WECHAT, + openId: openId.value, + } as AggregatePayParam + aggregatePay(from).then(({ data, code, msg }) => { + loading.value = false + if (code) { + router.replace({ name: 'payFail', query: { msg }, replace: true }) + return + } + // 根据类型拉起对应的支付。 支持跳转和jsapi + if (orderAndConfig.value?.aggregateConfig.callType === GatewayCallTypeEnum.jsapi) { + const json = JSON.parse(data.payBody) + jsapiPay(json) + } + if (orderAndConfig.value?.aggregateConfig.callType === GatewayCallTypeEnum.link) { + location.replace(data.payBody as any) + } + }) } /** diff --git a/src/views/daxpay/h5/code/wechat/WechatCashierCode.vue b/src/views/daxpay/h5/code/wechat/WechatCashierCode.vue index cc8ac92..798b773 100644 --- a/src/views/daxpay/h5/code/wechat/WechatCashierCode.vue +++ b/src/views/daxpay/h5/code/wechat/WechatCashierCode.vue @@ -181,7 +181,7 @@ async function init() { } /** - * 微信jsapi方式支付 + * 调起支付, 需要根据调用类型发起 */ function pay() { const amountValue = Number(amount.value)