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 26aa458b..ecb3439e 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,36 +940,21 @@ 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 && !isExpiredReward; + final bool isRewardEntry = entry.allocationType != null; 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: isExpiredReward ? const Color(0xFFFAFAFA) : Colors.white, + color: Colors.white, borderRadius: BorderRadius.circular(12), boxShadow: [ BoxShadow( @@ -986,10 +971,16 @@ class _LedgerDetailPageState extends ConsumerState width: 40, height: 40, decoration: BoxDecoration( - color: iconBgColor, + color: isIncome + ? const Color(0x1A4CAF50) + : const Color(0x1AE53935), borderRadius: BorderRadius.circular(10), ), - child: Icon(iconData, size: 20, color: iconColor), + child: Icon( + isIncome ? Icons.arrow_downward : Icons.arrow_upward, + size: 20, + color: isIncome ? const Color(0xFF4CAF50) : const Color(0xFFE53935), + ), ), const SizedBox(width: 12), // 类型和时间 @@ -997,41 +988,14 @@ class _LedgerDetailPageState extends ConsumerState child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - 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)), - ), - ), - ], + Text( + entry.displayName, + style: const TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: Color(0xFF5D4037), ), - ] else ...[ - Text( - entry.displayName, - style: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.w500, - color: Color(0xFF5D4037), - ), - ), - ], + ), const SizedBox(height: 4), Text( _formatDate(entry.createdAt), @@ -1057,9 +1021,7 @@ class _LedgerDetailPageState extends ConsumerState style: TextStyle( fontSize: 16, fontWeight: FontWeight.w700, - color: isExpiredReward - ? const Color(0xFF9E9E9E) - : (isIncome ? const Color(0xFF4CAF50) : const Color(0xFFE53935)), + color: isIncome ? const Color(0xFF4CAF50) : const Color(0xFFE53935), ), ), ),