feat: 添加 BMI 计算和训练计划排课功能
- 新增 BMI 计算工具,支持用户输入体重和身高计算 BMI 值,并根据结果提供分类和建议 - 在训练计划中集成排课功能,允许用户选择和安排训练动作 - 更新个人信息页面,添加出生日期字段,支持用户完善个人资料 - 优化训练计划卡片样式,提升用户体验 - 更新相关依赖,确保项目兼容性和功能完整性
This commit is contained in:
@@ -195,6 +195,7 @@ export default function EditProfileScreen() {
|
||||
avatar: next.avatarUri || undefined,
|
||||
weight: next.weight || undefined,
|
||||
height: next.height || undefined,
|
||||
birthDate: next.birthDate ? new Date(next.birthDate).getTime() / 1000 : undefined,
|
||||
});
|
||||
// 拉取最新用户信息,刷新全局状态
|
||||
await dispatch(fetchMyProfile() as any);
|
||||
@@ -363,13 +364,13 @@ export default function EditProfileScreen() {
|
||||
<Text style={[styles.textInput, { color: profile.birthDate ? textColor : placeholderColor }]}>
|
||||
{profile.birthDate
|
||||
? (() => {
|
||||
try {
|
||||
const d = new Date(profile.birthDate);
|
||||
return new Intl.DateTimeFormat('zh-CN', { year: 'numeric', month: 'long', day: 'numeric' }).format(d);
|
||||
} catch {
|
||||
return profile.birthDate;
|
||||
}
|
||||
})()
|
||||
try {
|
||||
const d = new Date(profile.birthDate);
|
||||
return new Intl.DateTimeFormat('zh-CN', { year: 'numeric', month: 'long', day: 'numeric' }).format(d);
|
||||
} catch {
|
||||
return profile.birthDate;
|
||||
}
|
||||
})()
|
||||
: '选择出生日期(可选)'}
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
|
||||
Reference in New Issue
Block a user