From c66e3d696a6ba8ff57a14a06cb3fca916cf413a7 Mon Sep 17 00:00:00 2001 From: guojin26 Date: Thu, 11 Nov 2021 16:21:35 +0800 Subject: [PATCH 1/5] add airquality Signed-off-by: guojin26 --- common/AirQuality/README_zh.md | 18 ++ common/AirQuality/build.gradle | 33 ++++ common/AirQuality/entry/build.gradle | 17 ++ common/AirQuality/entry/src/main/config.json | 62 +++++++ .../entry/src/main/js/default/app.js | 8 + .../src/main/js/default/common/ic_back.png | Bin 0 -> 1274 bytes .../entry/src/main/js/default/i18n/en-US.json | 11 ++ .../entry/src/main/js/default/i18n/zh-CN.json | 11 ++ .../src/main/js/default/pages/index/index.css | 174 ++++++++++++++++++ .../src/main/js/default/pages/index/index.hml | 106 +++++++++++ .../src/main/js/default/pages/index/index.js | 84 +++++++++ .../main/js/default/pages/second/second.css | 102 ++++++++++ .../main/js/default/pages/second/second.hml | 133 +++++++++++++ .../main/js/default/pages/second/second.js | 22 +++ .../main/resources/base/element/string.json | 12 ++ .../src/main/resources/base/media/icon.png | Bin 0 -> 5598 bytes common/AirQuality/settings.gradle | 1 + .../src/main/js/default/pages/index/index.hml | 2 +- 18 files changed, 795 insertions(+), 1 deletion(-) create mode 100644 common/AirQuality/README_zh.md create mode 100644 common/AirQuality/build.gradle create mode 100644 common/AirQuality/entry/build.gradle create mode 100644 common/AirQuality/entry/src/main/config.json create mode 100644 common/AirQuality/entry/src/main/js/default/app.js create mode 100644 common/AirQuality/entry/src/main/js/default/common/ic_back.png create mode 100644 common/AirQuality/entry/src/main/js/default/i18n/en-US.json create mode 100644 common/AirQuality/entry/src/main/js/default/i18n/zh-CN.json create mode 100644 common/AirQuality/entry/src/main/js/default/pages/index/index.css create mode 100644 common/AirQuality/entry/src/main/js/default/pages/index/index.hml create mode 100644 common/AirQuality/entry/src/main/js/default/pages/index/index.js create mode 100644 common/AirQuality/entry/src/main/js/default/pages/second/second.css create mode 100644 common/AirQuality/entry/src/main/js/default/pages/second/second.hml create mode 100644 common/AirQuality/entry/src/main/js/default/pages/second/second.js create mode 100644 common/AirQuality/entry/src/main/resources/base/element/string.json create mode 100644 common/AirQuality/entry/src/main/resources/base/media/icon.png create mode 100644 common/AirQuality/settings.gradle diff --git a/common/AirQuality/README_zh.md b/common/AirQuality/README_zh.md new file mode 100644 index 0000000000..79b1d189cb --- /dev/null +++ b/common/AirQuality/README_zh.md @@ -0,0 +1,18 @@ +# 空气质量 + +### 简介 + +本示例使用JS实现了一个简单空气质量应用,使用折行显示能力显示空气质量信息,使用柱形图展示历史记录。 + +### 使用说明 + +- 点击桌面应用图标,启动应用; +- 在首页展示空气质量信息,左右滑动可以切换城市; +- 点击历史记录可以跳转到历史记录页面,此界面用柱形图展示历史记录; + + + +### 约束与限制 + +- 本示例支持在标准系统上运行。 + diff --git a/common/AirQuality/build.gradle b/common/AirQuality/build.gradle new file mode 100644 index 0000000000..46b60f6716 --- /dev/null +++ b/common/AirQuality/build.gradle @@ -0,0 +1,33 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +apply plugin: 'com.huawei.ohos.app' + +//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 +ohos { + compileSdkVersion 7 + supportSystem "standard" +} + +buildscript { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + } + dependencies { + classpath 'com.huawei.ohos:hap:3.0.3.2' + } +} + +allprojects { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + } +} diff --git a/common/AirQuality/entry/build.gradle b/common/AirQuality/entry/build.gradle new file mode 100644 index 0000000000..4186492feb --- /dev/null +++ b/common/AirQuality/entry/build.gradle @@ -0,0 +1,17 @@ +apply plugin: 'com.huawei.ohos.hap' +//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 +ohos { + compileSdkVersion 7 + defaultConfig { + compatibleSdkVersion 6 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } +} + diff --git a/common/AirQuality/entry/src/main/config.json b/common/AirQuality/entry/src/main/config.json new file mode 100644 index 0000000000..946975608f --- /dev/null +++ b/common/AirQuality/entry/src/main/config.json @@ -0,0 +1,62 @@ +{ + "app": { + "bundleName": "ohos.samples.airquality", + "vendor": "samples", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "ohos.samples.airquality", + "name": ".MyApplication", + "mainAbility": ".default", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "name": ".default", + "srcPath": "default", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:mainability_description", + "formsEnabled": false, + "label": "$string:app_name", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".default", + "window": { + "designWidth": 720, + "autoDesignWidth": true + } + } + ] + } +} \ No newline at end of file diff --git a/common/AirQuality/entry/src/main/js/default/app.js b/common/AirQuality/entry/src/main/js/default/app.js new file mode 100644 index 0000000000..6d060ffe56 --- /dev/null +++ b/common/AirQuality/entry/src/main/js/default/app.js @@ -0,0 +1,8 @@ +export default { + onCreate() { + console.info("Application onCreate"); + }, + onDestroy() { + console.info("Application onDestroy"); + } +}; diff --git a/common/AirQuality/entry/src/main/js/default/common/ic_back.png b/common/AirQuality/entry/src/main/js/default/common/ic_back.png new file mode 100644 index 0000000000000000000000000000000000000000..4a269a11a6eca005d2eabb957992297446c858db GIT binary patch literal 1274 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k1|%Oc%$NbBBuiW)N`mv#O3D+9QW+dm@{>{( zJaZG%Q-e|yQz{EjrrIztFl%InM3hAM`dB6B=jtVb)aX^@765fKFxc2v6eK2Rr0UTq__OB&@Hb09I0xZL0)vRD^GUf^&XRs)DJWnQpS7iGhN-rJkXg zfr+W1j)IYap}D?+slI`ku7RPIfrXWkp#l^r0c|TvNwW%aaf8|g1^l#~=$>Fbx5 zm+O@q>*W`v>l<2HTIw4Z=^Gj80#)c1SLT%@R_NvxE5l51Ni9w;$}A|!%+FH*nV6WA zUs__T1av9H3%LbwWAlok!2}F2{ffi_eM3D1ke6TzeSPsO&CP|YE-nd5MYtEM!Nnn! z1*!T$sm1xFMajU3OH&3}Rbb^@l$uzQUlfv`p92fUfQU|Iy$+UJ6X7x zTAG*{S~xm8Im7h2*VN}Bb=g6k%)h^yok!`}^Trx<|bGDVf+9ZWB;J1FWGE$&HTUuezdVeRVT z5+gZ5VA0ZKk1~O^vd)v5Up$mpB!fdqz6E=9WC8#_cnrIDwrpUXO@geCy#!nv;i literal 0 HcmV?d00001 diff --git a/common/AirQuality/entry/src/main/js/default/i18n/en-US.json b/common/AirQuality/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000..08e34eac91 --- /dev/null +++ b/common/AirQuality/entry/src/main/js/default/i18n/en-US.json @@ -0,0 +1,11 @@ +{ + "strings": { + "hello": "Hello", + "world": "World", + "page": "Second Page", + "next": "Next Page", + "back": "Back" + }, + "Files": { + } +} \ No newline at end of file diff --git a/common/AirQuality/entry/src/main/js/default/i18n/zh-CN.json b/common/AirQuality/entry/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000..3dd53b3a8b --- /dev/null +++ b/common/AirQuality/entry/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,11 @@ +{ + "strings": { + "hello": "您好", + "world": "世界", + "page": "第二页", + "next": "下一页", + "back": "返回" + }, + "Files": { + } +} \ No newline at end of file diff --git a/common/AirQuality/entry/src/main/js/default/pages/index/index.css b/common/AirQuality/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000..bab770e4ed --- /dev/null +++ b/common/AirQuality/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,174 @@ +.aqi-value { + text-align: center; + font-size: 40px; + color: #000000; + width: 100%; + height: 25%; +} + +.list { + width: 100%; + height: 100%; +} + +.list-item { + flex-direction: column; + align-items: center; + justify-content: center; +} + +.aqi { + text-align: center; + color: #a2c4a2; + margin-top: 10%; + font-size: 30px; + width: 100%; + height: 30%; +} + +.airquality { + text-align: center; + width: 100%; + height: 25%; + font-size: 30px; +} + +.image { + top: 285px; + left: 274px; + width: 32px; + height: 32px; +} + +.location-text { + text-align: center; + color: #000000; + width: 100%; + height: 50px; + font-size: 35px; +} +.progress-div { + width: 320px; + height: 220px; + flex-direction: column; +} +.progress { + width: 100%; + height: 100%; +} + +.container { + flex-direction: column; + height: 100%; + width: 100%; +} + +.circle-progress { + start-angle: 198deg; + total-angle: 320deg; + stroke-width: 20px; + width: 100%; + height: 100%; + top:5px; +} + +.mask-layer { + width: 100%; + height: 100%; + top:10px; + flex-direction: column; +} + +.detail { + width: 350px; + height: 280px; + flex-direction: column; + justify-content: center; + align-items: center; +} + +.text-wrapper { + width: 100%; + height: 16%; +} + +.gas-name { + width: 50%; + text-align: left; + margin-left: 30%; +} + +.gas-value { + width: 50%; + text-align: right; + margin-right: 30%; +} + +.btn { + width: 50%; + height: 50px; + border-radius: 55px; + background-color: #1a1a1a; + color: #1085CE; +} + +.footer { + width: 100%; + height: 120px; + flex-direction: column; + align-items: center; + margin-top: 10px; +} + +.header { + width: 100%; + height: 80px; +} + +.back { + width: 36px; + height: 36px; + margin-top: 20px; + margin-left: 21px; + color: #e6e6e6; +} + +.title { + width: 296px; + height: 40px; + margin-top: 20px; + margin-left: 21px; + color: #e6e6e6; +} + +.swiper { + height: 700px; + width: 100%; +} + +.page { + width: 100%; + height: 100%; + flex-direction: row; + flex-wrap:wrap; + align-items: center; + justify-content: center; +} + +.update-time { + width: 100%; + color: #A9A9A9; + margin-left: 24px; +} + +.info-source { + width: 100%; + color: #A9A9A9; + margin-left: 24px; +} + +.circle-div { + width: 12px; + height: 12px; + border-radius: 6px; +} \ No newline at end of file diff --git a/common/AirQuality/entry/src/main/js/default/pages/index/index.hml b/common/AirQuality/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000..eb2368a6f9 --- /dev/null +++ b/common/AirQuality/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,106 @@ +
+
+ + 空气质量 +
+ + + +
+
+ + {{ airData[0].location }} + + + + +
+ AQI + {{ airData[0].detailData }} + {{ airData[0].airQuality }} + +
+
+
+
+
+ CO + 100 +
+
+ NO2 + 90 +
+
+ PM10 + 120 +
+
+ PM2.5 + 40 +
+
+ SO2 + 150 +
+
+
+ +
+ +
+
+
+ + {{ airData[1].location }} + + + + +
+ AQI + {{ airData[1].detailData }} + {{ airData[1].airQuality }} + +
+
+
+
+
+ CO + 100 +
+
+ NO2 + 90 +
+
+ PM10 + 120 +
+
+ PM2.5 + 40 +
+
+ SO2 + 150 +
+
+ + +
+
+
+
+
diff --git a/common/AirQuality/entry/src/main/js/default/pages/index/index.js b/common/AirQuality/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000..c24880a71f --- /dev/null +++ b/common/AirQuality/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,84 @@ +import router from '@system.router'; +import app from '@system.app'; + +export default { + data: { + textColor1: '#00ff00', + textColor2: '#00ff00', + bgColor1: '#669966', + bgColor2: '#669966', + swiperPage: 0, + percent1: 40, + percent2: 90, + iconcheckedBR: '6px', + iconcheckedColor: '#ffffff', + iconUncheckedColor: '#262626', + src1: '/common/cloud_green.png', + src2: '/common/cloud_green.png', + airData: [{ + location: '东莞', + airQuality: '良', + detailData: 40 + }, { + location: '深圳', + airQuality: '差', + detailData: 90 + }] + }, + onInit() { + if (this.airData[0].detailData > 100) { + this.src1 = '/common/cloud_red.png'; + this.textColor1 = '#ff0000'; + this.bgColor1 = '#9d7462'; + } else if (this.airData[0].detailData > 50 ) { + this.src1 = '/common/cloud_yellow.png'; + this.textColor1 = '#ecf19a'; + this.bgColor1 = '#9d9d62'; + } + if (this.airData[1].detailData > 100) { + this.src2 = '/common/cloud_red.png'; + this.textColor2 = '#ff0000'; + this.bgColor2 = '#9d9d62'; + } else if (50 < this.airData[1].detailData) { + this.src2 = '/common/cloud_yellow.png' + this.textColor2 = '#ecf19a'; + this.bgColor2 = '#9d9d62'; + } + if (this.selectedCityIndex) { + this.swiperPage = this.selectedCityIntex + if (this.swiperPage == 0) { + this.iconcheckedBR = '#ffffff'; + this.iconUncheckedColor = '#262626'; + } else { + this.iconcheckedColor = '#262626'; + this.iconUncheckedColor = '#ffffff'; + } + } + }, + openDetail() { + router.replace({ + uri: 'pages/second/second', + params: { + selectedCityIndex: this.swiperPage + } + }); + }, + exitApp() { + console.log('start exit'); + app.terminate(); + console.log('end exit') + }, + swiperChange(e) { + this.swiperPage = e.index; + if (e.index == 0) { + this.iconcheckedColor = '#ffffff'; + this.iconUncheckedColor = '#262626'; + } else { + this.iconcheckedColor = '#262626'; + this.iconUncheckedColor = '#ffffff'; + } + } +} + + + diff --git a/common/AirQuality/entry/src/main/js/default/pages/second/second.css b/common/AirQuality/entry/src/main/js/default/pages/second/second.css new file mode 100644 index 0000000000..8e899d9f47 --- /dev/null +++ b/common/AirQuality/entry/src/main/js/default/pages/second/second.css @@ -0,0 +1,102 @@ +.location { + text-align: center; + color: #000000; + width: 100%; + height: 100%; + font-size: 40px; +} + +.container { + height: 100%; + width: 100%; + flex-direction: column; +} + +.header { + width: 100%; + height: 60px; + align-items: center; +} + +.back { + width: 36px; + height: 36px; + margin-left: 39px; +} + +.title { + width: 296px; + height: 40px; + margin-left: 21px; + color: #e6e6e6; +} + +.chart-list { + width: 100%; + height: 900px; +} + +.list-item-title { + width: 100%; + height: 80px; +} + +.list-item-chart { + width: 100%; + height: 250px; +} + +.chart-wrapper { + width: 47%; + height: 256px; + flex-direction: column; +} + +.chart-wrapper1 { + width: 60%; + height: 256px; + flex-direction: column; +} + +.gas-name { + width: 100%; + height: 35px; + text-align: left; +} + +.chart { + width: 100%; + height: 155px; + margin-top: 10px; + justify-content: flex-start; + align-items: flex-end; +} + +.chart-item { + width: 24px; + margin-left: 18px; + border-radius: 3px; +} + +.white-line { + width: 100%; + height: 2px; + background-color: #ffffff; + margin-top: 22px; +} + +.week { + width: 100%; + height: 40px; + margin-top: 6px; + border-color: #ffffff; + border-radius: 2px; +} + +.day { + width: 26px; + height: 40px; + font-size: 10px; + margin-left: 16px; + text-align: center; +} \ No newline at end of file diff --git a/common/AirQuality/entry/src/main/js/default/pages/second/second.hml b/common/AirQuality/entry/src/main/js/default/pages/second/second.hml new file mode 100644 index 0000000000..9024794c01 --- /dev/null +++ b/common/AirQuality/entry/src/main/js/default/pages/second/second.hml @@ -0,0 +1,133 @@ +
+
+ + 历史记录 +
+ + + {{ location }} + + +
+
+ CO +
+
+
+
+
+
+
+
+
+
+
+ MON + TUE + WED + THU + FRI + SAT + SUN +
+
+
+ SO2 +
+
+
+
+
+
+
+
+
+
+
+ MON + TUE + WED + THU + FRI + SAT + SUN +
+
+
+
+ +
+
+ PM10 +
+
+
+
+
+
+
+
+
+
+
+ MON + TUE + WED + THU + FRI + SAT + SUN +
+
+
+ PM2.5 +
+
+
+
+
+
+
+
+
+
+
+ MON + TUE + WED + THU + FRI + SAT + SUN +
+
+
+
+ +
+
+ NO2 +
+
+
+
+
+
+
+
+
+
+
+ MON + TUE + WED + THU + FRI + SAT + SUN +
+
+
+
+
+
diff --git a/common/AirQuality/entry/src/main/js/default/pages/second/second.js b/common/AirQuality/entry/src/main/js/default/pages/second/second.js new file mode 100644 index 0000000000..6724c3ea48 --- /dev/null +++ b/common/AirQuality/entry/src/main/js/default/pages/second/second.js @@ -0,0 +1,22 @@ +import router from '@system.router' + +export default { + data: { + location: '' + }, + onInit() { + if (this.selectedCityIndex === 0) { + this.location = '东莞'; + } else { + this.location = '深圳'; + } + }, + backMain() { + router.replace({ + uri: 'pages/index/index', + params: { + selectedCityIndex: this.selectedCityIndex + } + }); + } +} diff --git a/common/AirQuality/entry/src/main/resources/base/element/string.json b/common/AirQuality/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000..277fb5384b --- /dev/null +++ b/common/AirQuality/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "AirQuality" + }, + { + "name": "mainability_description", + "value": "JS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/common/AirQuality/entry/src/main/resources/base/media/icon.png b/common/AirQuality/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..1f1899c2d46e2de8a01588efa3168b79cfd173d5 GIT binary patch literal 5598 zcmV<46(Q=0P)HGCvzVH3r z?|r}Jy&wpJAP9mW2!bF8f*=TjAP9mW2!bFK7D`^-ZOe*sRAoMzasiq)4TTyMs?hKN z4!{PO0n^B{DbmDgK^yr+M}7gokHP>N9Y8xMEhyT%#I(0)SaVVYkShC^*AZ2}j>@Oe zmz6rfL%>i)S>Mt zoGlF~q`^%05_O(KV^hfZ0@&5$#x&Fd)Jnq%X*AU~qRweFHVqnA0K1y3n1&9C@e3KE zov3R49L*2+YzmQ!5m;+U*t|Lm_1#%8QCB`r006P)e6S?gH_N<(R zrtCnLHwd{wBNjcM#?ddLQ&YVBe~a-8IgJEV)9-TQ0`0nE4k)s!Q^+;voU+ByG5Rfr zinbO_UjBj+`T=b%upoOez^*1Y%1}SDnME)LF)V?S(ToU<&VZG{AByn{20|t5xI2q6 zfO50cxnL}`8?qyS4}MUEY+x6RN7aaJW>^5`@Jgv`!H}53cO`AkqX;*aN=*v}Wht;c z(=otQsb|5U)F&OyCRKXZ9dkh2F7+%JHx|||V&oe&BEsz=( z49@(_3E))HT0tq0(qon6_iLxc0X)JI}LP_A=a;b9?>-u+dDBPRYXDTx}`HW{epD$`;o^v9V zW*4gR_l|+4X>>)0_{;E7p7k~JoUfUV$Y9>LY2sGB^NumU5a=53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P>b?x z&n}+r*+s3@%XzMGOm$RHVs=n$cHlAD7>ow#{pbrZ!5+2_9OHP%@QI8&(=UJ+C&Xk5 zm)4+<)}RmAo&OJ`kZ>A`WQIWxiJ1s_K}^|~0Rbr6q-KTuK--pn0hptkq+*4U$O$&FBL2p-2XqAIRR*z!~ufQ zc{_6gFq{4$^(z>f7{5=-VM_V}8&`w?i`2A`?*Z^=VgP`BQqO`hHgIK+tfo3bZ>#lIOO$q5HR$RKZz*kqOj0ANy=Nxch(AO%}YE!XG96+3}h z(gH#bd7p)AW{>ut)fAO?GmphZk#7wP@zH=6i2A>j3701~0{Dox?wCU~_AoG8+F3Xa zJ3;vh3s=9NtqbPnZM?#f%Xm>%UJY_?b*I~Zrzd1%e;iFO(TJ_ z>@gl&v;qHvHS}ZVuJz^WCXC~czqPWGn06=d88qsVt;3|OX8!6~rBsF`!5CMA7I0)JXROLw)ta;CfH=17~GOw>F$E3_h(Jla{ zfmVa2Q~@5q0oX=FVj6ii8F5Mv+Q=_DV%$N%4-5e9D72%o2b67?qnnubOG%?I2!bF8 sf*=TjAP9mW2!bF8f*=TjAmoVu1ALuLIN|ResQ>@~07*qoM6N<$g4?{hk^lez literal 0 HcmV?d00001 diff --git a/common/AirQuality/settings.gradle b/common/AirQuality/settings.gradle new file mode 100644 index 0000000000..4773db7323 --- /dev/null +++ b/common/AirQuality/settings.gradle @@ -0,0 +1 @@ +include ':entry' diff --git a/common/DistributeCalc/entry/src/main/js/default/pages/index/index.hml b/common/DistributeCalc/entry/src/main/js/default/pages/index/index.hml index d932563366..19e1120750 100644 --- a/common/DistributeCalc/entry/src/main/js/default/pages/index/index.hml +++ b/common/DistributeCalc/entry/src/main/js/default/pages/index/index.hml @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. --> -
+
-- Gitee From 1d1396988bcbf386b3d673c47988cef1d1c04e80 Mon Sep 17 00:00:00 2001 From: guojin26 Date: Thu, 11 Nov 2021 18:12:44 +0800 Subject: [PATCH 2/5] update Signed-off-by: guojin26 --- .../entry/src/main/js/default/i18n/en-US.json | 9 ++++----- .../entry/src/main/js/default/i18n/zh-CN.json | 9 ++++----- .../src/main/js/default/pages/index/index.hml | 14 +++++++------- .../src/main/js/default/pages/second/second.hml | 2 +- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/common/AirQuality/entry/src/main/js/default/i18n/en-US.json b/common/AirQuality/entry/src/main/js/default/i18n/en-US.json index 08e34eac91..9eb7314a8f 100644 --- a/common/AirQuality/entry/src/main/js/default/i18n/en-US.json +++ b/common/AirQuality/entry/src/main/js/default/i18n/en-US.json @@ -1,10 +1,9 @@ { "strings": { - "hello": "Hello", - "world": "World", - "page": "Second Page", - "next": "Next Page", - "back": "Back" + "title": "AirQuality", + "history": "History record", + "update_time": "Update time: 10: 38", + "source_info": "Information source: tianqi.com" }, "Files": { } diff --git a/common/AirQuality/entry/src/main/js/default/i18n/zh-CN.json b/common/AirQuality/entry/src/main/js/default/i18n/zh-CN.json index 3dd53b3a8b..c7321ad12d 100644 --- a/common/AirQuality/entry/src/main/js/default/i18n/zh-CN.json +++ b/common/AirQuality/entry/src/main/js/default/i18n/zh-CN.json @@ -1,10 +1,9 @@ { "strings": { - "hello": "您好", - "world": "世界", - "page": "第二页", - "next": "下一页", - "back": "返回" + "title": "空气质量", + "history": "历史记录", + "update_time": "更新时间: 10: 38", + "source_info": "信息来源: tianqi.com" }, "Files": { } diff --git a/common/AirQuality/entry/src/main/js/default/pages/index/index.hml b/common/AirQuality/entry/src/main/js/default/pages/index/index.hml index eb2368a6f9..b0ffad0621 100644 --- a/common/AirQuality/entry/src/main/js/default/pages/index/index.hml +++ b/common/AirQuality/entry/src/main/js/default/pages/index/index.hml @@ -1,7 +1,7 @@
- 空气质量 + {{ $t('strings.title') }}
@@ -47,11 +47,11 @@
- +
@@ -94,10 +94,10 @@ 150
- + diff --git a/common/AirQuality/entry/src/main/js/default/pages/second/second.hml b/common/AirQuality/entry/src/main/js/default/pages/second/second.hml index 9024794c01..7a5c03193a 100644 --- a/common/AirQuality/entry/src/main/js/default/pages/second/second.hml +++ b/common/AirQuality/entry/src/main/js/default/pages/second/second.hml @@ -1,7 +1,7 @@
- 历史记录 + {{ $t('strings.title') }}
-- Gitee From 55cba77b2835a5d486e4e424a5a6aafe2d94a611 Mon Sep 17 00:00:00 2001 From: guojin26 Date: Thu, 11 Nov 2021 18:16:54 +0800 Subject: [PATCH 3/5] update Signed-off-by: guojin26 --- .../entry/src/main/js/default/pages/index/index.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/AirQuality/entry/src/main/js/default/pages/index/index.css b/common/AirQuality/entry/src/main/js/default/pages/index/index.css index bab770e4ed..960e2e19ca 100644 --- a/common/AirQuality/entry/src/main/js/default/pages/index/index.css +++ b/common/AirQuality/entry/src/main/js/default/pages/index/index.css @@ -158,13 +158,13 @@ .update-time { width: 100%; color: #A9A9A9; - margin-left: 24px; + text-align: center; } .info-source { width: 100%; color: #A9A9A9; - margin-left: 24px; + text-align: center; } .circle-div { -- Gitee From 7ccb6f1a48af1cfef1cd394c8693c2e21e5ee974 Mon Sep 17 00:00:00 2001 From: guojin26 Date: Thu, 11 Nov 2021 19:07:18 +0800 Subject: [PATCH 4/5] update readme Signed-off-by: guojin26 --- common/AirQuality/README_zh.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/common/AirQuality/README_zh.md b/common/AirQuality/README_zh.md index 79b1d189cb..f91adb7c17 100644 --- a/common/AirQuality/README_zh.md +++ b/common/AirQuality/README_zh.md @@ -8,9 +8,7 @@ - 点击桌面应用图标,启动应用; - 在首页展示空气质量信息,左右滑动可以切换城市; -- 点击历史记录可以跳转到历史记录页面,此界面用柱形图展示历史记录; - - +- 点击历史记录可以跳转到历史记录页面,此界面用柱形图展示历史记录; ### 约束与限制 -- Gitee From 43362d4ecc89538f915125f6a2361197a457b822 Mon Sep 17 00:00:00 2001 From: guojin26 Date: Mon, 15 Nov 2021 08:53:12 +0800 Subject: [PATCH 5/5] add LICENSE Signed-off-by: guojin26 --- common/AirQuality/entry/src/main/js/default/app.js | 14 ++++++++++++++ .../src/main/js/default/pages/index/index.css | 14 ++++++++++++++ .../src/main/js/default/pages/index/index.hml | 14 ++++++++++++++ .../entry/src/main/js/default/pages/index/index.js | 14 ++++++++++++++ .../src/main/js/default/pages/second/second.css | 14 ++++++++++++++ .../src/main/js/default/pages/second/second.hml | 14 ++++++++++++++ .../src/main/js/default/pages/second/second.js | 14 ++++++++++++++ 7 files changed, 98 insertions(+) diff --git a/common/AirQuality/entry/src/main/js/default/app.js b/common/AirQuality/entry/src/main/js/default/app.js index 6d060ffe56..50449ecbed 100644 --- a/common/AirQuality/entry/src/main/js/default/app.js +++ b/common/AirQuality/entry/src/main/js/default/app.js @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ export default { onCreate() { console.info("Application onCreate"); diff --git a/common/AirQuality/entry/src/main/js/default/pages/index/index.css b/common/AirQuality/entry/src/main/js/default/pages/index/index.css index 960e2e19ca..c385c66236 100644 --- a/common/AirQuality/entry/src/main/js/default/pages/index/index.css +++ b/common/AirQuality/entry/src/main/js/default/pages/index/index.css @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ .aqi-value { text-align: center; font-size: 40px; diff --git a/common/AirQuality/entry/src/main/js/default/pages/index/index.hml b/common/AirQuality/entry/src/main/js/default/pages/index/index.hml index b0ffad0621..02620f661c 100644 --- a/common/AirQuality/entry/src/main/js/default/pages/index/index.hml +++ b/common/AirQuality/entry/src/main/js/default/pages/index/index.hml @@ -1,3 +1,17 @@ +
diff --git a/common/AirQuality/entry/src/main/js/default/pages/index/index.js b/common/AirQuality/entry/src/main/js/default/pages/index/index.js index c24880a71f..f18ece7f11 100644 --- a/common/AirQuality/entry/src/main/js/default/pages/index/index.js +++ b/common/AirQuality/entry/src/main/js/default/pages/index/index.js @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ import router from '@system.router'; import app from '@system.app'; diff --git a/common/AirQuality/entry/src/main/js/default/pages/second/second.css b/common/AirQuality/entry/src/main/js/default/pages/second/second.css index 8e899d9f47..289345c63a 100644 --- a/common/AirQuality/entry/src/main/js/default/pages/second/second.css +++ b/common/AirQuality/entry/src/main/js/default/pages/second/second.css @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ .location { text-align: center; color: #000000; diff --git a/common/AirQuality/entry/src/main/js/default/pages/second/second.hml b/common/AirQuality/entry/src/main/js/default/pages/second/second.hml index 7a5c03193a..6d0e315e60 100644 --- a/common/AirQuality/entry/src/main/js/default/pages/second/second.hml +++ b/common/AirQuality/entry/src/main/js/default/pages/second/second.hml @@ -1,3 +1,17 @@ +
diff --git a/common/AirQuality/entry/src/main/js/default/pages/second/second.js b/common/AirQuality/entry/src/main/js/default/pages/second/second.js index 6724c3ea48..1912cea0dc 100644 --- a/common/AirQuality/entry/src/main/js/default/pages/second/second.js +++ b/common/AirQuality/entry/src/main/js/default/pages/second/second.js @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ import router from '@system.router' export default { -- Gitee