From a38727eb7f37582c88daafd921ad6c4eca156c26 Mon Sep 17 00:00:00 2001 From: hailin Date: Wed, 24 Dec 2025 03:16:39 -0800 Subject: [PATCH] =?UTF-8?q?Revert=20"revert(profile):=20=E5=9B=9E=E6=BB=9A?= =?UTF-8?q?profile=5Fpage.dart=E5=88=B0=E7=A8=B3=E5=AE=9A=E7=89=88?= =?UTF-8?q?=E6=9C=AC"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b06f1868364a0fa2728dcb2acdd7e981a1814bf3. --- .../presentation/pages/profile_page.dart | 68 +++++++++++++++---- 1 file changed, 53 insertions(+), 15 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 0e94cdc2..ccc6ce4e 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 @@ -609,9 +609,10 @@ class _ProfilePageState extends ConsumerState { nickname: r.nickname, avatarUrl: r.avatarUrl, completedCount: r.completedCount, - targetCount: 50000, // 省公司目标5万 + targetCount: 50000, // 省公司目标固定5万 monthlyEarnings: r.monthlyEarnings, isCurrentUser: r.isCurrentUser, + accountSequence: r.accountSequence, )).toList(); }); } @@ -642,9 +643,10 @@ class _ProfilePageState extends ConsumerState { nickname: r.nickname, avatarUrl: r.avatarUrl, completedCount: r.completedCount, - targetCount: 10000, // 市公司目标1万 + targetCount: 10000, // 市公司目标固定1万 monthlyEarnings: r.monthlyEarnings, isCurrentUser: r.isCurrentUser, + accountSequence: r.accountSequence, )).toList(); }); } @@ -2203,18 +2205,29 @@ class _ProfilePageState extends ConsumerState { ), ), ), - // 第三行:备注信息 + // 第三行:来源信息(从 memo 中提取,去掉权益类型前缀) if (item.memo.isNotEmpty) ...[ const SizedBox(height: 4), - Text( - item.memo, - style: const TextStyle( - fontSize: 11, - fontFamily: 'Inter', - color: Color(0x995D4037), - ), - maxLines: 2, - overflow: TextOverflow.ellipsis, + Builder( + builder: (context) { + // memo 格式如 "分享权益:来自用户D25122400000的认种" + // 去掉前缀,只显示 "来自用户xxx的认种" 部分 + String displayMemo = item.memo; + final colonIndex = displayMemo.indexOf(':'); + if (colonIndex != -1 && colonIndex < displayMemo.length - 1) { + displayMemo = displayMemo.substring(colonIndex + 1); + } + return Text( + displayMemo, + style: const TextStyle( + fontSize: 11, + fontFamily: 'Inter', + color: Color(0x995D4037), + ), + maxLines: 2, + overflow: TextOverflow.ellipsis, + ); + }, ), ], ], @@ -2431,7 +2444,7 @@ class _ProfilePageState extends ConsumerState { StackedCardsView( items: _settleableRewards, peekHeight: 28, - expandedCardHeight: 90, + expandedCardHeight: 110, enableSound: true, itemBuilder: (item, isSelected, index) => _buildStackedSettleableRewardCard(item, isSelected), ), @@ -2604,7 +2617,7 @@ class _ProfilePageState extends ConsumerState { final amountText = amountParts.isNotEmpty ? amountParts.join(' ') : '0 绿积分'; return Container( - height: isSelected ? 90 : 48, + height: isSelected ? 110 : 48, decoration: BoxDecoration( color: isSelected ? Colors.white : const Color(0xFFFFFDF8), borderRadius: BorderRadius.circular(8), @@ -2653,7 +2666,7 @@ class _ProfilePageState extends ConsumerState { ), ], ), - const SizedBox(height: 8), + const SizedBox(height: 6), // 第二行:金额信息 FittedBox( fit: BoxFit.scaleDown, @@ -2668,6 +2681,31 @@ class _ProfilePageState extends ConsumerState { ), ), ), + // 第三行:来源信息(从 memo 中提取,去掉权益类型前缀) + if (item.memo.isNotEmpty) ...[ + const SizedBox(height: 4), + Builder( + builder: (context) { + // memo 格式如 "分享权益:来自用户D25122400000的认种" + // 去掉前缀,只显示 "来自用户xxx的认种" 部分 + String displayMemo = item.memo; + final colonIndex = displayMemo.indexOf(':'); + if (colonIndex != -1 && colonIndex < displayMemo.length - 1) { + displayMemo = displayMemo.substring(colonIndex + 1); + } + return Text( + displayMemo, + style: const TextStyle( + fontSize: 11, + fontFamily: 'Inter', + color: Color(0x995D4037), + ), + maxLines: 2, + overflow: TextOverflow.ellipsis, + ); + }, + ), + ], ], ), )