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 97023bb8..affa49c5 100644 --- a/frontend/mining-app/lib/presentation/pages/trading/trading_page.dart +++ b/frontend/mining-app/lib/presentation/pages/trading/trading_page.dart @@ -366,7 +366,7 @@ class _TradingPageState extends ConsumerState { // 流通池:显示全网已挖矿产出的积分股总量(totalMined), // 而非交易流通池(circulationPool,目前无交易故为0) _buildMarketDataItem( - '流通池', + '已分配积分股', market != null ? formatCompact(market.totalMined) : null, _orange, isLoading, @@ -386,11 +386,18 @@ class _TradingPageState extends ConsumerState { ), Container(width: 1, height: 24, color: bgGray), const SizedBox(width: 16), - _buildMarketDataItem( - '已销毁量', - market != null ? formatIntWithCommas(market.blackHoleAmount) : null, - _red, - isLoading, + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: market != null ? () => _showBurnDetailDialog(market) : null, + child: _buildMarketDataItemContent( + '已销毁量', + market != null ? formatIntWithCommas(market.blackHoleAmount) : null, + _red, + isLoading, + showTapHint: true, + ), + ), ), ], ), @@ -401,26 +408,83 @@ class _TradingPageState extends ConsumerState { Widget _buildMarketDataItem(String label, String? value, Color valueColor, bool isLoading) { return Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(label, style: TextStyle(fontSize: 12, color: AppColors.textSecondaryOf(context))), - const SizedBox(height: 4), - DataText( - data: value, - isLoading: isLoading, - placeholder: '--,---,---', - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.bold, - color: valueColor, - ), + child: _buildMarketDataItemContent(label, value, valueColor, isLoading), + ); + } + + Widget _buildMarketDataItemContent(String label, String? value, Color valueColor, bool isLoading, {bool showTapHint = false}) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisSize: MainAxisSize.min, + children: [ + Text(label, style: TextStyle(fontSize: 12, color: AppColors.textSecondaryOf(context))), + if (showTapHint) ...[ + const SizedBox(width: 4), + Icon(Icons.info_outline, size: 14, color: AppColors.textSecondaryOf(context)), + ], + ], + ), + const SizedBox(height: 4), + DataText( + data: value, + isLoading: isLoading, + placeholder: '--,---,---', + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + color: valueColor, + ), + ), + ], + ); + } + + void _showBurnDetailDialog(MarketOverview market) { + final darkText = AppColors.textPrimaryOf(context); + final grayText = AppColors.textSecondaryOf(context); + + showDialog( + context: context, + builder: (context) => AlertDialog( + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), + backgroundColor: AppColors.cardOf(context), + title: Text( + '销毁明细', + style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color: darkText), + ), + content: Column( + mainAxisSize: MainAxisSize.min, + children: [ + _buildBurnDetailRow('系统总销毁量', formatIntWithCommas(market.blackHoleAmount), darkText, grayText), + const SizedBox(height: 16), + _buildBurnDetailRow('全网兑换销毁量', formatIntWithCommas(market.circulationPool), darkText, grayText), + ], + ), + actions: [ + TextButton( + onPressed: () => Navigator.of(context).pop(), + child: const Text('关闭'), ), ], ), ); } + Widget _buildBurnDetailRow(String label, String value, Color textColor, Color labelColor) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text(label, style: TextStyle(fontSize: 14, color: labelColor)), + Text( + value, + style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold, color: textColor), + ), + ], + ); + } + Widget _buildTradingPanel(AsyncValue priceAsync) { final priceInfo = priceAsync.valueOrNull; final currentPrice = priceInfo?.price ?? '0';