From aae4f1e360a27e3971b8e14fb482f438906a7750 Mon Sep 17 00:00:00 2001 From: hailin Date: Fri, 26 Dec 2025 00:14:24 -0800 Subject: [PATCH] =?UTF-8?q?fix(mobile-app):=20=E9=81=8D=E5=8E=86=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E6=A0=88=E6=A3=80=E6=B5=8B=E5=BD=93=E5=89=8D=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E4=BF=AE=E5=A4=8Dpush=E5=AF=BC=E8=88=AA?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 之前只检查 currentConfiguration.uri.path,对于 push 导航的页面无法正确检测。 现在遍历整个 matches 路由栈,只要栈中有合同/KYC页面就跳过弹窗。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../presentation/pages/home_shell_page.dart | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/frontend/mobile-app/lib/features/home/presentation/pages/home_shell_page.dart b/frontend/mobile-app/lib/features/home/presentation/pages/home_shell_page.dart index 045edca3..150491df 100644 --- a/frontend/mobile-app/lib/features/home/presentation/pages/home_shell_page.dart +++ b/frontend/mobile-app/lib/features/home/presentation/pages/home_shell_page.dart @@ -110,15 +110,19 @@ class _HomeShellPageState extends ConsumerState } // 2. 检查是否在合同/KYC页面 - // 使用 appRouterProvider 获取全局路由状态 + // 遍历整个路由栈,检查是否有任何合同/KYC相关页面 try { final router = ref.read(appRouterProvider); - final location = router.routerDelegate.currentConfiguration.uri.path; - debugPrint('[HomeShellPage] 当前路由(provider): $location'); - // 合同签署相关页面 - if (location.startsWith('/contract-signing')) return true; - // KYC 相关页面 - if (location.startsWith('/kyc')) return true; + final matches = router.routerDelegate.currentConfiguration.matches; + + for (final match in matches) { + final location = match.matchedLocation; + debugPrint('[HomeShellPage] 路由栈: $location'); + // 合同签署相关页面 + if (location.startsWith('/contract-signing')) return true; + // KYC 相关页面 + if (location.startsWith('/kyc')) return true; + } return false; } catch (e) { debugPrint('[HomeShellPage] 获取路由状态失败: $e');