From 12d0507a8c26c0041bab8ad17fd9395c3003f356 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Tue, 16 Apr 2024 10:19:21 +0800 Subject: [PATCH] =?utf8?q?=E6=A0=B9=E6=8D=AE=E2=80=9C=E5=9B=BE=E6=A0=87?= =?utf8?q?=E4=BB=A3=E7=A0=81=E5=AF=B9=E7=85=A7=E8=A1=A8=E2=80=9D=E4=BF=AE?= =?utf8?q?=E6=94=B9=E5=A4=A9=E6=B0=94=E8=A7=86=E5=9B=BE=EF=BC=8C=E7=8E=B0?= =?utf8?q?=E5=9C=A8=E4=BC=9A=E8=BF=94=E5=9B=9E=E6=AD=A3=E7=A1=AE=E7=9A=84?= =?utf8?q?=E5=A4=A9=E6=B0=94icon=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/weather/include/WeatherModel.h | 28 ++++++++++--------- .../nativeui/weather/src/WeatherModel.cpp | 26 ++++++++--------- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherModel.h b/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherModel.h index da731694a..b3fa3779d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherModel.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-04-08 18:40:20 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-04-15 14:45:55 + * @LastEditTime: 2024-04-16 09:57:34 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherModel.h */ #ifndef WEATHER_MODEL_H @@ -64,18 +64,20 @@ namespace OHOS #define weather_src "/user/res/weather/weather65x65/" static const char *weather65x65[] = { - weather_src "weather_sunny.bin", // 晴天 - weather_src "weather_clear-cloudy.bin", // 多云 - weather_src "weather_rain.bin", // 阵雨 - weather_src "weather_thundershower.bin", - weather_src "weather_foggy.bin", - weather_src "weather_unknown.bin", - weather_src "weather_overcast.bin", - weather_src "weather_clear-sunny.bin", - weather_src "weather_duststorm.bin", - weather_src "weather_haze.bin", - weather_src "weather_snow.bin", - weather_src "weather_sunny-cloudy.bin", + weather_src "weather_placeholder.bin", // 占位或默认 + weather_src "weather_sunny.bin", // 晴(白天) + weather_src "weather_clear-sunny.bin", // 晴(晚上) + weather_src "weather_sunny-cloudy.bin", // 多云(白天) + weather_src "weather_clear-cloudy.bin", // 多云(晚上) + weather_src "weather_overcast.bin", // 阴 + weather_src "weather_rain.bin", // 阵雨 + weather_src "weather_thundershower.bin", // 雷雨 + weather_src "weather_snow.bin", // 雪 + weather_src "weather_foggy.bin", // 雾 + weather_src "weather_haze.bin", // 霾 + weather_src "weather_duststorm.bin", // 沙尘暴 + weather_src "weather_unknown.bin", // 未知 + }; /* -------------------------------------------------------------------------- */ class WeatherModel 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 987f0af29..daa9e5639 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-04-08 18:40:09 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-04-15 15:16:06 + * @LastEditTime: 2024-04-16 09:48:10 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp */ #include "weather/include/WeatherModel.h" @@ -83,18 +83,18 @@ namespace OHOS } #endif /* __cplusplus */ - // static constexpr const char json_data[] = - // "{\"now\": {\"humidity\":89,\"windScale\":\"2\",\"textNight\":\"多云\",\"uvIndex\":3,\"temp\":24,\"iconNight\":4}," - // "\"address\": {\"lat\":225737664,\"atm\":\"1010\",\"city\":\"深圳\",\"subLocality\":\"宝安\",\"lon\":1138535138}," - // "\"daily\": [{\"tempMin\":22,\"iconDay\":6,\"fxDate\":1712505600,\"textDay\":\"阵雨\",\"tempMax\":29}," - // "{\"tempMax\":27,\"textDay\":\"多云\",\"iconDay\":3,\"fxDate\":1712592000,\"tempMin\":22}," - // "{\"tempMax\":29,\"fxDate\":1712678400,\"textDay\":\"多云\",\"iconDay\":3,\"tempMin\":22}," - // "{\"tempMin\":23,\"textDay\":\"多云\",\"fxDate\":1712764800,\"tempMax\":30,\"iconDay\":3}," - // "{\"fxDate\":1712851200,\"textDay\":\"多云\",\"iconDay\":3,\"tempMax\":31,\"tempMin\":24}," - // "{\"fxDate\":1712937600,\"iconDay\":3,\"tempMax\":31,\"tempMin\":24,\"textDay\":\"多云\"}," - // "{\"fxDate\":1713024000,\"textDay\":\"多云\",\"iconDay\":3,\"tempMax\":29,\"tempMin\":25}]," - // "\"code\":1}"; - static constexpr const char json_data[2048] = "{\"now\":{\"humidity\":89,\"windScale\":\"2\",\"textNight\":\"多云\",\"uvIndex\":3,\"temp\":24,\"iconNight\":4},\"address\":{\"lat\":225737664,\"atm\":\"1010\",\"city\":\"深圳\",\"subLocality\":\"宝安\",\"lon\":1138535138},\"daily\":[{\"tempMin\":22,\"iconDay\":6,\"fxDate\":1712505600,\"textDay\":\"阵雨\",\"tempMax\":29},{\"tempMax\":27,\"textDay\":\"多云\",\"iconDay\":3,\"fxDate\":1712592000,\"tempMin\":22},{\"tempMax\":29,\"fxDate\":1712678400,\"textDay\":\"多云\",\"iconDay\":3,\"tempMin\":22},{\"tempMin\":23,\"textDay\":\"多云\",\"fxDate\":1712764800,\"tempMax\":30,\"iconDay\":3},{\"fxDate\":1712851200,\"textDay\":\"多云\",\"iconDay\":3,\"tempMax\":31,\"tempMin\":24},{\"fxDate\":1712937600,\"iconDay\":3,\"tempMax\":31,\"tempMin\":24,\"textDay\":\"多云\"},{\"fxDate\":1713024000,\"textDay\":\"多云\",\"iconDay\":3,\"tempMax\":29,\"tempMin\":25}],\"code\":1}"; + static constexpr const char json_data[] = + "{\"now\": {\"humidity\":89,\"windScale\":\"2\",\"textNight\":\"多云\",\"uvIndex\":3,\"temp\":24,\"iconNight\":4}," + "\"address\": {\"lat\":225737664,\"atm\":\"1010\",\"city\":\"深圳\",\"subLocality\":\"宝安\",\"lon\":1138535138}," + "\"daily\": [{\"tempMin\":22,\"iconDay\":6,\"fxDate\":1712505600,\"textDay\":\"阵雨\",\"tempMax\":29}," + "{\"tempMax\":27,\"textDay\":\"多云\",\"iconDay\":3,\"fxDate\":1712592000,\"tempMin\":22}," + "{\"tempMax\":29,\"fxDate\":1712678400,\"textDay\":\"多云\",\"iconDay\":3,\"tempMin\":22}," + "{\"tempMin\":23,\"textDay\":\"多云\",\"fxDate\":1712764800,\"tempMax\":30,\"iconDay\":3}," + "{\"fxDate\":1712851200,\"textDay\":\"多云\",\"iconDay\":3,\"tempMax\":31,\"tempMin\":24}," + "{\"fxDate\":1712937600,\"iconDay\":3,\"tempMax\":31,\"tempMin\":24,\"textDay\":\"多云\"}," + "{\"fxDate\":1713024000,\"textDay\":\"多云\",\"iconDay\":3,\"tempMax\":29,\"tempMin\":25}]," + "\"code\":1}"; + //static constexpr const char json_data[] = "{\"now\":{\"humidity\":89,\"windScale\":\"2\",\"textNight\":\"多云\",\"uvIndex\":3,\"temp\":24,\"iconNight\":4},\"address\":{\"lat\":225737664,\"atm\":\"1010\",\"city\":\"深圳\",\"subLocality\":\"宝安\",\"lon\":1138535138},\"daily\":[{\"tempMin\":22,\"iconDay\":6,\"fxDate\":1712505600,\"textDay\":\"阵雨\",\"tempMax\":29},{\"tempMax\":27,\"textDay\":\"多云\",\"iconDay\":3,\"fxDate\":1712592000,\"tempMin\":22},{\"tempMax\":29,\"fxDate\":1712678400,\"textDay\":\"多云\",\"iconDay\":3,\"tempMin\":22},{\"tempMin\":23,\"textDay\":\"多云\",\"fxDate\":1712764800,\"tempMax\":30,\"iconDay\":3},{\"fxDate\":1712851200,\"textDay\":\"多云\",\"iconDay\":3,\"tempMax\":31,\"tempMin\":24},{\"fxDate\":1712937600,\"iconDay\":3,\"tempMax\":31,\"tempMin\":24,\"textDay\":\"多云\"},{\"fxDate\":1713024000,\"textDay\":\"多云\",\"iconDay\":3,\"tempMax\":29,\"tempMin\":25}],\"code\":1}"; /* -------------------------------------------------------------------------- */ uint8_t WeatherModel::WEATHER_DATA_VALID = 0; WeatherModel::WeatherModel() -- 2.17.1