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 0eefda0b..d2a4fbb8 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 @@ -100,10 +100,30 @@ class _HomeShellPageState extends ConsumerState }); } + /// 检查当前是否在合同签署或KYC相关页面 + bool _isOnContractOrKycPage() { + try { + final location = GoRouterState.of(context).uri.path; + // 合同签署相关页面 + if (location.startsWith('/contract-signing')) return true; + // KYC 相关页面 + if (location.startsWith('/kyc')) return true; + return false; + } catch (e) { + return false; + } + } + /// 执行后台综合检查(合同 + KYC) Future _performBackgroundContractCheck() async { if (!mounted || _isShowingDialog) return; + // 如果用户在合同签署或KYC页面,跳过检查 + if (_isOnContractOrKycPage()) { + debugPrint('[HomeShellPage] 用户在合同/KYC页面,跳过后台检查'); + return; + } + try { debugPrint('[HomeShellPage] 执行后台综合检查...'); @@ -112,6 +132,12 @@ class _HomeShellPageState extends ConsumerState if (!mounted || _isShowingDialog) return; + // 再次检查,防止在请求期间用户进入了相关页面 + if (_isOnContractOrKycPage()) { + debugPrint('[HomeShellPage] 用户已进入合同/KYC页面,跳过弹窗'); + return; + } + // 1. 优先处理待签署合同 if (result.hasPendingContracts) { debugPrint('[HomeShellPage] 后台检测到待签署合同,显示弹窗');