fix(mobile-app): 修复合同签署页面定时检查仍弹窗的问题
使用 GoRouter.of(context).routerDelegate.currentConfiguration 获取全局路由状态, 而不是 GoRouterState.of(context),因为后者只能获取 ShellRoute 内部的路由状态, 当用户在顶级路由(如 /contract-signing/:orderNo)时无法正确检测。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
89a2700fc9
commit
ce75e68d5e
|
|
@ -109,14 +109,20 @@ class _HomeShellPageState extends ConsumerState<HomeShellPage>
|
|||
}
|
||||
|
||||
// 2. 检查是否在合同/KYC页面
|
||||
// 使用 GoRouter.of(context) 获取全局路由状态,而不是 GoRouterState.of(context)
|
||||
// 因为 GoRouterState.of(context) 只能获取到 ShellRoute 内的路由状态
|
||||
// 当用户导航到顶级路由(如 /contract-signing/:orderNo)时无法正确检测
|
||||
try {
|
||||
final location = GoRouterState.of(context).uri.path;
|
||||
final router = GoRouter.of(context);
|
||||
final location = router.routerDelegate.currentConfiguration.uri.path;
|
||||
debugPrint('[HomeShellPage] 当前路由: $location');
|
||||
// 合同签署相关页面
|
||||
if (location.startsWith('/contract-signing')) return true;
|
||||
// KYC 相关页面
|
||||
if (location.startsWith('/kyc')) return true;
|
||||
return false;
|
||||
} catch (e) {
|
||||
debugPrint('[HomeShellPage] 获取路由状态失败: $e');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue