chore(nav): 暂时隐藏矿机Tab

- 底部导航从4个减少到3个: 龙虎榜、交易、我
- 保留矿机相关代码注释,方便后续恢复
- 调整索引映射以匹配新的Tab顺序

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2025-12-15 01:05:28 -08:00
parent db37fbf860
commit 5219a5a39f
2 changed files with 20 additions and 16 deletions

View File

@ -60,25 +60,27 @@ class _HomeShellPageState extends ConsumerState<HomeShellPage>
int _getCurrentIndex(BuildContext context) {
final location = GoRouterState.of(context).uri.path;
// Tab暂时隐藏: 0-, 1-, 2-
if (location.startsWith(RoutePaths.ranking)) return 0;
if (location.startsWith(RoutePaths.mining)) return 1;
if (location.startsWith(RoutePaths.trading)) return 2;
if (location.startsWith(RoutePaths.profile)) return 3;
// if (location.startsWith(RoutePaths.mining)) return 1; //
if (location.startsWith(RoutePaths.trading)) return 1;
if (location.startsWith(RoutePaths.profile)) return 2;
return 0;
}
void _onTabTapped(BuildContext context, int index) {
// Tab暂时隐藏: 0-, 1-, 2-
switch (index) {
case 0:
context.go(RoutePaths.ranking);
break;
// case 1: //
// context.go(RoutePaths.mining);
// break;
case 1:
context.go(RoutePaths.mining);
break;
case 2:
context.go(RoutePaths.trading);
break;
case 3:
case 2:
context.go(RoutePaths.profile);
break;
}

View File

@ -1,7 +1,8 @@
import 'package:flutter/material.dart';
///
/// Tab
/// Tab
/// Tab暂时隐藏便
/// 使 LayoutBuilder
class BottomNavBar extends StatelessWidget {
final int currentIndex;
@ -41,20 +42,21 @@ class BottomNavBar extends StatelessWidget {
activeIcon: Icons.leaderboard,
label: '龙虎榜',
),
// Tab暂时隐藏便
// _buildNavItem(
// index: 1,
// icon: Icons.memory_outlined,
// activeIcon: Icons.memory,
// label: '矿机',
// ),
_buildNavItem(
index: 1,
icon: Icons.memory_outlined,
activeIcon: Icons.memory,
label: '矿机',
),
_buildNavItem(
index: 2,
index: 1, // index: 2
icon: Icons.swap_horiz_outlined,
activeIcon: Icons.swap_horiz,
label: '交易',
),
_buildNavItem(
index: 3,
index: 2, // index: 3
icon: Icons.person_outline,
activeIcon: Icons.person,
label: '',