From 7560940e14c60f965970a19c452d713e4e6d7388 Mon Sep 17 00:00:00 2001 From: hailin Date: Thu, 29 Jan 2026 09:44:12 -0800 Subject: [PATCH] =?UTF-8?q?fix(mining-app):=20=E4=BF=AE=E5=A4=8D=E8=B4=A1?= =?UTF-8?q?=E7=8C=AE=E5=80=BC=E6=98=8E=E7=BB=86=E9=A1=B5=E9=9D=A2=E7=AD=9B?= =?UTF-8?q?=E9=80=89=E5=92=8C=E6=96=87=E5=AD=97=E6=BA=A2=E5=87=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将贡献值记录筛选从客户端过滤改为服务端过滤,解决同伴上贡献值记录无法显示的问题 - 使用 FittedBox 包装三栏统计标签文字,防止"同伴上贡献值"溢出 Co-Authored-By: Claude Opus 4.5 --- .../pages/contribution/contribution_page.dart | 9 ++++++++- .../contribution_records_page.dart | 20 ++++++++----------- .../providers/contribution_providers.dart | 8 ++++++-- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/frontend/mining-app/lib/presentation/pages/contribution/contribution_page.dart b/frontend/mining-app/lib/presentation/pages/contribution/contribution_page.dart index 18dc7a64..2b06b026 100644 --- a/frontend/mining-app/lib/presentation/pages/contribution/contribution_page.dart +++ b/frontend/mining-app/lib/presentation/pages/contribution/contribution_page.dart @@ -279,7 +279,14 @@ class ContributionPage extends ConsumerWidget { padding: const EdgeInsets.symmetric(horizontal: 4), child: Column( children: [ - Text(label, style: TextStyle(fontSize: 12, color: AppColors.textSecondaryOf(context))), + FittedBox( + fit: BoxFit.scaleDown, + child: Text( + label, + style: TextStyle(fontSize: 12, color: AppColors.textSecondaryOf(context)), + maxLines: 1, + ), + ), const SizedBox(height: 4), DataText( data: value != null ? (hideAmounts ? '****' : formatAmount(value)) : null, diff --git a/frontend/mining-app/lib/presentation/pages/contribution/contribution_records_page.dart b/frontend/mining-app/lib/presentation/pages/contribution/contribution_records_page.dart index 2434d73b..5d68c1f0 100644 --- a/frontend/mining-app/lib/presentation/pages/contribution/contribution_records_page.dart +++ b/frontend/mining-app/lib/presentation/pages/contribution/contribution_records_page.dart @@ -41,6 +41,7 @@ class _ContributionRecordsListPageState extends ConsumerState r.sourceType == _selectedSourceType).toList(); - - if (filteredRecords.isEmpty) { - return _buildEmptyView(); - } - return ListView.builder( padding: const EdgeInsets.all(16), - itemCount: filteredRecords.length + 1, // +1 for pagination info + itemCount: recordsPage.data.length + 1, // +1 for pagination info itemBuilder: (context, index) { - if (index == filteredRecords.length) { + if (index == recordsPage.data.length) { return _buildPaginationInfo(recordsPage); } - return _buildRecordCard(filteredRecords[index], currentAccountSequence); + return _buildRecordCard(recordsPage.data[index], currentAccountSequence); }, ); } diff --git a/frontend/mining-app/lib/presentation/providers/contribution_providers.dart b/frontend/mining-app/lib/presentation/providers/contribution_providers.dart index b947ec86..e2799576 100644 --- a/frontend/mining-app/lib/presentation/providers/contribution_providers.dart +++ b/frontend/mining-app/lib/presentation/providers/contribution_providers.dart @@ -47,11 +47,13 @@ class ContributionRecordsParams { final String accountSequence; final int page; final int pageSize; + final ContributionSourceType? sourceType; const ContributionRecordsParams({ required this.accountSequence, this.page = 1, this.pageSize = 10, + this.sourceType, }); @override @@ -61,10 +63,11 @@ class ContributionRecordsParams { runtimeType == other.runtimeType && accountSequence == other.accountSequence && page == other.page && - pageSize == other.pageSize; + pageSize == other.pageSize && + sourceType == other.sourceType; @override - int get hashCode => accountSequence.hashCode ^ page.hashCode ^ pageSize.hashCode; + int get hashCode => accountSequence.hashCode ^ page.hashCode ^ pageSize.hashCode ^ sourceType.hashCode; } /// 贡献值记录 Provider @@ -78,6 +81,7 @@ final contributionRecordsProvider = FutureProvider.family