feat: add nutrition and mood reminder settings

- Implemented nutrition and mood reminder toggles in notification settings screen.
- Added corresponding utility functions for managing nutrition and mood reminder preferences.
- Updated user preferences interface to include nutrition and mood reminder states.
- Enhanced localization for new reminder settings and alerts.
- Incremented iOS app version to 1.0.30.
This commit is contained in:
2025-11-23 22:47:54 +08:00
parent bcb910140e
commit 8cbf6be50a
7 changed files with 359 additions and 151 deletions

View File

@@ -825,6 +825,8 @@ const notificationSettingsResources = {
sections: {
notifications: '通知设置',
medicationReminder: '药品提醒',
nutritionReminder: '营养提醒',
moodReminder: '心情提醒',
description: '说明',
},
items: {
@@ -836,9 +838,17 @@ const notificationSettingsResources = {
title: '药品通知提醒',
description: '在用药时间接收提醒通知',
},
nutritionReminder: {
title: '营养记录提醒',
description: '在用餐时间接收营养记录提醒',
},
moodReminder: {
title: '心情记录提醒',
description: '在晚间接收心情记录提醒',
},
},
description: {
text: '• 消息推送是所有通知的总开关\n• 药品通知提醒需要在消息推送开启后才能使用\n• 您可以在系统设置中管理通知权限\n• 关闭消息推送将停止所有应用通知',
text: '• 消息推送是所有通知的总开关\n• 各类提醒需要在消息推送开启后才能使用\n• 您可以在系统设置中管理通知权限\n• 关闭消息推送将停止所有应用通知',
},
alerts: {
permissionDenied: {
@@ -852,6 +862,8 @@ const notificationSettingsResources = {
message: '请求通知权限失败',
saveFailed: '保存设置失败',
medicationReminderFailed: '设置药品提醒失败',
nutritionReminderFailed: '设置营养提醒失败',
moodReminderFailed: '设置心情提醒失败',
},
notificationsEnabled: {
title: '通知已开启',
@@ -861,6 +873,14 @@ const notificationSettingsResources = {
title: '药品提醒已开启',
body: '您将在用药时间收到提醒通知',
},
nutritionReminderEnabled: {
title: '营养提醒已开启',
body: '您将在用餐时间收到营养记录提醒',
},
moodReminderEnabled: {
title: '心情提醒已开启',
body: '您将在晚间收到心情记录提醒',
},
},
};
@@ -1597,6 +1617,8 @@ const resources = {
sections: {
notifications: 'Notification Settings',
medicationReminder: 'Medication Reminder',
nutritionReminder: 'Nutrition Reminder',
moodReminder: 'Mood Reminder',
description: 'Description',
},
items: {
@@ -1608,9 +1630,17 @@ const resources = {
title: 'Medication Reminder',
description: 'Receive reminder notifications at medication time',
},
nutritionReminder: {
title: 'Nutrition Record Reminder',
description: 'Receive nutrition record reminders at meal times',
},
moodReminder: {
title: 'Mood Record Reminder',
description: 'Receive mood record reminders in the evening',
},
},
description: {
text: '• Push notifications is the master switch for all notifications\n• Medication reminder requires push notifications to be enabled\n• You can manage notification permissions in system settings\n• Disabling push notifications will stop all app notifications',
text: '• Push notifications is the master switch for all notifications\n• Various reminders require push notifications to be enabled\n• You can manage notification permissions in system settings\n• Disabling push notifications will stop all app notifications',
},
alerts: {
permissionDenied: {
@@ -1624,6 +1654,8 @@ const resources = {
message: 'Failed to request notification permission',
saveFailed: 'Failed to save settings',
medicationReminderFailed: 'Failed to set medication reminder',
nutritionReminderFailed: 'Failed to set nutrition reminder',
moodReminderFailed: 'Failed to set mood reminder',
},
notificationsEnabled: {
title: 'Notifications Enabled',
@@ -1633,6 +1665,14 @@ const resources = {
title: 'Medication Reminder Enabled',
body: 'You will receive reminder notifications at medication time',
},
nutritionReminderEnabled: {
title: 'Nutrition Reminder Enabled',
body: 'You will receive nutrition record reminders at meal times',
},
moodReminderEnabled: {
title: 'Mood Reminder Enabled',
body: 'You will receive mood record reminders in the evening',
},
},
},
tabBarConfig: {