From 5219a5a39f667804b0a2f6813fe3c0fa0079a3c7 Mon Sep 17 00:00:00 2001 From: hailin Date: Mon, 15 Dec 2025 01:05:28 -0800 Subject: [PATCH] =?UTF-8?q?chore(nav):=20=E6=9A=82=E6=97=B6=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E7=9F=BF=E6=9C=BATab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 底部导航从4个减少到3个: 龙虎榜、交易、我 - 保留矿机相关代码注释,方便后续恢复 - 调整索引映射以匹配新的Tab顺序 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../presentation/pages/home_shell_page.dart | 16 ++++++++------- .../presentation/widgets/bottom_nav_bar.dart | 20 ++++++++++--------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/frontend/mobile-app/lib/features/home/presentation/pages/home_shell_page.dart b/frontend/mobile-app/lib/features/home/presentation/pages/home_shell_page.dart index 76239078..518f532b 100644 --- a/frontend/mobile-app/lib/features/home/presentation/pages/home_shell_page.dart +++ b/frontend/mobile-app/lib/features/home/presentation/pages/home_shell_page.dart @@ -60,25 +60,27 @@ class _HomeShellPageState extends ConsumerState 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; } diff --git a/frontend/mobile-app/lib/features/home/presentation/widgets/bottom_nav_bar.dart b/frontend/mobile-app/lib/features/home/presentation/widgets/bottom_nav_bar.dart index a98ddb6a..6a90b73f 100644 --- a/frontend/mobile-app/lib/features/home/presentation/widgets/bottom_nav_bar.dart +++ b/frontend/mobile-app/lib/features/home/presentation/widgets/bottom_nav_bar.dart @@ -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: '我',