mirror of
https://gitee.com/bootx/dax-pay-h5.git
synced 2025-10-13 13:43:53 +00:00
fix: 优化提示异常问题
This commit is contained in:
@@ -187,12 +187,12 @@ async function wxAuth() {
|
||||
// 认证获取OpenId
|
||||
await auth(authParam.value).then(({ data, code, msg }) => {
|
||||
if (code) {
|
||||
router.push({ name: 'payFail', query: { msg }, replace: true })
|
||||
router.replace({ name: 'payFail', query: { msg }, replace: true })
|
||||
return
|
||||
}
|
||||
openId.value = data.openId as string
|
||||
}).catch((res) => {
|
||||
router.push({ name: 'payFail', query: { msg: res.message }, replace: true })
|
||||
router.replace({ name: 'payFail', query: { msg: res.message }, replace: true })
|
||||
})
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ function pay() {
|
||||
aggregatePay(from)
|
||||
.then(({ data, code, msg }) => {
|
||||
if (code) {
|
||||
router.push({ name: 'payFail', query: { msg }, replace: true })
|
||||
router.replace({ name: 'payFail', query: { msg }, replace: true })
|
||||
return
|
||||
}
|
||||
// 根据类型拉起对应的支付。 支持跳转和jsapi
|
||||
|
@@ -84,7 +84,7 @@ const showRemark = ref<boolean>(false) // 是否展示备注
|
||||
const loading = ref<boolean>(false) // 加载状态
|
||||
const cashierInfo = ref<GatewayCashierConfig>()
|
||||
const amount = ref<string>('0') // 金额
|
||||
const description = ref<string>('') // 描述
|
||||
const description = ref<string>()
|
||||
|
||||
const { input, del } = useKeyboard(amount)
|
||||
|
||||
@@ -101,14 +101,14 @@ function initData() {
|
||||
getCashierCodeConfig(code, CashierCodeTypeEnum.ALIPAY)
|
||||
.then((res) => {
|
||||
if (res.code) {
|
||||
router.push({ name: 'payFail', query: { msg: res.msg } })
|
||||
router.replace({ name: 'payFail', query: { msg: res.msg } })
|
||||
return
|
||||
}
|
||||
loading.value = false
|
||||
cashierInfo.value = res.data as any
|
||||
})
|
||||
.catch((res) => {
|
||||
router.push({ name: 'payFail', query: { msg: res.message } })
|
||||
router.replace({ name: 'payFail', query: { msg: res.message } })
|
||||
})
|
||||
}
|
||||
|
||||
|
@@ -97,8 +97,8 @@ const showRemark = ref<boolean>(false)
|
||||
const loading = ref<boolean>(false)
|
||||
const cashierInfo = ref<GatewayCashierConfig>({})
|
||||
const amount = ref<string>('0')
|
||||
const description = ref<string>('')
|
||||
const openId = ref<string>('')
|
||||
const description = ref<string>()
|
||||
const openId = ref<string>()
|
||||
|
||||
const { input, del } = useKeyboard(amount)
|
||||
|
||||
@@ -141,13 +141,13 @@ async function init() {
|
||||
auth({ cashierCode: cashierCode as string, cashierType: CashierCodeTypeEnum.WECHAT_PAY, authCode: authCode as string })
|
||||
.then((res) => {
|
||||
if (res.code) {
|
||||
router.push({ name: 'payFail', query: { msg: res.msg } })
|
||||
router.replace({ name: 'payFail', query: { msg: res.msg } })
|
||||
return
|
||||
}
|
||||
openId.value = res.data.openId as string
|
||||
show.value = true
|
||||
}).catch((res) => {
|
||||
router.push({ name: 'payFail', query: { msg: res.message }, replace: true })
|
||||
router.replace({ name: 'payFail', query: { msg: res.message }, replace: true })
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -156,7 +156,7 @@ async function init() {
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
router.push({ name: 'payFail', query: { msg: error } })
|
||||
router.replace({ name: 'payFail', query: { msg: error } })
|
||||
})
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ function pay() {
|
||||
cashierPay(from)
|
||||
.then((res) => {
|
||||
if (res.code) {
|
||||
router.push({ name: 'payFail', query: { msg: res.msg } })
|
||||
router.replace({ name: 'payFail', query: { msg: res.msg } })
|
||||
return
|
||||
}
|
||||
loading.value = false
|
||||
|
Reference in New Issue
Block a user