fix(mobile-app): 修复引荐列表展开无法显示更多数据的问题
- 使用实际总数作为limit参数请求API - 添加调试日志便于排查 - 优化:已加载全部数据时直接展开不重复请求 🤖 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
8eb5b410cc
commit
dab4b0674d
|
|
@ -431,13 +431,26 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
|||
Future<void> _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(() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue