feat: 移除目标管理功能模块

删除了完整的目标管理功能,包括目标创建、编辑、任务管理等相关页面和组件。同时移除了相关的API服务、Redux状态管理、类型定义和通知功能。应用版本从1.0.20升级到1.0.21。
This commit is contained in:
richarjiang
2025-10-31 08:49:22 +08:00
parent 7cd290d341
commit 16c2351160
31 changed files with 953 additions and 7884 deletions

View File

@@ -3,7 +3,6 @@ export const ROUTES = {
// Tab路由
TAB_EXPLORE: '/explore',
TAB_COACH: '/coach',
TAB_GOALS: '/goals',
TAB_STATISTICS: '/statistics',
TAB_CHALLENGES: '/challenges',
TAB_PERSONAL: '/personal',
@@ -30,7 +29,6 @@ export const ROUTES = {
// 用户相关路由
AUTH_LOGIN: '/auth/login',
PROFILE_EDIT: '/profile/edit',
PROFILE_GOALS: '/profile/goals',
// 法律相关路由
LEGAL_USER_AGREEMENT: '/legal/user-agreement',
@@ -59,8 +57,6 @@ export const ROUTES = {
// 轻断食相关
FASTING_PLAN_DETAIL: '/fasting',
// 任务相关路由
TASK_DETAIL: '/task-detail',
// 目标管理路由 (已移至tab中)
// GOAL_MANAGEMENT: '/goal-management',
@@ -85,8 +81,7 @@ export const ROUTE_PARAMS = {
// 文章参数
ARTICLE_ID: 'id',
// 任务参数
TASK_ID: 'taskId',
// 断食计划参数
FASTING_PLAN_ID: 'planId',
// 重定向参数

View File

@@ -1,227 +0,0 @@
import { CreateGoalRequest } from '@/types/goals';
export interface GoalTemplate {
id: string;
title: string;
icon: string;
iconColor: string;
backgroundColor: string;
category: 'recommended' | 'health' | 'lifestyle' | 'exercise';
data: Partial<CreateGoalRequest>;
isRecommended?: boolean;
}
export interface GoalCategory {
id: string;
title: string;
icon?: string;
isRecommended?: boolean;
}
export const goalTemplates: GoalTemplate[] = [
// 改善睡眠分类的模板
{
id: 'afternoon-nap',
title: '睡一会午觉',
icon: 'hotel',
iconColor: '#22D3EE',
backgroundColor: '#E0F2FE',
category: 'health',
data: {
title: '午休时间',
description: '每天午休30分钟恢复精力',
repeatType: 'daily',
frequency: 1,
hasReminder: true,
reminderTime: '13:00',
},
isRecommended: true
},
{
id: 'regular-bedtime',
title: '规律作息',
icon: 'access-time',
iconColor: '#8B5CF6',
backgroundColor: '#F3E8FF',
category: 'health',
data: {
title: '保持规律作息',
description: '每天固定时间睡觉起床,建立健康的生物钟',
repeatType: 'daily',
frequency: 1,
hasReminder: true,
reminderTime: '22:30',
},
isRecommended: true
},
// 生活习惯分类的模板
{
id: 'eat-breakfast',
title: '坚持吃早餐',
icon: 'restaurant',
iconColor: '#F97316',
backgroundColor: '#FFF7ED',
category: 'lifestyle',
data: {
title: '坚持吃早餐',
description: '每天按时吃早餐,保持营养均衡',
repeatType: 'daily',
frequency: 1,
hasReminder: true,
reminderTime: '07:30',
},
isRecommended: true
},
{
id: 'drink-water',
title: '喝八杯水',
icon: 'local-drink',
iconColor: '#06B6D4',
backgroundColor: '#E0F2FE',
category: 'lifestyle',
data: {
title: '每日饮水目标',
description: '每天喝足够的水,保持身体水分',
repeatType: 'daily',
frequency: 8,
hasReminder: true,
reminderTime: '09:00',
},
isRecommended: true
},
{
id: 'read-book',
title: '看一本新书',
icon: 'book',
iconColor: '#8B5CF6',
backgroundColor: '#F3E8FF',
category: 'lifestyle',
data: {
title: '阅读新书',
description: '每天阅读30分钟丰富知识',
repeatType: 'daily',
frequency: 1,
hasReminder: true,
reminderTime: '20:00',
}
},
{
id: 'housework',
title: '做一会家务',
icon: 'home',
iconColor: '#F97316',
backgroundColor: '#FFF7ED',
category: 'lifestyle',
data: {
title: '日常家务',
description: '每天做一些家务,保持家居整洁',
repeatType: 'daily',
frequency: 1,
hasReminder: true,
reminderTime: '19:00',
}
},
{
id: 'mindfulness',
title: '练习一次正念',
icon: 'self-improvement',
iconColor: '#10B981',
backgroundColor: '#ECFDF5',
category: 'lifestyle',
data: {
title: '正念练习',
description: '每天练习10分钟正念冥想',
repeatType: 'daily',
frequency: 1,
hasReminder: true,
reminderTime: '21:00',
},
isRecommended: true
},
// 运动锻炼分类的模板
{
id: 'exercise-duration',
title: '锻炼时长达标',
icon: 'timer',
iconColor: '#7C3AED',
backgroundColor: '#F3E8FF',
category: 'exercise',
data: {
title: '每日锻炼时长',
description: '每天至少锻炼30分钟',
repeatType: 'daily',
frequency: 1,
hasReminder: true,
reminderTime: '17:00',
}
},
{
id: 'morning-run',
title: '晨跑',
icon: 'directions-run',
iconColor: '#EF4444',
backgroundColor: '#FEF2F2',
category: 'exercise',
data: {
title: '每日晨跑',
description: '每天早上跑步30分钟保持活力',
repeatType: 'daily',
frequency: 1,
hasReminder: true,
reminderTime: '06:30',
}
},
{
id: 'yoga-practice',
title: '瑜伽练习',
icon: 'self-improvement',
iconColor: '#10B981',
backgroundColor: '#ECFDF5',
category: 'exercise',
data: {
title: '每日瑜伽',
description: '每天练习瑜伽,提升身体柔韧性',
repeatType: 'daily',
frequency: 1,
hasReminder: true,
reminderTime: '19:30',
}
},
];
// 分类定义
export const goalCategories: GoalCategory[] = [
{
id: 'recommended',
title: '推荐',
isRecommended: true
},
{
id: 'health',
title: '改善睡眠'
},
{
id: 'lifestyle',
title: '生活习惯'
},
{
id: 'exercise',
title: '运动锻炼'
}
];
// 按类别分组的模板
export const getTemplatesByCategory = (category: string) => {
if (category === 'recommended') {
// 推荐分类显示所有分类中的精选模板
return goalTemplates.filter(template => template.isRecommended);
}
return goalTemplates.filter(template => template.category === category);
};
// 获取所有分类
export const getAllCategories = () => {
return goalCategories;
};