feat: 更新应用版本和主题设置

- 将应用版本更新至 1.0.3,修改相关配置文件
- 强制全局使用浅色主题,确保一致的用户体验
- 在训练计划功能中新增激活计划的 API 接口,支持用户激活训练计划
- 优化打卡功能,支持自动同步打卡记录至服务器
- 更新样式以适应新功能的展示和交互
This commit is contained in:
2025-08-14 22:23:45 +08:00
parent 56d4c7fd7f
commit 807e185761
21 changed files with 677 additions and 141 deletions

View File

@@ -18,7 +18,7 @@ import { ThemedText } from '@/components/ThemedText';
import { HeaderBar } from '@/components/ui/HeaderBar';
import { palette } from '@/constants/Colors';
import { useAppDispatch, useAppSelector } from '@/hooks/redux';
import { clearError, deletePlan, loadPlans, setCurrentPlan, type TrainingPlan } from '@/store/trainingPlanSlice';
import { activatePlan, clearError, deletePlan, loadPlans, type TrainingPlan } from '@/store/trainingPlanSlice';
const GOAL_TEXT: Record<string, { title: string; color: string; description: string }> = {
@@ -184,6 +184,15 @@ export default function TrainingPlanListScreen() {
return () => clearTimeout(timer);
}
}, [error, dispatch]);
const handleActivate = async (planId: string) => {
try {
await dispatch(activatePlan(planId));
} catch (error) {
console.error('激活训练计划失败:', error);
}
}
return (
<View style={styles.safeArea}>
@@ -243,7 +252,7 @@ export default function TrainingPlanListScreen() {
index={index}
isActive={p.id === currentId}
onPress={() => {
dispatch(setCurrentPlan(p.id));
router.push(`/training-plan/create?id=${p.id}` as any);
}}
onDelete={() => dispatch(deletePlan(p.id))}
/>
@@ -303,6 +312,7 @@ const styles = StyleSheet.create({
fontSize: 28,
fontWeight: '800',
color: '#192126',
lineHeight: 34,
marginBottom: 4,
},
subtitle: {