fix: 门店详情/登录页无历史栈时顶部返回回首页,避免返回无响应

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
jacobxu666
2026-08-28 22:16:30 +08:00
co-authored by Claude Fable 5
parent 8a24dd033c
commit 3e54c21f19
2 changed files with 14 additions and 2 deletions
+7 -1
View File
@@ -136,7 +136,13 @@ export default {
uni.navigateTo({ url }) uni.navigateTo({ url })
}, },
goBack() { goBack() {
uni.navigateBack() // xuchao: 直接通过链接进入(无历史栈)时回到首页,避免返回无响应
const pages = getCurrentPages()
if (pages.length > 1) {
uni.navigateBack()
} else {
uni.reLaunch({ url: '/pages/index/index' })
}
} }
} }
} }
+7 -1
View File
@@ -132,7 +132,13 @@ export default {
}) })
}, },
goBack() { goBack() {
uni.navigateBack() // xuchao: 直接通过链接进入(无历史栈)时回到首页,避免返回无响应
const pages = getCurrentPages()
if (pages.length > 1) {
uni.navigateBack()
} else {
uni.reLaunch({ url: '/pages/index/index' })
}
} }
} }
} }