#1026,解决,天气显示不同,无法同步bug
authorluozheng <1732036298@qq.com>
Thu, 24 Oct 2024 07:36:21 +0000 (15:36 +0800)
committerluozheng <1732036298@qq.com>
Thu, 24 Oct 2024 07:36:21 +0000 (15:36 +0800)
code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp

index b038170..ac06afb 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-04-08 18:40:09
- * @LastEditors: penglei 1624952103@qq.com
- * @LastEditTime: 2024-09-28 17:27:46
+ * @LastEditors: luozheng 1732036298@qq.com
+ * @LastEditTime: 2024-10-24 15:32:28
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp
  */
 #include "weather/include/WeatherModel.h"
@@ -172,14 +172,16 @@ namespace OHOS
     {
         // int index = Weather_data_t_now.iconNight;//夜晚天气图标
         int index;
-        if (IsNightTime())
-        {
-            index = Weather_data_t_now.iconNight; // 夜晚天气图标
-        }
-        else
-        {
-            index = Weather_data_seven_data[0].iconDay; // 白天天气图标
-        }
+        // if (IsNightTime())
+        // {
+        //     index = Weather_data_t_now.iconNight; // 夜晚天气图标
+        // }
+        // else
+        // {
+        //     index = Weather_data_seven_data[0].iconDay; // 白天天气图标
+        // }
+        index = Weather_data_seven_data[0].iconDay; // 白天天气图标
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Weather_data_t_now.iconNight = %d", index);        
         return weather65x65[index];
     }
 
@@ -194,14 +196,16 @@ namespace OHOS
     std::string WeatherModel::GetWeatherDescription()
     {
         std::string WeatherDescription;
-        if (IsNightTime())
-        {
-            WeatherDescription = Weather_data_t_now.textNight;
-        }
-        else
-        {
-            WeatherDescription = Weather_data_seven_data[0].textDay;
-        }
+        // if (IsNightTime())
+        // {
+        //     WeatherDescription = Weather_data_t_now.textNight;
+        // }
+        // else
+        // {
+        //     WeatherDescription = Weather_data_seven_data[0].textDay;
+        // }
+        WeatherDescription = Weather_data_seven_data[0].textDay;
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "WeatherDescription:%s", WeatherDescription.c_str());
         return WeatherDescription;
     }
 
@@ -346,14 +350,15 @@ namespace OHOS
         if (DialModelWeather::GetInstance())
         {
             int index;
-            if(IsNightTime())
-            {
-                index = Weather_data_t_now.iconNight; // 夜晚天气图标
-            }
-            else
-            {
-                index = Weather_data_seven_data[0].iconDay; //白天天气图标
-            }
+            // if(IsNightTime())
+            // {
+            //     index = Weather_data_t_now.iconNight; // 夜晚天气图标
+            // }
+            // else
+            // {
+            //     index = Weather_data_seven_data[0].iconDay; //白天天气图标
+            // }
+            index = Weather_data_seven_data[0].iconDay; //白天天气图标
             DialModelWeather::GetInstance()->UpdateWeather(index); // 更新主界面天气图标
             // const std::string str = GetWeatherTemperature() + " "+GetWeatherDescription();
             const std::string str = GetWeatherTemperature();