feat: 新增喝水提醒功能,支持定期提醒和目标检查

This commit is contained in:
richarjiang
2025-09-02 18:56:40 +08:00
parent ccbc3417bc
commit 70e3152158
6 changed files with 569 additions and 61 deletions

View File

@@ -170,6 +170,13 @@ export class NotificationService {
if (data?.url) {
router.push(data.url as any);
}
} else if (data?.type === 'water_reminder' || data?.type === 'regular_water_reminder') {
// 处理喝水提醒通知
console.log('用户点击了喝水提醒通知', data);
// 跳转到统计页面查看喝水进度
if (data?.url) {
router.push(data.url as any);
}
}
}
@@ -446,6 +453,8 @@ export const NotificationTypes = {
LUNCH_REMINDER: 'lunch_reminder',
DINNER_REMINDER: 'dinner_reminder',
MOOD_REMINDER: 'mood_reminder',
WATER_REMINDER: 'water_reminder',
REGULAR_WATER_REMINDER: 'regular_water_reminder',
} as const;
// 便捷方法