feat: 添加心情记录功能

在统计页面新增心情卡片和弹窗组件,支持用户记录和查看每日心情状态。
This commit is contained in:
richarjiang
2025-08-21 15:34:47 +08:00
parent b93a863e25
commit a7607e0f74
4 changed files with 656 additions and 10 deletions

76
components/MoodCard.tsx Normal file
View File

@@ -0,0 +1,76 @@
import React from 'react';
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { ThemedText } from './ThemedText';
import { ThemedView } from './ThemedView';
interface MoodCardProps {
onPress: () => void;
}
export function MoodCard({ onPress }: MoodCardProps) {
return (
<ThemedView style={styles.container}>
<View style={styles.header}>
<ThemedText style={styles.title}></ThemedText>
<ThemedText style={styles.subtitle}></ThemedText>
</View>
<TouchableOpacity style={styles.content} onPress={onPress}>
<View style={styles.moodIcon}>
<Text style={styles.emoji}>😊</Text>
</View>
<ThemedText style={styles.moodText}></ThemedText>
</TouchableOpacity>
</ThemedView>
);
}
const styles = StyleSheet.create({
container: {
backgroundColor: '#fff',
borderRadius: 16,
padding: 16,
marginBottom: 16,
shadowColor: '#000',
shadowOffset: {
width: 0,
height: 2,
},
shadowOpacity: 0.1,
shadowRadius: 3.84,
elevation: 5,
},
header: {
marginBottom: 12,
},
title: {
fontSize: 18,
fontWeight: '600',
marginBottom: 4,
},
subtitle: {
fontSize: 14,
opacity: 0.6,
},
content: {
flexDirection: 'row',
alignItems: 'center',
paddingVertical: 8,
},
moodIcon: {
width: 40,
height: 40,
borderRadius: 20,
backgroundColor: '#f0f0f0',
justifyContent: 'center',
alignItems: 'center',
marginRight: 12,
},
emoji: {
fontSize: 20,
},
moodText: {
fontSize: 16,
flex: 1,
},
});