From 4bd40970d000f734d8ec2ad8c7e8a2af0c309653 Mon Sep 17 00:00:00 2001 From: hailin Date: Sat, 28 Feb 2026 12:01:36 -0800 Subject: [PATCH] =?UTF-8?q?fix(ledger):=20REWARD=5FEXPIRED=E6=9D=A1?= =?UTF-8?q?=E7=9B=AE=E6=98=BE=E7=A4=BA=E6=9D=83=E7=9B=8A=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?+=E5=B7=B2=E8=BF=87=E6=9C=9F=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 奖励过期条目显示具体权益名(分享权益/省团队权益等)+ 红色"已过期"标签 - 图标改为灰色 timer_off,金额文字改为灰色,背景微灰 - 与正常权益收入条目有明显视觉区分 Co-Authored-By: Claude Sonnet 4.6 --- .../pages/ledger_detail_page.dart | 74 ++++++++++++++----- 1 file changed, 56 insertions(+), 18 deletions(-) diff --git a/frontend/mobile-app/lib/features/trading/presentation/pages/ledger_detail_page.dart b/frontend/mobile-app/lib/features/trading/presentation/pages/ledger_detail_page.dart index ecb3439e..26aa458b 100644 --- a/frontend/mobile-app/lib/features/trading/presentation/pages/ledger_detail_page.dart +++ b/frontend/mobile-app/lib/features/trading/presentation/pages/ledger_detail_page.dart @@ -940,21 +940,36 @@ class _LedgerDetailPageState extends ConsumerState /// 构建流水项 Widget _buildLedgerItem(LedgerEntry entry) { final isIncome = entry.isIncome; + final bool isExpiredReward = entry.entryType == 'REWARD_EXPIRED'; // 可点击查看详情的类型:认种支付、权益分配、结算、提现、转入、转出 final bool isPlantPayment = entry.entryType == 'PLANT_PAYMENT' && entry.refOrderId != null; - final bool isRewardEntry = entry.allocationType != null; + final bool isRewardEntry = entry.allocationType != null && !isExpiredReward; final bool isSettlementEntry = entry.entryType == 'REWARD_SETTLED'; final bool isWithdrawalEntry = entry.entryType == 'WITHDRAWAL'; final bool isTransferEntry = entry.entryType == 'TRANSFER_IN' || entry.entryType == 'TRANSFER_OUT'; final bool isClickable = isPlantPayment || isRewardEntry || isSettlementEntry || isWithdrawalEntry || isTransferEntry; + // 奖励过期条目:图标用灰色 timer_off,标题显示权益类型 + "已过期"标签 + final Color iconBgColor = isExpiredReward + ? const Color(0x1A9E9E9E) + : (isIncome ? const Color(0x1A4CAF50) : const Color(0x1AE53935)); + final Color iconColor = isExpiredReward + ? const Color(0xFF9E9E9E) + : (isIncome ? const Color(0xFF4CAF50) : const Color(0xFFE53935)); + final IconData iconData = isExpiredReward + ? Icons.timer_off_outlined + : (isIncome ? Icons.arrow_downward : Icons.arrow_upward); + + // 过期条目标题:优先显示权益类型名(如"分享权益"),无则显示"奖励" + final String expiredTitle = entry.allocationTypeName ?? '奖励'; + return GestureDetector( onTap: isClickable ? () => _showEntryDetail(entry) : null, child: Container( margin: const EdgeInsets.only(bottom: 8), padding: const EdgeInsets.all(16), decoration: BoxDecoration( - color: Colors.white, + color: isExpiredReward ? const Color(0xFFFAFAFA) : Colors.white, borderRadius: BorderRadius.circular(12), boxShadow: [ BoxShadow( @@ -971,16 +986,10 @@ class _LedgerDetailPageState extends ConsumerState width: 40, height: 40, decoration: BoxDecoration( - color: isIncome - ? const Color(0x1A4CAF50) - : const Color(0x1AE53935), + color: iconBgColor, borderRadius: BorderRadius.circular(10), ), - child: Icon( - isIncome ? Icons.arrow_downward : Icons.arrow_upward, - size: 20, - color: isIncome ? const Color(0xFF4CAF50) : const Color(0xFFE53935), - ), + child: Icon(iconData, size: 20, color: iconColor), ), const SizedBox(width: 12), // 类型和时间 @@ -988,14 +997,41 @@ class _LedgerDetailPageState extends ConsumerState child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - entry.displayName, - style: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.w500, - color: Color(0xFF5D4037), + if (isExpiredReward) ...[ + Row( + children: [ + Text( + expiredTitle, + style: const TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: Color(0xFF9E9E9E), + ), + ), + const SizedBox(width: 6), + Container( + padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 1), + decoration: BoxDecoration( + color: const Color(0x1AE53935), + borderRadius: BorderRadius.circular(4), + ), + child: const Text( + '已过期', + style: TextStyle(fontSize: 10, color: Color(0xFFE53935)), + ), + ), + ], ), - ), + ] else ...[ + Text( + entry.displayName, + style: const TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: Color(0xFF5D4037), + ), + ), + ], const SizedBox(height: 4), Text( _formatDate(entry.createdAt), @@ -1021,7 +1057,9 @@ class _LedgerDetailPageState extends ConsumerState style: TextStyle( fontSize: 16, fontWeight: FontWeight.w700, - color: isIncome ? const Color(0xFF4CAF50) : const Color(0xFFE53935), + color: isExpiredReward + ? const Color(0xFF9E9E9E) + : (isIncome ? const Color(0xFF4CAF50) : const Color(0xFFE53935)), ), ), ),