feat: 实现减脂体重管理App完整功能

- 实现拍照识别食物功能(集成大语言模型视觉能力)
- 实现智能对话功能(集成大语言模型流式输出)
- 实现食物记录和卡路里管理功能
- 实现体重记录和统计功能
- 实现健康数据管理页面
- 配置数据库表结构(用户、食物记录、体重记录)
- 实现Express后端API路由
- 配置Tab导航和前端页面
- 采用健康运动配色方案
This commit is contained in:
jaystar
2026-02-02 15:17:50 +08:00
commit 28c4d7b3b4
82 changed files with 21891 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
import { Tabs } from 'expo-router';
import { Platform } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { FontAwesome6 } from '@expo/vector-icons';
import { useTheme } from '@/hooks/useTheme';
export default function TabLayout() {
const { theme, isDark } = useTheme();
const insets = useSafeAreaInsets();
return (
<Tabs
screenOptions={{
headerShown: false,
tabBarStyle: {
backgroundColor: theme.backgroundDefault,
borderTopColor: theme.border,
height: Platform.OS === 'web' ? 60 : 50 + insets.bottom,
paddingBottom: Platform.OS === 'web' ? 0 : insets.bottom,
},
tabBarActiveTintColor: theme.primary,
tabBarInactiveTintColor: theme.textMuted,
tabBarItemStyle: {
height: Platform.OS === 'web' ? 60 : undefined,
},
}}
>
<Tabs.Screen
name="index"
options={{
title: '首页',
tabBarIcon: ({ color }) => <FontAwesome6 name="house" size={20} color={color} />,
}}
/>
<Tabs.Screen
name="record"
options={{
title: '记录',
tabBarIcon: ({ color }) => <FontAwesome6 name="camera" size={20} color={color} />,
}}
/>
<Tabs.Screen
name="stats"
options={{
title: '统计',
tabBarIcon: ({ color }) => <FontAwesome6 name="chart-line" size={20} color={color} />,
}}
/>
<Tabs.Screen
name="chat"
options={{
title: 'AI助手',
tabBarIcon: ({ color }) => <FontAwesome6 name="robot" size={20} color={color} />,
}}
/>
</Tabs>
);
}

View File

@@ -0,0 +1 @@
export { default } from "@/screens/chat";

View File

@@ -0,0 +1 @@
export { default } from "@/screens/home";

View File

@@ -0,0 +1 @@
export { default } from "@/screens/record";

View File

@@ -0,0 +1 @@
export { default } from "@/screens/stats";

30
client/app/+not-found.tsx Normal file
View File

@@ -0,0 +1,30 @@
import { View, Text, StyleSheet } from 'react-native';
import { Link } from 'expo-router';
import { useTheme } from '@/hooks/useTheme';
import { Spacing } from '@/constants/theme';
export default function NotFoundScreen() {
const { theme } = useTheme();
return (
<View style={[styles.container, { backgroundColor: theme.backgroundRoot }]}>
<Text>
</Text>
<Link href="/" style={[styles.gohome]}>
</Link>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
gohome: {
marginTop: Spacing['2xl'],
},
});

9
client/app/_layout.tsx Normal file
View File

@@ -0,0 +1,9 @@
import { Stack } from 'expo-router';
export default function RootLayout() {
return (
<Stack screenOptions={{ headerShown: false }}>
<Stack.Screen name="(tabs)" />
</Stack>
);
}