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; 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; };