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)