Files
digital-pilates/services/users.ts
richarjiang a6dbe7c723 feat: 更新用户资料编辑功能及相关组件
- 在 EditProfileScreen 中新增活动水平字段,支持用户设置和保存活动水平
- 更新个人信息卡片,增加活动水平的展示和编辑功能
- 在 ProfileCard 组件中优化样式,提升用户体验
- 更新 package.json 和 package-lock.json,新增 @react-native-picker/picker 依赖
- 在多个组件中引入 expo-image,优化图片加载和展示效果
2025-08-27 09:59:44 +08:00

25 lines
621 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { api } from '@/services/api';
export type Gender = 'male' | 'female';
export type UpdateUserDto = {
userId: string;
name?: string;
avatar?: string; // base64 字符串
gender?: Gender;
birthDate?: number; // 时间戳(秒)
dailyStepsGoal?: number;
dailyCaloriesGoal?: number;
pilatesPurposes?: string[];
weight?: number;
height?: number;
activityLevel?: number; // 活动水平 1-4
};
export async function updateUser(dto: UpdateUserDto): Promise<Record<string, any>> {
// 固定使用后端文档接口PUT /api/users/update
return await api.put('/api/users/update', dto);
}