diff --git a/Weather/README.en.md b/Weather/README.en.md index 9ec5cfe9085313c9fc92c5f375d8675b1a7680ba..447446776fa6a76da236fd64fcb62c28f8185286 100644 --- a/Weather/README.en.md +++ b/Weather/README.en.md @@ -4,7 +4,7 @@ This sample demonstrates one-time development for multi-device deployment by showing how to develop a weather app and deploy it across different devices. The demo app includes the following: home page, **Manage City** page, **Add City** page, and **Update Time** page. -**How to Implement** +### How to Implement 1. Use the grid breakpoint system of responsive layout to implement different display effects on windows of different sizes. @@ -14,6 +14,13 @@ This sample demonstrates one-time development for multi-device deployment by sho 4. Use **Canvas** and **CanvasRenderingContext2D** to draw curves that show the air quality and sunrise and sunset. +### Display Effect + +| breakpoint | sm | md | lg | +|--------------|---------------------------------------------------|-----------------------------------------------------------------------|-----------------------------------------------------| +| Final effect | ![phone_cn.png](screenshots/devices/phone_en.png) | ![foldable_screen_cn.png](screenshots/devices/foldable_screen_en.png) | ![tablet_cn.png](screenshots/devices/tablet_en.png) | + + **How to Use** 1. After the demo app is started, weather information of the added cities is displayed on the home page. By default, two cities are present. You can swipe left or right to switch between them. The sidebar is displayed by default on a large-screen (LG) device. When the sidebar is displayed, the content area occupies 2/3 of the screen; when the sidebar is hidden, the content area automatically extends to full screen. @@ -28,9 +35,6 @@ This sample demonstrates one-time development for multi-device deployment by sho 6. Touch **Add City** on the **Manage Cities** page. On the **Add City** page displayed, tap any city that has not been added before. The city will be added to the city list and the **Manage Cities** page will be displayed. -Display Effect - -![home](./screenshots/devices/zh/home.png) ### Required Permissions diff --git a/Weather/README.md b/Weather/README.md index db563ea0202a7be1dd616da64c1edfba5da6a36b..c6810b23048ca8e6f490a054eb20730abcbc1943 100644 --- a/Weather/README.md +++ b/Weather/README.md @@ -14,10 +14,9 @@ ### 效果预览 - -| 首页 | -|--------------------------------------| -|![home](./screenshots/devices/zh/home.png)| +| 断点 | sm | md | lg | +|-----|---------------------------------------------------|-----------------------------------------------------------------------|-----------------------------------------------------| +| 效果图 | ![phone_cn.png](screenshots/devices/phone_cn.png) | ![foldable_screen_cn.png](screenshots/devices/foldable_screen_cn.png) | ![tablet_cn.png](screenshots/devices/tablet_cn.png) | 使用说明: @@ -79,7 +78,7 @@ 1、home.ets中引入SideContent()和homeContent()。 2、定义showSideBar来判断是否展示侧边栏,定义mediaquery.MediaQueryListener媒体监听器smListener、mdListener、lgListener。 3、在aboutToAppear调用mediaquery对界面进行监听,[源码参考](product/default/src/main/ets/pages/Home.ets )。 -4、监听到当前屏幕大小,调用this.isBreakpoint断点,对curBp、showSideBar进行赋值,[源码参考](product/default/src/main/ets/pages/Home.ets )。 +4、监听到当前屏幕大小,调用this.isBreakpoint断点,对curBp、showSideBar进行赋值,[源码参考](product/default/src/main/ets/pages/Home.ets )。 ### 相关权限 diff --git a/Weather/build-profile.json5 b/Weather/build-profile.json5 index 449658bcece3da55241d6795a724d42b3c5a62cd..7b2837f57b3b5bcd74360b2c7137b85c09ee8ddd 100644 --- a/Weather/build-profile.json5 +++ b/Weather/build-profile.json5 @@ -5,8 +5,8 @@ { "name": "default", "signingConfig": "default", - "compatibleSdkVersion": "5.0.5(17)", - "targetSdkVersion": "5.0.5(17)", + "targetSdkVersion": "5.1.1(19)", + "compatibleSdkVersion": "5.0.1(13)", "runtimeOS": "HarmonyOS", "buildOption": { "strictMode": { diff --git a/Weather/common/src/main/ets/mock/CityInfo.ets b/Weather/common/src/main/ets/mock/CityInfo.ets index 1e5d86d9c9055b3f02cf0825549107c4783ed522..a925e6f02dafe41aca82d4616326c9ca01d33699 100644 --- a/Weather/common/src/main/ets/mock/CityInfo.ets +++ b/Weather/common/src/main/ets/mock/CityInfo.ets @@ -15,119 +15,119 @@ export const cityData: CityInfo[] = [ { - "name": "北京", + "name": $r('app.string.Beijing'), "temp": "32", - "weather": "晴" + "weather": $r('app.string.Sunny') }, { - "name": "上海", + "name": $r('app.string.Shanghai'), "temp": "28", - "weather": "阴" + "weather": $r('app.string.Cloudy') }, { - "name": "广州", + "name": $r('app.string.Guangzhou'), "temp": "35", - "weather": "小雨" + "weather": $r('app.string.Rainy') }, { - "name": "天津", + "name": $r('app.string.Tianjin'), "temp": "35", - "weather": "中雨" + "weather": $r('app.string.Rainy') }, { - "name": "武汉", + "name": $r('app.string.Wuhan'), "temp": "26", - "weather": "多云" + "weather": $r('app.string.Cloudy') }, { - "name": "沈阳", + "name": $r('app.string.Shenyang'), "temp": "25", - "weather": "晴" + "weather": $r('app.string.Sunny') }, { - "name": "重庆", + "name": $r('app.string.Chongqing'), "temp": "27", - "weather": "小雨" + "weather": $r('app.string.Rainy') }, { - "name": "杭州", + "name": $r('app.string.Hangzhou'), "temp": "35", - "weather": "晴" + "weather": $r('app.string.Sunny') }, { - "name": "南京", + "name": $r('app.string.Nanjing'), "temp": "25", - "weather": "晴" + "weather": $r('app.string.Sunny') }, { - "name": "哈尔滨", + "name": $r('app.string.Harbin'), "temp": "25", - "weather": "晴" + "weather": $r('app.string.Sunny') }, { - "name": "长春", + "name": $r('app.string.Changchun'), "temp": "28", - "weather": "阵雨" + "weather": $r('app.string.Shower') }, { - "name": "呼和浩特", + "name": $r('app.string.Hohhot'), "temp": "25", - "weather": "晴" + "weather": $r('app.string.Sunny') }, { - "name": "石家庄", + "name": $r('app.string.Shijiazhuang'), "temp": "25", - "weather": "晴" + "weather": $r('app.string.Sunny') }, { - "name": "银川", + "name": $r('app.string.Yinchuan'), "temp": "25", - "weather": "晴" + "weather": $r('app.string.Sunny') }, { - "name": "乌鲁木齐", + "name": $r('app.string.Urumqi'), "temp": "25", - "weather": "晴" + "weather": $r('app.string.Sunny') }, { - "name": "拉萨", + "name": $r('app.string.Lhasa'), "temp": "35", - "weather": "晴" + "weather": $r('app.string.Sunny') }, { - "name": "西宁", + "name": $r('app.string.Xining'), "temp": "25", - "weather": "晴" + "weather": $r('app.string.Sunny') }, { - "name": "西安", + "name": $r('app.string.Xian'), "temp": "25", - "weather": "晴" + "weather": $r('app.string.Sunny') }, { - "name": "兰州", + "name": $r('app.string.Lanzhou'), "temp": "25", - "weather": "多云" + "weather": $r('app.string.Cloudy') }, { - "name": "太原", + "name": $r('app.string.Taiyuan'), "temp": "25", - "weather": "阴" + "weather": $r('app.string.Cloudy') }, { - "name": "昆明", + "name": $r('app.string.Kunming'), "temp": "25", - "weather": "小雨" + "weather": $r('app.string.Rainy') }, { - "name": "南宁", + "name": $r('app.string.Nanning'), "temp": "20", - "weather": "晴" + "weather": $r('app.string.Sunny') } ]; export class CityInfo { - name: string = ''; + name: ResourceStr = ''; temp: string = ''; - weather: string = ''; + weather: ResourceStr = ''; } \ No newline at end of file diff --git a/Weather/common/src/main/ets/mock/Mock.ets b/Weather/common/src/main/ets/mock/Mock.ets index 443d7986806058efe74872278bef40338c92b6eb..606e38273eed9e74746ac14a9f253a8bd5518a0b 100644 --- a/Weather/common/src/main/ets/mock/Mock.ets +++ b/Weather/common/src/main/ets/mock/Mock.ets @@ -16,21 +16,21 @@ export const weather: CityFull[] = [ { "cityId": "101210101", - "city": "北京", + "city": $r('app.string.Beijing'), "cityEn": "beijing", - "country": "中国", + "country": $r('app.string.China'), "countryEn": "China", "updateTime": "2022-06-23 13:09:59", "data": [ { - "day": "23日(星期四)", + "day": $r('app.string.23rd'), "date": "2022-06-23", - "week": "星期四", - "wea": "阴", + "week": $r('app.string.Thursday'), + "wea": $r('app.string.Cloudy'), "weaImg": "yun", - "weaDay": "阴", + "weaDay": $r('app.string.Cloudy'), "weaDayImg": "yun", - "weaNight": "阴", + "weaNight": $r('app.string.Cloudy'), "weaNightImg": "yin", "tem": "32", "tem1": "35", @@ -39,15 +39,15 @@ export const weather: CityFull[] = [ "visibility": "24km", "pressure": "998", "win": [ - "西南风", - "西南风" + $r('app.string.SouthwestWind'), + $r('app.string.SouthwestWind') ], - "winSpeed": "5-6级转3-4级", + "winSpeed": '5-6 -> 3-4', "winMeter": "18km/h", "sunrise": "04:58", "sunset": "19:04", "air": "20", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -58,14 +58,14 @@ export const weather: CityFull[] = [ "index": [] }, { - "day": "24日(星期五)", + "day": $r('app.string.24th'), "date": "2022-06-24", - "week": "星期五", - "wea": "晴", + "week": $r('app.string.Friday'), + "wea": $r('app.string.Sunny'), "weaImg": "yu", - "weaDay": "晴", + "weaDay": $r('app.string.Sunny'), "weaDayImg": "yu", - "weaNight": "晴", + "weaNight": $r('app.string.Sunny'), "weaNightImg": "yu", "tem": "32", "tem1": "35", @@ -74,16 +74,16 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "西南风", - "西南风" + $r('app.string.SouthwestWind'), + $r('app.string.SouthwestWind') ], - "winSpeed": "3-4级", + "winSpeed": '3-4', "winMeter": "", "sunrise": "04:58", "sunset": "19:04", "air": "20", - "airLevel": "优", - "airTips": "当前晴,炎热,不适合外出游玩!", + "airLevel": $r('app.string.Excellent'), + "airTips": $r('app.string.airTips1'), "alarm": { "alarmType": "", "alarmLevel": "", @@ -91,250 +91,250 @@ export const weather: CityFull[] = [ }, "hours": [ { - "hours": "09时", - "wea": "晴", + "hours": "09", + "wea": $r('app.string.Sunny'), "weaImg": "sunny", "tem": "30", - "win": "西南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "3-4" }, { - "hours": "10时", - "wea": "晴", + "hours": "10", + "wea": $r('app.string.Sunny'), "weaImg": "sunny", "tem": "30", - "win": "西南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "3-4" }, { - "hours": "11时", - "wea": "多云", + "hours": "11", + "wea": $r('app.string.Cloudy'), "weaImg": "sunny", "tem": "31", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "12时", - "wea": "晴", + "hours": "12", + "wea": $r('app.string.Sunny'), "weaImg": "sunny", "tem": "31", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "13时", - "wea": "晴", + "hours": "13", + "wea": $r('app.string.Sunny'), "weaImg": "sunny", "tem": "32", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "14时", - "wea": "晴", + "hours": "14", + "wea": $r('app.string.Sunny'), "weaImg": "sunny", "tem": "32", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "15时", - "wea": "多云", + "hours": "15", + "wea": $r('app.string.Cloudy'), "weaImg": "cloudy", "tem": "31", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "16时", - "wea": "晴", + "hours": "16", + "wea": $r('app.string.Sunny'), "weaImg": "sunny", "tem": "30", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "17时", - "wea": "多云", + "hours": "17", + "wea": $r('app.string.Cloudy'), "weaImg": "cloudy", "tem": "30", - "win": "西北风", - "winSpeed": "3-4级" + "win": $r('app.string.NorthwestWind'), + "winSpeed": "3-4" }, { - "hours": "18时", - "wea": "晴", + "hours": "18", + "wea": $r('app.string.Sunny'), "weaImg": "sunny", "tem": "29", - "win": "西风", - "winSpeed": "<3级" + "win": $r('app.string.WestWind'), + "winSpeed": "<3" }, { - "hours": "19时", - "wea": "晴", + "hours": "19", + "wea": $r('app.string.Sunny'), "weaImg": "sunny", "tem": "28", - "win": "西南风", - "winSpeed": "<3级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "<3" }, { - "hours": "20时", - "wea": "晴", + "hours": "20", + "wea": $r('app.string.Sunny'), "weaImg": "sunny", "tem": "28", - "win": "西南风", - "winSpeed": "<3级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "<3" }, { - "hours": "21时", - "wea": "晴", + "hours": "21", + "wea": $r('app.string.Sunny'), "weaImg": "sunny", "tem": "27", - "win": "西南风", - "winSpeed": "<3级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "<3" }, { - "hours": "22时", - "wea": "晴", + "hours": "22", + "wea": $r('app.string.Sunny'), "weaImg": "sunny", "tem": "27", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "23时", - "wea": "晴", + "hours": "23", + "wea": $r('app.string.Sunny'), "weaImg": "sunny", "tem": "27", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "00时", - "wea": "晴", + "hours": "00", + "wea": $r('app.string.Sunny'), "weaImg": "sunny", "tem": "26", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "01时", - "wea": "晴", + "hours": "01", + "wea": $r('app.string.Sunny'), "weaImg": "sunny", "tem": "26", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "02时", - "wea": "晴", + "hours": "02", + "wea": $r('app.string.Sunny'), "weaImg": "sunny", "tem": "26", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "03时", - "wea": "多云", + "hours": "03", + "wea": $r('app.string.Cloudy'), "weaImg": "sunny", "tem": "26", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "04时", - "wea": "晴", + "hours": "04", + "wea": $r('app.string.Sunny'), "weaImg": "sunny", "tem": "26", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "05时", - "wea": "晴", + "hours": "05", + "wea": $r('app.string.Sunny'), "weaImg": "sunny", "tem": "25", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "06时", - "wea": "晴", + "hours": "06", + "wea": $r('app.string.Sunny'), "weaImg": "sunny", "tem": "26", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "07时", - "wea": "晴", + "hours": "07", + "wea": $r('app.string.Sunny'), "weaImg": "sunny", "tem": "27", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "08时", - "wea": "晴", + "hours": "08", + "wea": $r('app.string.Sunny'), "weaImg": "sunny", "tem": "29", - "win": "西南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "3-4" }, ], "index": [ { - "title": "湿度", - "level": "42%", - "desc": "湿度刚好。" + "title": $r('app.string.Humidity'), + "level": $r('app.string.42Per'), + "desc": $r('app.string.Humidity_desc1') }, { - "title": "体感温度", - "level": "28°", + "title": $r('app.string.Temperature'), + "level": $r('app.string.tem28'), "desc": "" }, { - "title": "风力", - "level": "微风", - "desc": "风力较弱,适宜户外活动。" + "title": $r('app.string.WindForce'), + "level": $r('app.string.Breeze'), + "desc": $r('app.string.WindForce_desc1') }, { - "title": "风向", - "level": "北风", + "title": $r('app.string.WindDirection'), + "level": $r('app.string.NorthWind'), "desc": "" }, { - "title": "穿衣", - "level": "短袖", - "desc": "建议穿短衫、短裤等清凉夏季服装。" + "title": $r('app.string.Clothing'), + "level": $r('app.string.TShirt'), + "desc": $r('app.string.Clothing_desc1') }, { - "title": "运动", - "level": "宜室内", + "title": $r('app.string.Sport'), + "level": $r('app.string.SportRecommended'), "desc": "" }, { - "title": "感冒", - "level": "容易", - "desc": "昼夜温差大,注意预防感冒。" + "title": $r('app.string.Cold'), + "level": $r('app.string.ColdEasy'), + "desc": $r('app.string.ColdDesc') }, { - "title": "紫外线", - "level": "强", - "desc": "辐射强,涂擦SPF8-12防晒护肤品。" + "title": $r('app.string.UV'), + "level": $r('app.string.UVStrong'), + "desc": $r('app.string.UVDesc') } ] }, { - "day": "25日(星期六)", + "day": $r('app.string.25th'), "date": "2022-06-25", - "week": "星期六", - "wea": "多云", + "week": $r('app.string.Saturday'), + "wea": $r('app.string.Cloudy'), "weaImg": "cloudy", - "weaDay": "多云", + "weaDay": $r('app.string.Cloudy'), "weaDayImg": "yun", - "weaNight": "多云", + "weaNight": $r('app.string.Cloudy'), "weaNightImg": "yun", "tem": "34", "tem1": "32", @@ -343,15 +343,15 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "南风", - "无持续风向" + $r('app.string.SouthWind'), + $r('app.string.WinDesc') ], - "winSpeed": "4-5级转<3级", + "winSpeed": "4-5 -> <3", "winMeter": "", "sunrise": "04:58", "sunset": "19:04", "air": "34", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -362,14 +362,14 @@ export const weather: CityFull[] = [ "index": [] }, { - "day": "26日(星期日)", + "day": $r('app.string.26th'), "date": "2022-06-26", - "week": "星期日", - "wea": "小雨", + "week": $r('app.string.Sunday'), + "wea": $r('app.string.Rainy'), "weaImg": "yin", - "weaDay": "小雨", + "weaDay": $r('app.string.Rainy'), "weaDayImg": "yin", - "weaNight": "阴", + "weaNight": $r('app.string.Cloudy'), "weaNightImg": "yin", "tem": "36", "tem1": "36", @@ -378,15 +378,15 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "南风", - "南风" + $r('app.string.SouthWind'), + $r('app.string.SouthWind') ], - "winSpeed": "4-5级", + "winSpeed": "4-5", "winMeter": "", "sunrise": "04:59", "sunset": "19:04", "air": "29", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -397,14 +397,14 @@ export const weather: CityFull[] = [ "index": [] }, { - "day": "27日(星期一)", + "day": $r('app.string.27th'), "date": "2022-06-27", - "week": "星期一", - "wea": "阴", + "week": $r('app.string.Monday'), + "wea": $r('app.string.Cloudy'), "weaImg": "yin", - "weaDay": "阴", + "weaDay": $r('app.string.Cloudy'), "weaDayImg": "yin", - "weaNight": "阴", + "weaNight": $r('app.string.Cloudy'), "weaNightImg": "yin", "tem": "36", "tem1": "36", @@ -413,15 +413,15 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "南风", - "南风" + $r('app.string.SouthWind'), + $r('app.string.SouthWind') ], - "winSpeed": "4-5级", + "winSpeed": "4-5", "winMeter": "", "sunrise": "04:59", "sunset": "19:04", "air": "26", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -432,14 +432,14 @@ export const weather: CityFull[] = [ "index": [] }, { - "day": "28日(星期二)", + "day": $r('app.string.28th'), "date": "2022-06-28", - "week": "星期二", - "wea": "晴", + "week": $r('app.string.Tuesday'), + "wea": $r('app.string.Sunny'), "weaImg": "sunny", - "weaDay": "晴", + "weaDay": $r('app.string.Sunny'), "weaDayImg": "sunny", - "weaNight": "晴", + "weaNight": $r('app.string.Sunny'), "weaNightImg": "sunny", "tem": "36", "tem1": "36", @@ -448,15 +448,15 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "西南风", - "南风" + $r('app.string.SouthwestWind'), + $r('app.string.SouthWind') ], - "winSpeed": "4-5级转3-4级", + "winSpeed": "4-5 -> 3-4", "winMeter": "", "sunrise": "04:59", "sunset": "19:04", "air": "38", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -467,14 +467,14 @@ export const weather: CityFull[] = [ "index": [] }, { - "day": "29日(星期三)", + "day": $r('app.string.29th'), "date": "2022-06-29", - "week": "星期三", - "wea": "多云", + "week": $r('app.string.Wednesday'), + "wea": $r('app.string.Cloudy'), "weaImg": "cloudy", - "weaDay": "多云", + "weaDay": $r('app.string.Cloudy'), "weaDayImg": "cloudy", - "weaNight": "多云", + "weaNight": $r('app.string.Cloudy'), "weaNightImg": "cloudy", "tem": "35", "tem1": "35", @@ -483,15 +483,15 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "无持续风向", - "无持续风向" + $r('app.string.WinDesc'), + $r('app.string.WinDesc') ], - "winSpeed": "<3级", + "winSpeed": "<3", "winMeter": "", "sunrise": "05:00", "sunset": "19:04", "air": "31", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -505,49 +505,49 @@ export const weather: CityFull[] = [ "aqi": { "updateTime": "13:44", "cityId": "101210101", - "city": "北京", + "city": $r('app.string.Hangzhou'), "cityEn": "hangzhou", - "country": "中国", + "country": $r('app.string.China'), "countryEn": "China", "air": "28", - "airLevel": "优", - "airTips": "空气很好,可以外出活动,呼吸新鲜空气,拥抱大自然!", + "airLevel": $r('app.string.Excellent'), + "airTips": $r('app.string.airTips2'), "pm25": "94", - "pm25Desc": "优", + "pm25Desc": $r('app.string.Excellent'), "pm10": "181", - "pm10Desc": "优", + "pm10Desc": $r('app.string.Excellent'), "o3": "19", - "o3Desc": "优", + "o3Desc": $r('app.string.Excellent'), "no2": "105", - "no2Desc": "优", + "no2Desc": $r('app.string.Excellent'), "so2": "67", - "so2Desc": "优", + "so2Desc": $r('app.string.Excellent'), "co": "19", "coDesc": "-", - "kouzhao": "不用佩戴口罩", - "yundong": "非常适宜运动", - "waichu": "适宜外出", - "kaichuang": "适宜开窗", - "jinghuaqi": "关闭净化器" + "kouzhao": $r('app.string.MaskNeed1'), + "yundong": $r('app.string.exercise1'), + "waichu": $r('app.string.goingOut1'), + "kaichuang": $r('app.string.windows1'), + "jinghuaqi": $r('app.string.purifier1') } }, { "cityId": "101210102", - "city": "上海", + "city": $r('app.string.Shanghai'), "cityEn": "shanghai", - "country": "中国", + "country": $r('app.string.China'), "countryEn": "China", "updateTime": "2022-06-23 13:09:59", "data": [ { - "day": "23日(星期四)", + "day": $r('app.string.23rd'), "date": "2022-06-23", - "week": "星期四", - "wea": "多云", + "week": $r('app.string.Thursday'), + "wea": $r('app.string.Cloudy'), "weaImg": "yun", - "weaDay": "多云", + "weaDay": $r('app.string.Cloudy'), "weaDayImg": "cloudy", - "weaNight": "多云", + "weaNight": $r('app.string.Cloudy'), "weaNightImg": "cloudy", "tem": "28", "tem1": "36", @@ -556,15 +556,15 @@ export const weather: CityFull[] = [ "visibility": "24km", "pressure": "998", "win": [ - "西南风", - "西南风" + $r('app.string.SouthwestWind'), + $r('app.string.SouthwestWind') ], - "winSpeed": "5-6级转3-4级", + "winSpeed": '5-6 -> 3-4', "winMeter": "18km/h", "sunrise": "04:58", "sunset": "19:04", "air": "20", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -575,14 +575,14 @@ export const weather: CityFull[] = [ "index": [] }, { - "day": "24日(星期五)", + "day": $r('app.string.Excellent'), "date": "2022-06-24", - "week": "星期五", - "wea": "阴", + "week": $r('app.string.Friday'), + "wea": $r('app.string.Cloudy'), "weaImg": "yin", - "weaDay": "阴", + "weaDay": $r('app.string.Cloudy'), "weaDayImg": "yin", - "weaNight": "阴", + "weaNight": $r('app.string.Cloudy'), "weaNightImg": "yin", "tem": "28", "tem1": "32", @@ -591,16 +591,16 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "西南风", - "西南风" + $r('app.string.SouthwestWind'), + $r('app.string.SouthwestWind') ], - "winSpeed": "3-4级", + "winSpeed": '3-4', "winMeter": "", "sunrise": "04:58", "sunset": "19:04", "air": "32", - "airLevel": "优", - "airTips": "当前阴,紫外线弱,适合外出游玩!", + "airLevel": $r('app.string.Excellent'), + "airTips": $r('app.string.airTips3'), "alarm": { "alarmType": "", "alarmLevel": "", @@ -608,250 +608,250 @@ export const weather: CityFull[] = [ }, "hours": [ { - "hours": "08时", - "wea": "阴", + "hours": "08", + "wea": $r('app.string.Cloudy'), "weaImg": "yin", "tem": "29", - "win": "西南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "3-4" }, { - "hours": "09时", - "wea": "阴", + "hours": "09", + "wea": $r('app.string.Cloudy'), "weaImg": "yu", "tem": "30", - "win": "西南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "3-4" }, { - "hours": "10时", - "wea": "小雨", + "hours": "10", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "30", - "win": "西南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "3-4" }, { - "hours": "11时", - "wea": "阴", + "hours": "11", + "wea": $r('app.string.Cloudy'), "weaImg": "yu", "tem": "31", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "12时", - "wea": "多云", + "hours": "12", + "wea": $r('app.string.Cloudy'), "weaImg": "yu", "tem": "31", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "13时", - "wea": "阴", + "hours": "13", + "wea": $r('app.string.Cloudy'), "weaImg": "yu", "tem": "32", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "14时", - "wea": "阴", + "hours": "14", + "wea": $r('app.string.Cloudy'), "weaImg": "yu", "tem": "32", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "15时", - "wea": "阴", + "hours": "15", + "wea": $r('app.string.Cloudy'), "weaImg": "yu", "tem": "31", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "16时", - "wea": "阴", + "hours": "16", + "wea": $r('app.string.Cloudy'), "weaImg": "yu", "tem": "30", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "17时", - "wea": "阴", + "hours": "17", + "wea": $r('app.string.Cloudy'), "weaImg": "yu", "tem": "30", - "win": "西北风", - "winSpeed": "3-4级" + "win": $r('app.string.NorthwestWind'), + "winSpeed": "3-4" }, { - "hours": "18时", - "wea": "阴", + "hours": "18", + "wea": $r('app.string.Cloudy'), "weaImg": "yu", "tem": "29", - "win": "西风", - "winSpeed": "<3级" + "win": $r('app.string.WestWind'), + "winSpeed": "<3" }, { - "hours": "19时", - "wea": "阴", + "hours": "19", + "wea": $r('app.string.Cloudy'), "weaImg": "yu", "tem": "28", - "win": "西南风", - "winSpeed": "<3级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "<3" }, { - "hours": "20时", - "wea": "多云", + "hours": "20", + "wea": $r('app.string.Cloudy'), "weaImg": "yu", "tem": "28", - "win": "西南风", - "winSpeed": "<3级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "<3" }, { - "hours": "21时", - "wea": "阴", + "hours": "21", + "wea": $r('app.string.Cloudy'), "weaImg": "yu", "tem": "27", - "win": "西南风", - "winSpeed": "<3级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "<3" }, { - "hours": "22时", - "wea": "阴", + "hours": "22", + "wea": $r('app.string.Cloudy'), "weaImg": "yu", "tem": "27", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "23时", - "wea": "阴", + "hours": "23", + "wea": $r('app.string.Cloudy'), "weaImg": "yu", "tem": "27", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "00时", - "wea": "阴", + "hours": "00", + "wea": $r('app.string.Cloudy'), "weaImg": "yu", "tem": "26", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "01时", - "wea": "小雨", + "hours": "01", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "26", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "02时", - "wea": "阴", + "hours": "02", + "wea": $r('app.string.Cloudy'), "weaImg": "yu", "tem": "26", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "03时", - "wea": "阴", + "hours": "03", + "wea": $r('app.string.Cloudy'), "weaImg": "yu", "tem": "26", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "04时", - "wea": "阴", + "hours": "04", + "wea": $r('app.string.Cloudy'), "weaImg": "yu", "tem": "26", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "05时", - "wea": "阴", + "hours": "05", + "wea": $r('app.string.Cloudy'), "weaImg": "yu", "tem": "25", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "06时", - "wea": "阴", + "hours": "06", + "wea": $r('app.string.Cloudy'), "weaImg": "yu", "tem": "26", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "07时", - "wea": "多云", + "hours": "07", + "wea": $r('app.string.Cloudy'), "weaImg": "yu", "tem": "27", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" } ], "index": [ { - "title": "湿度", - "level": "45%", - "desc": "湿度刚好。" + "title": $r('app.string.Humidity'), + "level": $r('app.string.45Per'), + "desc": $r('app.string.Humidity_desc1') }, { - "title": "体感温度", - "level": "28°", + "title": $r('app.string.Humidity_desc1'), + "level": $r('app.string.tem28'), "desc": "" }, { - "title": "风力", - "level": "微风", - "desc": "风力较弱,适宜户外活动。" + "title": $r('app.string.WindForce'), + "level": $r('app.string.Breeze'), + "desc": $r('app.string.WindForce_desc1') }, { - "title": "风向", - "level": "南风", + "title": $r('app.string.WindDirection'), + "level": $r('app.string.SouthWind'), "desc": "" }, { - "title": "穿衣", - "level": "短袖", - "desc": "建议穿短衫、短裤等清凉夏季服装。" + "title": $r('app.string.Clothing'), + "level": $r('app.string.TShirt'), + "desc": $r('app.string.Clothing_desc1') }, { - "title": "运动", - "level": "宜室内", + "title": $r('app.string.Sport'), + "level": $r('app.string.SportRecommended'), "desc": "" }, { - "title": "感冒", - "level": "容易", - "desc": "昼夜温差大,注意预防感冒。" + "title": $r('app.string.Cold'), + "level": $r('app.string.ColdEasy'), + "desc": $r('app.string.ColdDesc') }, { - "title": "紫外线", - "level": "弱", - "desc": "辐射弱,涂擦SPF8-12防晒护肤品。" + "title": $r('app.string.UV'), + "level": $r('app.string.Weak'), + "desc": $r('app.string.UVDesc2') } ] }, { - "day": "25日(星期六)", + "day": $r('app.string.25th'), "date": "2022-06-25", - "week": "星期六", - "wea": "多云", + "week": $r('app.string.Saturday'), + "wea": $r('app.string.Cloudy'), "weaImg": "yun", - "weaDay": "多云", + "weaDay": $r('app.string.Cloudy'), "weaDayImg": "yun", - "weaNight": "多云", + "weaNight": $r('app.string.Cloudy'), "weaNightImg": "yun", "tem": "34", "tem1": "34", @@ -860,15 +860,15 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "南风", - "无持续风向" + $r('app.string.SouthWind'), + $r('app.string.WinDesc') ], - "winSpeed": "4-5级转<3级", + "winSpeed": "4-5 -> <3", "winMeter": "", "sunrise": "04:58", "sunset": "19:04", "air": "34", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -879,14 +879,14 @@ export const weather: CityFull[] = [ "index": [] }, { - "day": "26日(星期日)", + "day": $r('app.string.26th'), "date": "2022-06-26", - "week": "星期日", - "wea": "阴", + "week": $r('app.string.Sunday'), + "wea": $r('app.string.Cloudy'), "weaImg": "yin", - "weaDay": "阴", + "weaDay": $r('app.string.Cloudy'), "weaDayImg": "yin", - "weaNight": "阴", + "weaNight": $r('app.string.Cloudy'), "weaNightImg": "yin", "tem": "36", "tem1": "36", @@ -895,15 +895,15 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "南风", - "南风" + $r('app.string.SouthWind'), + $r('app.string.SouthWind') ], - "winSpeed": "4-5级", + "winSpeed": "4-5", "winMeter": "", "sunrise": "04:59", "sunset": "19:04", "air": "29", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -914,14 +914,14 @@ export const weather: CityFull[] = [ "index": [] }, { - "day": "27日(星期一)", + "day": $r('app.string.27th'), "date": "2022-06-27", - "week": "星期一", - "wea": "阴", + "week": $r('app.string.Monday'), + "wea": $r('app.string.Cloudy'), "weaImg": "yin", - "weaDay": "阴", + "weaDay": $r('app.string.Cloudy'), "weaDayImg": "yin", - "weaNight": "阴", + "weaNight": $r('app.string.Cloudy'), "weaNightImg": "yin", "tem": "36", "tem1": "36", @@ -930,15 +930,15 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "南风", - "南风" + $r('app.string.SouthWind'), + $r('app.string.SouthWind') ], - "winSpeed": "4-5级", + "winSpeed": "4-5", "winMeter": "", "sunrise": "04:59", "sunset": "19:04", "air": "26", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -949,14 +949,14 @@ export const weather: CityFull[] = [ "index": [] }, { - "day": "28日(星期二)", + "day": $r('app.string.28th'), "date": "2022-06-28", - "week": "星期二", - "wea": "多云", + "week": $r('app.string.Tuesday'), + "wea": $r('app.string.Cloudy'), "weaImg": "yin", - "weaDay": "多云", + "weaDay": $r('app.string.Cloudy'), "weaDayImg": "yin", - "weaNight": "阴", + "weaNight": $r('app.string.Cloudy'), "weaNightImg": "yin", "tem": "36", "tem1": "36", @@ -965,15 +965,15 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "西南风", - "南风" + $r('app.string.SouthwestWind'), + $r('app.string.SouthWind') ], - "winSpeed": "4-5级转3-4级", + "winSpeed": "4-5 -> 3-4", "winMeter": "", "sunrise": "04:59", "sunset": "19:04", "air": "38", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -984,14 +984,14 @@ export const weather: CityFull[] = [ "index": [] }, { - "day": "29日(星期三)", + "day": $r('app.string.29th'), "date": "2022-06-29", - "week": "星期三", - "wea": "小雨", + "week": $r('app.string.Wednesday'), + "wea": $r('app.string.Rainy'), "weaImg": "yu", - "weaDay": "小雨", + "weaDay": $r('app.string.Rainy'), "weaDayImg": "yu", - "weaNight": "小雨", + "weaNight": $r('app.string.Rainy'), "weaNightImg": "yu", "tem": "35", "tem1": "35", @@ -1000,15 +1000,15 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "无持续风向", - "无持续风向" + $r('app.string.WinDesc'), + $r('app.string.WinDesc') ], - "winSpeed": "<3级", + "winSpeed": "<3", "winMeter": "", "sunrise": "05:00", "sunset": "19:04", "air": "31", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -1022,67 +1022,67 @@ export const weather: CityFull[] = [ "aqi": { "updateTime": "13:44", "cityId": "101210102", - "city": "上海", + "city": $r('app.string.Shanghai'), "cityEn": "shanghai", - "country": "中国", + "country": $r('app.string.China'), "countryEn": "China", "air": "32", - "airLevel": "优", - "airTips": "空气很好,可以外出活动,呼吸新鲜空气,拥抱大自然!", + "airLevel": $r('app.string.Excellent'), + "airTips": $r('app.string.airTips2'), "pm25": "80", - "pm25Desc": "优", + "pm25Desc": $r('app.string.Excellent'), "pm10": "200", - "pm10Desc": "优", + "pm10Desc": $r('app.string.Excellent'), "o3": "39", - "o3Desc": "优", + "o3Desc": $r('app.string.Excellent'), "no2": "100", - "no2Desc": "优", + "no2Desc": $r('app.string.Excellent'), "so2": "70", - "so2Desc": "优", + "so2Desc": $r('app.string.Excellent'), "co": "20", "coDesc": "-", - "kouzhao": "不用佩戴口罩", - "yundong": "非常适宜运动", - "waichu": "适宜外出", - "kaichuang": "适宜开窗", - "jinghuaqi": "关闭净化器" + "kouzhao": $r('app.string.MaskNeed1'), + "yundong": $r('app.string.exercise1'), + "waichu": $r('app.string.goingOut1'), + "kaichuang": $r('app.string.windows1'), + "jinghuaqi": $r('app.string.purifier1') } }, { "cityId": "101210103", - "city": "广州", + "city": $r('app.string.Guangzhou'), "cityEn": "guangzhou", - "country": "中国", + "country": $r('app.string.China'), "countryEn": "China", "updateTime": "2022-06-23 13:09:59", "data": [ { - "day": "23日(星期四)", + "day": $r('app.string.23rd'), "date": "2022-06-23", - "week": "星期四", - "wea": "小雨", + "week": $r('app.string.Thursday'), + "wea": $r('app.string.Rainy'), "weaImg": "rain", - "weaDay": "小雨", + "weaDay": $r('app.string.Rainy'), "weaDayImg": "rain", - "weaNight": "小雨", + "weaNight": $r('app.string.Rainy'), "weaNightImg": "rain", "tem": "36", "tem1": "38", "tem2": "30", - "humidity": "50%", + "humidity": '50%', "visibility": "24km", "pressure": "998", "win": [ - "西南风", - "西南风" + $r('app.string.SouthwestWind'), + $r('app.string.SouthwestWind') ], - "winSpeed": "5-6级转3-4级", + "winSpeed": '5-6 -> 3-4', "winMeter": "18km/h", "sunrise": "04:58", "sunset": "19:04", "air": "40", - "airLevel": "优", - "airTips": "当前多云,昨天和今天温度一致,适合外出游玩!", + "airLevel": $r('app.string.Excellent'), + "airTips": $r('app.string.airTips4'), "alarm": { "alarmType": "", "alarmLevel": "", @@ -1092,14 +1092,14 @@ export const weather: CityFull[] = [ "index": [] }, { - "day": "24日(星期五)", + "day": $r('app.string.Excellent'), "date": "2022-06-24", - "week": "星期五", - "wea": "小雨", + "week": $r('app.string.Friday'), + "wea": $r('app.string.Rainy'), "weaImg": "yu", - "weaDay": "小雨", + "weaDay": $r('app.string.Rainy'), "weaDayImg": "yu", - "weaNight": "小雨", + "weaNight": $r('app.string.Rainy'), "weaNightImg": "yu", "tem": "26", "tem1": "30", @@ -1108,16 +1108,16 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "西南风", - "西南风" + $r('app.string.SouthwestWind'), + $r('app.string.SouthwestWind') ], - "winSpeed": "3-4级", + "winSpeed": '3-4', "winMeter": "", "sunrise": "04:58", "sunset": "19:04", "air": "27", - "airLevel": "优", - "airTips": "今天小雨,天气凉爽", + "airLevel": $r('app.string.Excellent'), + "airTips": $r('app.string.airTips5'), "alarm": { "alarmType": "", "alarmLevel": "", @@ -1125,250 +1125,250 @@ export const weather: CityFull[] = [ }, "hours": [ { - "hours": "08时", - "wea": "阴", + "hours": "08", + "wea": $r('app.string.Cloudy'), "weaImg": "yin", "tem": "29", - "win": "西南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "3-4" }, { - "hours": "09时", - "wea": "小雨", + "hours": "09", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "30", - "win": "西南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "3-4" }, { - "hours": "10时", - "wea": "小雨", + "hours": "10", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "30", - "win": "西南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "3-4" }, { - "hours": "11时", - "wea": "小雨", + "hours": "11", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "31", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "12时", - "wea": "小雨", + "hours": "12", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "31", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "13时", - "wea": "小雨", + "hours": "13", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "32", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "14时", - "wea": "阴", + "hours": "14", + "wea": $r('app.string.Cloudy'), "weaImg": "yin", "tem": "32", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "15时", - "wea": "小雨", + "hours": "15", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "31", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "16时", - "wea": "小雨", + "hours": "16", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "30", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "17时", - "wea": "小雨", + "hours": "17", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "30", - "win": "西北风", - "winSpeed": "3-4级" + "win": $r('app.string.NorthwestWind'), + "winSpeed": "3-4" }, { - "hours": "18时", - "wea": "小雨", + "hours": "18", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "29", - "win": "西风", - "winSpeed": "<3级" + "win": $r('app.string.WestWind'), + "winSpeed": "<3" }, { - "hours": "19时", - "wea": "小雨", + "hours": "19", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "28", - "win": "西南风", - "winSpeed": "<3级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "<3" }, { - "hours": "20时", - "wea": "小雨", + "hours": "20", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "28", - "win": "西南风", - "winSpeed": "<3级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "<3" }, { - "hours": "21时", - "wea": "小雨", + "hours": "21", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "27", - "win": "西南风", - "winSpeed": "<3级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "<3" }, { - "hours": "22时", - "wea": "小雨", + "hours": "22", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "27", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "23时", - "wea": "小雨", + "hours": "23", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "27", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "00时", - "wea": "小雨", + "hours": "00", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "26", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "01时", - "wea": "小雨", + "hours": "01", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "26", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "02时", - "wea": "小雨", + "hours": "02", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "26", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "03时", - "wea": "小雨", + "hours": "03", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "26", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "04时", - "wea": "小雨", + "hours": "04", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "26", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "05时", - "wea": "小雨", + "hours": "05", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "25", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "06时", - "wea": "小雨", + "hours": "06", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "26", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "07时", - "wea": "小雨", + "hours": "07", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "27", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" } ], "index": [ { - "title": "湿度", - "level": "50%", - "desc": "湿度刚好。" + "title": $r('app.string.Humidity'), + "level": $r('app.string.50Per'), + "desc": $r('app.string.Humidity_desc1') }, { - "title": "体感温度", - "level": "27°", + "title": $r('app.string.Humidity_desc1'), + "level": $r('app.string.tem27'), "desc": "" }, { - "title": "风力", - "level": "大风", - "desc": "风力较弱,适宜户外活动。" + "title": $r('app.string.WindForce'), + "level": $r('app.string.StrongWind'), + "desc": $r('app.string.WindForce_desc1') }, { - "title": "风向", - "level": "东南风", + "title": $r('app.string.WindDirection'), + "level": $r('app.string.SoutheastWind'), "desc": "" }, { - "title": "穿衣", - "level": "长袖", - "desc": "建议穿短衫、短裤等清凉夏季服装。" + "title": $r('app.string.Clothing'), + "level": $r('app.string.LongSleeves'), + "desc": $r('app.string.Clothing_desc1') }, { - "title": "运动", - "level": "宜室内", + "title": $r('app.string.Sport'), + "level": $r('app.string.SportRecommended'), "desc": "" }, { - "title": "感冒", - "level": "容易", - "desc": "昼夜温差大,注意预防感冒。" + "title": $r('app.string.Cold'), + "level": $r('app.string.ColdEasy'), + "desc": $r('app.string.ColdDesc') }, { - "title": "紫外线", - "level": "弱", - "desc": "辐射弱,涂擦SPF8-12防晒护肤品。" + "title": $r('app.string.UV'), + "level": $r('app.string.Weak'), + "desc": $r('app.string.UVDesc2') } ] }, { - "day": "25日(星期六)", + "day": $r('app.string.25th'), "date": "2022-06-25", - "week": "星期六", - "wea": "多云", + "week": $r('app.string.Saturday'), + "wea": $r('app.string.Cloudy'), "weaImg": "yun", - "weaDay": "多云", + "weaDay": $r('app.string.Cloudy'), "weaDayImg": "yun", - "weaNight": "多云", + "weaNight": $r('app.string.Cloudy'), "weaNightImg": "yun", "tem": "34", "tem1": "34", @@ -1377,15 +1377,15 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "南风", - "无持续风向" + $r('app.string.SouthWind'), + $r('app.string.WinDesc') ], - "winSpeed": "4-5级转<3级", + "winSpeed": "4-5 -> <3", "winMeter": "", "sunrise": "04:58", "sunset": "19:04", "air": "34", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -1396,14 +1396,14 @@ export const weather: CityFull[] = [ "index": [] }, { - "day": "26日(星期日)", + "day": $r('app.string.26th'), "date": "2022-06-26", - "week": "星期日", - "wea": "阴", + "week": $r('app.string.Sunday'), + "wea": $r('app.string.Cloudy'), "weaImg": "yin", - "weaDay": "阴", + "weaDay": $r('app.string.Cloudy'), "weaDayImg": "yin", - "weaNight": "阴", + "weaNight": $r('app.string.Cloudy'), "weaNightImg": "yin", "tem": "36", "tem1": "36", @@ -1412,15 +1412,15 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "南风", - "南风" + $r('app.string.SouthWind'), + $r('app.string.SouthWind') ], - "winSpeed": "4-5级", + "winSpeed": "4-5", "winMeter": "", "sunrise": "04:59", "sunset": "19:04", "air": "29", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -1431,14 +1431,14 @@ export const weather: CityFull[] = [ "index": [] }, { - "day": "27日(星期一)", + "day": $r('app.string.27th'), "date": "2022-06-27", - "week": "星期一", - "wea": "阴", + "week": $r('app.string.Monday'), + "wea": $r('app.string.Cloudy'), "weaImg": "yin", - "weaDay": "阴", + "weaDay": $r('app.string.Cloudy'), "weaDayImg": "yin", - "weaNight": "阴", + "weaNight": $r('app.string.Cloudy'), "weaNightImg": "yin", "tem": "36", "tem1": "36", @@ -1447,15 +1447,15 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "南风", - "南风" + $r('app.string.SouthWind'), + $r('app.string.SouthWind') ], - "winSpeed": "4-5级", + "winSpeed": "4-5", "winMeter": "", "sunrise": "04:59", "sunset": "19:04", "air": "26", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -1466,14 +1466,14 @@ export const weather: CityFull[] = [ "index": [] }, { - "day": "28日(星期二)", + "day": $r('app.string.28th'), "date": "2022-06-28", - "week": "星期二", - "wea": "中雨", + "week": $r('app.string.Tuesday'), + "wea": $r('app.string.ModerateRain'), "weaImg": "rain", - "weaDay": "中雨", + "weaDay": $r('app.string.ModerateRain'), "weaDayImg": "rain", - "weaNight": "中雨", + "weaNight": $r('app.string.ModerateRain'), "weaNightImg": "rain", "tem": "36", "tem1": "36", @@ -1482,15 +1482,15 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "西南风", - "南风" + $r('app.string.SouthwestWind'), + $r('app.string.SouthWind') ], - "winSpeed": "4-5级转3-4级", + "winSpeed": "4-5 -> 3-4", "winMeter": "", "sunrise": "04:59", "sunset": "19:04", "air": "38", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -1501,14 +1501,14 @@ export const weather: CityFull[] = [ "index": [] }, { - "day": "29日(星期三)", + "day": $r('app.string.29th'), "date": "2022-06-29", - "week": "星期三", - "wea": "中雨", + "week": $r('app.string.Wednesday'), + "wea": $r('app.string.ModerateRain'), "weaImg": "rain", - "weaDay": "中雨", + "weaDay": $r('app.string.ModerateRain'), "weaDayImg": "rain", - "weaNight": "小雨", + "weaNight": $r('app.string.Rainy'), "weaNightImg": "yu", "tem": "35", "tem1": "35", @@ -1517,15 +1517,15 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "无持续风向", - "无持续风向" + $r('app.string.WinDesc'), + $r('app.string.WinDesc') ], - "winSpeed": "<3级", + "winSpeed": "<3", "winMeter": "", "sunrise": "05:00", "sunset": "19:04", "air": "31", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -1539,49 +1539,49 @@ export const weather: CityFull[] = [ "aqi": { "updateTime": "13:44", "cityId": "101210103", - "city": "广州", + "city": $r('app.string.Guangzhou'), "cityEn": "guangzhou", - "country": "中国", + "country": $r('app.string.China'), "countryEn": "China", "air": "50", - "airLevel": "良", - "airTips": "空气良好,湿度较高,适宜室内活动!", + "airLevel": $r('app.string.Excellent'), + "airTips": $r('app.string.airTips6'), "pm25": "90", - "pm25Desc": "优", + "pm25Desc": $r('app.string.Excellent'), "pm10": "170", - "pm10Desc": "优", + "pm10Desc": $r('app.string.Excellent'), "o3": "18", - "o3Desc": "优", + "o3Desc": $r('app.string.Excellent'), "no2": "90", - "no2Desc": "优", + "no2Desc": $r('app.string.Excellent'), "so2": "64", - "so2Desc": "优", + "so2Desc": $r('app.string.Excellent'), "co": "22", "coDesc": "-", - "kouzhao": "不用佩戴口罩", - "yundong": "非常适宜运动", - "waichu": "适宜外出", - "kaichuang": "适宜开窗", - "jinghuaqi": "关闭净化器" + "kouzhao": $r('app.string.MaskNeed1'), + "yundong": $r('app.string.exercise1'), + "waichu": $r('app.string.goingOut1'), + "kaichuang": $r('app.string.windows1'), + "jinghuaqi": $r('app.string.purifier1') } }, { "cityId": "101210104", - "city": "天津", + "city": $r('app.string.Tianjin'), "cityEn": "tianjin", - "country": "中国", + "country": $r('app.string.China'), "countryEn": "China", "updateTime": "2022-06-23 13:09:59", "data": [ { - "day": "23日(星期四)", + "day": $r('app.string.23rd'), "date": "2022-06-23", - "week": "星期四", - "wea": "阴", + "week": $r('app.string.Thursday'), + "wea": $r('app.string.Cloudy'), "weaImg": "yin", - "weaDay": "阴", + "weaDay": $r('app.string.Cloudy'), "weaDayImg": "yin", - "weaNight": "阴", + "weaNight": $r('app.string.Cloudy'), "weaNightImg": "yin", "tem": "33", "tem1": "35", @@ -1590,15 +1590,15 @@ export const weather: CityFull[] = [ "visibility": "24km", "pressure": "998", "win": [ - "北风", - "北风" + $r('app.string.NorthWind'), + $r('app.string.NorthWind') ], - "winSpeed": "5-6级转3-4级", + "winSpeed": '5-6 -> 3-4', "winMeter": "18km/h", "sunrise": "04:58", "sunset": "19:04", "air": "35", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -1609,14 +1609,14 @@ export const weather: CityFull[] = [ "index": [] }, { - "day": "24日(星期五)", + "day": $r('app.string.Excellent'), "date": "2022-06-24", - "week": "星期五", - "wea": "中雨", + "week": $r('app.string.Friday'), + "wea": $r('app.string.ModerateRain'), "weaImg": "yu", - "weaDay": "中雨", + "weaDay": $r('app.string.ModerateRain'), "weaDayImg": "yu", - "weaNight": "中雨", + "weaNight": $r('app.string.ModerateRain'), "weaNightImg": "yu", "tem": "32", "tem1": "32", @@ -1625,16 +1625,16 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "西南风", - "西南风" + $r('app.string.SouthwestWind'), + $r('app.string.SouthwestWind') ], - "winSpeed": "4级", + "winSpeed": "4", "winMeter": "", "sunrise": "04:58", "sunset": "19:04", "air": "30", - "airLevel": "优", - "airTips": "今天中雨,出门记得带伞哦!", + "airLevel": $r('app.string.Excellent'), + "airTips": $r('app.string.airTips7'), "alarm": { "alarmType": "", "alarmLevel": "", @@ -1642,250 +1642,250 @@ export const weather: CityFull[] = [ }, "hours": [ { - "hours": "08时", - "wea": "阴", + "hours": "08", + "wea": $r('app.string.Cloudy'), "weaImg": "yin", "tem": "29", - "win": "西南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "3-4" }, { - "hours": "09时", - "wea": "小雨", + "hours": "09", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "30", - "win": "西南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "3-4" }, { - "hours": "10时", - "wea": "中雨", + "hours": "10", + "wea": $r('app.string.ModerateRain'), "weaImg": "yu", "tem": "30", - "win": "西南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "3-4" }, { - "hours": "11时", - "wea": "中雨", + "hours": "11", + "wea": $r('app.string.ModerateRain'), "weaImg": "yu", "tem": "31", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "12时", - "wea": "小雨", + "hours": "12", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "31", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "13时", - "wea": "中雨", + "hours": "13", + "wea": $r('app.string.ModerateRain'), "weaImg": "yu", "tem": "32", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "14时", - "wea": "中雨", + "hours": "14", + "wea": $r('app.string.ModerateRain'), "weaImg": "yu", "tem": "32", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "15时", - "wea": "小雨", + "hours": "15", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "31", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "16时", - "wea": "中雨", + "hours": "16", + "wea": $r('app.string.ModerateRain'), "weaImg": "yu", "tem": "30", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "17时", - "wea": "中雨", + "hours": "17", + "wea": $r('app.string.ModerateRain'), "weaImg": "yu", "tem": "30", - "win": "西北风", - "winSpeed": "3-4级" + "win": $r('app.string.NorthwestWind'), + "winSpeed": "3-4" }, { - "hours": "18时", - "wea": "中雨", + "hours": "18", + "wea": $r('app.string.ModerateRain'), "weaImg": "yu", "tem": "29", - "win": "西风", - "winSpeed": "<3级" + "win": $r('app.string.WestWind'), + "winSpeed": "<3" }, { - "hours": "19时", - "wea": "小雨", + "hours": "19", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "28", - "win": "西南风", - "winSpeed": "<3级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "<3" }, { - "hours": "20时", - "wea": "中雨", + "hours": "20", + "wea": $r('app.string.ModerateRain'), "weaImg": "yu", "tem": "28", - "win": "西南风", - "winSpeed": "<3级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "<3" }, { - "hours": "21时", - "wea": "小雨", + "hours": "21", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "27", - "win": "西南风", - "winSpeed": "<3级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "<3" }, { - "hours": "22时", - "wea": "小雨", + "hours": "22", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "27", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "23时", - "wea": "中雨", + "hours": "23", + "wea": $r('app.string.ModerateRain'), "weaImg": "yu", "tem": "27", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "00时", - "wea": "小雨", + "hours": "00", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "26", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "01时", - "wea": "中雨", + "hours": "01", + "wea": $r('app.string.ModerateRain'), "weaImg": "yu", "tem": "26", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "02时", - "wea": "中雨", + "hours": "02", + "wea": $r('app.string.ModerateRain'), "weaImg": "yu", "tem": "26", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "03时", - "wea": "中雨", + "hours": "03", + "wea": $r('app.string.ModerateRain'), "weaImg": "yu", "tem": "26", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "04时", - "wea": "小雨", + "hours": "04", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "26", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "05时", - "wea": "中雨", + "hours": "05", + "wea": $r('app.string.ModerateRain'), "weaImg": "yu", "tem": "25", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "06时", - "wea": "小雨", + "hours": "06", + "wea": $r('app.string.Rainy'), "weaImg": "yu", "tem": "26", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "07时", - "wea": "中雨", + "hours": "07", + "wea": $r('app.string.ModerateRain'), "weaImg": "yu", "tem": "27", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" } ], "index": [ { - "title": "湿度", - "level": "55%", - "desc": "湿度较高。" + "title": $r('app.string.Humidity'), + "level": $r('app.string.55Per'), + "desc": $r('app.string.Humidity_desc2') }, { - "title": "体感温度", - "level": "35°", + "title": $r('app.string.Humidity_desc1'), + "level": $r('app.string.tem35'), "desc": "" }, { - "title": "风力", - "level": "微风", - "desc": "风力较弱,适宜户外活动。" + "title": $r('app.string.WindForce'), + "level": $r('app.string.Breeze'), + "desc": $r('app.string.WindForce_desc1') }, { - "title": "风向", - "level": "南风", + "title": $r('app.string.WindDirection'), + "level": $r('app.string.SouthWind'), "desc": "" }, { - "title": "穿衣", - "level": "短袖", - "desc": "建议穿短衫、短裤等清凉夏季服装。" + "title": $r('app.string.Clothing'), + "level": $r('app.string.TShirt'), + "desc": $r('app.string.Clothing_desc1') }, { - "title": "运动", - "level": "宜室内", + "title": $r('app.string.Sport'), + "level": $r('app.string.SportRecommended'), "desc": "" }, { - "title": "感冒", - "level": "容易", - "desc": "昼夜温差大,注意预防感冒。" + "title": $r('app.string.Cold'), + "level": $r('app.string.ColdEasy'), + "desc": $r('app.string.ColdDesc') }, { - "title": "紫外线", - "level": "弱", - "desc": "辐射弱,涂擦SPF8-12防晒护肤品。" + "title": $r('app.string.UV'), + "level": $r('app.string.Weak'), + "desc": $r('app.string.UVDesc2') } ] }, { - "day": "25日(星期六)", + "day": $r('app.string.25th'), "date": "2022-06-25", - "week": "星期六", - "wea": "阴", + "week": $r('app.string.Saturday'), + "wea": $r('app.string.Cloudy'), "weaImg": "yin", - "weaDay": "阴", + "weaDay": $r('app.string.Cloudy'), "weaDayImg": "yin", - "weaNight": "阴", + "weaNight": $r('app.string.Cloudy'), "weaNightImg": "yin", "tem": "34", "tem1": "36", @@ -1894,15 +1894,15 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "南风", - "无持续风向" + $r('app.string.SouthWind'), + $r('app.string.WinDesc') ], - "winSpeed": "4-5级转<3级", + "winSpeed": "4-5 -> <3", "winMeter": "", "sunrise": "04:58", "sunset": "19:04", "air": "34", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -1913,14 +1913,14 @@ export const weather: CityFull[] = [ "index": [] }, { - "day": "26日(星期日)", + "day": $r('app.string.26th'), "date": "2022-06-26", - "week": "星期日", - "wea": "阴", + "week": $r('app.string.Sunday'), + "wea": $r('app.string.Cloudy'), "weaImg": "yin", - "weaDay": "阴", + "weaDay": $r('app.string.Cloudy'), "weaDayImg": "yin", - "weaNight": "阴", + "weaNight": $r('app.string.Cloudy'), "weaNightImg": "yin", "tem": "36", "tem1": "38", @@ -1929,15 +1929,15 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "南风", - "南风" + $r('app.string.SouthWind'), + $r('app.string.SouthWind') ], - "winSpeed": "4-5级", + "winSpeed": "4-5", "winMeter": "", "sunrise": "04:59", "sunset": "19:04", "air": "29", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -1948,14 +1948,14 @@ export const weather: CityFull[] = [ "index": [] }, { - "day": "27日(星期一)", + "day": $r('app.string.27th'), "date": "2022-06-27", - "week": "星期一", - "wea": "多云", + "week": $r('app.string.Monday'), + "wea": $r('app.string.Cloudy'), "weaImg": "cloudy", - "weaDay": "多云", + "weaDay": $r('app.string.Cloudy'), "weaDayImg": "cloudy", - "weaNight": "多云", + "weaNight": $r('app.string.Cloudy'), "weaNightImg": "cloudy", "tem": "36", "tem1": "36", @@ -1964,15 +1964,15 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "南风", - "南风" + $r('app.string.SouthWind'), + $r('app.string.SouthWind') ], - "winSpeed": "4-5级", + "winSpeed": "4-5", "winMeter": "", "sunrise": "04:59", "sunset": "19:04", "air": "26", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -1983,14 +1983,14 @@ export const weather: CityFull[] = [ "index": [] }, { - "day": "28日(星期二)", + "day": $r('app.string.28th'), "date": "2022-06-28", - "week": "星期二", - "wea": "晴", + "week": $r('app.string.Tuesday'), + "wea": $r('app.string.Sunny'), "weaImg": "sunny", - "weaDay": "晴", + "weaDay": $r('app.string.Sunny'), "weaDayImg": "sunny", - "weaNight": "晴", + "weaNight": $r('app.string.Sunny'), "weaNightImg": "sunny", "tem": "36", "tem1": "36", @@ -1999,15 +1999,15 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "西南风", - "南风" + $r('app.string.SouthwestWind'), + $r('app.string.SouthWind') ], - "winSpeed": "4-5级转3-4级", + "winSpeed": "4-5 -> 3-4", "winMeter": "", "sunrise": "04:59", "sunset": "19:04", "air": "38", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -2018,14 +2018,14 @@ export const weather: CityFull[] = [ "index": [] }, { - "day": "29日(星期三)", + "day": $r('app.string.29th'), "date": "2022-06-29", - "week": "星期三", - "wea": "晴", + "week": $r('app.string.Wednesday'), + "wea": $r('app.string.Sunny'), "weaImg": "sunny", - "weaDay": "晴", + "weaDay": $r('app.string.Sunny'), "weaDayImg": "sunny", - "weaNight": "晴", + "weaNight": $r('app.string.Sunny'), "weaNightImg": "sunny", "tem": "35", "tem1": "35", @@ -2034,15 +2034,15 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "无持续风向", - "无持续风向" + $r('app.string.WinDesc'), + $r('app.string.WinDesc') ], - "winSpeed": "<3级", + "winSpeed": "<3", "winMeter": "", "sunrise": "05:00", "sunset": "19:04", "air": "31", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -2056,49 +2056,49 @@ export const weather: CityFull[] = [ "aqi": { "updateTime": "13:44", "cityId": "101210104", - "city": "天津", + "city": $r('app.string.Tianjin'), "cityEn": "tianjin", - "country": "中国", + "country": $r('app.string.China'), "countryEn": "China", "air": "50", - "airLevel": "良", - "airTips": "空气良好,可以外出活动,呼吸新鲜空气,拥抱大自然!", + "airLevel": $r('app.string.Excellent'), + "airTips": $r('app.string.airTips8'), "pm25": "95", - "pm25Desc": "优", + "pm25Desc": $r('app.string.Excellent'), "pm10": "180", - "pm10Desc": "优", + "pm10Desc": $r('app.string.Excellent'), "o3": "30", - "o3Desc": "良", + "o3Desc": $r('app.string.Excellent'), "no2": "150", - "no2Desc": "良", + "no2Desc": $r('app.string.Excellent'), "so2": "65", - "so2Desc": "优", + "so2Desc": $r('app.string.Excellent'), "co": "19", "coDesc": "-", - "kouzhao": "不用佩戴口罩", - "yundong": "非常适宜运动", - "waichu": "适宜外出", - "kaichuang": "适宜开窗", - "jinghuaqi": "关闭净化器" + "kouzhao": $r('app.string.MaskNeed1'), + "yundong": $r('app.string.exercise1'), + "waichu": $r('app.string.goingOut1'), + "kaichuang": $r('app.string.windows1'), + "jinghuaqi": $r('app.string.purifier1') } }, { "cityId": "101210105", - "city": "武汉", + "city":$r('app.string.Wuhan'), "cityEn": "wuhan", - "country": "中国", + "country": $r('app.string.China'), "countryEn": "China", "updateTime": "2022-06-23 13:09:59", "data": [ { - "day": "23日(星期四)", + "day": $r('app.string.23rd'), "date": "2022-06-23", - "week": "星期四", - "wea": "多云", + "week": $r('app.string.Thursday'), + "wea": $r('app.string.Cloudy'), "weaImg": "yun", - "weaDay": "多云", + "weaDay": $r('app.string.Cloudy'), "weaDayImg": "yun", - "weaNight": "阴", + "weaNight": $r('app.string.Cloudy'), "weaNightImg": "yin", "tem": "35", "tem1": "39", @@ -2107,15 +2107,15 @@ export const weather: CityFull[] = [ "visibility": "24km", "pressure": "998", "win": [ - "西南风", - "西南风" + $r('app.string.SouthwestWind'), + $r('app.string.SouthwestWind') ], - "winSpeed": "5-6级转3-4级", + "winSpeed": '5-6 -> 3-4', "winMeter": "18km/h", "sunrise": "04:58", "sunset": "19:04", "air": "20", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -2124,250 +2124,250 @@ export const weather: CityFull[] = [ }, "hours": [ { - "hours": "08时", - "wea": "阴", + "hours": "08", + "wea": $r('app.string.Cloudy'), "weaImg": "yin", "tem": "29", - "win": "西南风", - "winSpeed": "3级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "3" }, { - "hours": "09时", - "wea": "阴", + "hours": "09", + "wea": $r('app.string.Cloudy'), "weaImg": "yin", "tem": "31", - "win": "西南风", - "winSpeed": "4级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "4" }, { - "hours": "10时", - "wea": "阴", + "hours": "10", + "wea": $r('app.string.Cloudy'), "weaImg": "yin", "tem": "32", - "win": "西南风", - "winSpeed": "5级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "5" }, { - "hours": "11时", - "wea": "多云", + "hours": "11", + "wea": $r('app.string.Cloudy'), "weaImg": "yun", "tem": "34", - "win": "西南风", - "winSpeed": "5级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "5" }, { - "hours": "12时", - "wea": "多云", + "hours": "12", + "wea": $r('app.string.Cloudy'), "weaImg": "yun", "tem": "34", - "win": "西南风", - "winSpeed": "5级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "5" }, { - "hours": "13时", - "wea": "多云", + "hours": "13", + "wea": $r('app.string.Cloudy'), "weaImg": "yun", "tem": "35", - "win": "西南风", - "winSpeed": "6级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "6" }, { - "hours": "14时", - "wea": "多云", + "hours": "14", + "wea": $r('app.string.Cloudy'), "weaImg": "yun", "tem": "36", - "win": "西南风", - "winSpeed": "5级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "5" }, { - "hours": "15时", - "wea": "多云", + "hours": "15", + "wea": $r('app.string.Cloudy'), "weaImg": "yun", "tem": "35", - "win": "西南风", - "winSpeed": "6级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "6" }, { - "hours": "16时", - "wea": "多云", + "hours": "16", + "wea": $r('app.string.Cloudy'), "weaImg": "yun", "tem": "35", - "win": "西南风", - "winSpeed": "5级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "5" }, { - "hours": "17时", - "wea": "多云", + "hours": "17", + "wea": $r('app.string.Cloudy'), "weaImg": "yun", "tem": "35", - "win": "西南风", - "winSpeed": "4级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "4" }, { - "hours": "18时", - "wea": "多云", + "hours": "18", + "wea": $r('app.string.Cloudy'), "weaImg": "yun", "tem": "34", - "win": "西南风", - "winSpeed": "4级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "4" }, { - "hours": "19时", - "wea": "多云", + "hours": "19", + "wea": $r('app.string.Cloudy'), "weaImg": "yun", "tem": "32", - "win": "西南风", - "winSpeed": "4级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "4" }, { - "hours": "20时", - "wea": "多云", + "hours": "20", + "wea": $r('app.string.Cloudy'), "weaImg": "yun", "tem": "31", - "win": "西南风", - "winSpeed": "4级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "4" }, { - "hours": "21时", - "wea": "阴", + "hours": "21", + "wea": $r('app.string.Cloudy'), "weaImg": "yin", "tem": "31", - "win": "西南风", - "winSpeed": "4级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "4" }, { - "hours": "22时", - "wea": "阴", + "hours": "22", + "wea": $r('app.string.Cloudy'), "weaImg": "yin", "tem": "30", - "win": "西南风", - "winSpeed": "4级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "4" }, { - "hours": "23时", - "wea": "阴", + "hours": "23", + "wea": $r('app.string.Cloudy'), "weaImg": "yin", "tem": "29", - "win": "西南风", - "winSpeed": "3级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "3" }, { - "hours": "00时", - "wea": "阴", + "hours": "00", + "wea": $r('app.string.Cloudy'), "weaImg": "yin", "tem": "29", - "win": "西南风", - "winSpeed": "3级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "3" }, { - "hours": "01时", - "wea": "阴", + "hours": "01", + "wea": $r('app.string.Cloudy'), "weaImg": "yin", "tem": "29", - "win": "西南风", - "winSpeed": "3级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "3" }, { - "hours": "02时", - "wea": "阴", + "hours": "02", + "wea": $r('app.string.Cloudy'), "weaImg": "yin", "tem": "28", - "win": "西南风", - "winSpeed": "3级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "3" }, { - "hours": "03时", - "wea": "阴", + "hours": "03", + "wea": $r('app.string.Cloudy'), "weaImg": "yin", "tem": "28", - "win": "西南风", - "winSpeed": "3级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "3" }, { - "hours": "04时", - "wea": "阴", + "hours": "04", + "wea": $r('app.string.Cloudy'), "weaImg": "yin", "tem": "28", - "win": "西南风", - "winSpeed": "3级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "3" }, { - "hours": "05时", - "wea": "阴", + "hours": "05", + "wea": $r('app.string.Cloudy'), "weaImg": "yin", "tem": "28", - "win": "西南风", - "winSpeed": "3级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "3" }, { - "hours": "06时", - "wea": "阴", + "hours": "06", + "wea": $r('app.string.Cloudy'), "weaImg": "yin", "tem": "28", - "win": "西南风", - "winSpeed": "3级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "3" }, { - "hours": "07时", - "wea": "阴", + "hours": "07", + "wea": $r('app.string.Cloudy'), "weaImg": "yin", "tem": "29", - "win": "西南风", - "winSpeed": "3级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "3" } ], "index": [ { - "title": "湿度", - "level": "45%", - "desc": "湿度刚好。" + "title": $r('app.string.Humidity'), + "level": $r('app.string.45Per'), + "desc": $r('app.string.Humidity_desc1') }, { - "title": "体感温度", - "level": "20°", + "title": $r('app.string.Humidity_desc1'), + "level": $r('app.string.tem20'), "desc": "" }, { - "title": "风力", - "level": "微风", - "desc": "风力较弱,适宜户外活动。" + "title": $r('app.string.WindForce'), + "level": $r('app.string.Breeze'), + "desc": $r('app.string.WindForce_desc1') }, { - "title": "风向", - "level": "南风", + "title": $r('app.string.WindDirection'), + "level": $r('app.string.SouthWind'), "desc": "" }, { - "title": "穿衣", - "level": "短袖", - "desc": "建议穿短衫、短裤等清凉夏季服装。" + "title": $r('app.string.Clothing'), + "level": $r('app.string.TShirt'), + "desc": $r('app.string.Clothing_desc1') }, { - "title": "运动", - "level": "宜室内", + "title": $r('app.string.Sport'), + "level": $r('app.string.SportRecommended'), "desc": "" }, { - "title": "感冒", - "level": "容易", - "desc": "昼夜温差大,注意预防感冒。" + "title": $r('app.string.Cold'), + "level": $r('app.string.ColdEasy'), + "desc": $r('app.string.ColdDesc') }, { - "title": "紫外线", - "level": "弱", - "desc": "辐射弱,涂擦SPF8-12防晒护肤品。" + "title": $r('app.string.UV'), + "level": $r('app.string.Weak'), + "desc": $r('app.string.UVDesc2') } ] }, { - "day": "24日(星期五)", + "day": $r('app.string.Excellent'), "date": "2022-06-24", - "week": "星期五", - "wea": "多云", + "week": $r('app.string.Friday'), + "wea": $r('app.string.Cloudy'), "weaImg": "cloudy", - "weaDay": "多云", + "weaDay": $r('app.string.Cloudy'), "weaDayImg": "cloudy", - "weaNight": "多云", + "weaNight": $r('app.string.Cloudy'), "weaNightImg": "cloudy", "tem": "27", "tem1": "29", @@ -2376,16 +2376,16 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "西南风", - "西南风" + $r('app.string.SouthwestWind'), + $r('app.string.SouthwestWind') ], - "winSpeed": "3-4级", + "winSpeed": '3-4', "winMeter": "", "sunrise": "04:58", "sunset": "19:04", "air": "25", - "airLevel": "优", - "airTips": "今天空气很好,适合外出游玩,注意防晒!", + "airLevel": $r('app.string.Excellent'), + "airTips": $r('app.string.airTips9'), "alarm": { "alarmType": "", "alarmLevel": "", @@ -2393,250 +2393,250 @@ export const weather: CityFull[] = [ }, "hours": [ { - "hours": "08时", - "wea": "阴", + "hours": "08", + "wea": $r('app.string.Cloudy'), "weaImg": "yin", "tem": "25", - "win": "西南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "3-4" }, { - "hours": "09时", - "wea": "多云", + "hours": "09", + "wea": $r('app.string.Cloudy'), "weaImg": "cloudy", "tem": "27", - "win": "西南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "3-4" }, { - "hours": "10时", - "wea": "多云", + "hours": "10", + "wea": $r('app.string.Cloudy'), "weaImg": "cloudy", "tem": "27", - "win": "西南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "3-4" }, { - "hours": "11时", - "wea": "多云", + "hours": "11", + "wea": $r('app.string.Cloudy'), "weaImg": "cloudy", "tem": "28", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "12时", - "wea": "多云", + "hours": "12", + "wea": $r('app.string.Cloudy'), "weaImg": "cloudy", "tem": "28", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "13时", - "wea": "多云", + "hours": "13", + "wea": $r('app.string.Cloudy'), "weaImg": "cloudy", "tem": "28", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "14时", - "wea": "多云", + "hours": "14", + "wea": $r('app.string.Cloudy'), "weaImg": "cloudy", "tem": "27", - "win": "西风", - "winSpeed": "4-5级" + "win": $r('app.string.WestWind'), + "winSpeed": "4-5" }, { - "hours": "15时", - "wea": "多云", + "hours": "15", + "wea": $r('app.string.Cloudy'), "weaImg": "cloudy", "tem": "27", - "win": "西风", - "winSpeed": "4-5级" + "win": $r('app.string.WestWind'), + "winSpeed": "4-5" }, { - "hours": "16时", - "wea": "多云", + "hours": "16", + "wea": $r('app.string.Cloudy'), "weaImg": "cloudy", "tem": "26", - "win": "西风", - "winSpeed": "3-4级" + "win": $r('app.string.WestWind'), + "winSpeed": "3-4" }, { - "hours": "17时", - "wea": "晴", + "hours": "17", + "wea": $r('app.string.Sunny'), "weaImg": "sunny", "tem": "27", - "win": "北风", - "winSpeed": "3-4级" + "win": $r('app.string.NorthWind'), + "winSpeed": "3-4" }, { - "hours": "18时", - "wea": "晴", + "hours": "18", + "wea": $r('app.string.Sunny'), "weaImg": "sunny", "tem": "27", - "win": "西风", - "winSpeed": "<3级" + "win": $r('app.string.WestWind'), + "winSpeed": "<3" }, { - "hours": "19时", - "wea": "多云", + "hours": "19", + "wea": $r('app.string.Cloudy'), "weaImg": "cloudy", "tem": "26", - "win": "西南风", - "winSpeed": "<3级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "<3" }, { - "hours": "20时", - "wea": "多云", + "hours": "20", + "wea": $r('app.string.Cloudy'), "weaImg": "cloudy", "tem": "25", - "win": "西南风", - "winSpeed": "<3级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "<3" }, { - "hours": "21时", - "wea": "多云", + "hours": "21", + "wea": $r('app.string.Cloudy'), "weaImg": "cloudy", "tem": "25", - "win": "西南风", - "winSpeed": "<3级" + "win": $r('app.string.SouthwestWind'), + "winSpeed": "<3" }, { - "hours": "22时", - "wea": "多云", + "hours": "22", + "wea": $r('app.string.Cloudy'), "weaImg": "cloudy", "tem": "24", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "23时", - "wea": "多云", + "hours": "23", + "wea": $r('app.string.Cloudy'), "weaImg": "cloudy", "tem": "24", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "00时", - "wea": "多云", + "hours": "00", + "wea": $r('app.string.Cloudy'), "weaImg": "cloudy", "tem": "24", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "01时", - "wea": "多云", + "hours": "01", + "wea": $r('app.string.Cloudy'), "weaImg": "cloudy", "tem": "24", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "02时", - "wea": "多云", + "hours": "02", + "wea": $r('app.string.Cloudy'), "weaImg": "cloudy", "tem": "24", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "03时", - "wea": "多云", + "hours": "03", + "wea": $r('app.string.Cloudy'), "weaImg": "cloudy", "tem": "23", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "04时", - "wea": "多云", + "hours": "04", + "wea": $r('app.string.Cloudy'), "weaImg": "cloudy", "tem": "24", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "05时", - "wea": "晴", + "hours": "05", + "wea": $r('app.string.Sunny'), "weaImg": "sunny", "tem": "25", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "06时", - "wea": "晴", + "hours": "06", + "wea": $r('app.string.Sunny'), "weaImg": "sunny", "tem": "25", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" }, { - "hours": "07时", - "wea": "晴", + "hours": "07", + "wea": $r('app.string.Sunny'), "weaImg": "sunny", "tem": "26", - "win": "南风", - "winSpeed": "3-4级" + "win": $r('app.string.SouthWind'), + "winSpeed": "3-4" } ], "index": [ { - "title": "湿度", - "level": "42%", - "desc": "湿度刚好。" + "title": $r('app.string.Humidity'), + "level": $r('app.string.42Per'), + "desc": $r('app.string.Humidity_desc1') }, { - "title": "体感温度", - "level": "25°", + "title": $r('app.string.Humidity_desc1'), + "level": $r('app.string.tem25'), "desc": "" }, { - "title": "风力", - "level": "微风", - "desc": "风力较弱,适宜户外活动。" + "title": $r('app.string.WindForce'), + "level": $r('app.string.Breeze'), + "desc": $r('app.string.WindForce_desc1') }, { - "title": "风向", - "level": "西南风", + "title": $r('app.string.WindDirection'), + "level": $r('app.string.SouthwestWind'), "desc": "" }, { - "title": "穿衣", - "level": "短袖", - "desc": "建议穿短衫、短裤等清凉夏季服装。" + "title": $r('app.string.Clothing'), + "level": $r('app.string.TShirt'), + "desc": $r('app.string.Clothing_desc1') }, { - "title": "运动", - "level": "宜室外", + "title": $r('app.string.Sport'), + "level": $r('app.string.SportRecommended1'), "desc": "" }, { - "title": "感冒", - "level": "容易", - "desc": "昼夜温差大,注意预防感冒。" + "title": $r('app.string.Cold'), + "level": $r('app.string.ColdEasy'), + "desc": $r('app.string.ColdDesc') }, { - "title": "紫外线", - "level": "弱", - "desc": "辐射弱,涂擦SPF8-12防晒护肤品。" + "title": $r('app.string.UV'), + "level": $r('app.string.Weak'), + "desc": $r('app.string.UVDesc2') } ] }, { - "day": "25日(星期六)", + "day": $r('app.string.25th'), "date": "2022-06-25", - "week": "星期六", - "wea": "多云", + "week": $r('app.string.Saturday'), + "wea": $r('app.string.Cloudy'), "weaImg": "yun", - "weaDay": "多云", + "weaDay": $r('app.string.Cloudy'), "weaDayImg": "yun", - "weaNight": "多云", + "weaNight": $r('app.string.Cloudy'), "weaNightImg": "yun", "tem": "29", "tem1": "30", @@ -2645,15 +2645,15 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "南风", - "无持续风向" + $r('app.string.SouthWind'), + $r('app.string.WinDesc') ], - "winSpeed": "4-5级转<3级", + "winSpeed": "4-5 -> <3", "winMeter": "", "sunrise": "04:58", "sunset": "19:04", "air": "34", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -2664,14 +2664,14 @@ export const weather: CityFull[] = [ "index": [] }, { - "day": "26日(星期日)", + "day": $r('app.string.26th'), "date": "2022-06-26", - "week": "星期日", - "wea": "晴", + "week": $r('app.string.Sunday'), + "wea": $r('app.string.Sunny'), "weaImg": "sunny", - "weaDay": "晴", + "weaDay": $r('app.string.Sunny'), "weaDayImg": "sunny", - "weaNight": "晴", + "weaNight": $r('app.string.Sunny'), "weaNightImg": "sunny", "tem": "36", "tem1": "40", @@ -2680,15 +2680,15 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "南风", - "南风" + $r('app.string.SouthWind'), + $r('app.string.SouthWind') ], - "winSpeed": "4-5级", + "winSpeed": "4-5", "winMeter": "", "sunrise": "04:59", "sunset": "19:04", "air": "29", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -2699,14 +2699,14 @@ export const weather: CityFull[] = [ "index": [] }, { - "day": "27日(星期一)", + "day": $r('app.string.27th'), "date": "2022-06-27", - "week": "星期一", - "wea": "晴", + "week": $r('app.string.Monday'), + "wea": $r('app.string.Sunny'), "weaImg": "sunny", - "weaDay": "晴", + "weaDay": $r('app.string.Sunny'), "weaDayImg": "sunny", - "weaNight": "晴", + "weaNight": $r('app.string.Sunny'), "weaNightImg": "sunny", "tem": "33", "tem1": "39", @@ -2715,15 +2715,15 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "南风", - "南风" + $r('app.string.SouthWind'), + $r('app.string.SouthWind') ], - "winSpeed": "4-5级", + "winSpeed": "4-5", "winMeter": "", "sunrise": "04:59", "sunset": "19:04", "air": "26", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -2734,14 +2734,14 @@ export const weather: CityFull[] = [ "index": [] }, { - "day": "28日(星期二)", + "day": $r('app.string.28th'), "date": "2022-06-28", - "week": "星期二", - "wea": "多云", + "week": $r('app.string.Tuesday'), + "wea": $r('app.string.Cloudy'), "weaImg": "cloudy", - "weaDay": "多云", + "weaDay": $r('app.string.Cloudy'), "weaDayImg": "cloudy", - "weaNight": "多云", + "weaNight": $r('app.string.Cloudy'), "weaNightImg": "cloudy", "tem": "35", "tem1": "38", @@ -2750,15 +2750,15 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "西南风", - "南风" + $r('app.string.SouthwestWind'), + $r('app.string.SouthWind') ], - "winSpeed": "4-5级转3-4级", + "winSpeed": "4-5 -> 3-4", "winMeter": "", "sunrise": "04:59", "sunset": "19:04", "air": "38", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -2769,14 +2769,14 @@ export const weather: CityFull[] = [ "index": [] }, { - "day": "29日(星期三)", + "day": $r('app.string.29th'), "date": "2022-06-29", - "week": "星期三", - "wea": "晴", + "week": $r('app.string.Wednesday'), + "wea": $r('app.string.Sunny'), "weaImg": "sunny", - "weaDay": "晴", + "weaDay": $r('app.string.Sunny'), "weaDayImg": "sunny", - "weaNight": "晴", + "weaNight": $r('app.string.Sunny'), "weaNightImg": "sunny", "tem": "35", "tem1": "39", @@ -2785,15 +2785,15 @@ export const weather: CityFull[] = [ "visibility": "", "pressure": "", "win": [ - "无持续风向", - "无持续风向" + $r('app.string.WinDesc'), + $r('app.string.WinDesc') ], - "winSpeed": "<3级", + "winSpeed": "<3", "winMeter": "", "sunrise": "05:00", "sunset": "19:04", "air": "31", - "airLevel": "优", + "airLevel": $r('app.string.Excellent'), "airTips": "", "alarm": { "alarmType": "", @@ -2807,39 +2807,39 @@ export const weather: CityFull[] = [ "aqi": { "updateTime": "13:44", "cityId": "101210105", - "city": "武汉", + "city": $r('app.string.Wuhan'), "cityEn": "wuhan", - "country": "中国", + "country": $r('app.string.China'), "countryEn": "China", "air": "29", - "airLevel": "优", - "airTips": "空气很好,可以外出活动,呼吸新鲜空气,拥抱大自然!", + "airLevel": $r('app.string.Excellent'), + "airTips": $r('app.string.airTips2'), "pm25": "93", - "pm25Desc": "优", + "pm25Desc": $r('app.string.Excellent'), "pm10": "178", - "pm10Desc": "优", + "pm10Desc": $r('app.string.Excellent'), "o3": "17", - "o3Desc": "优", + "o3Desc": $r('app.string.Excellent'), "no2": "100", - "no2Desc": "优", + "no2Desc": $r('app.string.Excellent'), "so2": "66", - "so2Desc": "优", + "so2Desc": $r('app.string.Excellent'), "co": "18", "coDesc": "-", - "kouzhao": "不用佩戴口罩", - "yundong": "非常适宜运动", - "waichu": "适宜外出", - "kaichuang": "适宜开窗", - "jinghuaqi": "关闭净化器" + "kouzhao": $r('app.string.MaskNeed1'), + "yundong": $r('app.string.exercise1'), + "waichu": $r('app.string.goingOut1'), + "kaichuang": $r('app.string.windows1'), + "jinghuaqi": $r('app.string.purifier1') } } ]; export class CityFull { cityId: string = ''; - city: string = ''; + city: ResourceStr = ''; cityEn: string = ''; - country: string = ''; + country: ResourceStr = ''; countryEn: string = ''; updateTime: string = ''; data: WeatherItem[] = []; @@ -2847,14 +2847,14 @@ export class CityFull { } export class WeatherItem { - day: string = ''; + day: ResourceStr = ''; date: string = ''; - week: string = ''; - wea: string = ''; + week: ResourceStr = ''; + wea: ResourceStr = ''; weaImg: string = ''; - weaDay: string = ''; + weaDay: ResourceStr = ''; weaDayImg: string = ''; - weaNight: string = ''; + weaNight: ResourceStr = ''; weaNightImg: string = ''; tem: string = ''; tem1: string = ''; @@ -2862,14 +2862,14 @@ export class WeatherItem { humidity: string = ''; visibility: string = ''; pressure: string = ''; - win: string[] = []; + win: ResourceStr[] = []; winSpeed: string = ''; winMeter: string = ''; sunrise: string = ''; sunset: string = ''; air: string = ''; - airLevel: string = ''; - airTips: string = ''; + airLevel: ResourceStr = ''; + airTips: ResourceStr = ''; alarm: AlarmItem = new AlarmItem(); hours: HoursItem[] = []; index: IndexItem[] = []; @@ -2883,44 +2883,44 @@ export class AlarmItem { export class HoursItem { hours: string = ''; - wea: string = ''; + wea: ResourceStr = ''; weaImg: string = ''; tem: string = ''; - win: string = ''; + win: ResourceStr = ''; winSpeed: string = ''; } export class IndexItem { - title: string = ''; - level: string = ''; - desc: string = ''; + title: ResourceStr = ''; + level: ResourceStr = ''; + desc: ResourceStr = ''; } export class Aqi { updateTime: string = ''; cityId: string = ''; - city: string = ''; + city: ResourceStr = ''; cityEn: string = ''; - country: string = ''; + country: ResourceStr = ''; countryEn: string = ''; air: string = ''; - airLevel: string = ''; - airTips: string = ''; + airLevel: ResourceStr = ''; + airTips: ResourceStr = ''; pm25: string = ''; - pm25Desc: string = ''; + pm25Desc: ResourceStr = ''; pm10: string = ''; - pm10Desc: string = ''; + pm10Desc: ResourceStr = ''; o3: string = ''; - o3Desc: string = ''; + o3Desc: ResourceStr = ''; no2: string = ''; - no2Desc: string = ''; + no2Desc: ResourceStr = ''; so2: string = ''; - so2Desc: string = ''; + so2Desc: ResourceStr = ''; co: string = ''; coDesc: string = ''; - kouzhao: string = ''; - yundong: string = ''; - waichu: string = ''; - kaichuang: string = ''; - jinghuaqi: string = ''; + kouzhao: ResourceStr = ''; + yundong: ResourceStr = ''; + waichu: ResourceStr = ''; + kaichuang: ResourceStr = ''; + jinghuaqi: ResourceStr = ''; } \ No newline at end of file diff --git a/Weather/common/src/main/ets/mock/RequestData.ets b/Weather/common/src/main/ets/mock/RequestData.ets index bbf6d23bdb30adec8989d0d71efa22bf6849882d..4ffcdf8b3bb2427e10cbcd7b570d060daabe5683 100644 --- a/Weather/common/src/main/ets/mock/RequestData.ets +++ b/Weather/common/src/main/ets/mock/RequestData.ets @@ -21,24 +21,37 @@ import { cityData } from './CityInfo'; import { Aqi, weather } from './Mock'; const form = new FormDate(); // 时间格式修正 +let uiContext = AppStorage.get('uiContext') as UIContext; +let resourceManager = uiContext.getHostContext()!.resourceManager; // 获取天气类型对应的icon function getTypeIcon(data: string) { + switch (data) { case '晴': return $r('app.media.ic_weather_sunny'); + case 'Sunny': + return $r('app.media.ic_weather_sunny'); + case 'Cloudy': + return $r('app.media.ic_weather_cloudy'); case '多云': return $r('app.media.ic_weather_cloudy'); case '阴': return $r('app.media.ic_weather_yin'); case '小雨': return $r('app.media.ic_weather_lightrain'); + case 'Rainy': + return $r('app.media.ic_weather_lightrain'); case '雷阵雨': return $r('app.media.ic_weather_lightrain'); + case 'Shower': + return $r('app.media.ic_weather_lightrain'); case '日落': return $r('app.media.ic_weather_sunset'); case '中雨': return $r('app.media.ic_weather_rain'); + case 'Moderate rain': + return $r('app.media.ic_weather_rain'); case '大雨': return $r('app.media.ic_weather_rain'); default: @@ -71,17 +84,23 @@ function getMenuInfo() { // 获取首页顶部显示信息 function getHeaderDate(cityIndex: number, city?: City) { // 生成空气质量对象 - let air: AirData = new AirData(weather[cityIndex].aqi.air, weather[cityIndex].aqi.airLevel); - return new HeaderData(city ? city.name : weather[cityIndex].city, weather[cityIndex].data[1].tem, - weather[cityIndex].data[1].wea, weather[cityIndex].data[1].tem1, weather[cityIndex].data[1].tem2, - getTypeIcon(weather[cityIndex].data[1].wea), air, weather[cityIndex].data[1].airTips); + let air: AirData = + new AirData(weather[cityIndex].aqi.air, + resourceManager!.getStringSync(weather[cityIndex].aqi.airLevel as Resource)); + return new HeaderData(city ? city.name : resourceManager!.getStringSync(weather[cityIndex].city as Resource), + weather[cityIndex].data[1].tem, + resourceManager!.getStringSync(weather[cityIndex].data[1].wea as Resource), weather[cityIndex].data[1].tem1, + weather[cityIndex].data[1].tem2, + getTypeIcon(resourceManager!.getStringSync(weather[cityIndex].data[1].wea as Resource)), air, + resourceManager!.getStringSync(weather[cityIndex].data[1].airTips as Resource)); } function getCityList() { let cities: Array = []; if (cityData) { cityData.forEach(item => { - cities.push(new City(item.name, item.temp, item.weather)); + cities.push(new City(resourceManager!.getStringSync(item.name as Resource), item.temp, + resourceManager!.getStringSync(item.weather as Resource))); }) } return cities; @@ -90,7 +109,7 @@ function getCityList() { function addCity(city: City) { let cities: City[] | undefined = AppStorage.get('cityList'); let cityIndex = cities!.length % 5; - city.weather = weather[cityIndex].data[1].wea; + city.weather = resourceManager!.getStringSync(weather[cityIndex].data[1].wea as Resource); city.temp = weather[cityIndex].data[1].tem; cities!.push(city); AppStorage.setOrCreate('cityList', cities); @@ -109,7 +128,8 @@ function getCityListWeatherData() { if (cities) { cities.forEach((item, cityIndex) => { let index = cityIndex % 5; - let air: AirData = new AirData(weather[cityIndex].aqi.air, weather[cityIndex].aqi.airLevel); + let air: AirData = new AirData(weather[cityIndex].aqi.air, + resourceManager!.getStringSync(weather[cityIndex].aqi.airLevel as Resource)); cityListWeatherData.push(new CityListData(item.name, getHeaderDate(index, item), getHoursData(index), getWeekWeatherData(index), air, getAirIndexData(index), getLifeData(index))); titles.push(''); @@ -125,10 +145,12 @@ function getHoursData(cityIndex: number) { let hoursData = new Array(); weather[cityIndex].data[1].hours.forEach(item => { let time = item.hours.substring(0, item.hours.length - 1); - hoursData.push(new Forecast(`${item.tem}°`, `${time}:00`, form.formTimeSlot(parseInt(time)), getTypeIcon(item.wea), - item.win, item.winSpeed)); + hoursData.push(new Forecast(`${item.tem}°`, `${time}:00`, form.formTimeSlot(parseInt(time)), + getTypeIcon(resourceManager!!.getStringSync(item.wea as Resource)), + resourceManager!.getStringSync(item.win as Resource), item.winSpeed)); if (item.hours.indexOf('17') !== -1) { - hoursData.push(new Forecast('日落', '17:32', form.formTimeSlot(parseInt(time)), getTypeIcon('日落'), item.win, + hoursData.push(new Forecast('日落', '17:32', form.formTimeSlot(parseInt(time)), getTypeIcon('日落'), + resourceManager!.getStringSync(item.win as Resource), item.winSpeed)); } }) @@ -139,8 +161,10 @@ function getHoursData(cityIndex: number) { function getWeekWeatherData(cityIndex: number) { let weekData = new Array(); weather[cityIndex].data.forEach(item => { - weekData.push(new WeekWeather(form.formMonthDay(item.date), item.week, getTypeIcon(item.wea), item.wea, - item.airLevel, item.tem1, item.tem2)); + weekData.push(new WeekWeather(form.formMonthDay(item.date), resourceManager!.getStringSync(item.week as Resource), + getTypeIcon(resourceManager!.getStringSync(item.wea as Resource)), + resourceManager!.getStringSync(item.wea as Resource), + resourceManager!.getStringSync(item.airLevel as Resource), item.tem1, item.tem2)); }) return weekData; } @@ -173,19 +197,20 @@ function getLifeData(cityIndex: number) { $r('app.media.icon_uv') ]; weather[cityIndex].data[1].index.forEach((item, index) => { - suitDate.push(new SuitData(iconList[index], item.title, item.level)); + suitDate.push(new SuitData(iconList[index], resourceManager!.getStringSync(item.title as Resource), + resourceManager!.getStringSync(item.level as Resource))); }) return suitDate; } // 根据天气类型 获取背景图片 function getSideBg(weatherType: string) { - if (weatherType === '晴') { + if (weatherType === '晴' || weatherType === 'Sunny') { return $r('app.media.weather_fine'); - } else if (weatherType.includes('雨')) { - return $r('app.media.weather_rain'); - } else { + } else if (weatherType === '阴' || weatherType === '多云' || weatherType === 'Cloudy') { return $r('app.media.weather_yin'); + } else { + return $r('app.media.weather_rain'); } } diff --git a/Weather/common/src/main/ets/model/FormDate.ets b/Weather/common/src/main/ets/model/FormDate.ets index d5d1424bc62778e9e283426dc58b487e12ed11f7..a50777bf48ef5985b68f07910f94ecf9c1630e58 100644 --- a/Weather/common/src/main/ets/model/FormDate.ets +++ b/Weather/common/src/main/ets/model/FormDate.ets @@ -13,6 +13,9 @@ * limitations under the License. */ +let uiContext = AppStorage.get('uiContext') as UIContext; +let resourceManager = uiContext.getHostContext()!.resourceManager; + // 时间格式 调整 export default class FormDate { // 月+日 @@ -51,18 +54,18 @@ export default class FormDate { formTimeSlot(hour?: number): string { let now = hour ? hour : new Date().getHours(); if (now >= 0 && now <= 8) { - return '早上'; + return resourceManager!.getStringSync($r('app.string.morning')); } else if (now >= 9 && now < 11) { - return '上午'; + return resourceManager!.getStringSync($r('app.string.forenoon')); } else if (now >= 11 && now <= 13) { - return '中午'; + return resourceManager!.getStringSync($r('app.string.midday')); } else if (now >= 14 && now <= 16) { - return '下午'; + return resourceManager!.getStringSync($r('app.string.afternoon')); } else if (now >= 17 && now <= 19) { - return '傍晚'; + return resourceManager!.getStringSync($r('app.string.sunset')); } else if (now >= 19 && now <= 23) { - return '晚上'; + return resourceManager!.getStringSync($r('app.string.night')); } - return '早上'; + return resourceManager!.getStringSync($r('app.string.morning')); } } \ No newline at end of file diff --git a/Weather/common/src/main/ets/model/Main.ets b/Weather/common/src/main/ets/model/Main.ets index 94a13d6a84f956d26107414cf574385b8cd15e12..fcf70b281761191ca5b632df6d27cc90bb8f9ed2 100644 --- a/Weather/common/src/main/ets/model/Main.ets +++ b/Weather/common/src/main/ets/model/Main.ets @@ -117,9 +117,9 @@ class HeaderData { class City { public name: string; public temp: string; - public weather: string; + public weather: ResourceStr; - constructor(name: string, temp: string, weather: string) { + constructor(name: string, temp: string, weather: ResourceStr) { this.name = name; this.temp = temp; this.weather = weather; diff --git a/Weather/common/src/main/resources/base/element/string.json b/Weather/common/src/main/resources/base/element/string.json index f51a9c8461a55f6312ef950344e3145b7f82d607..dfb07d96995340f6bc32f82a83cce80305ad0559 100644 --- a/Weather/common/src/main/resources/base/element/string.json +++ b/Weather/common/src/main/resources/base/element/string.json @@ -3,6 +3,426 @@ { "name": "page_show", "value": "page from package" + }, + { + "name": "Beijing", + "value": "Bei Jing" + }, + { + "name": "Sunny", + "value": "Sunny" + }, + { + "name": "Shanghai", + "value": "Shang Hai" + }, + { + "name": "Cloudy", + "value": "Cloudy" + }, + { + "name": "Guangzhou", + "value": "Guangzhou" + }, + { + "name": "Rainy", + "value": "Rainy" + }, + { + "name": "Tianjin", + "value": "Tianjin" + }, + { + "name": "ModerateRain", + "value": "Moderate rain" + }, + { + "name": "Wuhan", + "value": "Wuhan" + }, + { + "name": "Shenyang", + "value": "Shenyang" + }, + { + "name": "Chongqing", + "value": "Chongqing" + }, + { + "name": "Hangzhou", + "value": "Hangzhou" + }, + { + "name": "Nanjing", + "value": "Nanjing" + }, + { + "name": "Harbin", + "value": "Harbin" + }, + { + "name": "Changchun", + "value": "Changchun" + }, + { + "name": "Shower", + "value": "Shower" + }, + { + "name": "Hohhot", + "value": "Hohhot" + }, + { + "name": "Shijiazhuang", + "value": "Shijiazhuang" + }, + { + "name": "Yinchuan", + "value": "Yinchuan" + }, + { + "name": "Urumqi", + "value": "Urumqi" + }, + { + "name": "Lhasa", + "value": "Lhasa" + }, + { + "name": "Xining", + "value": "Xining" + }, + { + "name": "Xian", + "value": "Xian" + }, + { + "name": "Lanzhou", + "value": "Lanzhou" + }, + { + "name": "Taiyuan", + "value": "Taiyuan" + }, + { + "name": "Kunming", + "value": "Kunming" + }, + { + "name": "Nanning", + "value": "Nanning" + }, + { + "name": "China", + "value": "China" + }, + { + "name": "23rd", + "value": "Tur,23rd" + }, + { + "name": "Thursday", + "value": "Thursday" + }, + { + "name": "SouthwestWind", + "value": "Southwest wind" + }, + { + "name": "winSpeed1", + "value": "5-6 -> 3-4" + }, + { + "name": "Excellent", + "value": "Excellent" + }, + { + "name": "24th", + "value": "Fri,24th" + }, + { + "name": "Friday", + "value": "Friday" + }, + { + "name": "25th", + "value": "Sat,25th" + }, + { + "name": "Saturday", + "value": "Saturday" + }, + { + "name": "26th", + "value": "Sun,26th" + }, + { + "name": "Sunday", + "value": "Sunday" + }, + { + "name": "27th", + "value": "Mon,27th" + }, + { + "name": "Monday", + "value": "Monday" + }, + { + "name": "28th", + "value": "Tue, 28th" + }, + { + "name": "Tuesday", + "value": "Tuesday" + }, + { + "name": "29th", + "value": "Wed, 29th" + }, + { + "name": "Wednesday", + "value": "Wednesday" + }, + { + "name": "winSpeed2", + "value": "3-4" + }, + { + "name": "airTips1", + "value": "Sunny and hot, avoid outdoors." + }, + { + "name": "WestWind", + "value": "West wind" + }, + { + "name": "NorthwestWind", + "value": "Northwest wind" + }, + { + "name": "SouthWind", + "value": "South wind" + }, + { + "name": "Humidity", + "value": "Humidity" + }, + { + "name": "Humidity_desc1", + "value": "Humidity perfect." + }, + { + "name": "Temperature", + "value": "Temperature" + }, + { + "name": "WindForce", + "value": "Wind force" + }, + { + "name": "Breeze", + "value": "Breeze" + }, + { + "name": "WindForce_desc1", + "value": "Breeze, great for outdoors." + }, + { + "name": "WindDirection", + "value": "Wind direction" + }, + { + "name": "NorthWind", + "value": "North wind" + }, + { + "name": "Clothing", + "value": "Clothing" + }, + { + "name": "TShirt", + "value": "T-shirt" + }, + { + "name": "Clothing_desc1", + "value": "Light summer clothes." + }, + { + "name": "Sport", + "value": "Sport" + }, + { + "name": "SportRecommended", + "value": "Indoor" + }, + { + "name": "Cold", + "value": "Cold" + }, + { + "name": "ColdEasy", + "value": "Prone to colds" + }, + { + "name": "ColdDesc", + "value": "Large day-night temperature difference. Prevent colds." + }, + { + "name": "UV", + "value": "UV" + }, + { + "name": "UVStrong", + "value": "Strong" + }, + { + "name": "UVDesc", + "value": "Strong radiation. Use SPF 8-12 sunscreen." + }, + { + "name": "WinDesc", + "value": "No sustained wind direction." + }, + { + "name": "airTips2", + "value": "Great air quality. Go outside, breathe fresh air, embrace nature!" + }, + { + "name": "MaskNeed1", + "value": "No mask needed." + }, + { + "name": "exercise1", + "value": "Ideal for exercise." + }, + { + "name": "goingOut1", + "value": "Good for going out." + }, + { + "name": "windows1", + "value": "Good to open windows." + }, + { + "name": "purifier1", + "value": "Turn off purifier." + }, + { + "name": "airTips3", + "value": "Cloudy, weak UV. Perfect for outings!" + }, + { + "name": "Weak", + "value": "Weak" + }, + { + "name": "UVDesc2", + "value": "Weak radiation. Use SPF 8-12 sunscreen." + }, + { + "name": "airTips4", + "value": "Cloudy now. Same temp as yesterday. Great for outings!" + }, + { + "name": "airTips5", + "value": "Light rain today. Cool weather." + }, + { + "name": "StrongWind", + "value": "Strong wind" + }, + { + "name": "SoutheastWind", + "value": "Southeast wind" + }, + { + "name": "LongSleeves", + "value": "Long sleeves" + }, + { + "name": "airTips6", + "value": "Good air quality, high humidity. Ideal for indoor activities!" + }, + { + "name": "airTips7", + "value": "Moderate rain today. Remember your umbrella!" + }, + { + "name": "Humidity_desc2", + "value": "High humidity" + }, + { + "name": "airTips8", + "value": "Good air quality. Go out, breathe fresh air, embrace nature!" + }, + { + "name": "airTips9", + "value": "Great air today. Perfect for outings. Remember sun protection!" + }, + { + "name": "SportRecommended1", + "value": "Outdoor" + }, + { + "name": "42Per", + "value": "42%" + }, + { + "name": "45Per", + "value": "45%" + }, + { + "name": "50Per", + "value": "50%" + }, + { + "name": "tem28", + "value": "28°" + }, + { + "name": "tem27", + "value": "27°" + }, + { + "name": "55Per", + "value": "55%" + }, + { + "name": "tem35", + "value": "35°" + }, + { + "name": "tem20", + "value": "20°" + }, + { + "name": "tem25", + "value": "25°" + }, + { + "name": "morning", + "value": "morning" + }, + { + "name": "forenoon", + "value": "AM" + }, + { + "name": "midday", + "value": "midday" + }, + { + "name": "afternoon", + "value": "PM" + }, + { + "name": "sunset", + "value": "sunset" + }, + { + "name": "night", + "value": "night" } ] } diff --git a/Weather/hvigor/hvigor-config.json5 b/Weather/hvigor/hvigor-config.json5 index 5bebc9755447385d82ce4138f54d991b1f85f348..6f008c99c91ca502036e67232e4c089e0421aefc 100644 --- a/Weather/hvigor/hvigor-config.json5 +++ b/Weather/hvigor/hvigor-config.json5 @@ -1,5 +1,5 @@ { - "modelVersion": "5.0.5", + "modelVersion": "5.1.1", "dependencies": { }, "execution": { diff --git a/Weather/oh-package.json5 b/Weather/oh-package.json5 index a8aff0c5aff22d78aa26fd19c3861f4320e951ff..052cc24d6e7b3f754ab5557652fd9db52c4c2549 100644 --- a/Weather/oh-package.json5 +++ b/Weather/oh-package.json5 @@ -1,5 +1,5 @@ { - "modelVersion": "5.0.5", + "modelVersion": "5.1.1", "description": "Please describe the basic information.", "dependencies": { }, diff --git a/Weather/product/default/src/main/ets/entryability/EntryAbility.ets b/Weather/product/default/src/main/ets/entryability/EntryAbility.ets index c609249a199c0c5795b4dd237fa1937d02315bdd..e4c23c6821fd84f9a2d641c0157b7ec85e9f58fd 100644 --- a/Weather/product/default/src/main/ets/entryability/EntryAbility.ets +++ b/Weather/product/default/src/main/ets/entryability/EntryAbility.ets @@ -14,9 +14,9 @@ */ import { ConfigurationConstant, UIAbility } from '@kit.AbilityKit'; +import { BusinessError } from '@kit.BasicServicesKit'; import { hilog } from '@kit.PerformanceAnalysisKit'; import { window } from '@kit.ArkUI'; -import { BusinessError } from '@kit.BasicServicesKit'; const DOMAIN = 0x0000; @@ -40,22 +40,30 @@ export default class EntryAbility extends UIAbility { hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); try { let mainWindow: window.Window = windowStage.getMainWindowSync(); - mainWindow.setImmersiveModeEnabledState(true); - mainWindow.setWindowSystemBarEnable([]).catch((err: BusinessError) => { + + try { + mainWindow.setImmersiveModeEnabledState(true); + mainWindow.setWindowSystemBarEnable([]).catch((err: BusinessError) => { + hilog.error(DOMAIN, 'testTag', '%{public}s', + `stopAppServiceExtensionAbility failed, code is ${err.code}, message is ${err.message}`); + }); + } catch (err) { hilog.error(DOMAIN, 'testTag', '%{public}s', - `stopAppServiceExtensionAbility failed, code is ${err.code}, message is ${err.message}`); + `setColorMode failed, code is ${err.code}, message is ${err.message}`); + } + windowStage.loadContent('pages/Home', (err) => { + if (err.code) { + hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); + return; + } + hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); + let uiContext = mainWindow.getUIContext(); + AppStorage.setOrCreate('uiContext', uiContext); }); } catch (err) { hilog.error(DOMAIN, 'testTag', '%{public}s', - `setColorMode failed, code is ${err.code}, message is ${err.message}`); + `Failed to obtain the main window. Cause code: ${err.code}, message: ${err.message}`); } - windowStage.loadContent('pages/Home', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); } onWindowStageDestroy(): void { diff --git a/Weather/product/default/src/main/ets/feature/SunCanvasFeature.ets b/Weather/product/default/src/main/ets/feature/SunCanvasFeature.ets index 26e3fea9b175d3c3f5b6c9c21f4b87edc8d9283f..0529b5de04de4edd0e81670ca5ccc43e01170140 100644 --- a/Weather/product/default/src/main/ets/feature/SunCanvasFeature.ets +++ b/Weather/product/default/src/main/ets/feature/SunCanvasFeature.ets @@ -12,6 +12,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { hilog } from "@kit.PerformanceAnalysisKit"; + + +const DOMAIN = 0x0000; +let uiContext = AppStorage.get('uiContext') as UIContext; +let resourceManager = uiContext.getHostContext()!.resourceManager; /** * 日出日落图 @@ -27,68 +33,72 @@ function initSun(context: CanvasRenderingContext2D, img: ImageBitmap) { * 绘制 */ - let begin = '日出 早上6:00'; - let final = '日落 傍晚5:32'; - let now = new Date(); - let time: number = now.getHours(); - let flag = true; // 太阳是否绘制 - let scale: number = Math.floor((time - 6) * 18 / 11); - if (now.getHours() < 6 || now.getHours() >= 17) { - flag = false; - scale = 0; - } - - let width = context.width, height = context.height; - - - // 下线 - context.beginPath(); - context.strokeStyle = "#33FFFFFF"; - context.setLineDash([]); - context.moveTo(0, height - 54); - context.lineTo(width, height - 54); - context.stroke(); - - // 文字 - context.font = '20px'; - context.fillStyle = "#99FFFFFF"; - context.textAlign = 'center'; - context.textBaseline = 'middle'; - context.fillText(begin, width / 6, height - 40); - - context.font = '20px'; - context.fillStyle = "#99FFFFFF"; - context.textAlign = 'center'; - context.textBaseline = 'middle'; - context.fillText(final, width / 6 * 5, height - 40); - - // 渐变色 - let color = context.createLinearGradient(0, 0, width, height); - color.addColorStop(0, '#FFAF38'); - color.addColorStop(scale / 18, '#DDFAD961'); - color.addColorStop(1, '#11FFFFFF'); - context.save(); - context.beginPath(); - context.lineWidth = 1; - if (flag) { - context.strokeStyle = color; - } else { - context.strokeStyle = '#33C0C0C0'; - } - context.arc(width / 2, height - 25, width * 0.4, Math.PI / 180 * 193, Math.PI * 2 / 180 * 173, false); - context.setLineDash([8]); - context.stroke(); - context.restore(); - - if (flag) { - // x为刻度线 + try { + let begin = resourceManager!.getStringSync($r('app.string.sunrise_begin').id); + let final = resourceManager!.getStringSync($r('app.string.sunset_final').id); + let now = new Date(); + let time: number = now.getHours(); + let flag = true; // 太阳是否绘制 + let scale: number = Math.floor((time - 6) * 18 / 11); + if (now.getHours() < 6 || now.getHours() >= 17) { + flag = false; + scale = 0; + } + + let width = context.width, height = context.height; + + // 下线 + context.beginPath(); + context.strokeStyle = "#33FFFFFF"; + context.setLineDash([]); + context.moveTo(0, height - 54); + context.lineTo(width, height - 54); + context.stroke(); + + // 文字 + context.font = '20px'; + context.fillStyle = "#99FFFFFF"; + context.textAlign = 'center'; + context.textBaseline = 'middle'; + context.fillText(begin, width / 6, height - 40); + + context.font = '20px'; + context.fillStyle = "#99FFFFFF"; + context.textAlign = 'center'; + context.textBaseline = 'middle'; + context.fillText(final, width / 6 * 5, height - 40); + + // 渐变色 + let color = context.createLinearGradient(0, 0, width, height); + color.addColorStop(0, '#FFAF38'); + color.addColorStop(scale / 18, '#DDFAD961'); + color.addColorStop(1, '#11FFFFFF'); context.save(); - // 弧度*π/180 得到弧度 - let deg = Math.PI / 180 * (193 + scale * 9); - let offsetX = -(Math.cos(deg) * width * 0.4); - let offsetY = -(Math.sin(deg) * width * 0.40); - - context.drawImage(img, 0, 0, 120, 120, width / 2 - offsetX - 12, height - 37 - offsetY, 24, 24); + context.beginPath(); + context.lineWidth = 1; + if (flag) { + context.strokeStyle = color; + } else { + context.strokeStyle = '#33C0C0C0'; + } + context.arc(width / 2, height - 25, width * 0.4, Math.PI / 180 * 193, Math.PI * 2 / 180 * 173, false); + context.setLineDash([8]); + context.stroke(); + context.restore(); + + if (flag) { + // x为刻度线 + context.save(); + // 弧度*π/180 得到弧度 + let deg = Math.PI / 180 * (193 + scale * 9); + let offsetX = -(Math.cos(deg) * width * 0.4); + let offsetY = -(Math.sin(deg) * width * 0.40); + + context.drawImage(img, 0, 0, 120, 120, width / 2 - offsetX - 12, height - 37 - offsetY, 24, 24); + } + } catch (error) { + hilog.error(DOMAIN, 'testTag', '%{public}s', + `getStringSync failed, error code: ${error.code}, message: ${error.message}.`); } } @@ -107,68 +117,73 @@ function initMoon(context: CanvasRenderingContext2D, img: ImageBitmap, iconMoon: * 绘制 */ - let begin = '月出 傍晚5:12'; - let final = '月落 早上6:20'; - let now = new Date(); - let time: number = now.getHours(); - let flag = true; // 月亮是否绘制 - let index: number = time >= 17 ? time - 17 : time + 7; - let scale = Math.floor(index * 18 / 13); - if (now.getHours() >= 6 && now.getHours() < 17) { - flag = false; - scale = 0; - } - - let width = context.width, height = context.height; - - // 文字 - context.font = '20px'; - context.fillStyle = "#99FFFFFF"; - context.textAlign = 'center'; - context.textBaseline = 'middle'; - context.fillText(begin, width / 6, height - 20); - - context.font = '20px'; - context.fillStyle = "#99FFFFFF"; - context.textAlign = 'center'; - context.textBaseline = 'middle'; - context.fillText('上弦月', width / 2, height - 20); - - context.font = '20px'; - context.fillStyle = "#99FFFFFF"; - context.textAlign = 'center'; - context.textBaseline = 'middle'; - context.fillText(final, width / 6 * 5, height - 20); - - context.drawImage(iconMoon, 0, 0, 16, 16, width / 2 - 5, height - 45, 24, 24); - - // 渐变色 - let color = context.createLinearGradient(0, 0, width, height); - color.addColorStop(0, '#FFAF38'); - color.addColorStop(scale / 18, '#DDFAD961'); - color.addColorStop(1, '#11FFFFFF'); - context.save(); - context.beginPath(); - context.lineWidth = 1; - if (flag) { - context.strokeStyle = color; - } else { - context.strokeStyle = '#33C0C0C0'; - } - context.arc(width / 2, height - 25, width * 0.3, Math.PI / 180 * 197, Math.PI * 2 / 180 * 171, false); - context.setLineDash([8]); - context.stroke(); - context.restore(); - - if (flag) { - // x为刻度线 + try { + let begin = resourceManager!.getStringSync($r('app.string.moonrise_begin').id); + let final = resourceManager!.getStringSync($r('app.string.moonset_final').id); + let now = new Date(); + let time: number = now.getHours(); + let flag = true; // 月亮是否绘制 + let index: number = time >= 17 ? time - 17 : time + 7; + let scale = Math.floor(index * 18 / 13); + if (now.getHours() >= 6 && now.getHours() < 17) { + flag = false; + scale = 0; + } + + let width = context.width, height = context.height; + + // 文字 + context.font = '20px'; + context.fillStyle = "#99FFFFFF"; + context.textAlign = 'center'; + context.textBaseline = 'middle'; + context.fillText(begin, width / 6, height - 20); + + context.font = '20px'; + context.fillStyle = "#99FFFFFF"; + context.textAlign = 'center'; + context.textBaseline = 'middle'; + context.fillText(resourceManager!.getStringSync($r('app.string.first_quarter').id), width / 2, height - 20); + + context.font = '20px'; + context.fillStyle = "#99FFFFFF"; + context.textAlign = 'center'; + context.textBaseline = 'middle'; + context.fillText(final, width / 6 * 5, height - 20); + + context.drawImage(iconMoon, 0, 0, 16, 16, width / 2 - 5, height - 45, 24, 24); + + // 渐变色 + let color = context.createLinearGradient(0, 0, width, height); + color.addColorStop(0, '#FFAF38'); + color.addColorStop(scale / 18, '#DDFAD961'); + color.addColorStop(1, '#11FFFFFF'); context.save(); - // 弧度*π/180 得到弧度 - let deg = Math.PI / 180 * (197 + scale * 9); - let offsetX = -(Math.cos(deg) * width * 0.3); - let offsetY = -(Math.sin(deg) * width * 0.3); - - context.drawImage(img, 0, 0, 120, 120, width / 2 - offsetX - 12, height - 37 - offsetY, 24, 24); + context.beginPath(); + context.lineWidth = 1; + if (flag) { + context.strokeStyle = color; + } else { + context.strokeStyle = '#33C0C0C0'; + } + context.arc(width / 2, height - 25, width * 0.3, Math.PI / 180 * 197, Math.PI * 2 / 180 * 171, false); + context.setLineDash([8]); + context.stroke(); + context.restore(); + + if (flag) { + // x为刻度线 + context.save(); + // 弧度*π/180 得到弧度 + let deg = Math.PI / 180 * (197 + scale * 9); + let offsetX = -(Math.cos(deg) * width * 0.3); + let offsetY = -(Math.sin(deg) * width * 0.3); + + context.drawImage(img, 0, 0, 120, 120, width / 2 - offsetX - 12, height - 37 - offsetY, 24, 24); + } + } catch (error) { + hilog.error(DOMAIN, 'testTag', '%{public}s', + `getStringSync failed, error code: ${error.code}, message: ${error.message}.`); } } diff --git a/Weather/product/default/src/main/ets/pages/AddCity.ets b/Weather/product/default/src/main/ets/pages/AddCity.ets index 707b353cf6d5c0aa90013ccb66a8182e16e042fc..f54e2fc0c50a57f87ab4f4d4558f682e49e3274d 100644 --- a/Weather/product/default/src/main/ets/pages/AddCity.ets +++ b/Weather/product/default/src/main/ets/pages/AddCity.ets @@ -43,7 +43,7 @@ struct AddCity { .scrollBar(BarState.Off) } .height('100%') - .backgroundColor('#F1F3F5') + .backgroundColor($r('sys.color.point_color_checked')) } } @@ -71,7 +71,7 @@ export struct CityGrid { .width('100%') .fontSize(14) .fontWeight(FontWeight.Regular) - .fontColor('#99000000') + .fontColor($r('sys.color.mask_secondary')) .margin({ bottom: 14 }) } diff --git a/Weather/product/default/src/main/ets/pages/AirQuality.ets b/Weather/product/default/src/main/ets/pages/AirQuality.ets index 039a0adcb3cfad92cf76b8d827dc0a2b34675db9..8ec2a626ddc97142dc91804f4652934d0c5fbef5 100644 --- a/Weather/product/default/src/main/ets/pages/AirQuality.ets +++ b/Weather/product/default/src/main/ets/pages/AirQuality.ets @@ -43,7 +43,7 @@ export default struct AirQuality { .justifyContent(FlexAlign.Center) List({ space: 12 }) { - ForEach(this.airIndexData, (item: AirIndex, index: number) => { + ForEach(this.airIndexData, (item: AirIndex) => { ListItem() { Row() { Text(item.index) diff --git a/Weather/product/default/src/main/ets/pages/CityList.ets b/Weather/product/default/src/main/ets/pages/CityList.ets index b31d62df3b5537ff4ef5df599841fec89ea45d91..39358c91a82ae63099543f9d3ba5c6765106b83f 100644 --- a/Weather/product/default/src/main/ets/pages/CityList.ets +++ b/Weather/product/default/src/main/ets/pages/CityList.ets @@ -78,7 +78,8 @@ struct CityList { .borderRadius(Style.NORMAL_RADIUS) .alignItems(VerticalAlign.Center) .backgroundImageSize(ImageSize.Cover) - .backgroundImage(getSideBg(item.weather)) + .backgroundImage(getSideBg(this.getUIContext() + .getHostContext()?.resourceManager.getStringSync((item.weather as Resource))as string)) } build() { @@ -132,7 +133,7 @@ struct CityList { }) } .height('100%') - .backgroundColor('#F1F3F5') + .backgroundColor($r('sys.color.point_color_checked')) } onPageShow() { diff --git a/Weather/product/default/src/main/ets/pages/HoursWeather.ets b/Weather/product/default/src/main/ets/pages/HoursWeather.ets index b7b4a6b16870c3b3ac6d7282f5901e61144f113f..b534cd3a714d9d2c74cf5740fb540ed0300eaedd 100644 --- a/Weather/product/default/src/main/ets/pages/HoursWeather.ets +++ b/Weather/product/default/src/main/ets/pages/HoursWeather.ets @@ -64,7 +64,7 @@ export default struct HoursWeather { build() { // Implement extensibility capability through list component. List() { - LazyForEach(this.hoursDataResource, (hoursItem: Forecast, index: number) => { + LazyForEach(this.hoursDataResource, (hoursItem: Forecast) => { ListItem() { this.HoursWeatherItem(hoursItem, this.curBp === 'lg' ? Style.WEATHER_ITEM_WIDTH + 2 : Style.WEATHER_ITEM_WIDTH) diff --git a/Weather/product/default/src/main/ets/pages/IndexEnd.ets b/Weather/product/default/src/main/ets/pages/IndexEnd.ets index f79a605b955ac2c682f25aaddb9ead369d2719f1..2a7164b9d59b85ec7725e2e5abca86ae4ab30515 100644 --- a/Weather/product/default/src/main/ets/pages/IndexEnd.ets +++ b/Weather/product/default/src/main/ets/pages/IndexEnd.ets @@ -34,7 +34,7 @@ export default struct IndexEnd { .fontSize(12) .margin({ top: 8 }) Text($r('app.string.weather_statement')) - .fontColor('#FFFFFF') + .fontColor($r('sys.color.comp_background_list_card')) .fontSize(12) .margin({ top: 4 }) Text($r('app.string.weather_copyright')) diff --git a/Weather/product/default/src/main/ets/pages/IndexTitleBar.ets b/Weather/product/default/src/main/ets/pages/IndexTitleBar.ets index 952019ea3d06a40bd3d927572f11d8c3fc4d4eb5..a39c5bf12a29a0bb38041e3399781fc572ec1594 100644 --- a/Weather/product/default/src/main/ets/pages/IndexTitleBar.ets +++ b/Weather/product/default/src/main/ets/pages/IndexTitleBar.ets @@ -40,7 +40,7 @@ export default struct IndexTitleBar { Text(item.title) .id('menu' + index) .fontSize(16) - .fontColor('#000000') + .fontColor($r('sys.color.black')) .fontWeight(FontWeight.Regular) .width('100%') .onClick(() => { diff --git a/Weather/product/default/src/main/ets/pages/LifeIndex.ets b/Weather/product/default/src/main/ets/pages/LifeIndex.ets index bcc78117a527df19065941c0b99b77a6634de786..364315e7da157a9740997472826cdc6c8ac66fff 100644 --- a/Weather/product/default/src/main/ets/pages/LifeIndex.ets +++ b/Weather/product/default/src/main/ets/pages/LifeIndex.ets @@ -23,7 +23,7 @@ export default struct LifeIndex { build() { Grid() { - LazyForEach(this.lifeDataResource, (item: SuitData, index: number) => { + LazyForEach(this.lifeDataResource, (item: SuitData) => { GridItem() { Column() { Image(item.src) diff --git a/Weather/product/default/src/main/ets/pages/MultidayWeather.ets b/Weather/product/default/src/main/ets/pages/MultidayWeather.ets index be2cceb0ea41b8c7b5b8075df178428a0b504fc4..65126216ba54065e565a41f2a8d87de6ee8de1e5 100644 --- a/Weather/product/default/src/main/ets/pages/MultidayWeather.ets +++ b/Weather/product/default/src/main/ets/pages/MultidayWeather.ets @@ -51,7 +51,7 @@ struct DayWeatherItem { build() { Column() { - Text(this.index === 0 ? $r('app.string.yestoday') : + Text(this.index === 0 ? $r('app.string.yesterday') : this.index === 1 ? $r('app.string.today') : this.weatherInfo?.week) .fontSize(12) .fontColor(Color.White) @@ -81,10 +81,13 @@ struct DayWeatherItem { .fontColor(Color.White) .margin({ top: 19 }) .backgroundColor('#24FFFFFF') - .width(26) .height(16) .textAlign(TextAlign.Center) .borderRadius(11) + .padding({ + right: 6, + left: 6 + }) } } } \ No newline at end of file diff --git a/Weather/product/default/src/main/ets/pages/SideContent.ets b/Weather/product/default/src/main/ets/pages/SideContent.ets index 2300688bf3600fb9d5cb32de9a67e5f3b967662b..65d92f4a1ff01e2c86465e775ffb9a5906e25324 100644 --- a/Weather/product/default/src/main/ets/pages/SideContent.ets +++ b/Weather/product/default/src/main/ets/pages/SideContent.ets @@ -14,6 +14,9 @@ */ import { City, getSideBg, MyDataSource, Style } from 'common'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + +const DOMAIN = 0x0000; @Component export default struct SideContent { @@ -41,11 +44,11 @@ export default struct SideContent { .fontSize(30) .fontWeight(FontWeight.Medium) .width('100%') - Search({ placeholder: '搜索城市(中文/拼音)', icon: '/common/images/icon_search.svg' }) + Search({ placeholder: $r('app.string.search_placeholder'), icon: '/common/images/icon_search.svg' }) .placeholderFont({ size: 16 }) .placeholderColor('#60FFFFFF') .width('100%') - .backgroundColor('#26FFFFFF') + .backgroundColor($r('sys.color.container_modal_button_hover_baseboard')) .margin({ top: 4 }) .borderRadius(45) } @@ -87,6 +90,17 @@ struct CityItem { cityInfo?: City; index: number = 0; + getResourceFile(): Resource | undefined { + try { + return getSideBg(this.getUIContext() + .getHostContext()?.resourceManager.getStringSync((this.cityInfo!.weather as Resource).id) as string); + } catch (error) { + hilog.error(DOMAIN, 'testTag', '%{public}s', + `getStringSync failed, error code: ${error.code}, message: ${error.message}.`); + return undefined; + } + } + build() { Row() { Text(this.cityInfo?.name) @@ -126,6 +140,6 @@ struct CityItem { }) .alignItems(VerticalAlign.Center) .backgroundImageSize(ImageSize.Cover) - .backgroundImage(getSideBg(this.cityInfo!.weather)) + .backgroundImage(this.getResourceFile()) } } diff --git a/Weather/product/default/src/main/resources/base/element/string.json b/Weather/product/default/src/main/resources/base/element/string.json index 04e698f2275e7864fed564b1f3e3c9d0ebfdcdd1..c12b9e00df6f359aedcf4259018aecaa8a74cc0f 100644 --- a/Weather/product/default/src/main/resources/base/element/string.json +++ b/Weather/product/default/src/main/resources/base/element/string.json @@ -2,7 +2,7 @@ "string": [ { "name": "module_desc", - "value": "weather" + "value": "Weather" }, { "name": "EntryAbility_desc", @@ -10,55 +10,55 @@ }, { "name": "EntryAbility_label", - "value": "weather" + "value": "Weather" }, { "name": "midnight", - "value": "半夜" + "value": "Midnight" }, { "name": "early_morning", - "value": "清晨" + "value": "Early Morning" }, { "name": "morning", - "value": "早上" + "value": "Morning" }, { - "name": "yestoday", - "value": "昨天" + "name": "yesterday", + "value": "Yesterday" }, { "name": "today", - "value": "今天" + "value": "Today" }, { "name": "air", - "value": "空气" + "value": "Air" }, { "name": "air_quality", - "value": "污染指数" + "value": "Air Quality" }, { "name": "weather", - "value": "天气" + "value": "Weather" }, { "name": "china_weather", - "value": "中国天气" + "value": "China Weather" }, { "name": "weather_version", - "value": "天气版本:11.1.0" + "value": "Weather version:11.1.0" }, { "name": "weather_statement", - "value": "关于天气与隐私的声明" + "value": "Statement on Weather and Privacy" }, { "name": "weather_copyright", - "value": "版权所有2020 OpenHarmony技术有限公司" + "value": "Copyright © 2020 OpenHarmony Technology Co., Ltd." }, { "name": "du", @@ -66,27 +66,51 @@ }, { "name": "manage_city", - "value": "管理城市" + "value": "Urban management" }, { "name": "add_city", - "value": "添加城市" + "value": "Add City" }, { "name": "search_placeholder", - "value": "搜索城市(中文/拼音)" + "value": "Search for city (Chinese/Pinyin)" }, { "name": "update_time", - "value": "更新时间" + "value": "Update Time" }, { "name": "cancel", - "value": "取消" + "value": "Cancel" }, { "name": "hot_city", - "value": "热门城市" + "value": "Hot City" + }, + { + "name": "sunrise_begin", + "value": "Sunrise 6:00 AM" + }, + { + "name": "sunset_final", + "value": "Sunset 5:32 PM" + }, + { + "name": "moonrise_begin", + "value": "Moonrise 5:12 PM" + }, + { + "name": "moonset_final", + "value": "Moonset 6:20 AM" + }, + { + "name": "first_quarter", + "value": "First Quarter" + }, + { + "name": "empty", + "value": " " } ] } \ No newline at end of file diff --git a/Weather/product/default/src/main/resources/en_US/element/string.json b/Weather/product/default/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..c12b9e00df6f359aedcf4259018aecaa8a74cc0f --- /dev/null +++ b/Weather/product/default/src/main/resources/en_US/element/string.json @@ -0,0 +1,116 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "Weather" + }, + { + "name": "EntryAbility_desc", + "value": "Multiple weather conditions" + }, + { + "name": "EntryAbility_label", + "value": "Weather" + }, + { + "name": "midnight", + "value": "Midnight" + }, + { + "name": "early_morning", + "value": "Early Morning" + }, + { + "name": "morning", + "value": "Morning" + }, + { + "name": "yesterday", + "value": "Yesterday" + }, + { + "name": "today", + "value": "Today" + }, + { + "name": "air", + "value": "Air" + }, + { + "name": "air_quality", + "value": "Air Quality" + }, + { + "name": "weather", + "value": "Weather" + }, + { + "name": "china_weather", + "value": "China Weather" + }, + { + "name": "weather_version", + "value": "Weather version:11.1.0" + }, + { + "name": "weather_statement", + "value": "Statement on Weather and Privacy" + }, + { + "name": "weather_copyright", + "value": "Copyright © 2020 OpenHarmony Technology Co., Ltd." + }, + { + "name": "du", + "value": "℃" + }, + { + "name": "manage_city", + "value": "Urban management" + }, + { + "name": "add_city", + "value": "Add City" + }, + { + "name": "search_placeholder", + "value": "Search for city (Chinese/Pinyin)" + }, + { + "name": "update_time", + "value": "Update Time" + }, + { + "name": "cancel", + "value": "Cancel" + }, + { + "name": "hot_city", + "value": "Hot City" + }, + { + "name": "sunrise_begin", + "value": "Sunrise 6:00 AM" + }, + { + "name": "sunset_final", + "value": "Sunset 5:32 PM" + }, + { + "name": "moonrise_begin", + "value": "Moonrise 5:12 PM" + }, + { + "name": "moonset_final", + "value": "Moonset 6:20 AM" + }, + { + "name": "first_quarter", + "value": "First Quarter" + }, + { + "name": "empty", + "value": " " + } + ] +} \ No newline at end of file diff --git a/Weather/product/default/src/main/resources/zh_CN/element/string.json b/Weather/product/default/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..5375831c1248435b1410e8619e2eaa68b1becfe3 --- /dev/null +++ b/Weather/product/default/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,116 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "Weather" + }, + { + "name": "EntryAbility_desc", + "value": "Multiple weather conditions" + }, + { + "name": "EntryAbility_label", + "value": "Weather" + }, + { + "name": "midnight", + "value": "半夜" + }, + { + "name": "early_morning", + "value": "清晨" + }, + { + "name": "morning", + "value": "早上" + }, + { + "name": "yesterday", + "value": "昨天" + }, + { + "name": "today", + "value": "今天" + }, + { + "name": "air", + "value": "空气" + }, + { + "name": "air_quality", + "value": "污染指数" + }, + { + "name": "weather", + "value": "Weather" + }, + { + "name": "china_weather", + "value": "中国天气" + }, + { + "name": "weather_version", + "value": "天气版本:11.1.0" + }, + { + "name": "weather_statement", + "value": "关于天气与隐私的声明" + }, + { + "name": "weather_copyright", + "value": "版权所有2020 OpenHarmony技术有限公司" + }, + { + "name": "du", + "value": "℃" + }, + { + "name": "manage_city", + "value": "管理城市" + }, + { + "name": "add_city", + "value": "添加城市" + }, + { + "name": "search_placeholder", + "value": "搜索城市(中文/拼音)" + }, + { + "name": "update_time", + "value": "更新时间" + }, + { + "name": "cancel", + "value": "取消" + }, + { + "name": "hot_city", + "value": "热门城市" + }, + { + "name": "sunrise_begin", + "value": "日出 早上6:00" + }, + { + "name": "sunset_final", + "value": "日落 傍晚5:32" + }, + { + "name": "moonrise_begin", + "value": "月出 傍晚5:12" + }, + { + "name": "moonset_final", + "value": "月落 早上6:20" + }, + { + "name": "first_quarter", + "value": "上弦月" + }, + { + "name": "empty", + "value": " " + } + ] +} \ No newline at end of file diff --git a/Weather/screenshots/devices/foldable_screen_cn.png b/Weather/screenshots/devices/foldable_screen_cn.png new file mode 100644 index 0000000000000000000000000000000000000000..7851925c09ecad75a68042ae11187b634a23bd6e Binary files /dev/null and b/Weather/screenshots/devices/foldable_screen_cn.png differ diff --git a/Weather/screenshots/devices/foldable_screen_en.png b/Weather/screenshots/devices/foldable_screen_en.png new file mode 100644 index 0000000000000000000000000000000000000000..daf1448f456dfabd9cb971f2b15f099916c277b4 Binary files /dev/null and b/Weather/screenshots/devices/foldable_screen_en.png differ diff --git a/Weather/screenshots/devices/phone_cn.png b/Weather/screenshots/devices/phone_cn.png new file mode 100644 index 0000000000000000000000000000000000000000..24c1f9dba458044fb40608cc1157fc40cadc86f8 Binary files /dev/null and b/Weather/screenshots/devices/phone_cn.png differ diff --git a/Weather/screenshots/devices/phone_en.png b/Weather/screenshots/devices/phone_en.png new file mode 100644 index 0000000000000000000000000000000000000000..b5475b5e6fb7d5f73e23332c7af1eb1df292789b Binary files /dev/null and b/Weather/screenshots/devices/phone_en.png differ diff --git a/Weather/screenshots/devices/tablet_cn.png b/Weather/screenshots/devices/tablet_cn.png new file mode 100644 index 0000000000000000000000000000000000000000..bfbe71cdf29ee5d0ed53b21dbba84d23faa22bbf Binary files /dev/null and b/Weather/screenshots/devices/tablet_cn.png differ diff --git a/Weather/screenshots/devices/tablet_en.png b/Weather/screenshots/devices/tablet_en.png new file mode 100644 index 0000000000000000000000000000000000000000..9862f4f30de5714fdc366a6f145b09e9bbcc329b Binary files /dev/null and b/Weather/screenshots/devices/tablet_en.png differ diff --git a/Weather/screenshots/devices/vertical_screen_tablet_cn.png b/Weather/screenshots/devices/vertical_screen_tablet_cn.png new file mode 100644 index 0000000000000000000000000000000000000000..22066d286ef71eb23ccd78b67df4a34e45d01f38 Binary files /dev/null and b/Weather/screenshots/devices/vertical_screen_tablet_cn.png differ diff --git a/Weather/screenshots/devices/vertical_screen_tablet_en.png b/Weather/screenshots/devices/vertical_screen_tablet_en.png new file mode 100644 index 0000000000000000000000000000000000000000..642b25a34a1269183ef72d5e30490eb90b120d3e Binary files /dev/null and b/Weather/screenshots/devices/vertical_screen_tablet_en.png differ diff --git a/Weather/screenshots/devices/zh/add_city.png b/Weather/screenshots/devices/zh/add_city.png deleted file mode 100644 index 1beb0c5064a9765c30a328dd2731a9ff9dedd03b..0000000000000000000000000000000000000000 Binary files a/Weather/screenshots/devices/zh/add_city.png and /dev/null differ diff --git a/Weather/screenshots/devices/zh/city.png b/Weather/screenshots/devices/zh/city.png deleted file mode 100644 index ef7c5ab5c18ed7030334d11bd9e31777720f5b96..0000000000000000000000000000000000000000 Binary files a/Weather/screenshots/devices/zh/city.png and /dev/null differ diff --git a/Weather/screenshots/devices/zh/home.png b/Weather/screenshots/devices/zh/home.png deleted file mode 100644 index 17c6fe1552d4af75823b54f8b0ca033631b96c4b..0000000000000000000000000000000000000000 Binary files a/Weather/screenshots/devices/zh/home.png and /dev/null differ