diff --git a/frontend/mining-app/lib/presentation/pages/asset/asset_page.dart b/frontend/mining-app/lib/presentation/pages/asset/asset_page.dart index 6e865a5b..42ac89a9 100644 --- a/frontend/mining-app/lib/presentation/pages/asset/asset_page.dart +++ b/frontend/mining-app/lib/presentation/pages/asset/asset_page.dart @@ -49,7 +49,6 @@ class _AssetPageState extends ConsumerState { void _startTimerWithGrowth(AssetDisplay asset, String perSecondEarning) { // 防止重复启动 if (_timerStarted && _refreshTimer != null) { - debugPrint('[AssetPage] Timer already started, skipping'); return; } @@ -61,14 +60,11 @@ class _AssetPageState extends ConsumerState { _growthPerSecond = double.tryParse(perSecondEarning) ?? 0; _timerStarted = true; - debugPrint('[AssetPage] Starting timer: perSecondEarning=$perSecondEarning, growthPerSecond=$_growthPerSecond, initialDisplayValue=$_initialDisplayValue'); - _refreshTimer = Timer.periodic(const Duration(seconds: 1), (timer) { if (mounted) { setState(() { _elapsedSeconds++; }); - debugPrint('[AssetPage] Timer tick: $_elapsedSeconds, currentDisplayValue=$_currentDisplayValue'); } }); } @@ -111,15 +107,10 @@ class _AssetPageState extends ConsumerState { final perSecondEarning = shareAccount?.perSecondEarning ?? '0'; final hasValidGrowth = (double.tryParse(perSecondEarning) ?? 0) > 0; - // 调试日志 - debugPrint('[AssetPage] build: accountSequence=$accountSequence, asset=${asset != null}, shareAccount=${shareAccount != null}'); - debugPrint('[AssetPage] build: perSecondEarning=$perSecondEarning, hasValidGrowth=$hasValidGrowth, _timerStarted=$_timerStarted, _lastAccountSequence=$_lastAccountSequence'); - // 当数据加载完成时启动定时器 if (asset != null && hasValidGrowth) { // 账户切换或首次加载时重置并启动定时器 if (_lastAccountSequence != accountSequence) { - debugPrint('[AssetPage] Account changed or first load, resetting timer'); _lastAccountSequence = accountSequence; _lastAsset = asset; _resetTimer(); @@ -128,7 +119,6 @@ class _AssetPageState extends ConsumerState { }); } else if (!_timerStarted) { // 定时器未启动时启动(例如页面刚进入) - debugPrint('[AssetPage] Timer not started, starting now'); _lastAsset = asset; WidgetsBinding.instance.addPostFrameCallback((_) { if (mounted) _startTimerWithGrowth(asset, perSecondEarning); @@ -137,10 +127,7 @@ class _AssetPageState extends ConsumerState { _lastAsset = asset; } } else if (asset != null) { - debugPrint('[AssetPage] Asset loaded but no valid growth: perSecondEarning=$perSecondEarning'); _lastAsset = asset; - } else { - debugPrint('[AssetPage] Asset is null, waiting for data'); } return Scaffold(