feat: 增加睡眠分析通知功能,支持睡眠质量评估与建议

This commit is contained in:
richarjiang
2025-12-03 10:13:14 +08:00
parent 02b2de3ea3
commit e713ffbace
14 changed files with 190 additions and 415 deletions

View File

@@ -656,6 +656,45 @@ export const workoutDetail = {
},
};
export const sleepNotification = {
// Notification body template
body: 'You slept {{duration}} last night with {{efficiency}}% efficiency. Score: {{score}} 🎯',
// Sleep quality titles - warm and encouraging tone
quality: {
excellent: 'Amazing! You slept great',
good: 'Nice! Good sleep quality',
fair: 'Not bad, tomorrow will be better',
poor: 'Hang in there, rest well tonight',
veryPoor: 'Take care of yourself',
default: 'Sleep analysis complete',
},
// Sleep duration formatting
duration: {
hoursOnly: '{{hours}} hours',
hoursAndMinutes: '{{hours}}h {{minutes}}m',
},
// Sleep tips - encouraging tone
tips: {
excellent: {
keepItUp: 'Keep it up, you\'re doing amazing!',
greatJob: 'Your body thanks you for the great care!',
energized: 'You\'ll be full of energy today!',
proud: 'Give yourself a pat on the back!',
},
suggestions: {
shortSleep: 'Try hitting the pillow earlier - 7-9 hours will boost your energy!',
longSleep: 'Too much sleep can be tiring too - try a consistent wake time!',
lowDeepSleep: 'Put your phone away before bed for deeper rest~',
lowRemSleep: 'A regular schedule helps you dream better!',
lowEfficiency: 'A cozy bedroom environment can work wonders~',
},
general: 'Every night is a fresh start - take care of yourself!',
},
};
export const workoutHistory = {
title: 'Workout Summary',
loading: 'Loading workout records...',

View File

@@ -657,6 +657,45 @@ export const workoutDetail = {
},
};
export const sleepNotification = {
// 通知正文模板
body: '昨晚睡了 {{duration}},睡眠效率 {{efficiency}}%,得分 {{score}} 分 🎯',
// 睡眠质量标题 - 更温暖鼓励的语气
quality: {
excellent: '太棒了!睡得真好',
good: '不错哦!睡眠质量良好',
fair: '还行,明天会更好',
poor: '辛苦了,今晚早点休息',
veryPoor: '抱抱,好好照顾自己',
default: '睡眠分析完成啦',
},
// 睡眠时长格式化
duration: {
hoursOnly: '{{hours}} 小时',
hoursAndMinutes: '{{hours}} 小时 {{minutes}} 分钟',
},
// 睡眠建议 - 更鼓励的语气
tips: {
excellent: {
keepItUp: '继续保持,你真的很棒!',
greatJob: '身体一定很感谢你的照顾~',
energized: '今天一定精力满满!',
proud: '为自己的好习惯点赞!',
},
suggestions: {
shortSleep: '试着早点上床吧7-9 小时的睡眠会让你更有活力哦~',
longSleep: '睡太久也会累哦,试试固定起床时间~',
lowDeepSleep: '睡前放下手机,让大脑好好休息~',
lowRemSleep: '规律作息能帮助你做更多好梦~',
lowEfficiency: '调整一下卧室环境,会睡得更香哦~',
},
general: '每一晚都是新的开始,照顾好自己~',
},
};
export const workoutHistory = {
title: '锻炼总结',
loading: '正在加载锻炼记录...',