修复睡眠卡片错误的屏蔽
authorCaisking <Casiking@zhihuishixun.com>
Sat, 2 Aug 2025 09:22:18 +0000 (17:22 +0800)
committerCaisking <Casiking@zhihuishixun.com>
Sat, 2 Aug 2025 09:22:18 +0000 (17:22 +0800)
code/sdk/application/wearable/fd230/nativeapp/nativeui/sleep/src/SleepModel.cpp

index cf4bd10..3823e09 100644 (file)
@@ -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 << ":"