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');