From: luozheng <1732036298@qq.com> Date: Thu, 24 Oct 2024 07:36:21 +0000 (+0800) Subject: #1026,解决,天气显示不同,无法同步bug X-Git-Tag: fd230_release_V1.3.102~188^2~8 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=b5bedea8353c5aa1af70f2d70e7cd65019a89f93;p=mirrors%2FFD230.git #1026,解决,天气显示不同,无法同步bug --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp index b03817003..ac06afb6f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp @@ -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();