From b5bedea8353c5aa1af70f2d70e7cd65019a89f93 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Thu, 24 Oct 2024 15:36:21 +0800 Subject: [PATCH] =?utf8?q?#1026,=E8=A7=A3=E5=86=B3=EF=BC=8C=E5=A4=A9?= =?utf8?q?=E6=B0=94=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=90=8C=EF=BC=8C=E6=97=A0?= =?utf8?q?=E6=B3=95=E5=90=8C=E6=AD=A5bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/weather/src/WeatherModel.cpp | 57 ++++++++++--------- 1 file changed, 31 insertions(+), 26 deletions(-) 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(); -- 2.17.1