From 93918366a93049f07742234fa67c861c3e193f61 Mon Sep 17 00:00:00 2001 From: richarjiang Date: Mon, 18 Aug 2025 08:43:44 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E9=A1=B5=E5=92=8C=E6=96=B0=E5=A2=9E=E7=BB=9F=E8=AE=A1=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改标签页的名称和图标,将“探索”改为“统计”,并更新相关逻辑 - 新增统计页面,展示用户健康数据和历史记录 - 优化首页布局,调整组件显示,提升用户体验 - 删除不再使用的代码,简化项目结构 --- app/(tabs)/_layout.tsx | 75 +++++++++++----------- app/(tabs)/index.tsx | 27 ++++---- app/(tabs)/{explore.tsx => statistics.tsx} | 0 3 files changed, 51 insertions(+), 51 deletions(-) rename app/(tabs)/{explore.tsx => statistics.tsx} (100%) diff --git a/app/(tabs)/_layout.tsx b/app/(tabs)/_layout.tsx index b19e314..16ad7b8 100644 --- a/app/(tabs)/_layout.tsx +++ b/app/(tabs)/_layout.tsx @@ -19,7 +19,7 @@ export default function TabLayout() { const routeName = route.name; const isSelected = (routeName === 'index' && pathname === '/') || (routeName === 'coach' && pathname === '/coach') || - (routeName === 'explore' && pathname === '/explore') || + (routeName === 'statistics' && pathname === '/statistics') || pathname.includes(routeName); return { @@ -42,8 +42,8 @@ export default function TabLayout() { return { icon: 'house.fill', title: '首页' } as const; case 'coach': return { icon: 'person.3.fill', title: 'Bot' } as const; - case 'explore': - return { icon: 'paperplane.fill', title: '探索' } as const; + case 'statistics': + return { icon: 'chart.pie.fill', title: '统计' } as const; case 'personal': return { icon: 'person.fill', title: '个人' } as const; default: @@ -125,34 +125,7 @@ export default function TabLayout() { tabBarShowLabel: false, }; }}> - { - const isHomeSelected = pathname === '/' || pathname === '/index'; - return ( - - - {isHomeSelected && ( - - 首页 - - )} - - ); - }, - }} - /> + { - const isExploreSelected = pathname === '/explore'; + const isHomeSelected = pathname === '/' || pathname === '/index'; return ( - - {isExploreSelected && ( + + {isHomeSelected && ( - 探索 + 首页 + + )} + + ); + }, + }} + /> + { + const isStatisticsSelected = pathname === '/statistics'; + return ( + + + {isStatisticsSelected && ( + + 统计 )} diff --git a/app/(tabs)/index.tsx b/app/(tabs)/index.tsx index ac2c483..6e89f42 100644 --- a/app/(tabs)/index.tsx +++ b/app/(tabs)/index.tsx @@ -12,7 +12,6 @@ import { loadPlans } from '@/store/trainingPlanSlice'; // Removed WorkoutCard import since we no longer use the horizontal carousel import { useAuthGuard } from '@/hooks/useAuthGuard'; import { TrainingPlan } from '@/services/trainingPlanApi'; -import { getChineseGreeting } from '@/utils/date'; import { useRouter } from 'expo-router'; import React from 'react'; import { Animated, Image, PanResponder, Pressable, SafeAreaView, ScrollView, StyleSheet, useWindowDimensions, View } from 'react-native'; @@ -260,10 +259,10 @@ export default function HomeScreen() { {/* Header Section */} - + {/* {getChineseGreeting()} - 新学员,欢迎你 - + + */} {/* Search Box */} @@ -274,16 +273,16 @@ export default function HomeScreen() { - pushIfAuthedElseLogin('/workout/today')} > - + 训练 @@ -308,17 +307,17 @@ export default function HomeScreen() { > - + 计划 - + diff --git a/app/(tabs)/explore.tsx b/app/(tabs)/statistics.tsx similarity index 100% rename from app/(tabs)/explore.tsx rename to app/(tabs)/statistics.tsx