feat: 更新个人信息和打卡功能

- 在个人信息页面中修改用户姓名字段为“name”,并添加注销帐号功能,支持用户删除帐号及相关数据
- 在打卡页面中集成从后端获取当天打卡列表的功能,确保用户数据的实时同步
- 更新 Redux 状态管理,支持打卡记录的同步和更新
- 新增打卡服务,提供创建、更新和删除打卡记录的 API 接口
- 优化样式以适应新功能的展示和交互
This commit is contained in:
richarjiang
2025-08-13 19:24:03 +08:00
parent ebc74eb1c8
commit 7ad26590e5
7 changed files with 225 additions and 22 deletions

View File

@@ -26,7 +26,7 @@ type WeightUnit = 'kg' | 'lb';
type HeightUnit = 'cm' | 'ft';
interface UserProfile {
fullName?: string;
name?: string;
gender?: 'male' | 'female' | '';
age?: string; // 存储为字符串,方便非必填
// 以公制为基准存储
@@ -43,7 +43,7 @@ export default function EditProfileScreen() {
const insets = useSafeAreaInsets();
const [profile, setProfile] = useState<UserProfile>({
fullName: '',
name: '',
gender: '',
age: '',
weightKg: undefined,
@@ -66,7 +66,7 @@ export default function EditProfileScreen() {
]);
let next: UserProfile = {
fullName: '',
name: '',
gender: '',
age: '',
weightKg: undefined,
@@ -179,11 +179,11 @@ export default function EditProfileScreen() {
style={[styles.textInput, { color: textColor }]}
placeholder="填写姓名(可选)"
placeholderTextColor={placeholderColor}
value={profile.fullName}
onChangeText={(t) => setProfile((p) => ({ ...p, fullName: t }))}
value={profile.name}
onChangeText={(t) => setProfile((p) => ({ ...p, name: t }))}
/>
{/* 校验勾无需强制,仅装饰 */}
{!!profile.fullName && <Text style={{ color: '#C4C4C4' }}></Text>}
{!!profile.name && <Text style={{ color: '#C4C4C4' }}></Text>}
</View>
{/* 体重kg */}