From dab4b0674df13b22e3a40f1eb69afa6c7fb11d55 Mon Sep 17 00:00:00 2001 From: hailin Date: Fri, 9 Jan 2026 09:13:07 -0800 Subject: [PATCH] =?UTF-8?q?fix(mobile-app):=20=E4=BF=AE=E5=A4=8D=E5=BC=95?= =?UTF-8?q?=E8=8D=90=E5=88=97=E8=A1=A8=E5=B1=95=E5=BC=80=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=9B=B4=E5=A4=9A=E6=95=B0=E6=8D=AE=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 使用实际总数作为limit参数请求API - 添加调试日志便于排查 - 优化:已加载全部数据时直接展开不重复请求 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../profile/presentation/pages/profile_page.dart | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 86ef7292..d3b9641d 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 @@ -431,13 +431,26 @@ class _ProfilePageState extends ConsumerState { Future _expandReferralList() async { if (_isLoadingMoreReferrals) return; + // 如果已经加载过全部数据,直接展开,不重新请求 + if (_referrals.length >= _totalReferralCount) { + debugPrint('[ProfilePage] 数据已加载完整,直接展开'); + setState(() { + _isReferralListExpanded = true; + }); + return; + } + + debugPrint('[ProfilePage] 展开引荐列表,当前总数: $_totalReferralCount'); + setState(() { _isLoadingMoreReferrals = true; }); try { final referralService = ref.read(referralServiceProvider); - final response = await referralService.getDirectReferrals(limit: 200); + final response = await referralService.getDirectReferrals(limit: _totalReferralCount); + + debugPrint('[ProfilePage] 加载到 ${response.referrals.length} 条引荐记录'); if (mounted) { setState(() {