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
aggregatePay(from)
.then(({ data }) => {
loading.value = false
// 拉起jsapi支付
const json = JSON.parse(data.payBody)
jsapiPay(json)
// 根据类型拉起对应的支付。 支持跳转和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)
}
})
}
}

View File

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