fix 微信相关支付不支持跳转调用方式

This commit is contained in:
daxpay
2025-05-08 15:06:32 +08:00
parent 71d6ee162f
commit 208f1f14d5
2 changed files with 17 additions and 8 deletions

View File

@@ -205,10 +205,14 @@ function pay() {
} as AggregatePayParam } as AggregatePayParam
aggregatePay(from) aggregatePay(from)
.then(({ data }) => { .then(({ data }) => {
loading.value = false // 根据类型拉起对应的支付。 支持跳转和jsapi
// 拉起jsapi支付 if (orderAndConfig.value?.aggregateConfig.callType === GatewayCallTypeEnum.jsapi){
const json = JSON.parse(data.payBody) const json = JSON.parse(data.payBody)
jsapiPay(json) jsapiPay(json)
}
if (orderAndConfig.value?.aggregateConfig.callType === GatewayCallTypeEnum.link){
location.replace(data.payBody as any)
}
}) })
} }
} }

View File

@@ -73,7 +73,7 @@ import {
getCashierCodeConfig, getCashierCodeConfig,
} from '../CashierCode.api' } from '../CashierCode.api'
import { AggregateEnum, CashierCodeTypeEnum } from '@/enums/daxpay/DaxPayEnum' import { AggregateEnum, CashierCodeTypeEnum, GatewayCallTypeEnum } from '@/enums/daxpay/DaxPayEnum'
import router from '@/router' import router from '@/router'
import { useKeyboard } from '@/hooks/daxpay/useKeyboard' import { useKeyboard } from '@/hooks/daxpay/useKeyboard'
@@ -153,9 +153,14 @@ function pay() {
cashierPay(from) cashierPay(from)
.then(({ data }) => { .then(({ data }) => {
loading.value = false loading.value = false
// 拉起jsapi支付 // 根据类型拉起对应的支付。 支持跳转和jsapi
if (cashierInfo.value?.callType === GatewayCallTypeEnum.jsapi) {
const json = JSON.parse(data.payBody) const json = JSON.parse(data.payBody)
jsapiPay(json) jsapiPay(json)
}
if (cashierInfo.value?.callType === GatewayCallTypeEnum.link) {
location.replace(data.payBody as any)
}
}) })
} }