From 2706eef54fff9e1d62dc2dd3c3f5b62dd1631b33 Mon Sep 17 00:00:00 2001 From: hailin Date: Mon, 2 Mar 2026 09:04:07 -0800 Subject: [PATCH] =?UTF-8?q?feat(mining-app):=20=E5=85=91=E6=8D=A2=E9=A1=B5?= =?UTF-8?q?"=E6=80=BB=E7=A7=AF=E5=88=86=E8=82=A1"=E6=94=B9=E4=B8=BA"?= =?UTF-8?q?=E5=89=A9=E4=BD=99=E7=A7=AF=E5=88=86=E8=82=A1"=EF=BC=8C?= =?UTF-8?q?=E5=88=86=E9=85=8D=E8=AE=B0=E5=BD=95=E7=A7=AF=E5=88=86=E8=82=A1?= =?UTF-8?q?=E7=B2=BE=E5=BA=A6=E6=8F=90=E5=8D=87=E8=87=B313=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 兑换页面(trading_page): - 市场数据卡片标签从"总积分股"改为"剩余积分股" - 值的计算从直接显示 totalShares(100.02亿)改为 totalShares - totalMined(总量 - 全网已分配量), 使用 Decimal 精确运算避免浮点误差 2. 分配记录页面(mining_records_page): - 每条分配记录的积分股显示从 formatAmount(4位小数) 改为 formatDecimal(value, 13),展示完整13位小数精度 Co-Authored-By: Claude Opus 4.6 --- .../presentation/pages/profile/mining_records_page.dart | 2 +- .../lib/presentation/pages/trading/trading_page.dart | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/frontend/mining-app/lib/presentation/pages/profile/mining_records_page.dart b/frontend/mining-app/lib/presentation/pages/profile/mining_records_page.dart index 707752ab..7446482f 100644 --- a/frontend/mining-app/lib/presentation/pages/profile/mining_records_page.dart +++ b/frontend/mining-app/lib/presentation/pages/profile/mining_records_page.dart @@ -225,7 +225,7 @@ class _MiningRecordsListPageState extends ConsumerState { ), ), Text( - '+${formatAmount(record.shareAmount)}', + '+${formatDecimal(record.shareAmount, 13)}', style: const TextStyle( fontSize: 18, fontWeight: FontWeight.bold, diff --git a/frontend/mining-app/lib/presentation/pages/trading/trading_page.dart b/frontend/mining-app/lib/presentation/pages/trading/trading_page.dart index 29e88f57..ca5ccb62 100644 --- a/frontend/mining-app/lib/presentation/pages/trading/trading_page.dart +++ b/frontend/mining-app/lib/presentation/pages/trading/trading_page.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'package:decimal/decimal.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:go_router/go_router.dart'; @@ -357,8 +358,12 @@ class _TradingPageState extends ConsumerState { Row( children: [ _buildMarketDataItem( - '总积分股', - market != null ? formatCompact(market.totalShares) : null, + '剩余积分股', + market != null + ? formatCompact((Decimal.parse(market.totalShares) - + Decimal.parse(market.totalMined)) + .toString()) + : null, _orange, isLoading, ),