From: Caisking Date: Sat, 2 Aug 2025 09:22:18 +0000 (+0800) Subject: 修复睡眠卡片错误的屏蔽 X-Git-Tag: leiniao_debug_1.0.0_20250922_020716~201 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=b8386a2a05c9f06b331ce5754aad0bdb5f820852;p=mirrors%2FFD230.git 修复睡眠卡片错误的屏蔽 --- diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/sleep/src/SleepModel.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/sleep/src/SleepModel.cpp index cf4bd10e9..3823e09fe 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/sleep/src/SleepModel.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/sleep/src/SleepModel.cpp @@ -368,6 +368,9 @@ namespace OHOS void SleepModel::ReInitData() { + //更新睡眠目标 + set_sleep_goal(); + uint32_t sleep_fall_asleep_timestamp = 0; uint32_t sleep_wake_up_timestamp = 0; uint32_t nap_fall_asleep_timestamp = 0; @@ -588,10 +591,11 @@ namespace OHOS std::string SleepModel::GetUpdateSleepTime() { sleep_time_str.clear(); - // // 获取睡眠最新时间 + // 获取睡眠最新时间 // sleep_update_time = get_sleep_update_timestamp(); - // // 获取时间戳 - // update_time_info(sleep_update_time, sleep_time_str); + sleep_update_time = 0; + // 获取时间戳 + update_time_info(sleep_update_time, sleep_time_str); return sleep_time_str; } // 校验时间更新 @@ -679,10 +683,7 @@ namespace OHOS notify_hour -= 1; // 小时减1 } // 确保小时数正确 - notify_hour = - (notify_hour < 0) - ? 23 - : notify_hour; // 处理从0点前SLEPPNOTIFY分钟的情况,变为前一天的23点40分 + notify_hour = (notify_hour < 0) ? 23 : notify_hour; // 处理从0点前SLEPPNOTIFY分钟的情况,变为前一天的23点40分 // 格式化提醒时间字符串 std::ostringstream notifyoss; notifyoss << std::setfill('0') << std::setw(2) << notify_hour << ":"