From 8b2c36677e4ab6dc3500473698666c0c0f1f24ee Mon Sep 17 00:00:00 2001 From: lyf <2514544224@qq.com> Date: Fri, 3 Jul 2026 02:44:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AE=B2=E8=A7=A3=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E8=BF=94=E5=9B=9E=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exhibit/detail.vue | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/pages/exhibit/detail.vue b/src/pages/exhibit/detail.vue index 202396b..9918660 100644 --- a/src/pages/exhibit/detail.vue +++ b/src/pages/exhibit/detail.vue @@ -400,14 +400,29 @@ const handleNavigate = async () => { }) } +const fallbackToExplainHome = () => { + uni.reLaunch({ + url: '/pages/index/index?tab=explain' + }) +} + const handleBack = () => { + if (typeof window !== 'undefined' && window.history.length > 1) { + const currentHref = window.location.href + window.history.back() + + // H5 深链或异常历史栈下 history.back 可能不改变页面,兜底回到讲解首页。 + window.setTimeout(() => { + if (window.location.href === currentHref) { + fallbackToExplainHome() + } + }, 800) + return + } + uni.navigateBack({ delta: 1, - fail: () => { - uni.reLaunch({ - url: '/pages/index/index?tab=explain' - }) - } + fail: fallbackToExplainHome }) }