diff --git a/PageAndData01/01_Complete/AppScope/app.json5 b/PageAndData01/01_Complete/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..45b006b30ea74629e4219a71a70b74840df4ba82 --- /dev/null +++ b/PageAndData01/01_Complete/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.pageanddata", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/PageAndData01/01_Complete/AppScope/resources/base/element/string.json b/PageAndData01/01_Complete/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..594cc44fec10161d4efeae095baef27280a0c27f --- /dev/null +++ b/PageAndData01/01_Complete/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "PageAndData" + } + ] +} diff --git a/PageAndData01/01_Complete/AppScope/resources/base/media/app_icon.png b/PageAndData01/01_Complete/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/PageAndData01/01_Complete/AppScope/resources/base/media/app_icon.png differ diff --git a/PageAndData01/01_Complete/LICENSE b/PageAndData01/01_Complete/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..381eb507bc1eef9b5158e496dedab769e810b657 --- /dev/null +++ b/PageAndData01/01_Complete/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2022 Huawei Device Co., Ltd. All rights reserved. + + 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. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/PageAndData01/01_Complete/build-profile.json5 b/PageAndData01/01_Complete/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..c2b7ef27c250d201ac7d301c5183b34e51ac7a08 --- /dev/null +++ b/PageAndData01/01_Complete/build-profile.json5 @@ -0,0 +1,29 @@ +{ + "app": { + "signingConfigs": [ + + ], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "5.0.0(12)", + "runtimeOS": "HarmonyOS" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/PageAndData01/01_Complete/entry/build-profile.json5 b/PageAndData01/01_Complete/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..20c75049f2d45e57d267899b6547c79fb6aa84c1 --- /dev/null +++ b/PageAndData01/01_Complete/entry/build-profile.json5 @@ -0,0 +1,14 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + "runtimeOS": "HarmonyOS" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/PageAndData01/01_Complete/entry/hvigorfile.ts b/PageAndData01/01_Complete/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/PageAndData01/01_Complete/entry/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { hapTasks } from '@ohos/hvigor-ohos-plugin'; diff --git a/PageAndData01/01_Complete/entry/oh-package.json5 b/PageAndData01/01_Complete/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..19b9234a98d43a4711a0fc32cef604159228d3cd --- /dev/null +++ b/PageAndData01/01_Complete/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "license": "", + "devDependencies": {}, + "author": "", + "name": "entry", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} \ No newline at end of file diff --git a/PageAndData01/01_Complete/entry/src/main/ets/entryability/EntryAbility.ets b/PageAndData01/01_Complete/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..b7afa85923ac1d6d938836cbffb7b486ed002b93 --- /dev/null +++ b/PageAndData01/01_Complete/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2024 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 { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { window } from '@kit.ArkUI'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + +/** + * Lift cycle management of Ability. + */ +export default class entryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); + } + + onDestroy(): void | Promise { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + windowStage.getMainWindow().then((data: window.Window) => { + // Window immersive. + data.setWindowLayoutFullScreen(true); + }); + windowStage.loadContent('pages/LoginPage', (err, data) => { + if (err.code) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} \ No newline at end of file diff --git a/PageAndData01/01_Complete/entry/src/main/ets/pages/LoginPage.ets b/PageAndData01/01_Complete/entry/src/main/ets/pages/LoginPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..b59332de27ba50ee5f23795ac6df2f157dd81e17 --- /dev/null +++ b/PageAndData01/01_Complete/entry/src/main/ets/pages/LoginPage.ets @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2024 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. + */ + +@Extend(TextInput) +function inputStyle() { + .placeholderColor('#99182431') + .height('45vp') + .fontSize('18fp') + .backgroundColor('#F1F3F5') + .width('328vp') + .margin({ top: 12 }) +} + +@Extend(Line) +function lineStyle() { + .width('328vp') + .height('1vp') + .backgroundColor('#33182431') +} + +@Extend(Text) +function blueTextStyle() { + .fontColor('#007DFF') + .fontSize('14fp') + .fontWeight(FontWeight.Medium) +} + +/** + * Login page + */ +@Entry +@Component +struct LoginPage { + @Builder + imageButton(src: Resource) { + Button({ type: ButtonType.Circle, stateEffect: true }) { + Image(src) + } + .height('48vp') + .width('48vp') + .backgroundColor('#F1F3F5') + } + + build() { + Column() { + Image($r('app.media.logo')) + .width('78vp') + .height('78vp') + .margin({ + top: '150vp', + bottom: '8vp' + }) + Text($r('app.string.login_page')) + .fontSize('24fp') + .fontWeight(FontWeight.Medium) + .fontColor('#182431') + Text($r('app.string.login_more')) + .fontSize('16fp') + .fontColor('#99182431') + .margin({ + bottom: '30vp', + top: '8vp' + }) + + TextInput({ placeholder: $r('app.string.account') }) + .maxLength(11) + .type(InputType.Number) + .inputStyle() + Line() + .lineStyle() + + TextInput({ placeholder: $r('app.string.password') }) + .maxLength(8) + .type(InputType.Password) + .inputStyle() + Line() + .lineStyle() + + Row() { + Text($r('app.string.message_login')) + .blueTextStyle() + Text($r('app.string.forgot_password')) + .blueTextStyle() + } + .justifyContent(FlexAlign.SpaceBetween) + .width('328vp') + .margin({ top: '8vp' }) + + Button($r('app.string.login'), { type: ButtonType.Capsule }) + .width('328vp') + .height('40vp') + .fontSize('16fp') + .fontWeight(FontWeight.Medium) + .backgroundColor('#007DFF') + .margin({ + top: '48vp', + bottom: '12vp' + }) + + Text($r('app.string.register_account')) + .fontColor('#007DFF') + .fontSize('16fp') + .fontWeight(FontWeight.Medium) + + Blank() + Text($r('app.string.other_login_method')) + .fontColor('#838D97') + .fontSize('12fp') + .fontWeight(FontWeight.Medium) + .margin({ + top: '50vp', + bottom: '12vp' + }) + Row({ space: 44 }) { + this.imageButton($r('app.media.login_method1')) + this.imageButton($r('app.media.login_method2')) + this.imageButton($r('app.media.login_method3')) + } + .margin({ bottom: '16vp' }) + } + .padding({ + left: '12vp', + right: '12vp', + bottom: '24vp' + }) + .backgroundColor('#F1F3F5') + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/PageAndData01/01_Complete/entry/src/main/module.json5 b/PageAndData01/01_Complete/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..1fa3a18a9c72cebd1c9f90618abefaed11d329e4 --- /dev/null +++ b/PageAndData01/01_Complete/entry/src/main/module.json5 @@ -0,0 +1,36 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ets", + "description": "$string:EntryAbility_desc", + "icon": "$media:startIcon", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/PageAndData01/01_Complete/entry/src/main/resources/base/element/color.json b/PageAndData01/01_Complete/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..2b713164d8fd7c5053a1af4809507f13410e05a6 --- /dev/null +++ b/PageAndData01/01_Complete/entry/src/main/resources/base/element/color.json @@ -0,0 +1,80 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "white", + "value": "#FFFFFF" + }, + { + "name": "background", + "value": "#F1F3F5" + }, + { + "name": "title_text_color", + "value": "#182431" + }, + { + "name": "login_more_text_color", + "value": "#99182431" + }, + { + "name": "placeholder_color", + "value": "#99182431" + }, + { + "name": "line_color", + "value": "#33182431" + }, + { + "name": "login_button_color", + "value": "#007DFF" + }, + { + "name": "login_blue_text_color", + "value": "#007DFF" + }, + { + "name": "other_login_text_color", + "value": "#838D97" + }, + { + "name": "loading_color", + "value": "#182431" + }, + { + "name": "mainPage_selected", + "value": "#1698CE" + }, + { + "name": "mainPage_normal", + "value": "#6B6B6B" + }, + { + "name": "mainPage_backgroundColor", + "value": "#F1F3F5" + }, + { + "name": "home_grid_fontColor", + "value": "#99182431" + }, + { + "name": "setting_button_backgroundColor", + "value": "#E5E8EA" + }, + { + "name": "setting_button_fontColor", + "value": "#FA2A2D" + }, + { + "name": "grid_linear_start", + "value": "#1a0a5918" + }, + { + "name": "grid_linear_end", + "value": "#ffffff" + } + ] +} \ No newline at end of file diff --git a/PageAndData01/01_Complete/entry/src/main/resources/base/element/float.json b/PageAndData01/01_Complete/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..19ba0e188d1786b004c41f6ee067844629fe3502 --- /dev/null +++ b/PageAndData01/01_Complete/entry/src/main/resources/base/element/float.json @@ -0,0 +1,292 @@ +{ + "float": [ + { + "name": "logo_image_size", + "value": "78vp" + }, + { + "name": "logo_margin_top", + "value": "100vp" + }, + { + "name": "logo_margin_bottom", + "value": "8vp" + }, + { + "name": "page_title_text_size", + "value": "24fp" + }, + { + "name": "normal_text_size", + "value": "16fp" + }, + { + "name": "big_text_size", + "value": "18fp" + }, + { + "name": "small_text_size", + "value": "14fp" + }, + { + "name": "little_text_size", + "value": "12fp" + }, + { + "name": "login_more_margin_bottom", + "value": "30vp" + }, + { + "name": "login_more_margin_top", + "value": "8vp" + }, + { + "name": "login_input_height", + "value": "45vp" + }, + { + "name": "forgot_margin_top", + "value": "8vp" + }, + { + "name": "input_margin_top", + "value": "12vp" + }, + { + "name": "line_height", + "value": "1vp" + }, + { + "name": "login_button_height", + "value": "40vp" + }, + { + "name": "login_button_margin_top", + "value": "87vp" + }, + { + "name": "login_button_margin_bottom", + "value": "12vp" + }, + { + "name": "vertical_line_margin", + "value": "15vp" + }, + { + "name": "login_progress_size", + "value": "30vp" + }, + { + "name": "login_progress_margin_top", + "value": "20vp" + }, + { + "name": "other_login_margin_top", + "value": "50vp" + }, + { + "name": "other_login_margin_bottom", + "value": "12vp" + }, + { + "name": "login_page_padding_bottom", + "value": "24vp" + }, + { + "name": "other_login_image_size", + "value": "48vp" + }, + { + "name": "page_padding_hor", + "value": "12vp" + }, + { + "name": "mainPage_baseTab_top", + "value": "4vp" + }, + { + "name": "mainPage_baseTab_margin", + "value": "8vp" + }, + { + "name": "mainPage_padding", + "value": "12vp" + }, + { + "name": "mainPage_barHeight", + "value": "56vp" + }, + { + "name": "mainPage_baseTab_size", + "value": "25vp" + }, + { + "name": "main_tab_fontSize", + "value": "10fp" + }, + { + "name": "mainPage_tabTitles_margin", + "value": "12vp" + }, + { + "name": "mainPage_tabTitles_padding", + "value": "12vp" + }, + { + "name": "home_swiper_borderRadius", + "value": "16vp" + }, + { + "name": "home_swiper_margin", + "value": "24vp" + }, + { + "name": "home_grid_columnsGap", + "value": "8vp" + }, + { + "name": "home_grid_rowGap", + "value": "12vp" + }, + { + "name": "home_grid_padding", + "value": "12vp" + }, + { + "name": "home_grid_height", + "value": "124vp" + }, + { + "name": "home_grid_margin", + "value": "10vp" + }, + { + "name": "home_list_margin", + "value": "4vp" + }, + { + "name": "home_list_padding", + "value": "8vp" + }, + { + "name": "home_grid_borderRadius", + "value": "24vp" + }, + { + "name": "home_text_margin", + "value": "12vp" + }, + { + "name": "home_backgroundImage_borderRadius", + "value": "12vp" + }, + { + "name": "home_secondGrid_height", + "value": "260vp" + }, + { + "name": "home_secondGrid_margin", + "value": "10vp" + }, + { + "name": "home_homeCell_size", + "value": "24vp" + }, + { + "name": "home_homeCell_margin", + "value": "4vp" + }, + { + "name": "home_homeCell_width", + "value": "80vp" + }, + { + "name": "home_homeCell_height", + "value": "80vp" + }, + { + "name": "setting_name_margin", + "value": "4vp" + }, + { + "name": "setting_account_margin", + "value": "24vp" + }, + { + "name": "setting_account_size", + "value": "48vp" + }, + { + "name": "setting_account_fontSize", + "value": "20fp" + }, + { + "name": "setting_account_text_height", + "value": "28vp" + }, + { + "name": "setting_account_height", + "value": "96vp" + }, + { + "name": "setting_account_padding", + "value": "24vp" + }, + { + "name": "setting_account_borderRadius", + "value": "16vp" + }, + { + "name": "setting_list_height", + "value": "48vp" + }, + { + "name": "setting_list_padding", + "value": "4vp" + }, + { + "name": "setting_list_borderRadius", + "value": "16vp" + }, + { + "name": "setting_list_startMargin", + "value": "42vp" + }, + { + "name": "setting_list_endMargin", + "value": "24vp" + }, + { + "name": "setting_list_strokeWidth", + "value": "0.25vp" + }, + { + "name": "setting_button_bottom", + "value": "55vp" + }, + { + "name": "setting_size", + "value": "22vp" + }, + { + "name": "setting_padding", + "value": "10vp" + }, + { + "name": "setting_jump_width", + "value": "12vp" + }, + { + "name": "setting_jump_height", + "value": "24vp" + }, + { + "name": "setting_settingCell_left", + "value": "8vp" + }, + { + "name": "setting_settingCell_right", + "value": "22vp" + } + ] +} \ No newline at end of file diff --git a/PageAndData01/01_Complete/entry/src/main/resources/base/element/string.json b/PageAndData01/01_Complete/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..c7b4788cf0cf49b8968e0059e28a9daba9b8d82f --- /dev/null +++ b/PageAndData01/01_Complete/entry/src/main/resources/base/element/string.json @@ -0,0 +1,64 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "PageAndData" + }, + { + "name": "login_page", + "value": "Login page" + }, + { + "name": "login_more", + "value": "Log in to your account to use more services" + }, + { + "name": "account", + "value": "Account" + }, + { + "name": "password", + "value": "Password" + }, + { + "name": "login", + "value": "Log in" + }, + { + "name": "register_account", + "value": "Registering an Account" + }, + { + "name": "forgot_password", + "value": "Forgot Password" + }, + { + "name": "message_login", + "value": "SMS verification code login" + }, + { + "name": "other_login_method", + "value": "Other login methods" + }, + { + "name": "vertical_line", + "value": " | " + }, + { + "name": "input_empty_tips", + "value": "The input cannot be empty." + }, + { + "name": "login_success", + "value": "The login is successful." + } + ] +} \ No newline at end of file diff --git a/PageAndData01/01_Complete/entry/src/main/resources/base/media/icon.png b/PageAndData01/01_Complete/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/PageAndData01/01_Complete/entry/src/main/resources/base/media/icon.png differ diff --git a/PageAndData01/01_Complete/entry/src/main/resources/base/media/login_method1.png b/PageAndData01/01_Complete/entry/src/main/resources/base/media/login_method1.png new file mode 100644 index 0000000000000000000000000000000000000000..a7b47f2ea5723f81684506765ed437d6684f8184 Binary files /dev/null and b/PageAndData01/01_Complete/entry/src/main/resources/base/media/login_method1.png differ diff --git a/PageAndData01/01_Complete/entry/src/main/resources/base/media/login_method2.png b/PageAndData01/01_Complete/entry/src/main/resources/base/media/login_method2.png new file mode 100644 index 0000000000000000000000000000000000000000..320e9a5038da6fb9bdc201ed7675d4d4ad1a0c99 Binary files /dev/null and b/PageAndData01/01_Complete/entry/src/main/resources/base/media/login_method2.png differ diff --git a/PageAndData01/01_Complete/entry/src/main/resources/base/media/login_method3.png b/PageAndData01/01_Complete/entry/src/main/resources/base/media/login_method3.png new file mode 100644 index 0000000000000000000000000000000000000000..28ac6ec8669b5634df443b10a4ced8f9c7e8a5c7 Binary files /dev/null and b/PageAndData01/01_Complete/entry/src/main/resources/base/media/login_method3.png differ diff --git a/PageAndData01/01_Complete/entry/src/main/resources/base/media/logo.png b/PageAndData01/01_Complete/entry/src/main/resources/base/media/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..1dcac2208bef8df6893357ec8d43fdd6ee6763f7 Binary files /dev/null and b/PageAndData01/01_Complete/entry/src/main/resources/base/media/logo.png differ diff --git a/PageAndData01/01_Complete/entry/src/main/resources/base/media/startIcon.png b/PageAndData01/01_Complete/entry/src/main/resources/base/media/startIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b Binary files /dev/null and b/PageAndData01/01_Complete/entry/src/main/resources/base/media/startIcon.png differ diff --git a/PageAndData01/01_Complete/entry/src/main/resources/base/profile/main_pages.json b/PageAndData01/01_Complete/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..85a3c19566d76790ce243e498c48f665ce4008e5 --- /dev/null +++ b/PageAndData01/01_Complete/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/LoginPage" + ] +} \ No newline at end of file diff --git a/PageAndData01/01_Complete/entry/src/main/resources/en_US/element/string.json b/PageAndData01/01_Complete/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..c7b4788cf0cf49b8968e0059e28a9daba9b8d82f --- /dev/null +++ b/PageAndData01/01_Complete/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,64 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "PageAndData" + }, + { + "name": "login_page", + "value": "Login page" + }, + { + "name": "login_more", + "value": "Log in to your account to use more services" + }, + { + "name": "account", + "value": "Account" + }, + { + "name": "password", + "value": "Password" + }, + { + "name": "login", + "value": "Log in" + }, + { + "name": "register_account", + "value": "Registering an Account" + }, + { + "name": "forgot_password", + "value": "Forgot Password" + }, + { + "name": "message_login", + "value": "SMS verification code login" + }, + { + "name": "other_login_method", + "value": "Other login methods" + }, + { + "name": "vertical_line", + "value": " | " + }, + { + "name": "input_empty_tips", + "value": "The input cannot be empty." + }, + { + "name": "login_success", + "value": "The login is successful." + } + ] +} \ No newline at end of file diff --git a/PageAndData01/01_Complete/entry/src/main/resources/zh_CN/element/string.json b/PageAndData01/01_Complete/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..65c2b3089a03000882f83d9fe62a89ed96fcfd9b --- /dev/null +++ b/PageAndData01/01_Complete/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,64 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "PageAndData" + }, + { + "name": "login_page", + "value": "登录界面" + }, + { + "name": "login_more", + "value": "登录账号以使用更多服务" + }, + { + "name": "account", + "value": "账号" + }, + { + "name": "password", + "value": "密码" + }, + { + "name": "login", + "value": "登录" + }, + { + "name": "register_account", + "value": "注册账号" + }, + { + "name": "forgot_password", + "value": "忘记密码" + }, + { + "name": "message_login", + "value": "短信验证码登录" + }, + { + "name": "other_login_method", + "value": "其他登录方式" + }, + { + "name": "vertical_line", + "value": " | " + }, + { + "name": "input_empty_tips", + "value": "输入不能为空" + }, + { + "name": "login_success", + "value": "登录成功" + } + ] +} \ No newline at end of file diff --git a/PageAndData01/01_Complete/hvigor/hvigor-config.json5 b/PageAndData01/01_Complete/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..73bfab4e997c8d4aea53b22fdd7f10112b30987f --- /dev/null +++ b/PageAndData01/01_Complete/hvigor/hvigor-config.json5 @@ -0,0 +1,17 @@ +{ + "modelVersion": "5.0.0", + "dependencies": { + }, + "execution": { + // "daemon": true, /* Enable daemon compilation. Default: true */ + // "incremental": true, /* Enable incremental compilation. Default: true */ + // "parallel": true, /* Enable parallel compilation. Default: true */ + // "typeCheck": false, /* Enable typeCheck. Default: false */ + }, + "logging": { + // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */ + }, + "debugging": { + // "stacktrace": false /* Disable stacktrace compilation. Default: false */ + } +} \ No newline at end of file diff --git a/PageAndData01/01_Complete/hvigorfile.ts b/PageAndData01/01_Complete/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/PageAndData01/01_Complete/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/PageAndData01/01_Complete/oh-package.json5 b/PageAndData01/01_Complete/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ba334a33e0ef0989bb410985996742da64bceda1 --- /dev/null +++ b/PageAndData01/01_Complete/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "modelVersion": "5.0.0", + "license": "", + "devDependencies": { + }, + "author": "", + "name": "arktscomponents", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} \ No newline at end of file diff --git a/PageAndData01/01_Resources/login_method1.png b/PageAndData01/01_Resources/login_method1.png new file mode 100644 index 0000000000000000000000000000000000000000..a7b47f2ea5723f81684506765ed437d6684f8184 Binary files /dev/null and b/PageAndData01/01_Resources/login_method1.png differ diff --git a/PageAndData01/01_Resources/login_method2.png b/PageAndData01/01_Resources/login_method2.png new file mode 100644 index 0000000000000000000000000000000000000000..320e9a5038da6fb9bdc201ed7675d4d4ad1a0c99 Binary files /dev/null and b/PageAndData01/01_Resources/login_method2.png differ diff --git a/PageAndData01/01_Resources/login_method3.png b/PageAndData01/01_Resources/login_method3.png new file mode 100644 index 0000000000000000000000000000000000000000..28ac6ec8669b5634df443b10a4ced8f9c7e8a5c7 Binary files /dev/null and b/PageAndData01/01_Resources/login_method3.png differ diff --git a/PageAndData01/01_Resources/logo.png b/PageAndData01/01_Resources/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..1dcac2208bef8df6893357ec8d43fdd6ee6763f7 Binary files /dev/null and b/PageAndData01/01_Resources/logo.png differ diff --git a/PageAndData01/README.md b/PageAndData01/README.md new file mode 100644 index 0000000000000000000000000000000000000000..dddab5721ff491e20d8f1b01ade528994221fedc --- /dev/null +++ b/PageAndData01/README.md @@ -0,0 +1,5 @@ +根据【页面与数据:从简单页面开始】教程创建全新的项目。 + +根据教程中的提示使用01_Resources文件夹中的文件。 + +如果您想要自行探索,可以直接打开01_Complete文件夹中的项目并浏览代码。 \ No newline at end of file diff --git a/PageAndData02/02_Complete/AppScope/app.json5 b/PageAndData02/02_Complete/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..45b006b30ea74629e4219a71a70b74840df4ba82 --- /dev/null +++ b/PageAndData02/02_Complete/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.pageanddata", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/PageAndData02/02_Complete/AppScope/resources/base/element/string.json b/PageAndData02/02_Complete/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..594cc44fec10161d4efeae095baef27280a0c27f --- /dev/null +++ b/PageAndData02/02_Complete/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "PageAndData" + } + ] +} diff --git a/PageAndData02/02_Complete/AppScope/resources/base/media/app_icon.png b/PageAndData02/02_Complete/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/PageAndData02/02_Complete/AppScope/resources/base/media/app_icon.png differ diff --git a/PageAndData02/02_Complete/LICENSE b/PageAndData02/02_Complete/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..381eb507bc1eef9b5158e496dedab769e810b657 --- /dev/null +++ b/PageAndData02/02_Complete/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2022 Huawei Device Co., Ltd. All rights reserved. + + 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. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/PageAndData02/02_Complete/build-profile.json5 b/PageAndData02/02_Complete/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..7d4d5dfbbecc20e238fab96a718d57a7b0b4327a --- /dev/null +++ b/PageAndData02/02_Complete/build-profile.json5 @@ -0,0 +1,29 @@ +{ + "app": { + "signingConfigs": [ + + ], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "5.0.0(12)", + "runtimeOS": "HarmonyOS" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/PageAndData02/02_Complete/entry/build-profile.json5 b/PageAndData02/02_Complete/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..20c75049f2d45e57d267899b6547c79fb6aa84c1 --- /dev/null +++ b/PageAndData02/02_Complete/entry/build-profile.json5 @@ -0,0 +1,14 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + "runtimeOS": "HarmonyOS" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/PageAndData02/02_Complete/entry/hvigorfile.ts b/PageAndData02/02_Complete/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/PageAndData02/02_Complete/entry/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { hapTasks } from '@ohos/hvigor-ohos-plugin'; diff --git a/PageAndData02/02_Complete/entry/oh-package.json5 b/PageAndData02/02_Complete/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..19b9234a98d43a4711a0fc32cef604159228d3cd --- /dev/null +++ b/PageAndData02/02_Complete/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "license": "", + "devDependencies": {}, + "author": "", + "name": "entry", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} \ No newline at end of file diff --git a/PageAndData02/02_Complete/entry/src/main/ets/entryability/EntryAbility.ets b/PageAndData02/02_Complete/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..e9517cfe27b427b2164b91e5e7783cddf0ba11bb --- /dev/null +++ b/PageAndData02/02_Complete/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2024 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 { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { window } from '@kit.ArkUI'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + +/** + * Lift cycle management of Ability. + */ +export default class entryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); + } + + onDestroy(): void | Promise { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + windowStage.getMainWindow().then((data: window.Window) => { + // Window immersive. + data.setWindowLayoutFullScreen(true); + }) + windowStage.loadContent('pages/LoginPage', (err, data) => { + if (err.code) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} \ No newline at end of file diff --git a/PageAndData02/02_Complete/entry/src/main/ets/pages/LoginPage.ets b/PageAndData02/02_Complete/entry/src/main/ets/pages/LoginPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..ed7ca09bf6780a55e749a52a70fa5a2561ec5ecb --- /dev/null +++ b/PageAndData02/02_Complete/entry/src/main/ets/pages/LoginPage.ets @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2024 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 { promptAction } from '@kit.ArkUI'; +import { MainPage } from './MainPage'; + +@Extend(TextInput) +function inputStyle() { + .placeholderColor('#99182431') + .height('45vp') + .fontSize('18fp') + .backgroundColor('#F1F3F5') + .width('328vp') + .margin({ top: 12 }) +} + +@Extend(Line) +function lineStyle() { + .width('328vp') + .height('1vp') + .backgroundColor('#33182431') +} + +@Extend(Text) +function blueTextStyle() { + .fontColor('#007DFF') + .fontSize('14fp') + .fontWeight(FontWeight.Medium) +} + +/** + * Login page + */ +@Entry +@Component +struct LoginPage { + @State account: string = ''; + @State password: string = ''; + @State isShowProgress: boolean = false; + private timeOutId: number = -1; + pathStack: NavPathStack = new NavPathStack(); + + @Builder + imageButton(src: Resource) { + Button({ type: ButtonType.Circle, stateEffect: true }) { + Image(src) + } + .height('48vp') + .width('48vp') + .backgroundColor('#F1F3F5') + } + + login(result: boolean): void { + if (this.account === '' || this.password === '') { + promptAction.showToast({ + message: $r('app.string.input_empty_tips') + }) + } else { + this.isShowProgress = true; + if (this.timeOutId === -1) { + this.timeOutId = setTimeout(() => { + this.isShowProgress = false; + this.timeOutId = -1; + this.pathStack.pushPathByName('MainPage', null); + }, 2000); + } + } + } + + aboutToDisappear() { + clearTimeout(this.timeOutId); + this.timeOutId = -1; + } + + build() { + Navigation(this.pathStack) { + Column() { + Image($r('app.media.logo')) + .width('78vp') + .height('78vp') + .margin({ + top: '150vp', + bottom: '8vp' + }) + Text($r('app.string.login_page')) + .fontSize('24fp') + .fontWeight(FontWeight.Medium) + .fontColor('#182431') + Text($r('app.string.login_more')) + .fontSize('16fp') + .fontColor('#99182431') + .margin({ + bottom: '30vp', + top: '8vp' + }) + + TextInput({ placeholder: $r('app.string.account') }) + .maxLength(11) + .type(InputType.Number) + .inputStyle() + .onChange((value: string) => { + this.account = value; + }) + Line() + .lineStyle() + + TextInput({ placeholder: $r('app.string.password') }) + .maxLength(8) + .type(InputType.Password) + .inputStyle() + .onChange((value: string) => { + this.password = value; + }) + Line() + .lineStyle() + + Row() { + Text($r('app.string.message_login')) + .blueTextStyle() + Text($r('app.string.forgot_password')) + .blueTextStyle() + } + .justifyContent(FlexAlign.SpaceBetween) + .width('328vp') + .margin({ top: '8vp' }) + + Button($r('app.string.login'), { type: ButtonType.Capsule }) + .width('328vp') + .height('40vp') + .fontSize('16fp') + .fontWeight(FontWeight.Medium) + .backgroundColor('#007DFF') + .margin({ + top: '48vp', + bottom: '12vp' + }) + .onClick(() => { + this.login(true); + }) + Text($r('app.string.register_account')) + .fontColor('#007DFF') + .fontSize('16fp') + .fontWeight(FontWeight.Medium) + + if (this.isShowProgress) { + LoadingProgress() + .color('#182431') + .width('30vp') + .height('30vp') + .margin({ top: '20vp' }) + } + + Blank() + Text($r('app.string.other_login_method')) + .fontColor('#838D97') + .fontSize('12fp') + .fontWeight(FontWeight.Medium) + .margin({ + top: '50vp', + bottom: '12vp' + }) + Row({ space: 44 }) { + this.imageButton($r('app.media.login_method1')) + this.imageButton($r('app.media.login_method2')) + this.imageButton($r('app.media.login_method3')) + } + .margin({ bottom: '16vp' }) + } + .height('100%') + .width('100%') + .padding({ + left: '12vp', + right: '12vp', + bottom: '24vp' + }) + } + .backgroundColor('#F1F3F5') + .width('100%') + .height('100%') + .hideTitleBar(true) + .hideToolBar(true) + } +} \ No newline at end of file diff --git a/PageAndData02/02_Complete/entry/src/main/ets/pages/MainPage.ets b/PageAndData02/02_Complete/entry/src/main/ets/pages/MainPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..2e57ca76f03853ee02bd88aa8724899761ad31bd --- /dev/null +++ b/PageAndData02/02_Complete/entry/src/main/ets/pages/MainPage.ets @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2024 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 Home from "../view/Home"; +import Setting from "../view/Setting"; + +@Builder +export function MainPageBuilder() { + MainPage() +} + +/** + * Main page + */ +@Component +export struct MainPage { + @State currentIndex: number = 0; + private tabsController: TabsController = new TabsController(); + + @Builder + TabBuilder(title: Resource, index: number, selectedImg: Resource) { + Column() { + SymbolGlyph(selectedImg) + .fontSize('24fp') + .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_OPACITY) + .symbolEffect(new BounceSymbolEffect(EffectScope.WHOLE, EffectDirection.UP), + this.currentIndex === index ? true : false) + .fontColor(this.currentIndex === index ? ['#0a59f7'] : ['#66000000']) + Text(title) + .margin({ top: '4vp' }) + .fontSize(10) + .fontWeight(500) + .fontColor(this.currentIndex === index ? '#0a59f7' : '#66000000') + } + .backgroundColor('#F1F3F5') + .justifyContent(FlexAlign.Center) + .height('56vp') + .width('100%') + .onClick(() => { + this.currentIndex = index; + this.tabsController.changeIndex(this.currentIndex); + }) + } + + build() { + NavDestination() { + Tabs({ + barPosition: BarPosition.End, + controller: this.tabsController + }) { + TabContent() { + Home() + } + .padding({ + left: '12vp', + right: '12vp' + }) + .backgroundColor('#F1F3F5') + .tabBar(this.TabBuilder($r('app.string.Tab_Bar_One'), 0, $r('sys.symbol.house_fill'))) + + TabContent() { + Setting() + } + .padding({ + left: '12vp', + right: '12vp' + }) + .backgroundColor('#F1F3F5') + .tabBar(this.TabBuilder($r('app.string.Tab_Bar_Two'), 1, $r('sys.symbol.person_crop_circle_fill_1'))) + } + .margin({ bottom: '64vp' }) + .width('100%') + .height('100%') + .barHeight('80vp') + .barMode(BarMode.Fixed) + .onChange((index: number) => { + this.currentIndex = index; + }) + } + .height('100%') + .hideTitleBar(true) + .backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/PageAndData02/02_Complete/entry/src/main/ets/view/Home.ets b/PageAndData02/02_Complete/entry/src/main/ets/view/Home.ets new file mode 100644 index 0000000000000000000000000000000000000000..0c568c3efc3792c2f40575192fcbb450856e898f --- /dev/null +++ b/PageAndData02/02_Complete/entry/src/main/ets/view/Home.ets @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2024 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 mainViewModel from '../viewmodel/MainViewModel'; +import ItemData from '../viewmodel/ItemData'; + +/** + * Home tab content + */ +@Component +export default struct Home { + private swiperController: SwiperController = new SwiperController(); + + build() { + Column() { + Text($r('app.string.mainPage_tabTitles_home')) + .width('100%') + .margin({ + top: '48vp', + bottom: '12vp' + }) + .fontWeight(700) + .fontSize('26fp') + + Scroll() { + Column() { + Swiper(this.swiperController) { + ForEach(mainViewModel.getSwiperImages(), (img: Resource) => { + Image(img) + .width('100%') + .borderRadius('16fp') + }, (img: Resource) => JSON.stringify(img.id)) + } + .autoPlay(true) + + Grid() { + ForEach(mainViewModel.getFirstGridData(), (item: ItemData, index: number) => { + GridItem() { + Column() { + Image(item.img) + .width('40vp') + .height('40vp') + Text(item.title) + .fontSize('12fp') + .margin({ top: '4vp' }) + } + } + }, (item: ItemData) => JSON.stringify(item)) + } + .backgroundImage($r('app.media.backgroundImage')) + .backgroundImageSize({ + width: '100%', + height: '156vp' + }) + .columnsTemplate('1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr') + .columnsGap('8vp') + .rowsGap('12vp') + .margin({ top: '12vp' }) + .padding({ + top: '12vp', + bottom: '12vp' + }) + .height('156vp') + .backgroundColor(Color.White) + .borderRadius('16vp') + } + } + .height('660vp') + .align(Alignment.TopStart) + .scrollBar(BarState.Off) + } + .justifyContent(FlexAlign.Start) + .alignItems(HorizontalAlign.Start) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/PageAndData02/02_Complete/entry/src/main/ets/view/Setting.ets b/PageAndData02/02_Complete/entry/src/main/ets/view/Setting.ets new file mode 100644 index 0000000000000000000000000000000000000000..6b6fa22a3f96e84ea7ed1d04592c1527a85e013f --- /dev/null +++ b/PageAndData02/02_Complete/entry/src/main/ets/view/Setting.ets @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2024 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 ItemData from '../viewmodel/ItemData'; +import mainViewModel from '../viewmodel/MainViewModel'; + +/** + * Setting tab content + */ +@Component +export default struct Setting { + @Builder + settingCell(item: ItemData) { + Row() { + Row({}) { + Image(item.img) + .height('22vp') + .margin({ + left: '16vp', + right: '12vp' + }) + Text(item.title) + .fontSize('16fp') + } + + if (item.others === undefined) { + Image($r('app.media.right_grey')) + .width('12vp') + .height('24vp') + } else { + Toggle({ type: ToggleType.Switch, isOn: false }) + } + } + .justifyContent(FlexAlign.SpaceBetween) + .width('100%') + .padding({ + left: '8vp', + right: '22vp' + }) + } + + build() { + Scroll() { + Column({ space: 12 }) { + Text($r('app.string.mainPage_tabTitles_mine')) + .width('100%') + .margin({ + top: '48vp', + bottom: '12vp' + }) + .fontWeight(700) + .fontSize('26fp') + + Row() { + Image($r('app.media.account')) + .width('48vp') + .height('48vp') + Column() { + Text($r('app.string.setting_account_name')) + .fontSize('20fp') + Text($r('app.string.setting_account_email')) + .fontSize('12fp') + .margin({ top: '4vp' }) + } + .alignItems(HorizontalAlign.Start) + .margin({ left: '12vp' }) + } + .alignItems(VerticalAlign.Center) + .width('100%') + + List({ space: 12 }) { + ForEach(mainViewModel.getSettingListData(), (item: ItemData[], index: number) => { + ListItemGroup() { + ForEach(item, (cell: ItemData, cellIndex) => { + ListItem() { + this.settingCell(cell) + } + .height('48vp') + }) + } + .divider({ + strokeWidth: '1vp', + color: '#0d000000', + startMargin: '42vp', + endMargin: '24vp' + }) + .backgroundColor('#ffffff') + .borderRadius('16vp') + + }, (item: ItemData) => JSON.stringify(item)) + } + .scrollBar(BarState.Off) + .width('100%') + .padding({ + top: '4vp', + bottom: '4vp' + }) + + Blank() + + Button($r('app.string.setting_button'), { type: ButtonType.Capsule }) + .width('90%') + .height('40vp') + .fontSize('16fp') + .fontColor('#FA2A2D') + .fontWeight(FontWeight.Medium) + .backgroundColor('#E5E8EA') + .margin({ bottom: '16vp' }) + } + .height('100%') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/PageAndData02/02_Complete/entry/src/main/ets/viewmodel/ItemData.ets b/PageAndData02/02_Complete/entry/src/main/ets/viewmodel/ItemData.ets new file mode 100644 index 0000000000000000000000000000000000000000..658e6b1dc9529e7612f8a5095b4695a2032ce8e2 --- /dev/null +++ b/PageAndData02/02_Complete/entry/src/main/ets/viewmodel/ItemData.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 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. + */ + +/** + * List item data entity. + */ +export default class PageResource { + /** + * ID of list item. + */ + id: number; + /** + * Text of list item. + */ + title: Resource; + /** + * Image of list item. + */ + img: Resource; + /** + * Other resource of list item. + */ + others?: Resource; + + constructor(id: number, title: Resource, img: Resource, others?: Resource) { + this.id = id; + this.title = title; + this.img = img; + this.others = others; + } +} \ No newline at end of file diff --git a/PageAndData02/02_Complete/entry/src/main/ets/viewmodel/MainViewModel.ets b/PageAndData02/02_Complete/entry/src/main/ets/viewmodel/MainViewModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..c3e6c387b5bb9bd61cf5afaa2b055640430c0b95 --- /dev/null +++ b/PageAndData02/02_Complete/entry/src/main/ets/viewmodel/MainViewModel.ets @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2024 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 ItemData from './ItemData'; + +/** + * Binds data to components and provides interfaces. + */ +export class MainViewModel { + /** + * Get swiper image data. + * + * @return {Array} swiperImages. + */ + getSwiperImages(): Array { + let swiperImages: Resource[] = [ + $r('app.media.fig1'), + $r('app.media.fig2'), + $r('app.media.fig3'), + $r('app.media.fig4') + ]; + return swiperImages; + } + + /** + * Get data of the first grid. + * + * @return {Array} firstGridData. + */ + getFirstGridData(): Array { + let firstGridData: ItemData[] = [ + new ItemData(0, $r('app.string.my_love'), $r('app.media.love')), + new ItemData(1, $r('app.string.history_record'), $r('app.media.record')), + new ItemData(2, $r('app.string.message'), $r('app.media.message')), + new ItemData(3, $r('app.string.shopping_cart'), $r('app.media.shopping')), + new ItemData(4, $r('app.string.my_goal'), $r('app.media.target')), + new ItemData(5, $r('app.string.group'), $r('app.media.circle')), + new ItemData(6, $r('app.string.favorites'), $r('app.media.favorite')), + new ItemData(7, $r('app.string.recycle_bin'), $r('app.media.recycle')) + ]; + return firstGridData; + } + + /** + * Get data of the setting list. + * + * @return {Array} settingListData. + */ + getSettingListData(): Array> { + let settingListData: ItemData[][] = [ + [ + new ItemData(0, $r('app.string.setting_list_news'), $r('app.media.news'), $r("app.string.setting_toggle")) + ], + [ + new ItemData(1, $r('app.string.setting_list_font'), $r('app.media.data')), + new ItemData(2, $r('app.string.setting_list_menu'), $r('app.media.menu')), + ], + [ + new ItemData(3, $r('app.string.clear_cache'), $r('app.media.storage')), + new ItemData(4, $r('app.string.setting_list_privacy'), $r('app.media.person_shield')), + ], + [ + new ItemData(5, $r('app.string.setting_list_about'), $r('app.media.about')) + ] + ]; + return settingListData; + } +} + +export default new MainViewModel(); \ No newline at end of file diff --git a/PageAndData02/02_Complete/entry/src/main/module.json5 b/PageAndData02/02_Complete/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..62be2f7558e6e727934099311d958e868afa16db --- /dev/null +++ b/PageAndData02/02_Complete/entry/src/main/module.json5 @@ -0,0 +1,46 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone" + ], + "routerMap": "$profile:route_map", + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ets", + "description": "$string:EntryAbility_desc", + "icon": "$media:startIcon", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ], + "requestPermissions": [ + { + "name": "ohos.permission.INTERNET", + }, + { + "name": "ohos.permission.GET_NETWORK_INFO", + }, + + ] + } +} \ No newline at end of file diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/element/color.json b/PageAndData02/02_Complete/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..2b713164d8fd7c5053a1af4809507f13410e05a6 --- /dev/null +++ b/PageAndData02/02_Complete/entry/src/main/resources/base/element/color.json @@ -0,0 +1,80 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "white", + "value": "#FFFFFF" + }, + { + "name": "background", + "value": "#F1F3F5" + }, + { + "name": "title_text_color", + "value": "#182431" + }, + { + "name": "login_more_text_color", + "value": "#99182431" + }, + { + "name": "placeholder_color", + "value": "#99182431" + }, + { + "name": "line_color", + "value": "#33182431" + }, + { + "name": "login_button_color", + "value": "#007DFF" + }, + { + "name": "login_blue_text_color", + "value": "#007DFF" + }, + { + "name": "other_login_text_color", + "value": "#838D97" + }, + { + "name": "loading_color", + "value": "#182431" + }, + { + "name": "mainPage_selected", + "value": "#1698CE" + }, + { + "name": "mainPage_normal", + "value": "#6B6B6B" + }, + { + "name": "mainPage_backgroundColor", + "value": "#F1F3F5" + }, + { + "name": "home_grid_fontColor", + "value": "#99182431" + }, + { + "name": "setting_button_backgroundColor", + "value": "#E5E8EA" + }, + { + "name": "setting_button_fontColor", + "value": "#FA2A2D" + }, + { + "name": "grid_linear_start", + "value": "#1a0a5918" + }, + { + "name": "grid_linear_end", + "value": "#ffffff" + } + ] +} \ No newline at end of file diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/element/float.json b/PageAndData02/02_Complete/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..19ba0e188d1786b004c41f6ee067844629fe3502 --- /dev/null +++ b/PageAndData02/02_Complete/entry/src/main/resources/base/element/float.json @@ -0,0 +1,292 @@ +{ + "float": [ + { + "name": "logo_image_size", + "value": "78vp" + }, + { + "name": "logo_margin_top", + "value": "100vp" + }, + { + "name": "logo_margin_bottom", + "value": "8vp" + }, + { + "name": "page_title_text_size", + "value": "24fp" + }, + { + "name": "normal_text_size", + "value": "16fp" + }, + { + "name": "big_text_size", + "value": "18fp" + }, + { + "name": "small_text_size", + "value": "14fp" + }, + { + "name": "little_text_size", + "value": "12fp" + }, + { + "name": "login_more_margin_bottom", + "value": "30vp" + }, + { + "name": "login_more_margin_top", + "value": "8vp" + }, + { + "name": "login_input_height", + "value": "45vp" + }, + { + "name": "forgot_margin_top", + "value": "8vp" + }, + { + "name": "input_margin_top", + "value": "12vp" + }, + { + "name": "line_height", + "value": "1vp" + }, + { + "name": "login_button_height", + "value": "40vp" + }, + { + "name": "login_button_margin_top", + "value": "87vp" + }, + { + "name": "login_button_margin_bottom", + "value": "12vp" + }, + { + "name": "vertical_line_margin", + "value": "15vp" + }, + { + "name": "login_progress_size", + "value": "30vp" + }, + { + "name": "login_progress_margin_top", + "value": "20vp" + }, + { + "name": "other_login_margin_top", + "value": "50vp" + }, + { + "name": "other_login_margin_bottom", + "value": "12vp" + }, + { + "name": "login_page_padding_bottom", + "value": "24vp" + }, + { + "name": "other_login_image_size", + "value": "48vp" + }, + { + "name": "page_padding_hor", + "value": "12vp" + }, + { + "name": "mainPage_baseTab_top", + "value": "4vp" + }, + { + "name": "mainPage_baseTab_margin", + "value": "8vp" + }, + { + "name": "mainPage_padding", + "value": "12vp" + }, + { + "name": "mainPage_barHeight", + "value": "56vp" + }, + { + "name": "mainPage_baseTab_size", + "value": "25vp" + }, + { + "name": "main_tab_fontSize", + "value": "10fp" + }, + { + "name": "mainPage_tabTitles_margin", + "value": "12vp" + }, + { + "name": "mainPage_tabTitles_padding", + "value": "12vp" + }, + { + "name": "home_swiper_borderRadius", + "value": "16vp" + }, + { + "name": "home_swiper_margin", + "value": "24vp" + }, + { + "name": "home_grid_columnsGap", + "value": "8vp" + }, + { + "name": "home_grid_rowGap", + "value": "12vp" + }, + { + "name": "home_grid_padding", + "value": "12vp" + }, + { + "name": "home_grid_height", + "value": "124vp" + }, + { + "name": "home_grid_margin", + "value": "10vp" + }, + { + "name": "home_list_margin", + "value": "4vp" + }, + { + "name": "home_list_padding", + "value": "8vp" + }, + { + "name": "home_grid_borderRadius", + "value": "24vp" + }, + { + "name": "home_text_margin", + "value": "12vp" + }, + { + "name": "home_backgroundImage_borderRadius", + "value": "12vp" + }, + { + "name": "home_secondGrid_height", + "value": "260vp" + }, + { + "name": "home_secondGrid_margin", + "value": "10vp" + }, + { + "name": "home_homeCell_size", + "value": "24vp" + }, + { + "name": "home_homeCell_margin", + "value": "4vp" + }, + { + "name": "home_homeCell_width", + "value": "80vp" + }, + { + "name": "home_homeCell_height", + "value": "80vp" + }, + { + "name": "setting_name_margin", + "value": "4vp" + }, + { + "name": "setting_account_margin", + "value": "24vp" + }, + { + "name": "setting_account_size", + "value": "48vp" + }, + { + "name": "setting_account_fontSize", + "value": "20fp" + }, + { + "name": "setting_account_text_height", + "value": "28vp" + }, + { + "name": "setting_account_height", + "value": "96vp" + }, + { + "name": "setting_account_padding", + "value": "24vp" + }, + { + "name": "setting_account_borderRadius", + "value": "16vp" + }, + { + "name": "setting_list_height", + "value": "48vp" + }, + { + "name": "setting_list_padding", + "value": "4vp" + }, + { + "name": "setting_list_borderRadius", + "value": "16vp" + }, + { + "name": "setting_list_startMargin", + "value": "42vp" + }, + { + "name": "setting_list_endMargin", + "value": "24vp" + }, + { + "name": "setting_list_strokeWidth", + "value": "0.25vp" + }, + { + "name": "setting_button_bottom", + "value": "55vp" + }, + { + "name": "setting_size", + "value": "22vp" + }, + { + "name": "setting_padding", + "value": "10vp" + }, + { + "name": "setting_jump_width", + "value": "12vp" + }, + { + "name": "setting_jump_height", + "value": "24vp" + }, + { + "name": "setting_settingCell_left", + "value": "8vp" + }, + { + "name": "setting_settingCell_right", + "value": "22vp" + } + ] +} \ No newline at end of file diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/element/string.json b/PageAndData02/02_Complete/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..e6f3b2bf151e458ab15f89c31714c870d96655b0 --- /dev/null +++ b/PageAndData02/02_Complete/entry/src/main/resources/base/element/string.json @@ -0,0 +1,316 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "PageAndData" + }, + { + "name": "login_page", + "value": "Login page" + }, + { + "name": "login_more", + "value": "Log in to your account to use more services" + }, + { + "name": "account", + "value": "Account" + }, + { + "name": "password", + "value": "Password" + }, + { + "name": "login", + "value": "Log in" + }, + { + "name": "register_account", + "value": "Registering an Account" + }, + { + "name": "forgot_password", + "value": "Forgot Password" + }, + { + "name": "message_login", + "value": "SMS verification code login" + }, + { + "name": "other_login_method", + "value": "Other login methods" + }, + { + "name": "vertical_line", + "value": " | " + }, + { + "name": "input_empty_tips", + "value": "The input cannot be empty." + }, + { + "name": "login_success", + "value": "The login is successful." + }, + { + "name": "my_love", + "value": "My favorite" + }, + { + "name": "history_record", + "value": "History" + }, + { + "name": "message", + "value": "Message" + }, + { + "name": "shopping_cart", + "value": "Shopping cart" + }, + { + "name": "my_goal", + "value": "My goal" + }, + { + "name": "group", + "value": "Group" + }, + { + "name": "favorites", + "value": "Favorites" + }, + { + "name": "recycle_bin", + "value": "Recycle Bin" + }, + { + "name": "rankings", + "value": "Rankings" + }, + { + "name": "new_product_debut", + "value": "New product debut" + }, + { + "name": "big_name_flash", + "value": "Big name flash" + }, + { + "name": "find_good", + "value": "Find good things" + }, + { + "name": "xiamen_station", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "more_big_names", + "value": "More Big Names" + }, + { + "name": "push_notifications", + "value": "Push Notifications" + }, + { + "name": "data_management", + "value": "Data Management" + }, + { + "name": "menu_settings", + "value": "Menu Settings" + }, + { + "name": "about", + "value": "About" + }, + { + "name": "clear_cache", + "value": "Clear Cache" + }, + { + "name": "mainPage_tabTitles_home", + "value": "Home" + }, + { + "name": "mainPage_tabTitles_mine", + "value": "Mine" + }, + { + "name": "mainPage_top", + "value": "Rankings" + }, + { + "name": "mainPage_text_top", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "mainPage_new", + "value": "New product debut" + }, + { + "name": "mainPage_text_new", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "mainPage_brand", + "value": "Big name flash" + }, + { + "name": "mainPage_text_brand", + "value": "More Big Names" + }, + { + "name": "mainPage_found", + "value": "Find good things" + }, + { + "name": "mainPage_text_found", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "setting_account_name", + "value": "Mr. Lee" + }, + { + "name": "setting_account_email", + "value": "2000000@test.cc" + }, + { + "name": "setting_list_news", + "value": "Push Notifications" + }, + { + "name": "setting_list_font", + "value": "Fontsize Change" + }, + { + "name": "setting_list_menu", + "value": "Menu Settings" + }, + { + "name": "setting_list_about", + "value": "About" + }, + { + "name": "setting_list_storage", + "value": "Clear Cache" + }, + { + "name": "setting_list_privacy", + "value": "Privacy Agreement" + }, + { + "name": "setting_button", + "value": "Logout" + }, + { + "name": "home_list", + "value": "List" + }, + { + "name": "setting_toggle", + "value": "switch" + }, + { + "name": "bind_title", + "value": "Exercise completion" + }, + { + "name": "fontsize_change", + "value": "FontSize change" + }, + { + "name": "Confirmed", + "value": "Confirmed" + }, + { + "name": "Cancel", + "value": "Cancel" + }, + { + "name": "sport_name", + "value": "Sport Name" + }, + { + "name": "Morning_jogging", + "value": "Morning jogging" + }, + { + "name": "Yoga", + "value": "Yoga" + }, + { + "name": "Swimming", + "value": "Swimming" + }, + { + "name": "Exercise_duration", + "value": "Exercise duration: (minutes)" + }, + { + "name": "Completion_Status", + "value": "Completion Status" + }, + { + "name": "Completed", + "value": "Completed" + }, + { + "name": "Uncompleted", + "value": "Uncompleted" + }, + { + "name": "submit", + "value": "Submit" + }, + { + "name": "enter_duration", + "value": "Please enter the exercise duration." + }, + { + "name": "My_plans", + "value": "My Plans" + }, + { + "name": "ALL", + "value": "All" + }, + { + "name": "delete_question", + "value": "Are you sure you want to delete the plan?" + }, + { + "name": "delete", + "value": "Delete" + }, + { + "name": "Add_Plans", + "value": "Add plan" + }, + { + "name": "status", + "value": "Status" + }, + { + "name": "Duration", + "value": "Duration" + }, + { + "name": "Tab_Bar_One", + "value": "Home Page" + }, + { + "name": "Tab_Bar_Two", + "value": "Mine" + } + ] +} \ No newline at end of file diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/about.png b/PageAndData02/02_Complete/entry/src/main/resources/base/media/about.png new file mode 100644 index 0000000000000000000000000000000000000000..6896495ca95dd5eb4507c1f70f2f1a24ede868db Binary files /dev/null and b/PageAndData02/02_Complete/entry/src/main/resources/base/media/about.png differ diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/account.png b/PageAndData02/02_Complete/entry/src/main/resources/base/media/account.png new file mode 100644 index 0000000000000000000000000000000000000000..12f8fe56f8faa51ab5d61ee40f38cae3a79135df Binary files /dev/null and b/PageAndData02/02_Complete/entry/src/main/resources/base/media/account.png differ diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/backgroundImage.png b/PageAndData02/02_Complete/entry/src/main/resources/base/media/backgroundImage.png new file mode 100644 index 0000000000000000000000000000000000000000..86e8d90778d319f4fa50f21b6ed7f173a89995b2 Binary files /dev/null and b/PageAndData02/02_Complete/entry/src/main/resources/base/media/backgroundImage.png differ diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/circle.svg b/PageAndData02/02_Complete/entry/src/main/resources/base/media/circle.svg new file mode 100644 index 0000000000000000000000000000000000000000..f6fa05cf1550e22111cc0b64007727276bb3aa66 --- /dev/null +++ b/PageAndData02/02_Complete/entry/src/main/resources/base/media/circle.svg @@ -0,0 +1,18 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/data.png b/PageAndData02/02_Complete/entry/src/main/resources/base/media/data.png new file mode 100644 index 0000000000000000000000000000000000000000..101db234f4b25f8997d0d3881ddd79b68599dc8b Binary files /dev/null and b/PageAndData02/02_Complete/entry/src/main/resources/base/media/data.png differ diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/delete.png b/PageAndData02/02_Complete/entry/src/main/resources/base/media/delete.png new file mode 100644 index 0000000000000000000000000000000000000000..fd17d4dbadfe66884774d8ed779e8cec48f79896 Binary files /dev/null and b/PageAndData02/02_Complete/entry/src/main/resources/base/media/delete.png differ diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/edit.png b/PageAndData02/02_Complete/entry/src/main/resources/base/media/edit.png new file mode 100644 index 0000000000000000000000000000000000000000..6ff921b308877a85886ee1c24a4661a5d5f6df66 Binary files /dev/null and b/PageAndData02/02_Complete/entry/src/main/resources/base/media/edit.png differ diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/favorite.svg b/PageAndData02/02_Complete/entry/src/main/resources/base/media/favorite.svg new file mode 100644 index 0000000000000000000000000000000000000000..06d2bed182b8d3846faee9305bf2532ad96b2b33 --- /dev/null +++ b/PageAndData02/02_Complete/entry/src/main/resources/base/media/favorite.svg @@ -0,0 +1,15 @@ + + + Created with Pixso. + + + + + + + + + + + + diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/fig1.png b/PageAndData02/02_Complete/entry/src/main/resources/base/media/fig1.png new file mode 100644 index 0000000000000000000000000000000000000000..3f1e081539375a4fb4ac142ab7061287af80a12d Binary files /dev/null and b/PageAndData02/02_Complete/entry/src/main/resources/base/media/fig1.png differ diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/fig2.png b/PageAndData02/02_Complete/entry/src/main/resources/base/media/fig2.png new file mode 100644 index 0000000000000000000000000000000000000000..5e307d53994dafc85984518b5513f80d864b8815 Binary files /dev/null and b/PageAndData02/02_Complete/entry/src/main/resources/base/media/fig2.png differ diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/fig3.png b/PageAndData02/02_Complete/entry/src/main/resources/base/media/fig3.png new file mode 100644 index 0000000000000000000000000000000000000000..e47660fee043619b24d38aaf61897f7282454109 Binary files /dev/null and b/PageAndData02/02_Complete/entry/src/main/resources/base/media/fig3.png differ diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/fig4.png b/PageAndData02/02_Complete/entry/src/main/resources/base/media/fig4.png new file mode 100644 index 0000000000000000000000000000000000000000..bfbd91b3093dd6b80ac3528c2f2acccab331e1ce Binary files /dev/null and b/PageAndData02/02_Complete/entry/src/main/resources/base/media/fig4.png differ diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/icon.png b/PageAndData02/02_Complete/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/PageAndData02/02_Complete/entry/src/main/resources/base/media/icon.png differ diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/login_method1.png b/PageAndData02/02_Complete/entry/src/main/resources/base/media/login_method1.png new file mode 100644 index 0000000000000000000000000000000000000000..a7b47f2ea5723f81684506765ed437d6684f8184 Binary files /dev/null and b/PageAndData02/02_Complete/entry/src/main/resources/base/media/login_method1.png differ diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/login_method2.png b/PageAndData02/02_Complete/entry/src/main/resources/base/media/login_method2.png new file mode 100644 index 0000000000000000000000000000000000000000..320e9a5038da6fb9bdc201ed7675d4d4ad1a0c99 Binary files /dev/null and b/PageAndData02/02_Complete/entry/src/main/resources/base/media/login_method2.png differ diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/login_method3.png b/PageAndData02/02_Complete/entry/src/main/resources/base/media/login_method3.png new file mode 100644 index 0000000000000000000000000000000000000000..28ac6ec8669b5634df443b10a4ced8f9c7e8a5c7 Binary files /dev/null and b/PageAndData02/02_Complete/entry/src/main/resources/base/media/login_method3.png differ diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/logo.png b/PageAndData02/02_Complete/entry/src/main/resources/base/media/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..1dcac2208bef8df6893357ec8d43fdd6ee6763f7 Binary files /dev/null and b/PageAndData02/02_Complete/entry/src/main/resources/base/media/logo.png differ diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/love.svg b/PageAndData02/02_Complete/entry/src/main/resources/base/media/love.svg new file mode 100644 index 0000000000000000000000000000000000000000..5c75b04648ae692256d879a7ed8b0e42b93936f8 --- /dev/null +++ b/PageAndData02/02_Complete/entry/src/main/resources/base/media/love.svg @@ -0,0 +1,18 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/menu.png b/PageAndData02/02_Complete/entry/src/main/resources/base/media/menu.png new file mode 100644 index 0000000000000000000000000000000000000000..04b95f49b5328fefa63ecd0da9bc8ae2cb0e7ebd Binary files /dev/null and b/PageAndData02/02_Complete/entry/src/main/resources/base/media/menu.png differ diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/message.svg b/PageAndData02/02_Complete/entry/src/main/resources/base/media/message.svg new file mode 100644 index 0000000000000000000000000000000000000000..c4c144958d1b109fa200514a4e0e46dc3367b630 --- /dev/null +++ b/PageAndData02/02_Complete/entry/src/main/resources/base/media/message.svg @@ -0,0 +1,18 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/news.png b/PageAndData02/02_Complete/entry/src/main/resources/base/media/news.png new file mode 100644 index 0000000000000000000000000000000000000000..379f25a2fcb654ff84966e45f0892db30e6c46e1 Binary files /dev/null and b/PageAndData02/02_Complete/entry/src/main/resources/base/media/news.png differ diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/path.svg b/PageAndData02/02_Complete/entry/src/main/resources/base/media/path.svg new file mode 100644 index 0000000000000000000000000000000000000000..3ed90565ea331acc5ba33320257284977037e16d --- /dev/null +++ b/PageAndData02/02_Complete/entry/src/main/resources/base/media/path.svg @@ -0,0 +1,7 @@ + + + Created with Pixso. + + + + diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/person_shield.png b/PageAndData02/02_Complete/entry/src/main/resources/base/media/person_shield.png new file mode 100644 index 0000000000000000000000000000000000000000..e50355ea8b34750f8f00b9f4cd124ea996a38742 Binary files /dev/null and b/PageAndData02/02_Complete/entry/src/main/resources/base/media/person_shield.png differ diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/record.svg b/PageAndData02/02_Complete/entry/src/main/resources/base/media/record.svg new file mode 100644 index 0000000000000000000000000000000000000000..e0749d6a5c6be2603af7b760d29326f762ece934 --- /dev/null +++ b/PageAndData02/02_Complete/entry/src/main/resources/base/media/record.svg @@ -0,0 +1,15 @@ + + + Created with Pixso. + + + + + + + + + + + + diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/recycle.svg b/PageAndData02/02_Complete/entry/src/main/resources/base/media/recycle.svg new file mode 100644 index 0000000000000000000000000000000000000000..d22b4dce6cec5c5353e6a974256f05a871133dfc --- /dev/null +++ b/PageAndData02/02_Complete/entry/src/main/resources/base/media/recycle.svg @@ -0,0 +1,17 @@ + + + Created with Pixso. + + + + + + + + + + + + + + diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/reset.png b/PageAndData02/02_Complete/entry/src/main/resources/base/media/reset.png new file mode 100644 index 0000000000000000000000000000000000000000..d4645bdca4d56183f13d63a015a6537225bf2c6f Binary files /dev/null and b/PageAndData02/02_Complete/entry/src/main/resources/base/media/reset.png differ diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/right_grey.png b/PageAndData02/02_Complete/entry/src/main/resources/base/media/right_grey.png new file mode 100644 index 0000000000000000000000000000000000000000..ed1eed6403e44374cd3542d2631d2c1a83608d4f Binary files /dev/null and b/PageAndData02/02_Complete/entry/src/main/resources/base/media/right_grey.png differ diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/shopping.svg b/PageAndData02/02_Complete/entry/src/main/resources/base/media/shopping.svg new file mode 100644 index 0000000000000000000000000000000000000000..025437298c567eaf57abb0596c2076746944a6ec --- /dev/null +++ b/PageAndData02/02_Complete/entry/src/main/resources/base/media/shopping.svg @@ -0,0 +1,15 @@ + + + Created with Pixso. + + + + + + + + + + + + diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/sift.png b/PageAndData02/02_Complete/entry/src/main/resources/base/media/sift.png new file mode 100644 index 0000000000000000000000000000000000000000..8bb376fac511a07d3ad9e85bde352a3d22d73e2f Binary files /dev/null and b/PageAndData02/02_Complete/entry/src/main/resources/base/media/sift.png differ diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/startIcon.png b/PageAndData02/02_Complete/entry/src/main/resources/base/media/startIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b Binary files /dev/null and b/PageAndData02/02_Complete/entry/src/main/resources/base/media/startIcon.png differ diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/storage.png b/PageAndData02/02_Complete/entry/src/main/resources/base/media/storage.png new file mode 100644 index 0000000000000000000000000000000000000000..af5baac97a5949c836ff16f8a58a1d458341490e Binary files /dev/null and b/PageAndData02/02_Complete/entry/src/main/resources/base/media/storage.png differ diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/media/target.svg b/PageAndData02/02_Complete/entry/src/main/resources/base/media/target.svg new file mode 100644 index 0000000000000000000000000000000000000000..2a49f3ae2f1042b0bcca4a9c6a050690c5020ee8 --- /dev/null +++ b/PageAndData02/02_Complete/entry/src/main/resources/base/media/target.svg @@ -0,0 +1,19 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + + diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/profile/main_pages.json b/PageAndData02/02_Complete/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..85a3c19566d76790ce243e498c48f665ce4008e5 --- /dev/null +++ b/PageAndData02/02_Complete/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/LoginPage" + ] +} \ No newline at end of file diff --git a/PageAndData02/02_Complete/entry/src/main/resources/base/profile/route_map.json b/PageAndData02/02_Complete/entry/src/main/resources/base/profile/route_map.json new file mode 100644 index 0000000000000000000000000000000000000000..e1b4bcba03bf1f24e370245ff1db2b44c5ba935f --- /dev/null +++ b/PageAndData02/02_Complete/entry/src/main/resources/base/profile/route_map.json @@ -0,0 +1,12 @@ +{ + "routerMap": [ + { + "name": "MainPage", + "pageSourceFile": "src/main/ets/pages/MainPage.ets", + "buildFunction": "MainPageBuilder", + "data": { + "description" : "this is mainPage" + } + } + ] +} \ No newline at end of file diff --git a/PageAndData02/02_Complete/entry/src/main/resources/en_US/element/string.json b/PageAndData02/02_Complete/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..e6f3b2bf151e458ab15f89c31714c870d96655b0 --- /dev/null +++ b/PageAndData02/02_Complete/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,316 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "PageAndData" + }, + { + "name": "login_page", + "value": "Login page" + }, + { + "name": "login_more", + "value": "Log in to your account to use more services" + }, + { + "name": "account", + "value": "Account" + }, + { + "name": "password", + "value": "Password" + }, + { + "name": "login", + "value": "Log in" + }, + { + "name": "register_account", + "value": "Registering an Account" + }, + { + "name": "forgot_password", + "value": "Forgot Password" + }, + { + "name": "message_login", + "value": "SMS verification code login" + }, + { + "name": "other_login_method", + "value": "Other login methods" + }, + { + "name": "vertical_line", + "value": " | " + }, + { + "name": "input_empty_tips", + "value": "The input cannot be empty." + }, + { + "name": "login_success", + "value": "The login is successful." + }, + { + "name": "my_love", + "value": "My favorite" + }, + { + "name": "history_record", + "value": "History" + }, + { + "name": "message", + "value": "Message" + }, + { + "name": "shopping_cart", + "value": "Shopping cart" + }, + { + "name": "my_goal", + "value": "My goal" + }, + { + "name": "group", + "value": "Group" + }, + { + "name": "favorites", + "value": "Favorites" + }, + { + "name": "recycle_bin", + "value": "Recycle Bin" + }, + { + "name": "rankings", + "value": "Rankings" + }, + { + "name": "new_product_debut", + "value": "New product debut" + }, + { + "name": "big_name_flash", + "value": "Big name flash" + }, + { + "name": "find_good", + "value": "Find good things" + }, + { + "name": "xiamen_station", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "more_big_names", + "value": "More Big Names" + }, + { + "name": "push_notifications", + "value": "Push Notifications" + }, + { + "name": "data_management", + "value": "Data Management" + }, + { + "name": "menu_settings", + "value": "Menu Settings" + }, + { + "name": "about", + "value": "About" + }, + { + "name": "clear_cache", + "value": "Clear Cache" + }, + { + "name": "mainPage_tabTitles_home", + "value": "Home" + }, + { + "name": "mainPage_tabTitles_mine", + "value": "Mine" + }, + { + "name": "mainPage_top", + "value": "Rankings" + }, + { + "name": "mainPage_text_top", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "mainPage_new", + "value": "New product debut" + }, + { + "name": "mainPage_text_new", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "mainPage_brand", + "value": "Big name flash" + }, + { + "name": "mainPage_text_brand", + "value": "More Big Names" + }, + { + "name": "mainPage_found", + "value": "Find good things" + }, + { + "name": "mainPage_text_found", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "setting_account_name", + "value": "Mr. Lee" + }, + { + "name": "setting_account_email", + "value": "2000000@test.cc" + }, + { + "name": "setting_list_news", + "value": "Push Notifications" + }, + { + "name": "setting_list_font", + "value": "Fontsize Change" + }, + { + "name": "setting_list_menu", + "value": "Menu Settings" + }, + { + "name": "setting_list_about", + "value": "About" + }, + { + "name": "setting_list_storage", + "value": "Clear Cache" + }, + { + "name": "setting_list_privacy", + "value": "Privacy Agreement" + }, + { + "name": "setting_button", + "value": "Logout" + }, + { + "name": "home_list", + "value": "List" + }, + { + "name": "setting_toggle", + "value": "switch" + }, + { + "name": "bind_title", + "value": "Exercise completion" + }, + { + "name": "fontsize_change", + "value": "FontSize change" + }, + { + "name": "Confirmed", + "value": "Confirmed" + }, + { + "name": "Cancel", + "value": "Cancel" + }, + { + "name": "sport_name", + "value": "Sport Name" + }, + { + "name": "Morning_jogging", + "value": "Morning jogging" + }, + { + "name": "Yoga", + "value": "Yoga" + }, + { + "name": "Swimming", + "value": "Swimming" + }, + { + "name": "Exercise_duration", + "value": "Exercise duration: (minutes)" + }, + { + "name": "Completion_Status", + "value": "Completion Status" + }, + { + "name": "Completed", + "value": "Completed" + }, + { + "name": "Uncompleted", + "value": "Uncompleted" + }, + { + "name": "submit", + "value": "Submit" + }, + { + "name": "enter_duration", + "value": "Please enter the exercise duration." + }, + { + "name": "My_plans", + "value": "My Plans" + }, + { + "name": "ALL", + "value": "All" + }, + { + "name": "delete_question", + "value": "Are you sure you want to delete the plan?" + }, + { + "name": "delete", + "value": "Delete" + }, + { + "name": "Add_Plans", + "value": "Add plan" + }, + { + "name": "status", + "value": "Status" + }, + { + "name": "Duration", + "value": "Duration" + }, + { + "name": "Tab_Bar_One", + "value": "Home Page" + }, + { + "name": "Tab_Bar_Two", + "value": "Mine" + } + ] +} \ No newline at end of file diff --git a/PageAndData02/02_Complete/entry/src/main/resources/zh_CN/element/string.json b/PageAndData02/02_Complete/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..6709da69b42a21d430f1efd7b9eacae909e67216 --- /dev/null +++ b/PageAndData02/02_Complete/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,316 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "PageAndData" + }, + { + "name": "login_page", + "value": "登录界面" + }, + { + "name": "login_more", + "value": "登录账号以使用更多服务" + }, + { + "name": "account", + "value": "账号" + }, + { + "name": "password", + "value": "密码" + }, + { + "name": "login", + "value": "登录" + }, + { + "name": "register_account", + "value": "注册账号" + }, + { + "name": "forgot_password", + "value": "忘记密码" + }, + { + "name": "message_login", + "value": "短信验证码登录" + }, + { + "name": "other_login_method", + "value": "其他登录方式" + }, + { + "name": "vertical_line", + "value": " | " + }, + { + "name": "input_empty_tips", + "value": "输入不能为空" + }, + { + "name": "login_success", + "value": "登录成功" + }, + { + "name": "my_love", + "value": "我的最爱" + }, + { + "name": "history_record", + "value": "历史记录" + }, + { + "name": "message", + "value": "消息" + }, + { + "name": "shopping_cart", + "value": "购物车" + }, + { + "name": "my_goal", + "value": "我的目标" + }, + { + "name": "group", + "value": "圈子" + }, + { + "name": "favorites", + "value": "收藏" + }, + { + "name": "recycle_bin", + "value": "回收站" + }, + { + "name": "rankings", + "value": "排行榜" + }, + { + "name": "new_product_debut", + "value": "新品首发" + }, + { + "name": "big_name_flash", + "value": "大牌闪购" + }, + { + "name": "find_good", + "value": "发现好物" + }, + { + "name": "xiamen_station", + "value": "厦门站,我们不见不散" + }, + { + "name": "more_big_names", + "value": "更多大牌" + }, + { + "name": "push_notifications", + "value": "推送通知" + }, + { + "name": "data_management", + "value": "数据管理" + }, + { + "name": "menu_settings", + "value": "菜单设置" + }, + { + "name": "about", + "value": "关于" + }, + { + "name": "clear_cache", + "value": "清除缓存" + }, + { + "name": "mainPage_tabTitles_home", + "value": "首页" + }, + { + "name": "mainPage_tabTitles_mine", + "value": "我的" + }, + { + "name": "mainPage_top", + "value": "排行榜" + }, + { + "name": "mainPage_text_top", + "value": "厦门站,我们不见不散" + }, + { + "name": "mainPage_new", + "value": "新品首发" + }, + { + "name": "mainPage_text_new", + "value": "厦门站,我们不见不散" + }, + { + "name": "mainPage_brand", + "value": "大牌闪购" + }, + { + "name": "mainPage_text_brand", + "value": "更多大牌" + }, + { + "name": "mainPage_found", + "value": "发现好物" + }, + { + "name": "mainPage_text_found", + "value": "厦门站,我们不见不散" + }, + { + "name": "setting_account_name", + "value": "李先生" + }, + { + "name": "setting_account_email", + "value": "2000000@test.cc" + }, + { + "name": "setting_list_news", + "value": "推送通知" + }, + { + "name": "setting_list_font", + "value": "字体大小调节" + }, + { + "name": "setting_list_menu", + "value": "菜单设置" + }, + { + "name": "setting_list_about", + "value": "关于" + }, + { + "name": "setting_list_storage", + "value": "清除缓存" + }, + { + "name": "setting_list_privacy", + "value": "隐私协议" + }, + { + "name": "setting_button", + "value": "退出登录" + }, + { + "name": "home_list", + "value": "列表" + }, + { + "name": "setting_toggle", + "value": "开关" + }, + { + "name": "bind_title", + "value": "运动完成情况" + }, + { + "name": "fontsize_change", + "value": "字体大小调节" + }, + { + "name": "Confirmed", + "value": "确认" + }, + { + "name": "Cancel", + "value": "取消" + }, + { + "name": "sport_name", + "value": "运动名" + }, + { + "name": "Morning_jogging", + "value": "晨跑" + }, + { + "name": "Yoga", + "value": "瑜伽" + }, + { + "name": "Swimming", + "value": "游泳" + }, + { + "name": "Exercise_duration", + "value": "运动时长: (分钟)" + }, + { + "name": "Completion_Status", + "value": "完成状态" + }, + { + "name": "Completed", + "value": "已完成" + }, + { + "name": "Uncompleted", + "value": "未完成" + }, + { + "name": "submit", + "value": "提交" + }, + { + "name": "enter_duration", + "value": "请输入运动时长" + }, + { + "name": "My_plans", + "value": "我的计划" + }, + { + "name": "ALL", + "value": "任意" + }, + { + "name": "delete_question", + "value": "确定要删除该计划吗?" + }, + { + "name": "delete", + "value": "删除" + }, + { + "name": "Add_Plans", + "value": "新增计划" + }, + { + "name": "status", + "value": "状态" + }, + { + "name": "Duration", + "value": "时长" + }, + { + "name": "Tab_Bar_One", + "value": "首页" + }, + { + "name": "Tab_Bar_Two", + "value": "我的" + } + ] +} \ No newline at end of file diff --git a/PageAndData02/02_Complete/hvigor/hvigor-config.json5 b/PageAndData02/02_Complete/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..73bfab4e997c8d4aea53b22fdd7f10112b30987f --- /dev/null +++ b/PageAndData02/02_Complete/hvigor/hvigor-config.json5 @@ -0,0 +1,17 @@ +{ + "modelVersion": "5.0.0", + "dependencies": { + }, + "execution": { + // "daemon": true, /* Enable daemon compilation. Default: true */ + // "incremental": true, /* Enable incremental compilation. Default: true */ + // "parallel": true, /* Enable parallel compilation. Default: true */ + // "typeCheck": false, /* Enable typeCheck. Default: false */ + }, + "logging": { + // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */ + }, + "debugging": { + // "stacktrace": false /* Disable stacktrace compilation. Default: false */ + } +} \ No newline at end of file diff --git a/PageAndData02/02_Complete/hvigorfile.ts b/PageAndData02/02_Complete/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/PageAndData02/02_Complete/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/PageAndData02/02_Complete/oh-package.json5 b/PageAndData02/02_Complete/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ba334a33e0ef0989bb410985996742da64bceda1 --- /dev/null +++ b/PageAndData02/02_Complete/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "modelVersion": "5.0.0", + "license": "", + "devDependencies": { + }, + "author": "", + "name": "arktscomponents", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} \ No newline at end of file diff --git a/PageAndData02/02_Resources/about.png b/PageAndData02/02_Resources/about.png new file mode 100644 index 0000000000000000000000000000000000000000..6896495ca95dd5eb4507c1f70f2f1a24ede868db Binary files /dev/null and b/PageAndData02/02_Resources/about.png differ diff --git a/PageAndData02/02_Resources/account.png b/PageAndData02/02_Resources/account.png new file mode 100644 index 0000000000000000000000000000000000000000..12f8fe56f8faa51ab5d61ee40f38cae3a79135df Binary files /dev/null and b/PageAndData02/02_Resources/account.png differ diff --git a/PageAndData02/02_Resources/backgroundImage.png b/PageAndData02/02_Resources/backgroundImage.png new file mode 100644 index 0000000000000000000000000000000000000000..86e8d90778d319f4fa50f21b6ed7f173a89995b2 Binary files /dev/null and b/PageAndData02/02_Resources/backgroundImage.png differ diff --git a/PageAndData02/02_Resources/circle.svg b/PageAndData02/02_Resources/circle.svg new file mode 100644 index 0000000000000000000000000000000000000000..f6fa05cf1550e22111cc0b64007727276bb3aa66 --- /dev/null +++ b/PageAndData02/02_Resources/circle.svg @@ -0,0 +1,18 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + diff --git a/PageAndData02/02_Resources/data.png b/PageAndData02/02_Resources/data.png new file mode 100644 index 0000000000000000000000000000000000000000..101db234f4b25f8997d0d3881ddd79b68599dc8b Binary files /dev/null and b/PageAndData02/02_Resources/data.png differ diff --git a/PageAndData02/02_Resources/delete.png b/PageAndData02/02_Resources/delete.png new file mode 100644 index 0000000000000000000000000000000000000000..fd17d4dbadfe66884774d8ed779e8cec48f79896 Binary files /dev/null and b/PageAndData02/02_Resources/delete.png differ diff --git a/PageAndData02/02_Resources/edit.png b/PageAndData02/02_Resources/edit.png new file mode 100644 index 0000000000000000000000000000000000000000..6ff921b308877a85886ee1c24a4661a5d5f6df66 Binary files /dev/null and b/PageAndData02/02_Resources/edit.png differ diff --git a/PageAndData02/02_Resources/favorite.svg b/PageAndData02/02_Resources/favorite.svg new file mode 100644 index 0000000000000000000000000000000000000000..06d2bed182b8d3846faee9305bf2532ad96b2b33 --- /dev/null +++ b/PageAndData02/02_Resources/favorite.svg @@ -0,0 +1,15 @@ + + + Created with Pixso. + + + + + + + + + + + + diff --git a/PageAndData02/02_Resources/fig1.png b/PageAndData02/02_Resources/fig1.png new file mode 100644 index 0000000000000000000000000000000000000000..3f1e081539375a4fb4ac142ab7061287af80a12d Binary files /dev/null and b/PageAndData02/02_Resources/fig1.png differ diff --git a/PageAndData02/02_Resources/fig2.png b/PageAndData02/02_Resources/fig2.png new file mode 100644 index 0000000000000000000000000000000000000000..5e307d53994dafc85984518b5513f80d864b8815 Binary files /dev/null and b/PageAndData02/02_Resources/fig2.png differ diff --git a/PageAndData02/02_Resources/fig3.png b/PageAndData02/02_Resources/fig3.png new file mode 100644 index 0000000000000000000000000000000000000000..e47660fee043619b24d38aaf61897f7282454109 Binary files /dev/null and b/PageAndData02/02_Resources/fig3.png differ diff --git a/PageAndData02/02_Resources/fig4.png b/PageAndData02/02_Resources/fig4.png new file mode 100644 index 0000000000000000000000000000000000000000..bfbd91b3093dd6b80ac3528c2f2acccab331e1ce Binary files /dev/null and b/PageAndData02/02_Resources/fig4.png differ diff --git a/PageAndData02/02_Resources/icon.png b/PageAndData02/02_Resources/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/PageAndData02/02_Resources/icon.png differ diff --git a/PageAndData02/02_Resources/love.svg b/PageAndData02/02_Resources/love.svg new file mode 100644 index 0000000000000000000000000000000000000000..5c75b04648ae692256d879a7ed8b0e42b93936f8 --- /dev/null +++ b/PageAndData02/02_Resources/love.svg @@ -0,0 +1,18 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + diff --git a/PageAndData02/02_Resources/menu.png b/PageAndData02/02_Resources/menu.png new file mode 100644 index 0000000000000000000000000000000000000000..04b95f49b5328fefa63ecd0da9bc8ae2cb0e7ebd Binary files /dev/null and b/PageAndData02/02_Resources/menu.png differ diff --git a/PageAndData02/02_Resources/message.svg b/PageAndData02/02_Resources/message.svg new file mode 100644 index 0000000000000000000000000000000000000000..c4c144958d1b109fa200514a4e0e46dc3367b630 --- /dev/null +++ b/PageAndData02/02_Resources/message.svg @@ -0,0 +1,18 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + diff --git a/PageAndData02/02_Resources/news.png b/PageAndData02/02_Resources/news.png new file mode 100644 index 0000000000000000000000000000000000000000..379f25a2fcb654ff84966e45f0892db30e6c46e1 Binary files /dev/null and b/PageAndData02/02_Resources/news.png differ diff --git a/PageAndData02/02_Resources/path.svg b/PageAndData02/02_Resources/path.svg new file mode 100644 index 0000000000000000000000000000000000000000..3ed90565ea331acc5ba33320257284977037e16d --- /dev/null +++ b/PageAndData02/02_Resources/path.svg @@ -0,0 +1,7 @@ + + + Created with Pixso. + + + + diff --git a/PageAndData02/02_Resources/person_shield.png b/PageAndData02/02_Resources/person_shield.png new file mode 100644 index 0000000000000000000000000000000000000000..e50355ea8b34750f8f00b9f4cd124ea996a38742 Binary files /dev/null and b/PageAndData02/02_Resources/person_shield.png differ diff --git a/PageAndData02/02_Resources/record.svg b/PageAndData02/02_Resources/record.svg new file mode 100644 index 0000000000000000000000000000000000000000..e0749d6a5c6be2603af7b760d29326f762ece934 --- /dev/null +++ b/PageAndData02/02_Resources/record.svg @@ -0,0 +1,15 @@ + + + Created with Pixso. + + + + + + + + + + + + diff --git a/PageAndData02/02_Resources/recycle.svg b/PageAndData02/02_Resources/recycle.svg new file mode 100644 index 0000000000000000000000000000000000000000..d22b4dce6cec5c5353e6a974256f05a871133dfc --- /dev/null +++ b/PageAndData02/02_Resources/recycle.svg @@ -0,0 +1,17 @@ + + + Created with Pixso. + + + + + + + + + + + + + + diff --git a/PageAndData02/02_Resources/reset.png b/PageAndData02/02_Resources/reset.png new file mode 100644 index 0000000000000000000000000000000000000000..d4645bdca4d56183f13d63a015a6537225bf2c6f Binary files /dev/null and b/PageAndData02/02_Resources/reset.png differ diff --git a/PageAndData02/02_Resources/right_grey.png b/PageAndData02/02_Resources/right_grey.png new file mode 100644 index 0000000000000000000000000000000000000000..ed1eed6403e44374cd3542d2631d2c1a83608d4f Binary files /dev/null and b/PageAndData02/02_Resources/right_grey.png differ diff --git a/PageAndData02/02_Resources/shopping.svg b/PageAndData02/02_Resources/shopping.svg new file mode 100644 index 0000000000000000000000000000000000000000..025437298c567eaf57abb0596c2076746944a6ec --- /dev/null +++ b/PageAndData02/02_Resources/shopping.svg @@ -0,0 +1,15 @@ + + + Created with Pixso. + + + + + + + + + + + + diff --git a/PageAndData02/02_Resources/sift.png b/PageAndData02/02_Resources/sift.png new file mode 100644 index 0000000000000000000000000000000000000000..8bb376fac511a07d3ad9e85bde352a3d22d73e2f Binary files /dev/null and b/PageAndData02/02_Resources/sift.png differ diff --git a/PageAndData02/02_Resources/startIcon.png b/PageAndData02/02_Resources/startIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b Binary files /dev/null and b/PageAndData02/02_Resources/startIcon.png differ diff --git a/PageAndData02/02_Resources/storage.png b/PageAndData02/02_Resources/storage.png new file mode 100644 index 0000000000000000000000000000000000000000..af5baac97a5949c836ff16f8a58a1d458341490e Binary files /dev/null and b/PageAndData02/02_Resources/storage.png differ diff --git a/PageAndData02/02_Resources/target.svg b/PageAndData02/02_Resources/target.svg new file mode 100644 index 0000000000000000000000000000000000000000..2a49f3ae2f1042b0bcca4a9c6a050690c5020ee8 --- /dev/null +++ b/PageAndData02/02_Resources/target.svg @@ -0,0 +1,19 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + + diff --git a/PageAndData02/02_StartingPoint/AppScope/app.json5 b/PageAndData02/02_StartingPoint/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..45b006b30ea74629e4219a71a70b74840df4ba82 --- /dev/null +++ b/PageAndData02/02_StartingPoint/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.pageanddata", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/PageAndData02/02_StartingPoint/AppScope/resources/base/element/string.json b/PageAndData02/02_StartingPoint/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..594cc44fec10161d4efeae095baef27280a0c27f --- /dev/null +++ b/PageAndData02/02_StartingPoint/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "PageAndData" + } + ] +} diff --git a/PageAndData02/02_StartingPoint/AppScope/resources/base/media/app_icon.png b/PageAndData02/02_StartingPoint/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/PageAndData02/02_StartingPoint/AppScope/resources/base/media/app_icon.png differ diff --git a/PageAndData02/02_StartingPoint/LICENSE b/PageAndData02/02_StartingPoint/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..381eb507bc1eef9b5158e496dedab769e810b657 --- /dev/null +++ b/PageAndData02/02_StartingPoint/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2022 Huawei Device Co., Ltd. All rights reserved. + + 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. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/PageAndData02/02_StartingPoint/build-profile.json5 b/PageAndData02/02_StartingPoint/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..c2b7ef27c250d201ac7d301c5183b34e51ac7a08 --- /dev/null +++ b/PageAndData02/02_StartingPoint/build-profile.json5 @@ -0,0 +1,29 @@ +{ + "app": { + "signingConfigs": [ + + ], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "5.0.0(12)", + "runtimeOS": "HarmonyOS" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/PageAndData02/02_StartingPoint/entry/build-profile.json5 b/PageAndData02/02_StartingPoint/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..20c75049f2d45e57d267899b6547c79fb6aa84c1 --- /dev/null +++ b/PageAndData02/02_StartingPoint/entry/build-profile.json5 @@ -0,0 +1,14 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + "runtimeOS": "HarmonyOS" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/PageAndData02/02_StartingPoint/entry/hvigorfile.ts b/PageAndData02/02_StartingPoint/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/PageAndData02/02_StartingPoint/entry/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { hapTasks } from '@ohos/hvigor-ohos-plugin'; diff --git a/PageAndData02/02_StartingPoint/entry/oh-package.json5 b/PageAndData02/02_StartingPoint/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..19b9234a98d43a4711a0fc32cef604159228d3cd --- /dev/null +++ b/PageAndData02/02_StartingPoint/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "license": "", + "devDependencies": {}, + "author": "", + "name": "entry", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} \ No newline at end of file diff --git a/PageAndData02/02_StartingPoint/entry/src/main/ets/common/constants/CommonConstants.ets b/PageAndData02/02_StartingPoint/entry/src/main/ets/common/constants/CommonConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..1f25be72b6f6c2a90bd793960c971f1ed5b26d5a --- /dev/null +++ b/PageAndData02/02_StartingPoint/entry/src/main/ets/common/constants/CommonConstants.ets @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2022 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. + */ + +/** + * Common constants for all features. + */ +export default class CommonConstants { + /** + * The width or height of the component is spread across the parent component. + */ + static readonly FULL_PARENT: string = '100%'; + + /** + * The sql of creating sports table. + */ + static readonly CREATE_SPORTS_TABLE_SQL: string = + 'CREATE TABLE IF NOT EXISTS SPORTS (ID INTEGER PRIMARY KEY AUTOINCREMENT, NAME TEXT ' + + 'NOT NULL, TYPE TEXT NOT NULL)'; + + /** + * The sql of creating plans table. + */ + static readonly CREATE_PLANS_TABLE_SQL: string = + 'CREATE TABLE IF NOT EXISTS PLANS (ID INTEGER PRIMARY KEY AUTOINCREMENT, SPORT_ID INTEGER ' + + 'NOT NULL, DURATION INTEGER NOT NULL, STATUS TEXT NOT NULL)'; + + /** + * The sql of querying all durations. + */ + static readonly QUERY_ALL_DURATIONS_SQL: string = + 'SELECT DISTINCT DURATION FROM PLANS'; + + /** + * The sql of query all plans. + */ + static readonly QUERY_ALL_PLANS_SQL: string = + 'SELECT p.id as ID,s.NAME as NAME,s.type as TYPE,p.DURATION as DURATION,p.STATUS as STATUS FROM SPORTS as s ' + + 'join PLANS as p where s.ID = P.SPORT_ID'; + + /** + * The sql of querying plans by duration. + */ + static readonly QUERY_PLANS_BY_DURATION_SQL: string = + 'SELECT p.id as ID,s.NAME as NAME,s.type as TYPE,p.DURATION as DURATION,p.STATUS as STATUS FROM SPORTS as s' + + ' join PLANS as p where s.ID = P.SPORT_ID and p.DURATION = '; + + /** + * The sql of querying plans by status. + */ + static readonly QUERY_PLANS_BY_STATUS_SQL: string = + 'SELECT p.id as ID,s.NAME as NAME,s.type as TYPE,p.DURATION as DURATION,p.STATUS as STATUS FROM SPORTS as s' + + ' join PLANS as p where s.ID = P.SPORT_ID and p.STATUS = "'; +} \ No newline at end of file diff --git a/PageAndData02/02_StartingPoint/entry/src/main/ets/entryability/EntryAbility.ets b/PageAndData02/02_StartingPoint/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..b7afa85923ac1d6d938836cbffb7b486ed002b93 --- /dev/null +++ b/PageAndData02/02_StartingPoint/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2024 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 { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { window } from '@kit.ArkUI'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + +/** + * Lift cycle management of Ability. + */ +export default class entryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); + } + + onDestroy(): void | Promise { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + windowStage.getMainWindow().then((data: window.Window) => { + // Window immersive. + data.setWindowLayoutFullScreen(true); + }); + windowStage.loadContent('pages/LoginPage', (err, data) => { + if (err.code) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} \ No newline at end of file diff --git a/PageAndData02/02_StartingPoint/entry/src/main/ets/pages/LoginPage.ets b/PageAndData02/02_StartingPoint/entry/src/main/ets/pages/LoginPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..b59332de27ba50ee5f23795ac6df2f157dd81e17 --- /dev/null +++ b/PageAndData02/02_StartingPoint/entry/src/main/ets/pages/LoginPage.ets @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2024 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. + */ + +@Extend(TextInput) +function inputStyle() { + .placeholderColor('#99182431') + .height('45vp') + .fontSize('18fp') + .backgroundColor('#F1F3F5') + .width('328vp') + .margin({ top: 12 }) +} + +@Extend(Line) +function lineStyle() { + .width('328vp') + .height('1vp') + .backgroundColor('#33182431') +} + +@Extend(Text) +function blueTextStyle() { + .fontColor('#007DFF') + .fontSize('14fp') + .fontWeight(FontWeight.Medium) +} + +/** + * Login page + */ +@Entry +@Component +struct LoginPage { + @Builder + imageButton(src: Resource) { + Button({ type: ButtonType.Circle, stateEffect: true }) { + Image(src) + } + .height('48vp') + .width('48vp') + .backgroundColor('#F1F3F5') + } + + build() { + Column() { + Image($r('app.media.logo')) + .width('78vp') + .height('78vp') + .margin({ + top: '150vp', + bottom: '8vp' + }) + Text($r('app.string.login_page')) + .fontSize('24fp') + .fontWeight(FontWeight.Medium) + .fontColor('#182431') + Text($r('app.string.login_more')) + .fontSize('16fp') + .fontColor('#99182431') + .margin({ + bottom: '30vp', + top: '8vp' + }) + + TextInput({ placeholder: $r('app.string.account') }) + .maxLength(11) + .type(InputType.Number) + .inputStyle() + Line() + .lineStyle() + + TextInput({ placeholder: $r('app.string.password') }) + .maxLength(8) + .type(InputType.Password) + .inputStyle() + Line() + .lineStyle() + + Row() { + Text($r('app.string.message_login')) + .blueTextStyle() + Text($r('app.string.forgot_password')) + .blueTextStyle() + } + .justifyContent(FlexAlign.SpaceBetween) + .width('328vp') + .margin({ top: '8vp' }) + + Button($r('app.string.login'), { type: ButtonType.Capsule }) + .width('328vp') + .height('40vp') + .fontSize('16fp') + .fontWeight(FontWeight.Medium) + .backgroundColor('#007DFF') + .margin({ + top: '48vp', + bottom: '12vp' + }) + + Text($r('app.string.register_account')) + .fontColor('#007DFF') + .fontSize('16fp') + .fontWeight(FontWeight.Medium) + + Blank() + Text($r('app.string.other_login_method')) + .fontColor('#838D97') + .fontSize('12fp') + .fontWeight(FontWeight.Medium) + .margin({ + top: '50vp', + bottom: '12vp' + }) + Row({ space: 44 }) { + this.imageButton($r('app.media.login_method1')) + this.imageButton($r('app.media.login_method2')) + this.imageButton($r('app.media.login_method3')) + } + .margin({ bottom: '16vp' }) + } + .padding({ + left: '12vp', + right: '12vp', + bottom: '24vp' + }) + .backgroundColor('#F1F3F5') + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/PageAndData02/02_StartingPoint/entry/src/main/module.json5 b/PageAndData02/02_StartingPoint/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..1fa3a18a9c72cebd1c9f90618abefaed11d329e4 --- /dev/null +++ b/PageAndData02/02_StartingPoint/entry/src/main/module.json5 @@ -0,0 +1,36 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ets", + "description": "$string:EntryAbility_desc", + "icon": "$media:startIcon", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/PageAndData02/02_StartingPoint/entry/src/main/resources/base/element/color.json b/PageAndData02/02_StartingPoint/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..2b713164d8fd7c5053a1af4809507f13410e05a6 --- /dev/null +++ b/PageAndData02/02_StartingPoint/entry/src/main/resources/base/element/color.json @@ -0,0 +1,80 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "white", + "value": "#FFFFFF" + }, + { + "name": "background", + "value": "#F1F3F5" + }, + { + "name": "title_text_color", + "value": "#182431" + }, + { + "name": "login_more_text_color", + "value": "#99182431" + }, + { + "name": "placeholder_color", + "value": "#99182431" + }, + { + "name": "line_color", + "value": "#33182431" + }, + { + "name": "login_button_color", + "value": "#007DFF" + }, + { + "name": "login_blue_text_color", + "value": "#007DFF" + }, + { + "name": "other_login_text_color", + "value": "#838D97" + }, + { + "name": "loading_color", + "value": "#182431" + }, + { + "name": "mainPage_selected", + "value": "#1698CE" + }, + { + "name": "mainPage_normal", + "value": "#6B6B6B" + }, + { + "name": "mainPage_backgroundColor", + "value": "#F1F3F5" + }, + { + "name": "home_grid_fontColor", + "value": "#99182431" + }, + { + "name": "setting_button_backgroundColor", + "value": "#E5E8EA" + }, + { + "name": "setting_button_fontColor", + "value": "#FA2A2D" + }, + { + "name": "grid_linear_start", + "value": "#1a0a5918" + }, + { + "name": "grid_linear_end", + "value": "#ffffff" + } + ] +} \ No newline at end of file diff --git a/PageAndData02/02_StartingPoint/entry/src/main/resources/base/element/float.json b/PageAndData02/02_StartingPoint/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..19ba0e188d1786b004c41f6ee067844629fe3502 --- /dev/null +++ b/PageAndData02/02_StartingPoint/entry/src/main/resources/base/element/float.json @@ -0,0 +1,292 @@ +{ + "float": [ + { + "name": "logo_image_size", + "value": "78vp" + }, + { + "name": "logo_margin_top", + "value": "100vp" + }, + { + "name": "logo_margin_bottom", + "value": "8vp" + }, + { + "name": "page_title_text_size", + "value": "24fp" + }, + { + "name": "normal_text_size", + "value": "16fp" + }, + { + "name": "big_text_size", + "value": "18fp" + }, + { + "name": "small_text_size", + "value": "14fp" + }, + { + "name": "little_text_size", + "value": "12fp" + }, + { + "name": "login_more_margin_bottom", + "value": "30vp" + }, + { + "name": "login_more_margin_top", + "value": "8vp" + }, + { + "name": "login_input_height", + "value": "45vp" + }, + { + "name": "forgot_margin_top", + "value": "8vp" + }, + { + "name": "input_margin_top", + "value": "12vp" + }, + { + "name": "line_height", + "value": "1vp" + }, + { + "name": "login_button_height", + "value": "40vp" + }, + { + "name": "login_button_margin_top", + "value": "87vp" + }, + { + "name": "login_button_margin_bottom", + "value": "12vp" + }, + { + "name": "vertical_line_margin", + "value": "15vp" + }, + { + "name": "login_progress_size", + "value": "30vp" + }, + { + "name": "login_progress_margin_top", + "value": "20vp" + }, + { + "name": "other_login_margin_top", + "value": "50vp" + }, + { + "name": "other_login_margin_bottom", + "value": "12vp" + }, + { + "name": "login_page_padding_bottom", + "value": "24vp" + }, + { + "name": "other_login_image_size", + "value": "48vp" + }, + { + "name": "page_padding_hor", + "value": "12vp" + }, + { + "name": "mainPage_baseTab_top", + "value": "4vp" + }, + { + "name": "mainPage_baseTab_margin", + "value": "8vp" + }, + { + "name": "mainPage_padding", + "value": "12vp" + }, + { + "name": "mainPage_barHeight", + "value": "56vp" + }, + { + "name": "mainPage_baseTab_size", + "value": "25vp" + }, + { + "name": "main_tab_fontSize", + "value": "10fp" + }, + { + "name": "mainPage_tabTitles_margin", + "value": "12vp" + }, + { + "name": "mainPage_tabTitles_padding", + "value": "12vp" + }, + { + "name": "home_swiper_borderRadius", + "value": "16vp" + }, + { + "name": "home_swiper_margin", + "value": "24vp" + }, + { + "name": "home_grid_columnsGap", + "value": "8vp" + }, + { + "name": "home_grid_rowGap", + "value": "12vp" + }, + { + "name": "home_grid_padding", + "value": "12vp" + }, + { + "name": "home_grid_height", + "value": "124vp" + }, + { + "name": "home_grid_margin", + "value": "10vp" + }, + { + "name": "home_list_margin", + "value": "4vp" + }, + { + "name": "home_list_padding", + "value": "8vp" + }, + { + "name": "home_grid_borderRadius", + "value": "24vp" + }, + { + "name": "home_text_margin", + "value": "12vp" + }, + { + "name": "home_backgroundImage_borderRadius", + "value": "12vp" + }, + { + "name": "home_secondGrid_height", + "value": "260vp" + }, + { + "name": "home_secondGrid_margin", + "value": "10vp" + }, + { + "name": "home_homeCell_size", + "value": "24vp" + }, + { + "name": "home_homeCell_margin", + "value": "4vp" + }, + { + "name": "home_homeCell_width", + "value": "80vp" + }, + { + "name": "home_homeCell_height", + "value": "80vp" + }, + { + "name": "setting_name_margin", + "value": "4vp" + }, + { + "name": "setting_account_margin", + "value": "24vp" + }, + { + "name": "setting_account_size", + "value": "48vp" + }, + { + "name": "setting_account_fontSize", + "value": "20fp" + }, + { + "name": "setting_account_text_height", + "value": "28vp" + }, + { + "name": "setting_account_height", + "value": "96vp" + }, + { + "name": "setting_account_padding", + "value": "24vp" + }, + { + "name": "setting_account_borderRadius", + "value": "16vp" + }, + { + "name": "setting_list_height", + "value": "48vp" + }, + { + "name": "setting_list_padding", + "value": "4vp" + }, + { + "name": "setting_list_borderRadius", + "value": "16vp" + }, + { + "name": "setting_list_startMargin", + "value": "42vp" + }, + { + "name": "setting_list_endMargin", + "value": "24vp" + }, + { + "name": "setting_list_strokeWidth", + "value": "0.25vp" + }, + { + "name": "setting_button_bottom", + "value": "55vp" + }, + { + "name": "setting_size", + "value": "22vp" + }, + { + "name": "setting_padding", + "value": "10vp" + }, + { + "name": "setting_jump_width", + "value": "12vp" + }, + { + "name": "setting_jump_height", + "value": "24vp" + }, + { + "name": "setting_settingCell_left", + "value": "8vp" + }, + { + "name": "setting_settingCell_right", + "value": "22vp" + } + ] +} \ No newline at end of file diff --git a/PageAndData02/02_StartingPoint/entry/src/main/resources/base/element/string.json b/PageAndData02/02_StartingPoint/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..c7b4788cf0cf49b8968e0059e28a9daba9b8d82f --- /dev/null +++ b/PageAndData02/02_StartingPoint/entry/src/main/resources/base/element/string.json @@ -0,0 +1,64 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "PageAndData" + }, + { + "name": "login_page", + "value": "Login page" + }, + { + "name": "login_more", + "value": "Log in to your account to use more services" + }, + { + "name": "account", + "value": "Account" + }, + { + "name": "password", + "value": "Password" + }, + { + "name": "login", + "value": "Log in" + }, + { + "name": "register_account", + "value": "Registering an Account" + }, + { + "name": "forgot_password", + "value": "Forgot Password" + }, + { + "name": "message_login", + "value": "SMS verification code login" + }, + { + "name": "other_login_method", + "value": "Other login methods" + }, + { + "name": "vertical_line", + "value": " | " + }, + { + "name": "input_empty_tips", + "value": "The input cannot be empty." + }, + { + "name": "login_success", + "value": "The login is successful." + } + ] +} \ No newline at end of file diff --git a/PageAndData02/02_StartingPoint/entry/src/main/resources/base/media/icon.png b/PageAndData02/02_StartingPoint/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/PageAndData02/02_StartingPoint/entry/src/main/resources/base/media/icon.png differ diff --git a/PageAndData02/02_StartingPoint/entry/src/main/resources/base/media/login_method1.png b/PageAndData02/02_StartingPoint/entry/src/main/resources/base/media/login_method1.png new file mode 100644 index 0000000000000000000000000000000000000000..a7b47f2ea5723f81684506765ed437d6684f8184 Binary files /dev/null and b/PageAndData02/02_StartingPoint/entry/src/main/resources/base/media/login_method1.png differ diff --git a/PageAndData02/02_StartingPoint/entry/src/main/resources/base/media/login_method2.png b/PageAndData02/02_StartingPoint/entry/src/main/resources/base/media/login_method2.png new file mode 100644 index 0000000000000000000000000000000000000000..320e9a5038da6fb9bdc201ed7675d4d4ad1a0c99 Binary files /dev/null and b/PageAndData02/02_StartingPoint/entry/src/main/resources/base/media/login_method2.png differ diff --git a/PageAndData02/02_StartingPoint/entry/src/main/resources/base/media/login_method3.png b/PageAndData02/02_StartingPoint/entry/src/main/resources/base/media/login_method3.png new file mode 100644 index 0000000000000000000000000000000000000000..28ac6ec8669b5634df443b10a4ced8f9c7e8a5c7 Binary files /dev/null and b/PageAndData02/02_StartingPoint/entry/src/main/resources/base/media/login_method3.png differ diff --git a/PageAndData02/02_StartingPoint/entry/src/main/resources/base/media/logo.png b/PageAndData02/02_StartingPoint/entry/src/main/resources/base/media/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..1dcac2208bef8df6893357ec8d43fdd6ee6763f7 Binary files /dev/null and b/PageAndData02/02_StartingPoint/entry/src/main/resources/base/media/logo.png differ diff --git a/PageAndData02/02_StartingPoint/entry/src/main/resources/base/media/startIcon.png b/PageAndData02/02_StartingPoint/entry/src/main/resources/base/media/startIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b Binary files /dev/null and b/PageAndData02/02_StartingPoint/entry/src/main/resources/base/media/startIcon.png differ diff --git a/PageAndData02/02_StartingPoint/entry/src/main/resources/base/profile/main_pages.json b/PageAndData02/02_StartingPoint/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..85a3c19566d76790ce243e498c48f665ce4008e5 --- /dev/null +++ b/PageAndData02/02_StartingPoint/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/LoginPage" + ] +} \ No newline at end of file diff --git a/PageAndData02/02_StartingPoint/entry/src/main/resources/en_US/element/string.json b/PageAndData02/02_StartingPoint/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..c7b4788cf0cf49b8968e0059e28a9daba9b8d82f --- /dev/null +++ b/PageAndData02/02_StartingPoint/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,64 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "PageAndData" + }, + { + "name": "login_page", + "value": "Login page" + }, + { + "name": "login_more", + "value": "Log in to your account to use more services" + }, + { + "name": "account", + "value": "Account" + }, + { + "name": "password", + "value": "Password" + }, + { + "name": "login", + "value": "Log in" + }, + { + "name": "register_account", + "value": "Registering an Account" + }, + { + "name": "forgot_password", + "value": "Forgot Password" + }, + { + "name": "message_login", + "value": "SMS verification code login" + }, + { + "name": "other_login_method", + "value": "Other login methods" + }, + { + "name": "vertical_line", + "value": " | " + }, + { + "name": "input_empty_tips", + "value": "The input cannot be empty." + }, + { + "name": "login_success", + "value": "The login is successful." + } + ] +} \ No newline at end of file diff --git a/PageAndData02/02_StartingPoint/entry/src/main/resources/zh_CN/element/string.json b/PageAndData02/02_StartingPoint/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..65c2b3089a03000882f83d9fe62a89ed96fcfd9b --- /dev/null +++ b/PageAndData02/02_StartingPoint/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,64 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "PageAndData" + }, + { + "name": "login_page", + "value": "登录界面" + }, + { + "name": "login_more", + "value": "登录账号以使用更多服务" + }, + { + "name": "account", + "value": "账号" + }, + { + "name": "password", + "value": "密码" + }, + { + "name": "login", + "value": "登录" + }, + { + "name": "register_account", + "value": "注册账号" + }, + { + "name": "forgot_password", + "value": "忘记密码" + }, + { + "name": "message_login", + "value": "短信验证码登录" + }, + { + "name": "other_login_method", + "value": "其他登录方式" + }, + { + "name": "vertical_line", + "value": " | " + }, + { + "name": "input_empty_tips", + "value": "输入不能为空" + }, + { + "name": "login_success", + "value": "登录成功" + } + ] +} \ No newline at end of file diff --git a/PageAndData02/02_StartingPoint/hvigor/hvigor-config.json5 b/PageAndData02/02_StartingPoint/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..73bfab4e997c8d4aea53b22fdd7f10112b30987f --- /dev/null +++ b/PageAndData02/02_StartingPoint/hvigor/hvigor-config.json5 @@ -0,0 +1,17 @@ +{ + "modelVersion": "5.0.0", + "dependencies": { + }, + "execution": { + // "daemon": true, /* Enable daemon compilation. Default: true */ + // "incremental": true, /* Enable incremental compilation. Default: true */ + // "parallel": true, /* Enable parallel compilation. Default: true */ + // "typeCheck": false, /* Enable typeCheck. Default: false */ + }, + "logging": { + // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */ + }, + "debugging": { + // "stacktrace": false /* Disable stacktrace compilation. Default: false */ + } +} \ No newline at end of file diff --git a/PageAndData02/02_StartingPoint/hvigorfile.ts b/PageAndData02/02_StartingPoint/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/PageAndData02/02_StartingPoint/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/PageAndData02/02_StartingPoint/oh-package.json5 b/PageAndData02/02_StartingPoint/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ba334a33e0ef0989bb410985996742da64bceda1 --- /dev/null +++ b/PageAndData02/02_StartingPoint/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "modelVersion": "5.0.0", + "license": "", + "devDependencies": { + }, + "author": "", + "name": "arktscomponents", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} \ No newline at end of file diff --git a/PageAndData02/README.md b/PageAndData02/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4dbf0080ad8600c802b2000f14e376bd993229d5 --- /dev/null +++ b/PageAndData02/README.md @@ -0,0 +1,6 @@ +根据【页面与数据:构建更加丰富的页面】教程进行学习,您可以选择从上一教程结束时构建完成的项目开始,也可以直接运行02_StartingPoint文件夹中的项目。 + +根据教程中的提示使用02_Resources文件夹中的文件。 + +如果您想要自行探索,可以直接打开02_Complete文件夹中的项目并浏览代码。 + diff --git a/PageAndData03/03_Complete/AppScope/app.json5 b/PageAndData03/03_Complete/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..45b006b30ea74629e4219a71a70b74840df4ba82 --- /dev/null +++ b/PageAndData03/03_Complete/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.pageanddata", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/PageAndData03/03_Complete/AppScope/resources/base/element/string.json b/PageAndData03/03_Complete/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..594cc44fec10161d4efeae095baef27280a0c27f --- /dev/null +++ b/PageAndData03/03_Complete/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "PageAndData" + } + ] +} diff --git a/PageAndData03/03_Complete/AppScope/resources/base/media/app_icon.png b/PageAndData03/03_Complete/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/PageAndData03/03_Complete/AppScope/resources/base/media/app_icon.png differ diff --git a/PageAndData03/03_Complete/LICENSE b/PageAndData03/03_Complete/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..381eb507bc1eef9b5158e496dedab769e810b657 --- /dev/null +++ b/PageAndData03/03_Complete/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2022 Huawei Device Co., Ltd. All rights reserved. + + 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. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/PageAndData03/03_Complete/build-profile.json5 b/PageAndData03/03_Complete/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..5ce78d4b70932305cc3f0b5ae6e9038c6fa9e57e --- /dev/null +++ b/PageAndData03/03_Complete/build-profile.json5 @@ -0,0 +1,29 @@ +{ + "app": { + "signingConfigs": [ + + ], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "5.0.0(12)", + "runtimeOS": "HarmonyOS" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/PageAndData03/03_Complete/entry/build-profile.json5 b/PageAndData03/03_Complete/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..20c75049f2d45e57d267899b6547c79fb6aa84c1 --- /dev/null +++ b/PageAndData03/03_Complete/entry/build-profile.json5 @@ -0,0 +1,14 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + "runtimeOS": "HarmonyOS" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/PageAndData03/03_Complete/entry/hvigorfile.ts b/PageAndData03/03_Complete/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/PageAndData03/03_Complete/entry/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { hapTasks } from '@ohos/hvigor-ohos-plugin'; diff --git a/PageAndData03/03_Complete/entry/oh-package.json5 b/PageAndData03/03_Complete/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..19b9234a98d43a4711a0fc32cef604159228d3cd --- /dev/null +++ b/PageAndData03/03_Complete/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "license": "", + "devDependencies": {}, + "author": "", + "name": "entry", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} \ No newline at end of file diff --git a/PageAndData03/03_Complete/entry/src/main/ets/common/network/ConnectionUtils.ets b/PageAndData03/03_Complete/entry/src/main/ets/common/network/ConnectionUtils.ets new file mode 100644 index 0000000000000000000000000000000000000000..e2ca4d96d32673d24b9815bf7bb316c5e3639895 --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/ets/common/network/ConnectionUtils.ets @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2024 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 { connection } from '@kit.NetworkKit'; +import { BusinessError } from '@kit.BasicServicesKit'; +import { promptAction } from '@kit.ArkUI'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + +const TAG: string = 'ConnectionUtils'; + +/** + * The ConnectionUtils provides the network listening capability. + */ +export class ConnectionUtils { + netConnection = connection.createNetConnection(); + + /** + *The method of checking whether the monitoring network is connected.. + */ + async isNetworkConnected(): Promise { + let result: boolean = false; + await connection.getDefaultNet().then(async (data: connection.NetHandle) => { + if (data.netId === 0) { + hilog.info(0x0000, TAG, 'network error'); + return; + } + await connection.getNetCapabilities(data).then( + (data: connection.NetCapabilities) => { + let bearerTypes: Set = new Set(data.bearerTypes); + let bearerTypesNum = Array.from(bearerTypes.values()); + for (let item of bearerTypesNum) { + if (item === 0) { + result = true; + hilog.info(0x0000, TAG, 'BEARER_CELLULAR'); + } else if (item === 1) { + result = true; + hilog.info(0x0000, TAG, 'BEARER_WIFI'); + } else if (item === 3) { + result = true; + hilog.info(0x0000, TAG, 'BEARER_ETHERNET'); + } else { + return; + } + } + }) + }) + return result; + } + + /** + *The method of opening register. + */ + openRegister() { + this.netConnection.register((error: BusinessError) => { + hilog.info(0x0000, TAG, JSON.stringify(error)); + }); + } + + /** + *The method of listening to the network status. + */ + registerNetworkAvailableStatus() { + this.netConnection.on('netAvailable', () => { + promptAction.showToast({ + message: $r('app.string.Network_Available'), + duration: 2000 + }); + }); + + this.netConnection.on('netUnavailable', () => { + promptAction.showToast({ + message: $r('app.string.Network_Unavailable'), + duration: 2000 + }); + }); + + this.netConnection.on('netLost', () => { + promptAction.showToast({ + message: $r('app.string.Network_Lost'), + duration: 2000 + }); + }); + } + + /** + *The method of closing register. + */ + closeRegister() { + this.netConnection.unregister((error: BusinessError) => { + hilog.info(0x0000, TAG, JSON.stringify(error)); + }); + } +} + +export default new ConnectionUtils(); \ No newline at end of file diff --git a/PageAndData03/03_Complete/entry/src/main/ets/common/network/HttpUtils.ets b/PageAndData03/03_Complete/entry/src/main/ets/common/network/HttpUtils.ets new file mode 100644 index 0000000000000000000000000000000000000000..529388a5430075676c94ba4a9cc5b67feda528b4 --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/ets/common/network/HttpUtils.ets @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2024 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 { http } from '@kit.NetworkKit'; +import { fileIo, fileUri } from '@kit.CoreFileKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import ResponseData from '../../viewmodel/ResponseData/ResponseData'; +import ListInfo from '../../viewmodel/ResponseData/ListInfo'; + +const TAG: string = 'HttpUtils'; +const IMAGE_URL: string = 'https://developer.huawei.com/system/modules/org.opencms.portal.template.core/' + + 'resources/harmony/img/jiantou_right.svg'; +const RESOURCE_URL: string = 'https://svc-drcn.developer.huawei.com/community/servlet/consumer' + + '/partnerActivityService/v1/developer/activity/terminalActivities/list'; + +/** + * The class of header. + */ +class Header { + contentType: string; + + constructor(contentType: string) { + this.contentType = contentType; + } +} + +/** + * The HttpUtils provides the capability of accessing the network through HTTP. + */ +export class HttpUtils { + httpRequest: http.HttpRequest; + + constructor() { + this.httpRequest = http.createHttp(); + } + + /** + * The method of initiating a GET request through HTTP. + */ + async getHttpRequest(cacheDir: string): Promise { + let responsePictureUri: string = ''; + await this.httpRequest.request(IMAGE_URL, { method: http.RequestMethod.GET }) + .then((data: http.HttpResponse) => { + let filePath = cacheDir + '/test.svg'; + let file = fileIo.openSync(filePath, fileIo.OpenMode.CREATE | fileIo.OpenMode.READ_WRITE); + responsePictureUri = fileUri.getUriFromPath(filePath); + fileIo.writeSync(file.fd, data.result as ArrayBuffer); + fileIo.closeSync(file.fd); + }) + return responsePictureUri; + } + + /** + * The method of initiating a POST request through HTTP. + */ + async postHttpRequest(): Promise { + let responseData: Array = []; + await this.httpRequest.request(RESOURCE_URL, + { + method: http.RequestMethod.POST, extraData: { + 'status': '1', + 'belong': '1', + 'language': 'cn', + 'needTop': 1, + 'displayChannel': [1, 3], + 'count': 4, + 'pagestart': 1, + 'type': '1,4,5,6' + }, + header: new Header('application/json;charset=UTF-8') + }).then((data: http.HttpResponse) => { + let result: ResponseData = JSON.parse(data.result as string); + responseData = result.value.list; + }).catch((err: Error) => { + hilog.info(0x0000, TAG, JSON.stringify(err)); + }); + return responseData; + } + + /** + * The method of destroying httpRequest. + */ + destroyHttpRequest() { + this.httpRequest.destroy(); + } +} \ No newline at end of file diff --git a/PageAndData03/03_Complete/entry/src/main/ets/common/network/RCPUtils.ets b/PageAndData03/03_Complete/entry/src/main/ets/common/network/RCPUtils.ets new file mode 100644 index 0000000000000000000000000000000000000000..066063d92508c5bbf262d8fb123a47fc9ba502a5 --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/ets/common/network/RCPUtils.ets @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2024 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 { rcp } from '@kit.RemoteCommunicationKit'; +import { fileIo, fileUri } from '@kit.CoreFileKit'; +import { BusinessError } from '@kit.BasicServicesKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import ResponseData from '../../viewmodel/ResponseData/ResponseData'; +import ListInfo from '../../viewmodel/ResponseData/ListInfo'; + +const TAG: string = 'RCPUtils'; +const list_source: string = 'https://svc-drcn.developer.huawei.com/community/servlet/consumer/' + + 'partnerActivityService/v1/developer/activity/terminalActivities/list'; + +/** + * The RCPUtils provides the capability of accessing the network through RCP. + */ +export class RCPUtils { + rcpSession: rcp.Session; + + constructor() { + this.rcpSession = rcp.createSession(); + } + + /** + * The method of initiating a GET request through RCP. + */ + async getRCPRequest(cacheDir: string): Promise { + let responsePictureUri: string = ''; + await this.rcpSession.get('https://developer.huawei.com/system/modules/org.opencms.portal.template.core/' + + 'resources/harmony/img/jiantou_right.svg') + .then((response) => { + let filePath = cacheDir + '/test.svg'; + let file = fileIo.openSync(filePath, fileIo.OpenMode.CREATE | fileIo.OpenMode.READ_WRITE); + responsePictureUri = fileUri.getUriFromPath(filePath); + fileIo.writeSync(file.fd, response.body); + fileIo.closeSync(file.fd); + }).catch((err: BusinessError) => { + hilog.error(0x0000, TAG, `err: err code is ${err.code}, err message is ${JSON.stringify(err)}`); + }); + return responsePictureUri; + } + + + /** + * The method of initiating a POST request through RCP. + */ + async postRCPRequest(): Promise { + let responseData: Array = []; + let requestContent: rcp.RequestContent = { + 'status': '1', + 'belong': '1', + 'language': 'cn', + 'needTop': 1, + 'displayChannel': [1, 3], + 'count': 4, + 'pagestart': 1, + 'type': '1,4,5,6' + } + await this.rcpSession.post(list_source, requestContent).then((response) => { + let result: ResponseData = response.toJSON() as ResponseData; + responseData = result.value.list; + }).catch((err: BusinessError) => { + hilog.error(0x0000, TAG, `err: err code is ${err.code}, err message is ${JSON.stringify(err)}`); + }); + return responseData; + } + + /** + * The method of closing a RCP Session. + */ + destroySession() { + this.rcpSession.close(); + } +} \ No newline at end of file diff --git a/PageAndData03/03_Complete/entry/src/main/ets/entryability/EntryAbility.ets b/PageAndData03/03_Complete/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..4a69eff069010eb1fce2a8f550777f30832a0a87 --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2024 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 { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { window } from '@kit.ArkUI'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import ConnectionUtils from '../common/network/ConnectionUtils'; + +/** + * Lift cycle management of Ability. + */ +export default class entryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + ConnectionUtils.openRegister(); + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); + } + + onDestroy(): void | Promise { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + windowStage.getMainWindow().then((data: window.Window) => { + // Window immersive. + data.setWindowLayoutFullScreen(true); + }); + windowStage.loadContent('pages/LoginPage', (err, data) => { + if (err.code) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + ConnectionUtils.registerNetworkAvailableStatus(); + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + ConnectionUtils.closeRegister(); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} \ No newline at end of file diff --git a/PageAndData03/03_Complete/entry/src/main/ets/pages/LoginPage.ets b/PageAndData03/03_Complete/entry/src/main/ets/pages/LoginPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..e736b5a437164f41a5d0ca1a3979b89599cf93d4 --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/ets/pages/LoginPage.ets @@ -0,0 +1,205 @@ +/* + * Copyright (c) 2024 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 { promptAction } from '@kit.ArkUI'; +import ConnectionUtils from '../common/network/ConnectionUtils'; +import { MainPage } from './MainPage'; + +@Extend(TextInput) +function inputStyle() { + .placeholderColor('#99182431') + .height('45vp') + .fontSize('18fp') + .backgroundColor('#F1F3F5') + .width('328vp') + .margin({ top: 12 }) +} + +@Extend(Line) +function lineStyle() { + .width('328vp') + .height('1vp') + .backgroundColor('#33182431') +} + +@Extend(Text) +function blueTextStyle() { + .fontColor('#007DFF') + .fontSize('14fp') + .fontWeight(FontWeight.Medium) +} + +/** + * Login page + */ +@Entry +@Component +struct LoginPage { + @State account: string = ''; + @State password: string = ''; + @State isShowProgress: boolean = false; + private timeOutId: number = -1; + pathStack: NavPathStack = new NavPathStack(); + + @Builder + imageButton(src: Resource) { + Button({ type: ButtonType.Circle, stateEffect: true }) { + Image(src) + } + .height('48vp') + .width('48vp') + .backgroundColor('#F1F3F5') + } + + login(result: boolean): void { + if (this.account === '' || this.password === '') { + promptAction.showToast({ + message: $r('app.string.input_empty_tips') + }); + } else { + this.isShowProgress = true; + if (this.timeOutId === -1) { + this.timeOutId = setTimeout(async () => { + this.isShowProgress = false; + this.timeOutId = -1; + + if (result) { + this.pathStack.pushPathByName('MainPage', null); + } else { + promptAction.showToast({ + message: $r('app.string.Network_Lost') + }); + } + }, 2000); + } + } + } + + aboutToDisappear() { + clearTimeout(this.timeOutId); + this.timeOutId = -1; + } + + build() { + Navigation(this.pathStack) { + Column() { + Image($r('app.media.logo')) + .width('78vp') + .height('78vp') + .margin({ + top: '150vp', + bottom: '8vp' + }) + Text($r('app.string.login_page')) + .fontSize('24fp') + .fontWeight(FontWeight.Medium) + .fontColor('#182431') + Text($r('app.string.login_more')) + .fontSize('16fp') + .fontColor('#99182431') + .margin({ + bottom: '30vp', + top: '8vp' + }) + + TextInput({ placeholder: $r('app.string.account') }) + .maxLength(11) + .type(InputType.Number) + .inputStyle() + .onChange((value: string) => { + this.account = value; + }) + Line() + .lineStyle() + + TextInput({ placeholder: $r('app.string.password') }) + .maxLength(8) + .type(InputType.Password) + .inputStyle() + .onChange((value: string) => { + this.password = value; + }) + Line() + .lineStyle() + + Row() { + Text($r('app.string.message_login')) + .blueTextStyle() + Text($r('app.string.forgot_password')) + .blueTextStyle() + } + .justifyContent(FlexAlign.SpaceBetween) + .width('328vp') + .margin({ top: '8vp' }) + + Button($r('app.string.login'), { type: ButtonType.Capsule }) + .width('328vp') + .height('40vp') + .fontSize('16fp') + .fontWeight(FontWeight.Medium) + .backgroundColor('#007DFF') + .margin({ + top: '48vp', + bottom: '12vp' + }) + .onClick(async () => { + await ConnectionUtils.isNetworkConnected().then((value) => { + this.login(value); + }) + }) + Text($r('app.string.register_account')) + .fontColor('#007DFF') + .fontSize('16fp') + .fontWeight(FontWeight.Medium) + + if (this.isShowProgress) { + LoadingProgress() + .color('#182431') + .width('30vp') + .height('30vp') + .margin({ top: '20vp' }) + } + + Blank() + Text($r('app.string.other_login_method')) + .fontColor('#838D97') + .fontSize('12fp') + .fontWeight(FontWeight.Medium) + .margin({ + top: '50vp', + bottom: '12vp' + }) + Row({ space: 44 }) { + this.imageButton($r('app.media.login_method1')) + this.imageButton($r('app.media.login_method2')) + this.imageButton($r('app.media.login_method3')) + } + .margin({ bottom: '16vp' }) + } + .height('100%') + .width('100%') + .padding({ + left: '12vp', + right: '12vp', + bottom: '24vp' + }) + } + .backgroundColor('#F1F3F5') + .width('100%') + .height('100%') + .hideTitleBar(true) + .hideToolBar(true) + } +} \ No newline at end of file diff --git a/PageAndData03/03_Complete/entry/src/main/ets/pages/MainPage.ets b/PageAndData03/03_Complete/entry/src/main/ets/pages/MainPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..c688847f94cfa20fbbb4e58a588962b6f5abc26f --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/ets/pages/MainPage.ets @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2024 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 Home from '../view/Home'; +import Setting from '../view/Setting'; + +@Builder +export function MainPageBuilder() { + MainPage() +} + +/** + * Main page + */ +@Component +export struct MainPage { + @State currentIndex: number = 0; + private tabsController: TabsController = new TabsController(); + + @Builder + tabBuilder(title: Resource, index: number, selectedImg: Resource) { + Column() { + SymbolGlyph(selectedImg) + .fontSize('24fp') + .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_OPACITY) + .symbolEffect(new BounceSymbolEffect(EffectScope.WHOLE, EffectDirection.UP), + this.currentIndex === index ? true : false) + .fontColor(this.currentIndex === index ? ['#0a59f7'] : ['#66000000']) + Text(title) + .margin({ top: '4vp' }) + .fontSize('10fp') + .fontWeight(500) + .fontColor(this.currentIndex === index ? '#0a59f7' : '#66000000') + } + .backgroundColor('#F1F3F5') + .justifyContent(FlexAlign.Center) + .height('56vp') + .width('100%') + .onClick(() => { + this.currentIndex = index; + this.tabsController.changeIndex(this.currentIndex); + }) + } + + build() { + NavDestination() { + Tabs({ + barPosition: BarPosition.End, + controller: this.tabsController + }) { + TabContent() { + Home() + } + .padding({ + left: '12vp', + right: '12vp' + }) + .backgroundColor('#F1F3F5') + .tabBar(this.tabBuilder($r('app.string.Tab_Bar_One'), 0, $r('sys.symbol.house_fill'))) + + TabContent() { + Setting() + } + .padding({ + left: '12vp', + right: '12vp' + }) + .backgroundColor('#F1F3F5') + .tabBar(this.tabBuilder($r('app.string.Tab_Bar_Two'), 1, $r('sys.symbol.person_crop_circle_fill_1'))) + } + .margin({ bottom: '64vp' }) + .width('100%') + .height('100%') + .barHeight('80vp') + .barMode(BarMode.Fixed) + .onChange((index: number) => { + this.currentIndex = index; + }) + } + .height('100%') + .hideTitleBar(true) + .backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/PageAndData03/03_Complete/entry/src/main/ets/view/Home.ets b/PageAndData03/03_Complete/entry/src/main/ets/view/Home.ets new file mode 100644 index 0000000000000000000000000000000000000000..f5fbc66cde44aa27a7264296a0cf63baad822fb3 --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/ets/view/Home.ets @@ -0,0 +1,185 @@ +/* + * Copyright (c) 2024 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 { common } from '@kit.AbilityKit'; +import mainViewModel from '../viewmodel/MainViewModel'; +import ItemData from '../viewmodel/ItemData'; +import ListInfo from '../viewmodel/ResponseData/ListInfo'; +import { HttpUtils } from '../common/network/HttpUtils'; +import { RCPUtils } from '../common/network/RCPUtils'; + +/** + * Home tab content + */ +@Component +export default struct Home { + @State httpGridItems: Array = []; + @State pictureUri: string = ''; + private swiperController: SwiperController = new SwiperController(); + private context = getContext(this) as common.UIAbilityContext; + private applicationContext = this.context.getApplicationContext(); + private cacheDir = this.applicationContext.filesDir; + + async aboutToAppear(): Promise { + // let httpUtil: HttpUtils = new HttpUtils(); + // await httpUtil.postHttpRequest().then((value : Array)=>{ + // this.httpGridItems = value; + // }); + // await httpUtil.getHttpRequest(this.cacheDir).then((value: string) => { + // this.pictureUri = value; + // }); + // httpUtil.destroyHttpRequest(); + + let rcpUtil: RCPUtils = new RCPUtils(); + await rcpUtil.postRCPRequest().then((value: Array) => { + this.httpGridItems = value; + }); + await rcpUtil.getRCPRequest(this.cacheDir).then((value: string) => { + this.pictureUri = value; + }); + rcpUtil.destroySession(); + } + + build() { + Column() { + Text($r('app.string.mainPage_tabTitles_home')) + .width('100%') + .margin({ + top: '48vp', + bottom: '12vp' + }) + .fontWeight(700) + .fontSize('26fp') + + Scroll() { + Column() { + Swiper(this.swiperController) { + ForEach(mainViewModel.getSwiperImages(), (img: Resource) => { + Image(img) + .width('100%') + .borderRadius('16vp') + }, (img: Resource) => JSON.stringify(img.id)) + } + .autoPlay(true) + + Grid() { + ForEach(mainViewModel.getFirstGridData(), (item: ItemData) => { + GridItem() { + Column() { + Image(item.img) + .width('40vp') + .height('40vp') + Text(item.title) + .fontSize('12fp') + .margin({ top: '4vp' }) + } + } + }, (item: ItemData) => JSON.stringify(item)) + } + .backgroundImage($r('app.media.backgroundImage')) + .backgroundImageSize({ + width: '100%', + height: '156vp' + }) + .columnsTemplate('1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr') + .columnsGap('8vp') + .rowsGap('12vp') + .margin({ top: '12vp' }) + .padding({ + top: '12vp', + bottom: '12vp' + }) + .height('156vp') + .backgroundColor(Color.White) + .borderRadius('16vp') + + Text($r('app.string.home_list')) + .fontSize('18fp') + .fontWeight(700) + .width('100%') + .margin({ + top: '18vp', + bottom: '8vp' + }) + + List() { + ForEach(this.httpGridItems, (secondItem: ListInfo) => { + ListItem() { + Row() { + Image(secondItem.indexNavPic) + .width('130vp') + .height('80vp') + .objectFit(ImageFit.TOP_START) + .borderRadius('8vp') + .margin({ right: '12vp' }) + + Column() { + Text(secondItem.activityName) + .width('190vp') + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(1) + .fontSize('16fp') + .fontWeight(FontWeight.Medium) + Text(secondItem.theme) + .width('190vp') + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(2) + .margin({ top: '4vp' }) + .fontSize('12fp') + .fontColor('#99182431') + Row() { + Image(this.pictureUri) + .width('20vp') + .opacity(0.5) + } + .width('170vp') + .margin({ top: '10.5vp' }) + .justifyContent(FlexAlign.End) + .alignItems(VerticalAlign.Bottom) + } + .alignItems(HorizontalAlign.Start) + } + .width('100%') + .padding({ + left: '12vp', + right: '12vp', + top: '12vp', + bottom: '12vp' + }) + .justifyContent(FlexAlign.SpaceBetween) + } + .margin({ bottom: '8vp' }) + .borderRadius('16vp') + .backgroundColor('#ffffff') + .borderRadius($r('app.float.home_backgroundImage_borderRadius')) + .align(Alignment.TopStart) + .width('100%') + }, (secondItem: ListInfo) => JSON.stringify(secondItem)) + } + .scrollBar(BarState.Off) + .width('100%') + } + } + .height('660vp') + .align(Alignment.TopStart) + .scrollBar(BarState.Off) + } + .justifyContent(FlexAlign.Start) + .alignItems(HorizontalAlign.Start) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/PageAndData03/03_Complete/entry/src/main/ets/view/Setting.ets b/PageAndData03/03_Complete/entry/src/main/ets/view/Setting.ets new file mode 100644 index 0000000000000000000000000000000000000000..daa9c055cf34fb061ab108e7a673c6f49457eaf0 --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/ets/view/Setting.ets @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2024 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 ItemData from '../viewmodel/ItemData'; +import mainViewModel from '../viewmodel/MainViewModel'; + +/** + * Setting tab content + */ +@Component +export default struct Setting { + @Builder + settingCell(item: ItemData) { + Row() { + Row({}) { + Image(item.img) + .height('22vp') + .margin({ + left: '16vp', + right: '12vp' + }) + Text(item.title) + .fontSize('16fp') + } + + if (item.others === undefined) { + Image($r('app.media.right_grey')) + .width('12vp') + .height('24vp') + } else { + Toggle({ type: ToggleType.Switch, isOn: false }) + } + } + .justifyContent(FlexAlign.SpaceBetween) + .width('100%') + .padding({ + left: '8vp', + right: '22vp' + }) + } + + build() { + Scroll() { + Column({ space: 12 }) { + Text($r('app.string.mainPage_tabTitles_mine')) + .width('100%') + .margin({ top: '48vp' }) + .fontWeight(700) + .fontSize('26fp') + + Row() { + Image($r('app.media.account')) + .width('48vp') + .height('48vp') + Column() { + Text($r('app.string.setting_account_name')) + .fontSize('20fp') + Text($r('app.string.setting_account_email')) + .fontSize('12fp') + .margin({ top: '4vp' }) + } + .alignItems(HorizontalAlign.Start) + .margin({ left: '12vp' }) + } + .alignItems(VerticalAlign.Center) + .width('100%') + + List({ space: 12 }) { + ForEach(mainViewModel.getSettingListData(), (item: ItemData[]) => { + ListItemGroup() { + ForEach(item, (cell: ItemData) => { + ListItem() { + this.settingCell(cell) + } + .height('48vp') + }) + } + .divider({ + strokeWidth: '1vp', + color: '#0d000000', + startMargin: '42vp', + endMargin: '24vp' + }) + .backgroundColor('#ffffff') + .borderRadius('16vp') + }, (item: ItemData) => JSON.stringify(item)) + } + .scrollBar(BarState.Off) + .width('100%') + .padding({ + top: '4vp', + bottom: '4vp' + }) + + Blank() + + Button($r('app.string.setting_button'), { type: ButtonType.Capsule }) + .width('90%') + .height('40vp') + .fontSize('16fp') + .fontColor('#FA2A2D') + .fontWeight(FontWeight.Medium) + .backgroundColor('#E5E8EA') + .margin({ bottom: '16vp' }) + } + .height('100%') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/PageAndData03/03_Complete/entry/src/main/ets/view/test.ets b/PageAndData03/03_Complete/entry/src/main/ets/view/test.ets new file mode 100644 index 0000000000000000000000000000000000000000..74041dada999c834c52b23f6b5e7c301f0e51ae7 --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/ets/view/test.ets @@ -0,0 +1,182 @@ +/* + * Copyright (c) 2024 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 { common } from '@kit.AbilityKit'; +import mainViewModel from '../viewmodel/MainViewModel'; +import ItemData from '../viewmodel/ItemData'; +import ListInfo from '../viewmodel/ResponseData/ListInfo'; +import { HttpUtils } from '../common/network/HttpUtils'; +import { RCPUtils } from '../common/network/RCPUtils'; + +@Component +export default struct Home { + @State httpGridItems: Array = []; + @State pictureUri: string = ''; + private swiperController: SwiperController = new SwiperController(); + private context = getContext(this) as common.UIAbilityContext; + private applicationContext = this.context.getApplicationContext(); + private cacheDir = this.applicationContext.filesDir; + + async aboutToAppear(): Promise { + // let httpUtil: HttpUtils = new HttpUtils(); + // await httpUtil.postHttpRequest().then((value : Array)=>{ + // this.httpGridItems = value; + // }); + // await httpUtil.getHttpRequest(this.cacheDir).then((value: string) => { + // this.pictureUri = value; + // }); + // httpUtil.destroyHttpRequest(); + + let rcpUtil: RCPUtils = new RCPUtils(); + await rcpUtil.postRCPRequest().then((value: Array) => { + this.httpGridItems = value; + }); + await rcpUtil.getRCPRequest(this.cacheDir).then((value: string) => { + this.pictureUri = value; + }); + rcpUtil.destroySession(); + } + + build() { + Column() { + Text($r('app.string.mainPage_tabTitles_home')) + .width('100%') + .margin({ + top: '48vp', + bottom: '12vp' + }) + .fontWeight(700) + .fontSize('26fp') + + Scroll() { + Column() { + Swiper(this.swiperController) { + ForEach(mainViewModel.getSwiperImages(), (img: Resource) => { + Image(img) + .width('100%') + .borderRadius('16vp') + }, (img: Resource) => JSON.stringify(img.id)) + } + .autoPlay(true) + + Grid() { + ForEach(mainViewModel.getFirstGridData(), (item: ItemData) => { + GridItem() { + Column() { + Image(item.img) + .width('40vp') + .height('40vp') + Text(item.title) + .fontSize('12fp') + .margin({ top: '4vp' }) + } + } + }, (item: ItemData) => JSON.stringify(item)) + } + .backgroundImage($r('app.media.backgroundImage')) + .backgroundImageSize({ + width: '100%', + height: '156vp' + }) + .columnsTemplate('1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr') + .columnsGap('8vp') + .rowsGap('12vp') + .margin({ top: '12vp' }) + .padding({ + top: '12vp', + bottom: '12vp' + }) + .height('156vp') + .backgroundColor(Color.White) + .borderRadius('16vp') + + Text($r('app.string.home_list')) + .fontSize('18fp') + .fontWeight(700) + .width('100%') + .margin({ + top: '18vp', + bottom: '8vp' + }) + + List() { + ForEach(this.httpGridItems, (secondItem: ListInfo) => { + ListItem() { + Row() { + Image(secondItem.indexNavPic) + .width('130vp') + .height('80vp') + .objectFit(ImageFit.TOP_START) + .borderRadius('8vp') + .margin({ right: '12vp' }) + + Column() { + Text(secondItem.activityName) + .width('190vp') + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(1) + .fontSize('16fp') + .fontWeight(FontWeight.Medium) + Text(secondItem.theme) + .width('190vp') + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(2) + .margin({ top: '4vp' }) + .fontSize('12fp') + .fontColor('#99182431') + Row() { + Image(this.pictureUri) + .width('20vp') + .opacity(0.5) + } + .width('170vp') + .margin({ top: '10.5vp' }) + .justifyContent(FlexAlign.End) + .alignItems(VerticalAlign.Bottom) + } + .alignItems(HorizontalAlign.Start) + } + .width('100%') + .padding({ + left: '12vp', + right: '12vp', + top: '12vp', + bottom: '12vp' + }) + .justifyContent(FlexAlign.SpaceBetween) + } + .margin({ bottom: '8vp' }) + .borderRadius('16vp') + .backgroundColor('#ffffff') + .borderRadius($r('app.float.home_backgroundImage_borderRadius')) + .align(Alignment.TopStart) + .width('100%') + }, (secondItem: ListInfo) => JSON.stringify(secondItem)) + } + .scrollBar(BarState.Off) + .width('100%') + } + } + .height('660vp') + .align(Alignment.TopStart) + .scrollBar(BarState.Off) + } + .justifyContent(FlexAlign.Start) + .alignItems(HorizontalAlign.Start) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/PageAndData03/03_Complete/entry/src/main/ets/viewmodel/HttpGridItem.ets b/PageAndData03/03_Complete/entry/src/main/ets/viewmodel/HttpGridItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..745c9b1bfe301b16ec91d94ef465194dbed8fd34 --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/ets/viewmodel/HttpGridItem.ets @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2024 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. + */ + +/** + * List item data entity. + */ +export default class HttpGridItem { + /** + * Text of list item. + */ + title: string; + /** + * Image of list item. + */ + img: string; + /** + * Other resource of list item. + */ + content: string; + + constructor(title: string, img: string, content: string) { + this.title = title; + this.img = img; + this.content = content; + } +} \ No newline at end of file diff --git a/PageAndData03/03_Complete/entry/src/main/ets/viewmodel/ItemData.ets b/PageAndData03/03_Complete/entry/src/main/ets/viewmodel/ItemData.ets new file mode 100644 index 0000000000000000000000000000000000000000..658e6b1dc9529e7612f8a5095b4695a2032ce8e2 --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/ets/viewmodel/ItemData.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 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. + */ + +/** + * List item data entity. + */ +export default class PageResource { + /** + * ID of list item. + */ + id: number; + /** + * Text of list item. + */ + title: Resource; + /** + * Image of list item. + */ + img: Resource; + /** + * Other resource of list item. + */ + others?: Resource; + + constructor(id: number, title: Resource, img: Resource, others?: Resource) { + this.id = id; + this.title = title; + this.img = img; + this.others = others; + } +} \ No newline at end of file diff --git a/PageAndData03/03_Complete/entry/src/main/ets/viewmodel/MainViewModel.ets b/PageAndData03/03_Complete/entry/src/main/ets/viewmodel/MainViewModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..6fbca7d8221f48af2509bb40da08f564c8a9dd23 --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/ets/viewmodel/MainViewModel.ets @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2024 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 ItemData from './ItemData'; + +/** + * Binds data to components and provides interfaces. + */ +export class MainViewModel { + /** + * Get swiper image data. + * + * @return {Array} swiperImages. + */ + getSwiperImages(): Array { + let swiperImages: Resource[] = [ + $r('app.media.fig1'), + $r('app.media.fig2'), + $r('app.media.fig3'), + $r('app.media.fig4') + ]; + return swiperImages; + } + + /** + * Get data of the first grid. + * + * @return {Array} firstGridData. + */ + getFirstGridData(): Array { + let firstGridData: ItemData[] = [ + new ItemData(0, $r('app.string.my_love'), $r('app.media.love')), + new ItemData(1, $r('app.string.history_record'), $r('app.media.record')), + new ItemData(2, $r('app.string.message'), $r('app.media.message')), + new ItemData(3, $r('app.string.shopping_cart'), $r('app.media.shopping')), + new ItemData(4, $r('app.string.my_goal'), $r('app.media.target')), + new ItemData(5, $r('app.string.group'), $r('app.media.circle')), + new ItemData(6, $r('app.string.favorites'), $r('app.media.favorite')), + new ItemData(7, $r('app.string.recycle_bin'), $r('app.media.recycle')) + ]; + return firstGridData; + } + + /** + * Get data of the setting list. + * + * @return {Array} settingListData. + */ + getSettingListData(): Array> { + let settingListData: ItemData[][] = [ + [ + new ItemData(0, $r('app.string.setting_list_news'), $r('app.media.news'), $r('app.string.setting_toggle')) + ], + [ + new ItemData(1, $r('app.string.setting_list_font'), $r('app.media.data')), + new ItemData(2, $r('app.string.setting_list_menu'), $r('app.media.menu')), + ], + [ + new ItemData(3, $r('app.string.clear_cache'), $r('app.media.storage')), + new ItemData(4, $r('app.string.setting_list_privacy'), $r('app.media.person_shield')), + ], + [ + new ItemData(5, $r('app.string.setting_list_about'), $r('app.media.about')) + ] + ]; + return settingListData; + } +} + +export default new MainViewModel(); \ No newline at end of file diff --git a/PageAndData03/03_Complete/entry/src/main/ets/viewmodel/ResponseData/ListInfo.ets b/PageAndData03/03_Complete/entry/src/main/ets/viewmodel/ResponseData/ListInfo.ets new file mode 100644 index 0000000000000000000000000000000000000000..569823b4da1588d054bc1368d400ab20ab660c62 --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/ets/viewmodel/ResponseData/ListInfo.ets @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2024 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 class ListInfo { + public activityName: string; + public theme: string; + public indexNavPic: string; + + constructor(activityName: string, theme: string, indexNavPic: string) { + this.activityName = activityName; + this.theme = theme; + this.indexNavPic = indexNavPic; + } +} \ No newline at end of file diff --git a/PageAndData03/03_Complete/entry/src/main/ets/viewmodel/ResponseData/ResponseData.ets b/PageAndData03/03_Complete/entry/src/main/ets/viewmodel/ResponseData/ResponseData.ets new file mode 100644 index 0000000000000000000000000000000000000000..5f27bfc990dc43f9d778d70191fa5a12df3532b9 --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/ets/viewmodel/ResponseData/ResponseData.ets @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2024 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 Value from './Value'; + +export default class ResponseData { + public code: string; + public value: Value; + + constructor(code: string, value: Value) { + this.code = code; + this.value = value; + } +} \ No newline at end of file diff --git a/PageAndData03/03_Complete/entry/src/main/ets/viewmodel/ResponseData/Value.ets b/PageAndData03/03_Complete/entry/src/main/ets/viewmodel/ResponseData/Value.ets new file mode 100644 index 0000000000000000000000000000000000000000..8af68edb0f61f7114ede333ea603a2d9505b1895 --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/ets/viewmodel/ResponseData/Value.ets @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2024 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 ListInfo from './ListInfo'; + +export default class Value { + public list: Array; + + constructor(list: Array) { + this.list = list; + } +} \ No newline at end of file diff --git a/PageAndData03/03_Complete/entry/src/main/module.json5 b/PageAndData03/03_Complete/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ccfb83c424f5a6d145e085ac2e658114f7ec522b --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/module.json5 @@ -0,0 +1,59 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone" + ], + "routerMap": "$profile:route_map", + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ets", + "description": "$string:EntryAbility_desc", + "icon": "$media:startIcon", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ], + "requestPermissions": [ + { + "name": "ohos.permission.INTERNET", + "reason": "$string:Internet", + "usedScene": { + "abilities": [ + "EntryAbility" + ], + "when": "inuse" + } + }, + { + "name": "ohos.permission.GET_NETWORK_INFO", + "reason": "$string:network_info", + "usedScene": { + "abilities": [ + "EntryAbility" + ], + "when": "inuse" + } + } + ] + } +} \ No newline at end of file diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/element/color.json b/PageAndData03/03_Complete/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..2b713164d8fd7c5053a1af4809507f13410e05a6 --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/resources/base/element/color.json @@ -0,0 +1,80 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "white", + "value": "#FFFFFF" + }, + { + "name": "background", + "value": "#F1F3F5" + }, + { + "name": "title_text_color", + "value": "#182431" + }, + { + "name": "login_more_text_color", + "value": "#99182431" + }, + { + "name": "placeholder_color", + "value": "#99182431" + }, + { + "name": "line_color", + "value": "#33182431" + }, + { + "name": "login_button_color", + "value": "#007DFF" + }, + { + "name": "login_blue_text_color", + "value": "#007DFF" + }, + { + "name": "other_login_text_color", + "value": "#838D97" + }, + { + "name": "loading_color", + "value": "#182431" + }, + { + "name": "mainPage_selected", + "value": "#1698CE" + }, + { + "name": "mainPage_normal", + "value": "#6B6B6B" + }, + { + "name": "mainPage_backgroundColor", + "value": "#F1F3F5" + }, + { + "name": "home_grid_fontColor", + "value": "#99182431" + }, + { + "name": "setting_button_backgroundColor", + "value": "#E5E8EA" + }, + { + "name": "setting_button_fontColor", + "value": "#FA2A2D" + }, + { + "name": "grid_linear_start", + "value": "#1a0a5918" + }, + { + "name": "grid_linear_end", + "value": "#ffffff" + } + ] +} \ No newline at end of file diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/element/float.json b/PageAndData03/03_Complete/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..19ba0e188d1786b004c41f6ee067844629fe3502 --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/resources/base/element/float.json @@ -0,0 +1,292 @@ +{ + "float": [ + { + "name": "logo_image_size", + "value": "78vp" + }, + { + "name": "logo_margin_top", + "value": "100vp" + }, + { + "name": "logo_margin_bottom", + "value": "8vp" + }, + { + "name": "page_title_text_size", + "value": "24fp" + }, + { + "name": "normal_text_size", + "value": "16fp" + }, + { + "name": "big_text_size", + "value": "18fp" + }, + { + "name": "small_text_size", + "value": "14fp" + }, + { + "name": "little_text_size", + "value": "12fp" + }, + { + "name": "login_more_margin_bottom", + "value": "30vp" + }, + { + "name": "login_more_margin_top", + "value": "8vp" + }, + { + "name": "login_input_height", + "value": "45vp" + }, + { + "name": "forgot_margin_top", + "value": "8vp" + }, + { + "name": "input_margin_top", + "value": "12vp" + }, + { + "name": "line_height", + "value": "1vp" + }, + { + "name": "login_button_height", + "value": "40vp" + }, + { + "name": "login_button_margin_top", + "value": "87vp" + }, + { + "name": "login_button_margin_bottom", + "value": "12vp" + }, + { + "name": "vertical_line_margin", + "value": "15vp" + }, + { + "name": "login_progress_size", + "value": "30vp" + }, + { + "name": "login_progress_margin_top", + "value": "20vp" + }, + { + "name": "other_login_margin_top", + "value": "50vp" + }, + { + "name": "other_login_margin_bottom", + "value": "12vp" + }, + { + "name": "login_page_padding_bottom", + "value": "24vp" + }, + { + "name": "other_login_image_size", + "value": "48vp" + }, + { + "name": "page_padding_hor", + "value": "12vp" + }, + { + "name": "mainPage_baseTab_top", + "value": "4vp" + }, + { + "name": "mainPage_baseTab_margin", + "value": "8vp" + }, + { + "name": "mainPage_padding", + "value": "12vp" + }, + { + "name": "mainPage_barHeight", + "value": "56vp" + }, + { + "name": "mainPage_baseTab_size", + "value": "25vp" + }, + { + "name": "main_tab_fontSize", + "value": "10fp" + }, + { + "name": "mainPage_tabTitles_margin", + "value": "12vp" + }, + { + "name": "mainPage_tabTitles_padding", + "value": "12vp" + }, + { + "name": "home_swiper_borderRadius", + "value": "16vp" + }, + { + "name": "home_swiper_margin", + "value": "24vp" + }, + { + "name": "home_grid_columnsGap", + "value": "8vp" + }, + { + "name": "home_grid_rowGap", + "value": "12vp" + }, + { + "name": "home_grid_padding", + "value": "12vp" + }, + { + "name": "home_grid_height", + "value": "124vp" + }, + { + "name": "home_grid_margin", + "value": "10vp" + }, + { + "name": "home_list_margin", + "value": "4vp" + }, + { + "name": "home_list_padding", + "value": "8vp" + }, + { + "name": "home_grid_borderRadius", + "value": "24vp" + }, + { + "name": "home_text_margin", + "value": "12vp" + }, + { + "name": "home_backgroundImage_borderRadius", + "value": "12vp" + }, + { + "name": "home_secondGrid_height", + "value": "260vp" + }, + { + "name": "home_secondGrid_margin", + "value": "10vp" + }, + { + "name": "home_homeCell_size", + "value": "24vp" + }, + { + "name": "home_homeCell_margin", + "value": "4vp" + }, + { + "name": "home_homeCell_width", + "value": "80vp" + }, + { + "name": "home_homeCell_height", + "value": "80vp" + }, + { + "name": "setting_name_margin", + "value": "4vp" + }, + { + "name": "setting_account_margin", + "value": "24vp" + }, + { + "name": "setting_account_size", + "value": "48vp" + }, + { + "name": "setting_account_fontSize", + "value": "20fp" + }, + { + "name": "setting_account_text_height", + "value": "28vp" + }, + { + "name": "setting_account_height", + "value": "96vp" + }, + { + "name": "setting_account_padding", + "value": "24vp" + }, + { + "name": "setting_account_borderRadius", + "value": "16vp" + }, + { + "name": "setting_list_height", + "value": "48vp" + }, + { + "name": "setting_list_padding", + "value": "4vp" + }, + { + "name": "setting_list_borderRadius", + "value": "16vp" + }, + { + "name": "setting_list_startMargin", + "value": "42vp" + }, + { + "name": "setting_list_endMargin", + "value": "24vp" + }, + { + "name": "setting_list_strokeWidth", + "value": "0.25vp" + }, + { + "name": "setting_button_bottom", + "value": "55vp" + }, + { + "name": "setting_size", + "value": "22vp" + }, + { + "name": "setting_padding", + "value": "10vp" + }, + { + "name": "setting_jump_width", + "value": "12vp" + }, + { + "name": "setting_jump_height", + "value": "24vp" + }, + { + "name": "setting_settingCell_left", + "value": "8vp" + }, + { + "name": "setting_settingCell_right", + "value": "22vp" + } + ] +} \ No newline at end of file diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/element/string.json b/PageAndData03/03_Complete/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..5392b0095aa9dae9758275bdd855ba48b8ae3a29 --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/resources/base/element/string.json @@ -0,0 +1,340 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "PageAndData" + }, + { + "name": "login_page", + "value": "Login page" + }, + { + "name": "login_more", + "value": "Log in to your account to use more services" + }, + { + "name": "account", + "value": "Account" + }, + { + "name": "password", + "value": "Password" + }, + { + "name": "login", + "value": "Log in" + }, + { + "name": "register_account", + "value": "Registering an Account" + }, + { + "name": "forgot_password", + "value": "Forgot Password" + }, + { + "name": "message_login", + "value": "SMS verification code login" + }, + { + "name": "other_login_method", + "value": "Other login methods" + }, + { + "name": "vertical_line", + "value": " | " + }, + { + "name": "input_empty_tips", + "value": "The input cannot be empty." + }, + { + "name": "login_success", + "value": "The login is successful." + }, + { + "name": "my_love", + "value": "My favorite" + }, + { + "name": "history_record", + "value": "History" + }, + { + "name": "message", + "value": "Message" + }, + { + "name": "shopping_cart", + "value": "Shopping cart" + }, + { + "name": "my_goal", + "value": "My goal" + }, + { + "name": "group", + "value": "Group" + }, + { + "name": "favorites", + "value": "Favorites" + }, + { + "name": "recycle_bin", + "value": "Recycle Bin" + }, + { + "name": "rankings", + "value": "Rankings" + }, + { + "name": "new_product_debut", + "value": "New product debut" + }, + { + "name": "big_name_flash", + "value": "Big name flash" + }, + { + "name": "find_good", + "value": "Find good things" + }, + { + "name": "xiamen_station", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "more_big_names", + "value": "More Big Names" + }, + { + "name": "push_notifications", + "value": "Push Notifications" + }, + { + "name": "data_management", + "value": "Data Management" + }, + { + "name": "menu_settings", + "value": "Menu Settings" + }, + { + "name": "about", + "value": "About" + }, + { + "name": "clear_cache", + "value": "Clear Cache" + }, + { + "name": "mainPage_tabTitles_home", + "value": "Home" + }, + { + "name": "mainPage_tabTitles_mine", + "value": "Mine" + }, + { + "name": "mainPage_top", + "value": "Rankings" + }, + { + "name": "mainPage_text_top", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "mainPage_new", + "value": "New product debut" + }, + { + "name": "mainPage_text_new", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "mainPage_brand", + "value": "Big name flash" + }, + { + "name": "mainPage_text_brand", + "value": "More Big Names" + }, + { + "name": "mainPage_found", + "value": "Find good things" + }, + { + "name": "mainPage_text_found", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "setting_account_name", + "value": "Mr. Lee" + }, + { + "name": "setting_account_email", + "value": "2000000@test.cc" + }, + { + "name": "setting_list_news", + "value": "Push Notifications" + }, + { + "name": "setting_list_font", + "value": "Fontsize Change" + }, + { + "name": "setting_list_menu", + "value": "Menu Settings" + }, + { + "name": "setting_list_about", + "value": "About" + }, + { + "name": "setting_list_storage", + "value": "Clear Cache" + }, + { + "name": "setting_list_privacy", + "value": "Privacy Agreement" + }, + { + "name": "setting_button", + "value": "Logout" + }, + { + "name": "home_list", + "value": "List" + }, + { + "name": "setting_toggle", + "value": "switch" + }, + { + "name": "bind_title", + "value": "Exercise completion" + }, + { + "name": "fontsize_change", + "value": "FontSize change" + }, + { + "name": "Confirmed", + "value": "Confirmed" + }, + { + "name": "Cancel", + "value": "Cancel" + }, + { + "name": "sport_name", + "value": "Sport Name" + }, + { + "name": "Morning_jogging", + "value": "Morning jogging" + }, + { + "name": "Yoga", + "value": "Yoga" + }, + { + "name": "Swimming", + "value": "Swimming" + }, + { + "name": "Exercise_duration", + "value": "Exercise duration: (minutes)" + }, + { + "name": "Completion_Status", + "value": "Completion Status" + }, + { + "name": "Completed", + "value": "Completed" + }, + { + "name": "Uncompleted", + "value": "Uncompleted" + }, + { + "name": "submit", + "value": "Submit" + }, + { + "name": "enter_duration", + "value": "Please enter the exercise duration." + }, + { + "name": "My_plans", + "value": "My Plans" + }, + { + "name": "ALL", + "value": "All" + }, + { + "name": "delete_question", + "value": "Are you sure you want to delete the plan?" + }, + { + "name": "delete", + "value": "Delete" + }, + { + "name": "Add_Plans", + "value": "Add plan" + }, + { + "name": "status", + "value": "Status" + }, + { + "name": "Duration", + "value": "Duration" + }, + { + "name": "Tab_Bar_One", + "value": "Home Page" + }, + { + "name": "Tab_Bar_Two", + "value": "Mine" + }, + { + "name": "Network_Available", + "value": "Network Available" + }, + { + "name": "Network_Lost", + "value": "Network Lost" + }, + { + "name": "Network_Unavailable", + "value": "Network Unavailable" + }, + { + "name": "Login_Failed", + "value": "Failed to log in because the network is not connected." + }, + { + "name": "Internet", + "value": "Internet Permission Request" + }, + { + "name": "network_info", + "value": "NetWork Info Permission Request" + } + ] +} \ No newline at end of file diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/about.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/about.png new file mode 100644 index 0000000000000000000000000000000000000000..6896495ca95dd5eb4507c1f70f2f1a24ede868db Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/about.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/account.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/account.png new file mode 100644 index 0000000000000000000000000000000000000000..12f8fe56f8faa51ab5d61ee40f38cae3a79135df Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/account.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/arrow.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..87bd1f3a6eb2e77b58c40aabca5f7ce6b1f158e5 Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/arrow.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/backgroundImage.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/backgroundImage.png new file mode 100644 index 0000000000000000000000000000000000000000..86e8d90778d319f4fa50f21b6ed7f173a89995b2 Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/backgroundImage.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/brand.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/brand.png new file mode 100644 index 0000000000000000000000000000000000000000..657be8334a8a445f21d9b74ed4cb6627dc13d127 Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/brand.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/circle.svg b/PageAndData03/03_Complete/entry/src/main/resources/base/media/circle.svg new file mode 100644 index 0000000000000000000000000000000000000000..f6fa05cf1550e22111cc0b64007727276bb3aa66 --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/resources/base/media/circle.svg @@ -0,0 +1,18 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/data.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/data.png new file mode 100644 index 0000000000000000000000000000000000000000..101db234f4b25f8997d0d3881ddd79b68599dc8b Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/data.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/delete.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/delete.png new file mode 100644 index 0000000000000000000000000000000000000000..fd17d4dbadfe66884774d8ed779e8cec48f79896 Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/delete.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/discover_normal.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/discover_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..24a53012eacc0b6974d9eafef8eaac364a52fbbd Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/discover_normal.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/discover_selected.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/discover_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..db4bbaacdbb9c59915f4886ef6da79ec62fdd897 Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/discover_selected.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/edit.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/edit.png new file mode 100644 index 0000000000000000000000000000000000000000..6ff921b308877a85886ee1c24a4661a5d5f6df66 Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/edit.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/favorite.svg b/PageAndData03/03_Complete/entry/src/main/resources/base/media/favorite.svg new file mode 100644 index 0000000000000000000000000000000000000000..06d2bed182b8d3846faee9305bf2532ad96b2b33 --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/resources/base/media/favorite.svg @@ -0,0 +1,15 @@ + + + Created with Pixso. + + + + + + + + + + + + diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/fig1.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/fig1.png new file mode 100644 index 0000000000000000000000000000000000000000..3f1e081539375a4fb4ac142ab7061287af80a12d Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/fig1.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/fig2.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/fig2.png new file mode 100644 index 0000000000000000000000000000000000000000..5e307d53994dafc85984518b5513f80d864b8815 Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/fig2.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/fig3.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/fig3.png new file mode 100644 index 0000000000000000000000000000000000000000..e47660fee043619b24d38aaf61897f7282454109 Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/fig3.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/fig4.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/fig4.png new file mode 100644 index 0000000000000000000000000000000000000000..bfbd91b3093dd6b80ac3528c2f2acccab331e1ce Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/fig4.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/found.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/found.png new file mode 100644 index 0000000000000000000000000000000000000000..39df31354d8912ad2dfdb070041df24013e49860 Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/found.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/home_normal.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/home_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..1b893d3c368185078120a56cf72d5b45770a54ec Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/home_normal.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/home_selected.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/home_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..3cd3f1bb2024003b06ef718bb81745d432c3ac92 Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/home_selected.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/icon.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/icon.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/login_method1.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/login_method1.png new file mode 100644 index 0000000000000000000000000000000000000000..a7b47f2ea5723f81684506765ed437d6684f8184 Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/login_method1.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/login_method2.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/login_method2.png new file mode 100644 index 0000000000000000000000000000000000000000..320e9a5038da6fb9bdc201ed7675d4d4ad1a0c99 Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/login_method2.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/login_method3.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/login_method3.png new file mode 100644 index 0000000000000000000000000000000000000000..28ac6ec8669b5634df443b10a4ced8f9c7e8a5c7 Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/login_method3.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/logo.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..1dcac2208bef8df6893357ec8d43fdd6ee6763f7 Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/logo.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/love.svg b/PageAndData03/03_Complete/entry/src/main/resources/base/media/love.svg new file mode 100644 index 0000000000000000000000000000000000000000..5c75b04648ae692256d879a7ed8b0e42b93936f8 --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/resources/base/media/love.svg @@ -0,0 +1,18 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/menu.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/menu.png new file mode 100644 index 0000000000000000000000000000000000000000..04b95f49b5328fefa63ecd0da9bc8ae2cb0e7ebd Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/menu.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/message.svg b/PageAndData03/03_Complete/entry/src/main/resources/base/media/message.svg new file mode 100644 index 0000000000000000000000000000000000000000..c4c144958d1b109fa200514a4e0e46dc3367b630 --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/resources/base/media/message.svg @@ -0,0 +1,18 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/mine_normal.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/mine_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..d323b89cbd5a24d9c58cec73273919dc71bbd025 Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/mine_normal.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/mine_selected.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/mine_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..41183cf3790008974cb1d640683a68b6d03daa0f Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/mine_selected.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/new.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/new.png new file mode 100644 index 0000000000000000000000000000000000000000..a3e34211e891458be3afa0a901bccfa6f2371b22 Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/new.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/news.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/news.png new file mode 100644 index 0000000000000000000000000000000000000000..379f25a2fcb654ff84966e45f0892db30e6c46e1 Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/news.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/path.svg b/PageAndData03/03_Complete/entry/src/main/resources/base/media/path.svg new file mode 100644 index 0000000000000000000000000000000000000000..3ed90565ea331acc5ba33320257284977037e16d --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/resources/base/media/path.svg @@ -0,0 +1,7 @@ + + + Created with Pixso. + + + + diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/person_shield.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/person_shield.png new file mode 100644 index 0000000000000000000000000000000000000000..e50355ea8b34750f8f00b9f4cd124ea996a38742 Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/person_shield.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/privacy.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/privacy.png new file mode 100644 index 0000000000000000000000000000000000000000..bfe9f464f7fa185475b8f4d545d5c18f44583b71 Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/privacy.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/record.svg b/PageAndData03/03_Complete/entry/src/main/resources/base/media/record.svg new file mode 100644 index 0000000000000000000000000000000000000000..e0749d6a5c6be2603af7b760d29326f762ece934 --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/resources/base/media/record.svg @@ -0,0 +1,15 @@ + + + Created with Pixso. + + + + + + + + + + + + diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/recycle.svg b/PageAndData03/03_Complete/entry/src/main/resources/base/media/recycle.svg new file mode 100644 index 0000000000000000000000000000000000000000..d22b4dce6cec5c5353e6a974256f05a871133dfc --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/resources/base/media/recycle.svg @@ -0,0 +1,17 @@ + + + Created with Pixso. + + + + + + + + + + + + + + diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/reset.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/reset.png new file mode 100644 index 0000000000000000000000000000000000000000..d4645bdca4d56183f13d63a015a6537225bf2c6f Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/reset.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/right_grey.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/right_grey.png new file mode 100644 index 0000000000000000000000000000000000000000..ed1eed6403e44374cd3542d2631d2c1a83608d4f Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/right_grey.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/search.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/search.png new file mode 100644 index 0000000000000000000000000000000000000000..be40ad4eac19072978d49bc90d5b0c91ab2b6af3 Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/search.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/shopping.svg b/PageAndData03/03_Complete/entry/src/main/resources/base/media/shopping.svg new file mode 100644 index 0000000000000000000000000000000000000000..025437298c567eaf57abb0596c2076746944a6ec --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/resources/base/media/shopping.svg @@ -0,0 +1,15 @@ + + + Created with Pixso. + + + + + + + + + + + + diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/sift.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/sift.png new file mode 100644 index 0000000000000000000000000000000000000000..8bb376fac511a07d3ad9e85bde352a3d22d73e2f Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/sift.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/startIcon.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/startIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/startIcon.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/storage.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/storage.png new file mode 100644 index 0000000000000000000000000000000000000000..af5baac97a5949c836ff16f8a58a1d458341490e Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/storage.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/target.svg b/PageAndData03/03_Complete/entry/src/main/resources/base/media/target.svg new file mode 100644 index 0000000000000000000000000000000000000000..2a49f3ae2f1042b0bcca4a9c6a050690c5020ee8 --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/resources/base/media/target.svg @@ -0,0 +1,19 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + + diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/media/top.png b/PageAndData03/03_Complete/entry/src/main/resources/base/media/top.png new file mode 100644 index 0000000000000000000000000000000000000000..1ca23a5dbc1f769677b5602afc567184a4a24851 Binary files /dev/null and b/PageAndData03/03_Complete/entry/src/main/resources/base/media/top.png differ diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/profile/main_pages.json b/PageAndData03/03_Complete/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..85a3c19566d76790ce243e498c48f665ce4008e5 --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/LoginPage" + ] +} \ No newline at end of file diff --git a/PageAndData03/03_Complete/entry/src/main/resources/base/profile/route_map.json b/PageAndData03/03_Complete/entry/src/main/resources/base/profile/route_map.json new file mode 100644 index 0000000000000000000000000000000000000000..e1b4bcba03bf1f24e370245ff1db2b44c5ba935f --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/resources/base/profile/route_map.json @@ -0,0 +1,12 @@ +{ + "routerMap": [ + { + "name": "MainPage", + "pageSourceFile": "src/main/ets/pages/MainPage.ets", + "buildFunction": "MainPageBuilder", + "data": { + "description" : "this is mainPage" + } + } + ] +} \ No newline at end of file diff --git a/PageAndData03/03_Complete/entry/src/main/resources/en_US/element/string.json b/PageAndData03/03_Complete/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..19c9eb267c39b3760e03a9df37f45539a0b335f7 --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,332 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "PageAndData" + }, + { + "name": "login_page", + "value": "Login page" + }, + { + "name": "login_more", + "value": "Log in to your account to use more services" + }, + { + "name": "account", + "value": "Account" + }, + { + "name": "password", + "value": "Password" + }, + { + "name": "login", + "value": "Log in" + }, + { + "name": "register_account", + "value": "Registering an Account" + }, + { + "name": "forgot_password", + "value": "Forgot Password" + }, + { + "name": "message_login", + "value": "SMS verification code login" + }, + { + "name": "other_login_method", + "value": "Other login methods" + }, + { + "name": "vertical_line", + "value": " | " + }, + { + "name": "input_empty_tips", + "value": "The input cannot be empty." + }, + { + "name": "login_success", + "value": "The login is successful." + }, + { + "name": "my_love", + "value": "My favorite" + }, + { + "name": "history_record", + "value": "History" + }, + { + "name": "message", + "value": "Message" + }, + { + "name": "shopping_cart", + "value": "Shopping cart" + }, + { + "name": "my_goal", + "value": "My goal" + }, + { + "name": "group", + "value": "Group" + }, + { + "name": "favorites", + "value": "Favorites" + }, + { + "name": "recycle_bin", + "value": "Recycle Bin" + }, + { + "name": "rankings", + "value": "Rankings" + }, + { + "name": "new_product_debut", + "value": "New product debut" + }, + { + "name": "big_name_flash", + "value": "Big name flash" + }, + { + "name": "find_good", + "value": "Find good things" + }, + { + "name": "xiamen_station", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "more_big_names", + "value": "More Big Names" + }, + { + "name": "push_notifications", + "value": "Push Notifications" + }, + { + "name": "data_management", + "value": "Data Management" + }, + { + "name": "menu_settings", + "value": "Menu Settings" + }, + { + "name": "about", + "value": "About" + }, + { + "name": "clear_cache", + "value": "Clear Cache" + }, + { + "name": "mainPage_tabTitles_home", + "value": "Home" + }, + { + "name": "mainPage_tabTitles_mine", + "value": "Mine" + }, + { + "name": "mainPage_top", + "value": "Rankings" + }, + { + "name": "mainPage_text_top", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "mainPage_new", + "value": "New product debut" + }, + { + "name": "mainPage_text_new", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "mainPage_brand", + "value": "Big name flash" + }, + { + "name": "mainPage_text_brand", + "value": "More Big Names" + }, + { + "name": "mainPage_found", + "value": "Find good things" + }, + { + "name": "mainPage_text_found", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "setting_account_name", + "value": "Mr. Lee" + }, + { + "name": "setting_account_email", + "value": "2000000@test.cc" + }, + { + "name": "setting_list_news", + "value": "Push Notifications" + }, + { + "name": "setting_list_font", + "value": "Fontsize Change" + }, + { + "name": "setting_list_menu", + "value": "Menu Settings" + }, + { + "name": "setting_list_about", + "value": "About" + }, + { + "name": "setting_list_storage", + "value": "Clear Cache" + }, + { + "name": "setting_list_privacy", + "value": "Privacy Agreement" + }, + { + "name": "setting_button", + "value": "Logout" + }, + { + "name": "home_list", + "value": "List" + }, + { + "name": "setting_toggle", + "value": "switch" + }, + { + "name": "bind_title", + "value": "Exercise completion" + }, + { + "name": "fontsize_change", + "value": "FontSize change" + }, + { + "name": "Confirmed", + "value": "Confirmed" + }, + { + "name": "Cancel", + "value": "Cancel" + }, + { + "name": "sport_name", + "value": "Sport Name" + }, + { + "name": "Morning_jogging", + "value": "Morning jogging" + }, + { + "name": "Yoga", + "value": "Yoga" + }, + { + "name": "Swimming", + "value": "Swimming" + }, + { + "name": "Exercise_duration", + "value": "Exercise duration: (minutes)" + }, + { + "name": "Completion_Status", + "value": "Completion Status" + }, + { + "name": "Completed", + "value": "Completed" + }, + { + "name": "Uncompleted", + "value": "Uncompleted" + }, + { + "name": "submit", + "value": "Submit" + }, + { + "name": "enter_duration", + "value": "Please enter the exercise duration." + }, + { + "name": "My_plans", + "value": "My Plans" + }, + { + "name": "ALL", + "value": "All" + }, + { + "name": "delete_question", + "value": "Are you sure you want to delete the plan?" + }, + { + "name": "delete", + "value": "Delete" + }, + { + "name": "Add_Plans", + "value": "Add plan" + }, + { + "name": "status", + "value": "Status" + }, + { + "name": "Duration", + "value": "Duration" + }, + { + "name": "Tab_Bar_One", + "value": "Home Page" + }, + { + "name": "Tab_Bar_Two", + "value": "Mine" + }, + { + "name": "Network_Available", + "value": "Network Available" + }, + { + "name": "Network_Lost", + "value": "Network Lost" + }, + { + "name": "Network_Unavailable", + "value": "Network Unavailable" + }, + { + "name": "Login_Failed", + "value": "Failed to log in because the network is not connected." + } + ] +} \ No newline at end of file diff --git a/PageAndData03/03_Complete/entry/src/main/resources/zh_CN/element/string.json b/PageAndData03/03_Complete/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..9942777e4c145acf474bfa05ae8a9c1c230b1333 --- /dev/null +++ b/PageAndData03/03_Complete/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,332 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "PageAndData" + }, + { + "name": "login_page", + "value": "登录界面" + }, + { + "name": "login_more", + "value": "登录账号以使用更多服务" + }, + { + "name": "account", + "value": "账号" + }, + { + "name": "password", + "value": "密码" + }, + { + "name": "login", + "value": "登录" + }, + { + "name": "register_account", + "value": "注册账号" + }, + { + "name": "forgot_password", + "value": "忘记密码" + }, + { + "name": "message_login", + "value": "短信验证码登录" + }, + { + "name": "other_login_method", + "value": "其他登录方式" + }, + { + "name": "vertical_line", + "value": " | " + }, + { + "name": "input_empty_tips", + "value": "输入不能为空" + }, + { + "name": "login_success", + "value": "登录成功" + }, + { + "name": "my_love", + "value": "我的最爱" + }, + { + "name": "history_record", + "value": "历史记录" + }, + { + "name": "message", + "value": "消息" + }, + { + "name": "shopping_cart", + "value": "购物车" + }, + { + "name": "my_goal", + "value": "我的目标" + }, + { + "name": "group", + "value": "圈子" + }, + { + "name": "favorites", + "value": "收藏" + }, + { + "name": "recycle_bin", + "value": "回收站" + }, + { + "name": "rankings", + "value": "排行榜" + }, + { + "name": "new_product_debut", + "value": "新品首发" + }, + { + "name": "big_name_flash", + "value": "大牌闪购" + }, + { + "name": "find_good", + "value": "发现好物" + }, + { + "name": "xiamen_station", + "value": "厦门站,我们不见不散" + }, + { + "name": "more_big_names", + "value": "更多大牌" + }, + { + "name": "push_notifications", + "value": "推送通知" + }, + { + "name": "data_management", + "value": "数据管理" + }, + { + "name": "menu_settings", + "value": "菜单设置" + }, + { + "name": "about", + "value": "关于" + }, + { + "name": "clear_cache", + "value": "清除缓存" + }, + { + "name": "mainPage_tabTitles_home", + "value": "首页" + }, + { + "name": "mainPage_tabTitles_mine", + "value": "我的" + }, + { + "name": "mainPage_top", + "value": "排行榜" + }, + { + "name": "mainPage_text_top", + "value": "厦门站,我们不见不散" + }, + { + "name": "mainPage_new", + "value": "新品首发" + }, + { + "name": "mainPage_text_new", + "value": "厦门站,我们不见不散" + }, + { + "name": "mainPage_brand", + "value": "大牌闪购" + }, + { + "name": "mainPage_text_brand", + "value": "更多大牌" + }, + { + "name": "mainPage_found", + "value": "发现好物" + }, + { + "name": "mainPage_text_found", + "value": "厦门站,我们不见不散" + }, + { + "name": "setting_account_name", + "value": "李先生" + }, + { + "name": "setting_account_email", + "value": "2000000@test.cc" + }, + { + "name": "setting_list_news", + "value": "推送通知" + }, + { + "name": "setting_list_font", + "value": "字体大小调节" + }, + { + "name": "setting_list_menu", + "value": "菜单设置" + }, + { + "name": "setting_list_about", + "value": "关于" + }, + { + "name": "setting_list_storage", + "value": "清除缓存" + }, + { + "name": "setting_list_privacy", + "value": "隐私协议" + }, + { + "name": "setting_button", + "value": "退出登录" + }, + { + "name": "home_list", + "value": "列表" + }, + { + "name": "setting_toggle", + "value": "开关" + }, + { + "name": "bind_title", + "value": "运动完成情况" + }, + { + "name": "fontsize_change", + "value": "字体大小调节" + }, + { + "name": "Confirmed", + "value": "确认" + }, + { + "name": "Cancel", + "value": "取消" + }, + { + "name": "sport_name", + "value": "运动名" + }, + { + "name": "Morning_jogging", + "value": "晨跑" + }, + { + "name": "Yoga", + "value": "瑜伽" + }, + { + "name": "Swimming", + "value": "游泳" + }, + { + "name": "Exercise_duration", + "value": "运动时长: (分钟)" + }, + { + "name": "Completion_Status", + "value": "完成状态" + }, + { + "name": "Completed", + "value": "已完成" + }, + { + "name": "Uncompleted", + "value": "未完成" + }, + { + "name": "submit", + "value": "提交" + }, + { + "name": "enter_duration", + "value": "请输入运动时长" + }, + { + "name": "My_plans", + "value": "我的计划" + }, + { + "name": "ALL", + "value": "任意" + }, + { + "name": "delete_question", + "value": "确定要删除该计划吗?" + }, + { + "name": "delete", + "value": "删除" + }, + { + "name": "Add_Plans", + "value": "新增计划" + }, + { + "name": "status", + "value": "状态" + }, + { + "name": "Duration", + "value": "时长" + }, + { + "name": "Tab_Bar_One", + "value": "首页" + }, + { + "name": "Tab_Bar_Two", + "value": "我的" + }, + { + "name": "Network_Available", + "value": "网络可用" + }, + { + "name": "Network_Lost", + "value": "网络丢失" + }, + { + "name": "Network_Unavailable", + "value": "网络不可用" + }, + { + "name": "Login_Failed", + "value": "网络未连接,无法登录" + } + ] +} \ No newline at end of file diff --git a/PageAndData03/03_Complete/hvigor/hvigor-config.json5 b/PageAndData03/03_Complete/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..73bfab4e997c8d4aea53b22fdd7f10112b30987f --- /dev/null +++ b/PageAndData03/03_Complete/hvigor/hvigor-config.json5 @@ -0,0 +1,17 @@ +{ + "modelVersion": "5.0.0", + "dependencies": { + }, + "execution": { + // "daemon": true, /* Enable daemon compilation. Default: true */ + // "incremental": true, /* Enable incremental compilation. Default: true */ + // "parallel": true, /* Enable parallel compilation. Default: true */ + // "typeCheck": false, /* Enable typeCheck. Default: false */ + }, + "logging": { + // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */ + }, + "debugging": { + // "stacktrace": false /* Disable stacktrace compilation. Default: false */ + } +} \ No newline at end of file diff --git a/PageAndData03/03_Complete/hvigorfile.ts b/PageAndData03/03_Complete/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/PageAndData03/03_Complete/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/PageAndData03/03_Complete/oh-package.json5 b/PageAndData03/03_Complete/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ba334a33e0ef0989bb410985996742da64bceda1 --- /dev/null +++ b/PageAndData03/03_Complete/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "modelVersion": "5.0.0", + "license": "", + "devDependencies": { + }, + "author": "", + "name": "arktscomponents", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} \ No newline at end of file diff --git a/PageAndData03/03_StartingPoint/AppScope/app.json5 b/PageAndData03/03_StartingPoint/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..45b006b30ea74629e4219a71a70b74840df4ba82 --- /dev/null +++ b/PageAndData03/03_StartingPoint/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.pageanddata", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/PageAndData03/03_StartingPoint/AppScope/resources/base/element/string.json b/PageAndData03/03_StartingPoint/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..594cc44fec10161d4efeae095baef27280a0c27f --- /dev/null +++ b/PageAndData03/03_StartingPoint/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "PageAndData" + } + ] +} diff --git a/PageAndData03/03_StartingPoint/AppScope/resources/base/media/app_icon.png b/PageAndData03/03_StartingPoint/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/PageAndData03/03_StartingPoint/AppScope/resources/base/media/app_icon.png differ diff --git a/PageAndData03/03_StartingPoint/LICENSE b/PageAndData03/03_StartingPoint/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..381eb507bc1eef9b5158e496dedab769e810b657 --- /dev/null +++ b/PageAndData03/03_StartingPoint/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2022 Huawei Device Co., Ltd. All rights reserved. + + 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. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/PageAndData03/03_StartingPoint/build-profile.json5 b/PageAndData03/03_StartingPoint/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..7d4d5dfbbecc20e238fab96a718d57a7b0b4327a --- /dev/null +++ b/PageAndData03/03_StartingPoint/build-profile.json5 @@ -0,0 +1,29 @@ +{ + "app": { + "signingConfigs": [ + + ], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "5.0.0(12)", + "runtimeOS": "HarmonyOS" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/PageAndData03/03_StartingPoint/entry/build-profile.json5 b/PageAndData03/03_StartingPoint/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..20c75049f2d45e57d267899b6547c79fb6aa84c1 --- /dev/null +++ b/PageAndData03/03_StartingPoint/entry/build-profile.json5 @@ -0,0 +1,14 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + "runtimeOS": "HarmonyOS" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/PageAndData03/03_StartingPoint/entry/hvigorfile.ts b/PageAndData03/03_StartingPoint/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/PageAndData03/03_StartingPoint/entry/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { hapTasks } from '@ohos/hvigor-ohos-plugin'; diff --git a/PageAndData03/03_StartingPoint/entry/oh-package.json5 b/PageAndData03/03_StartingPoint/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..19b9234a98d43a4711a0fc32cef604159228d3cd --- /dev/null +++ b/PageAndData03/03_StartingPoint/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "license": "", + "devDependencies": {}, + "author": "", + "name": "entry", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} \ No newline at end of file diff --git a/PageAndData03/03_StartingPoint/entry/src/main/ets/entryability/EntryAbility.ets b/PageAndData03/03_StartingPoint/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..e9517cfe27b427b2164b91e5e7783cddf0ba11bb --- /dev/null +++ b/PageAndData03/03_StartingPoint/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2024 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 { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { window } from '@kit.ArkUI'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + +/** + * Lift cycle management of Ability. + */ +export default class entryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); + } + + onDestroy(): void | Promise { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + windowStage.getMainWindow().then((data: window.Window) => { + // Window immersive. + data.setWindowLayoutFullScreen(true); + }) + windowStage.loadContent('pages/LoginPage', (err, data) => { + if (err.code) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} \ No newline at end of file diff --git a/PageAndData03/03_StartingPoint/entry/src/main/ets/pages/LoginPage.ets b/PageAndData03/03_StartingPoint/entry/src/main/ets/pages/LoginPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..ed7ca09bf6780a55e749a52a70fa5a2561ec5ecb --- /dev/null +++ b/PageAndData03/03_StartingPoint/entry/src/main/ets/pages/LoginPage.ets @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2024 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 { promptAction } from '@kit.ArkUI'; +import { MainPage } from './MainPage'; + +@Extend(TextInput) +function inputStyle() { + .placeholderColor('#99182431') + .height('45vp') + .fontSize('18fp') + .backgroundColor('#F1F3F5') + .width('328vp') + .margin({ top: 12 }) +} + +@Extend(Line) +function lineStyle() { + .width('328vp') + .height('1vp') + .backgroundColor('#33182431') +} + +@Extend(Text) +function blueTextStyle() { + .fontColor('#007DFF') + .fontSize('14fp') + .fontWeight(FontWeight.Medium) +} + +/** + * Login page + */ +@Entry +@Component +struct LoginPage { + @State account: string = ''; + @State password: string = ''; + @State isShowProgress: boolean = false; + private timeOutId: number = -1; + pathStack: NavPathStack = new NavPathStack(); + + @Builder + imageButton(src: Resource) { + Button({ type: ButtonType.Circle, stateEffect: true }) { + Image(src) + } + .height('48vp') + .width('48vp') + .backgroundColor('#F1F3F5') + } + + login(result: boolean): void { + if (this.account === '' || this.password === '') { + promptAction.showToast({ + message: $r('app.string.input_empty_tips') + }) + } else { + this.isShowProgress = true; + if (this.timeOutId === -1) { + this.timeOutId = setTimeout(() => { + this.isShowProgress = false; + this.timeOutId = -1; + this.pathStack.pushPathByName('MainPage', null); + }, 2000); + } + } + } + + aboutToDisappear() { + clearTimeout(this.timeOutId); + this.timeOutId = -1; + } + + build() { + Navigation(this.pathStack) { + Column() { + Image($r('app.media.logo')) + .width('78vp') + .height('78vp') + .margin({ + top: '150vp', + bottom: '8vp' + }) + Text($r('app.string.login_page')) + .fontSize('24fp') + .fontWeight(FontWeight.Medium) + .fontColor('#182431') + Text($r('app.string.login_more')) + .fontSize('16fp') + .fontColor('#99182431') + .margin({ + bottom: '30vp', + top: '8vp' + }) + + TextInput({ placeholder: $r('app.string.account') }) + .maxLength(11) + .type(InputType.Number) + .inputStyle() + .onChange((value: string) => { + this.account = value; + }) + Line() + .lineStyle() + + TextInput({ placeholder: $r('app.string.password') }) + .maxLength(8) + .type(InputType.Password) + .inputStyle() + .onChange((value: string) => { + this.password = value; + }) + Line() + .lineStyle() + + Row() { + Text($r('app.string.message_login')) + .blueTextStyle() + Text($r('app.string.forgot_password')) + .blueTextStyle() + } + .justifyContent(FlexAlign.SpaceBetween) + .width('328vp') + .margin({ top: '8vp' }) + + Button($r('app.string.login'), { type: ButtonType.Capsule }) + .width('328vp') + .height('40vp') + .fontSize('16fp') + .fontWeight(FontWeight.Medium) + .backgroundColor('#007DFF') + .margin({ + top: '48vp', + bottom: '12vp' + }) + .onClick(() => { + this.login(true); + }) + Text($r('app.string.register_account')) + .fontColor('#007DFF') + .fontSize('16fp') + .fontWeight(FontWeight.Medium) + + if (this.isShowProgress) { + LoadingProgress() + .color('#182431') + .width('30vp') + .height('30vp') + .margin({ top: '20vp' }) + } + + Blank() + Text($r('app.string.other_login_method')) + .fontColor('#838D97') + .fontSize('12fp') + .fontWeight(FontWeight.Medium) + .margin({ + top: '50vp', + bottom: '12vp' + }) + Row({ space: 44 }) { + this.imageButton($r('app.media.login_method1')) + this.imageButton($r('app.media.login_method2')) + this.imageButton($r('app.media.login_method3')) + } + .margin({ bottom: '16vp' }) + } + .height('100%') + .width('100%') + .padding({ + left: '12vp', + right: '12vp', + bottom: '24vp' + }) + } + .backgroundColor('#F1F3F5') + .width('100%') + .height('100%') + .hideTitleBar(true) + .hideToolBar(true) + } +} \ No newline at end of file diff --git a/PageAndData03/03_StartingPoint/entry/src/main/ets/pages/MainPage.ets b/PageAndData03/03_StartingPoint/entry/src/main/ets/pages/MainPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..2e57ca76f03853ee02bd88aa8724899761ad31bd --- /dev/null +++ b/PageAndData03/03_StartingPoint/entry/src/main/ets/pages/MainPage.ets @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2024 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 Home from "../view/Home"; +import Setting from "../view/Setting"; + +@Builder +export function MainPageBuilder() { + MainPage() +} + +/** + * Main page + */ +@Component +export struct MainPage { + @State currentIndex: number = 0; + private tabsController: TabsController = new TabsController(); + + @Builder + TabBuilder(title: Resource, index: number, selectedImg: Resource) { + Column() { + SymbolGlyph(selectedImg) + .fontSize('24fp') + .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_OPACITY) + .symbolEffect(new BounceSymbolEffect(EffectScope.WHOLE, EffectDirection.UP), + this.currentIndex === index ? true : false) + .fontColor(this.currentIndex === index ? ['#0a59f7'] : ['#66000000']) + Text(title) + .margin({ top: '4vp' }) + .fontSize(10) + .fontWeight(500) + .fontColor(this.currentIndex === index ? '#0a59f7' : '#66000000') + } + .backgroundColor('#F1F3F5') + .justifyContent(FlexAlign.Center) + .height('56vp') + .width('100%') + .onClick(() => { + this.currentIndex = index; + this.tabsController.changeIndex(this.currentIndex); + }) + } + + build() { + NavDestination() { + Tabs({ + barPosition: BarPosition.End, + controller: this.tabsController + }) { + TabContent() { + Home() + } + .padding({ + left: '12vp', + right: '12vp' + }) + .backgroundColor('#F1F3F5') + .tabBar(this.TabBuilder($r('app.string.Tab_Bar_One'), 0, $r('sys.symbol.house_fill'))) + + TabContent() { + Setting() + } + .padding({ + left: '12vp', + right: '12vp' + }) + .backgroundColor('#F1F3F5') + .tabBar(this.TabBuilder($r('app.string.Tab_Bar_Two'), 1, $r('sys.symbol.person_crop_circle_fill_1'))) + } + .margin({ bottom: '64vp' }) + .width('100%') + .height('100%') + .barHeight('80vp') + .barMode(BarMode.Fixed) + .onChange((index: number) => { + this.currentIndex = index; + }) + } + .height('100%') + .hideTitleBar(true) + .backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/PageAndData03/03_StartingPoint/entry/src/main/ets/view/Home.ets b/PageAndData03/03_StartingPoint/entry/src/main/ets/view/Home.ets new file mode 100644 index 0000000000000000000000000000000000000000..0c568c3efc3792c2f40575192fcbb450856e898f --- /dev/null +++ b/PageAndData03/03_StartingPoint/entry/src/main/ets/view/Home.ets @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2024 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 mainViewModel from '../viewmodel/MainViewModel'; +import ItemData from '../viewmodel/ItemData'; + +/** + * Home tab content + */ +@Component +export default struct Home { + private swiperController: SwiperController = new SwiperController(); + + build() { + Column() { + Text($r('app.string.mainPage_tabTitles_home')) + .width('100%') + .margin({ + top: '48vp', + bottom: '12vp' + }) + .fontWeight(700) + .fontSize('26fp') + + Scroll() { + Column() { + Swiper(this.swiperController) { + ForEach(mainViewModel.getSwiperImages(), (img: Resource) => { + Image(img) + .width('100%') + .borderRadius('16fp') + }, (img: Resource) => JSON.stringify(img.id)) + } + .autoPlay(true) + + Grid() { + ForEach(mainViewModel.getFirstGridData(), (item: ItemData, index: number) => { + GridItem() { + Column() { + Image(item.img) + .width('40vp') + .height('40vp') + Text(item.title) + .fontSize('12fp') + .margin({ top: '4vp' }) + } + } + }, (item: ItemData) => JSON.stringify(item)) + } + .backgroundImage($r('app.media.backgroundImage')) + .backgroundImageSize({ + width: '100%', + height: '156vp' + }) + .columnsTemplate('1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr') + .columnsGap('8vp') + .rowsGap('12vp') + .margin({ top: '12vp' }) + .padding({ + top: '12vp', + bottom: '12vp' + }) + .height('156vp') + .backgroundColor(Color.White) + .borderRadius('16vp') + } + } + .height('660vp') + .align(Alignment.TopStart) + .scrollBar(BarState.Off) + } + .justifyContent(FlexAlign.Start) + .alignItems(HorizontalAlign.Start) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/PageAndData03/03_StartingPoint/entry/src/main/ets/view/Setting.ets b/PageAndData03/03_StartingPoint/entry/src/main/ets/view/Setting.ets new file mode 100644 index 0000000000000000000000000000000000000000..6b6fa22a3f96e84ea7ed1d04592c1527a85e013f --- /dev/null +++ b/PageAndData03/03_StartingPoint/entry/src/main/ets/view/Setting.ets @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2024 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 ItemData from '../viewmodel/ItemData'; +import mainViewModel from '../viewmodel/MainViewModel'; + +/** + * Setting tab content + */ +@Component +export default struct Setting { + @Builder + settingCell(item: ItemData) { + Row() { + Row({}) { + Image(item.img) + .height('22vp') + .margin({ + left: '16vp', + right: '12vp' + }) + Text(item.title) + .fontSize('16fp') + } + + if (item.others === undefined) { + Image($r('app.media.right_grey')) + .width('12vp') + .height('24vp') + } else { + Toggle({ type: ToggleType.Switch, isOn: false }) + } + } + .justifyContent(FlexAlign.SpaceBetween) + .width('100%') + .padding({ + left: '8vp', + right: '22vp' + }) + } + + build() { + Scroll() { + Column({ space: 12 }) { + Text($r('app.string.mainPage_tabTitles_mine')) + .width('100%') + .margin({ + top: '48vp', + bottom: '12vp' + }) + .fontWeight(700) + .fontSize('26fp') + + Row() { + Image($r('app.media.account')) + .width('48vp') + .height('48vp') + Column() { + Text($r('app.string.setting_account_name')) + .fontSize('20fp') + Text($r('app.string.setting_account_email')) + .fontSize('12fp') + .margin({ top: '4vp' }) + } + .alignItems(HorizontalAlign.Start) + .margin({ left: '12vp' }) + } + .alignItems(VerticalAlign.Center) + .width('100%') + + List({ space: 12 }) { + ForEach(mainViewModel.getSettingListData(), (item: ItemData[], index: number) => { + ListItemGroup() { + ForEach(item, (cell: ItemData, cellIndex) => { + ListItem() { + this.settingCell(cell) + } + .height('48vp') + }) + } + .divider({ + strokeWidth: '1vp', + color: '#0d000000', + startMargin: '42vp', + endMargin: '24vp' + }) + .backgroundColor('#ffffff') + .borderRadius('16vp') + + }, (item: ItemData) => JSON.stringify(item)) + } + .scrollBar(BarState.Off) + .width('100%') + .padding({ + top: '4vp', + bottom: '4vp' + }) + + Blank() + + Button($r('app.string.setting_button'), { type: ButtonType.Capsule }) + .width('90%') + .height('40vp') + .fontSize('16fp') + .fontColor('#FA2A2D') + .fontWeight(FontWeight.Medium) + .backgroundColor('#E5E8EA') + .margin({ bottom: '16vp' }) + } + .height('100%') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/PageAndData03/03_StartingPoint/entry/src/main/ets/viewmodel/ItemData.ets b/PageAndData03/03_StartingPoint/entry/src/main/ets/viewmodel/ItemData.ets new file mode 100644 index 0000000000000000000000000000000000000000..658e6b1dc9529e7612f8a5095b4695a2032ce8e2 --- /dev/null +++ b/PageAndData03/03_StartingPoint/entry/src/main/ets/viewmodel/ItemData.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 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. + */ + +/** + * List item data entity. + */ +export default class PageResource { + /** + * ID of list item. + */ + id: number; + /** + * Text of list item. + */ + title: Resource; + /** + * Image of list item. + */ + img: Resource; + /** + * Other resource of list item. + */ + others?: Resource; + + constructor(id: number, title: Resource, img: Resource, others?: Resource) { + this.id = id; + this.title = title; + this.img = img; + this.others = others; + } +} \ No newline at end of file diff --git a/PageAndData03/03_StartingPoint/entry/src/main/ets/viewmodel/MainViewModel.ets b/PageAndData03/03_StartingPoint/entry/src/main/ets/viewmodel/MainViewModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..c3e6c387b5bb9bd61cf5afaa2b055640430c0b95 --- /dev/null +++ b/PageAndData03/03_StartingPoint/entry/src/main/ets/viewmodel/MainViewModel.ets @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2024 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 ItemData from './ItemData'; + +/** + * Binds data to components and provides interfaces. + */ +export class MainViewModel { + /** + * Get swiper image data. + * + * @return {Array} swiperImages. + */ + getSwiperImages(): Array { + let swiperImages: Resource[] = [ + $r('app.media.fig1'), + $r('app.media.fig2'), + $r('app.media.fig3'), + $r('app.media.fig4') + ]; + return swiperImages; + } + + /** + * Get data of the first grid. + * + * @return {Array} firstGridData. + */ + getFirstGridData(): Array { + let firstGridData: ItemData[] = [ + new ItemData(0, $r('app.string.my_love'), $r('app.media.love')), + new ItemData(1, $r('app.string.history_record'), $r('app.media.record')), + new ItemData(2, $r('app.string.message'), $r('app.media.message')), + new ItemData(3, $r('app.string.shopping_cart'), $r('app.media.shopping')), + new ItemData(4, $r('app.string.my_goal'), $r('app.media.target')), + new ItemData(5, $r('app.string.group'), $r('app.media.circle')), + new ItemData(6, $r('app.string.favorites'), $r('app.media.favorite')), + new ItemData(7, $r('app.string.recycle_bin'), $r('app.media.recycle')) + ]; + return firstGridData; + } + + /** + * Get data of the setting list. + * + * @return {Array} settingListData. + */ + getSettingListData(): Array> { + let settingListData: ItemData[][] = [ + [ + new ItemData(0, $r('app.string.setting_list_news'), $r('app.media.news'), $r("app.string.setting_toggle")) + ], + [ + new ItemData(1, $r('app.string.setting_list_font'), $r('app.media.data')), + new ItemData(2, $r('app.string.setting_list_menu'), $r('app.media.menu')), + ], + [ + new ItemData(3, $r('app.string.clear_cache'), $r('app.media.storage')), + new ItemData(4, $r('app.string.setting_list_privacy'), $r('app.media.person_shield')), + ], + [ + new ItemData(5, $r('app.string.setting_list_about'), $r('app.media.about')) + ] + ]; + return settingListData; + } +} + +export default new MainViewModel(); \ No newline at end of file diff --git a/PageAndData03/03_StartingPoint/entry/src/main/module.json5 b/PageAndData03/03_StartingPoint/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..62be2f7558e6e727934099311d958e868afa16db --- /dev/null +++ b/PageAndData03/03_StartingPoint/entry/src/main/module.json5 @@ -0,0 +1,46 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone" + ], + "routerMap": "$profile:route_map", + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ets", + "description": "$string:EntryAbility_desc", + "icon": "$media:startIcon", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ], + "requestPermissions": [ + { + "name": "ohos.permission.INTERNET", + }, + { + "name": "ohos.permission.GET_NETWORK_INFO", + }, + + ] + } +} \ No newline at end of file diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/element/color.json b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..2b713164d8fd7c5053a1af4809507f13410e05a6 --- /dev/null +++ b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/element/color.json @@ -0,0 +1,80 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "white", + "value": "#FFFFFF" + }, + { + "name": "background", + "value": "#F1F3F5" + }, + { + "name": "title_text_color", + "value": "#182431" + }, + { + "name": "login_more_text_color", + "value": "#99182431" + }, + { + "name": "placeholder_color", + "value": "#99182431" + }, + { + "name": "line_color", + "value": "#33182431" + }, + { + "name": "login_button_color", + "value": "#007DFF" + }, + { + "name": "login_blue_text_color", + "value": "#007DFF" + }, + { + "name": "other_login_text_color", + "value": "#838D97" + }, + { + "name": "loading_color", + "value": "#182431" + }, + { + "name": "mainPage_selected", + "value": "#1698CE" + }, + { + "name": "mainPage_normal", + "value": "#6B6B6B" + }, + { + "name": "mainPage_backgroundColor", + "value": "#F1F3F5" + }, + { + "name": "home_grid_fontColor", + "value": "#99182431" + }, + { + "name": "setting_button_backgroundColor", + "value": "#E5E8EA" + }, + { + "name": "setting_button_fontColor", + "value": "#FA2A2D" + }, + { + "name": "grid_linear_start", + "value": "#1a0a5918" + }, + { + "name": "grid_linear_end", + "value": "#ffffff" + } + ] +} \ No newline at end of file diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/element/float.json b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..19ba0e188d1786b004c41f6ee067844629fe3502 --- /dev/null +++ b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/element/float.json @@ -0,0 +1,292 @@ +{ + "float": [ + { + "name": "logo_image_size", + "value": "78vp" + }, + { + "name": "logo_margin_top", + "value": "100vp" + }, + { + "name": "logo_margin_bottom", + "value": "8vp" + }, + { + "name": "page_title_text_size", + "value": "24fp" + }, + { + "name": "normal_text_size", + "value": "16fp" + }, + { + "name": "big_text_size", + "value": "18fp" + }, + { + "name": "small_text_size", + "value": "14fp" + }, + { + "name": "little_text_size", + "value": "12fp" + }, + { + "name": "login_more_margin_bottom", + "value": "30vp" + }, + { + "name": "login_more_margin_top", + "value": "8vp" + }, + { + "name": "login_input_height", + "value": "45vp" + }, + { + "name": "forgot_margin_top", + "value": "8vp" + }, + { + "name": "input_margin_top", + "value": "12vp" + }, + { + "name": "line_height", + "value": "1vp" + }, + { + "name": "login_button_height", + "value": "40vp" + }, + { + "name": "login_button_margin_top", + "value": "87vp" + }, + { + "name": "login_button_margin_bottom", + "value": "12vp" + }, + { + "name": "vertical_line_margin", + "value": "15vp" + }, + { + "name": "login_progress_size", + "value": "30vp" + }, + { + "name": "login_progress_margin_top", + "value": "20vp" + }, + { + "name": "other_login_margin_top", + "value": "50vp" + }, + { + "name": "other_login_margin_bottom", + "value": "12vp" + }, + { + "name": "login_page_padding_bottom", + "value": "24vp" + }, + { + "name": "other_login_image_size", + "value": "48vp" + }, + { + "name": "page_padding_hor", + "value": "12vp" + }, + { + "name": "mainPage_baseTab_top", + "value": "4vp" + }, + { + "name": "mainPage_baseTab_margin", + "value": "8vp" + }, + { + "name": "mainPage_padding", + "value": "12vp" + }, + { + "name": "mainPage_barHeight", + "value": "56vp" + }, + { + "name": "mainPage_baseTab_size", + "value": "25vp" + }, + { + "name": "main_tab_fontSize", + "value": "10fp" + }, + { + "name": "mainPage_tabTitles_margin", + "value": "12vp" + }, + { + "name": "mainPage_tabTitles_padding", + "value": "12vp" + }, + { + "name": "home_swiper_borderRadius", + "value": "16vp" + }, + { + "name": "home_swiper_margin", + "value": "24vp" + }, + { + "name": "home_grid_columnsGap", + "value": "8vp" + }, + { + "name": "home_grid_rowGap", + "value": "12vp" + }, + { + "name": "home_grid_padding", + "value": "12vp" + }, + { + "name": "home_grid_height", + "value": "124vp" + }, + { + "name": "home_grid_margin", + "value": "10vp" + }, + { + "name": "home_list_margin", + "value": "4vp" + }, + { + "name": "home_list_padding", + "value": "8vp" + }, + { + "name": "home_grid_borderRadius", + "value": "24vp" + }, + { + "name": "home_text_margin", + "value": "12vp" + }, + { + "name": "home_backgroundImage_borderRadius", + "value": "12vp" + }, + { + "name": "home_secondGrid_height", + "value": "260vp" + }, + { + "name": "home_secondGrid_margin", + "value": "10vp" + }, + { + "name": "home_homeCell_size", + "value": "24vp" + }, + { + "name": "home_homeCell_margin", + "value": "4vp" + }, + { + "name": "home_homeCell_width", + "value": "80vp" + }, + { + "name": "home_homeCell_height", + "value": "80vp" + }, + { + "name": "setting_name_margin", + "value": "4vp" + }, + { + "name": "setting_account_margin", + "value": "24vp" + }, + { + "name": "setting_account_size", + "value": "48vp" + }, + { + "name": "setting_account_fontSize", + "value": "20fp" + }, + { + "name": "setting_account_text_height", + "value": "28vp" + }, + { + "name": "setting_account_height", + "value": "96vp" + }, + { + "name": "setting_account_padding", + "value": "24vp" + }, + { + "name": "setting_account_borderRadius", + "value": "16vp" + }, + { + "name": "setting_list_height", + "value": "48vp" + }, + { + "name": "setting_list_padding", + "value": "4vp" + }, + { + "name": "setting_list_borderRadius", + "value": "16vp" + }, + { + "name": "setting_list_startMargin", + "value": "42vp" + }, + { + "name": "setting_list_endMargin", + "value": "24vp" + }, + { + "name": "setting_list_strokeWidth", + "value": "0.25vp" + }, + { + "name": "setting_button_bottom", + "value": "55vp" + }, + { + "name": "setting_size", + "value": "22vp" + }, + { + "name": "setting_padding", + "value": "10vp" + }, + { + "name": "setting_jump_width", + "value": "12vp" + }, + { + "name": "setting_jump_height", + "value": "24vp" + }, + { + "name": "setting_settingCell_left", + "value": "8vp" + }, + { + "name": "setting_settingCell_right", + "value": "22vp" + } + ] +} \ No newline at end of file diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/element/string.json b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..e6f3b2bf151e458ab15f89c31714c870d96655b0 --- /dev/null +++ b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/element/string.json @@ -0,0 +1,316 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "PageAndData" + }, + { + "name": "login_page", + "value": "Login page" + }, + { + "name": "login_more", + "value": "Log in to your account to use more services" + }, + { + "name": "account", + "value": "Account" + }, + { + "name": "password", + "value": "Password" + }, + { + "name": "login", + "value": "Log in" + }, + { + "name": "register_account", + "value": "Registering an Account" + }, + { + "name": "forgot_password", + "value": "Forgot Password" + }, + { + "name": "message_login", + "value": "SMS verification code login" + }, + { + "name": "other_login_method", + "value": "Other login methods" + }, + { + "name": "vertical_line", + "value": " | " + }, + { + "name": "input_empty_tips", + "value": "The input cannot be empty." + }, + { + "name": "login_success", + "value": "The login is successful." + }, + { + "name": "my_love", + "value": "My favorite" + }, + { + "name": "history_record", + "value": "History" + }, + { + "name": "message", + "value": "Message" + }, + { + "name": "shopping_cart", + "value": "Shopping cart" + }, + { + "name": "my_goal", + "value": "My goal" + }, + { + "name": "group", + "value": "Group" + }, + { + "name": "favorites", + "value": "Favorites" + }, + { + "name": "recycle_bin", + "value": "Recycle Bin" + }, + { + "name": "rankings", + "value": "Rankings" + }, + { + "name": "new_product_debut", + "value": "New product debut" + }, + { + "name": "big_name_flash", + "value": "Big name flash" + }, + { + "name": "find_good", + "value": "Find good things" + }, + { + "name": "xiamen_station", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "more_big_names", + "value": "More Big Names" + }, + { + "name": "push_notifications", + "value": "Push Notifications" + }, + { + "name": "data_management", + "value": "Data Management" + }, + { + "name": "menu_settings", + "value": "Menu Settings" + }, + { + "name": "about", + "value": "About" + }, + { + "name": "clear_cache", + "value": "Clear Cache" + }, + { + "name": "mainPage_tabTitles_home", + "value": "Home" + }, + { + "name": "mainPage_tabTitles_mine", + "value": "Mine" + }, + { + "name": "mainPage_top", + "value": "Rankings" + }, + { + "name": "mainPage_text_top", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "mainPage_new", + "value": "New product debut" + }, + { + "name": "mainPage_text_new", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "mainPage_brand", + "value": "Big name flash" + }, + { + "name": "mainPage_text_brand", + "value": "More Big Names" + }, + { + "name": "mainPage_found", + "value": "Find good things" + }, + { + "name": "mainPage_text_found", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "setting_account_name", + "value": "Mr. Lee" + }, + { + "name": "setting_account_email", + "value": "2000000@test.cc" + }, + { + "name": "setting_list_news", + "value": "Push Notifications" + }, + { + "name": "setting_list_font", + "value": "Fontsize Change" + }, + { + "name": "setting_list_menu", + "value": "Menu Settings" + }, + { + "name": "setting_list_about", + "value": "About" + }, + { + "name": "setting_list_storage", + "value": "Clear Cache" + }, + { + "name": "setting_list_privacy", + "value": "Privacy Agreement" + }, + { + "name": "setting_button", + "value": "Logout" + }, + { + "name": "home_list", + "value": "List" + }, + { + "name": "setting_toggle", + "value": "switch" + }, + { + "name": "bind_title", + "value": "Exercise completion" + }, + { + "name": "fontsize_change", + "value": "FontSize change" + }, + { + "name": "Confirmed", + "value": "Confirmed" + }, + { + "name": "Cancel", + "value": "Cancel" + }, + { + "name": "sport_name", + "value": "Sport Name" + }, + { + "name": "Morning_jogging", + "value": "Morning jogging" + }, + { + "name": "Yoga", + "value": "Yoga" + }, + { + "name": "Swimming", + "value": "Swimming" + }, + { + "name": "Exercise_duration", + "value": "Exercise duration: (minutes)" + }, + { + "name": "Completion_Status", + "value": "Completion Status" + }, + { + "name": "Completed", + "value": "Completed" + }, + { + "name": "Uncompleted", + "value": "Uncompleted" + }, + { + "name": "submit", + "value": "Submit" + }, + { + "name": "enter_duration", + "value": "Please enter the exercise duration." + }, + { + "name": "My_plans", + "value": "My Plans" + }, + { + "name": "ALL", + "value": "All" + }, + { + "name": "delete_question", + "value": "Are you sure you want to delete the plan?" + }, + { + "name": "delete", + "value": "Delete" + }, + { + "name": "Add_Plans", + "value": "Add plan" + }, + { + "name": "status", + "value": "Status" + }, + { + "name": "Duration", + "value": "Duration" + }, + { + "name": "Tab_Bar_One", + "value": "Home Page" + }, + { + "name": "Tab_Bar_Two", + "value": "Mine" + } + ] +} \ No newline at end of file diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/about.png b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/about.png new file mode 100644 index 0000000000000000000000000000000000000000..6896495ca95dd5eb4507c1f70f2f1a24ede868db Binary files /dev/null and b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/about.png differ diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/account.png b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/account.png new file mode 100644 index 0000000000000000000000000000000000000000..12f8fe56f8faa51ab5d61ee40f38cae3a79135df Binary files /dev/null and b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/account.png differ diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/backgroundImage.png b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/backgroundImage.png new file mode 100644 index 0000000000000000000000000000000000000000..86e8d90778d319f4fa50f21b6ed7f173a89995b2 Binary files /dev/null and b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/backgroundImage.png differ diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/circle.svg b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/circle.svg new file mode 100644 index 0000000000000000000000000000000000000000..f6fa05cf1550e22111cc0b64007727276bb3aa66 --- /dev/null +++ b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/circle.svg @@ -0,0 +1,18 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/data.png b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/data.png new file mode 100644 index 0000000000000000000000000000000000000000..101db234f4b25f8997d0d3881ddd79b68599dc8b Binary files /dev/null and b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/data.png differ diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/delete.png b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/delete.png new file mode 100644 index 0000000000000000000000000000000000000000..fd17d4dbadfe66884774d8ed779e8cec48f79896 Binary files /dev/null and b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/delete.png differ diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/edit.png b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/edit.png new file mode 100644 index 0000000000000000000000000000000000000000..6ff921b308877a85886ee1c24a4661a5d5f6df66 Binary files /dev/null and b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/edit.png differ diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/favorite.svg b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/favorite.svg new file mode 100644 index 0000000000000000000000000000000000000000..06d2bed182b8d3846faee9305bf2532ad96b2b33 --- /dev/null +++ b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/favorite.svg @@ -0,0 +1,15 @@ + + + Created with Pixso. + + + + + + + + + + + + diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/fig1.png b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/fig1.png new file mode 100644 index 0000000000000000000000000000000000000000..3f1e081539375a4fb4ac142ab7061287af80a12d Binary files /dev/null and b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/fig1.png differ diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/fig2.png b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/fig2.png new file mode 100644 index 0000000000000000000000000000000000000000..5e307d53994dafc85984518b5513f80d864b8815 Binary files /dev/null and b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/fig2.png differ diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/fig3.png b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/fig3.png new file mode 100644 index 0000000000000000000000000000000000000000..e47660fee043619b24d38aaf61897f7282454109 Binary files /dev/null and b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/fig3.png differ diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/fig4.png b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/fig4.png new file mode 100644 index 0000000000000000000000000000000000000000..bfbd91b3093dd6b80ac3528c2f2acccab331e1ce Binary files /dev/null and b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/fig4.png differ diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/icon.png b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/icon.png differ diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/login_method1.png b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/login_method1.png new file mode 100644 index 0000000000000000000000000000000000000000..a7b47f2ea5723f81684506765ed437d6684f8184 Binary files /dev/null and b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/login_method1.png differ diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/login_method2.png b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/login_method2.png new file mode 100644 index 0000000000000000000000000000000000000000..320e9a5038da6fb9bdc201ed7675d4d4ad1a0c99 Binary files /dev/null and b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/login_method2.png differ diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/login_method3.png b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/login_method3.png new file mode 100644 index 0000000000000000000000000000000000000000..28ac6ec8669b5634df443b10a4ced8f9c7e8a5c7 Binary files /dev/null and b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/login_method3.png differ diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/logo.png b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..1dcac2208bef8df6893357ec8d43fdd6ee6763f7 Binary files /dev/null and b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/logo.png differ diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/love.svg b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/love.svg new file mode 100644 index 0000000000000000000000000000000000000000..5c75b04648ae692256d879a7ed8b0e42b93936f8 --- /dev/null +++ b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/love.svg @@ -0,0 +1,18 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/menu.png b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/menu.png new file mode 100644 index 0000000000000000000000000000000000000000..04b95f49b5328fefa63ecd0da9bc8ae2cb0e7ebd Binary files /dev/null and b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/menu.png differ diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/message.svg b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/message.svg new file mode 100644 index 0000000000000000000000000000000000000000..c4c144958d1b109fa200514a4e0e46dc3367b630 --- /dev/null +++ b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/message.svg @@ -0,0 +1,18 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/news.png b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/news.png new file mode 100644 index 0000000000000000000000000000000000000000..379f25a2fcb654ff84966e45f0892db30e6c46e1 Binary files /dev/null and b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/news.png differ diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/path.svg b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/path.svg new file mode 100644 index 0000000000000000000000000000000000000000..3ed90565ea331acc5ba33320257284977037e16d --- /dev/null +++ b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/path.svg @@ -0,0 +1,7 @@ + + + Created with Pixso. + + + + diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/person_shield.png b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/person_shield.png new file mode 100644 index 0000000000000000000000000000000000000000..e50355ea8b34750f8f00b9f4cd124ea996a38742 Binary files /dev/null and b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/person_shield.png differ diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/record.svg b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/record.svg new file mode 100644 index 0000000000000000000000000000000000000000..e0749d6a5c6be2603af7b760d29326f762ece934 --- /dev/null +++ b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/record.svg @@ -0,0 +1,15 @@ + + + Created with Pixso. + + + + + + + + + + + + diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/recycle.svg b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/recycle.svg new file mode 100644 index 0000000000000000000000000000000000000000..d22b4dce6cec5c5353e6a974256f05a871133dfc --- /dev/null +++ b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/recycle.svg @@ -0,0 +1,17 @@ + + + Created with Pixso. + + + + + + + + + + + + + + diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/reset.png b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/reset.png new file mode 100644 index 0000000000000000000000000000000000000000..d4645bdca4d56183f13d63a015a6537225bf2c6f Binary files /dev/null and b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/reset.png differ diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/right_grey.png b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/right_grey.png new file mode 100644 index 0000000000000000000000000000000000000000..ed1eed6403e44374cd3542d2631d2c1a83608d4f Binary files /dev/null and b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/right_grey.png differ diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/shopping.svg b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/shopping.svg new file mode 100644 index 0000000000000000000000000000000000000000..025437298c567eaf57abb0596c2076746944a6ec --- /dev/null +++ b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/shopping.svg @@ -0,0 +1,15 @@ + + + Created with Pixso. + + + + + + + + + + + + diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/sift.png b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/sift.png new file mode 100644 index 0000000000000000000000000000000000000000..8bb376fac511a07d3ad9e85bde352a3d22d73e2f Binary files /dev/null and b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/sift.png differ diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/startIcon.png b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/startIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b Binary files /dev/null and b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/startIcon.png differ diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/storage.png b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/storage.png new file mode 100644 index 0000000000000000000000000000000000000000..af5baac97a5949c836ff16f8a58a1d458341490e Binary files /dev/null and b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/storage.png differ diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/target.svg b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/target.svg new file mode 100644 index 0000000000000000000000000000000000000000..2a49f3ae2f1042b0bcca4a9c6a050690c5020ee8 --- /dev/null +++ b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/media/target.svg @@ -0,0 +1,19 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + + diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/profile/main_pages.json b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..85a3c19566d76790ce243e498c48f665ce4008e5 --- /dev/null +++ b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/LoginPage" + ] +} \ No newline at end of file diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/base/profile/route_map.json b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/profile/route_map.json new file mode 100644 index 0000000000000000000000000000000000000000..e1b4bcba03bf1f24e370245ff1db2b44c5ba935f --- /dev/null +++ b/PageAndData03/03_StartingPoint/entry/src/main/resources/base/profile/route_map.json @@ -0,0 +1,12 @@ +{ + "routerMap": [ + { + "name": "MainPage", + "pageSourceFile": "src/main/ets/pages/MainPage.ets", + "buildFunction": "MainPageBuilder", + "data": { + "description" : "this is mainPage" + } + } + ] +} \ No newline at end of file diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/en_US/element/string.json b/PageAndData03/03_StartingPoint/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..e6f3b2bf151e458ab15f89c31714c870d96655b0 --- /dev/null +++ b/PageAndData03/03_StartingPoint/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,316 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "PageAndData" + }, + { + "name": "login_page", + "value": "Login page" + }, + { + "name": "login_more", + "value": "Log in to your account to use more services" + }, + { + "name": "account", + "value": "Account" + }, + { + "name": "password", + "value": "Password" + }, + { + "name": "login", + "value": "Log in" + }, + { + "name": "register_account", + "value": "Registering an Account" + }, + { + "name": "forgot_password", + "value": "Forgot Password" + }, + { + "name": "message_login", + "value": "SMS verification code login" + }, + { + "name": "other_login_method", + "value": "Other login methods" + }, + { + "name": "vertical_line", + "value": " | " + }, + { + "name": "input_empty_tips", + "value": "The input cannot be empty." + }, + { + "name": "login_success", + "value": "The login is successful." + }, + { + "name": "my_love", + "value": "My favorite" + }, + { + "name": "history_record", + "value": "History" + }, + { + "name": "message", + "value": "Message" + }, + { + "name": "shopping_cart", + "value": "Shopping cart" + }, + { + "name": "my_goal", + "value": "My goal" + }, + { + "name": "group", + "value": "Group" + }, + { + "name": "favorites", + "value": "Favorites" + }, + { + "name": "recycle_bin", + "value": "Recycle Bin" + }, + { + "name": "rankings", + "value": "Rankings" + }, + { + "name": "new_product_debut", + "value": "New product debut" + }, + { + "name": "big_name_flash", + "value": "Big name flash" + }, + { + "name": "find_good", + "value": "Find good things" + }, + { + "name": "xiamen_station", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "more_big_names", + "value": "More Big Names" + }, + { + "name": "push_notifications", + "value": "Push Notifications" + }, + { + "name": "data_management", + "value": "Data Management" + }, + { + "name": "menu_settings", + "value": "Menu Settings" + }, + { + "name": "about", + "value": "About" + }, + { + "name": "clear_cache", + "value": "Clear Cache" + }, + { + "name": "mainPage_tabTitles_home", + "value": "Home" + }, + { + "name": "mainPage_tabTitles_mine", + "value": "Mine" + }, + { + "name": "mainPage_top", + "value": "Rankings" + }, + { + "name": "mainPage_text_top", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "mainPage_new", + "value": "New product debut" + }, + { + "name": "mainPage_text_new", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "mainPage_brand", + "value": "Big name flash" + }, + { + "name": "mainPage_text_brand", + "value": "More Big Names" + }, + { + "name": "mainPage_found", + "value": "Find good things" + }, + { + "name": "mainPage_text_found", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "setting_account_name", + "value": "Mr. Lee" + }, + { + "name": "setting_account_email", + "value": "2000000@test.cc" + }, + { + "name": "setting_list_news", + "value": "Push Notifications" + }, + { + "name": "setting_list_font", + "value": "Fontsize Change" + }, + { + "name": "setting_list_menu", + "value": "Menu Settings" + }, + { + "name": "setting_list_about", + "value": "About" + }, + { + "name": "setting_list_storage", + "value": "Clear Cache" + }, + { + "name": "setting_list_privacy", + "value": "Privacy Agreement" + }, + { + "name": "setting_button", + "value": "Logout" + }, + { + "name": "home_list", + "value": "List" + }, + { + "name": "setting_toggle", + "value": "switch" + }, + { + "name": "bind_title", + "value": "Exercise completion" + }, + { + "name": "fontsize_change", + "value": "FontSize change" + }, + { + "name": "Confirmed", + "value": "Confirmed" + }, + { + "name": "Cancel", + "value": "Cancel" + }, + { + "name": "sport_name", + "value": "Sport Name" + }, + { + "name": "Morning_jogging", + "value": "Morning jogging" + }, + { + "name": "Yoga", + "value": "Yoga" + }, + { + "name": "Swimming", + "value": "Swimming" + }, + { + "name": "Exercise_duration", + "value": "Exercise duration: (minutes)" + }, + { + "name": "Completion_Status", + "value": "Completion Status" + }, + { + "name": "Completed", + "value": "Completed" + }, + { + "name": "Uncompleted", + "value": "Uncompleted" + }, + { + "name": "submit", + "value": "Submit" + }, + { + "name": "enter_duration", + "value": "Please enter the exercise duration." + }, + { + "name": "My_plans", + "value": "My Plans" + }, + { + "name": "ALL", + "value": "All" + }, + { + "name": "delete_question", + "value": "Are you sure you want to delete the plan?" + }, + { + "name": "delete", + "value": "Delete" + }, + { + "name": "Add_Plans", + "value": "Add plan" + }, + { + "name": "status", + "value": "Status" + }, + { + "name": "Duration", + "value": "Duration" + }, + { + "name": "Tab_Bar_One", + "value": "Home Page" + }, + { + "name": "Tab_Bar_Two", + "value": "Mine" + } + ] +} \ No newline at end of file diff --git a/PageAndData03/03_StartingPoint/entry/src/main/resources/zh_CN/element/string.json b/PageAndData03/03_StartingPoint/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..6709da69b42a21d430f1efd7b9eacae909e67216 --- /dev/null +++ b/PageAndData03/03_StartingPoint/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,316 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "PageAndData" + }, + { + "name": "login_page", + "value": "登录界面" + }, + { + "name": "login_more", + "value": "登录账号以使用更多服务" + }, + { + "name": "account", + "value": "账号" + }, + { + "name": "password", + "value": "密码" + }, + { + "name": "login", + "value": "登录" + }, + { + "name": "register_account", + "value": "注册账号" + }, + { + "name": "forgot_password", + "value": "忘记密码" + }, + { + "name": "message_login", + "value": "短信验证码登录" + }, + { + "name": "other_login_method", + "value": "其他登录方式" + }, + { + "name": "vertical_line", + "value": " | " + }, + { + "name": "input_empty_tips", + "value": "输入不能为空" + }, + { + "name": "login_success", + "value": "登录成功" + }, + { + "name": "my_love", + "value": "我的最爱" + }, + { + "name": "history_record", + "value": "历史记录" + }, + { + "name": "message", + "value": "消息" + }, + { + "name": "shopping_cart", + "value": "购物车" + }, + { + "name": "my_goal", + "value": "我的目标" + }, + { + "name": "group", + "value": "圈子" + }, + { + "name": "favorites", + "value": "收藏" + }, + { + "name": "recycle_bin", + "value": "回收站" + }, + { + "name": "rankings", + "value": "排行榜" + }, + { + "name": "new_product_debut", + "value": "新品首发" + }, + { + "name": "big_name_flash", + "value": "大牌闪购" + }, + { + "name": "find_good", + "value": "发现好物" + }, + { + "name": "xiamen_station", + "value": "厦门站,我们不见不散" + }, + { + "name": "more_big_names", + "value": "更多大牌" + }, + { + "name": "push_notifications", + "value": "推送通知" + }, + { + "name": "data_management", + "value": "数据管理" + }, + { + "name": "menu_settings", + "value": "菜单设置" + }, + { + "name": "about", + "value": "关于" + }, + { + "name": "clear_cache", + "value": "清除缓存" + }, + { + "name": "mainPage_tabTitles_home", + "value": "首页" + }, + { + "name": "mainPage_tabTitles_mine", + "value": "我的" + }, + { + "name": "mainPage_top", + "value": "排行榜" + }, + { + "name": "mainPage_text_top", + "value": "厦门站,我们不见不散" + }, + { + "name": "mainPage_new", + "value": "新品首发" + }, + { + "name": "mainPage_text_new", + "value": "厦门站,我们不见不散" + }, + { + "name": "mainPage_brand", + "value": "大牌闪购" + }, + { + "name": "mainPage_text_brand", + "value": "更多大牌" + }, + { + "name": "mainPage_found", + "value": "发现好物" + }, + { + "name": "mainPage_text_found", + "value": "厦门站,我们不见不散" + }, + { + "name": "setting_account_name", + "value": "李先生" + }, + { + "name": "setting_account_email", + "value": "2000000@test.cc" + }, + { + "name": "setting_list_news", + "value": "推送通知" + }, + { + "name": "setting_list_font", + "value": "字体大小调节" + }, + { + "name": "setting_list_menu", + "value": "菜单设置" + }, + { + "name": "setting_list_about", + "value": "关于" + }, + { + "name": "setting_list_storage", + "value": "清除缓存" + }, + { + "name": "setting_list_privacy", + "value": "隐私协议" + }, + { + "name": "setting_button", + "value": "退出登录" + }, + { + "name": "home_list", + "value": "列表" + }, + { + "name": "setting_toggle", + "value": "开关" + }, + { + "name": "bind_title", + "value": "运动完成情况" + }, + { + "name": "fontsize_change", + "value": "字体大小调节" + }, + { + "name": "Confirmed", + "value": "确认" + }, + { + "name": "Cancel", + "value": "取消" + }, + { + "name": "sport_name", + "value": "运动名" + }, + { + "name": "Morning_jogging", + "value": "晨跑" + }, + { + "name": "Yoga", + "value": "瑜伽" + }, + { + "name": "Swimming", + "value": "游泳" + }, + { + "name": "Exercise_duration", + "value": "运动时长: (分钟)" + }, + { + "name": "Completion_Status", + "value": "完成状态" + }, + { + "name": "Completed", + "value": "已完成" + }, + { + "name": "Uncompleted", + "value": "未完成" + }, + { + "name": "submit", + "value": "提交" + }, + { + "name": "enter_duration", + "value": "请输入运动时长" + }, + { + "name": "My_plans", + "value": "我的计划" + }, + { + "name": "ALL", + "value": "任意" + }, + { + "name": "delete_question", + "value": "确定要删除该计划吗?" + }, + { + "name": "delete", + "value": "删除" + }, + { + "name": "Add_Plans", + "value": "新增计划" + }, + { + "name": "status", + "value": "状态" + }, + { + "name": "Duration", + "value": "时长" + }, + { + "name": "Tab_Bar_One", + "value": "首页" + }, + { + "name": "Tab_Bar_Two", + "value": "我的" + } + ] +} \ No newline at end of file diff --git a/PageAndData03/03_StartingPoint/hvigor/hvigor-config.json5 b/PageAndData03/03_StartingPoint/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..73bfab4e997c8d4aea53b22fdd7f10112b30987f --- /dev/null +++ b/PageAndData03/03_StartingPoint/hvigor/hvigor-config.json5 @@ -0,0 +1,17 @@ +{ + "modelVersion": "5.0.0", + "dependencies": { + }, + "execution": { + // "daemon": true, /* Enable daemon compilation. Default: true */ + // "incremental": true, /* Enable incremental compilation. Default: true */ + // "parallel": true, /* Enable parallel compilation. Default: true */ + // "typeCheck": false, /* Enable typeCheck. Default: false */ + }, + "logging": { + // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */ + }, + "debugging": { + // "stacktrace": false /* Disable stacktrace compilation. Default: false */ + } +} \ No newline at end of file diff --git a/PageAndData03/03_StartingPoint/hvigorfile.ts b/PageAndData03/03_StartingPoint/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/PageAndData03/03_StartingPoint/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/PageAndData03/03_StartingPoint/oh-package.json5 b/PageAndData03/03_StartingPoint/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ba334a33e0ef0989bb410985996742da64bceda1 --- /dev/null +++ b/PageAndData03/03_StartingPoint/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "modelVersion": "5.0.0", + "license": "", + "devDependencies": { + }, + "author": "", + "name": "arktscomponents", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} \ No newline at end of file diff --git a/PageAndData03/README.md b/PageAndData03/README.md new file mode 100644 index 0000000000000000000000000000000000000000..47c7ac0a8d11ea2127d8bfb864b25ac95514b9c0 --- /dev/null +++ b/PageAndData03/README.md @@ -0,0 +1,6 @@ +根据【页面与数据:从网络获取数据】教程进行学习,您可以选择从上一教程结束时构建完成的项目开始,也可以直接运行03_StartingPoint文件夹中的项目。 + +根据教程中的提示使用03_Resources文件夹中的文件。 + +如果您想要自行探索,可以直接打开03_Complete文件夹中的项目并浏览代码。 + diff --git a/PageAndData04/04_Complete/AppScope/app.json5 b/PageAndData04/04_Complete/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..45b006b30ea74629e4219a71a70b74840df4ba82 --- /dev/null +++ b/PageAndData04/04_Complete/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.pageanddata", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/PageAndData04/04_Complete/AppScope/resources/base/element/string.json b/PageAndData04/04_Complete/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..594cc44fec10161d4efeae095baef27280a0c27f --- /dev/null +++ b/PageAndData04/04_Complete/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "PageAndData" + } + ] +} diff --git a/PageAndData04/04_Complete/AppScope/resources/base/media/app_icon.png b/PageAndData04/04_Complete/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/PageAndData04/04_Complete/AppScope/resources/base/media/app_icon.png differ diff --git a/PageAndData04/04_Complete/LICENSE b/PageAndData04/04_Complete/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..381eb507bc1eef9b5158e496dedab769e810b657 --- /dev/null +++ b/PageAndData04/04_Complete/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2022 Huawei Device Co., Ltd. All rights reserved. + + 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. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/PageAndData04/04_Complete/build-profile.json5 b/PageAndData04/04_Complete/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..5ce78d4b70932305cc3f0b5ae6e9038c6fa9e57e --- /dev/null +++ b/PageAndData04/04_Complete/build-profile.json5 @@ -0,0 +1,29 @@ +{ + "app": { + "signingConfigs": [ + + ], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "5.0.0(12)", + "runtimeOS": "HarmonyOS" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/build-profile.json5 b/PageAndData04/04_Complete/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..20c75049f2d45e57d267899b6547c79fb6aa84c1 --- /dev/null +++ b/PageAndData04/04_Complete/entry/build-profile.json5 @@ -0,0 +1,14 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + "runtimeOS": "HarmonyOS" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/hvigorfile.ts b/PageAndData04/04_Complete/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/PageAndData04/04_Complete/entry/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { hapTasks } from '@ohos/hvigor-ohos-plugin'; diff --git a/PageAndData04/04_Complete/entry/oh-package.json5 b/PageAndData04/04_Complete/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..19b9234a98d43a4711a0fc32cef604159228d3cd --- /dev/null +++ b/PageAndData04/04_Complete/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "license": "", + "devDependencies": {}, + "author": "", + "name": "entry", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/ets/common/constants/CommonConstants.ets b/PageAndData04/04_Complete/entry/src/main/ets/common/constants/CommonConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..a13926f7b70ffe5bf98e341bbddcaf2baf0b64df --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/ets/common/constants/CommonConstants.ets @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2024 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. + */ + +/** + * Common constants for all features. + */ +export default class CommonConstants { + /** + * The sql of creating sports table. + */ + static readonly CREATE_SPORTS_TABLE_SQL: string = + 'CREATE TABLE IF NOT EXISTS SPORTS (ID INTEGER PRIMARY KEY AUTOINCREMENT, NAME TEXT ' + + 'NOT NULL, TYPE TEXT NOT NULL)'; + + /** + * The sql of creating plans table. + */ + static readonly CREATE_PLANS_TABLE_SQL: string = + 'CREATE TABLE IF NOT EXISTS PLANS (ID INTEGER PRIMARY KEY AUTOINCREMENT, SPORT_ID INTEGER ' + + 'NOT NULL, DURATION INTEGER NOT NULL, STATUS TEXT NOT NULL)'; + + /** + * The sql of querying all durations. + */ + static readonly QUERY_ALL_DURATIONS_SQL: string = + 'SELECT DISTINCT DURATION FROM PLANS'; + + /** + * The sql of query all plans. + */ + static readonly QUERY_ALL_PLANS_SQL: string = + 'SELECT p.id AS ID,s.NAME AS NAME,s.type AS TYPE,p.DURATION AS DURATION,p.STATUS AS STATUS FROM SPORTS AS s ' + + 'JOIN PLANS AS p WHERE s.ID = P.SPORT_ID'; + + /** + * The sql of querying plans by duration. + */ + static readonly QUERY_PLANS_BY_DURATION_SQL: string = + 'SELECT p.id AS ID,s.NAME AS NAME,s.type AS TYPE,p.DURATION AS DURATION,p.STATUS AS STATUS FROM SPORTS AS s' + + ' JOIN PLANS AS p WHERE s.ID = P.SPORT_ID AND p.DURATION = '; + + /** + * The sql of querying plans by status. + */ + static readonly QUERY_PLANS_BY_STATUS_SQL: string = + 'SELECT p.id AS ID,s.NAME AS NAME,s.type AS TYPE,p.DURATION AS DURATION,p.STATUS AS STATUS FROM SPORTS AS s' + + ' JOIN PLANS AS p WHERE s.ID = P.SPORT_ID AND p.STATUS = "'; +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/ets/common/database/PreferencesUtil.ets b/PageAndData04/04_Complete/entry/src/main/ets/common/database/PreferencesUtil.ets new file mode 100644 index 0000000000000000000000000000000000000000..1ead3c56b9ca2ee2da9b2d11bd52771b2f439ac8 --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/ets/common/database/PreferencesUtil.ets @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2024 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 { preferences } from '@kit.ArkData'; +import { BusinessError } from '@kit.BasicServicesKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + +const KEY_APP_FONT_SIZE = 'appFontSize'; +const TAG = 'PreferencesUtil'; + +/** + * The PreferencesUtil provides preferences of create, save and query. + */ +export class PreferencesUtil { + preference?: preferences.Preferences; + + /** + *The method of creating a preferences Instance. + */ + getFontPreferences(context: Context) { + this.preference = preferences.getPreferencesSync(context, { name: 'FontPreferences' }); + hilog.info(0x0000, TAG, 'create success'); + } + + /** + *The method of saving fontsize offset change. + */ + saveChangeFontSize(fontSizeOffset: number) { + this.preference?.putSync(KEY_APP_FONT_SIZE, fontSizeOffset); + this.preference?.flush( + (err: BusinessError) => { + if (err) { + hilog.error(0x0000, TAG, 'Failed to flush. code =' + err.code + ', message =' + err.message); + return; + } + hilog.info(0x0000, TAG, 'Succeeded in flushing.'); + }); + } + + /** + *The method of getting fontsize offset. + */ + getChangeFontSize() { + let fontSizeOffset: number = 0; + fontSizeOffset = this.preference?.getSync(KEY_APP_FONT_SIZE, 0) as number; + return fontSizeOffset; + } + + /** + *The method of Determining Whether a key Exists. + */ + isKeyExist(): boolean { + let isKeyExist: boolean = false; + this.preference?.has(KEY_APP_FONT_SIZE).then(async (isExist: boolean) => { + isKeyExist = isExist; + }).catch((err: Error) => { + hilog.error(0x0000, TAG, 'Has the value failed with err: ' + err); + }); + return isKeyExist; + } +} + +export default new PreferencesUtil(); \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/ets/common/database/RDBStoreUtil.ets b/PageAndData04/04_Complete/entry/src/main/ets/common/database/RDBStoreUtil.ets new file mode 100644 index 0000000000000000000000000000000000000000..b4ac52899f1e936b942ebfc2b4e9cf9caa2c55fe --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/ets/common/database/RDBStoreUtil.ets @@ -0,0 +1,226 @@ +/* + * Copyright (c) 2024 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 { relationalStore } from '@kit.ArkData'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { BusinessError } from '@kit.BasicServicesKit'; +import { GoalItem } from '../../viewmodel/GoalItem'; +import CommonConstants from '../constants/CommonConstants'; + +const TAG: string = 'RDBStoreUtil'; + +/** + *The RDBStoreUtil provides rdbStore of create, save and query. + */ +export class RDBStoreUtil { + objectiveRDB?: relationalStore.RdbStore; + + /** + *The method of creating an RDBStore Instance. + */ + createObjectiveRDB(context: Context) { + const STORE_CONFIG: relationalStore.StoreConfig = { + name: 'Objective.db', + securityLevel: relationalStore.SecurityLevel.S1 + }; + + relationalStore.getRdbStore(context, STORE_CONFIG, (err: BusinessError, rdbStore: relationalStore.RdbStore) => { + this.objectiveRDB = rdbStore; + if (err) { + hilog.error(0x0000, TAG, `Get RdbStore failed, code is ${err.code},message is ${err.message}`); + return; + } + hilog.error(0x0000, TAG, 'Get RdbStore successfully.'); + }) + } + + /** + *The method of creating a sport table. + */ + createSportTable() { + this.objectiveRDB?.execute(CommonConstants.CREATE_SPORTS_TABLE_SQL) + .then(() => { + hilog.info(0x0000, TAG, `execute create sport table sql success`); + }) + .catch((err: BusinessError) => { + hilog.error(0x0000, TAG, `execute sql failed, code is ${err.code},message is ${err.message}`); + }); + } + + /** + *The method of creating a plan table. + */ + createPlanTable() { + this.objectiveRDB?.execute(CommonConstants.CREATE_PLANS_TABLE_SQL) + .then(() => { + hilog.info(0x0000, TAG, `execute create plas table sql success`); + }) + .catch((err: BusinessError) => { + hilog.error(0x0000, TAG, `execute sql failed, code is ${err.code},message is ${err.message}`); + }); + } + + /** + *The method of Initializing sport table. + */ + initSportTable() { + const sportDataOne: relationalStore.ValuesBucket = { + 'ID': 0, + 'NAME': '晨跑', + 'TYPE': '有氧运动' + }; + const sportDataTWO: relationalStore.ValuesBucket = { + 'ID': 1, + 'NAME': '瑜伽', + 'TYPE': '柔韧运动' + }; + const sportDataThree: relationalStore.ValuesBucket = { + 'ID': 2, + 'NAME': '游泳', + 'TYPE': '有氧运动' + }; + let valueBuckets = new Array(sportDataOne, sportDataTWO, sportDataThree); + this.objectiveRDB?.batchInsert('SPORTS', valueBuckets).then((insertNum: number) => { + hilog.info(0x0000, TAG, `batchInsert is successful, the number of values that were inserted = ${insertNum}`); + }).catch((err: BusinessError) => { + hilog.error(0x0000, TAG, `batchInsert is failed, code is ${err.code},message is ${err.message}`); + }) + } + + /** + *The method of querying all durations in all plans. + */ + async queryAllPlansDuration(): Promise { + let plansSet: Array = []; + await this.objectiveRDB?.querySql(CommonConstants.QUERY_ALL_DURATIONS_SQL).then((resultSet: relationalStore.ResultSet) => { + while (resultSet.goToNextRow()) { + let duration: number = resultSet.getValue(resultSet.getColumnIndex('DURATION')) as number; + plansSet.push(duration); + } + resultSet.close(); + }).catch((err: BusinessError) => { + hilog.error(0x0000, TAG, `Query failed, code is ${err.code},message is ${err.message}`); + }) + return plansSet; + } + + /** + *The method of querying all plans. + */ + async queryAllPlans(): Promise { + let plansSet: Array = []; + await this.objectiveRDB?.querySql(CommonConstants.QUERY_ALL_PLANS_SQL) + .then((resultSet: relationalStore.ResultSet) => { + while (resultSet.goToNextRow()) { + const id = resultSet.getValue(resultSet.getColumnIndex('ID')) as number; + const name = resultSet.getValue(resultSet.getColumnIndex('NAME')) as string; + const type = resultSet.getValue(resultSet.getColumnIndex('TYPE')) as string; + const duration = resultSet.getValue(resultSet.getColumnIndex('DURATION')) as number; + const status = resultSet.getValue(resultSet.getColumnIndex('STATUS')) as string; + plansSet.push(new GoalItem(id, name, type, duration, status)); + } + resultSet.close(); + }).catch((err: BusinessError) => { + hilog.error(0x0000, TAG, `Query failed, code is ${err.code},message is ${err.message}`); + }) + return plansSet; + } + + /** + *The method of inserting a plan information. + */ + async insertPlan(sportID: number, duration: number, status: boolean) { + const sportData: relationalStore.ValuesBucket = { + 'SPORT_ID': sportID, + 'DURATION': duration, + 'STATUS': status ? '已完成' : '未完成' + }; + await this.objectiveRDB?.insert('PLANS', sportData, + relationalStore.ConflictResolution.ON_CONFLICT_REPLACE).then((rowId: number) => { + hilog.info(0x0000, TAG, `Insert is successful, rowId = ${rowId}`); + }).catch((err: BusinessError) => { + hilog.error(0x0000, TAG, `Insert is failed, code is ${err.code},message is ${err.message}`); + }) + } + + /** + *The method of updating a plan information. + */ + async updatePlan(planID: number, duration: number, status: boolean) { + const planData: relationalStore.ValuesBucket = { + 'DURATION': duration, + 'STATUS': status ? '已完成' : '未完成' + }; + let predicates = new relationalStore.RdbPredicates('PLANS'); + predicates.equalTo('ID', planID); + await this.objectiveRDB?.update(planData, predicates, + relationalStore.ConflictResolution.ON_CONFLICT_REPLACE).then(async (rows: Number) => { + hilog.info(0x0000, TAG, `Updated row count: ${rows}`); + }).catch((err: BusinessError) => { + hilog.error(0x0000, TAG, `Updated failed, code is ${err.code},message is ${err.message}`); + }) + } + + /** + *The method of deleting a plan information. + */ + async deletePlan(planID: number) { + let predicates = new relationalStore.RdbPredicates('PLANS'); + predicates.equalTo('ID', planID); + await this.objectiveRDB?.delete(predicates).then((rows: Number) => { + hilog.info(0x0000, TAG, `Delete rows: ${rows}`); + }).catch((err: BusinessError) => { + hilog.error(0x0000, TAG, `Delete failed, code is ${err.code},message is ${err.message}`); + }) + } + + /** + *The method of filtering all plans based on different criteria. + */ + async conditionalPlansQuery(duration: number | undefined, status: boolean | undefined): Promise { + let plansSet: Array = []; + let querySql: string = ''; + if (status === undefined) { + if (duration === undefined) { + querySql = CommonConstants.QUERY_ALL_PLANS_SQL; + } else { + querySql = CommonConstants.QUERY_PLANS_BY_DURATION_SQL + duration; + } + } else { + let statusCondition: string = status ? '已完成' : '未完成'; + if (duration === undefined) { + querySql = CommonConstants.QUERY_PLANS_BY_STATUS_SQL + statusCondition + '"'; + } else { + querySql = CommonConstants.QUERY_PLANS_BY_STATUS_SQL + statusCondition + '" and p.DURATION = ' + duration; + } + } + await this.objectiveRDB?.querySql(querySql).then((resultSet: relationalStore.ResultSet) => { + while (resultSet.goToNextRow()) { + const id = resultSet.getValue(resultSet.getColumnIndex('ID')) as number; + const name = resultSet.getValue(resultSet.getColumnIndex('NAME')) as string; + const type = resultSet.getValue(resultSet.getColumnIndex('TYPE')) as string; + const duration = resultSet.getValue(resultSet.getColumnIndex('DURATION')) as number; + const status = resultSet.getValue(resultSet.getColumnIndex('STATUS')) as string; + plansSet.push(new GoalItem(id, name, type, duration, status)); + } + resultSet.close(); + }).catch((err: BusinessError) => { + hilog.error(0x0000, TAG, `Query failed, code is ${err.code},message is ${err.message}`); + }) + return plansSet; + } +} + +export default new RDBStoreUtil(); \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/ets/common/network/ConnectionUtils.ets b/PageAndData04/04_Complete/entry/src/main/ets/common/network/ConnectionUtils.ets new file mode 100644 index 0000000000000000000000000000000000000000..e2ca4d96d32673d24b9815bf7bb316c5e3639895 --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/ets/common/network/ConnectionUtils.ets @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2024 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 { connection } from '@kit.NetworkKit'; +import { BusinessError } from '@kit.BasicServicesKit'; +import { promptAction } from '@kit.ArkUI'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + +const TAG: string = 'ConnectionUtils'; + +/** + * The ConnectionUtils provides the network listening capability. + */ +export class ConnectionUtils { + netConnection = connection.createNetConnection(); + + /** + *The method of checking whether the monitoring network is connected.. + */ + async isNetworkConnected(): Promise { + let result: boolean = false; + await connection.getDefaultNet().then(async (data: connection.NetHandle) => { + if (data.netId === 0) { + hilog.info(0x0000, TAG, 'network error'); + return; + } + await connection.getNetCapabilities(data).then( + (data: connection.NetCapabilities) => { + let bearerTypes: Set = new Set(data.bearerTypes); + let bearerTypesNum = Array.from(bearerTypes.values()); + for (let item of bearerTypesNum) { + if (item === 0) { + result = true; + hilog.info(0x0000, TAG, 'BEARER_CELLULAR'); + } else if (item === 1) { + result = true; + hilog.info(0x0000, TAG, 'BEARER_WIFI'); + } else if (item === 3) { + result = true; + hilog.info(0x0000, TAG, 'BEARER_ETHERNET'); + } else { + return; + } + } + }) + }) + return result; + } + + /** + *The method of opening register. + */ + openRegister() { + this.netConnection.register((error: BusinessError) => { + hilog.info(0x0000, TAG, JSON.stringify(error)); + }); + } + + /** + *The method of listening to the network status. + */ + registerNetworkAvailableStatus() { + this.netConnection.on('netAvailable', () => { + promptAction.showToast({ + message: $r('app.string.Network_Available'), + duration: 2000 + }); + }); + + this.netConnection.on('netUnavailable', () => { + promptAction.showToast({ + message: $r('app.string.Network_Unavailable'), + duration: 2000 + }); + }); + + this.netConnection.on('netLost', () => { + promptAction.showToast({ + message: $r('app.string.Network_Lost'), + duration: 2000 + }); + }); + } + + /** + *The method of closing register. + */ + closeRegister() { + this.netConnection.unregister((error: BusinessError) => { + hilog.info(0x0000, TAG, JSON.stringify(error)); + }); + } +} + +export default new ConnectionUtils(); \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/ets/common/network/HttpUtils.ets b/PageAndData04/04_Complete/entry/src/main/ets/common/network/HttpUtils.ets new file mode 100644 index 0000000000000000000000000000000000000000..529388a5430075676c94ba4a9cc5b67feda528b4 --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/ets/common/network/HttpUtils.ets @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2024 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 { http } from '@kit.NetworkKit'; +import { fileIo, fileUri } from '@kit.CoreFileKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import ResponseData from '../../viewmodel/ResponseData/ResponseData'; +import ListInfo from '../../viewmodel/ResponseData/ListInfo'; + +const TAG: string = 'HttpUtils'; +const IMAGE_URL: string = 'https://developer.huawei.com/system/modules/org.opencms.portal.template.core/' + + 'resources/harmony/img/jiantou_right.svg'; +const RESOURCE_URL: string = 'https://svc-drcn.developer.huawei.com/community/servlet/consumer' + + '/partnerActivityService/v1/developer/activity/terminalActivities/list'; + +/** + * The class of header. + */ +class Header { + contentType: string; + + constructor(contentType: string) { + this.contentType = contentType; + } +} + +/** + * The HttpUtils provides the capability of accessing the network through HTTP. + */ +export class HttpUtils { + httpRequest: http.HttpRequest; + + constructor() { + this.httpRequest = http.createHttp(); + } + + /** + * The method of initiating a GET request through HTTP. + */ + async getHttpRequest(cacheDir: string): Promise { + let responsePictureUri: string = ''; + await this.httpRequest.request(IMAGE_URL, { method: http.RequestMethod.GET }) + .then((data: http.HttpResponse) => { + let filePath = cacheDir + '/test.svg'; + let file = fileIo.openSync(filePath, fileIo.OpenMode.CREATE | fileIo.OpenMode.READ_WRITE); + responsePictureUri = fileUri.getUriFromPath(filePath); + fileIo.writeSync(file.fd, data.result as ArrayBuffer); + fileIo.closeSync(file.fd); + }) + return responsePictureUri; + } + + /** + * The method of initiating a POST request through HTTP. + */ + async postHttpRequest(): Promise { + let responseData: Array = []; + await this.httpRequest.request(RESOURCE_URL, + { + method: http.RequestMethod.POST, extraData: { + 'status': '1', + 'belong': '1', + 'language': 'cn', + 'needTop': 1, + 'displayChannel': [1, 3], + 'count': 4, + 'pagestart': 1, + 'type': '1,4,5,6' + }, + header: new Header('application/json;charset=UTF-8') + }).then((data: http.HttpResponse) => { + let result: ResponseData = JSON.parse(data.result as string); + responseData = result.value.list; + }).catch((err: Error) => { + hilog.info(0x0000, TAG, JSON.stringify(err)); + }); + return responseData; + } + + /** + * The method of destroying httpRequest. + */ + destroyHttpRequest() { + this.httpRequest.destroy(); + } +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/ets/common/network/RCPUtils.ets b/PageAndData04/04_Complete/entry/src/main/ets/common/network/RCPUtils.ets new file mode 100644 index 0000000000000000000000000000000000000000..78e1aa1e9051b5824338ba2e0ef5897b5cfbc6a5 --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/ets/common/network/RCPUtils.ets @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2024 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 { rcp } from '@kit.RemoteCommunicationKit'; +import { fileIo, fileUri } from '@kit.CoreFileKit'; +import { BusinessError } from '@kit.BasicServicesKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import ResponseData from '../../viewmodel/ResponseData/ResponseData'; +import ListInfo from '../../viewmodel/ResponseData/ListInfo'; + +const TAG: string = 'RCPUtils'; +const IMAGE_URL: string = 'https://developer.huawei.com/system/modules/org.opencms.portal.template.core/' + + 'resources/harmony/img/jiantou_right.svg' +const RESOURCE_URL: string = 'https://svc-drcn.developer.huawei.com/community/servlet/consumer' + + '/partnerActivityService/v1/developer/activity/terminalActivities/list' + +/** + * The RCPUtils provides the capability of accessing the network through RCP. + */ +export class RCPUtils { + rcpSession: rcp.Session; + + constructor() { + this.rcpSession = rcp.createSession(); + } + + /** + * The method of initiating a GET request through RCP. + */ + async getRCPRequest(cacheDir: string): Promise { + let responsePictureUri: string = ''; + await this.rcpSession.get(IMAGE_URL).then((response) => { + let filePath = cacheDir + '/test.svg'; + let file = fileIo.openSync(filePath, fileIo.OpenMode.CREATE | fileIo.OpenMode.READ_WRITE); + responsePictureUri = fileUri.getUriFromPath(filePath); + fileIo.writeSync(file.fd, response.body); + fileIo.closeSync(file.fd); + }).catch((err: BusinessError) => { + hilog.error(0x0000, TAG, `err: err code is ${err.code}, err message is ${JSON.stringify(err)}`); + }); + return responsePictureUri; + } + + /** + * The method of initiating a POST request through RCP. + */ + async postRCPRequest(): Promise { + let responseData: Array = []; + let requestContent: rcp.RequestContent = { + 'status': '1', + 'belong': '1', + 'language': 'cn', + 'needTop': 1, + 'displayChannel': [1, 3], + 'count': 4, + 'pagestart': 1, + 'type': '1,4,5,6' + } + await this.rcpSession.post(RESOURCE_URL, requestContent).then((response) => { + let result: ResponseData = response.toJSON() as ResponseData; + responseData = result.value.list; + }).catch((err: BusinessError) => { + hilog.error(0x0000, TAG, `err: err code is ${err.code}, err message is ${JSON.stringify(err)}`); + }); + return responseData; + } + + /** + * The method of closing a RCP Session. + */ + destroySession() { + this.rcpSession.close(); + } +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/ets/entryability/EntryAbility.ets b/PageAndData04/04_Complete/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..d113d5a0dfb97deea90c6088c4162338d3c80bb6 --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2024 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 { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { window } from '@kit.ArkUI'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import PreferencesUtil from '../common/database/PreferencesUtil'; +import RDBStoreUtil from '../common/database/RDBStoreUtil'; +import ConnectionUtils from '../common/network/ConnectionUtils'; + +/** + * Lift cycle management of Ability. + */ +export default class entryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + PreferencesUtil.getFontPreferences(this.context); + ConnectionUtils.openRegister(); + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); + } + + onDestroy(): void | Promise { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + windowStage.getMainWindow().then((data: window.Window) => { + // Window immersive. + data.setWindowLayoutFullScreen(true); + }) + RDBStoreUtil.createObjectiveRDB(this.context); + windowStage.loadContent('pages/LoginPage', (err, data) => { + if (err.code) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + ConnectionUtils.registerNetworkAvailableStatus(); + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + ConnectionUtils.closeRegister(); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/ets/pages/GoalPage.ets b/PageAndData04/04_Complete/entry/src/main/ets/pages/GoalPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..e09d53b6b457a61e8118b60afa0ed692234f11cd --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/ets/pages/GoalPage.ets @@ -0,0 +1,427 @@ +/* + * Copyright (c) 2024 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 { hilog } from '@kit.PerformanceAnalysisKit'; +import RDBStoreUtil from '../common/database/RDBStoreUtil'; +import { GoalItem } from '../viewmodel/GoalItem'; + +const TAG = 'GoalPage'; + +@Builder +export function GoalPageBuilder() { + GoalPage() +} + +/** + * Goal page + */ +@Component +export struct GoalPage { + @State plansSet: Array = []; + @State plan: GoalItem = new GoalItem(0, '', '', 0, ''); + @State durationSelectOptions: Array = []; + @State durationSet: Array = []; + @State currentDuration: number | undefined = undefined; + @State currentStatus: boolean | undefined = undefined; + @State isUpdateShow: boolean = false; + @State isInsetShow: boolean = false; + @State currentNumber: number = 0; + @State currentPlan: GoalItem = new GoalItem(0, '', '', 0, ''); + @State duration: number = 0; + @State status: boolean = false; + @State addSportID: number = 0; + @State addDuration: number = 0; + @State addStatus: boolean = false; + + @Builder + updateBindSheet(planData: GoalItem) { + Column() { + Row() { + Text($r('app.string.sport_name')) + .font({ + size: '16fp', + weight: 500 + }) + .opacity(0.9) + Select([{ value: $r('app.string.Morning_jogging') }, { value: $r('app.string.Yoga') }, + { value: $r('app.string.Swimming') }]) + .value(planData.sportName) + .focusable(false) + .width('150vp') + } + .justifyContent(FlexAlign.SpaceBetween) + .width('90%') + .margin({ + top: '15vp', + bottom: '15vp' + }) + + Row() { + Text($r('app.string.Exercise_duration')) + .font({ + size: '16fp', + weight: 400 + }) + .opacity(0.9) + TextInput({ text: planData.duration.toString() }) + .onChange((data: string) => { + this.duration = Number.parseInt(data); + }) + .width('150vp') + } + .width('90%') + .margin({ bottom: '15vp' }) + .justifyContent(FlexAlign.SpaceBetween) + + Row() { + Text($r('app.string.Completion_Status')) + .font({ + size: '16fp', + weight: 400 + }) + .opacity(0.9) + Select([ + { value: $r('app.string.Completed') }, + { value: $r('app.string.Uncompleted') } + ]) + .width('150vp') + .value(planData.status) + .onSelect((index: number) => { + if (index === 0) { + this.status = true; + } else { + this.status = false; + } + }) + } + .width('90%') + .margin({ bottom: '15vp' }) + .justifyContent(FlexAlign.SpaceBetween) + + Button($r('app.string.submit')) + .width('288vp') + .onClick(async () => { + await RDBStoreUtil.updatePlan(planData.id, this.duration, this.status); + await RDBStoreUtil.queryAllPlans().then((value) => { + this.plansSet = value; + }); + this.refreshSelectOption(); + this.isUpdateShow = false; + }) + } + .justifyContent(FlexAlign.Center) + .width('100%') + } + + @Builder + insertBindSheet() { + Column() { + Row() { + Text($r('app.string.sport_name')) + .font({ + size: '16fp', + weight: 500 + }) + .opacity(0.9) + Select([ + { value: $r('app.string.Morning_jogging') }, + { value: $r('app.string.Yoga') }, + { value: $r('app.string.Swimming') } + ]) + .value($r('app.string.Morning_jogging')) + .onSelect((index: number) => { + this.addSportID = index; + }) + .width('170vp') + } + .justifyContent(FlexAlign.SpaceBetween) + .width('90%') + .margin({ + top: '15vp', + bottom: '15vp' + }) + + Row() { + Text($r('app.string.Exercise_duration')) + .font({ + size: '16fp', + weight: 400 + }) + .opacity(0.9) + TextInput({ placeholder: $r('app.string.enter_duration') }) + .onChange((data: string) => { + this.addDuration = Number.parseInt(data); + }) + .width('170vp') + } + .width('90%') + .margin({ bottom: '15vp' }) + .justifyContent(FlexAlign.SpaceBetween) + + Row() { + Text($r('app.string.Completion_Status')) + .font({ + size: '16fp', + weight: 400 + }) + .opacity(0.9) + Select([ + { value: $r('app.string.Completed') }, + { value: $r('app.string.Uncompleted') } + ]) + .value($r('app.string.Uncompleted')) + .onSelect((index: number) => { + if (index === 0) { + this.addStatus = true; + } else { + this.addStatus = false; + } + }) + .width('170vp') + } + .width('90%') + .margin({ bottom: '15vp' }) + .justifyContent(FlexAlign.SpaceBetween) + + Button($r('app.string.submit')) + .width('288vp') + .onClick(async () => { + await RDBStoreUtil.insertPlan(this.addSportID, this.addDuration, this.addStatus); + await RDBStoreUtil.queryAllPlans().then((value) => { + this.plansSet = value; + }); + this.refreshSelectOption(); + this.isInsetShow = false; + }) + } + .justifyContent(FlexAlign.Center) + .width('100%') + } + + async aboutToAppear(): Promise { + RDBStoreUtil.createSportTable(); + RDBStoreUtil.initSportTable(); + RDBStoreUtil.createPlanTable(); + await RDBStoreUtil.queryAllPlans().then((value) => { + this.plansSet = value; + }); + this.refreshSelectOption(); + } + + async refreshSelectOption() { + await RDBStoreUtil.queryAllPlansDuration().then((value) => { + this.durationSet = value; + }); + this.durationSelectOptions = [{ value: $r('app.string.ALL') }]; + for (let i = 0; i < this.durationSet.length; i++) { + this.durationSelectOptions.push({ value: this.durationSet[i] + 'min' }); + } + } + + build() { + NavDestination() { + Column() { + Column() { + Text($r('app.string.my_goal')) + .width('100%') + .font({ + size: '30fp', + weight: 700 + }) + .margin({ + top: '48vp', + bottom: '32vp' + }) + Row() { + Select(this.durationSelectOptions) + .onSelect((index: number) => { + if (index === 0) { + this.currentDuration = undefined; + } else { + this.currentDuration = this.durationSet[index-1]; + } + }) + .value($r('app.string.Duration')) + .margin({ right: '25vp' }) + Select([{ value: $r('app.string.ALL') }, + { value: $r('app.string.Completed') }, + { value: $r('app.string.Uncompleted') }]) + .onSelect((index: number) => { + if (index === 0) { + this.currentStatus = undefined; + } else if (index === 1) { + this.currentStatus = true; + } else { + this.currentStatus = false; + } + }) + .value($r('app.string.status')) + .margin({ right: '25vp' }) + Image($r('app.media.reset')) + .width(40) + .onClick(async () => { + await RDBStoreUtil.queryAllPlans().then((value) => { + this.plansSet = value; + }); + }) + .margin({ right: '16vp' }) + Image($r('app.media.sift')) + .width(40) + .onClick(async () => { + await RDBStoreUtil.conditionalPlansQuery(this.currentDuration, this.currentStatus).then((value) => { + this.plansSet = value; + }); + }) + .margin({ right: '16vp' }) + } + .width('100%') + .margin({ bottom: '8vp' }) + + List() { + ForEach(this.plansSet, (item: GoalItem, index: number) => { + ListItem() { + Row() { + Column() { + Text(item.sportName) + .font({ + size: '16fp', + weight: 500 + }) + .opacity(0.9) + Text(item.type) + .font({ + size: '14fp', + weight: 400 + }) + .opacity(0.6) + } + .alignItems(HorizontalAlign.Start) + .margin({ left: '16vp' }) + + Text(item.duration + 'min') + .font({ + size: '14vp', + weight: 400 + }) + .opacity(0.6) + Text(item.status) + .font({ + size: '14vp', + weight: 400 + }) + .opacity(0.6) + Image($r('app.media.edit')) + .width('40vp') + .onClick(() => { + this.currentNumber = index; + this.currentPlan = item; + this.isUpdateShow = true; + }) + Image($r('app.media.delete')) + .width('40vp') + .margin({ right: '16vp' }) + .onClick(() => { + AlertDialog.show( + { + message: $r('app.string.delete_question'), + autoCancel: true, + alignment: DialogAlignment.Bottom, + gridCount: 4, + offset: { dx: 0, dy: -20 }, + primaryButton: { + value: $r('app.string.Cancel'), + action: () => { + hilog.info(0x0000, TAG, 'Callback when the first button is clicked'); + } + }, + secondaryButton: { + enabled: true, + defaultFocus: true, + style: DialogButtonStyle.HIGHLIGHT, + value: $r('app.string.delete'), + action: async () => { + await RDBStoreUtil.deletePlan(item.id); + this.refreshSelectOption(); + await RDBStoreUtil.queryAllPlans().then((value) => { + this.plansSet = value; + }); + } + }, + cancel: () => { + hilog.info(0x0000, TAG, 'Closed callbacks'); + }, + onWillDismiss: (dismissDialogAction: DismissDialogAction) => { + if (dismissDialogAction.reason == DismissReason.PRESS_BACK) { + dismissDialogAction.dismiss(); + } + if (dismissDialogAction.reason == DismissReason.TOUCH_OUTSIDE) { + dismissDialogAction.dismiss(); + } + } + } + ) + + }) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.SpaceBetween) + } + .width('100%') + .height('60vp') + }, (item: GoalItem) => JSON.stringify(item)) + } + .width('100%') + .divider({ + strokeWidth: 1, + color: '#1a000000', + startMargin: 16, + endMargin: 16 + }) + .bindSheet(this.isUpdateShow, this.updateBindSheet(this.currentPlan), { + height: '320vp', + title: { title: $r('app.string.bind_title') }, + onDisappear: () => { + this.isUpdateShow = false; + } + }) + } + + Button($r('app.string.Add_Plans')) + .width('100%') + .margin({ bottom: '32vp' }) + .onClick(() => { + this.isInsetShow = true; + }) + .bindSheet(this.isInsetShow, this.insertBindSheet(), { + height: '320vp', + title: { title: $r('app.string.Add_Plans') }, + onDisappear: () => { + this.isInsetShow = false; + } + }) + } + .padding({ + left: '12vp', + right: '12vp' + }) + .width('100%') + .height('100%') + .justifyContent(FlexAlign.SpaceBetween) + } + .backgroundColor('#F1F3F5') + .hideTitleBar(true) + } +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/ets/pages/LoginPage.ets b/PageAndData04/04_Complete/entry/src/main/ets/pages/LoginPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..2f543a45f04be52bea8b081aef4804165ffe3441 --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/ets/pages/LoginPage.ets @@ -0,0 +1,201 @@ +/* + * Copyright (c) 2024 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 { promptAction } from '@kit.ArkUI'; +import ConnectionUtils from '../common/network/ConnectionUtils'; + +@Extend(TextInput) +function inputStyle() { + .placeholderColor('#99182431') + .height('45vp') + .fontSize('18fp') + .backgroundColor('#F1F3F5') + .width('328vp') + .margin({ top: 12 }) +} + +@Extend(Line) +function lineStyle() { + .width('328vp') + .height('1vp') + .backgroundColor('#33182431') +} + +@Extend(Text) +function blueTextStyle() { + .fontColor('#007DFF') + .fontSize('14fp') + .fontWeight(FontWeight.Medium) +} + +/** + * Login page + */ +@Entry +@Component +struct LoginPage { + @State account: string = ''; + @State password: string = ''; + @State isShowProgress: boolean = false; + private timeOutId: number = -1; + pathStack: NavPathStack = new NavPathStack(); + + @Builder + imageButton(src: Resource) { + Button({ type: ButtonType.Circle, stateEffect: true }) { + Image(src) + } + .height('48vp') + .width('48vp') + .backgroundColor('#F1F3F5') + } + + login(result: boolean): void { + if (this.account === '' || this.password === '') { + promptAction.showToast({ + message: $r('app.string.input_empty_tips') + }); + } else { + this.isShowProgress = true; + if (this.timeOutId === -1) { + this.timeOutId = setTimeout(async () => { + this.isShowProgress = false; + this.timeOutId = -1; + + if (result) { + this.pathStack.pushPathByName('MainPage', null); + } else { + promptAction.showToast({ + message: $r('app.string.Network_Lost') + }); + } + }, 2000); + } + } + } + + aboutToDisappear() { + clearTimeout(this.timeOutId); + this.timeOutId = -1; + } + + build() { + Navigation(this.pathStack) { + Column() { + Image($r('app.media.logo')) + .width('78vp') + .height('78vp') + .margin({ top: '150vp', bottom: '8vp' }) + Text($r('app.string.login_page')) + .fontSize('24fp') + .fontWeight(FontWeight.Medium) + .fontColor('#182431') + Text($r('app.string.login_more')) + .fontSize('16fp') + .fontColor('#99182431') + .margin({ + bottom: '30vp', + top: '8vp' + }) + + TextInput({ placeholder: $r('app.string.account') }) + .maxLength(11) + .type(InputType.Number) + .inputStyle() + .onChange((value: string) => { + this.account = value; + }) + Line() + .lineStyle() + + TextInput({ placeholder: $r('app.string.password') }) + .maxLength(8) + .type(InputType.Password) + .inputStyle() + .onChange((value: string) => { + this.password = value; + }) + Line() + .lineStyle() + + Row() { + Text($r('app.string.message_login')) + .blueTextStyle() + Text($r('app.string.forgot_password')) + .blueTextStyle() + } + .justifyContent(FlexAlign.SpaceBetween) + .width('328vp') + .margin({ top: '8vp' }) + + Button($r('app.string.login'), { type: ButtonType.Capsule }) + .width('328vp') + .height('40vp') + .fontSize('16fp') + .fontWeight(FontWeight.Medium) + .backgroundColor($r('app.color.login_button_color')) + .margin({ + top: '48vp', + bottom: '12vp' + }) + .onClick(async () => { + await ConnectionUtils.isNetworkConnected().then((value) => { + this.login(value); + }) + }) + Text($r('app.string.register_account')) + .fontColor('#007DFF') + .fontSize('16fp') + .fontWeight(FontWeight.Medium) + + if (this.isShowProgress) { + LoadingProgress() + .color('#182431') + .width('30vp') + .height('30vp') + .margin({ top: '20vp' }) + } + + Blank() + Text($r('app.string.other_login_method')) + .fontColor('#838D97') + .fontSize('12fp') + .fontWeight(FontWeight.Medium) + .margin({ + top: '50vp', + bottom: '12vp' + }) + Row({ space: 44 }) { + this.imageButton($r('app.media.login_method1')) + this.imageButton($r('app.media.login_method2')) + this.imageButton($r('app.media.login_method3')) + } + .margin({ bottom: '16vp' }) + } + .height('100%') + .width('100%') + .padding({ + left: '12vp', + right: '12vp', + bottom: '24vp' + }) + } + .backgroundColor('#F1F3F5') + .width('100%') + .height('100%') + .hideTitleBar(true) + .hideToolBar(true) + } +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/ets/pages/MainPage.ets b/PageAndData04/04_Complete/entry/src/main/ets/pages/MainPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..df5b162b684ff4a7a1cd902bc0290a7e4a3086ad --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/ets/pages/MainPage.ets @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2024 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 PreferencesUtil from '../common/database/PreferencesUtil'; +import Home from '../view/Home'; +import Setting from '../view/Setting'; + +@Builder +export function MainPageBuilder() { + MainPage() +} + +/** + * Main page + */ +@Component +export struct MainPage { + @StorageLink('fontSizeOffset') fontSizeOffset: number = 0; + @State currentIndex: number = 0; + @State pathStack: NavPathStack = new NavPathStack(); + private tabsController: TabsController = new TabsController(); + + aboutToAppear() { + this.fontSizeOffset = PreferencesUtil.getChangeFontSize(); + } + + @Builder + TabBuilder(title: Resource, index: number, selectedImg: Resource) { + Column() { + SymbolGlyph(selectedImg) + .fontSize('24fp') + .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_OPACITY) + .symbolEffect(new BounceSymbolEffect(EffectScope.WHOLE, EffectDirection.UP), + this.currentIndex === index ? true : false) + .fontColor(this.currentIndex === index ? ['#0a59f7'] : ['#66000000']) + Text(title) + .margin({ top: '4vp' }) + .fontSize(10 + this.fontSizeOffset) + .fontWeight(500) + .fontColor(this.currentIndex === index ? '#0a59f7' : '#66000000') + } + .backgroundColor('#F1F3F5') + .justifyContent(FlexAlign.Center) + .height('56vp') + .width('100%') + .onClick(() => { + this.currentIndex = index; + this.tabsController.changeIndex(this.currentIndex); + }) + } + + build() { + NavDestination() { + Tabs({ + barPosition: BarPosition.End, + controller: this.tabsController + }) { + TabContent() { + Home({ pathStack: this.pathStack }) + } + .padding({ + left: '12vp', + right: '12vp' + }) + .backgroundColor('#F1F3F5') + .tabBar(this.TabBuilder($r('app.string.Tab_Bar_One'), 0, $r('sys.symbol.house_fill'))) + + TabContent() { + Setting() + } + .padding({ + left: '12vp', + right: '12vp' + }) + .backgroundColor('#F1F3F5') + .tabBar(this.TabBuilder($r('app.string.Tab_Bar_Two'), 1, $r('sys.symbol.person_crop_circle_fill_1'))) + } + .margin({ bottom: '64vp' }) + .width('100%') + .height('100%') + .barHeight('80vp') + .barMode(BarMode.Fixed) + .onChange((index: number) => { + this.currentIndex = index; + }) + } + .height('100%') + .hideTitleBar(true) + .backgroundColor('#F1F3F5') + .onReady((context: NavDestinationContext) => { + this.pathStack = context.pathStack; + }) + } +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/ets/view/Home.ets b/PageAndData04/04_Complete/entry/src/main/ets/view/Home.ets new file mode 100644 index 0000000000000000000000000000000000000000..1f23a3928fbdc39be5b65160db2744e195ab343a --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/ets/view/Home.ets @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2024 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 { common } from '@kit.AbilityKit'; +import mainViewModel from '../viewmodel/MainViewModel'; +import ItemData from '../viewmodel/ItemData'; +import ListInfo from '../viewmodel/ResponseData/ListInfo'; +import { HttpUtils } from '../common/network/HttpUtils'; +import { RCPUtils } from '../common/network/RCPUtils'; + +/** + * Home tab content + */ +@Component +export default struct Home { + @StorageLink('fontSizeOffset') fontSizeOffset: number = 0; + @State httpGridItems: Array = []; + @State pictureUri: string = ''; + @Link pathStack: NavPathStack; + private swiperController: SwiperController = new SwiperController(); + context = getContext(this) as common.UIAbilityContext; + applicationContext = this.context.getApplicationContext(); + cacheDir = this.applicationContext.filesDir; + + async aboutToAppear(): Promise { + // let httpUtil: HttpUtils = new HttpUtils(); + // await httpUtil.postHttpRequest().then((value : Array)=>{ + // this.httpGridItems = value; + // }); + // await httpUtil.getHttpRequest(this.cacheDir).then((value: string) => { + // this.pictureUri = value; + // }); + // httpUtil.destroyHttpRequest(); + + let rcpUtil: RCPUtils = new RCPUtils(); + await rcpUtil.postRCPRequest().then((value: Array) => { + this.httpGridItems = value; + }); + await rcpUtil.getRCPRequest(this.cacheDir).then((value: string) => { + this.pictureUri = value; + }); + rcpUtil.destroySession(); + } + + build() { + Column() { + Text($r('app.string.mainPage_tabTitles_home')) + .width('100%') + .margin({ + top: '48vp', + bottom: '12vp' + }) + .fontWeight(700) + .fontSize(26 + this.fontSizeOffset) + + Scroll() { + Column() { + Swiper(this.swiperController) { + ForEach(mainViewModel.getSwiperImages(), (img: Resource) => { + Image(img) + .width('100%') + .borderRadius('16vp') + }, (img: Resource) => JSON.stringify(img.id)) + } + .autoPlay(true) + + Grid() { + ForEach(mainViewModel.getFirstGridData(), (item: ItemData, index: number) => { + GridItem() { + Column() { + Image(item.img) + .width('40vp') + .height('40vp') + Text(item.title) + .fontSize(12 + this.fontSizeOffset) + .margin({ top: '4vp' }) + } + } + .onClick(() => { + if (index === 4) { + this.pathStack.pushPathByName('GoalPage', null); + } + }) + }, (item: ItemData) => JSON.stringify(item)) + } + .backgroundImage($r('app.media.backgroundImage')) + .backgroundImageSize({ + width: '100%', + height: '156vp' + }) + .columnsTemplate('1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr') + .columnsGap('8vp') + .rowsGap('12vp') + .margin({ top: '12vp' }) + .padding({ + top: '12vp', + bottom: '12vp' + }) + .height('156vp') + .backgroundColor(Color.White) + .borderRadius('16vp') + + Text($r('app.string.home_list')) + .fontSize('18fp') + .fontWeight(700) + .width('100%') + .margin({ + top: '18vp', + bottom: '8vp' + }) + + List() { + ForEach(this.httpGridItems, (secondItem: ListInfo) => { + ListItem() { + Row() { + Image(secondItem.indexNavPic) + .width('130vp') + .height('80vp') + .objectFit(ImageFit.TOP_START) + .borderRadius(8) + .margin({ right: '12vp' }) + + Column() { + Text(secondItem.activityName) + .width('190vp') + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(1) + .fontSize(16 + this.fontSizeOffset) + .fontWeight(FontWeight.Medium) + Text(secondItem.theme) + .width('190vp') + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(2) + .margin({ top: '4vp' }) + .fontSize(12 + this.fontSizeOffset) + .fontColor('#99182431') + Row() { + Image(this.pictureUri) + .width('20vp') + .opacity(0.5) + } + .width('170vp') + .margin({ top: '10.5vp' }) + .justifyContent(FlexAlign.End) + .alignItems(VerticalAlign.Bottom) + } + .alignItems(HorizontalAlign.Start) + } + .width('100%') + .padding({ + left: '12vp', + right: '12vp', + top: '12vp', + bottom: '12vp' + }) + .justifyContent(FlexAlign.SpaceBetween) + } + .margin({ bottom: '8vp' }) + .borderRadius('16vp') + .backgroundColor('#ffffff') + .borderRadius($r('app.float.home_backgroundImage_borderRadius')) + .align(Alignment.TopStart) + .width('100%') + }, (secondItem: ListInfo) => JSON.stringify(secondItem)) + } + .scrollBar(BarState.Off) + .width('100%') + } + } + .height('660vp') + .align(Alignment.TopStart) + .scrollBar(BarState.Off) + } + .justifyContent(FlexAlign.Start) + .alignItems(HorizontalAlign.Start) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/ets/view/Setting.ets b/PageAndData04/04_Complete/entry/src/main/ets/view/Setting.ets new file mode 100644 index 0000000000000000000000000000000000000000..22694e93e16d67f805d8568ad5d41678f7d6a16a --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/ets/view/Setting.ets @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2024 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 ItemData from '../viewmodel/ItemData'; +import mainViewModel from '../viewmodel/MainViewModel'; +import { SliderCustomDialog } from './SliderCustomDialog'; + +/** + * Setting tab content + */ +@Component +export default struct Setting { + @StorageLink('fontSizeOffset') fontSizeOffset: number = 0; + SliderCustomDialogController: CustomDialogController = new CustomDialogController({ + builder: SliderCustomDialog({}), + alignment: DialogAlignment.Bottom, + customStyle: true, + offset: { dx: 0, dy: -25 } + }); + + @Builder + settingCell(item: ItemData, customDialogController: CustomDialogController) { + Row() { + Row({}) { + Image(item.img) + .height('22vp') + .margin({ + left: '16vp', + right: '12vp' + }) + Text(item.title) + .fontSize(16 + this.fontSizeOffset) + } + + if (item.others === undefined) { + Image($r('app.media.right_grey')) + .width('12vp') + .height('24vp') + } else { + Toggle({ type: ToggleType.Switch, isOn: false }) + } + } + .onClick(() => { + if (item.id === 1) { + customDialogController.open(); + } + }) + .justifyContent(FlexAlign.SpaceBetween) + .width('100%') + .padding({ + left: '8vp', + right: '22vp' + }) + } + + build() { + Scroll() { + Column({ space: 12 }) { + Text($r('app.string.mainPage_tabTitles_mine')) + .width('100%') + .margin({ + top: '48vp', + bottom: '12vp' + }) + .fontWeight(700) + .fontSize(26 + this.fontSizeOffset) + + Row() { + Image($r('app.media.account')) + .width('48vp') + .height('48vp') + Column() { + Text($r('app.string.setting_account_name')) + .fontSize(20 + this.fontSizeOffset) + Text($r('app.string.setting_account_email')) + .fontSize(12 + this.fontSizeOffset) + .margin({ top: '4vp' }) + } + .alignItems(HorizontalAlign.Start) + .margin({ left: '12vp' }) + } + .alignItems(VerticalAlign.Center) + .width('100%') + + List({ space: 12 }) { + ForEach(mainViewModel.getSettingListData(), (item: ItemData[]) => { + ListItemGroup() { + ForEach(item, (cell: ItemData) => { + ListItem() { + this.settingCell(cell, this.SliderCustomDialogController); + } + .height('48vp') + }, (cell: ItemData) => JSON.stringify(cell)) + } + .divider({ + strokeWidth: '1vp', + color: '#0d000000', + startMargin: '42vp', + endMargin: '24vp' + }) + .backgroundColor('#ffffff') + .borderRadius('16vp') + + }, (item: ItemData) => JSON.stringify(item)) + } + .scrollBar(BarState.Off) + .width('100%') + .padding({ + top: 4, + bottom: 4 + }) + + Blank() + + Button($r('app.string.setting_button'), { type: ButtonType.Capsule }) + .width('90%') + .height('40vp') + .fontSize(16 + this.fontSizeOffset) + .fontColor('#FA2A2D') + .fontWeight(FontWeight.Medium) + .backgroundColor('#E5E8EA') + .margin({ bottom: '16vp' }) + } + .height('100%') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/ets/view/SliderCustomDialog.ets b/PageAndData04/04_Complete/entry/src/main/ets/view/SliderCustomDialog.ets new file mode 100644 index 0000000000000000000000000000000000000000..a3cb65e436f748a71ab29e0fe470114d0347899c --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/ets/view/SliderCustomDialog.ets @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2024 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 PreferencesUtil from '../common/database/PreferencesUtil'; + +@CustomDialog +export struct SliderCustomDialog { + @StorageLink('fontSizeOffset') fontSizeOffset: number = 4; + @State currentValue: number = 0; + SliderCustomDialogController?: CustomDialogController; + + build() { + Column() { + Text($r('app.string.fontsize_change')) + .font({ + size: '20fp', + weight: 700 + }) + .textAlign(TextAlign.Center) + .opacity(0.9) + .width('312vp') + .height('27vp') + .margin({ + top: '15vp', + bottom: '15vp', + left: '24vp', + right: '24vp' + }) + Row() { + Text('A') + .font({ + size: '12fp', + weight: 700 + }) + .margin({ right: '4vp' }) + Slider({ + value: this.fontSizeOffset, + min: -4, + max: 4, + }) + .margin({ right: '4vp' }) + .width('304vp') + .onChange((data: number) => { + this.currentValue = data; + }) + Text('A') + .font({ + size: '20fp', + weight: 700 + }) + } + + Row() { + Button($r('app.string.Cancel')) + .width('156vp') + .height('41vp') + .margin({ + left: '16vp', + right: '16vp' + }) + .backgroundColor('#0d000000') + .fontColor('#0A59F7') + .onClick(() => { + this.SliderCustomDialogController?.close(); + }) + Button($r('app.string.Confirmed')) + .width('156vp') + .height('41vp') + .margin({ right: '16vp' }) + .onClick(() => { + PreferencesUtil.saveChangeFontSize(this.currentValue); + this.fontSizeOffset = this.currentValue; + this.SliderCustomDialogController?.close(); + }) + } + .width('100%') + .margin({ + top: '15vp', + bottom: '15vp' + }) + } + .justifyContent(FlexAlign.Center) + .alignItems(HorizontalAlign.Center) + .width('360vp') + .backgroundColor('#ffffff') + .borderRadius('16vp') + } +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/ets/viewmodel/GoalItem.ets b/PageAndData04/04_Complete/entry/src/main/ets/viewmodel/GoalItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..6ab9d2bda10fc02e07bf6d97757f9bcb6f8a93f3 --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/ets/viewmodel/GoalItem.ets @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2024 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 class GoalItem { + id: number; + sportName: string; + type: string; + duration: number; + status: string; + + constructor(id: number, sportName: string, type: string, duration: number, status: string) { + this.id = id; + this.sportName = sportName; + this.type = type; + this.duration = duration; + this.status = status; + } +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/ets/viewmodel/HttpGridItem.ets b/PageAndData04/04_Complete/entry/src/main/ets/viewmodel/HttpGridItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..0e2a14505a53c655b2177be26742a72eca0a027c --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/ets/viewmodel/HttpGridItem.ets @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2024 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 class HttpGridItem { + /** + * Text of list item. + */ + title: string; + /** + * Image of list item. + */ + img: string; + /** + * Other resource of list item. + */ + content: string; + + constructor(title: string, img: string, content: string) { + this.title = title; + this.img = img; + this.content = content; + } +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/ets/viewmodel/ItemData.ets b/PageAndData04/04_Complete/entry/src/main/ets/viewmodel/ItemData.ets new file mode 100644 index 0000000000000000000000000000000000000000..83914c4bcaeddff2e6fb7fb41dcb389eaeb6bdf6 --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/ets/viewmodel/ItemData.ets @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2024 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 class PageResource { + /** + * ID of list item. + */ + id: number; + /** + * Text of list item. + */ + title: Resource; + /** + * Image of list item. + */ + img: Resource; + /** + * Other resource of list item. + */ + others?: Resource; + + constructor(id: number, title: Resource, img: Resource, others?: Resource) { + this.id = id; + this.title = title; + this.img = img; + this.others = others; + } +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/ets/viewmodel/MainViewModel.ets b/PageAndData04/04_Complete/entry/src/main/ets/viewmodel/MainViewModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..c3e6c387b5bb9bd61cf5afaa2b055640430c0b95 --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/ets/viewmodel/MainViewModel.ets @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2024 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 ItemData from './ItemData'; + +/** + * Binds data to components and provides interfaces. + */ +export class MainViewModel { + /** + * Get swiper image data. + * + * @return {Array} swiperImages. + */ + getSwiperImages(): Array { + let swiperImages: Resource[] = [ + $r('app.media.fig1'), + $r('app.media.fig2'), + $r('app.media.fig3'), + $r('app.media.fig4') + ]; + return swiperImages; + } + + /** + * Get data of the first grid. + * + * @return {Array} firstGridData. + */ + getFirstGridData(): Array { + let firstGridData: ItemData[] = [ + new ItemData(0, $r('app.string.my_love'), $r('app.media.love')), + new ItemData(1, $r('app.string.history_record'), $r('app.media.record')), + new ItemData(2, $r('app.string.message'), $r('app.media.message')), + new ItemData(3, $r('app.string.shopping_cart'), $r('app.media.shopping')), + new ItemData(4, $r('app.string.my_goal'), $r('app.media.target')), + new ItemData(5, $r('app.string.group'), $r('app.media.circle')), + new ItemData(6, $r('app.string.favorites'), $r('app.media.favorite')), + new ItemData(7, $r('app.string.recycle_bin'), $r('app.media.recycle')) + ]; + return firstGridData; + } + + /** + * Get data of the setting list. + * + * @return {Array} settingListData. + */ + getSettingListData(): Array> { + let settingListData: ItemData[][] = [ + [ + new ItemData(0, $r('app.string.setting_list_news'), $r('app.media.news'), $r("app.string.setting_toggle")) + ], + [ + new ItemData(1, $r('app.string.setting_list_font'), $r('app.media.data')), + new ItemData(2, $r('app.string.setting_list_menu'), $r('app.media.menu')), + ], + [ + new ItemData(3, $r('app.string.clear_cache'), $r('app.media.storage')), + new ItemData(4, $r('app.string.setting_list_privacy'), $r('app.media.person_shield')), + ], + [ + new ItemData(5, $r('app.string.setting_list_about'), $r('app.media.about')) + ] + ]; + return settingListData; + } +} + +export default new MainViewModel(); \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/ets/viewmodel/ResponseData/ListInfo.ets b/PageAndData04/04_Complete/entry/src/main/ets/viewmodel/ResponseData/ListInfo.ets new file mode 100644 index 0000000000000000000000000000000000000000..569823b4da1588d054bc1368d400ab20ab660c62 --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/ets/viewmodel/ResponseData/ListInfo.ets @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2024 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 class ListInfo { + public activityName: string; + public theme: string; + public indexNavPic: string; + + constructor(activityName: string, theme: string, indexNavPic: string) { + this.activityName = activityName; + this.theme = theme; + this.indexNavPic = indexNavPic; + } +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/ets/viewmodel/ResponseData/ResponseData.ets b/PageAndData04/04_Complete/entry/src/main/ets/viewmodel/ResponseData/ResponseData.ets new file mode 100644 index 0000000000000000000000000000000000000000..5f27bfc990dc43f9d778d70191fa5a12df3532b9 --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/ets/viewmodel/ResponseData/ResponseData.ets @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2024 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 Value from './Value'; + +export default class ResponseData { + public code: string; + public value: Value; + + constructor(code: string, value: Value) { + this.code = code; + this.value = value; + } +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/ets/viewmodel/ResponseData/Value.ets b/PageAndData04/04_Complete/entry/src/main/ets/viewmodel/ResponseData/Value.ets new file mode 100644 index 0000000000000000000000000000000000000000..8af68edb0f61f7114ede333ea603a2d9505b1895 --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/ets/viewmodel/ResponseData/Value.ets @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2024 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 ListInfo from './ListInfo'; + +export default class Value { + public list: Array; + + constructor(list: Array) { + this.list = list; + } +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/module.json5 b/PageAndData04/04_Complete/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ccfb83c424f5a6d145e085ac2e658114f7ec522b --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/module.json5 @@ -0,0 +1,59 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone" + ], + "routerMap": "$profile:route_map", + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ets", + "description": "$string:EntryAbility_desc", + "icon": "$media:startIcon", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ], + "requestPermissions": [ + { + "name": "ohos.permission.INTERNET", + "reason": "$string:Internet", + "usedScene": { + "abilities": [ + "EntryAbility" + ], + "when": "inuse" + } + }, + { + "name": "ohos.permission.GET_NETWORK_INFO", + "reason": "$string:network_info", + "usedScene": { + "abilities": [ + "EntryAbility" + ], + "when": "inuse" + } + } + ] + } +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/element/color.json b/PageAndData04/04_Complete/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..2b713164d8fd7c5053a1af4809507f13410e05a6 --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/resources/base/element/color.json @@ -0,0 +1,80 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "white", + "value": "#FFFFFF" + }, + { + "name": "background", + "value": "#F1F3F5" + }, + { + "name": "title_text_color", + "value": "#182431" + }, + { + "name": "login_more_text_color", + "value": "#99182431" + }, + { + "name": "placeholder_color", + "value": "#99182431" + }, + { + "name": "line_color", + "value": "#33182431" + }, + { + "name": "login_button_color", + "value": "#007DFF" + }, + { + "name": "login_blue_text_color", + "value": "#007DFF" + }, + { + "name": "other_login_text_color", + "value": "#838D97" + }, + { + "name": "loading_color", + "value": "#182431" + }, + { + "name": "mainPage_selected", + "value": "#1698CE" + }, + { + "name": "mainPage_normal", + "value": "#6B6B6B" + }, + { + "name": "mainPage_backgroundColor", + "value": "#F1F3F5" + }, + { + "name": "home_grid_fontColor", + "value": "#99182431" + }, + { + "name": "setting_button_backgroundColor", + "value": "#E5E8EA" + }, + { + "name": "setting_button_fontColor", + "value": "#FA2A2D" + }, + { + "name": "grid_linear_start", + "value": "#1a0a5918" + }, + { + "name": "grid_linear_end", + "value": "#ffffff" + } + ] +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/element/float.json b/PageAndData04/04_Complete/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..19ba0e188d1786b004c41f6ee067844629fe3502 --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/resources/base/element/float.json @@ -0,0 +1,292 @@ +{ + "float": [ + { + "name": "logo_image_size", + "value": "78vp" + }, + { + "name": "logo_margin_top", + "value": "100vp" + }, + { + "name": "logo_margin_bottom", + "value": "8vp" + }, + { + "name": "page_title_text_size", + "value": "24fp" + }, + { + "name": "normal_text_size", + "value": "16fp" + }, + { + "name": "big_text_size", + "value": "18fp" + }, + { + "name": "small_text_size", + "value": "14fp" + }, + { + "name": "little_text_size", + "value": "12fp" + }, + { + "name": "login_more_margin_bottom", + "value": "30vp" + }, + { + "name": "login_more_margin_top", + "value": "8vp" + }, + { + "name": "login_input_height", + "value": "45vp" + }, + { + "name": "forgot_margin_top", + "value": "8vp" + }, + { + "name": "input_margin_top", + "value": "12vp" + }, + { + "name": "line_height", + "value": "1vp" + }, + { + "name": "login_button_height", + "value": "40vp" + }, + { + "name": "login_button_margin_top", + "value": "87vp" + }, + { + "name": "login_button_margin_bottom", + "value": "12vp" + }, + { + "name": "vertical_line_margin", + "value": "15vp" + }, + { + "name": "login_progress_size", + "value": "30vp" + }, + { + "name": "login_progress_margin_top", + "value": "20vp" + }, + { + "name": "other_login_margin_top", + "value": "50vp" + }, + { + "name": "other_login_margin_bottom", + "value": "12vp" + }, + { + "name": "login_page_padding_bottom", + "value": "24vp" + }, + { + "name": "other_login_image_size", + "value": "48vp" + }, + { + "name": "page_padding_hor", + "value": "12vp" + }, + { + "name": "mainPage_baseTab_top", + "value": "4vp" + }, + { + "name": "mainPage_baseTab_margin", + "value": "8vp" + }, + { + "name": "mainPage_padding", + "value": "12vp" + }, + { + "name": "mainPage_barHeight", + "value": "56vp" + }, + { + "name": "mainPage_baseTab_size", + "value": "25vp" + }, + { + "name": "main_tab_fontSize", + "value": "10fp" + }, + { + "name": "mainPage_tabTitles_margin", + "value": "12vp" + }, + { + "name": "mainPage_tabTitles_padding", + "value": "12vp" + }, + { + "name": "home_swiper_borderRadius", + "value": "16vp" + }, + { + "name": "home_swiper_margin", + "value": "24vp" + }, + { + "name": "home_grid_columnsGap", + "value": "8vp" + }, + { + "name": "home_grid_rowGap", + "value": "12vp" + }, + { + "name": "home_grid_padding", + "value": "12vp" + }, + { + "name": "home_grid_height", + "value": "124vp" + }, + { + "name": "home_grid_margin", + "value": "10vp" + }, + { + "name": "home_list_margin", + "value": "4vp" + }, + { + "name": "home_list_padding", + "value": "8vp" + }, + { + "name": "home_grid_borderRadius", + "value": "24vp" + }, + { + "name": "home_text_margin", + "value": "12vp" + }, + { + "name": "home_backgroundImage_borderRadius", + "value": "12vp" + }, + { + "name": "home_secondGrid_height", + "value": "260vp" + }, + { + "name": "home_secondGrid_margin", + "value": "10vp" + }, + { + "name": "home_homeCell_size", + "value": "24vp" + }, + { + "name": "home_homeCell_margin", + "value": "4vp" + }, + { + "name": "home_homeCell_width", + "value": "80vp" + }, + { + "name": "home_homeCell_height", + "value": "80vp" + }, + { + "name": "setting_name_margin", + "value": "4vp" + }, + { + "name": "setting_account_margin", + "value": "24vp" + }, + { + "name": "setting_account_size", + "value": "48vp" + }, + { + "name": "setting_account_fontSize", + "value": "20fp" + }, + { + "name": "setting_account_text_height", + "value": "28vp" + }, + { + "name": "setting_account_height", + "value": "96vp" + }, + { + "name": "setting_account_padding", + "value": "24vp" + }, + { + "name": "setting_account_borderRadius", + "value": "16vp" + }, + { + "name": "setting_list_height", + "value": "48vp" + }, + { + "name": "setting_list_padding", + "value": "4vp" + }, + { + "name": "setting_list_borderRadius", + "value": "16vp" + }, + { + "name": "setting_list_startMargin", + "value": "42vp" + }, + { + "name": "setting_list_endMargin", + "value": "24vp" + }, + { + "name": "setting_list_strokeWidth", + "value": "0.25vp" + }, + { + "name": "setting_button_bottom", + "value": "55vp" + }, + { + "name": "setting_size", + "value": "22vp" + }, + { + "name": "setting_padding", + "value": "10vp" + }, + { + "name": "setting_jump_width", + "value": "12vp" + }, + { + "name": "setting_jump_height", + "value": "24vp" + }, + { + "name": "setting_settingCell_left", + "value": "8vp" + }, + { + "name": "setting_settingCell_right", + "value": "22vp" + } + ] +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/element/string.json b/PageAndData04/04_Complete/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..5392b0095aa9dae9758275bdd855ba48b8ae3a29 --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/resources/base/element/string.json @@ -0,0 +1,340 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "PageAndData" + }, + { + "name": "login_page", + "value": "Login page" + }, + { + "name": "login_more", + "value": "Log in to your account to use more services" + }, + { + "name": "account", + "value": "Account" + }, + { + "name": "password", + "value": "Password" + }, + { + "name": "login", + "value": "Log in" + }, + { + "name": "register_account", + "value": "Registering an Account" + }, + { + "name": "forgot_password", + "value": "Forgot Password" + }, + { + "name": "message_login", + "value": "SMS verification code login" + }, + { + "name": "other_login_method", + "value": "Other login methods" + }, + { + "name": "vertical_line", + "value": " | " + }, + { + "name": "input_empty_tips", + "value": "The input cannot be empty." + }, + { + "name": "login_success", + "value": "The login is successful." + }, + { + "name": "my_love", + "value": "My favorite" + }, + { + "name": "history_record", + "value": "History" + }, + { + "name": "message", + "value": "Message" + }, + { + "name": "shopping_cart", + "value": "Shopping cart" + }, + { + "name": "my_goal", + "value": "My goal" + }, + { + "name": "group", + "value": "Group" + }, + { + "name": "favorites", + "value": "Favorites" + }, + { + "name": "recycle_bin", + "value": "Recycle Bin" + }, + { + "name": "rankings", + "value": "Rankings" + }, + { + "name": "new_product_debut", + "value": "New product debut" + }, + { + "name": "big_name_flash", + "value": "Big name flash" + }, + { + "name": "find_good", + "value": "Find good things" + }, + { + "name": "xiamen_station", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "more_big_names", + "value": "More Big Names" + }, + { + "name": "push_notifications", + "value": "Push Notifications" + }, + { + "name": "data_management", + "value": "Data Management" + }, + { + "name": "menu_settings", + "value": "Menu Settings" + }, + { + "name": "about", + "value": "About" + }, + { + "name": "clear_cache", + "value": "Clear Cache" + }, + { + "name": "mainPage_tabTitles_home", + "value": "Home" + }, + { + "name": "mainPage_tabTitles_mine", + "value": "Mine" + }, + { + "name": "mainPage_top", + "value": "Rankings" + }, + { + "name": "mainPage_text_top", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "mainPage_new", + "value": "New product debut" + }, + { + "name": "mainPage_text_new", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "mainPage_brand", + "value": "Big name flash" + }, + { + "name": "mainPage_text_brand", + "value": "More Big Names" + }, + { + "name": "mainPage_found", + "value": "Find good things" + }, + { + "name": "mainPage_text_found", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "setting_account_name", + "value": "Mr. Lee" + }, + { + "name": "setting_account_email", + "value": "2000000@test.cc" + }, + { + "name": "setting_list_news", + "value": "Push Notifications" + }, + { + "name": "setting_list_font", + "value": "Fontsize Change" + }, + { + "name": "setting_list_menu", + "value": "Menu Settings" + }, + { + "name": "setting_list_about", + "value": "About" + }, + { + "name": "setting_list_storage", + "value": "Clear Cache" + }, + { + "name": "setting_list_privacy", + "value": "Privacy Agreement" + }, + { + "name": "setting_button", + "value": "Logout" + }, + { + "name": "home_list", + "value": "List" + }, + { + "name": "setting_toggle", + "value": "switch" + }, + { + "name": "bind_title", + "value": "Exercise completion" + }, + { + "name": "fontsize_change", + "value": "FontSize change" + }, + { + "name": "Confirmed", + "value": "Confirmed" + }, + { + "name": "Cancel", + "value": "Cancel" + }, + { + "name": "sport_name", + "value": "Sport Name" + }, + { + "name": "Morning_jogging", + "value": "Morning jogging" + }, + { + "name": "Yoga", + "value": "Yoga" + }, + { + "name": "Swimming", + "value": "Swimming" + }, + { + "name": "Exercise_duration", + "value": "Exercise duration: (minutes)" + }, + { + "name": "Completion_Status", + "value": "Completion Status" + }, + { + "name": "Completed", + "value": "Completed" + }, + { + "name": "Uncompleted", + "value": "Uncompleted" + }, + { + "name": "submit", + "value": "Submit" + }, + { + "name": "enter_duration", + "value": "Please enter the exercise duration." + }, + { + "name": "My_plans", + "value": "My Plans" + }, + { + "name": "ALL", + "value": "All" + }, + { + "name": "delete_question", + "value": "Are you sure you want to delete the plan?" + }, + { + "name": "delete", + "value": "Delete" + }, + { + "name": "Add_Plans", + "value": "Add plan" + }, + { + "name": "status", + "value": "Status" + }, + { + "name": "Duration", + "value": "Duration" + }, + { + "name": "Tab_Bar_One", + "value": "Home Page" + }, + { + "name": "Tab_Bar_Two", + "value": "Mine" + }, + { + "name": "Network_Available", + "value": "Network Available" + }, + { + "name": "Network_Lost", + "value": "Network Lost" + }, + { + "name": "Network_Unavailable", + "value": "Network Unavailable" + }, + { + "name": "Login_Failed", + "value": "Failed to log in because the network is not connected." + }, + { + "name": "Internet", + "value": "Internet Permission Request" + }, + { + "name": "network_info", + "value": "NetWork Info Permission Request" + } + ] +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/about.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/about.png new file mode 100644 index 0000000000000000000000000000000000000000..6896495ca95dd5eb4507c1f70f2f1a24ede868db Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/about.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/account.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/account.png new file mode 100644 index 0000000000000000000000000000000000000000..12f8fe56f8faa51ab5d61ee40f38cae3a79135df Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/account.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/arrow.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..87bd1f3a6eb2e77b58c40aabca5f7ce6b1f158e5 Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/arrow.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/backgroundImage.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/backgroundImage.png new file mode 100644 index 0000000000000000000000000000000000000000..86e8d90778d319f4fa50f21b6ed7f173a89995b2 Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/backgroundImage.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/brand.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/brand.png new file mode 100644 index 0000000000000000000000000000000000000000..657be8334a8a445f21d9b74ed4cb6627dc13d127 Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/brand.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/circle.svg b/PageAndData04/04_Complete/entry/src/main/resources/base/media/circle.svg new file mode 100644 index 0000000000000000000000000000000000000000..f6fa05cf1550e22111cc0b64007727276bb3aa66 --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/resources/base/media/circle.svg @@ -0,0 +1,18 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/data.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/data.png new file mode 100644 index 0000000000000000000000000000000000000000..101db234f4b25f8997d0d3881ddd79b68599dc8b Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/data.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/delete.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/delete.png new file mode 100644 index 0000000000000000000000000000000000000000..fd17d4dbadfe66884774d8ed779e8cec48f79896 Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/delete.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/discover_normal.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/discover_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..24a53012eacc0b6974d9eafef8eaac364a52fbbd Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/discover_normal.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/discover_selected.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/discover_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..db4bbaacdbb9c59915f4886ef6da79ec62fdd897 Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/discover_selected.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/edit.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/edit.png new file mode 100644 index 0000000000000000000000000000000000000000..6ff921b308877a85886ee1c24a4661a5d5f6df66 Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/edit.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/favorite.svg b/PageAndData04/04_Complete/entry/src/main/resources/base/media/favorite.svg new file mode 100644 index 0000000000000000000000000000000000000000..06d2bed182b8d3846faee9305bf2532ad96b2b33 --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/resources/base/media/favorite.svg @@ -0,0 +1,15 @@ + + + Created with Pixso. + + + + + + + + + + + + diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/fig1.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/fig1.png new file mode 100644 index 0000000000000000000000000000000000000000..3f1e081539375a4fb4ac142ab7061287af80a12d Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/fig1.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/fig2.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/fig2.png new file mode 100644 index 0000000000000000000000000000000000000000..5e307d53994dafc85984518b5513f80d864b8815 Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/fig2.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/fig3.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/fig3.png new file mode 100644 index 0000000000000000000000000000000000000000..e47660fee043619b24d38aaf61897f7282454109 Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/fig3.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/fig4.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/fig4.png new file mode 100644 index 0000000000000000000000000000000000000000..bfbd91b3093dd6b80ac3528c2f2acccab331e1ce Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/fig4.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/found.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/found.png new file mode 100644 index 0000000000000000000000000000000000000000..39df31354d8912ad2dfdb070041df24013e49860 Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/found.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/home_normal.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/home_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..1b893d3c368185078120a56cf72d5b45770a54ec Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/home_normal.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/home_selected.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/home_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..3cd3f1bb2024003b06ef718bb81745d432c3ac92 Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/home_selected.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/icon.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/icon.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/login_method1.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/login_method1.png new file mode 100644 index 0000000000000000000000000000000000000000..a7b47f2ea5723f81684506765ed437d6684f8184 Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/login_method1.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/login_method2.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/login_method2.png new file mode 100644 index 0000000000000000000000000000000000000000..320e9a5038da6fb9bdc201ed7675d4d4ad1a0c99 Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/login_method2.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/login_method3.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/login_method3.png new file mode 100644 index 0000000000000000000000000000000000000000..28ac6ec8669b5634df443b10a4ced8f9c7e8a5c7 Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/login_method3.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/logo.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..1dcac2208bef8df6893357ec8d43fdd6ee6763f7 Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/logo.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/love.svg b/PageAndData04/04_Complete/entry/src/main/resources/base/media/love.svg new file mode 100644 index 0000000000000000000000000000000000000000..5c75b04648ae692256d879a7ed8b0e42b93936f8 --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/resources/base/media/love.svg @@ -0,0 +1,18 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/menu.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/menu.png new file mode 100644 index 0000000000000000000000000000000000000000..04b95f49b5328fefa63ecd0da9bc8ae2cb0e7ebd Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/menu.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/message.svg b/PageAndData04/04_Complete/entry/src/main/resources/base/media/message.svg new file mode 100644 index 0000000000000000000000000000000000000000..c4c144958d1b109fa200514a4e0e46dc3367b630 --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/resources/base/media/message.svg @@ -0,0 +1,18 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/mine_normal.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/mine_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..d323b89cbd5a24d9c58cec73273919dc71bbd025 Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/mine_normal.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/mine_selected.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/mine_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..41183cf3790008974cb1d640683a68b6d03daa0f Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/mine_selected.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/new.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/new.png new file mode 100644 index 0000000000000000000000000000000000000000..a3e34211e891458be3afa0a901bccfa6f2371b22 Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/new.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/news.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/news.png new file mode 100644 index 0000000000000000000000000000000000000000..379f25a2fcb654ff84966e45f0892db30e6c46e1 Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/news.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/path.svg b/PageAndData04/04_Complete/entry/src/main/resources/base/media/path.svg new file mode 100644 index 0000000000000000000000000000000000000000..3ed90565ea331acc5ba33320257284977037e16d --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/resources/base/media/path.svg @@ -0,0 +1,7 @@ + + + Created with Pixso. + + + + diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/person_shield.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/person_shield.png new file mode 100644 index 0000000000000000000000000000000000000000..e50355ea8b34750f8f00b9f4cd124ea996a38742 Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/person_shield.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/privacy.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/privacy.png new file mode 100644 index 0000000000000000000000000000000000000000..bfe9f464f7fa185475b8f4d545d5c18f44583b71 Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/privacy.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/record.svg b/PageAndData04/04_Complete/entry/src/main/resources/base/media/record.svg new file mode 100644 index 0000000000000000000000000000000000000000..e0749d6a5c6be2603af7b760d29326f762ece934 --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/resources/base/media/record.svg @@ -0,0 +1,15 @@ + + + Created with Pixso. + + + + + + + + + + + + diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/recycle.svg b/PageAndData04/04_Complete/entry/src/main/resources/base/media/recycle.svg new file mode 100644 index 0000000000000000000000000000000000000000..d22b4dce6cec5c5353e6a974256f05a871133dfc --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/resources/base/media/recycle.svg @@ -0,0 +1,17 @@ + + + Created with Pixso. + + + + + + + + + + + + + + diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/reset.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/reset.png new file mode 100644 index 0000000000000000000000000000000000000000..d4645bdca4d56183f13d63a015a6537225bf2c6f Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/reset.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/right_grey.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/right_grey.png new file mode 100644 index 0000000000000000000000000000000000000000..ed1eed6403e44374cd3542d2631d2c1a83608d4f Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/right_grey.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/search.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/search.png new file mode 100644 index 0000000000000000000000000000000000000000..be40ad4eac19072978d49bc90d5b0c91ab2b6af3 Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/search.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/shopping.svg b/PageAndData04/04_Complete/entry/src/main/resources/base/media/shopping.svg new file mode 100644 index 0000000000000000000000000000000000000000..025437298c567eaf57abb0596c2076746944a6ec --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/resources/base/media/shopping.svg @@ -0,0 +1,15 @@ + + + Created with Pixso. + + + + + + + + + + + + diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/sift.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/sift.png new file mode 100644 index 0000000000000000000000000000000000000000..8bb376fac511a07d3ad9e85bde352a3d22d73e2f Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/sift.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/startIcon.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/startIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/startIcon.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/storage.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/storage.png new file mode 100644 index 0000000000000000000000000000000000000000..af5baac97a5949c836ff16f8a58a1d458341490e Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/storage.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/target.svg b/PageAndData04/04_Complete/entry/src/main/resources/base/media/target.svg new file mode 100644 index 0000000000000000000000000000000000000000..2a49f3ae2f1042b0bcca4a9c6a050690c5020ee8 --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/resources/base/media/target.svg @@ -0,0 +1,19 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + + diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/media/top.png b/PageAndData04/04_Complete/entry/src/main/resources/base/media/top.png new file mode 100644 index 0000000000000000000000000000000000000000..1ca23a5dbc1f769677b5602afc567184a4a24851 Binary files /dev/null and b/PageAndData04/04_Complete/entry/src/main/resources/base/media/top.png differ diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/profile/main_pages.json b/PageAndData04/04_Complete/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..85a3c19566d76790ce243e498c48f665ce4008e5 --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/LoginPage" + ] +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/resources/base/profile/route_map.json b/PageAndData04/04_Complete/entry/src/main/resources/base/profile/route_map.json new file mode 100644 index 0000000000000000000000000000000000000000..c2fa179d0fc3264ead4787e6dfee65314ae20ee1 --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/resources/base/profile/route_map.json @@ -0,0 +1,20 @@ +{ + "routerMap": [ + { + "name": "MainPage", + "pageSourceFile": "src/main/ets/pages/MainPage.ets", + "buildFunction": "MainPageBuilder", + "data": { + "description" : "this is MainPage" + } + }, + { + "name": "GoalPage", + "pageSourceFile": "src/main/ets/pages/GoalPage.ets", + "buildFunction": "GoalPageBuilder", + "data": { + "description" : "this is GoalPage" + } + } + ] +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/resources/en_US/element/string.json b/PageAndData04/04_Complete/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..19c9eb267c39b3760e03a9df37f45539a0b335f7 --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,332 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "PageAndData" + }, + { + "name": "login_page", + "value": "Login page" + }, + { + "name": "login_more", + "value": "Log in to your account to use more services" + }, + { + "name": "account", + "value": "Account" + }, + { + "name": "password", + "value": "Password" + }, + { + "name": "login", + "value": "Log in" + }, + { + "name": "register_account", + "value": "Registering an Account" + }, + { + "name": "forgot_password", + "value": "Forgot Password" + }, + { + "name": "message_login", + "value": "SMS verification code login" + }, + { + "name": "other_login_method", + "value": "Other login methods" + }, + { + "name": "vertical_line", + "value": " | " + }, + { + "name": "input_empty_tips", + "value": "The input cannot be empty." + }, + { + "name": "login_success", + "value": "The login is successful." + }, + { + "name": "my_love", + "value": "My favorite" + }, + { + "name": "history_record", + "value": "History" + }, + { + "name": "message", + "value": "Message" + }, + { + "name": "shopping_cart", + "value": "Shopping cart" + }, + { + "name": "my_goal", + "value": "My goal" + }, + { + "name": "group", + "value": "Group" + }, + { + "name": "favorites", + "value": "Favorites" + }, + { + "name": "recycle_bin", + "value": "Recycle Bin" + }, + { + "name": "rankings", + "value": "Rankings" + }, + { + "name": "new_product_debut", + "value": "New product debut" + }, + { + "name": "big_name_flash", + "value": "Big name flash" + }, + { + "name": "find_good", + "value": "Find good things" + }, + { + "name": "xiamen_station", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "more_big_names", + "value": "More Big Names" + }, + { + "name": "push_notifications", + "value": "Push Notifications" + }, + { + "name": "data_management", + "value": "Data Management" + }, + { + "name": "menu_settings", + "value": "Menu Settings" + }, + { + "name": "about", + "value": "About" + }, + { + "name": "clear_cache", + "value": "Clear Cache" + }, + { + "name": "mainPage_tabTitles_home", + "value": "Home" + }, + { + "name": "mainPage_tabTitles_mine", + "value": "Mine" + }, + { + "name": "mainPage_top", + "value": "Rankings" + }, + { + "name": "mainPage_text_top", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "mainPage_new", + "value": "New product debut" + }, + { + "name": "mainPage_text_new", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "mainPage_brand", + "value": "Big name flash" + }, + { + "name": "mainPage_text_brand", + "value": "More Big Names" + }, + { + "name": "mainPage_found", + "value": "Find good things" + }, + { + "name": "mainPage_text_found", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "setting_account_name", + "value": "Mr. Lee" + }, + { + "name": "setting_account_email", + "value": "2000000@test.cc" + }, + { + "name": "setting_list_news", + "value": "Push Notifications" + }, + { + "name": "setting_list_font", + "value": "Fontsize Change" + }, + { + "name": "setting_list_menu", + "value": "Menu Settings" + }, + { + "name": "setting_list_about", + "value": "About" + }, + { + "name": "setting_list_storage", + "value": "Clear Cache" + }, + { + "name": "setting_list_privacy", + "value": "Privacy Agreement" + }, + { + "name": "setting_button", + "value": "Logout" + }, + { + "name": "home_list", + "value": "List" + }, + { + "name": "setting_toggle", + "value": "switch" + }, + { + "name": "bind_title", + "value": "Exercise completion" + }, + { + "name": "fontsize_change", + "value": "FontSize change" + }, + { + "name": "Confirmed", + "value": "Confirmed" + }, + { + "name": "Cancel", + "value": "Cancel" + }, + { + "name": "sport_name", + "value": "Sport Name" + }, + { + "name": "Morning_jogging", + "value": "Morning jogging" + }, + { + "name": "Yoga", + "value": "Yoga" + }, + { + "name": "Swimming", + "value": "Swimming" + }, + { + "name": "Exercise_duration", + "value": "Exercise duration: (minutes)" + }, + { + "name": "Completion_Status", + "value": "Completion Status" + }, + { + "name": "Completed", + "value": "Completed" + }, + { + "name": "Uncompleted", + "value": "Uncompleted" + }, + { + "name": "submit", + "value": "Submit" + }, + { + "name": "enter_duration", + "value": "Please enter the exercise duration." + }, + { + "name": "My_plans", + "value": "My Plans" + }, + { + "name": "ALL", + "value": "All" + }, + { + "name": "delete_question", + "value": "Are you sure you want to delete the plan?" + }, + { + "name": "delete", + "value": "Delete" + }, + { + "name": "Add_Plans", + "value": "Add plan" + }, + { + "name": "status", + "value": "Status" + }, + { + "name": "Duration", + "value": "Duration" + }, + { + "name": "Tab_Bar_One", + "value": "Home Page" + }, + { + "name": "Tab_Bar_Two", + "value": "Mine" + }, + { + "name": "Network_Available", + "value": "Network Available" + }, + { + "name": "Network_Lost", + "value": "Network Lost" + }, + { + "name": "Network_Unavailable", + "value": "Network Unavailable" + }, + { + "name": "Login_Failed", + "value": "Failed to log in because the network is not connected." + } + ] +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/entry/src/main/resources/zh_CN/element/string.json b/PageAndData04/04_Complete/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..9942777e4c145acf474bfa05ae8a9c1c230b1333 --- /dev/null +++ b/PageAndData04/04_Complete/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,332 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "PageAndData" + }, + { + "name": "login_page", + "value": "登录界面" + }, + { + "name": "login_more", + "value": "登录账号以使用更多服务" + }, + { + "name": "account", + "value": "账号" + }, + { + "name": "password", + "value": "密码" + }, + { + "name": "login", + "value": "登录" + }, + { + "name": "register_account", + "value": "注册账号" + }, + { + "name": "forgot_password", + "value": "忘记密码" + }, + { + "name": "message_login", + "value": "短信验证码登录" + }, + { + "name": "other_login_method", + "value": "其他登录方式" + }, + { + "name": "vertical_line", + "value": " | " + }, + { + "name": "input_empty_tips", + "value": "输入不能为空" + }, + { + "name": "login_success", + "value": "登录成功" + }, + { + "name": "my_love", + "value": "我的最爱" + }, + { + "name": "history_record", + "value": "历史记录" + }, + { + "name": "message", + "value": "消息" + }, + { + "name": "shopping_cart", + "value": "购物车" + }, + { + "name": "my_goal", + "value": "我的目标" + }, + { + "name": "group", + "value": "圈子" + }, + { + "name": "favorites", + "value": "收藏" + }, + { + "name": "recycle_bin", + "value": "回收站" + }, + { + "name": "rankings", + "value": "排行榜" + }, + { + "name": "new_product_debut", + "value": "新品首发" + }, + { + "name": "big_name_flash", + "value": "大牌闪购" + }, + { + "name": "find_good", + "value": "发现好物" + }, + { + "name": "xiamen_station", + "value": "厦门站,我们不见不散" + }, + { + "name": "more_big_names", + "value": "更多大牌" + }, + { + "name": "push_notifications", + "value": "推送通知" + }, + { + "name": "data_management", + "value": "数据管理" + }, + { + "name": "menu_settings", + "value": "菜单设置" + }, + { + "name": "about", + "value": "关于" + }, + { + "name": "clear_cache", + "value": "清除缓存" + }, + { + "name": "mainPage_tabTitles_home", + "value": "首页" + }, + { + "name": "mainPage_tabTitles_mine", + "value": "我的" + }, + { + "name": "mainPage_top", + "value": "排行榜" + }, + { + "name": "mainPage_text_top", + "value": "厦门站,我们不见不散" + }, + { + "name": "mainPage_new", + "value": "新品首发" + }, + { + "name": "mainPage_text_new", + "value": "厦门站,我们不见不散" + }, + { + "name": "mainPage_brand", + "value": "大牌闪购" + }, + { + "name": "mainPage_text_brand", + "value": "更多大牌" + }, + { + "name": "mainPage_found", + "value": "发现好物" + }, + { + "name": "mainPage_text_found", + "value": "厦门站,我们不见不散" + }, + { + "name": "setting_account_name", + "value": "李先生" + }, + { + "name": "setting_account_email", + "value": "2000000@test.cc" + }, + { + "name": "setting_list_news", + "value": "推送通知" + }, + { + "name": "setting_list_font", + "value": "字体大小调节" + }, + { + "name": "setting_list_menu", + "value": "菜单设置" + }, + { + "name": "setting_list_about", + "value": "关于" + }, + { + "name": "setting_list_storage", + "value": "清除缓存" + }, + { + "name": "setting_list_privacy", + "value": "隐私协议" + }, + { + "name": "setting_button", + "value": "退出登录" + }, + { + "name": "home_list", + "value": "列表" + }, + { + "name": "setting_toggle", + "value": "开关" + }, + { + "name": "bind_title", + "value": "运动完成情况" + }, + { + "name": "fontsize_change", + "value": "字体大小调节" + }, + { + "name": "Confirmed", + "value": "确认" + }, + { + "name": "Cancel", + "value": "取消" + }, + { + "name": "sport_name", + "value": "运动名" + }, + { + "name": "Morning_jogging", + "value": "晨跑" + }, + { + "name": "Yoga", + "value": "瑜伽" + }, + { + "name": "Swimming", + "value": "游泳" + }, + { + "name": "Exercise_duration", + "value": "运动时长: (分钟)" + }, + { + "name": "Completion_Status", + "value": "完成状态" + }, + { + "name": "Completed", + "value": "已完成" + }, + { + "name": "Uncompleted", + "value": "未完成" + }, + { + "name": "submit", + "value": "提交" + }, + { + "name": "enter_duration", + "value": "请输入运动时长" + }, + { + "name": "My_plans", + "value": "我的计划" + }, + { + "name": "ALL", + "value": "任意" + }, + { + "name": "delete_question", + "value": "确定要删除该计划吗?" + }, + { + "name": "delete", + "value": "删除" + }, + { + "name": "Add_Plans", + "value": "新增计划" + }, + { + "name": "status", + "value": "状态" + }, + { + "name": "Duration", + "value": "时长" + }, + { + "name": "Tab_Bar_One", + "value": "首页" + }, + { + "name": "Tab_Bar_Two", + "value": "我的" + }, + { + "name": "Network_Available", + "value": "网络可用" + }, + { + "name": "Network_Lost", + "value": "网络丢失" + }, + { + "name": "Network_Unavailable", + "value": "网络不可用" + }, + { + "name": "Login_Failed", + "value": "网络未连接,无法登录" + } + ] +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/hvigor/hvigor-config.json5 b/PageAndData04/04_Complete/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..73bfab4e997c8d4aea53b22fdd7f10112b30987f --- /dev/null +++ b/PageAndData04/04_Complete/hvigor/hvigor-config.json5 @@ -0,0 +1,17 @@ +{ + "modelVersion": "5.0.0", + "dependencies": { + }, + "execution": { + // "daemon": true, /* Enable daemon compilation. Default: true */ + // "incremental": true, /* Enable incremental compilation. Default: true */ + // "parallel": true, /* Enable parallel compilation. Default: true */ + // "typeCheck": false, /* Enable typeCheck. Default: false */ + }, + "logging": { + // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */ + }, + "debugging": { + // "stacktrace": false /* Disable stacktrace compilation. Default: false */ + } +} \ No newline at end of file diff --git a/PageAndData04/04_Complete/hvigorfile.ts b/PageAndData04/04_Complete/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/PageAndData04/04_Complete/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/PageAndData04/04_Complete/oh-package.json5 b/PageAndData04/04_Complete/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ba334a33e0ef0989bb410985996742da64bceda1 --- /dev/null +++ b/PageAndData04/04_Complete/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "modelVersion": "5.0.0", + "license": "", + "devDependencies": { + }, + "author": "", + "name": "arktscomponents", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/AppScope/app.json5 b/PageAndData04/04_StartingPoint/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..45b006b30ea74629e4219a71a70b74840df4ba82 --- /dev/null +++ b/PageAndData04/04_StartingPoint/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.pageanddata", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/PageAndData04/04_StartingPoint/AppScope/resources/base/element/string.json b/PageAndData04/04_StartingPoint/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..594cc44fec10161d4efeae095baef27280a0c27f --- /dev/null +++ b/PageAndData04/04_StartingPoint/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "PageAndData" + } + ] +} diff --git a/PageAndData04/04_StartingPoint/AppScope/resources/base/media/app_icon.png b/PageAndData04/04_StartingPoint/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/PageAndData04/04_StartingPoint/AppScope/resources/base/media/app_icon.png differ diff --git a/PageAndData04/04_StartingPoint/LICENSE b/PageAndData04/04_StartingPoint/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..381eb507bc1eef9b5158e496dedab769e810b657 --- /dev/null +++ b/PageAndData04/04_StartingPoint/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2022 Huawei Device Co., Ltd. All rights reserved. + + 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. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/build-profile.json5 b/PageAndData04/04_StartingPoint/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..5ce78d4b70932305cc3f0b5ae6e9038c6fa9e57e --- /dev/null +++ b/PageAndData04/04_StartingPoint/build-profile.json5 @@ -0,0 +1,29 @@ +{ + "app": { + "signingConfigs": [ + + ], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "5.0.0(12)", + "runtimeOS": "HarmonyOS" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/entry/build-profile.json5 b/PageAndData04/04_StartingPoint/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..20c75049f2d45e57d267899b6547c79fb6aa84c1 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/build-profile.json5 @@ -0,0 +1,14 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + "runtimeOS": "HarmonyOS" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/entry/hvigorfile.ts b/PageAndData04/04_StartingPoint/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { hapTasks } from '@ohos/hvigor-ohos-plugin'; diff --git a/PageAndData04/04_StartingPoint/entry/oh-package.json5 b/PageAndData04/04_StartingPoint/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..19b9234a98d43a4711a0fc32cef604159228d3cd --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "license": "", + "devDependencies": {}, + "author": "", + "name": "entry", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/entry/src/main/ets/common/network/ConnectionUtils.ets b/PageAndData04/04_StartingPoint/entry/src/main/ets/common/network/ConnectionUtils.ets new file mode 100644 index 0000000000000000000000000000000000000000..e2ca4d96d32673d24b9815bf7bb316c5e3639895 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/ets/common/network/ConnectionUtils.ets @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2024 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 { connection } from '@kit.NetworkKit'; +import { BusinessError } from '@kit.BasicServicesKit'; +import { promptAction } from '@kit.ArkUI'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + +const TAG: string = 'ConnectionUtils'; + +/** + * The ConnectionUtils provides the network listening capability. + */ +export class ConnectionUtils { + netConnection = connection.createNetConnection(); + + /** + *The method of checking whether the monitoring network is connected.. + */ + async isNetworkConnected(): Promise { + let result: boolean = false; + await connection.getDefaultNet().then(async (data: connection.NetHandle) => { + if (data.netId === 0) { + hilog.info(0x0000, TAG, 'network error'); + return; + } + await connection.getNetCapabilities(data).then( + (data: connection.NetCapabilities) => { + let bearerTypes: Set = new Set(data.bearerTypes); + let bearerTypesNum = Array.from(bearerTypes.values()); + for (let item of bearerTypesNum) { + if (item === 0) { + result = true; + hilog.info(0x0000, TAG, 'BEARER_CELLULAR'); + } else if (item === 1) { + result = true; + hilog.info(0x0000, TAG, 'BEARER_WIFI'); + } else if (item === 3) { + result = true; + hilog.info(0x0000, TAG, 'BEARER_ETHERNET'); + } else { + return; + } + } + }) + }) + return result; + } + + /** + *The method of opening register. + */ + openRegister() { + this.netConnection.register((error: BusinessError) => { + hilog.info(0x0000, TAG, JSON.stringify(error)); + }); + } + + /** + *The method of listening to the network status. + */ + registerNetworkAvailableStatus() { + this.netConnection.on('netAvailable', () => { + promptAction.showToast({ + message: $r('app.string.Network_Available'), + duration: 2000 + }); + }); + + this.netConnection.on('netUnavailable', () => { + promptAction.showToast({ + message: $r('app.string.Network_Unavailable'), + duration: 2000 + }); + }); + + this.netConnection.on('netLost', () => { + promptAction.showToast({ + message: $r('app.string.Network_Lost'), + duration: 2000 + }); + }); + } + + /** + *The method of closing register. + */ + closeRegister() { + this.netConnection.unregister((error: BusinessError) => { + hilog.info(0x0000, TAG, JSON.stringify(error)); + }); + } +} + +export default new ConnectionUtils(); \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/entry/src/main/ets/common/network/HttpUtils.ets b/PageAndData04/04_StartingPoint/entry/src/main/ets/common/network/HttpUtils.ets new file mode 100644 index 0000000000000000000000000000000000000000..529388a5430075676c94ba4a9cc5b67feda528b4 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/ets/common/network/HttpUtils.ets @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2024 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 { http } from '@kit.NetworkKit'; +import { fileIo, fileUri } from '@kit.CoreFileKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import ResponseData from '../../viewmodel/ResponseData/ResponseData'; +import ListInfo from '../../viewmodel/ResponseData/ListInfo'; + +const TAG: string = 'HttpUtils'; +const IMAGE_URL: string = 'https://developer.huawei.com/system/modules/org.opencms.portal.template.core/' + + 'resources/harmony/img/jiantou_right.svg'; +const RESOURCE_URL: string = 'https://svc-drcn.developer.huawei.com/community/servlet/consumer' + + '/partnerActivityService/v1/developer/activity/terminalActivities/list'; + +/** + * The class of header. + */ +class Header { + contentType: string; + + constructor(contentType: string) { + this.contentType = contentType; + } +} + +/** + * The HttpUtils provides the capability of accessing the network through HTTP. + */ +export class HttpUtils { + httpRequest: http.HttpRequest; + + constructor() { + this.httpRequest = http.createHttp(); + } + + /** + * The method of initiating a GET request through HTTP. + */ + async getHttpRequest(cacheDir: string): Promise { + let responsePictureUri: string = ''; + await this.httpRequest.request(IMAGE_URL, { method: http.RequestMethod.GET }) + .then((data: http.HttpResponse) => { + let filePath = cacheDir + '/test.svg'; + let file = fileIo.openSync(filePath, fileIo.OpenMode.CREATE | fileIo.OpenMode.READ_WRITE); + responsePictureUri = fileUri.getUriFromPath(filePath); + fileIo.writeSync(file.fd, data.result as ArrayBuffer); + fileIo.closeSync(file.fd); + }) + return responsePictureUri; + } + + /** + * The method of initiating a POST request through HTTP. + */ + async postHttpRequest(): Promise { + let responseData: Array = []; + await this.httpRequest.request(RESOURCE_URL, + { + method: http.RequestMethod.POST, extraData: { + 'status': '1', + 'belong': '1', + 'language': 'cn', + 'needTop': 1, + 'displayChannel': [1, 3], + 'count': 4, + 'pagestart': 1, + 'type': '1,4,5,6' + }, + header: new Header('application/json;charset=UTF-8') + }).then((data: http.HttpResponse) => { + let result: ResponseData = JSON.parse(data.result as string); + responseData = result.value.list; + }).catch((err: Error) => { + hilog.info(0x0000, TAG, JSON.stringify(err)); + }); + return responseData; + } + + /** + * The method of destroying httpRequest. + */ + destroyHttpRequest() { + this.httpRequest.destroy(); + } +} \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/entry/src/main/ets/common/network/RCPUtils.ets b/PageAndData04/04_StartingPoint/entry/src/main/ets/common/network/RCPUtils.ets new file mode 100644 index 0000000000000000000000000000000000000000..066063d92508c5bbf262d8fb123a47fc9ba502a5 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/ets/common/network/RCPUtils.ets @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2024 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 { rcp } from '@kit.RemoteCommunicationKit'; +import { fileIo, fileUri } from '@kit.CoreFileKit'; +import { BusinessError } from '@kit.BasicServicesKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import ResponseData from '../../viewmodel/ResponseData/ResponseData'; +import ListInfo from '../../viewmodel/ResponseData/ListInfo'; + +const TAG: string = 'RCPUtils'; +const list_source: string = 'https://svc-drcn.developer.huawei.com/community/servlet/consumer/' + + 'partnerActivityService/v1/developer/activity/terminalActivities/list'; + +/** + * The RCPUtils provides the capability of accessing the network through RCP. + */ +export class RCPUtils { + rcpSession: rcp.Session; + + constructor() { + this.rcpSession = rcp.createSession(); + } + + /** + * The method of initiating a GET request through RCP. + */ + async getRCPRequest(cacheDir: string): Promise { + let responsePictureUri: string = ''; + await this.rcpSession.get('https://developer.huawei.com/system/modules/org.opencms.portal.template.core/' + + 'resources/harmony/img/jiantou_right.svg') + .then((response) => { + let filePath = cacheDir + '/test.svg'; + let file = fileIo.openSync(filePath, fileIo.OpenMode.CREATE | fileIo.OpenMode.READ_WRITE); + responsePictureUri = fileUri.getUriFromPath(filePath); + fileIo.writeSync(file.fd, response.body); + fileIo.closeSync(file.fd); + }).catch((err: BusinessError) => { + hilog.error(0x0000, TAG, `err: err code is ${err.code}, err message is ${JSON.stringify(err)}`); + }); + return responsePictureUri; + } + + + /** + * The method of initiating a POST request through RCP. + */ + async postRCPRequest(): Promise { + let responseData: Array = []; + let requestContent: rcp.RequestContent = { + 'status': '1', + 'belong': '1', + 'language': 'cn', + 'needTop': 1, + 'displayChannel': [1, 3], + 'count': 4, + 'pagestart': 1, + 'type': '1,4,5,6' + } + await this.rcpSession.post(list_source, requestContent).then((response) => { + let result: ResponseData = response.toJSON() as ResponseData; + responseData = result.value.list; + }).catch((err: BusinessError) => { + hilog.error(0x0000, TAG, `err: err code is ${err.code}, err message is ${JSON.stringify(err)}`); + }); + return responseData; + } + + /** + * The method of closing a RCP Session. + */ + destroySession() { + this.rcpSession.close(); + } +} \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/entry/src/main/ets/entryability/EntryAbility.ets b/PageAndData04/04_StartingPoint/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..4a69eff069010eb1fce2a8f550777f30832a0a87 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2024 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 { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { window } from '@kit.ArkUI'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import ConnectionUtils from '../common/network/ConnectionUtils'; + +/** + * Lift cycle management of Ability. + */ +export default class entryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + ConnectionUtils.openRegister(); + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); + } + + onDestroy(): void | Promise { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + windowStage.getMainWindow().then((data: window.Window) => { + // Window immersive. + data.setWindowLayoutFullScreen(true); + }); + windowStage.loadContent('pages/LoginPage', (err, data) => { + if (err.code) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + ConnectionUtils.registerNetworkAvailableStatus(); + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + ConnectionUtils.closeRegister(); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/entry/src/main/ets/pages/LoginPage.ets b/PageAndData04/04_StartingPoint/entry/src/main/ets/pages/LoginPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..e736b5a437164f41a5d0ca1a3979b89599cf93d4 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/ets/pages/LoginPage.ets @@ -0,0 +1,205 @@ +/* + * Copyright (c) 2024 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 { promptAction } from '@kit.ArkUI'; +import ConnectionUtils from '../common/network/ConnectionUtils'; +import { MainPage } from './MainPage'; + +@Extend(TextInput) +function inputStyle() { + .placeholderColor('#99182431') + .height('45vp') + .fontSize('18fp') + .backgroundColor('#F1F3F5') + .width('328vp') + .margin({ top: 12 }) +} + +@Extend(Line) +function lineStyle() { + .width('328vp') + .height('1vp') + .backgroundColor('#33182431') +} + +@Extend(Text) +function blueTextStyle() { + .fontColor('#007DFF') + .fontSize('14fp') + .fontWeight(FontWeight.Medium) +} + +/** + * Login page + */ +@Entry +@Component +struct LoginPage { + @State account: string = ''; + @State password: string = ''; + @State isShowProgress: boolean = false; + private timeOutId: number = -1; + pathStack: NavPathStack = new NavPathStack(); + + @Builder + imageButton(src: Resource) { + Button({ type: ButtonType.Circle, stateEffect: true }) { + Image(src) + } + .height('48vp') + .width('48vp') + .backgroundColor('#F1F3F5') + } + + login(result: boolean): void { + if (this.account === '' || this.password === '') { + promptAction.showToast({ + message: $r('app.string.input_empty_tips') + }); + } else { + this.isShowProgress = true; + if (this.timeOutId === -1) { + this.timeOutId = setTimeout(async () => { + this.isShowProgress = false; + this.timeOutId = -1; + + if (result) { + this.pathStack.pushPathByName('MainPage', null); + } else { + promptAction.showToast({ + message: $r('app.string.Network_Lost') + }); + } + }, 2000); + } + } + } + + aboutToDisappear() { + clearTimeout(this.timeOutId); + this.timeOutId = -1; + } + + build() { + Navigation(this.pathStack) { + Column() { + Image($r('app.media.logo')) + .width('78vp') + .height('78vp') + .margin({ + top: '150vp', + bottom: '8vp' + }) + Text($r('app.string.login_page')) + .fontSize('24fp') + .fontWeight(FontWeight.Medium) + .fontColor('#182431') + Text($r('app.string.login_more')) + .fontSize('16fp') + .fontColor('#99182431') + .margin({ + bottom: '30vp', + top: '8vp' + }) + + TextInput({ placeholder: $r('app.string.account') }) + .maxLength(11) + .type(InputType.Number) + .inputStyle() + .onChange((value: string) => { + this.account = value; + }) + Line() + .lineStyle() + + TextInput({ placeholder: $r('app.string.password') }) + .maxLength(8) + .type(InputType.Password) + .inputStyle() + .onChange((value: string) => { + this.password = value; + }) + Line() + .lineStyle() + + Row() { + Text($r('app.string.message_login')) + .blueTextStyle() + Text($r('app.string.forgot_password')) + .blueTextStyle() + } + .justifyContent(FlexAlign.SpaceBetween) + .width('328vp') + .margin({ top: '8vp' }) + + Button($r('app.string.login'), { type: ButtonType.Capsule }) + .width('328vp') + .height('40vp') + .fontSize('16fp') + .fontWeight(FontWeight.Medium) + .backgroundColor('#007DFF') + .margin({ + top: '48vp', + bottom: '12vp' + }) + .onClick(async () => { + await ConnectionUtils.isNetworkConnected().then((value) => { + this.login(value); + }) + }) + Text($r('app.string.register_account')) + .fontColor('#007DFF') + .fontSize('16fp') + .fontWeight(FontWeight.Medium) + + if (this.isShowProgress) { + LoadingProgress() + .color('#182431') + .width('30vp') + .height('30vp') + .margin({ top: '20vp' }) + } + + Blank() + Text($r('app.string.other_login_method')) + .fontColor('#838D97') + .fontSize('12fp') + .fontWeight(FontWeight.Medium) + .margin({ + top: '50vp', + bottom: '12vp' + }) + Row({ space: 44 }) { + this.imageButton($r('app.media.login_method1')) + this.imageButton($r('app.media.login_method2')) + this.imageButton($r('app.media.login_method3')) + } + .margin({ bottom: '16vp' }) + } + .height('100%') + .width('100%') + .padding({ + left: '12vp', + right: '12vp', + bottom: '24vp' + }) + } + .backgroundColor('#F1F3F5') + .width('100%') + .height('100%') + .hideTitleBar(true) + .hideToolBar(true) + } +} \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/entry/src/main/ets/pages/MainPage.ets b/PageAndData04/04_StartingPoint/entry/src/main/ets/pages/MainPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..c688847f94cfa20fbbb4e58a588962b6f5abc26f --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/ets/pages/MainPage.ets @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2024 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 Home from '../view/Home'; +import Setting from '../view/Setting'; + +@Builder +export function MainPageBuilder() { + MainPage() +} + +/** + * Main page + */ +@Component +export struct MainPage { + @State currentIndex: number = 0; + private tabsController: TabsController = new TabsController(); + + @Builder + tabBuilder(title: Resource, index: number, selectedImg: Resource) { + Column() { + SymbolGlyph(selectedImg) + .fontSize('24fp') + .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_OPACITY) + .symbolEffect(new BounceSymbolEffect(EffectScope.WHOLE, EffectDirection.UP), + this.currentIndex === index ? true : false) + .fontColor(this.currentIndex === index ? ['#0a59f7'] : ['#66000000']) + Text(title) + .margin({ top: '4vp' }) + .fontSize('10fp') + .fontWeight(500) + .fontColor(this.currentIndex === index ? '#0a59f7' : '#66000000') + } + .backgroundColor('#F1F3F5') + .justifyContent(FlexAlign.Center) + .height('56vp') + .width('100%') + .onClick(() => { + this.currentIndex = index; + this.tabsController.changeIndex(this.currentIndex); + }) + } + + build() { + NavDestination() { + Tabs({ + barPosition: BarPosition.End, + controller: this.tabsController + }) { + TabContent() { + Home() + } + .padding({ + left: '12vp', + right: '12vp' + }) + .backgroundColor('#F1F3F5') + .tabBar(this.tabBuilder($r('app.string.Tab_Bar_One'), 0, $r('sys.symbol.house_fill'))) + + TabContent() { + Setting() + } + .padding({ + left: '12vp', + right: '12vp' + }) + .backgroundColor('#F1F3F5') + .tabBar(this.tabBuilder($r('app.string.Tab_Bar_Two'), 1, $r('sys.symbol.person_crop_circle_fill_1'))) + } + .margin({ bottom: '64vp' }) + .width('100%') + .height('100%') + .barHeight('80vp') + .barMode(BarMode.Fixed) + .onChange((index: number) => { + this.currentIndex = index; + }) + } + .height('100%') + .hideTitleBar(true) + .backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/entry/src/main/ets/view/Home.ets b/PageAndData04/04_StartingPoint/entry/src/main/ets/view/Home.ets new file mode 100644 index 0000000000000000000000000000000000000000..f5fbc66cde44aa27a7264296a0cf63baad822fb3 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/ets/view/Home.ets @@ -0,0 +1,185 @@ +/* + * Copyright (c) 2024 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 { common } from '@kit.AbilityKit'; +import mainViewModel from '../viewmodel/MainViewModel'; +import ItemData from '../viewmodel/ItemData'; +import ListInfo from '../viewmodel/ResponseData/ListInfo'; +import { HttpUtils } from '../common/network/HttpUtils'; +import { RCPUtils } from '../common/network/RCPUtils'; + +/** + * Home tab content + */ +@Component +export default struct Home { + @State httpGridItems: Array = []; + @State pictureUri: string = ''; + private swiperController: SwiperController = new SwiperController(); + private context = getContext(this) as common.UIAbilityContext; + private applicationContext = this.context.getApplicationContext(); + private cacheDir = this.applicationContext.filesDir; + + async aboutToAppear(): Promise { + // let httpUtil: HttpUtils = new HttpUtils(); + // await httpUtil.postHttpRequest().then((value : Array)=>{ + // this.httpGridItems = value; + // }); + // await httpUtil.getHttpRequest(this.cacheDir).then((value: string) => { + // this.pictureUri = value; + // }); + // httpUtil.destroyHttpRequest(); + + let rcpUtil: RCPUtils = new RCPUtils(); + await rcpUtil.postRCPRequest().then((value: Array) => { + this.httpGridItems = value; + }); + await rcpUtil.getRCPRequest(this.cacheDir).then((value: string) => { + this.pictureUri = value; + }); + rcpUtil.destroySession(); + } + + build() { + Column() { + Text($r('app.string.mainPage_tabTitles_home')) + .width('100%') + .margin({ + top: '48vp', + bottom: '12vp' + }) + .fontWeight(700) + .fontSize('26fp') + + Scroll() { + Column() { + Swiper(this.swiperController) { + ForEach(mainViewModel.getSwiperImages(), (img: Resource) => { + Image(img) + .width('100%') + .borderRadius('16vp') + }, (img: Resource) => JSON.stringify(img.id)) + } + .autoPlay(true) + + Grid() { + ForEach(mainViewModel.getFirstGridData(), (item: ItemData) => { + GridItem() { + Column() { + Image(item.img) + .width('40vp') + .height('40vp') + Text(item.title) + .fontSize('12fp') + .margin({ top: '4vp' }) + } + } + }, (item: ItemData) => JSON.stringify(item)) + } + .backgroundImage($r('app.media.backgroundImage')) + .backgroundImageSize({ + width: '100%', + height: '156vp' + }) + .columnsTemplate('1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr') + .columnsGap('8vp') + .rowsGap('12vp') + .margin({ top: '12vp' }) + .padding({ + top: '12vp', + bottom: '12vp' + }) + .height('156vp') + .backgroundColor(Color.White) + .borderRadius('16vp') + + Text($r('app.string.home_list')) + .fontSize('18fp') + .fontWeight(700) + .width('100%') + .margin({ + top: '18vp', + bottom: '8vp' + }) + + List() { + ForEach(this.httpGridItems, (secondItem: ListInfo) => { + ListItem() { + Row() { + Image(secondItem.indexNavPic) + .width('130vp') + .height('80vp') + .objectFit(ImageFit.TOP_START) + .borderRadius('8vp') + .margin({ right: '12vp' }) + + Column() { + Text(secondItem.activityName) + .width('190vp') + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(1) + .fontSize('16fp') + .fontWeight(FontWeight.Medium) + Text(secondItem.theme) + .width('190vp') + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(2) + .margin({ top: '4vp' }) + .fontSize('12fp') + .fontColor('#99182431') + Row() { + Image(this.pictureUri) + .width('20vp') + .opacity(0.5) + } + .width('170vp') + .margin({ top: '10.5vp' }) + .justifyContent(FlexAlign.End) + .alignItems(VerticalAlign.Bottom) + } + .alignItems(HorizontalAlign.Start) + } + .width('100%') + .padding({ + left: '12vp', + right: '12vp', + top: '12vp', + bottom: '12vp' + }) + .justifyContent(FlexAlign.SpaceBetween) + } + .margin({ bottom: '8vp' }) + .borderRadius('16vp') + .backgroundColor('#ffffff') + .borderRadius($r('app.float.home_backgroundImage_borderRadius')) + .align(Alignment.TopStart) + .width('100%') + }, (secondItem: ListInfo) => JSON.stringify(secondItem)) + } + .scrollBar(BarState.Off) + .width('100%') + } + } + .height('660vp') + .align(Alignment.TopStart) + .scrollBar(BarState.Off) + } + .justifyContent(FlexAlign.Start) + .alignItems(HorizontalAlign.Start) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/entry/src/main/ets/view/Setting.ets b/PageAndData04/04_StartingPoint/entry/src/main/ets/view/Setting.ets new file mode 100644 index 0000000000000000000000000000000000000000..daa9c055cf34fb061ab108e7a673c6f49457eaf0 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/ets/view/Setting.ets @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2024 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 ItemData from '../viewmodel/ItemData'; +import mainViewModel from '../viewmodel/MainViewModel'; + +/** + * Setting tab content + */ +@Component +export default struct Setting { + @Builder + settingCell(item: ItemData) { + Row() { + Row({}) { + Image(item.img) + .height('22vp') + .margin({ + left: '16vp', + right: '12vp' + }) + Text(item.title) + .fontSize('16fp') + } + + if (item.others === undefined) { + Image($r('app.media.right_grey')) + .width('12vp') + .height('24vp') + } else { + Toggle({ type: ToggleType.Switch, isOn: false }) + } + } + .justifyContent(FlexAlign.SpaceBetween) + .width('100%') + .padding({ + left: '8vp', + right: '22vp' + }) + } + + build() { + Scroll() { + Column({ space: 12 }) { + Text($r('app.string.mainPage_tabTitles_mine')) + .width('100%') + .margin({ top: '48vp' }) + .fontWeight(700) + .fontSize('26fp') + + Row() { + Image($r('app.media.account')) + .width('48vp') + .height('48vp') + Column() { + Text($r('app.string.setting_account_name')) + .fontSize('20fp') + Text($r('app.string.setting_account_email')) + .fontSize('12fp') + .margin({ top: '4vp' }) + } + .alignItems(HorizontalAlign.Start) + .margin({ left: '12vp' }) + } + .alignItems(VerticalAlign.Center) + .width('100%') + + List({ space: 12 }) { + ForEach(mainViewModel.getSettingListData(), (item: ItemData[]) => { + ListItemGroup() { + ForEach(item, (cell: ItemData) => { + ListItem() { + this.settingCell(cell) + } + .height('48vp') + }) + } + .divider({ + strokeWidth: '1vp', + color: '#0d000000', + startMargin: '42vp', + endMargin: '24vp' + }) + .backgroundColor('#ffffff') + .borderRadius('16vp') + }, (item: ItemData) => JSON.stringify(item)) + } + .scrollBar(BarState.Off) + .width('100%') + .padding({ + top: '4vp', + bottom: '4vp' + }) + + Blank() + + Button($r('app.string.setting_button'), { type: ButtonType.Capsule }) + .width('90%') + .height('40vp') + .fontSize('16fp') + .fontColor('#FA2A2D') + .fontWeight(FontWeight.Medium) + .backgroundColor('#E5E8EA') + .margin({ bottom: '16vp' }) + } + .height('100%') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/entry/src/main/ets/view/test.ets b/PageAndData04/04_StartingPoint/entry/src/main/ets/view/test.ets new file mode 100644 index 0000000000000000000000000000000000000000..74041dada999c834c52b23f6b5e7c301f0e51ae7 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/ets/view/test.ets @@ -0,0 +1,182 @@ +/* + * Copyright (c) 2024 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 { common } from '@kit.AbilityKit'; +import mainViewModel from '../viewmodel/MainViewModel'; +import ItemData from '../viewmodel/ItemData'; +import ListInfo from '../viewmodel/ResponseData/ListInfo'; +import { HttpUtils } from '../common/network/HttpUtils'; +import { RCPUtils } from '../common/network/RCPUtils'; + +@Component +export default struct Home { + @State httpGridItems: Array = []; + @State pictureUri: string = ''; + private swiperController: SwiperController = new SwiperController(); + private context = getContext(this) as common.UIAbilityContext; + private applicationContext = this.context.getApplicationContext(); + private cacheDir = this.applicationContext.filesDir; + + async aboutToAppear(): Promise { + // let httpUtil: HttpUtils = new HttpUtils(); + // await httpUtil.postHttpRequest().then((value : Array)=>{ + // this.httpGridItems = value; + // }); + // await httpUtil.getHttpRequest(this.cacheDir).then((value: string) => { + // this.pictureUri = value; + // }); + // httpUtil.destroyHttpRequest(); + + let rcpUtil: RCPUtils = new RCPUtils(); + await rcpUtil.postRCPRequest().then((value: Array) => { + this.httpGridItems = value; + }); + await rcpUtil.getRCPRequest(this.cacheDir).then((value: string) => { + this.pictureUri = value; + }); + rcpUtil.destroySession(); + } + + build() { + Column() { + Text($r('app.string.mainPage_tabTitles_home')) + .width('100%') + .margin({ + top: '48vp', + bottom: '12vp' + }) + .fontWeight(700) + .fontSize('26fp') + + Scroll() { + Column() { + Swiper(this.swiperController) { + ForEach(mainViewModel.getSwiperImages(), (img: Resource) => { + Image(img) + .width('100%') + .borderRadius('16vp') + }, (img: Resource) => JSON.stringify(img.id)) + } + .autoPlay(true) + + Grid() { + ForEach(mainViewModel.getFirstGridData(), (item: ItemData) => { + GridItem() { + Column() { + Image(item.img) + .width('40vp') + .height('40vp') + Text(item.title) + .fontSize('12fp') + .margin({ top: '4vp' }) + } + } + }, (item: ItemData) => JSON.stringify(item)) + } + .backgroundImage($r('app.media.backgroundImage')) + .backgroundImageSize({ + width: '100%', + height: '156vp' + }) + .columnsTemplate('1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr') + .columnsGap('8vp') + .rowsGap('12vp') + .margin({ top: '12vp' }) + .padding({ + top: '12vp', + bottom: '12vp' + }) + .height('156vp') + .backgroundColor(Color.White) + .borderRadius('16vp') + + Text($r('app.string.home_list')) + .fontSize('18fp') + .fontWeight(700) + .width('100%') + .margin({ + top: '18vp', + bottom: '8vp' + }) + + List() { + ForEach(this.httpGridItems, (secondItem: ListInfo) => { + ListItem() { + Row() { + Image(secondItem.indexNavPic) + .width('130vp') + .height('80vp') + .objectFit(ImageFit.TOP_START) + .borderRadius('8vp') + .margin({ right: '12vp' }) + + Column() { + Text(secondItem.activityName) + .width('190vp') + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(1) + .fontSize('16fp') + .fontWeight(FontWeight.Medium) + Text(secondItem.theme) + .width('190vp') + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(2) + .margin({ top: '4vp' }) + .fontSize('12fp') + .fontColor('#99182431') + Row() { + Image(this.pictureUri) + .width('20vp') + .opacity(0.5) + } + .width('170vp') + .margin({ top: '10.5vp' }) + .justifyContent(FlexAlign.End) + .alignItems(VerticalAlign.Bottom) + } + .alignItems(HorizontalAlign.Start) + } + .width('100%') + .padding({ + left: '12vp', + right: '12vp', + top: '12vp', + bottom: '12vp' + }) + .justifyContent(FlexAlign.SpaceBetween) + } + .margin({ bottom: '8vp' }) + .borderRadius('16vp') + .backgroundColor('#ffffff') + .borderRadius($r('app.float.home_backgroundImage_borderRadius')) + .align(Alignment.TopStart) + .width('100%') + }, (secondItem: ListInfo) => JSON.stringify(secondItem)) + } + .scrollBar(BarState.Off) + .width('100%') + } + } + .height('660vp') + .align(Alignment.TopStart) + .scrollBar(BarState.Off) + } + .justifyContent(FlexAlign.Start) + .alignItems(HorizontalAlign.Start) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/entry/src/main/ets/viewmodel/HttpGridItem.ets b/PageAndData04/04_StartingPoint/entry/src/main/ets/viewmodel/HttpGridItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..745c9b1bfe301b16ec91d94ef465194dbed8fd34 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/ets/viewmodel/HttpGridItem.ets @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2024 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. + */ + +/** + * List item data entity. + */ +export default class HttpGridItem { + /** + * Text of list item. + */ + title: string; + /** + * Image of list item. + */ + img: string; + /** + * Other resource of list item. + */ + content: string; + + constructor(title: string, img: string, content: string) { + this.title = title; + this.img = img; + this.content = content; + } +} \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/entry/src/main/ets/viewmodel/ItemData.ets b/PageAndData04/04_StartingPoint/entry/src/main/ets/viewmodel/ItemData.ets new file mode 100644 index 0000000000000000000000000000000000000000..658e6b1dc9529e7612f8a5095b4695a2032ce8e2 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/ets/viewmodel/ItemData.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 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. + */ + +/** + * List item data entity. + */ +export default class PageResource { + /** + * ID of list item. + */ + id: number; + /** + * Text of list item. + */ + title: Resource; + /** + * Image of list item. + */ + img: Resource; + /** + * Other resource of list item. + */ + others?: Resource; + + constructor(id: number, title: Resource, img: Resource, others?: Resource) { + this.id = id; + this.title = title; + this.img = img; + this.others = others; + } +} \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/entry/src/main/ets/viewmodel/MainViewModel.ets b/PageAndData04/04_StartingPoint/entry/src/main/ets/viewmodel/MainViewModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..6fbca7d8221f48af2509bb40da08f564c8a9dd23 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/ets/viewmodel/MainViewModel.ets @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2024 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 ItemData from './ItemData'; + +/** + * Binds data to components and provides interfaces. + */ +export class MainViewModel { + /** + * Get swiper image data. + * + * @return {Array} swiperImages. + */ + getSwiperImages(): Array { + let swiperImages: Resource[] = [ + $r('app.media.fig1'), + $r('app.media.fig2'), + $r('app.media.fig3'), + $r('app.media.fig4') + ]; + return swiperImages; + } + + /** + * Get data of the first grid. + * + * @return {Array} firstGridData. + */ + getFirstGridData(): Array { + let firstGridData: ItemData[] = [ + new ItemData(0, $r('app.string.my_love'), $r('app.media.love')), + new ItemData(1, $r('app.string.history_record'), $r('app.media.record')), + new ItemData(2, $r('app.string.message'), $r('app.media.message')), + new ItemData(3, $r('app.string.shopping_cart'), $r('app.media.shopping')), + new ItemData(4, $r('app.string.my_goal'), $r('app.media.target')), + new ItemData(5, $r('app.string.group'), $r('app.media.circle')), + new ItemData(6, $r('app.string.favorites'), $r('app.media.favorite')), + new ItemData(7, $r('app.string.recycle_bin'), $r('app.media.recycle')) + ]; + return firstGridData; + } + + /** + * Get data of the setting list. + * + * @return {Array} settingListData. + */ + getSettingListData(): Array> { + let settingListData: ItemData[][] = [ + [ + new ItemData(0, $r('app.string.setting_list_news'), $r('app.media.news'), $r('app.string.setting_toggle')) + ], + [ + new ItemData(1, $r('app.string.setting_list_font'), $r('app.media.data')), + new ItemData(2, $r('app.string.setting_list_menu'), $r('app.media.menu')), + ], + [ + new ItemData(3, $r('app.string.clear_cache'), $r('app.media.storage')), + new ItemData(4, $r('app.string.setting_list_privacy'), $r('app.media.person_shield')), + ], + [ + new ItemData(5, $r('app.string.setting_list_about'), $r('app.media.about')) + ] + ]; + return settingListData; + } +} + +export default new MainViewModel(); \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/entry/src/main/ets/viewmodel/ResponseData/ListInfo.ets b/PageAndData04/04_StartingPoint/entry/src/main/ets/viewmodel/ResponseData/ListInfo.ets new file mode 100644 index 0000000000000000000000000000000000000000..569823b4da1588d054bc1368d400ab20ab660c62 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/ets/viewmodel/ResponseData/ListInfo.ets @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2024 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 class ListInfo { + public activityName: string; + public theme: string; + public indexNavPic: string; + + constructor(activityName: string, theme: string, indexNavPic: string) { + this.activityName = activityName; + this.theme = theme; + this.indexNavPic = indexNavPic; + } +} \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/entry/src/main/ets/viewmodel/ResponseData/ResponseData.ets b/PageAndData04/04_StartingPoint/entry/src/main/ets/viewmodel/ResponseData/ResponseData.ets new file mode 100644 index 0000000000000000000000000000000000000000..5f27bfc990dc43f9d778d70191fa5a12df3532b9 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/ets/viewmodel/ResponseData/ResponseData.ets @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2024 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 Value from './Value'; + +export default class ResponseData { + public code: string; + public value: Value; + + constructor(code: string, value: Value) { + this.code = code; + this.value = value; + } +} \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/entry/src/main/ets/viewmodel/ResponseData/Value.ets b/PageAndData04/04_StartingPoint/entry/src/main/ets/viewmodel/ResponseData/Value.ets new file mode 100644 index 0000000000000000000000000000000000000000..8af68edb0f61f7114ede333ea603a2d9505b1895 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/ets/viewmodel/ResponseData/Value.ets @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2024 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 ListInfo from './ListInfo'; + +export default class Value { + public list: Array; + + constructor(list: Array) { + this.list = list; + } +} \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/entry/src/main/module.json5 b/PageAndData04/04_StartingPoint/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ccfb83c424f5a6d145e085ac2e658114f7ec522b --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/module.json5 @@ -0,0 +1,59 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone" + ], + "routerMap": "$profile:route_map", + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ets", + "description": "$string:EntryAbility_desc", + "icon": "$media:startIcon", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ], + "requestPermissions": [ + { + "name": "ohos.permission.INTERNET", + "reason": "$string:Internet", + "usedScene": { + "abilities": [ + "EntryAbility" + ], + "when": "inuse" + } + }, + { + "name": "ohos.permission.GET_NETWORK_INFO", + "reason": "$string:network_info", + "usedScene": { + "abilities": [ + "EntryAbility" + ], + "when": "inuse" + } + } + ] + } +} \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/element/color.json b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..2b713164d8fd7c5053a1af4809507f13410e05a6 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/element/color.json @@ -0,0 +1,80 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "white", + "value": "#FFFFFF" + }, + { + "name": "background", + "value": "#F1F3F5" + }, + { + "name": "title_text_color", + "value": "#182431" + }, + { + "name": "login_more_text_color", + "value": "#99182431" + }, + { + "name": "placeholder_color", + "value": "#99182431" + }, + { + "name": "line_color", + "value": "#33182431" + }, + { + "name": "login_button_color", + "value": "#007DFF" + }, + { + "name": "login_blue_text_color", + "value": "#007DFF" + }, + { + "name": "other_login_text_color", + "value": "#838D97" + }, + { + "name": "loading_color", + "value": "#182431" + }, + { + "name": "mainPage_selected", + "value": "#1698CE" + }, + { + "name": "mainPage_normal", + "value": "#6B6B6B" + }, + { + "name": "mainPage_backgroundColor", + "value": "#F1F3F5" + }, + { + "name": "home_grid_fontColor", + "value": "#99182431" + }, + { + "name": "setting_button_backgroundColor", + "value": "#E5E8EA" + }, + { + "name": "setting_button_fontColor", + "value": "#FA2A2D" + }, + { + "name": "grid_linear_start", + "value": "#1a0a5918" + }, + { + "name": "grid_linear_end", + "value": "#ffffff" + } + ] +} \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/element/float.json b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..19ba0e188d1786b004c41f6ee067844629fe3502 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/element/float.json @@ -0,0 +1,292 @@ +{ + "float": [ + { + "name": "logo_image_size", + "value": "78vp" + }, + { + "name": "logo_margin_top", + "value": "100vp" + }, + { + "name": "logo_margin_bottom", + "value": "8vp" + }, + { + "name": "page_title_text_size", + "value": "24fp" + }, + { + "name": "normal_text_size", + "value": "16fp" + }, + { + "name": "big_text_size", + "value": "18fp" + }, + { + "name": "small_text_size", + "value": "14fp" + }, + { + "name": "little_text_size", + "value": "12fp" + }, + { + "name": "login_more_margin_bottom", + "value": "30vp" + }, + { + "name": "login_more_margin_top", + "value": "8vp" + }, + { + "name": "login_input_height", + "value": "45vp" + }, + { + "name": "forgot_margin_top", + "value": "8vp" + }, + { + "name": "input_margin_top", + "value": "12vp" + }, + { + "name": "line_height", + "value": "1vp" + }, + { + "name": "login_button_height", + "value": "40vp" + }, + { + "name": "login_button_margin_top", + "value": "87vp" + }, + { + "name": "login_button_margin_bottom", + "value": "12vp" + }, + { + "name": "vertical_line_margin", + "value": "15vp" + }, + { + "name": "login_progress_size", + "value": "30vp" + }, + { + "name": "login_progress_margin_top", + "value": "20vp" + }, + { + "name": "other_login_margin_top", + "value": "50vp" + }, + { + "name": "other_login_margin_bottom", + "value": "12vp" + }, + { + "name": "login_page_padding_bottom", + "value": "24vp" + }, + { + "name": "other_login_image_size", + "value": "48vp" + }, + { + "name": "page_padding_hor", + "value": "12vp" + }, + { + "name": "mainPage_baseTab_top", + "value": "4vp" + }, + { + "name": "mainPage_baseTab_margin", + "value": "8vp" + }, + { + "name": "mainPage_padding", + "value": "12vp" + }, + { + "name": "mainPage_barHeight", + "value": "56vp" + }, + { + "name": "mainPage_baseTab_size", + "value": "25vp" + }, + { + "name": "main_tab_fontSize", + "value": "10fp" + }, + { + "name": "mainPage_tabTitles_margin", + "value": "12vp" + }, + { + "name": "mainPage_tabTitles_padding", + "value": "12vp" + }, + { + "name": "home_swiper_borderRadius", + "value": "16vp" + }, + { + "name": "home_swiper_margin", + "value": "24vp" + }, + { + "name": "home_grid_columnsGap", + "value": "8vp" + }, + { + "name": "home_grid_rowGap", + "value": "12vp" + }, + { + "name": "home_grid_padding", + "value": "12vp" + }, + { + "name": "home_grid_height", + "value": "124vp" + }, + { + "name": "home_grid_margin", + "value": "10vp" + }, + { + "name": "home_list_margin", + "value": "4vp" + }, + { + "name": "home_list_padding", + "value": "8vp" + }, + { + "name": "home_grid_borderRadius", + "value": "24vp" + }, + { + "name": "home_text_margin", + "value": "12vp" + }, + { + "name": "home_backgroundImage_borderRadius", + "value": "12vp" + }, + { + "name": "home_secondGrid_height", + "value": "260vp" + }, + { + "name": "home_secondGrid_margin", + "value": "10vp" + }, + { + "name": "home_homeCell_size", + "value": "24vp" + }, + { + "name": "home_homeCell_margin", + "value": "4vp" + }, + { + "name": "home_homeCell_width", + "value": "80vp" + }, + { + "name": "home_homeCell_height", + "value": "80vp" + }, + { + "name": "setting_name_margin", + "value": "4vp" + }, + { + "name": "setting_account_margin", + "value": "24vp" + }, + { + "name": "setting_account_size", + "value": "48vp" + }, + { + "name": "setting_account_fontSize", + "value": "20fp" + }, + { + "name": "setting_account_text_height", + "value": "28vp" + }, + { + "name": "setting_account_height", + "value": "96vp" + }, + { + "name": "setting_account_padding", + "value": "24vp" + }, + { + "name": "setting_account_borderRadius", + "value": "16vp" + }, + { + "name": "setting_list_height", + "value": "48vp" + }, + { + "name": "setting_list_padding", + "value": "4vp" + }, + { + "name": "setting_list_borderRadius", + "value": "16vp" + }, + { + "name": "setting_list_startMargin", + "value": "42vp" + }, + { + "name": "setting_list_endMargin", + "value": "24vp" + }, + { + "name": "setting_list_strokeWidth", + "value": "0.25vp" + }, + { + "name": "setting_button_bottom", + "value": "55vp" + }, + { + "name": "setting_size", + "value": "22vp" + }, + { + "name": "setting_padding", + "value": "10vp" + }, + { + "name": "setting_jump_width", + "value": "12vp" + }, + { + "name": "setting_jump_height", + "value": "24vp" + }, + { + "name": "setting_settingCell_left", + "value": "8vp" + }, + { + "name": "setting_settingCell_right", + "value": "22vp" + } + ] +} \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/element/string.json b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..5392b0095aa9dae9758275bdd855ba48b8ae3a29 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/element/string.json @@ -0,0 +1,340 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "PageAndData" + }, + { + "name": "login_page", + "value": "Login page" + }, + { + "name": "login_more", + "value": "Log in to your account to use more services" + }, + { + "name": "account", + "value": "Account" + }, + { + "name": "password", + "value": "Password" + }, + { + "name": "login", + "value": "Log in" + }, + { + "name": "register_account", + "value": "Registering an Account" + }, + { + "name": "forgot_password", + "value": "Forgot Password" + }, + { + "name": "message_login", + "value": "SMS verification code login" + }, + { + "name": "other_login_method", + "value": "Other login methods" + }, + { + "name": "vertical_line", + "value": " | " + }, + { + "name": "input_empty_tips", + "value": "The input cannot be empty." + }, + { + "name": "login_success", + "value": "The login is successful." + }, + { + "name": "my_love", + "value": "My favorite" + }, + { + "name": "history_record", + "value": "History" + }, + { + "name": "message", + "value": "Message" + }, + { + "name": "shopping_cart", + "value": "Shopping cart" + }, + { + "name": "my_goal", + "value": "My goal" + }, + { + "name": "group", + "value": "Group" + }, + { + "name": "favorites", + "value": "Favorites" + }, + { + "name": "recycle_bin", + "value": "Recycle Bin" + }, + { + "name": "rankings", + "value": "Rankings" + }, + { + "name": "new_product_debut", + "value": "New product debut" + }, + { + "name": "big_name_flash", + "value": "Big name flash" + }, + { + "name": "find_good", + "value": "Find good things" + }, + { + "name": "xiamen_station", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "more_big_names", + "value": "More Big Names" + }, + { + "name": "push_notifications", + "value": "Push Notifications" + }, + { + "name": "data_management", + "value": "Data Management" + }, + { + "name": "menu_settings", + "value": "Menu Settings" + }, + { + "name": "about", + "value": "About" + }, + { + "name": "clear_cache", + "value": "Clear Cache" + }, + { + "name": "mainPage_tabTitles_home", + "value": "Home" + }, + { + "name": "mainPage_tabTitles_mine", + "value": "Mine" + }, + { + "name": "mainPage_top", + "value": "Rankings" + }, + { + "name": "mainPage_text_top", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "mainPage_new", + "value": "New product debut" + }, + { + "name": "mainPage_text_new", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "mainPage_brand", + "value": "Big name flash" + }, + { + "name": "mainPage_text_brand", + "value": "More Big Names" + }, + { + "name": "mainPage_found", + "value": "Find good things" + }, + { + "name": "mainPage_text_found", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "setting_account_name", + "value": "Mr. Lee" + }, + { + "name": "setting_account_email", + "value": "2000000@test.cc" + }, + { + "name": "setting_list_news", + "value": "Push Notifications" + }, + { + "name": "setting_list_font", + "value": "Fontsize Change" + }, + { + "name": "setting_list_menu", + "value": "Menu Settings" + }, + { + "name": "setting_list_about", + "value": "About" + }, + { + "name": "setting_list_storage", + "value": "Clear Cache" + }, + { + "name": "setting_list_privacy", + "value": "Privacy Agreement" + }, + { + "name": "setting_button", + "value": "Logout" + }, + { + "name": "home_list", + "value": "List" + }, + { + "name": "setting_toggle", + "value": "switch" + }, + { + "name": "bind_title", + "value": "Exercise completion" + }, + { + "name": "fontsize_change", + "value": "FontSize change" + }, + { + "name": "Confirmed", + "value": "Confirmed" + }, + { + "name": "Cancel", + "value": "Cancel" + }, + { + "name": "sport_name", + "value": "Sport Name" + }, + { + "name": "Morning_jogging", + "value": "Morning jogging" + }, + { + "name": "Yoga", + "value": "Yoga" + }, + { + "name": "Swimming", + "value": "Swimming" + }, + { + "name": "Exercise_duration", + "value": "Exercise duration: (minutes)" + }, + { + "name": "Completion_Status", + "value": "Completion Status" + }, + { + "name": "Completed", + "value": "Completed" + }, + { + "name": "Uncompleted", + "value": "Uncompleted" + }, + { + "name": "submit", + "value": "Submit" + }, + { + "name": "enter_duration", + "value": "Please enter the exercise duration." + }, + { + "name": "My_plans", + "value": "My Plans" + }, + { + "name": "ALL", + "value": "All" + }, + { + "name": "delete_question", + "value": "Are you sure you want to delete the plan?" + }, + { + "name": "delete", + "value": "Delete" + }, + { + "name": "Add_Plans", + "value": "Add plan" + }, + { + "name": "status", + "value": "Status" + }, + { + "name": "Duration", + "value": "Duration" + }, + { + "name": "Tab_Bar_One", + "value": "Home Page" + }, + { + "name": "Tab_Bar_Two", + "value": "Mine" + }, + { + "name": "Network_Available", + "value": "Network Available" + }, + { + "name": "Network_Lost", + "value": "Network Lost" + }, + { + "name": "Network_Unavailable", + "value": "Network Unavailable" + }, + { + "name": "Login_Failed", + "value": "Failed to log in because the network is not connected." + }, + { + "name": "Internet", + "value": "Internet Permission Request" + }, + { + "name": "network_info", + "value": "NetWork Info Permission Request" + } + ] +} \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/about.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/about.png new file mode 100644 index 0000000000000000000000000000000000000000..6896495ca95dd5eb4507c1f70f2f1a24ede868db Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/about.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/account.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/account.png new file mode 100644 index 0000000000000000000000000000000000000000..12f8fe56f8faa51ab5d61ee40f38cae3a79135df Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/account.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/arrow.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..87bd1f3a6eb2e77b58c40aabca5f7ce6b1f158e5 Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/arrow.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/backgroundImage.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/backgroundImage.png new file mode 100644 index 0000000000000000000000000000000000000000..86e8d90778d319f4fa50f21b6ed7f173a89995b2 Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/backgroundImage.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/brand.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/brand.png new file mode 100644 index 0000000000000000000000000000000000000000..657be8334a8a445f21d9b74ed4cb6627dc13d127 Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/brand.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/circle.svg b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/circle.svg new file mode 100644 index 0000000000000000000000000000000000000000..f6fa05cf1550e22111cc0b64007727276bb3aa66 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/circle.svg @@ -0,0 +1,18 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/data.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/data.png new file mode 100644 index 0000000000000000000000000000000000000000..101db234f4b25f8997d0d3881ddd79b68599dc8b Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/data.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/delete.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/delete.png new file mode 100644 index 0000000000000000000000000000000000000000..fd17d4dbadfe66884774d8ed779e8cec48f79896 Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/delete.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/discover_normal.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/discover_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..24a53012eacc0b6974d9eafef8eaac364a52fbbd Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/discover_normal.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/discover_selected.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/discover_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..db4bbaacdbb9c59915f4886ef6da79ec62fdd897 Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/discover_selected.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/edit.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/edit.png new file mode 100644 index 0000000000000000000000000000000000000000..6ff921b308877a85886ee1c24a4661a5d5f6df66 Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/edit.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/favorite.svg b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/favorite.svg new file mode 100644 index 0000000000000000000000000000000000000000..06d2bed182b8d3846faee9305bf2532ad96b2b33 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/favorite.svg @@ -0,0 +1,15 @@ + + + Created with Pixso. + + + + + + + + + + + + diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/fig1.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/fig1.png new file mode 100644 index 0000000000000000000000000000000000000000..3f1e081539375a4fb4ac142ab7061287af80a12d Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/fig1.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/fig2.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/fig2.png new file mode 100644 index 0000000000000000000000000000000000000000..5e307d53994dafc85984518b5513f80d864b8815 Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/fig2.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/fig3.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/fig3.png new file mode 100644 index 0000000000000000000000000000000000000000..e47660fee043619b24d38aaf61897f7282454109 Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/fig3.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/fig4.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/fig4.png new file mode 100644 index 0000000000000000000000000000000000000000..bfbd91b3093dd6b80ac3528c2f2acccab331e1ce Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/fig4.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/found.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/found.png new file mode 100644 index 0000000000000000000000000000000000000000..39df31354d8912ad2dfdb070041df24013e49860 Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/found.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/home_normal.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/home_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..1b893d3c368185078120a56cf72d5b45770a54ec Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/home_normal.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/home_selected.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/home_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..3cd3f1bb2024003b06ef718bb81745d432c3ac92 Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/home_selected.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/icon.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/icon.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/login_method1.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/login_method1.png new file mode 100644 index 0000000000000000000000000000000000000000..a7b47f2ea5723f81684506765ed437d6684f8184 Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/login_method1.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/login_method2.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/login_method2.png new file mode 100644 index 0000000000000000000000000000000000000000..320e9a5038da6fb9bdc201ed7675d4d4ad1a0c99 Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/login_method2.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/login_method3.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/login_method3.png new file mode 100644 index 0000000000000000000000000000000000000000..28ac6ec8669b5634df443b10a4ced8f9c7e8a5c7 Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/login_method3.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/logo.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..1dcac2208bef8df6893357ec8d43fdd6ee6763f7 Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/logo.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/love.svg b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/love.svg new file mode 100644 index 0000000000000000000000000000000000000000..5c75b04648ae692256d879a7ed8b0e42b93936f8 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/love.svg @@ -0,0 +1,18 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/menu.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/menu.png new file mode 100644 index 0000000000000000000000000000000000000000..04b95f49b5328fefa63ecd0da9bc8ae2cb0e7ebd Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/menu.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/message.svg b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/message.svg new file mode 100644 index 0000000000000000000000000000000000000000..c4c144958d1b109fa200514a4e0e46dc3367b630 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/message.svg @@ -0,0 +1,18 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/mine_normal.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/mine_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..d323b89cbd5a24d9c58cec73273919dc71bbd025 Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/mine_normal.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/mine_selected.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/mine_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..41183cf3790008974cb1d640683a68b6d03daa0f Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/mine_selected.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/new.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/new.png new file mode 100644 index 0000000000000000000000000000000000000000..a3e34211e891458be3afa0a901bccfa6f2371b22 Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/new.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/news.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/news.png new file mode 100644 index 0000000000000000000000000000000000000000..379f25a2fcb654ff84966e45f0892db30e6c46e1 Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/news.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/path.svg b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/path.svg new file mode 100644 index 0000000000000000000000000000000000000000..3ed90565ea331acc5ba33320257284977037e16d --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/path.svg @@ -0,0 +1,7 @@ + + + Created with Pixso. + + + + diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/person_shield.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/person_shield.png new file mode 100644 index 0000000000000000000000000000000000000000..e50355ea8b34750f8f00b9f4cd124ea996a38742 Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/person_shield.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/privacy.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/privacy.png new file mode 100644 index 0000000000000000000000000000000000000000..bfe9f464f7fa185475b8f4d545d5c18f44583b71 Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/privacy.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/record.svg b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/record.svg new file mode 100644 index 0000000000000000000000000000000000000000..e0749d6a5c6be2603af7b760d29326f762ece934 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/record.svg @@ -0,0 +1,15 @@ + + + Created with Pixso. + + + + + + + + + + + + diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/recycle.svg b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/recycle.svg new file mode 100644 index 0000000000000000000000000000000000000000..d22b4dce6cec5c5353e6a974256f05a871133dfc --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/recycle.svg @@ -0,0 +1,17 @@ + + + Created with Pixso. + + + + + + + + + + + + + + diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/reset.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/reset.png new file mode 100644 index 0000000000000000000000000000000000000000..d4645bdca4d56183f13d63a015a6537225bf2c6f Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/reset.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/right_grey.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/right_grey.png new file mode 100644 index 0000000000000000000000000000000000000000..ed1eed6403e44374cd3542d2631d2c1a83608d4f Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/right_grey.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/search.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/search.png new file mode 100644 index 0000000000000000000000000000000000000000..be40ad4eac19072978d49bc90d5b0c91ab2b6af3 Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/search.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/shopping.svg b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/shopping.svg new file mode 100644 index 0000000000000000000000000000000000000000..025437298c567eaf57abb0596c2076746944a6ec --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/shopping.svg @@ -0,0 +1,15 @@ + + + Created with Pixso. + + + + + + + + + + + + diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/sift.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/sift.png new file mode 100644 index 0000000000000000000000000000000000000000..8bb376fac511a07d3ad9e85bde352a3d22d73e2f Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/sift.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/startIcon.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/startIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/startIcon.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/storage.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/storage.png new file mode 100644 index 0000000000000000000000000000000000000000..af5baac97a5949c836ff16f8a58a1d458341490e Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/storage.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/target.svg b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/target.svg new file mode 100644 index 0000000000000000000000000000000000000000..2a49f3ae2f1042b0bcca4a9c6a050690c5020ee8 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/target.svg @@ -0,0 +1,19 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + + diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/top.png b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/top.png new file mode 100644 index 0000000000000000000000000000000000000000..1ca23a5dbc1f769677b5602afc567184a4a24851 Binary files /dev/null and b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/media/top.png differ diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/profile/main_pages.json b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..85a3c19566d76790ce243e498c48f665ce4008e5 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/LoginPage" + ] +} \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/base/profile/route_map.json b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/profile/route_map.json new file mode 100644 index 0000000000000000000000000000000000000000..e1b4bcba03bf1f24e370245ff1db2b44c5ba935f --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/resources/base/profile/route_map.json @@ -0,0 +1,12 @@ +{ + "routerMap": [ + { + "name": "MainPage", + "pageSourceFile": "src/main/ets/pages/MainPage.ets", + "buildFunction": "MainPageBuilder", + "data": { + "description" : "this is mainPage" + } + } + ] +} \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/en_US/element/string.json b/PageAndData04/04_StartingPoint/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..19c9eb267c39b3760e03a9df37f45539a0b335f7 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,332 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "PageAndData" + }, + { + "name": "login_page", + "value": "Login page" + }, + { + "name": "login_more", + "value": "Log in to your account to use more services" + }, + { + "name": "account", + "value": "Account" + }, + { + "name": "password", + "value": "Password" + }, + { + "name": "login", + "value": "Log in" + }, + { + "name": "register_account", + "value": "Registering an Account" + }, + { + "name": "forgot_password", + "value": "Forgot Password" + }, + { + "name": "message_login", + "value": "SMS verification code login" + }, + { + "name": "other_login_method", + "value": "Other login methods" + }, + { + "name": "vertical_line", + "value": " | " + }, + { + "name": "input_empty_tips", + "value": "The input cannot be empty." + }, + { + "name": "login_success", + "value": "The login is successful." + }, + { + "name": "my_love", + "value": "My favorite" + }, + { + "name": "history_record", + "value": "History" + }, + { + "name": "message", + "value": "Message" + }, + { + "name": "shopping_cart", + "value": "Shopping cart" + }, + { + "name": "my_goal", + "value": "My goal" + }, + { + "name": "group", + "value": "Group" + }, + { + "name": "favorites", + "value": "Favorites" + }, + { + "name": "recycle_bin", + "value": "Recycle Bin" + }, + { + "name": "rankings", + "value": "Rankings" + }, + { + "name": "new_product_debut", + "value": "New product debut" + }, + { + "name": "big_name_flash", + "value": "Big name flash" + }, + { + "name": "find_good", + "value": "Find good things" + }, + { + "name": "xiamen_station", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "more_big_names", + "value": "More Big Names" + }, + { + "name": "push_notifications", + "value": "Push Notifications" + }, + { + "name": "data_management", + "value": "Data Management" + }, + { + "name": "menu_settings", + "value": "Menu Settings" + }, + { + "name": "about", + "value": "About" + }, + { + "name": "clear_cache", + "value": "Clear Cache" + }, + { + "name": "mainPage_tabTitles_home", + "value": "Home" + }, + { + "name": "mainPage_tabTitles_mine", + "value": "Mine" + }, + { + "name": "mainPage_top", + "value": "Rankings" + }, + { + "name": "mainPage_text_top", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "mainPage_new", + "value": "New product debut" + }, + { + "name": "mainPage_text_new", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "mainPage_brand", + "value": "Big name flash" + }, + { + "name": "mainPage_text_brand", + "value": "More Big Names" + }, + { + "name": "mainPage_found", + "value": "Find good things" + }, + { + "name": "mainPage_text_found", + "value": "Xiamen Station, we'll see you." + }, + { + "name": "setting_account_name", + "value": "Mr. Lee" + }, + { + "name": "setting_account_email", + "value": "2000000@test.cc" + }, + { + "name": "setting_list_news", + "value": "Push Notifications" + }, + { + "name": "setting_list_font", + "value": "Fontsize Change" + }, + { + "name": "setting_list_menu", + "value": "Menu Settings" + }, + { + "name": "setting_list_about", + "value": "About" + }, + { + "name": "setting_list_storage", + "value": "Clear Cache" + }, + { + "name": "setting_list_privacy", + "value": "Privacy Agreement" + }, + { + "name": "setting_button", + "value": "Logout" + }, + { + "name": "home_list", + "value": "List" + }, + { + "name": "setting_toggle", + "value": "switch" + }, + { + "name": "bind_title", + "value": "Exercise completion" + }, + { + "name": "fontsize_change", + "value": "FontSize change" + }, + { + "name": "Confirmed", + "value": "Confirmed" + }, + { + "name": "Cancel", + "value": "Cancel" + }, + { + "name": "sport_name", + "value": "Sport Name" + }, + { + "name": "Morning_jogging", + "value": "Morning jogging" + }, + { + "name": "Yoga", + "value": "Yoga" + }, + { + "name": "Swimming", + "value": "Swimming" + }, + { + "name": "Exercise_duration", + "value": "Exercise duration: (minutes)" + }, + { + "name": "Completion_Status", + "value": "Completion Status" + }, + { + "name": "Completed", + "value": "Completed" + }, + { + "name": "Uncompleted", + "value": "Uncompleted" + }, + { + "name": "submit", + "value": "Submit" + }, + { + "name": "enter_duration", + "value": "Please enter the exercise duration." + }, + { + "name": "My_plans", + "value": "My Plans" + }, + { + "name": "ALL", + "value": "All" + }, + { + "name": "delete_question", + "value": "Are you sure you want to delete the plan?" + }, + { + "name": "delete", + "value": "Delete" + }, + { + "name": "Add_Plans", + "value": "Add plan" + }, + { + "name": "status", + "value": "Status" + }, + { + "name": "Duration", + "value": "Duration" + }, + { + "name": "Tab_Bar_One", + "value": "Home Page" + }, + { + "name": "Tab_Bar_Two", + "value": "Mine" + }, + { + "name": "Network_Available", + "value": "Network Available" + }, + { + "name": "Network_Lost", + "value": "Network Lost" + }, + { + "name": "Network_Unavailable", + "value": "Network Unavailable" + }, + { + "name": "Login_Failed", + "value": "Failed to log in because the network is not connected." + } + ] +} \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/entry/src/main/resources/zh_CN/element/string.json b/PageAndData04/04_StartingPoint/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..9942777e4c145acf474bfa05ae8a9c1c230b1333 --- /dev/null +++ b/PageAndData04/04_StartingPoint/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,332 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "PageAndData" + }, + { + "name": "login_page", + "value": "登录界面" + }, + { + "name": "login_more", + "value": "登录账号以使用更多服务" + }, + { + "name": "account", + "value": "账号" + }, + { + "name": "password", + "value": "密码" + }, + { + "name": "login", + "value": "登录" + }, + { + "name": "register_account", + "value": "注册账号" + }, + { + "name": "forgot_password", + "value": "忘记密码" + }, + { + "name": "message_login", + "value": "短信验证码登录" + }, + { + "name": "other_login_method", + "value": "其他登录方式" + }, + { + "name": "vertical_line", + "value": " | " + }, + { + "name": "input_empty_tips", + "value": "输入不能为空" + }, + { + "name": "login_success", + "value": "登录成功" + }, + { + "name": "my_love", + "value": "我的最爱" + }, + { + "name": "history_record", + "value": "历史记录" + }, + { + "name": "message", + "value": "消息" + }, + { + "name": "shopping_cart", + "value": "购物车" + }, + { + "name": "my_goal", + "value": "我的目标" + }, + { + "name": "group", + "value": "圈子" + }, + { + "name": "favorites", + "value": "收藏" + }, + { + "name": "recycle_bin", + "value": "回收站" + }, + { + "name": "rankings", + "value": "排行榜" + }, + { + "name": "new_product_debut", + "value": "新品首发" + }, + { + "name": "big_name_flash", + "value": "大牌闪购" + }, + { + "name": "find_good", + "value": "发现好物" + }, + { + "name": "xiamen_station", + "value": "厦门站,我们不见不散" + }, + { + "name": "more_big_names", + "value": "更多大牌" + }, + { + "name": "push_notifications", + "value": "推送通知" + }, + { + "name": "data_management", + "value": "数据管理" + }, + { + "name": "menu_settings", + "value": "菜单设置" + }, + { + "name": "about", + "value": "关于" + }, + { + "name": "clear_cache", + "value": "清除缓存" + }, + { + "name": "mainPage_tabTitles_home", + "value": "首页" + }, + { + "name": "mainPage_tabTitles_mine", + "value": "我的" + }, + { + "name": "mainPage_top", + "value": "排行榜" + }, + { + "name": "mainPage_text_top", + "value": "厦门站,我们不见不散" + }, + { + "name": "mainPage_new", + "value": "新品首发" + }, + { + "name": "mainPage_text_new", + "value": "厦门站,我们不见不散" + }, + { + "name": "mainPage_brand", + "value": "大牌闪购" + }, + { + "name": "mainPage_text_brand", + "value": "更多大牌" + }, + { + "name": "mainPage_found", + "value": "发现好物" + }, + { + "name": "mainPage_text_found", + "value": "厦门站,我们不见不散" + }, + { + "name": "setting_account_name", + "value": "李先生" + }, + { + "name": "setting_account_email", + "value": "2000000@test.cc" + }, + { + "name": "setting_list_news", + "value": "推送通知" + }, + { + "name": "setting_list_font", + "value": "字体大小调节" + }, + { + "name": "setting_list_menu", + "value": "菜单设置" + }, + { + "name": "setting_list_about", + "value": "关于" + }, + { + "name": "setting_list_storage", + "value": "清除缓存" + }, + { + "name": "setting_list_privacy", + "value": "隐私协议" + }, + { + "name": "setting_button", + "value": "退出登录" + }, + { + "name": "home_list", + "value": "列表" + }, + { + "name": "setting_toggle", + "value": "开关" + }, + { + "name": "bind_title", + "value": "运动完成情况" + }, + { + "name": "fontsize_change", + "value": "字体大小调节" + }, + { + "name": "Confirmed", + "value": "确认" + }, + { + "name": "Cancel", + "value": "取消" + }, + { + "name": "sport_name", + "value": "运动名" + }, + { + "name": "Morning_jogging", + "value": "晨跑" + }, + { + "name": "Yoga", + "value": "瑜伽" + }, + { + "name": "Swimming", + "value": "游泳" + }, + { + "name": "Exercise_duration", + "value": "运动时长: (分钟)" + }, + { + "name": "Completion_Status", + "value": "完成状态" + }, + { + "name": "Completed", + "value": "已完成" + }, + { + "name": "Uncompleted", + "value": "未完成" + }, + { + "name": "submit", + "value": "提交" + }, + { + "name": "enter_duration", + "value": "请输入运动时长" + }, + { + "name": "My_plans", + "value": "我的计划" + }, + { + "name": "ALL", + "value": "任意" + }, + { + "name": "delete_question", + "value": "确定要删除该计划吗?" + }, + { + "name": "delete", + "value": "删除" + }, + { + "name": "Add_Plans", + "value": "新增计划" + }, + { + "name": "status", + "value": "状态" + }, + { + "name": "Duration", + "value": "时长" + }, + { + "name": "Tab_Bar_One", + "value": "首页" + }, + { + "name": "Tab_Bar_Two", + "value": "我的" + }, + { + "name": "Network_Available", + "value": "网络可用" + }, + { + "name": "Network_Lost", + "value": "网络丢失" + }, + { + "name": "Network_Unavailable", + "value": "网络不可用" + }, + { + "name": "Login_Failed", + "value": "网络未连接,无法登录" + } + ] +} \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/hvigor/hvigor-config.json5 b/PageAndData04/04_StartingPoint/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..73bfab4e997c8d4aea53b22fdd7f10112b30987f --- /dev/null +++ b/PageAndData04/04_StartingPoint/hvigor/hvigor-config.json5 @@ -0,0 +1,17 @@ +{ + "modelVersion": "5.0.0", + "dependencies": { + }, + "execution": { + // "daemon": true, /* Enable daemon compilation. Default: true */ + // "incremental": true, /* Enable incremental compilation. Default: true */ + // "parallel": true, /* Enable parallel compilation. Default: true */ + // "typeCheck": false, /* Enable typeCheck. Default: false */ + }, + "logging": { + // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */ + }, + "debugging": { + // "stacktrace": false /* Disable stacktrace compilation. Default: false */ + } +} \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/hvigorfile.ts b/PageAndData04/04_StartingPoint/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/PageAndData04/04_StartingPoint/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/PageAndData04/04_StartingPoint/oh-package.json5 b/PageAndData04/04_StartingPoint/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ba334a33e0ef0989bb410985996742da64bceda1 --- /dev/null +++ b/PageAndData04/04_StartingPoint/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "modelVersion": "5.0.0", + "license": "", + "devDependencies": { + }, + "author": "", + "name": "arktscomponents", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} \ No newline at end of file diff --git a/PageAndData04/README.md b/PageAndData04/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a402b07e1c5b60bbc78ae93e6de976f05e61a793 --- /dev/null +++ b/PageAndData04/README.md @@ -0,0 +1,4 @@ +根据【页面与数据:保存应用数据】教程进行学习,您可以选择从上一教程结束时构建完成的项目开始,也可以直接运行04_StartingPoint文件夹中的项目。 + +如果您想要自行探索,可以直接打开04_Complete文件夹中的项目并浏览代码。 + diff --git a/README.en.md b/README.en.md deleted file mode 100644 index 6a956a48543f3eb9f9a349bb257baf80d4fefbf8..0000000000000000000000000000000000000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# PageAndData - -#### Description -{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md deleted file mode 100644 index ffb58ff2d7ed216af27a33957f9ce47da5d099da..0000000000000000000000000000000000000000 --- a/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# PageAndData - -#### 介绍 -{**以下是 Gitee 平台说明,您可以替换此简介** -Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 -无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} - -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -#### 特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)