Commit 2dc30ad6 by huangzhi

feat: 优化支付成功页面 后退两步

parent 0dfe5870
......@@ -210,7 +210,7 @@ export default {
pagePath = 'pay/groupSuccess'
}
const url = `${hostPrefix}/h5-course/${pagePath}?${urlStr}`
uni.redirectTo({
uni.navigateTo({
url: `/pages/web/web?title=${'支付成功'}&loadUrl=${encodeURIComponent(url)}`,
})
},
......
......@@ -38,6 +38,15 @@ export default {
// 移除登录成功事件
onUnload() {
uni.$off('loginSuccess', this.handleLoginSuccess)
// eslint-disable-next-line no-undef
const pages = getCurrentPages()
const beforePage = pages[pages.length - 2]
// 如果当前页是支付成功页,后退的页面是 原生支付页面,那么直接后退两步,略过支付原生页面,直接跳入,比如 课程详情页面
if (this.loadUrl.includes('pay/') && beforePage.route.includes('pages/pay/pay')) {
uni.navigateBack({
delta: 2,
})
}
},
// 主要用于返回上一页,刷新当前页面
onShow() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment