mirror of
https://gitee.com/bootx/dax-pay-h5
synced 2026-08-07 05:45:45 +08:00
fix 微信聚合支付限制成了固定jsapi方式
This commit is contained in:
@@ -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)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -181,7 +181,7 @@ async function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信jsapi方式支付
|
||||
* 调起支付, 需要根据调用类型发起
|
||||
*/
|
||||
function pay() {
|
||||
const amountValue = Number(amount.value)
|
||||
|
||||
Reference in New Issue
Block a user