fix(mining-app): 分配记录时间压缩防溢出 + 剩余积分股扣除销毁量
1. 分配记录页面:
- 时间格式从完整时间戳压缩为 "YY/MM/DD HH:mm:ss",节省空间
- 积分股字号从18缩至13,字体改为monospace便于对齐
- 外层加 Flexible 防止超出屏幕右边界
2. 兑换页面剩余积分股:
- 公式从 totalShares - totalMined
改为 totalShares - totalMined - blackHoleAmount
- 即:总量 - 已分配 - 已销毁 = 真正的剩余可分配量
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
789a703ec8
commit
40731c08ea
|
|
@ -216,20 +216,23 @@ class _MiningRecordsListPageState extends ConsumerState<MiningRecordsListPage> {
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
record.distributionMinute,
|
_shortTime(record.distributionMinute),
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 12,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
color: _darkText,
|
color: _darkText,
|
||||||
fontFamily: 'monospace',
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Flexible(
|
||||||
|
child: Text(
|
||||||
'+${formatDecimal(record.shareAmount, 13)}',
|
'+${formatDecimal(record.shareAmount, 13)}',
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 18,
|
fontSize: 13,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: _green,
|
color: _green,
|
||||||
|
fontFamily: 'monospace',
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.right,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
@ -290,6 +293,24 @@ class _MiningRecordsListPageState extends ConsumerState<MiningRecordsListPage> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// 压缩时间显示:'2026-03-02 17:24:00' → '26/03/02 17:24'
|
||||||
|
String _shortTime(String time) {
|
||||||
|
// 去掉秒和毫秒部分,截短年份
|
||||||
|
final t = time.replaceAll('T', ' ').split('.').first; // 去毫秒
|
||||||
|
try {
|
||||||
|
final dt = DateTime.parse(t);
|
||||||
|
final y = (dt.year % 100).toString().padLeft(2, '0');
|
||||||
|
final m = dt.month.toString().padLeft(2, '0');
|
||||||
|
final d = dt.day.toString().padLeft(2, '0');
|
||||||
|
final h = dt.hour.toString().padLeft(2, '0');
|
||||||
|
final min = dt.minute.toString().padLeft(2, '0');
|
||||||
|
final s = dt.second.toString().padLeft(2, '0');
|
||||||
|
return '$y/$m/$d $h:$min:$s';
|
||||||
|
} catch (_) {
|
||||||
|
return time.length > 16 ? time.substring(0, 16) : time;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String _formatPercent(String ratio) {
|
String _formatPercent(String ratio) {
|
||||||
try {
|
try {
|
||||||
final value = double.parse(ratio);
|
final value = double.parse(ratio);
|
||||||
|
|
|
||||||
|
|
@ -362,7 +362,8 @@ class _TradingPageState extends ConsumerState<TradingPage> {
|
||||||
market != null
|
market != null
|
||||||
? formatCompact(
|
? formatCompact(
|
||||||
(Decimal.parse(market.totalShares) -
|
(Decimal.parse(market.totalShares) -
|
||||||
Decimal.parse(market.totalMined))
|
Decimal.parse(market.totalMined) -
|
||||||
|
Decimal.parse(market.blackHoleAmount))
|
||||||
.toString(),
|
.toString(),
|
||||||
precision: 4)
|
precision: 4)
|
||||||
: null,
|
: null,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue