Revert "fix(ledger): REWARD_EXPIRED条目显示权益类型+已过期标签"

This reverts commit 4bd40970d0.
This commit is contained in:
hailin 2026-02-28 12:04:07 -08:00
parent 4bd40970d0
commit 62bbbca609
1 changed files with 18 additions and 56 deletions

View File

@ -940,36 +940,21 @@ class _LedgerDetailPageState extends ConsumerState<LedgerDetailPage>
///
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<LedgerDetailPage>
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<LedgerDetailPage>
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<LedgerDetailPage>
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),
),
),
),