fix 微信聚合支付限制成了固定jsapi方式

This commit is contained in:
bootx
2025-09-02 00:05:00 +08:00
parent 56f50d5f49
commit 7debb88d94
2 changed files with 21 additions and 23 deletions

View File

@@ -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)
}
})
}
/**

View File

@@ -181,7 +181,7 @@ async function init() {
}
/**
* 微信jsapi方式支付
* 调起支付, 需要根据调用类型发起
*/
function pay() {
const amountValue = Number(amount.value)