From 02080226152ee65aa1859817dcff76220b0b7b1f Mon Sep 17 00:00:00 2001 From: hailin Date: Mon, 15 Dec 2025 21:19:22 -0800 Subject: [PATCH] =?UTF-8?q?fix(profile):=20=E4=BF=AE=E5=A4=8D=E6=87=92?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E9=AA=A8=E6=9E=B6=E5=B1=8F=E4=B8=80=E7=9B=B4?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将懒加载区域的加载状态初始值改为 false - 只有真正在加载时才显示骨架屏 - 修复条件判断逻辑导致的死锁问题 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../profile/presentation/pages/profile_page.dart | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/frontend/mobile-app/lib/features/profile/presentation/pages/profile_page.dart b/frontend/mobile-app/lib/features/profile/presentation/pages/profile_page.dart index 43a5b055..48296c94 100644 --- a/frontend/mobile-app/lib/features/profile/presentation/pages/profile_page.dart +++ b/frontend/mobile-app/lib/features/profile/presentation/pages/profile_page.dart @@ -106,7 +106,7 @@ class _ProfilePageState extends ConsumerState { double _settledUsdt = 0.0; double _expiredUsdt = 0.0; double _expiredPower = 0.0; - bool _isLoadingWallet = true; + bool _isLoadingWallet = false; // 懒加载,初始为 false String? _walletError; // 待领取奖励列表(每一笔单独显示) @@ -128,10 +128,10 @@ class _ProfilePageState extends ConsumerState { int _unreadNotificationCount = 0; // ========== 懒加载 + 重试机制相关状态 ========== - // 各区域加载状态 + // 各区域加载状态(懒加载区域初始为 false,等待可见时触发) bool _isLoadingUserData = true; - bool _isLoadingReferral = true; - bool _isLoadingAuthorization = true; + bool _isLoadingReferral = false; + bool _isLoadingAuthorization = false; String? _userDataError; String? _referralError; String? _authorizationError; @@ -1403,8 +1403,8 @@ class _ProfilePageState extends ConsumerState { /// 构建推荐人信息卡片(包含授权数据) Widget _buildReferralInfoCard() { - // 显示加载状态(骨架屏) - if (_isLoadingAuthorization && !_hasLoadedAuthorization) { + // 显示加载状态(骨架屏)- 只有正在加载时才显示 + if (_isLoadingAuthorization) { return _buildSkeleton(height: 180); } @@ -1559,8 +1559,8 @@ class _ProfilePageState extends ConsumerState { /// 构建主要内容卡片 Widget _buildMainContentCard() { - // 显示加载状态(骨架屏)- 收益数据 - if (_isLoadingWallet && !_hasLoadedWallet) { + // 显示加载状态(骨架屏)- 只有正在加载时才显示 + if (_isLoadingWallet) { return _buildSkeleton(height: 400); }