diff --git a/AppScope/app.json5 b/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..e2858b00de411e8205a1502422e1dee8acb11ad5 --- /dev/null +++ b/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.window", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/AppScope/resources/base/element/string.json b/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..4f7f79ce369a0e20906711b5115db4643c74d9f0 --- /dev/null +++ b/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "WindowManager" + } + ] +} diff --git a/AppScope/resources/base/media/app_icon.png b/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/AppScope/resources/base/media/app_icon.png differ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..0210352ae2ade0dd7b4c841cb6e8ba08b4780038 --- /dev/null +++ b/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2023 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/README.en.md b/README.en.md deleted file mode 100644 index f95f46f6a97b7984815fa14a8c4388bd5db828e7..0000000000000000000000000000000000000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# WindowManager - -#### 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 index 57252f5c1554465f3d5e47cc5e6ef653b342b8ca..e3d1d33b00a3641d0337eeeb4f3a92305f34071e 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,30 @@ -# WindowManager +# 窗口管理(ArkTS) -#### 介绍 -{**以下是 Gitee 平台说明,您可以替换此简介** -Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 -无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} +### 简介 -#### 软件架构 -软件架构说明 +本篇Codelab基于窗口管理,实现一个验证码登录案例。效果图如下: +![](screenshots/device/windowmanager.gif) -#### 安装教程 +### 相关概念 -1. xxxx -2. xxxx -3. xxxx +- 主窗口: 应用主窗口用于显示应用界面,会在"任务管理界面"显示。 +- 子窗口:应用子窗口用于显示应用的弹窗、悬浮窗等辅助窗口。 +- 沉浸式:指对状态栏、导航栏等系统窗口进行控制,减少状态栏导航栏等系统界面的突兀感,从而使用户获得最佳体验的能力。 -#### 使用说明 +### 相关权限 -1. xxxx -2. xxxx -3. xxxx +不涉及 -#### 参与贡献 +### 使用说明 -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request +1. 打开应用,主窗口实现沉浸式。 +2. 输入用户名密码后,点击验证码登录,拉起验证码校验子窗口。 +3. 验证码校验成功后,等待两秒,验证码校验子窗口消失,主窗口跳转到应用首页。 +### 约束与限制 -#### 特技 - -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/) +1. 本示例仅支持标准系统上运行,支持设备:华为手机。 +2. HarmonyOS系统:HarmonyOS NEXT Developer Beta1及以上。 +3. DevEco Studio版本:DevEco Studio NEXT Developer Beta1及以上。 +4. HarmonyOS SDK版本:HarmonyOS NEXT Developer Beta1 SDK及以上。 diff --git a/build-profile.json5 b/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..26bea001ac6999860a2890121e380c122e6b601b --- /dev/null +++ b/build-profile.json5 @@ -0,0 +1,28 @@ +{ + "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/entry/build-profile.json5 b/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..13c5eda6e6a3dae913ec5c5c4d60ea3ac954f205 --- /dev/null +++ b/entry/build-profile.json5 @@ -0,0 +1,11 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + "runtimeOS": "HarmonyOS" + } + ] +} \ No newline at end of file diff --git a/entry/hvigorfile.ts b/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/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/entry/oh-package.json5 b/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..225946cb11a2c405c8dc81eea89c22f923556638 --- /dev/null +++ b/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": {} +} diff --git a/entry/src/main/ets/common/constants/CommonConstants.ets b/entry/src/main/ets/common/constants/CommonConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..74e3f5ce98c9ae846faea64ca564c0c985254d63 --- /dev/null +++ b/entry/src/main/ets/common/constants/CommonConstants.ets @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2023 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 { + /** + * Input length of the account. + */ + static readonly INPUT_ACCOUNT_LENGTH: number = 11; + + /** + * Input length of the password. + */ + static readonly INPUT_PASSWORD_LENGTH: number = 8; + + /** + * Common Spacing of Components. + */ + static readonly COMMON_SPACE: number = 12; + + /** + * Login wait time. + */ + static readonly LOGIN_WAIT_TIME: number = 2000; + + /** + * Success page url. + */ + static readonly SUCCESS_PAGE_URL: string = 'pages/SuccessPage'; + + /** + * Home page url. + */ + static readonly HOME_PAGE_URL: string = 'pages/HomePage'; + + /** + * Login page url. + */ + static readonly LOGIN_PAGE_URL: string = 'pages/LoginPage'; + + /** + * Verify page url. + */ + static readonly VERIFY_PAGE_URL: string = 'pages/VerifyPage'; + + /** + * Home page url. + */ + static readonly HOME_PAGE_ACTION: string = 'startHomePage'; + + /** + * Sub window name. + */ + static readonly SUB_WINDOW_NAME: string = 'subWindow'; + + /** + * Status bar color. + */ + static readonly STATUS_BAR_COLOR: string = '#F1F3F5'; + + /** + * Status bar content color. + */ + static readonly STATUS_BAR_CONTENT_COLOR: string = '#000000'; + + /** + * Sub window width ratio in screen width. + */ + static readonly SUB_WINDOW_WIDTH_RATIO: number = 0.93; + + /** + * Sub window aspect ratio. + */ + static readonly SUB_WINDOW_ASPECT_RATIO: number = 1.25; + + /** + * The width or height of the component is spread across the parent component. + */ + static readonly FULL_PARENT: string = '100%'; + + /** + * The width of button. + */ + static readonly BUTTON_WIDTH: string = '86.7%'; + + /** + * The columns is four. + */ + static readonly GRID_FOUR_COLUMNS: string = '1fr 1fr 1fr 1fr'; + + /** + * The row is two. + */ + static readonly GRID_TWO_ROWS: string = '1fr 1fr'; + + /** + * The columns is two. + */ + static readonly GRID_TWO_COLUMNS: string = '1fr 1fr'; + + /** + * The row is four. + */ + static readonly GRID_THREE_ROWS: string = '1fr 1fr 1fr'; +} + diff --git a/entry/src/main/ets/common/utils/GlobalContext.ets b/entry/src/main/ets/common/utils/GlobalContext.ets new file mode 100644 index 0000000000000000000000000000000000000000..23f5130a61c9e0ac09c5d885cdcaa2c878e0d522 --- /dev/null +++ b/entry/src/main/ets/common/utils/GlobalContext.ets @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2023 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 GlobalContext { + private constructor() { + } + + private static instance: GlobalContext; + private _objects = new Map(); + + public static getContext(): GlobalContext { + if (!GlobalContext.instance) { + GlobalContext.instance = new GlobalContext(); + } + return GlobalContext.instance; + } + + getObject(value: string): Object | undefined { + return this._objects.get(value); + } + + setObject(key: string, objectClass: Object): void { + this._objects.set(key, objectClass); + } +} \ No newline at end of file diff --git a/entry/src/main/ets/common/utils/Logger.ets b/entry/src/main/ets/common/utils/Logger.ets new file mode 100644 index 0000000000000000000000000000000000000000..dad83350e46ec1f854635cfcca60445223a86c58 --- /dev/null +++ b/entry/src/main/ets/common/utils/Logger.ets @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2023 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'; + +export class Logger { + private domain: number + private prefix: string + + /** + * @param format Indicates the log format string. + */ + private format: string = '%{public}s, %{public}s' + + /** + * Constructor. + * + * @param prefix Identifies the log tag. + * @param domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF + * @param args Indicates the log parameters. + */ + constructor(prefix: string = 'WindowManager', domain: number = 0xFF00) { + this.prefix = prefix; + this.domain = domain; + } + + debug(...args: string[]): void { + hilog.debug(this.domain, this.prefix, this.format, args); + } + + info(...args: string[]): void { + hilog.info(this.domain, this.prefix, this.format, args); + } + + warn(...args: string[]): void { + hilog.warn(this.domain, this.prefix, this.format, args); + } + + error(...args: string[]): void { + hilog.error(this.domain, this.prefix, this.format, args); + } +} + +export default new Logger(); \ No newline at end of file diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..499348ba9c20856ba958f80f2b8c817cfe0ac2b4 --- /dev/null +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2023 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 { UIAbility } from '@kit.AbilityKit'; +import { window } from '@kit.ArkUI'; +import CommonConstants from '../common/constants/CommonConstants'; +import Logger from '../common/utils/Logger'; +import WindowModel from '../model/WindowModel'; + +export default class EntryAbility extends UIAbility { + onWindowStageCreate(windowStage: window.WindowStage) { + Logger.info('Ability onWindowStageCreate'); + + let windowModel = WindowModel.getInstance(); + windowModel.setWindowStage(windowStage); + windowModel.setMainWindowImmersive(); + windowStage.loadContent(CommonConstants.LOGIN_PAGE_URL, (err) => { + if (err.code) { + Logger.error(`Failed to load the content. Code:${err.code},message:${err.message}`); + return; + } + }); + } +} diff --git a/entry/src/main/ets/model/WindowModel.ets b/entry/src/main/ets/model/WindowModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..fd3505f708b5501b927502d56b2e6b7b6251f20e --- /dev/null +++ b/entry/src/main/ets/model/WindowModel.ets @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2023 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 { window, display } from '@kit.ArkUI'; +import CommonConstants from '../common/constants/CommonConstants'; +import Logger from '../common/utils/Logger'; +import { GlobalContext } from '../common/utils/GlobalContext'; + +/** + * Window controller model. + */ +export default class WindowModel { + private windowStage?: window.WindowStage; + private subWindowClass?: window.Window; + + /** + * Get singleton. + * + * @return {WindowModel} WindowModel + */ + static getInstance(): WindowModel { + let instance: WindowModel = GlobalContext.getContext().getObject('windowModel') as WindowModel; + if (instance === undefined) { + instance = new WindowModel(); + GlobalContext.getContext().setObject('windowModel', instance) + } + return instance; + } + + /** + * Set windowStage. + * + * @param windowStage The object of WindowStage. + */ + setWindowStage(windowStage: window.WindowStage) { + this.windowStage = windowStage; + } + + /** + * Create sub window. + */ + createSubWindow() { + if (this.windowStage === undefined) { + Logger.error('Failed to create the subWindow.'); + return; + } + this.windowStage.createSubWindow(CommonConstants.SUB_WINDOW_NAME, (err, data: window.Window) => { + if (err.code) { + Logger.error(`Failed to create the window. Code:${err.code}, message:${err.message}`); + return; + } + // Obtains a child window instance. + this.subWindowClass = data; + // Obtains the screen width and height. + let screenWidth = display.getDefaultDisplaySync().width; + let screenHeight = display.getDefaultDisplaySync().height; + // Calculate the sub-window width and height based on the sub-window aspect ratio. + let windowWidth = screenWidth * CommonConstants.SUB_WINDOW_WIDTH_RATIO; + let windowHeight = windowWidth / CommonConstants.SUB_WINDOW_ASPECT_RATIO; + // Calculate the start coordinate of the sub-window. + let moveX = (screenWidth - windowWidth) / 2; + let moveY = screenHeight - windowHeight; + this.subWindowClass.moveWindowTo(moveX, moveY, (err) => { + if (err.code) { + Logger.error(`Failed to move the window. Code:${err.code}, message:${err.message}`); + return; + } + }); + this.subWindowClass.resize(windowWidth, windowHeight, (err) => { + if (err.code) { + Logger.error(`Failed to change the window size. Code:${err.code}, message:${err.message}`); + return; + } + }); + this.subWindowClass.setUIContent(CommonConstants.VERIFY_PAGE_URL, (err) => { + if (err.code) { + Logger.error(`Failed to load the content. Code:${err.code}, message:${err.message}`); + return; + } + if (this.subWindowClass === undefined) { + Logger.error('subWindowClass is undefined.'); + return; + } + this.subWindowClass.setWindowBackgroundColor('#00000000'); + this.subWindowClass.showWindow((err) => { + if (err.code) { + Logger.error(`Failed to show the window. Code:${err.code}, essage:${err.message}`); + return; + } + }); + }); + }); + } + + /** + * Set the main window immersive. + */ + setMainWindowImmersive() { + if (this.windowStage === undefined) { + Logger.error('windowStage is undefined.'); + return; + } + this.windowStage.getMainWindow((err, windowClass: window.Window) => { + if (err.code) { + Logger.error(`Failed to obtain the main window. Code:${err.code}, message:${err.message}`); + return; + } + windowClass.setWindowLayoutFullScreen(true, (err) => { + if (err.code) { + Logger.error(`Failed to set full-screen mode. Code:${err.code}, message:${err.message}`); + return; + } + }); + windowClass.setWindowSystemBarEnable([], (err) => { + if (err.code) { + Logger.error(`Failed to set the system bar to be invisible. Code:${err.code}, message:${err.message}`); + return; + } + }); + }); + } + + /** + * Destroy sub window. + */ + destroySubWindow() { + if (this.subWindowClass === undefined) { + Logger.error('subWindowClass is undefined.'); + return; + } + this.subWindowClass.destroyWindow((err) => { + if (err.code) { + Logger.error(`Failed to destroy the window. Code:${err.code}, message:${err.message}`); + return; + } + }); + } +} diff --git a/entry/src/main/ets/pages/HomePage.ets b/entry/src/main/ets/pages/HomePage.ets new file mode 100644 index 0000000000000000000000000000000000000000..f06b0ac9ea46a72abfb7fec5d490da2a9309315f --- /dev/null +++ b/entry/src/main/ets/pages/HomePage.ets @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2023 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 CommonConstants from '../common/constants/CommonConstants'; +import ItemData from '../viewmodel/GridItem'; +import WindowViewModel from '../viewmodel/WindowViewModel'; + +/** + * Home page after login. + */ +@Entry +@Component +struct HomePage { + private swiperController: SwiperController = new SwiperController(); + + @Builder + NavigationTitle() { + Text($r('app.string.home_title')) + .fontWeight(FontWeight.Medium) + .fontSize($r('app.float.page_title_text_size')) + .margin({ top: $r('app.float.home_tab_titles_margin') }) + .padding({ left: $r('app.float.home_tab_titles_padding') }) + } + + build() { + Navigation() { + Scroll() { + Column({ space: CommonConstants.COMMON_SPACE }) { + Swiper(this.swiperController) { + ForEach(WindowViewModel.getSwiperImages(), (img: Resource, index?: number) => { + Image(img).borderRadius($r('app.float.home_swiper_border_radius')) + }, (img: Resource, index?: number) => index + JSON.stringify(img.id)) + } + .margin({ + top: $r('app.float.home_swiper_margin') + }) + .autoPlay(true) + + Grid() { + ForEach(WindowViewModel.getFirstGridData(), (firstItem: ItemData, index?: number) => { + GridItem() { + Column() { + Image(firstItem.image) + .width($r('app.float.home_home_cell_size')) + .height($r('app.float.home_home_cell_size')) + Text(firstItem.title) + .fontSize($r('app.float.little_text_size')) + .margin({ top: $r('app.float.home_home_cell_margin') }) + } + } + }, (firstItem: ItemData, index?: number) => index + JSON.stringify(firstItem)) + } + .columnsTemplate(CommonConstants.GRID_FOUR_COLUMNS) + .rowsTemplate(CommonConstants.GRID_TWO_ROWS) + .columnsGap($r('app.float.home_grid_columns_gap')) + .rowsGap($r('app.float.home_grid_row_gap')) + .padding({ + top: $r('app.float.home_grid_padding'), + bottom: $r('app.float.home_grid_padding') + }) + .height($r('app.float.home_grid_height')) + .backgroundColor(Color.White) + .borderRadius($r('app.float.background_border_radius')) + + Text($r('app.string.home_list')) + .fontSize($r('app.float.normal_text_size')) + .fontWeight(FontWeight.Medium) + .width(CommonConstants.FULL_PARENT) + .margin({ top: $r('app.float.home_text_margin') }) + + Grid() { + ForEach(WindowViewModel.getSecondGridData(), (secondItem: ItemData, index?: number) => { + GridItem() { + Column() { + Text(secondItem.title) + .fontSize($r('app.float.normal_text_size')) + .fontWeight(FontWeight.Medium) + Text(secondItem.others) + .margin({ top: $r('app.float.background_text_margin') }) + .fontSize($r('app.float.little_text_size')) + .fontColor($r('app.color.home_grid_font_color')) + } + .alignItems(HorizontalAlign.Start) + } + .padding({ + top: $r('app.float.home_list_padding'), + left: $r('app.float.home_list_padding') + }) + .borderRadius($r('app.float.home_background_border_radius')) + .align(Alignment.TopStart) + .backgroundImage(secondItem.image) + .backgroundImageSize(ImageSize.Cover) + .width(CommonConstants.FULL_PARENT) + .height(CommonConstants.FULL_PARENT) + }, (secondItem: ItemData, index?: number) => index + JSON.stringify(secondItem)) + } + .width(CommonConstants.FULL_PARENT) + .height($r('app.float.home_second_grid_height')) + .columnsTemplate(CommonConstants.GRID_TWO_COLUMNS) + .rowsTemplate(CommonConstants.GRID_THREE_ROWS) + .columnsGap($r('app.float.home_grid_columns_gap')) + .rowsGap($r('app.float.home_grid_row_gap')) + .margin({ bottom: $r('app.float.home_button_bottom') }) + } + } + .scrollBar(BarState.Off) + .margin({ + left: $r('app.float.home_padding'), + right: $r('app.float.home_padding') + }) + } + .title(this.NavigationTitle()) + .titleMode(NavigationTitleMode.Mini) + .hideBackButton(true) + .backgroundColor($r('app.color.background')) + } +} diff --git a/entry/src/main/ets/pages/LoginPage.ets b/entry/src/main/ets/pages/LoginPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..8203655b153bbf24be82f92d0a6487ef70ca86b6 --- /dev/null +++ b/entry/src/main/ets/pages/LoginPage.ets @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { router } from '@kit.ArkUI'; +import CommonConstants from '../common/constants/CommonConstants'; +import Logger from '../common/utils/Logger'; +import WindowModel from '../model/WindowModel'; + +@Extend(TextInput) +function inputStyle() { + .placeholderColor($r('app.color.placeholder_color')) + .backgroundColor(($r('app.color.start_window_background'))) + .height($r('app.float.login_input_height')) + .fontSize($r('app.float.big_text_size')) + .padding({ + left: $r('app.float.input_padding'), + right: $r('app.float.input_padding') + }) +} + +@Extend(Text) +function blueTextStyle() { + .fontColor($r('app.color.login_blue_text_color')) + .fontSize($r('app.float.small_text_size')) + .fontWeight(FontWeight.Medium) + .margin({ + left: $r('app.float.forgot_margin'), + right: $r('app.float.forgot_margin') + }) +} + +/** + * Login page. + */ +@Entry +@Component +struct LoginPage { + @State account: string = ''; + @State password: string = ''; + @State isShadow: boolean = false; + private windowModel: WindowModel = WindowModel.getInstance(); + @State @Watch('toHome')isHome: boolean = false; + aboutToAppear() { + getContext(this).eventHub.on(CommonConstants.HOME_PAGE_ACTION, () => { + this.isHome = true; + }); + } + + build() { + Stack({ alignContent: Alignment.Top }) { + Column() { + Image($r('app.media.ic_logo')) + .width($r('app.float.logo_image_size')) + .height($r('app.float.logo_image_size')) + .margin({ + top: $r('app.float.logo_margin_top'), + bottom: $r('app.float.logo_margin_bottom') + }) + Text($r('app.string.login_page')) + .fontSize($r('app.float.page_title_text_size')) + .fontWeight(FontWeight.Medium) + .fontColor($r('app.color.title_text_color')) + Text($r('app.string.login_more')) + .fontSize($r('app.float.normal_text_size')) + .fontColor($r('app.color.login_more_text_color')) + .margin({ + bottom: $r('app.float.login_more_margin_bottom'), + top: $r('app.float.login_more_margin_top') + }) + + Column() { + TextInput({ placeholder: $r('app.string.account') }) + .maxLength(CommonConstants.INPUT_ACCOUNT_LENGTH) + .inputStyle() + .onChange((value: string) => { + this.account = value; + }) + Line() + .width(CommonConstants.FULL_PARENT) + .height($r('app.float.line_height')) + .backgroundColor($r('app.color.line_color')) + .margin({ + left: $r('app.float.line_margin'), + right: $r('app.float.line_margin') + }) + TextInput({ placeholder: $r('app.string.password') }) + .maxLength(CommonConstants.INPUT_PASSWORD_LENGTH) + .type(InputType.Password) + .inputStyle() + .onChange((value: string) => { + this.password = value; + }) + } + .padding({ + top: $r('app.float.background_text_margin'), + bottom: $r('app.float.background_text_margin') + }) + .width(CommonConstants.FULL_PARENT) + .backgroundColor($r('app.color.start_window_background')) + .borderRadius($r('app.float.background_border_radius')) + + Row() { + Text($r('app.string.message_login')).blueTextStyle() + Text($r('app.string.forgot_password')).blueTextStyle() + } + .justifyContent(FlexAlign.SpaceBetween) + .width(CommonConstants.FULL_PARENT) + .margin({ top: $r('app.float.forgot_margin_top') }) + + Blank() + Button($r('app.string.verify'), { type: ButtonType.Capsule }) + .width(CommonConstants.BUTTON_WIDTH) + .height($r('app.float.login_button_height')) + .fontSize($r('app.float.normal_text_size')) + .fontWeight(FontWeight.Medium) + .enabled(isLoginClickable(this.account, this.password)) + .backgroundColor(isLoginClickable(this.account, this.password) ? $r('app.color.login_button_color') : $r('app.color.login_button_disable')) + .fontColor(isLoginClickable(this.account, this.password) ? Color.White : $r('app.color.login_font_disable')) + .margin({ + top: $r('app.float.login_button_margin_top'), + bottom: $r('app.float.login_button_margin_bottom') + }) + .onClick(() => { + this.windowModel.createSubWindow(); + this.isShadow = true; + }) + Text($r('app.string.register_account')) + .fontColor($r('app.color.login_blue_text_color')) + .fontSize($r('app.float.normal_text_size')) + .fontWeight(FontWeight.Medium) + .margin({ bottom: $r('app.float.login_register_margin_bottom') }) + } + .backgroundColor($r('app.color.background')) + .height(CommonConstants.FULL_PARENT) + .width(CommonConstants.FULL_PARENT) + .padding({ + left: $r('app.float.login_padding'), + right: $r('app.float.login_padding'), + bottom: $r('app.float.login_page_padding_bottom') + }) + + if (this.isShadow) { + Rect() + .width(CommonConstants.FULL_PARENT) + .height(CommonConstants.FULL_PARENT) + .fillOpacity($r('app.float.login_background_opacity')) + .fill($r('app.color.title_text_color')) + } + } + } + toHome():void{ + if(this.isHome){ + router.replaceUrl({ + url: CommonConstants.HOME_PAGE_URL + }).catch((err: Error) => { + Logger.error(`pushUrl failed, message:${err.message}`); + }); + } + } +} + +/** + * Calculate login button clickable by the input of username and password. + * + * @param account Login username. + * @param password Login password. + * + * @return {boolean} isLoginButtonClickable. + */ +function isLoginClickable(account: string, password: string): boolean { + return account !== '' && password !== ''; +} \ No newline at end of file diff --git a/entry/src/main/ets/pages/SuccessPage.ets b/entry/src/main/ets/pages/SuccessPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..ff32d274b44cd7ffb827423077b621078b1d7138 --- /dev/null +++ b/entry/src/main/ets/pages/SuccessPage.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 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 CommonConstants from '../common/constants/CommonConstants'; +import WindowModel from '../model/WindowModel'; + +/** + * Success page in sub window. + */ +@Entry +@Component +struct SuccessPage { + aboutToAppear() { + setTimeout(() => { + WindowModel.getInstance().destroySubWindow(); + getContext(this).eventHub.emit(CommonConstants.HOME_PAGE_ACTION); + }, CommonConstants.LOGIN_WAIT_TIME); + } + + build() { + Column() { + Column() { + Text($r('app.string.success')) + .fontSize($r('app.float.large_text_size')) + .padding({ + left: $r('app.float.verify_padding'), + top: $r('app.float.verify_padding') + }) + .width(CommonConstants.FULL_PARENT) + Image($r('app.media.ic_success')) + .width($r('app.float.success_image_size')) + .height($r('app.float.success_image_size')) + .margin({ + top: $r('app.float.success_image_margin'), + bottom: $r('app.float.success_image_margin') + }) + Text($r('app.string.success_login_hints')) + .fontSize($r('app.float.small_text_size')) + .fontColor($r('app.color.placeholder_color')) + .margin({ + bottom: $r('app.float.verify_auto_jump_bottom_margin') + }) + } + .backgroundColor(Color.White) + .height(CommonConstants.FULL_PARENT) + .borderRadius($r('app.float.verify_ok_margin')) + } + .padding({ bottom: $r('app.float.verify_bottom_padding') }) + .height(CommonConstants.FULL_PARENT) + } +} \ No newline at end of file diff --git a/entry/src/main/ets/pages/VerifyPage.ets b/entry/src/main/ets/pages/VerifyPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..cc12972857d760561f5b3b4dca2cf6f61c72f90e --- /dev/null +++ b/entry/src/main/ets/pages/VerifyPage.ets @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { router } from '@kit.ArkUI'; +import CommonConstants from '../common/constants/CommonConstants'; +import Logger from '../common/utils/Logger'; +import VerifyItem from '../viewmodel/VerifyItem'; +import WindowViewModel from '../viewmodel/WindowViewModel'; + +@Extend(Text) +function promptTextStyle() { + .fontSize($r('app.float.small_text_size')) + .width(CommonConstants.FULL_PARENT) + .padding({ + left: $r('app.float.verify_padding'), + right: $r('app.float.verify_padding') + }) +} + +/** + * Verify page in sub window. + */ +@Entry +@Component +struct VerifyPage { + @State isInputWrong: boolean = false; + @State verifyItem: VerifyItem = new VerifyItem($r('app.media.ic_verity_character1'), 'XYZK'); + @State inputText: string = ''; + private verifyMap: Map = new Map(); + private imageId: number = 0; + + aboutToAppear() { + this.verifyMap = WindowViewModel.getVerifyMap(); + this.updateVerifyItem(); + } + + updateVerifyItem(){ + let verifyItemNew: VerifyItem | undefined = this.verifyMap.get(this.imageId); + if (verifyItemNew !== undefined) { + this.verifyItem = verifyItemNew; + } + } + + build() { + Column() { + Column() { + Row() { + Image(this.verifyItem.image) + .height($r('app.float.verify_image_height')) + .width($r('app.float.verify_image_width')) + Text($r('app.string.change_one')) + .fontColor($r('app.color.login_blue_text_color')) + .fontSize($r('app.float.big_text_size')) + .width($r('app.float.verify_hints_width')) + .textAlign(TextAlign.Center) + .onClick(() => { + this.imageId = (this.imageId + 1) % 2; + this.updateVerifyItem(); + }) + } + .padding({ + left: $r('app.float.verify_padding'), + top: $r('app.float.verify_padding'), + right: $r('app.float.verify_hints_padding') + }) + .width(CommonConstants.FULL_PARENT) + .justifyContent(FlexAlign.SpaceBetween) + + + TextInput({ placeholder: $r('app.string.verify_input_placeholder'), text: this.inputText }) + .placeholderColor($r('app.color.placeholder_color')) + .fontSize($r('app.float.big_text_size')) + .height($r('app.float.login_button_height')) + .margin({ + left: $r('app.float.verify_padding'), + right: $r('app.float.verify_padding'), + top: $r('app.float.verify_text_input_margin'), + bottom: $r('app.float.verify_text_input_margin') + }) + .onChange((value: string) => { + this.inputText = value; + }) + if (this.isInputWrong) { + Text($r('app.string.verify_wrong_hints')) + .fontColor($r('app.color.verify_wrong_hints_color')) + .promptTextStyle() + } else { + Text($r('app.string.verify_hints')) + .fontColor($r('app.color.placeholder_color')) + .promptTextStyle() + } + Text($r('app.string.verify_ok')) + .fontSize($r('app.float.big_text_size')) + .fontColor($r('app.color.login_blue_text_color')) + .margin({ + top: $r('app.float.verify_ok_margin'), + bottom: $r('app.float.verify_ok_margin') + }) + .onClick(() => { + let verifyText: string = this.verifyItem.characters; + if (this.inputText.toLowerCase() === verifyText.toLowerCase()) { + router.replaceUrl({ + url: CommonConstants.SUCCESS_PAGE_URL + }).catch((err: Error) => { + Logger.error(`pushUrl failed, message:${err.message}`); + }); + } else { + this.isInputWrong = true; + this.inputText = ''; + this.imageId = (this.imageId + 1) % 2; + this.updateVerifyItem(); + } + }) + } + .backgroundColor(Color.White) + .height(CommonConstants.FULL_PARENT) + .borderRadius($r('app.float.verify_ok_margin')) + } + .padding({ bottom: $r('app.float.verify_bottom_padding') }) + .height(CommonConstants.FULL_PARENT) + } +} \ No newline at end of file diff --git a/entry/src/main/ets/viewmodel/GridItem.ets b/entry/src/main/ets/viewmodel/GridItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..5cf7de2f16d9603bac8e968ef92626cf449d24eb --- /dev/null +++ b/entry/src/main/ets/viewmodel/GridItem.ets @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2023 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. + */ + +/** + * Grid item data entity. + */ +export default class GridItem { + /** + * Title of grid item. + */ + title: Resource; + /** + * Image of grid item. + */ + image: Resource = $r('app.media.ic_love'); + /** + * Other resource of grid item. + */ + others?: Resource; + + constructor(title: Resource, image: Resource, others?: Resource) { + this.title = title; + this.image = image; + this.others = others; + } +} \ No newline at end of file diff --git a/entry/src/main/ets/viewmodel/VerifyItem.ets b/entry/src/main/ets/viewmodel/VerifyItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..c8986e8248e5489f73c0eb1033789fd2323a6e57 --- /dev/null +++ b/entry/src/main/ets/viewmodel/VerifyItem.ets @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2023 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. + */ + +/** + * Verify item entity. + */ +export default class VerifyItem { + /** + * Image of verify item. + */ + image: Resource; + /** + * Correct characters of verify item. + */ + characters: string; + + constructor(image: Resource, characters: string) { + this.image = image; + this.characters = characters; + } +} \ No newline at end of file diff --git a/entry/src/main/ets/viewmodel/WindowViewModel.ets b/entry/src/main/ets/viewmodel/WindowViewModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..718dab4211d4fa42dc0887ae4e905380af0a7341 --- /dev/null +++ b/entry/src/main/ets/viewmodel/WindowViewModel.ets @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2023 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 GridItem from './GridItem'; +import VerifyItem from './VerifyItem'; + +/** + * Binds data to components and provides interfaces. + */ +export class WindowViewModel { + + /** + * Get verify items map. + * + * @return {Map} verifyMap. + */ + getVerifyMap(): Map { + let verifyMap: Map = new Map(); + verifyMap.set(0, new VerifyItem($r('app.media.ic_verity_character1'), 'XYZK')); + verifyMap.set(1, new VerifyItem($r('app.media.ic_verity_character2'), 'LHBR')); + return verifyMap; + } + + /** + * Get swiper image data. + * + * @return {Array} swiperImages. + */ + getSwiperImages(): Array { + let swiperImages: Resource[] = [ + $r('app.media.ic_swiper1'), + $r('app.media.ic_swiper2'), + $r('app.media.ic_swiper3'), + $r('app.media.ic_swiper4') + ]; + return swiperImages; + } + + /** + * Get data of the first grid. + * + * @return {Array} firstGridData. + */ + getFirstGridData(): Array { + let firstGridData: GridItem[] = [ + new GridItem($r('app.string.my_love'), $r('app.media.ic_love')), + new GridItem($r('app.string.history_record'), $r('app.media.ic_record')), + new GridItem($r('app.string.message'), $r('app.media.ic_message')), + new GridItem($r('app.string.shopping_cart'), $r('app.media.ic_shopping')), + new GridItem($r('app.string.my_goal'), $r('app.media.ic_target')), + new GridItem($r('app.string.group'), $r('app.media.ic_circle')), + new GridItem($r('app.string.favorites'), $r('app.media.ic_favorite')), + new GridItem($r('app.string.recycle_bin'), $r('app.media.ic_recycle')) + ]; + return firstGridData; + } + + /** + * Get data of the second grid. + * + * @return {Array} secondGridData. + */ + getSecondGridData(): Array { + let secondGridData: GridItem[] = [ + new GridItem($r('app.string.home_top'), $r('app.media.ic_top'), $r('app.string.home_text_top')), + new GridItem($r('app.string.home_new'), $r('app.media.ic_new'), $r('app.string.home_text_new')), + new GridItem($r('app.string.home_brand'), $r('app.media.ic_brand'), $r('app.string.home_text_brand')), + new GridItem($r('app.string.home_found'), $r('app.media.ic_found'), $r('app.string.home_text_found')), + new GridItem($r('app.string.home_top'), $r('app.media.ic_top'), $r('app.string.home_text_top')), + new GridItem($r('app.string.home_new'), $r('app.media.ic_new'), $r('app.string.home_text_new')) + ]; + return secondGridData; + } +} + +export default new WindowViewModel(); \ No newline at end of file diff --git a/entry/src/main/module.json5 b/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..d20b6d2d74915682d233726daa5c0c8ba770877f --- /dev/null +++ b/entry/src/main/module.json5 @@ -0,0 +1,38 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ets", + "description": "$string:EntryAbility_desc", + "icon": "$media:icon", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "portrait" + } + ] + } +} \ No newline at end of file diff --git a/entry/src/main/resources/base/element/color.json b/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..6d3e3eeb46ab9aec0c2d3f79f766c59c0cc2cda6 --- /dev/null +++ b/entry/src/main/resources/base/element/color.json @@ -0,0 +1,52 @@ +{ + "color": [ + { + "name": "start_window_background", + "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": "#0D000000" + }, + { + "name": "login_button_color", + "value": "#007DFF" + }, + { + "name": "login_button_disable", + "value": "#66007DFF" + }, + { + "name": "login_font_disable", + "value": "#66FFFFFF" + }, + { + "name": "login_blue_text_color", + "value": "#007DFF" + }, + { + "name": "verify_wrong_hints_color", + "value": "#FFFA2A2D" + }, + { + "name": "home_grid_font_color", + "value": "#99182431" + } + ] +} \ No newline at end of file diff --git a/entry/src/main/resources/base/element/float.json b/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..149b1d8c7e0833ecbb27cf9c35741fdce8df4abb --- /dev/null +++ b/entry/src/main/resources/base/element/float.json @@ -0,0 +1,216 @@ +{ + "float": [ + { + "name": "logo_image_size", + "value": "78vp" + }, + { + "name": "logo_margin_top", + "value": "125vp" + }, + { + "name": "logo_margin_bottom", + "value": "9vp" + }, + { + "name": "page_title_text_size", + "value": "24fp" + }, + { + "name": "normal_text_size", + "value": "16fp" + }, + { + "name": "large_text_size", + "value": "21fp" + }, + { + "name": "big_text_size", + "value": "16fp" + }, + { + "name": "small_text_size", + "value": "14fp" + }, + { + "name": "little_text_size", + "value": "12fp" + }, + { + "name": "login_more_margin_bottom", + "value": "24vp" + }, + { + "name": "login_more_margin_top", + "value": "8vp" + }, + { + "name": "login_input_height", + "value": "48vp" + }, + { + "name": "forgot_margin_top", + "value": "12vp" + }, + { + "name": "forgot_margin", + "value": "12vp" + }, + { + "name": "input_padding", + "value": "12vp" + }, + { + "name": "line_height", + "value": "0.5vp" + }, + { + "name": "line_margin", + "value": "12vp" + }, + { + "name": "login_button_height", + "value": "40vp" + }, + { + "name": "login_button_margin_top", + "value": "231vp" + }, + { + "name": "login_register_margin_bottom", + "value": "40vp" + }, + { + "name": "login_button_margin_bottom", + "value": "12vp" + }, + { + "name": "login_page_padding_bottom", + "value": "24vp" + }, + { + "name": "login_background_opacity", + "value": "0.2" + }, + { + "name": "login_padding", + "value": "12vp" + }, + { + "name": "verify_padding", + "value": "24vp" + }, + { + "name": "verify_image_height", + "value": "48vp" + }, + { + "name": "verify_image_width", + "value": "164vp" + }, + { + "name": "verify_hints_width", + "value": "88vp" + }, + { + "name": "verify_hints_padding", + "value": "40vp" + }, + { + "name": "verify_text_input_margin", + "value": "8vp" + }, + { + "name": "verify_ok_margin", + "value": "32vp" + }, + { + "name": "verify_bottom_padding", + "value": "12vp" + }, + { + "name": "verify_auto_jump_bottom_margin", + "value": "24vp" + }, + { + "name": "success_image_size", + "value": "56vp" + }, + { + "name": "success_image_margin", + "value": "32vp" + }, + { + "name": "home_padding", + "value": "12vp" + }, + { + "name": "home_tab_titles_margin", + "value": "12vp" + }, + { + "name": "home_tab_titles_padding", + "value": "12vp" + }, + { + "name": "home_swiper_border_radius", + "value": "16vp" + }, + { + "name": "home_swiper_margin", + "value": "24vp" + }, + { + "name": "home_grid_columns_gap", + "value": "8vp" + }, + { + "name": "home_grid_row_gap", + "value": "12vp" + }, + { + "name": "home_grid_padding", + "value": "12vp" + }, + { + "name": "home_grid_height", + "value": "124vp" + }, + { + "name": "background_text_margin", + "value": "4vp" + }, + { + "name": "home_list_padding", + "value": "8vp" + }, + { + "name": "background_border_radius", + "value": "24vp" + }, + { + "name": "home_text_margin", + "value": "12vp" + }, + { + "name": "home_background_border_radius", + "value": "12vp" + }, + { + "name": "home_second_grid_height", + "value": "406vp" + }, + { + "name": "home_home_cell_size", + "value": "24vp" + }, + { + "name": "home_home_cell_margin", + "value": "4vp" + }, + { + "name": "home_button_bottom", + "value": "55vp" + } + ] +} \ No newline at end of file diff --git a/entry/src/main/resources/base/element/string.json b/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..28efd25a728921e4c74aa26076112d88040454b7 --- /dev/null +++ b/entry/src/main/resources/base/element/string.json @@ -0,0 +1,148 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "WindowManager" + }, + { + "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": "verify", + "value": "Verify" + }, + { + "name": "register_account", + "value": "Registering an Account" + }, + { + "name": "forgot_password", + "value": "Forgot Password" + }, + { + "name": "message_login", + "value": "SMS verification code login" + }, + { + "name": "change_one", + "value": "Change One" + }, + { + "name": "verify_input_placeholder", + "value": "Please enter the verification code" + }, + { + "name": "verify_wrong_hints", + "value": "Incorrect verification code. Please try again" + }, + { + "name": "verify_hints", + "value": "To protect your network security, please enter the verification code" + }, + { + "name": "verify_ok", + "value": "OK" + }, + { + "name": "success", + "value": "Verification success" + }, + { + "name": "success_login_hints", + "value": "The login page is automatically displayed in 2 seconds" + }, + { + "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": "home_top", + "value": "Rankings" + }, + { + "name": "home_text_top", + "value": "XiaMen Station, we'll see you." + }, + { + "name": "home_new", + "value": "New product launch" + }, + { + "name": "home_text_new", + "value": "XiaMen Station, we'll see you." + }, + { + "name": "home_brand", + "value": "Big-name flash shopping" + }, + { + "name": "home_text_brand", + "value": "More Big Names" + }, + { + "name": "home_found", + "value": "Discover the good stuff" + }, + { + "name": "home_text_found", + "value": "XiaMen Station, we'll see you." + }, + { + "name": "home_list", + "value": "List" + }, + { + "name": "home_title", + "value": "Home" + } + ] +} \ No newline at end of file diff --git a/entry/src/main/resources/base/media/ic_about.png b/entry/src/main/resources/base/media/ic_about.png new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/entry/src/main/resources/base/media/ic_brand.png b/entry/src/main/resources/base/media/ic_brand.png new file mode 100644 index 0000000000000000000000000000000000000000..657be8334a8a445f21d9b74ed4cb6627dc13d127 Binary files /dev/null and b/entry/src/main/resources/base/media/ic_brand.png differ diff --git a/entry/src/main/resources/base/media/ic_circle.png b/entry/src/main/resources/base/media/ic_circle.png new file mode 100644 index 0000000000000000000000000000000000000000..8679cc579e02960529ee58be9d835bd4934ddf95 Binary files /dev/null and b/entry/src/main/resources/base/media/ic_circle.png differ diff --git a/entry/src/main/resources/base/media/ic_data.png b/entry/src/main/resources/base/media/ic_data.png new file mode 100644 index 0000000000000000000000000000000000000000..022a833ddb4cd84c5307ba361004cbd2a3a25558 Binary files /dev/null and b/entry/src/main/resources/base/media/ic_data.png differ diff --git a/entry/src/main/resources/base/media/ic_favorite.png b/entry/src/main/resources/base/media/ic_favorite.png new file mode 100644 index 0000000000000000000000000000000000000000..7bb1d806578b17bad0d6f5ad5b68971ca15b8343 Binary files /dev/null and b/entry/src/main/resources/base/media/ic_favorite.png differ diff --git a/entry/src/main/resources/base/media/ic_found.png b/entry/src/main/resources/base/media/ic_found.png new file mode 100644 index 0000000000000000000000000000000000000000..39df31354d8912ad2dfdb070041df24013e49860 Binary files /dev/null and b/entry/src/main/resources/base/media/ic_found.png differ diff --git a/entry/src/main/resources/base/media/ic_logo.png b/entry/src/main/resources/base/media/ic_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..1dcac2208bef8df6893357ec8d43fdd6ee6763f7 Binary files /dev/null and b/entry/src/main/resources/base/media/ic_logo.png differ diff --git a/entry/src/main/resources/base/media/ic_love.png b/entry/src/main/resources/base/media/ic_love.png new file mode 100644 index 0000000000000000000000000000000000000000..af2463bc5174a3617f2782ab11af2e07169bcd06 Binary files /dev/null and b/entry/src/main/resources/base/media/ic_love.png differ diff --git a/entry/src/main/resources/base/media/ic_message.png b/entry/src/main/resources/base/media/ic_message.png new file mode 100644 index 0000000000000000000000000000000000000000..d06572ad0d06dc7d76ae87df7518a24c58766a6f Binary files /dev/null and b/entry/src/main/resources/base/media/ic_message.png differ diff --git a/entry/src/main/resources/base/media/ic_new.png b/entry/src/main/resources/base/media/ic_new.png new file mode 100644 index 0000000000000000000000000000000000000000..a3e34211e891458be3afa0a901bccfa6f2371b22 Binary files /dev/null and b/entry/src/main/resources/base/media/ic_new.png differ diff --git a/entry/src/main/resources/base/media/ic_record.png b/entry/src/main/resources/base/media/ic_record.png new file mode 100644 index 0000000000000000000000000000000000000000..06c596d37373bf765cf3ef594d5d1cb1a9094965 Binary files /dev/null and b/entry/src/main/resources/base/media/ic_record.png differ diff --git a/entry/src/main/resources/base/media/ic_recycle.png b/entry/src/main/resources/base/media/ic_recycle.png new file mode 100644 index 0000000000000000000000000000000000000000..30cee7fc4e050a1e685f20c8d59eb558a73db41c Binary files /dev/null and b/entry/src/main/resources/base/media/ic_recycle.png differ diff --git a/entry/src/main/resources/base/media/ic_shadow_background.png b/entry/src/main/resources/base/media/ic_shadow_background.png new file mode 100644 index 0000000000000000000000000000000000000000..3981e020cd00a84c78fa12715094301343032135 Binary files /dev/null and b/entry/src/main/resources/base/media/ic_shadow_background.png differ diff --git a/entry/src/main/resources/base/media/ic_shopping.png b/entry/src/main/resources/base/media/ic_shopping.png new file mode 100644 index 0000000000000000000000000000000000000000..c060dcaa614b3f0286476e798baf7840bd0a0315 Binary files /dev/null and b/entry/src/main/resources/base/media/ic_shopping.png differ diff --git a/entry/src/main/resources/base/media/ic_success.svg b/entry/src/main/resources/base/media/ic_success.svg new file mode 100644 index 0000000000000000000000000000000000000000..6a1d7953bafe06f3e0cadc92072be0714b8d0b42 --- /dev/null +++ b/entry/src/main/resources/base/media/ic_success.svg @@ -0,0 +1,13 @@ + + + ic_success + + + + + + + + + + \ No newline at end of file diff --git a/entry/src/main/resources/base/media/ic_swiper1.png b/entry/src/main/resources/base/media/ic_swiper1.png new file mode 100644 index 0000000000000000000000000000000000000000..3f1e081539375a4fb4ac142ab7061287af80a12d Binary files /dev/null and b/entry/src/main/resources/base/media/ic_swiper1.png differ diff --git a/entry/src/main/resources/base/media/ic_swiper2.png b/entry/src/main/resources/base/media/ic_swiper2.png new file mode 100644 index 0000000000000000000000000000000000000000..5e307d53994dafc85984518b5513f80d864b8815 Binary files /dev/null and b/entry/src/main/resources/base/media/ic_swiper2.png differ diff --git a/entry/src/main/resources/base/media/ic_swiper3.png b/entry/src/main/resources/base/media/ic_swiper3.png new file mode 100644 index 0000000000000000000000000000000000000000..e47660fee043619b24d38aaf61897f7282454109 Binary files /dev/null and b/entry/src/main/resources/base/media/ic_swiper3.png differ diff --git a/entry/src/main/resources/base/media/ic_swiper4.png b/entry/src/main/resources/base/media/ic_swiper4.png new file mode 100644 index 0000000000000000000000000000000000000000..bfbd91b3093dd6b80ac3528c2f2acccab331e1ce Binary files /dev/null and b/entry/src/main/resources/base/media/ic_swiper4.png differ diff --git a/entry/src/main/resources/base/media/ic_target.png b/entry/src/main/resources/base/media/ic_target.png new file mode 100644 index 0000000000000000000000000000000000000000..643399686567163c4077ff32654dc39caf450fc6 Binary files /dev/null and b/entry/src/main/resources/base/media/ic_target.png differ diff --git a/entry/src/main/resources/base/media/ic_top.png b/entry/src/main/resources/base/media/ic_top.png new file mode 100644 index 0000000000000000000000000000000000000000..1ca23a5dbc1f769677b5602afc567184a4a24851 Binary files /dev/null and b/entry/src/main/resources/base/media/ic_top.png differ diff --git a/entry/src/main/resources/base/media/ic_verity_character1.png b/entry/src/main/resources/base/media/ic_verity_character1.png new file mode 100644 index 0000000000000000000000000000000000000000..2bfcf094f1faf355fafc083b1a8e8d1b37a676d2 Binary files /dev/null and b/entry/src/main/resources/base/media/ic_verity_character1.png differ diff --git a/entry/src/main/resources/base/media/ic_verity_character2.png b/entry/src/main/resources/base/media/ic_verity_character2.png new file mode 100644 index 0000000000000000000000000000000000000000..b2f8c3ffce732b9115f02472142832e5268df5ea Binary files /dev/null and b/entry/src/main/resources/base/media/ic_verity_character2.png differ diff --git a/entry/src/main/resources/base/media/icon.png b/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/entry/src/main/resources/base/media/icon.png differ diff --git a/entry/src/main/resources/base/profile/main_pages.json b/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..fa9bda5ccb6e0b182e287fcbeced530c93fc6ebd --- /dev/null +++ b/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,8 @@ +{ + "src": [ + "pages/LoginPage", + "pages/HomePage", + "pages/VerifyPage", + "pages/SuccessPage" + ] +} \ No newline at end of file diff --git a/entry/src/main/resources/en_US/element/string.json b/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..28efd25a728921e4c74aa26076112d88040454b7 --- /dev/null +++ b/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,148 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "WindowManager" + }, + { + "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": "verify", + "value": "Verify" + }, + { + "name": "register_account", + "value": "Registering an Account" + }, + { + "name": "forgot_password", + "value": "Forgot Password" + }, + { + "name": "message_login", + "value": "SMS verification code login" + }, + { + "name": "change_one", + "value": "Change One" + }, + { + "name": "verify_input_placeholder", + "value": "Please enter the verification code" + }, + { + "name": "verify_wrong_hints", + "value": "Incorrect verification code. Please try again" + }, + { + "name": "verify_hints", + "value": "To protect your network security, please enter the verification code" + }, + { + "name": "verify_ok", + "value": "OK" + }, + { + "name": "success", + "value": "Verification success" + }, + { + "name": "success_login_hints", + "value": "The login page is automatically displayed in 2 seconds" + }, + { + "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": "home_top", + "value": "Rankings" + }, + { + "name": "home_text_top", + "value": "XiaMen Station, we'll see you." + }, + { + "name": "home_new", + "value": "New product launch" + }, + { + "name": "home_text_new", + "value": "XiaMen Station, we'll see you." + }, + { + "name": "home_brand", + "value": "Big-name flash shopping" + }, + { + "name": "home_text_brand", + "value": "More Big Names" + }, + { + "name": "home_found", + "value": "Discover the good stuff" + }, + { + "name": "home_text_found", + "value": "XiaMen Station, we'll see you." + }, + { + "name": "home_list", + "value": "List" + }, + { + "name": "home_title", + "value": "Home" + } + ] +} \ No newline at end of file diff --git a/entry/src/main/resources/zh_CN/element/string.json b/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..913bd12fc3cccd65890f5934c6f7d3bedf9a4640 --- /dev/null +++ b/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,148 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "描述" + }, + { + "name": "EntryAbility_label", + "value": "窗口管理" + }, + { + "name": "login_page", + "value": "登录界面" + }, + { + "name": "login_more", + "value": "登录帐号以使用更多服务" + }, + { + "name": "account", + "value": "帐号" + }, + { + "name": "password", + "value": "密码" + }, + { + "name": "verify", + "value": "验证码检测" + }, + { + "name": "register_account", + "value": "注册帐号" + }, + { + "name": "forgot_password", + "value": "忘记密码" + }, + { + "name": "message_login", + "value": "短信验证码登录" + }, + { + "name": "change_one", + "value": "换一张" + }, + { + "name": "verify_input_placeholder", + "value": "请输入验证码" + }, + { + "name": "verify_wrong_hints", + "value": "验证码错误,请重新输入" + }, + { + "name": "verify_hints", + "value": "为了保护你的网络安全,请输入验证码" + }, + { + "name": "verify_ok", + "value": "确定" + }, + { + "name": "success", + "value": "验证成功" + }, + { + "name": "success_login_hints", + "value": "2s后自动跳转登录" + }, + { + "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": "home_top", + "value": "排行榜" + }, + { + "name": "home_text_top", + "value": "厦门站,我们不见不散" + }, + { + "name": "home_new", + "value": "新品首发" + }, + { + "name": "home_text_new", + "value": "厦门站,我们不见不散" + }, + { + "name": "home_brand", + "value": "大牌闪购" + }, + { + "name": "home_text_brand", + "value": "更多大牌" + }, + { + "name": "home_found", + "value": "发现好物" + }, + { + "name": "home_text_found", + "value": "厦门站,我们不见不散" + }, + { + "name": "home_list", + "value": "列表" + }, + { + "name": "home_title", + "value": "首页" + } + ] +} \ No newline at end of file diff --git a/hvigor/hvigor-config.json5 b/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..73bfab4e997c8d4aea53b22fdd7f10112b30987f --- /dev/null +++ b/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/hvigorfile.ts b/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/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/oh-package.json5 b/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..15bcef7f6a98f5b674f36c89264ecff80e56b2e4 --- /dev/null +++ b/oh-package.json5 @@ -0,0 +1,13 @@ +{ + "modelVersion": "5.0.0", + "license": "", + "devDependencies": { + "@ohos/hypium": "1.0.15" + }, + "author": "", + "name": "windowmanager", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} diff --git a/screenshots/device/windowmanager.gif b/screenshots/device/windowmanager.gif new file mode 100644 index 0000000000000000000000000000000000000000..2d032dc133c25f5f9056745b5e84370f07b8ee1e Binary files /dev/null and b/screenshots/device/windowmanager.gif differ