feat: 更新训练计划和今日训练页面
- 在训练计划中添加了新的类型定义,优化了排课功能 - 修改了今日训练页面的布局,提升用户体验 - 删除了不再使用的排课相关文件,简化代码结构 - 更新了 Redux 状态管理,确保数据处理的准确性和稳定性
This commit is contained in:
@@ -35,6 +35,9 @@ import { buildClassicalSession } from '@/utils/classicalSession';
|
||||
// Tab 类型定义
|
||||
type TabType = 'list' | 'schedule';
|
||||
|
||||
// ScheduleItemType 类型定义
|
||||
type ScheduleItemType = 'exercise' | 'rest' | 'note';
|
||||
|
||||
|
||||
const GOAL_TEXT: Record<string, { title: string; color: string; description: string }> = {
|
||||
postpartum_recovery: { title: '产后恢复', color: '#9BE370', description: '温和激活,核心重建' },
|
||||
@@ -371,7 +374,7 @@ export default function TrainingPlanScreen() {
|
||||
durationSec: item.durationSec,
|
||||
restSec: item.restSec,
|
||||
note: item.note,
|
||||
itemType: item.itemType || 'exercise' as const,
|
||||
itemType: item.itemType || 'exercise',
|
||||
};
|
||||
|
||||
await dispatch(addExercise({ planId: selectedPlanId, dto })).unwrap();
|
||||
@@ -485,13 +488,13 @@ export default function TrainingPlanScreen() {
|
||||
<Text style={styles.scheduleActionBtnText}>添加动作</Text>
|
||||
</TouchableOpacity>
|
||||
|
||||
<TouchableOpacity
|
||||
{/* <TouchableOpacity
|
||||
style={[styles.scheduleSecondaryBtn, { borderColor: goalConfig.color }]}
|
||||
onPress={() => setGenVisible(true)}
|
||||
>
|
||||
<Ionicons name="flash" size={16} color={goalConfig.color} style={{ marginRight: 4 }} />
|
||||
<Text style={[styles.scheduleSecondaryBtnText, { color: goalConfig.color }]}>一键排课</Text>
|
||||
</TouchableOpacity>
|
||||
</TouchableOpacity> */}
|
||||
</View>
|
||||
|
||||
{/* 动作列表 */}
|
||||
@@ -625,7 +628,11 @@ export default function TrainingPlanScreen() {
|
||||
|
||||
{/* 一键排课配置弹窗 */}
|
||||
{selectedPlan && (
|
||||
<Modal visible={genVisible} transparent animationType="fade" onRequestClose={() => setGenVisible(false)}>
|
||||
<Modal
|
||||
visible={genVisible}
|
||||
transparent
|
||||
animationType="fade"
|
||||
onRequestClose={() => setGenVisible(false)}>
|
||||
<TouchableOpacity activeOpacity={1} style={styles.modalOverlay} onPress={() => setGenVisible(false)}>
|
||||
<TouchableOpacity activeOpacity={1} style={styles.modalSheet} onPress={(e) => e.stopPropagation() as any}>
|
||||
<Text style={styles.modalTitle}>一键排课配置</Text>
|
||||
|
||||
Reference in New Issue
Block a user