diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/.gitignore b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..3751fa5d3adfc49a1aa3be18d511503bbc558292 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/.gitignore @@ -0,0 +1,5 @@ +/build +/node_modules +/.preview/ +.gradle/ +.*/ \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/LICENSE b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..7c357dc828cf7d8c783f10ed6bb1bac8a1e903c1 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2021 Huawei Device Co., Ltd. + + Licensed under the Apache License,Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +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/2022_ArkUI_Bootcamp/fengforky+WeuiEts/README.md b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/README.md new file mode 100644 index 0000000000000000000000000000000000000000..fbc77c7539afe2a8b0ddf0905e72e03ae19d03d6 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/README.md @@ -0,0 +1,11 @@ +简介 • 鸿蒙ets组件演示。weui风格。weui for ets of arkui 鸿蒙harmonyos。 + +安装要求 • 安装DevEco Studio • 设置DevEco Studio开发环境。DevEco Studio开发环境需要连接到网络,以确保该正常使用。可以根据以下两种情况配置开发环境: 1.如果您可以直接访问Internet,则只需下载HarmonyOS SDK + + +用户指南 • 下载此项目 • 打开HUAWEI DevEco Studio,单击File> Open选择此ComponentCodelab • 单击Build> Build App(s)/Hap(s)>Build Debug Hap(s)以编译hap软件包 • 单击Run> Run 'entry'以运行hap包 + +注意 • 您可以选择在模拟器或真机上运行hap软件包。 +• 如果在真机上运行它,则需要在项目的File> Project Structure> Modules> Signing Configs中配置签名和证书信息。 + +许可 请参阅LICENSE文件以获得更多信息。 diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/RELEASE-NOTES.md b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/RELEASE-NOTES.md new file mode 100644 index 0000000000000000000000000000000000000000..ea23a13e3d4407d06cba3aa7155a23e5081b50b4 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/RELEASE-NOTES.md @@ -0,0 +1,2 @@ +1.0.0 +1.Initial version \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/build.gradle b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..1a58de33ed3179c49b1ac69394c480aac518e0a3 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/build.gradle @@ -0,0 +1,44 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +apply plugin: 'com.huawei.ohos.app' + +//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 +ohos { + signingConfigs { + debug { + storeFile file('/Users/fengguo/.ohos/config/auto_debug_com.huawei.cookbook_900086000023004558.p12') + storePassword '0000001B324D04306744FAC872648D38FF73728819C75EDA38827778DF44390B892024C810D08F653A3A84' + keyAlias = 'debugKey' + keyPassword '0000001B6B22F93BA49DFA2049D4A67AFCCAF495937F2D0B44A5BD00C196A54421614311D17A0CDEE62BFB' + signAlg = 'SHA256withECDSA' + profile file('/Users/fengguo/.ohos/config/auto_debug_com.huawei.cookbook_900086000023004558.p7b') + certpath file('/Users/fengguo/.ohos/config/auto_debug_com.huawei.cookbook_900086000023004558.cer') + } + } + compileSdkVersion 7 +} + +buildscript { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + } + dependencies { + classpath 'com.huawei.ohos:hap:3.1.0.5' + classpath 'com.huawei.ohos:decctest:1.2.7.11' + } +} + +allprojects { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/build.gradle b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..05bcb56d7438f02c08a98a1a67bce4bd8825c9de --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/build.gradle @@ -0,0 +1,29 @@ +apply plugin: 'com.huawei.ohos.hap' +apply plugin: 'com.huawei.ohos.decctest' +//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 +ohos { + signingConfigs { + + } + compileSdkVersion 7 + defaultConfig { + compatibleSdkVersion 7 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) + testImplementation 'junit:junit:4.13.1' + ohosTestImplementation 'com.huawei.ohos.testkit:runner:2.0.0.200' +} +decc { + supportType = ['html', 'xml'] +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/proguard-rules.pro b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/proguard-rules.pro new file mode 100644 index 0000000000000000000000000000000000000000..f7666e47561d514b2a76d5a7dfbb43ede86da92a --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/proguard-rules.pro @@ -0,0 +1 @@ +# config module specific ProGuard rules here. \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/config.json b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..c5c25a4c4d2a2b73832981d331470ca75e4a44da --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/config.json @@ -0,0 +1,103 @@ +{ + "app": { + "vendor": "example", + "bundleName": "com.myie9.weuiets", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "mainAbility": "com.huawei.shoppingdemoets.MainAbility", + "deviceType": [ + "phone" + ], + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": "com.huawei.shoppingdemoets.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "distro": { + "moduleType": "entry", + "installationFree": false, + "deliveryWithInstall": true, + "moduleName": "entry" + }, + "package": "com.huawei.shoppingdemoets", + "name": ".MyApplication", + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/HomePage", + "pages/containertab/ColumnExample", + "pages/Slider", + "pages/Button", + "pages/ShoppingCartPage", + "pages/ShoppingDetail", + "pages/MyPage", + "pages/choosePage", + "pages/DividerExample", + "pages/RatingExample", + "pages/PopupExample", + "pages/PanelExample", + "pages/BadgeExample", + "pages/containertab/ColumnSplit", + "pages/CounterExample", + "pages/containertab/FlexExample3", + "pages/containertab/GridExample", + "pages/containertab/ListExample", + "pages/containertab/RowExample", + "pages/containertab/RowSplitExample", + "pages/containertab/ScrollExample", + "pages/containertab/StackExample", + "pages/giftab/AttrAnimationExample", + "pages/giftab/AnimateToExample", + "pages/giftab/PageTransitionExample", + "pages/giftab/TransitionExample", + "pages/giftab/SharedTransitionExampleA", + "pages/giftab/SharedTransitionExampleB", + "pages/giftab/MotionPathExample", + "pages/giftab/ShapeExample", + "pages/TextStyleExample", + "pages/giftab/ClipAndMaskExample", + "pages/fuc/privacy/FirstPage", + "pages/fuc/privacy/Privacy", + "pages/fuc/privacy/SecondPage", + "pages/fuc/privacy/ThirdPage", + "pages/fuc/privacy/WebPage", + "pages/gesturetab/LongPressGestureExample", + "pages/gesturetab/PanGestureExample", + "pages/gesturetab/PinchGestureExample", + "pages/gesturetab/RotationGestureExample", + "pages/gesturetab/GestureGroupExample" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/app.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/app.ets new file mode 100644 index 0000000000000000000000000000000000000000..0be61a623b0216ebbfacf77d8871f2fcaf1de68e --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/app.ets @@ -0,0 +1,8 @@ +export default { + onCreate() { + console.info('Application onCreate') + }, + onDestroy() { + console.info('Application onDestroy') + }, +} diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/model/ArsData.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/model/ArsData.ets new file mode 100644 index 0000000000000000000000000000000000000000..658e93b765aed92519d00b6307aaf4d2fb6e28d9 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/model/ArsData.ets @@ -0,0 +1,13 @@ + +let NextId = 0; +export class ArsData { + id: string; + title: string; + content: string; + + constructor(title: string, content: string) { + this.id = `${NextId++}`; + this.title = title; + this.content = content; + } +} diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/model/GoodsData.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/model/GoodsData.ets new file mode 100644 index 0000000000000000000000000000000000000000..95176852b36bd3ffac7722456072153e5d2e2def --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/model/GoodsData.ets @@ -0,0 +1,16 @@ +let NextId = 0; +export class GoodsData { + id: string; + title: string; + content: string; + price: number; + imgSrc: Resource; + + constructor(title: string, content: string, price: number, imgSrc: Resource) { + this.id = `${NextId++}`; + this.title = title; + this.content = content; + this.price = price; + this.imgSrc = imgSrc; + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/model/GoodsDataModels.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/model/GoodsDataModels.ets new file mode 100644 index 0000000000000000000000000000000000000000..c7cc78ab16568e1dac20312a2247918859d026c1 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/model/GoodsDataModels.ets @@ -0,0 +1,247 @@ +import { GoodsData} from './GoodsData' + +import {Menu, ImageItem} from './Menu' +import {ArsData} from './ArsData' + +export function initializeOnStartup(): Array { + let GoodsDataArray: Array = [] + GoodsComposition.forEach(item => { + console.log(item.title); + GoodsDataArray.push(new GoodsData(item.title, item.content, item.price, item.imgSrc)); + }) + return GoodsDataArray; +} + +export function getIconPath(): Array { + let IconPath: Array = ['nav/icon-buy.png','nav/icon-shopping-cart.png','nav/icon-my.png'] + + return IconPath; +} + +export function getIconPathSelect(): Array { + let IconPathSelect: Array = ['nav/icon-home.png','nav/icon-shopping-cart-select.png','nav/icon-my-select.png'] + + return IconPathSelect; +} + +export function getDetailImages(): Array { + let detailImages: Array = ['computer/computer1.png','computer/computer2.png','computer/computer3.png','computer/computer4.png','computer/computer5.png','computer/computer6.png'] + + return detailImages; +} + + +export function getMenu(): Array { + let MenuArray: Array = [] + MyMenu.forEach(item => { + MenuArray.push(new Menu(item.title,item.num)); + }) + return MenuArray; +} + +export function getTrans(): Array { + let ImageItemArray: Array = [] + MyTrans.forEach(item => { + ImageItemArray.push(new ImageItem(item.title,item.imageSrc)); + }) + return ImageItemArray; +} + +export function getMore(): Array { + let ImageItemArray: Array = [] + MyMore.forEach(item => { + ImageItemArray.push(new ImageItem(item.title,item.imageSrc)); + }) + return ImageItemArray; +} + +export function getArs(): Array { + let ArsItemArray: Array = [] + ArsList.forEach(item => { + ArsItemArray.push(new ArsData(item.title,item.content)); + }) + return ArsItemArray; +} + +const GoodsComposition: any[] = [ + { + "title": 'HUAWEI nova 8 Pro ', + "content": 'Goes on sale: 10:08', + "price": '3999', + "imgSrc": $rawfile('picture/HW (1).png') + }, + { + "title": 'HUAWEI Mate 30E Pro 5G', + "content": '3 interest-free payments ', + "price": '5299', + "imgSrc": $rawfile('picture/HW (2).png') + }, + { + "title": 'HUAWEI MatePad Pro', + "content": 'Flagship ', + "price": '3799', + "imgSrc": $rawfile('picture/HW (3).png') + }, + { + "title": 'HUAWEI Nova 8 Pro', + "content": 'New arrival ', + "price": '3999', + "imgSrc": $rawfile('picture/HW (4).png') + }, + { + "title": 'HUAWEI WATCH FIT', + "content": 'Versatile', + "price": '769', + "imgSrc": $rawfile('picture/HW (5).png') + }, + { + "title": 'HUAWEI nova 8 Pro ', + "content": 'Goes on sale: 10:08', + "price": '3999', + "imgSrc": $rawfile('picture/HW (6).png') + }, + { + "title": 'HUAWEI Mate 30E Pro 5G', + "content": '3 interest-free payments ', + "price": '5299', + "imgSrc": $rawfile('picture/HW (7).png') + }, + { + "title": 'HUAWEI MatePad Pro', + "content": 'Flagship ', + "price": '3799', + "imgSrc": $rawfile('picture/HW (8).png') + }, + { + "title": 'HUAWEI Nova 8 Pro', + "content": 'New arrival ', + "price": '3999', + "imgSrc": $rawfile('picture/HW (9).png') + }, + { + "title": 'HUAWEI WATCH FIT', + "content": 'Versatile', + "price": '769', + "imgSrc": $rawfile('picture/HW (10).png') + }, +] + +const MyMenu: any[] = [ + { + 'title': 'Favorites', + 'num': '10' + }, + { + 'title': 'Searched', + 'num': '1000' + }, + { + 'title': 'Following', + 'num': '100' + }, + { + 'title': 'Followers', + 'num': '10000' + } +] + + + + +const MyTrans: any[] = [ + { + 'title': 'Post: 520', + 'imageSrc': $rawfile('nav/icon-menu-release.png') + }, + { + 'title': 'Sold: 520', + 'imageSrc': $rawfile('nav/icon-menu-sell.png') + }, + { + 'title': 'Bought: 10', + 'imageSrc': $rawfile('nav/icon-menu-buy.png') + } +] + +const MyMore: any[] = [ + { + 'title': 'Guide', + 'imageSrc': $rawfile('nav/icon-menu-buy.png') + }, + { + 'title': 'Create', + 'imageSrc': $rawfile('nav/icon-menu-buy.png') + }, + { + 'title': 'Poster', + 'imageSrc': $rawfile('nav/icon-menu-buy.png') + }, + { + 'title': 'Games', + 'imageSrc': $rawfile('nav/icon-menu-buy.png') + }, + { + 'title': 'Jobber', + 'imageSrc': $rawfile('nav/icon-menu-buy.png') + }, + { + 'title': 'Myself', + 'imageSrc': $rawfile('nav/icon-menu-buy.png') + }, + { + 'title': 'About', + 'imageSrc': $rawfile('nav/icon-menu-buy.png') + }, + { + 'title': 'Rental', + 'imageSrc': $rawfile('nav/icon-menu-buy.png') + }, + { + 'title': 'Author', + 'imageSrc': $rawfile('nav/icon-menu-buy.png') + }, + +] + +const ArsList: any[] =[ + { + 'title': 'Display Size', + 'content': '13.9 inches', + }, + { + 'title': 'Memory', + 'content': '16 GB', + }, + { + 'title': 'Marketing Name', + 'content': 'HUAWEI MateBook X Pro', + }, + { + 'title': 'Color Gamut', + 'content': '100% sRGB color gamut (Typical)', + }, + { + 'title': 'Battery', + 'content': '56 Wh (rated capacity)', + }, + { + 'title': 'Storage', + 'content': '512 GB', + }, + { + 'title': 'Resolution', + 'content': '3000x2000', + }, + { + 'title': 'Processor', + 'content': '11th Gen Intel® Core™ i7-1165G7 Processor', + }, + { + 'title': 'CPU Cores', + 'content': '4', + }, + { + 'title': 'Launch Time', + 'content': 'January 2021', + } +] \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/model/Menu.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/model/Menu.ets new file mode 100644 index 0000000000000000000000000000000000000000..e1e7c3ba045ea4d5aa06d1f65004c48394b2b4c5 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/model/Menu.ets @@ -0,0 +1,25 @@ + +let NextId = 0; +export class Menu { + id: string; + title: string; + num: number; + + constructor(title: string, num: number) { + this.id = `${NextId++}`; + this.title = title; + this.num = num; + } +} + +export class ImageItem { + id: string; + title: string; + imageSrc: Resource; + + constructor(title: string, imageSrc: Resource) { + this.id = `${NextId++}`; + this.title = title; + this.imageSrc = imageSrc; + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/BadgeExample.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/BadgeExample.ets new file mode 100644 index 0000000000000000000000000000000000000000..f61a3ccfd79689a0bbee7d1c370ed908bc9f3ad1 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/BadgeExample.ets @@ -0,0 +1,42 @@ +// xxx.ets +@Entry +@Component +struct BadgeExample { + @State counts: number = 1 + @State message: string = 'new' + + build() { + Flex({ justifyContent: FlexAlign.SpaceAround }) { + Badge({ + count: this.counts, + maxCount: 99, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red } + }) { + Button('message') + .onClick(() => { + this.counts++ + }) + .width(100).height(50).backgroundColor(0x317aff) + }.width(100).height(50) + + Badge({ + value: this.message, + style: { color: 0xFFFFFF, fontSize: 9, badgeSize: 20, badgeColor: Color.Blue } + }) { + Text('message') + .width(80).height(50).fontSize(16).lineHeight(37) + .borderRadius(10).textAlign(TextAlign.Center).backgroundColor(0xF3F4ED) + }.width(80).height(50) + + Badge({ + value: '', + position: BadgePosition.Right, + style: { badgeSize: 6, badgeColor: Color.Red } + }) { + Text('message') + .width(90).height(50).fontSize(16).lineHeight(37) + .borderRadius(10).textAlign(TextAlign.Center).backgroundColor(0xF3F4ED) + }.width(90).height(50) + }.width('100%').margin({ top: 25 }) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/Button.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/Button.ets new file mode 100644 index 0000000000000000000000000000000000000000..4b2ffc0ee51d0d7effedbf54c27ade59f8e27839 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/Button.ets @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ButtonEts { + + @Builder DescribeText(text:string) { + Stack() { + Text(text ) + .margin({ top: 30 }) + .fontSize(20) + .fontWeight(FontWeight.Bold) + } + } + + build() { + Column({space:20}) { + Button("主要操作", { type: ButtonType.Normal, stateEffect: true }) + .backgroundColor(0x07c160) + .borderRadius(8).width(184).height(48).fontWeight(700) + .onClick((event: ClickEvent) => { + AlertDialog.show({ message: '点击成功' }) + }) +// .fontSize(17) + + + Button("次要操作", { type: ButtonType.Normal, stateEffect: true }) + .backgroundColor(0xf2f2f2).width(184).height(48).fontWeight(700).fontColor(0x06ae56) + .borderRadius(8) + + Button("警示操作", { type: ButtonType.Normal, stateEffect: true }) + .backgroundColor(0xf2f2f2).width(184).height(48).fontWeight(700).fontColor(0xfa5151) + .borderRadius(8) + +// this.DescribeText('禁止状态的按钮') + + Button("禁止的按钮", { type: ButtonType.Normal, stateEffect: false }) + .backgroundColor(0xf2f2f2).width(184).height(48).fontWeight(700) + .borderRadius(8).fontColor('rgba(0, 0, 0, 0.2)') + .enabled(false).opacity(0.5) + + + Button("普通行按钮", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF).fontWeight(700) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + AlertDialog.show({ message: '点击成功' }) + }) + + Button("强调行按钮", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF).fontWeight(700) + .fontColor(0x576B95) + .onClick((event: ClickEvent) => { + AlertDialog.show({ message: '点击成功' }) + }) + +// this.DescribeText('小按钮') + + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Start, justifyContent: FlexAlign.SpaceBetween }) { +// Text('Common button').fontSize(9).fontColor(0xCCCCCC) + Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Button('Ok', { type: ButtonType.Normal, stateEffect: true }).borderRadius(8).backgroundColor(0x317aff).width(90) + Button({ type: ButtonType.Normal, stateEffect: true }) { + Row() { + Image($r('app.media.flower4')).width(20).height(20).margin({ left: 12 }) + Text('loading').fontSize(12).fontColor(0xffffff).margin({ left: 5, right: 12 }) + }.alignItems(VerticalAlign.Center) + }.borderRadius(8).backgroundColor(0x317aff).width(90) + Button('Disable', { type: ButtonType.Normal, stateEffect: false }).opacity(0.5) + .borderRadius(8).backgroundColor(0x317aff).width(90) + } + +// Text('Capsule button').fontSize(9).fontColor(0xCCCCCC) + Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Button('Ok', { type: ButtonType.Capsule, stateEffect: true }).backgroundColor(0x317aff).width(90) + Button({ type: ButtonType.Capsule, stateEffect: true }) { + Row() { + Image($r('app.media.flower4')).width(20).height(20).margin({ left: 12 }) + Text('loading').fontSize(12).fontColor(0xffffff).margin({ left: 5, right: 12 }) + }.alignItems(VerticalAlign.Center).width(90) + }.backgroundColor(0x317aff) + .onClick((event: ClickEvent) => { + AlertDialog.show({ message: 'The login is successful' }) + }) + Button('Disable', { type: ButtonType.Capsule, stateEffect: false }).opacity(0.5) + .backgroundColor(0x317aff).width(90) + } + +// Text('Circle button').fontSize(9).fontColor(0xCCCCCC) + Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.Wrap }) { + Button({ type: ButtonType.Circle, stateEffect: true }) { + Image($r('app.media.flower4')).width(20).height(20) + }.width(55).height(55).backgroundColor(0x317aff) + Button({ type: ButtonType.Circle, stateEffect: true }) { + Image($r('app.media.flower4')).width(30).height(30) + }.width(55).height(55).margin({ left: 20 }).backgroundColor(0xF55A42) + } + }.height(230).padding({ left: 35, right: 35, top: 10 }) + + } + .padding({ left: 5, right: 5, top:20 }) + .backgroundColor('#ececec') + } + + onPageShow() { + } +} diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/CounterExample.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/CounterExample.ets new file mode 100644 index 0000000000000000000000000000000000000000..25c484c7980c22dfd3e4ea0cf05400962d20cfe3 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/CounterExample.ets @@ -0,0 +1,20 @@ +// xxx.ets +@Entry +@Component +struct CounterExample { + @State value: number = 0 + + build() { + Column() { + Counter() { + Text(this.value.toString()) + }.margin(100) + .onInc(() => { + this.value++ + }) + .onDec(() => { + this.value-- + }) + }.width("100%") + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/DividerExample.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/DividerExample.ets new file mode 100644 index 0000000000000000000000000000000000000000..c9d1eeacd690fb03d946f53f0c30889e30b50e0e --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/DividerExample.ets @@ -0,0 +1,27 @@ +// xxx.ets +@Entry +@Component +struct DividerExample { + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Start, justifyContent: FlexAlign.SpaceBetween }) { + Text('Horizontal divider').fontSize(9).fontColor(0xCCCCCC) + Row().width('100%').height(40).backgroundColor(0xF1F3F5) + Divider() + Row().width('100%').height(40).backgroundColor(0xF1F3F5) + + Text('Vertical divider').fontSize(9).fontColor(0xCCCCCC) + Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.Wrap }) { + Text('bravery') + Divider().vertical(true).margin(20).height(15) + Text('effort') + Divider().vertical(true).margin(20).height(15) + Text('upward') + }.width(250) + + Text('Custom Styles').fontSize(9).fontColor(0xCCCCCC) + Row().width('100%').height(40).backgroundColor(0xF1F3F5) + Divider().vertical(false).strokeWidth(5).color(0x2788D9).lineCap(LineCapStyle.Round) + Row().width('100%').height(40).backgroundColor(0xF1F3F5) + }.width('100%').height(350).padding({ left: 35, right: 35, top: 35 }) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/HomePage.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/HomePage.ets new file mode 100644 index 0000000000000000000000000000000000000000..db523d050c3bfd368f2321f597b4e5334201165e --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/HomePage.ets @@ -0,0 +1,545 @@ +import {GoodsData} from '../model/GoodsData' +import {initializeOnStartup,getIconPath,getIconPathSelect} from '../model/GoodsDataModels' +import {ShoppingCart} from './ShoppingCartPage' +import {MyInfo} from './MyPage' +import router from '@system.router' + +@Entry +@Component +struct Index { + @Provide currentPage: number = 1 + private goodsItems: GoodsData[] = initializeOnStartup() + build() { + Column() { + Scroll() { + Column() { + if (this.currentPage == 1) { + GoodsHome({ goodsItems: this.goodsItems }) + } else if (this.currentPage == 2) { + //购物车列表 + ShoppingCart() + } else { + //我的 + MyInfo() + } + } + .backgroundColor('#ececec') +// .height('100%') + .height(630) + } + .flexGrow(1) + HomeBottom() + } + .backgroundColor("white") + + + } +} + + +@Component +struct HomeBottom { + @Consume currentPage: number + private iconPathTmp: string[] = getIconPath() + private iconPathSelectsTmp: string[] = getIconPathSelect() + @State iconPath: string[] = getIconPath() + build() { + Row(){ + List() { + ForEach(this.iconPath, item => { + ListItem() { + Image($rawfile(item)) + .objectFit(ImageFit.Cover) + .height(30) + .width(30) + .renderMode(ImageRenderMode.Original) + .onClick(()=>{ + if(item==this.iconPath[0]){ + this.iconPath[0]=this.iconPathTmp[0] + this.iconPath[1]=this.iconPathTmp[1] + this.iconPath[2]=this.iconPathTmp[2] + this.currentPage=1 + } + if(item==this.iconPath[1]){ + this.iconPath[0]=this.iconPathSelectsTmp[0] + this.iconPath[1]=this.iconPathSelectsTmp[1] + this.iconPath[2]=this.iconPathTmp[2] + this.currentPage=2 + } + if(item==this.iconPath[2]){ + this.iconPath[0]=this.iconPathSelectsTmp[0] + this.iconPath[1]=this.iconPathTmp[1] + this.iconPath[2]=this.iconPathSelectsTmp[2] + this.currentPage=3 + } + }) + } + .width(120) + .height(40) + }, item => item) + } + .margin({left:10}) + .align(Alignment.BottomStart) + .listDirection(Axis.Horizontal) + } + .alignItems(VerticalAlign.Bottom) + .height(30) + .margin({top:10 ,bottom:10}) + } +} + +@Component +struct GoodsList { + private goodsItems: GoodsData[] + + build() { + Column() { + List() { + ForEach(this.goodsItems, item => { + ListItem() { + GoodsListItem({ goodsItem: item }) + } + }, item => item.id.toString()) + } + .height('100%') + .width('100%') + .align(Alignment.Top) + .margin({top: 5}) + } + } +} + + + +@Component +struct ContainerTab { + + build() { + Column() { + List({ space: 2, initialIndex: 0 }) { + ListItem() { + Button("列容器", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/containertab/ColumnExample' }) + }) + } + + ListItem() { + Button("列拆分", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/containertab/ColumnSplit' }) + }) + } + + ListItem() { + Button("Flex布局", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/containertab/FlexExample3' }) + }) + } + + ListItem() { + Button("网格", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/containertab/GridExample' }) + }) + } + + ListItem() { + Button("列表", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/containertab/ListExample' }) + }) + } + + ListItem() { + Button("行容器", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/containertab/RowExample' }) + }) + } + + ListItem() { + Button("行拆分", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/containertab/RowSplitExample' }) + }) + } + + ListItem() { + Button("滚动条", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/containertab/ScrollExample' }) + }) + } + + ListItem() { + Button("堆叠栈", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/containertab/StackExample' }) + }) + } + + } + + .height('100%') + .width('100%') + .align(Alignment.Top) + .borderColor(Color.Gray) + } + } +} + + +@Component +struct GestureTab { + + build() { + Column() { + List({ space: 2, initialIndex: 0 }) { + ListItem() { + Button("长按", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/gesturetab/LongPressGestureExample' }) + }) + } + + ListItem() { + Button("拖动", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/gesturetab/PanGestureExample' }) + }) + } + + + ListItem() { + Button("缩放", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/gesturetab/PinchGestureExample' }) + }) + } +// +// ListItem() { +// Button("旋转", { type: ButtonType.Normal, stateEffect: false }) +// .width('100%').height(56).backgroundColor(0xFFFFFF) +// .fontColor('rgb(0, 0, 0)') +// .onClick((event: ClickEvent) => { +// router.push({ uri: 'pages/gesturetab/RotationGestureExample' }) +// }) +// } +// +// +// ListItem() { +// Button("组合", { type: ButtonType.Normal, stateEffect: false }) +// .width('100%').height(56).backgroundColor(0xFFFFFF) +// .fontColor('rgb(0, 0, 0)') +// .onClick((event: ClickEvent) => { +// router.push({ uri: 'pages/gesturetab/GestureGroupExample' }) +// }) +// } + + + + } + + .height('100%') + .width('100%') + .align(Alignment.Top) + .borderColor(Color.Gray) + } + } +} + + + + +@Component +struct GifTab { + + build() { + Column() { + List({ space: 2, initialIndex: 0 }) { + ListItem() { + Button("属性动画", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/giftab/AttrAnimationExample' }) + }) + } + + ListItem() { + Button("显式动画", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/giftab/AnimateToExample' }) + }) + } + + ListItem() { + Button("页面转场", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/giftab/PageTransitionExample' }) + }) + } + + ListItem() { + Button("组件转场", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/giftab/TransitionExample' }) + }) + } + + ListItem() { + Button("共享元素转场", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/giftab/SharedTransitionExampleA' }) + }) + } + + ListItem() { + Button("路径动画", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/giftab/MotionPathExample' }) + }) + } + + ListItem() { + Button("形状绘画", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/giftab/ShapeExample' }) + }) + } + + ListItem() { + Button("图片裁剪", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/giftab/ClipAndMaskExample' }) + }) + } + + + } + + .height('100%') + .width('100%') + .align(Alignment.Top) + .borderColor(Color.Gray) + } + } +} + + + +@Component +struct FormArk { + + build() { + Column() { + List({ space: 2, initialIndex: 0 }) { + ListItem() { + Button("按钮", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/Button' }) + }) + } + + ListItem() { + Button("角标", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/BadgeExample' }) + }) + } + + ListItem() { + Button("滑杆", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/Slider' }) + }) + } + + ListItem() { + Button("分隔器", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/DividerExample' }) + }) + } + + ListItem() { + Button("打分", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/RatingExample' }) + }) + } + + ListItem() { + Button("弹框", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/PopupExample' }) + }) + } + + ListItem() { + Button("从下弹框", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/PanelExample' }) + }) + } + + ListItem() { + Button("增减数", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/CounterExample' }) + }) + } + + ListItem() { + Button("文本样式", { type: ButtonType.Normal, stateEffect: false }) + .width('100%').height(56).backgroundColor(0xFFFFFF) + .fontColor('rgb(0, 0, 0)') + .onClick((event: ClickEvent) => { + router.push({ uri: 'pages/TextStyleExample' }) + }) + } + + + + } + + .height('100%') + .width('100%') + .align(Alignment.Top) + .borderColor(Color.Gray) + } + } +} + + +@Component +struct GoodsHome { + private goodsItems: GoodsData[] + + build() { + Column() { + Tabs() { + TabContent() { + FormArk(); + } + .tabBar('表单') + + TabContent() { + ContainerTab(); + } + .tabBar("布局") + + TabContent() { + GifTab(); + } + .tabBar("动画") + + TabContent() { + GestureTab(); + } + .tabBar("手势") + } + .barWidth(500) + .barHeight(45) + .scrollable(true) + .barMode(BarMode.Scrollable) + .height(630) + + } + .alignItems(HorizontalAlign.Start) + .width('100%') + } +} + +@Component +struct GoodsListItem { + private goodsItem: GoodsData + + build() { + Navigator({ target: 'pages/ShoppingDetail' }) { + Row() { + Column(){ + Text(this.goodsItem.title) + .fontSize(14) + Text(this.goodsItem.content ) + .fontSize(10) + Text('¥' + this.goodsItem.price) + .fontSize(14) + .fontColor(Color.Red) + } + .height(100) + .width('50%') + .margin({left: 20}) + .alignItems(HorizontalAlign.Start) + Image(this.goodsItem.imgSrc) + .objectFit(ImageFit.ScaleDown) + .height(100) + .width('40%') + .renderMode(ImageRenderMode.Original) + .margin({right: 10,left:10}) + + } + .backgroundColor(Color.White) + + + } + .params({ goodsData: this.goodsItem }) + .margin({ right: 5}) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/MyPage.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/MyPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..da9e2b619a256899f335078097a31a990f1540af --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/MyPage.ets @@ -0,0 +1,176 @@ +import {getMenu,getTrans,getMore} from '../model/GoodsDataModels' +import {Menu, ImageItem} from '../model/Menu' +@Entry +@Component +export struct MyInfo { + + build() { + Column() { + + Text('展示harmonyos ets组件的效果。欢迎大家在github weuiets更新本代码') + .fontSize(15).padding(40) + Row(){ + Image($rawfile('nav/icon-user.png')) + .margin({left:20}) + .objectFit(ImageFit.Cover) + .height(50) + .width(50) + .renderMode(ImageRenderMode.Original) + .margin({left:40,right:40}) + Column(){ + Text('by MyIE') + .fontSize(15) + Text('Member Name : myie') + } + .height(60) + .margin({left:40,top:10}) + .alignItems(HorizontalAlign.Start) + } +// TopList() +// MyTransList() +// MoreGrid() + + } + .alignItems(HorizontalAlign.Start) + .width('100%') + .flexGrow(1) + } +} + + +@Component +struct TopList { + private menus: Menu[] = getMenu() + + build() { + Row() { + List() { + ForEach(this.menus, item => { + ListItem() { + MenuItem({ menu: item }) + } + }, item => item.id.toString()) + } + .height('100%') + .width('100%') + .margin({top: 5}) + .edgeEffect(EdgeEffect.None) + .listDirection(Axis.Horizontal) + } + .width('100%') + .height(50) + } +} + +@Component +struct MyTransList { + private imageItems: ImageItem[] = getTrans() + build() { + Column() { + Text('My Transaction') + .fontSize(20) + .margin({ left: 10 }) + .width('100%') + .height(30) + Row() { + List() { + ForEach(this.imageItems, item => { + ListItem() { + DataItem({ imageItem: item }) + } + }, item => item.id.toString()) + } + .height(70) + .width('100%') + .align(Alignment.Top) + .margin({ top: 5}) + .listDirection(Axis.Horizontal) + } + } + .height(120) + } +} + +@Component +struct MoreGrid { + private gridRowTemplate: string = '' + private imageItems: ImageItem[] = getMore() + private heightValue: number + + aboutToAppear() { + var rows = Math.round(this.imageItems.length / 3); + this.gridRowTemplate = '1fr '.repeat(rows); + this.heightValue = rows * 75 ; + } + + build() { + Column() { + Text('More') + .fontSize(20) + .margin({ left: 10 }) + .width('100%') + .height(30) + Scroll() { + Grid() { + ForEach(this.imageItems, (item: ImageItem) => { + GridItem() { + DataItem({ imageItem: item }) + } + }, (item: ImageItem) => item.id.toString()) + } + .rowsTemplate(this.gridRowTemplate) + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(8) + .rowsGap(8) + .height(this.heightValue) + } + .padding({ left: 16, right: 16 }) + } + .height(400) + } +} + + +@Component +struct DataItem { + private imageItem: ImageItem + + build() { + Column() { + Image(this.imageItem.imageSrc) + .objectFit(ImageFit.Contain) + .height(50) + .width(50) + .renderMode(ImageRenderMode.Original) + Text(this.imageItem.title) + .fontSize(15) + + + } + .height(70) + .width(80) + .margin({left: 15,right:15}) + .backgroundColor(Color.White) + } +} + +@Component +struct MenuItem { + private menu: Menu + + build() { + Column() { + Text(this.menu.title) + .fontSize(15) + Text(this.menu.num+'') + .fontSize(13) + + } + .height(50) + .width(80) + .margin({left: 8,right:8}) + .alignItems(HorizontalAlign.Start) + .backgroundColor(Color.White) + } +} + diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/PanelExample.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/PanelExample.ets new file mode 100644 index 0000000000000000000000000000000000000000..19a0c1b30e546b2fb0b80026d3e5a5aa0cbb87fc --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/PanelExample.ets @@ -0,0 +1,30 @@ +// xxx.ets +@Entry +@Component +struct PanelExample { + @State show: boolean = false + + build() { + Column() { + Text('2021-09-30 Today Calendar: 1.afternoon......Click for details') + .width('90%').height(50).borderRadius(10) + .backgroundColor(0xFFFFFF).padding({ left: 20 }) + .onClick(() => { + this.show = !this.show + }) + Panel(this.show) { // 展示日程 + Column() { + Text('Today Calendar') + Divider() + Text('1. afternoon 4:00 The project meeting') + } + } + .type(PanelType.Foldable).mode(PanelMode.Half) + .dragBar(true) // 默认开启 + .halfHeight(500) // 默认一半 + .onChange((width: number, height: number, mode: PanelMode) => { + console.info(`width:${width},height:${height},mode:${mode}`) + }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/PopupExample.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/PopupExample.ets new file mode 100644 index 0000000000000000000000000000000000000000..6969ba6aa22436650d6666e4c6aad7d222f2e9f5 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/PopupExample.ets @@ -0,0 +1,121 @@ +import prompt from '@system.prompt'; +// xxx.ets +@Entry +@Component +struct PopupExample { + @State noHandlePopup: boolean = false + @State handlePopup: boolean = false + @State customPopup: boolean = false + @State show: boolean = false + + + @Builder popupBuilder() { + Row({ space: 2 }) { + Image('/resource/ic_public_thumbsup.svg').width(24).height(24).margin({ left: -5 }) + Text('Custom Popup').fontSize(10) + }.width(100).height(50).backgroundColor(Color.White) + } + + build() { + + Column({space:20}) { + Button("提示框", { type: ButtonType.Normal, stateEffect: true }) + .backgroundColor(0x07c160) + .borderRadius(8).width(184).height(48).fontWeight(700) + .onClick((event: ClickEvent) => { + prompt.showToast({ + message: 'Checking Out', + duration: 10, + bottom:100 + }) + }) + + Button('one button dialog') + .onClick(() => { + AlertDialog.show( + { + title: 'title', + message: 'text', + confirm: { + value: 'button', + action: () => { + console.info('Button-clicking callback') + } + }, + cancel: () => { + console.info('Closed callbacks') + } + } + ) + }) + .backgroundColor(0x317aff) + Button('two button dialog') + .onClick(() => { + AlertDialog.show( + { + title: 'title', + message: 'text', + primaryButton: { + value: 'cancel', + action: () => { + console.info('Callback when the first button is clicked') + } + }, + secondaryButton: { + value: 'ok', + action: () => { + console.info('Callback when the second button is clicked') + } + }, + cancel: () => { + console.info('Closed callbacks') + } + } + ) + }).backgroundColor(0x317aff) + + + Button('no handle popup') + .onClick(() => { + this.noHandlePopup = !this.noHandlePopup + }) + .bindPopup(this.noHandlePopup, { + message: 'content1 content1', + placementOnTop: false, + onStateChange: (e) => { + console.info(e.isVisible.toString()) + if (!e.isVisible) { + this.noHandlePopup = false + } + } + }) + + Button('with handle popup') + .onClick(() => { + this.handlePopup = !this.handlePopup + }) + .bindPopup(this.handlePopup, { + message: 'content2 content2', + placementOnTop: true, + primaryButton: { + value: '确定', + action: () => { + this.handlePopup = !this.handlePopup + console.info('secondaryButton click') + } + }, + onStateChange: (e) => { + console.info(e.isVisible.toString()) + } + }) + + +// Button('custom popup') +// .onClick(() => { +// this.customPopup = !this.customPopup +// }) +// .position({ x: 100, y: 350 }) + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/RatingExample.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/RatingExample.ets new file mode 100644 index 0000000000000000000000000000000000000000..2d3d6b9d11a5b2485ed98c4e094d97d28b412856 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/RatingExample.ets @@ -0,0 +1,19 @@ +// xxx.ets +@Entry +@Component +struct RatingExample { + @State rating: number = 1 + @State indicator: boolean = false + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Text('current score is ' + this.rating).fontSize(20) + Rating({ rating: this.rating, indicator: this.indicator }) + .stars(5) + .stepSize(0.5) + .onChange((value: number) => { + this.rating = value + }) + }.width(350).height(200).padding(35) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/ShoppingCartPage.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/ShoppingCartPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..31f653886673e325c628c327ad2325a53562219d --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/ShoppingCartPage.ets @@ -0,0 +1,118 @@ +import {GoodsData} from '../model/GoodsData' +import {initializeOnStartup} from '../model/GoodsDataModels' +import prompt from '@system.prompt'; + +@Entry +@Component +export struct ShoppingCart { + @Provide totalPrice : number =0 + private goodsItems: GoodsData[] = initializeOnStartup() + build() { + Column() { + Column() { + Text('ShoppingCart') + .fontColor(Color.Black) + .fontSize(25) + .margin({ left: 60,right:60 }) + .align(Alignment.Center) + } + .backgroundColor('#FF00BFFF') + .width('100%') + .height(30) + + ShopCartList({ goodsItems: this.goodsItems }); + ShopCartBottom() + } + .alignItems(HorizontalAlign.Start) + } +} + +@Component +struct ShopCartList { + + private goodsItems: GoodsData[] + + build() { + Column() { + List() { + ForEach(this.goodsItems, item => { + ListItem() { + ShopCartListItem({ goodsItem: item }) + } + }, item => item.id.toString()) + } + .height('100%') + .width('100%') + .align(Alignment.Top) + .margin({top: 5}) + } + .height(570) + } +} + +@Component +struct ShopCartListItem { + @Consume totalPrice: number + private goodsItem: GoodsData + + build() { + Row() { +// Toggle({type: ToggleType.Checkbox}) +// .width(10) +// .height(10) +// .onChange((isOn:boolean) => { +// if(isOn){ +// this.totalPrice +=parseInt(this.goodsItem.price+'',0) +// }else{ +// this.totalPrice -= parseInt(this.goodsItem.price+'',0) +// } +// }) + Image(this.goodsItem.imgSrc) + .objectFit(ImageFit.ScaleDown) + .height(100) + .width(100) + .renderMode(ImageRenderMode.Original) + Column() { + Text(this.goodsItem.title) + .fontSize(14) + Text('¥' + this.goodsItem.price) + .fontSize(14) + .fontColor(Color.Red) + } + } + .height(100) + .width(180) + .margin({left: 20}) + .alignItems(VerticalAlign.Center) + .backgroundColor(Color.White) + } +} + +@Component +struct ShopCartBottom { + @Consume totalPrice: number + build() { + Row() { + Text('Total: ¥'+this.totalPrice) + .fontColor(Color.Red) + .fontSize(18) + .margin({left:20}) + .width(150) +// Text('Check Out') +// .fontColor(Color.Black) +// .fontSize(18) +// .margin({right:20,left:100}) +// .onClick(()=>{ +// prompt.showToast({ +// message: 'Checking Out', +// duration: 10, +// bottom:100 +// }) +// }) + } + .height(30) + .width('100%') + .backgroundColor('#FF7FFFD4') + .alignItems(VerticalAlign.Bottom) + } +} diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/ShoppingDetail.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/ShoppingDetail.ets new file mode 100644 index 0000000000000000000000000000000000000000..61ed25d270111d23bdd5b6d1436e4d1a0b0db1ed --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/ShoppingDetail.ets @@ -0,0 +1,288 @@ +import router from '@system.router'; +import {ArsData} from '../model/ArsData' +import {getArs,getDetailImages} from '../model/GoodsDataModels' +import prompt from '@system.prompt'; + +@Entry +@Component +struct ShoppingDetail { + private arsItems: ArsData[] = getArs() + private detailImages: string[] = getDetailImages() + build() { + Column() { + DetailTop() + Scroll() { + Column() { + SwiperTop() + DetailText() + DetailArsList({ arsItems: this.arsItems }) + Image($rawfile('computer/computer1.png')) + .height(220) + .width('100%') + .margin({top:30}) + Image($rawfile('computer/computer2.png')) + .height(220) + .width('100%') + .margin({top:30}) + Image($rawfile('computer/computer3.png')) + .height(220) + .width('100%') + .margin({top:30}) + Image($rawfile('computer/computer4.png')) + .height(220) + .width('100%') + .margin({top:30}) + Image($rawfile('computer/computer5.png')) + .height(220) + .width('100%') + .margin({top:30}) + Image($rawfile('computer/computer6.png')) + .height(220) + .width('100%') + .margin({top:30}) + } + .width('100%') + .flexGrow(1) + } + .scrollable(ScrollDirection.Vertical) + DetailBottom() + } + .height(630) + + + } +} + +@Component +struct DetailTop{ + build(){ + Column(){ + Row(){ + Image($rawfile('detail/icon-return.png')) + .height(20) + .width(20) + .margin({ left: 20, right: 250 }) + .onClick(() => { + router.push({ + uri: "pages/HomePage" + }) + }) + + } + .width('100%') + .height(25) + .backgroundColor('#FF87CEEB') + } + .width('100%') + .height(30) + } +} + +@Component +struct SwiperTop{ + build() { + Column() { + Swiper() { + Image($rawfile('computer/computer1.png')) + .height(220) + .width('100%') + Image($rawfile('computer/computer2.png')) + .height(220) + .width('100%') + Image($rawfile('computer/computer3.png')) + .height(220) + .width('100%') + Image($rawfile('computer/computer4.png')) + .height(220) + .width('100%') + Image($rawfile('computer/computer5.png')) + .height(220) + .width('100%') + Image($rawfile('computer/computer6.png')) + .height(220) + .width('100%') + + } + .index(0) + .autoPlay(true) + .interval(3000) + .indicator(true) + .loop(true) + .height(250) + .width('100%') + } + .height(250) + .width('100%') + } +} + +@Component +struct DetailText{ + build() { + Column() { + Row(){ + Image($rawfile('computer/icon-promotion.png')) + .height(30) + .width(30) + .margin({left:10}) + Text('Special Offer: ¥9999') + .fontColor(Color.White) + .fontSize(20) + .margin({left:10}) + + } + .width('100%') + .height(35) + .backgroundColor(Color.Red) + Column(){ + Text('New Arrival: HUAWEI MateBook X Pro 2021') + .fontSize(15) + .margin({left:10}) + .alignSelf(ItemAlign.Start) + Text('13.9-Inch, 11th Gen Intel® Core™ i7, 16 GB of Memory, 512 GB of Storage, Ultra-slim Business Laptop, 3K FullView Display, Multi-screen Collaboration, Emerald Green') + .fontSize(10) + .margin({left:10}) + Row(){ + Image($rawfile('nav/icon-buy.png')) + .height(15) + .width(15) + .margin({left:10}) + //TODO 暂不支持跑马灯组件,用Text代替 + Text('Limited offer') + .fontSize(10) + .fontColor(Color.Red) + .margin({left:100}) + + } + .backgroundColor(Color.Pink) + .width('100%') + .height(25) + .margin({top:10}) + Text(' Shipment: 2-day shipping') + .fontSize(13) + .fontColor(Color.Red) + .margin({left:10,top:5}) + .alignSelf(ItemAlign.Start) + Text(' Ship To: Hubei,Wuhan,China') + .fontSize(13) + .fontColor(Color.Red) + .margin({left:10,top:5}) + .alignSelf(ItemAlign.Start) + .onClick(()=>{ + prompt.showDialog({title:'select address',}) + + }) + Text('Guarantee: Genuine guaranteed') + .fontSize(13) + .margin({left:10,top:5}) + .alignSelf(ItemAlign.Start) + } + .height(150) + .width('100%') + } + .height(160) + .width('100%') + } +} + + +@Component +struct DetailArsList{ + private arsItems: ArsData[] + build() { + Scroll() { + Column() { + List() { + ForEach(this.arsItems, item => { + ListItem() { + ArsListItem({ arsItem: item }) + } + }, item => item.id.toString()) + } + .height('100%') + .width('100%') + .margin({ top: 5 }) + .listDirection(Axis.Vertical) + } + .height(200) + } + } +} + +@Component +struct ArsListItem { + private arsItem: ArsData + + build() { + Row() { + Text(this.arsItem.title+" :") + .fontSize(11) + .margin({left:20}) + .flexGrow(1) + Text( this.arsItem.content) + .fontSize(11) + .margin({right:20}) + + } + .height(14) + .width('100%') + .backgroundColor(Color.White) + } +} + + +@CustomDialog +struct DialogExample { + @Consume + private value : number + controller: CustomDialogController; + action: () => void; + build() { + Column() { + Progress({value: this.value++ >=100?100:this.value, total: 100, style: ProgressStyle.Eclipse}) + .height(50) + .width(100) + .margin({top:5}) + + } + .height(60) + .width(100) + + + } +} + +@Component +struct DetailBottom{ + @Provide + private value : number=1 + dialogController : CustomDialogController = new CustomDialogController({ + builder: DialogExample({action: this.onAccept}), + cancel: this.existApp, + autoCancel: true + }); + + onAccept() { + + } + existApp() { + + } + build(){ + Column(){ + Text('Buy') + .width(40) + .height(25) + .fontSize(20) + .fontColor(Color.White) + .onClick(()=>{ + this.value=1 + this.dialogController.open() + }) + } + .alignItems(HorizontalAlign.Center) + .backgroundColor(Color.Red) + .width('100%') + .height(40) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/Slider.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/Slider.ets new file mode 100644 index 0000000000000000000000000000000000000000..41717b06a48fb9a00128f9cc7dbf548550f1bf29 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/Slider.ets @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct SliderEts { + @State private speed: number = 5 + @State private imageSize: number = 1 + @State private angle: number = 0 + @State private interval: number = 0 + + @Builder DescribeText(text:string, speed: number) { + Stack() { + Text(text + speed.toFixed(1)) + .margin({ top: 30 }) + .fontSize(20) + .fontWeight(FontWeight.Bold) + } + } + + build() { + Column() { + Image($rawfile('windmill.png')) + .objectFit(ImageFit.Contain) + .height(150) + .width(150) + .margin({ top: 50, bottom: 150, right: 16 }) + .rotate({ x: 0, y: 0, z: 1, angle: this.angle }) + .scale({ x: this.imageSize, y: this.imageSize }) + + this.DescribeText('速度:', this.speed) + + Slider({ + value: this.speed, + min: 1, + max: 10, + step: 1, + style: SliderStyle.OutSet + }) + .showTips(true) + .blockColor(Color.Blue) + .onChange((value: number, mode: SliderChangeMode) => { + this.speed = value + console.log("value:" + value); + clearInterval(this.interval) + this.speedChange() + }) + + this.DescribeText('缩放比例:', this.imageSize) + + Slider({ + value: this.imageSize, + min: 0.5, + max: 2.5, + step: 0.1, + style: SliderStyle.OutSet + }) + .showTips(true) + .blockColor(Color.Blue) + .onChange((value: number, mode: SliderChangeMode) => { + this.imageSize = value + }) + } + .margin({ left: 30, right: 30 }) + } + + speedChange() { + var that = this; + that.angle = 0; + this.interval = setInterval(function () { + that.angle += that.speed + }, 15) + } + + onPageShow() { + clearInterval(this.interval) + this.speedChange() + } +} diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/TextStyleExample.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/TextStyleExample.ets new file mode 100644 index 0000000000000000000000000000000000000000..7213bef1459a4d31e4cf1b91a28469e48228503a --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/TextStyleExample.ets @@ -0,0 +1,41 @@ +// xxx.ets +@Entry +@Component +struct TextStyleExample { + build() { + Column({ space: 5 }) { + Text('default text') + + Text('text font color red') + .fontColor(Color.Red) + + Text('text font size 20') + .fontSize(20) + + Text('text font style Italic') + .fontStyle(FontStyle.Italic) + + Text('text fontWeight bold') + .fontWeight(700) + + Text('text fontFamily sans-serif') + .fontFamily('sans-serif') + + Text('red 20 Italic bold cursive text') + .fontColor(Color.Red) + .fontSize(20) + .fontStyle(FontStyle.Italic) + .fontWeight(700) + .fontFamily('cursive') + .textAlign(TextAlign.Center) + .width('90%') + + Text('Orange 18 Normal source-sans-pro text') + .fontColor(Color.Orange) + .fontSize(18) + .fontStyle(FontStyle.Normal) + .fontWeight(400) + .fontFamily('source-sans-pro,cursive,sans-serif') + }.width('100%') + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/choosePage.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/choosePage.ets new file mode 100644 index 0000000000000000000000000000000000000000..2cb5b8633ec1ca43d47b254a39c6ea7fc021be8f --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/choosePage.ets @@ -0,0 +1,16 @@ +@Entry +@Component +struct ChoosePage { + @State message: string = 'Hello World' + + build() { + Column() { +// Row() { +// Text('Bluetooth').fontSize(18) +// Blank() +// Toggle({ type: ToggleType.Switch }) +// }.width('100%').backgroundColor(0xFFFFFF).borderRadius(15).padding({ left: 12 }) + + }.backgroundColor(0xEFEFEF).padding(20) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/containertab/ColumnExample.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/containertab/ColumnExample.ets new file mode 100644 index 0000000000000000000000000000000000000000..c5a7070a98e23d20fdd842fdfa37b3ce8c2ec3d5 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/containertab/ColumnExample.ets @@ -0,0 +1,40 @@ +// xxx.ets +@Entry +@Component +struct ColumnExample { + build() { + Column() { + Text('space').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column({ space: 5 }) { + Column().width('100%').height(30).backgroundColor(0xAFEEEE) + Column().width('100%').height(30).backgroundColor(0x00FFFF) + }.width('90%').height(100).border({ width: 1 }) + + Text('alignItems(Start)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column() { + Column().width('50%').height(30).backgroundColor(0xAFEEEE) + Column().width('50%').height(30).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.Start).width('90%').border({ width: 1 }) + + Text('alignItems(End)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column() { + Column().width('50%').height(30).backgroundColor(0xAFEEEE) + Column().width('50%').height(30).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.End).width('90%').border({ width: 1 }) + + Text('justifyContent(Center)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column() { + Column().width('30%').height(30).backgroundColor(0xAFEEEE) + Column().width('30%').height(30).backgroundColor(0x00FFFF) + }.height('15%').border({ width: 1 }) +// .justifyContent(FlexAlign.Center) + + Text('justifyContent(End)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column() { + Column().width('30%').height(30).backgroundColor(0xAFEEEE) + Column().width('30%').height(30).backgroundColor(0x00FFFF) + }.height('15%').border({ width: 1 }) +// .justifyContent(FlexAlign.End) + }.width('100%').padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/containertab/ColumnSplit.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/containertab/ColumnSplit.ets new file mode 100644 index 0000000000000000000000000000000000000000..64e4bcddb67941b400196cacdd1bc1e531466a85 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/containertab/ColumnSplit.ets @@ -0,0 +1,21 @@ +// xxx.ets +@Entry +@Component +struct ColumnSplitExample { + build() { + Column(){ + Text('将子组件纵向布局,并在每个子组件之间插入一根横向的分割线。').fontSize(14).padding(20) + + Text('分割线可以拖动。').fontSize(14) + ColumnSplit() { + Text('1').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('2').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('3').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('4').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('5').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + } + .resizeable(true) + .width('90%').height('60%') + }.width('100%') + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/containertab/FlexExample3.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/containertab/FlexExample3.ets new file mode 100644 index 0000000000000000000000000000000000000000..64801484f199d36c9078eff74a6f4f6588bdba40 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/containertab/FlexExample3.ets @@ -0,0 +1,44 @@ +// Example 03 +@Component +struct JustifyContentFlex { + @Prop justifyContent : number + + build() { + Flex({ justifyContent: this.justifyContent }) { + Text('1').width('20%').height(50).backgroundColor(0xF5DEB3) + Text('2').width('20%').height(50).backgroundColor(0xD2B48C) + Text('3').width('20%').height(50).backgroundColor(0xF5DEB3) + } + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + } +} + +@Entry +@Component +struct FlexExample3 { + build() { + Column() { + Column({ space: 5 }) { + Text('justifyContent:Start').fontSize(9).fontColor(0xCCCCCC).width('90%') + JustifyContentFlex({ justifyContent: FlexAlign.Start }) + + Text('justifyContent:Center').fontSize(9).fontColor(0xCCCCCC).width('90%') + JustifyContentFlex({ justifyContent: FlexAlign.Center }) + + Text('justifyContent:End').fontSize(9).fontColor(0xCCCCCC).width('90%') + JustifyContentFlex({ justifyContent: FlexAlign.End }) + + Text('justifyContent:SpaceBetween').fontSize(9).fontColor(0xCCCCCC).width('90%') + JustifyContentFlex({ justifyContent: FlexAlign.SpaceBetween }) + + Text('justifyContent:SpaceAround').fontSize(9).fontColor(0xCCCCCC).width('90%') + JustifyContentFlex({ justifyContent: FlexAlign.SpaceAround }) + + Text('justifyContent:SpaceEvenly').fontSize(9).fontColor(0xCCCCCC).width('90%') + JustifyContentFlex({ justifyContent: FlexAlign.SpaceEvenly }) + }.width('100%').margin({ top: 5 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/containertab/GridExample.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/containertab/GridExample.ets new file mode 100644 index 0000000000000000000000000000000000000000..64f931a7c14dfb216e762591f141ebf4aad0107f --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/containertab/GridExample.ets @@ -0,0 +1,57 @@ +// xxx.ets +@Entry +@Component +struct GridExample { + @State Number: String[] = ['0', '1', '2', '3', '4'] + + build() { + Column({ space: 5 }) { + Grid() { + ForEach(this.Number, (day: string) => { + ForEach(this.Number, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height('100%') + .textAlign(TextAlign.Center) + } + }, day => day) + }, day => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid() { + ForEach(this.Number, (day: string) => { + ForEach(this.Number, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, day => day) + }, day => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/containertab/ListExample.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/containertab/ListExample.ets new file mode 100644 index 0000000000000000000000000000000000000000..c731bf383cabe1c4e95c1711dbaddc07b2902809 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/containertab/ListExample.ets @@ -0,0 +1,44 @@ +// xxx.ets +@Entry +@Component +struct ListExample { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State editFlag: boolean = false + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + }.editable(true) + }, item => item) + } + .listDirection(Axis.Vertical) // 排列方向 + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) // 每行之间的分界线 + .edgeEffect(EdgeEffect.None) // 滑动到边缘无效果 + .chainAnimation(false) // 联动特效关闭 + .onScrollIndex((firstIndex: number, lastIndex: number) => { + console.info('first' + firstIndex) + console.info('last' + lastIndex) + }) + .editMode(this.editFlag) + .onItemDelete((index: number) => { + console.info(this.arr[index] + 'Delete') + this.arr.splice(index, 1) + console.info(JSON.stringify(this.arr)) + this.editFlag = false + return true + }).width('90%') + }.width('100%') + + Button('edit list') + .onClick(() => { + this.editFlag = !this.editFlag + }).margin({ top: 5, left: 20 }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/containertab/RowExample.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/containertab/RowExample.ets new file mode 100644 index 0000000000000000000000000000000000000000..45ee0e7024d0c00479553c5430cbf0f2dc19fce0 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/containertab/RowExample.ets @@ -0,0 +1,40 @@ +// xxx.ets +@Entry +@Component +struct RowExample { + build() { + Column({ space: 5 }) { + Text('space').fontSize(9).fontColor(0xCCCCCC).width('90%') + Row({ space: 5 }) { + Row().width('30%').height(50).backgroundColor(0xAFEEEE) + Row().width('30%').height(50).backgroundColor(0x00FFFF) + }.width('90%').height(107).border({ width: 1 }) + + Text('alignItems(Top)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Row() { + Row().width('30%').height(50).backgroundColor(0xAFEEEE) + Row().width('30%').height(50).backgroundColor(0x00FFFF) + }.alignItems(VerticalAlign.Top).height('15%').border({ width: 1 }) + + Text('alignItems(Center)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Row() { + Row().width('30%').height(50).backgroundColor(0xAFEEEE) + Row().width('30%').height(50).backgroundColor(0x00FFFF) + }.alignItems(VerticalAlign.Center).height('15%').border({ width: 1 }) + + Text('justifyContent(End)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Row() { + Row().width('30%').height(50).backgroundColor(0xAFEEEE) + Row().width('30%').height(50).backgroundColor(0x00FFFF) + }.width('90%').border({ width: 1 }) +// .justifyContent(FlexAlign.End) + + Text('justifyContent(Center)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Row() { + Row().width('30%').height(50).backgroundColor(0xAFEEEE) + Row().width('30%').height(50).backgroundColor(0x00FFFF) + }.width('90%').border({ width: 1 }) +// .justifyContent(FlexAlign.Center) + }.width('100%') + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/containertab/RowSplitExample.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/containertab/RowSplitExample.ets new file mode 100644 index 0000000000000000000000000000000000000000..571b8828f64bb3c5c25e3028c335dc02fce65d91 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/containertab/RowSplitExample.ets @@ -0,0 +1,19 @@ +// xxx.ets +@Entry +@Component +struct RowSplitExample { + build() { + Column() { + Text('The second line can be dragged').fontSize(9).fontColor(0xCCCCCC).width('90%') + RowSplit() { + Text('1').width('10%').height(100).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('2').width('10%').height(100).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('3').width('10%').height(100).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('4').width('10%').height(100).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('5').width('10%').height(100).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + } + .resizeable(true) // 可拖动 + .width('90%').height(100) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/containertab/ScrollExample.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/containertab/ScrollExample.ets new file mode 100644 index 0000000000000000000000000000000000000000..5a94ca50364a6407d28598ba0984ffefcb71b01c --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/containertab/ScrollExample.ets @@ -0,0 +1,55 @@ +// xxx.ets +@Entry +@Component +struct ScrollExample { + scroller: Scroller = new Scroller() + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, item => item) + }.width('100%') + } + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(30) + .onScroll((xOffset: number, yOffset: number) => { + console.info(xOffset + ' ' + yOffset) + }) + .onScrollEdge((side: Edge) => { + console.info('To the edge') + }) + .onScrollEnd(() => { + console.info('Scroll Stop') + }) + + Button('scroll 100') + .onClick(() => { // 点击后下滑100.0距离 + this.scroller.scrollTo({ xOffset: 0, yOffset: this.scroller.currentOffset().yOffset + 100 }) + }) + .margin({ top: 10, left: 20 }) + Button('back top') + .onClick(() => { // 点击后回到顶部 + this.scroller.scrollEdge(Edge.Top) + }) + .margin({ top: 60, left: 20 }) + Button('next page') + .onClick(() => { // 点击后下滑到底部 + this.scroller.scrollPage({ next: true }) + }) + .margin({ top: 110, left: 20 }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/containertab/StackExample.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/containertab/StackExample.ets new file mode 100644 index 0000000000000000000000000000000000000000..dc3a44f01527030d7e621302d7dfc05e74d52802 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/containertab/StackExample.ets @@ -0,0 +1,11 @@ +// xxx.ets +@Entry +@Component +struct StackExample { + build() { + Stack({ alignContent: Alignment.Bottom }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(150).margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/fuc/privacy/FirstPage.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/fuc/privacy/FirstPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..f4c1d6d196d686cc5b041b495864430c6f39a6ec --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/fuc/privacy/FirstPage.ets @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import app from '@system.app' +import dataStorage from '@ohos.data.storage'; +import featureAbility from '@ohos.ability.featureAbility' + +@Entry +@Component +struct FirstPage { + dialogController: CustomDialogController = new CustomDialogController({ + builder: CustomDialogExample( + { + //由于回调函数中无法调用this,通过bind的方式将this传入回调中 + cancel: this.onCancel.bind(this), + confirm: this.onConfirm.bind(this) + }), + cancel: this.existApp, + autoCancel: false + }) + private isPrivacy: boolean + private timerId: number + + onCancel() { + // 不同意隐私协议,退出应用 + this.existApp() + } + + onConfirm() { + this.saveIsPrivacy() + this.timerId = setTimeout(function () { + router.replace({ uri: 'pages/fuc/privacy/SecondPage' }) + }, 2000); + + } + + onPageHide() { + clearTimeout(this.timerId) + } + + existApp() { + // 退出应用 + app.terminate(); + } + + aboutToAppear() { + this.getIsPrivacy().then((value) => { + let firstCome = value + this.isPrivacy = value + if (firstCome) { + this.dialogController.open() + } + + if (!firstCome) { + setTimeout(function () { + router.replace({ uri: 'pages/fuc/privacy/SecondPage' }) + }, 2000); + } + }) + } + + async saveIsPrivacy() { + var context = featureAbility.getContext() + var path = await context.getFilesDir() + let storage = dataStorage.getStorageSync(path + '/myStore') + storage.putSync("isPrivacy", "false") + storage.flushSync() + } + + async getIsPrivacy() { + var context = featureAbility.getContext() + var path = await context.getFilesDir() + let storage = dataStorage.getStorageSync(path + '/myStore') + let result = storage.getSync("isPrivacy", "true"); + this.isPrivacy = result === 'true' ? true : false + return result === 'true' ? true : false; + } + + build() { + Row() { + Column() { + Image($r("app.media.example")) + } + .width('100%') + } + .height('100%') + } +} + + +@CustomDialog +struct CustomDialogExample { + controller: CustomDialogController + cancel: () => void + confirm: () => void + @State data: string = "

h1标题

" + + "

h1斜体

" + + "

h1下划线

" + + "

h2标题

" + + "

h3标题

" + + "

p常规


" + + "
" + + "

字体大小35px,行高45px

" + + "

" + + "

这是一段文字这是一段文字这是一段文字这是一段文字这是一段文字这是一段文字这是一段文字这是一段文字这是一段文字

" + + build() { + Column() { + Text('欢迎使用我的应用').width('80%').fontSize(20).textAlign(TextAlign.Center).margin({ top: 20, bottom: 20 }) + Text('隐私协议弹框隐私协议弹框隐私协议弹框隐私协议弹框隐私协议弹框隐私协议弹框隐私协议弹框').width('80%').fontSize(16) + + Text('隐私协议弹框').width('80%').fontSize(16).fontColor(Color.Blue).onClick(() => { + router.push({ uri: 'pages/fuc/privacy/Privacy' }) + }) + + + Text('(以下简称为“本声明”)以便您了解我们如何搜集、使用、披露、保护、存储及传输您的个人数据。请您仔细阅读本声明。如您有任何疑问,请告知我们。') + .width('80%') + .fontSize(16) + .margin({ bottom: 10 }) + + + Flex({ justifyContent: FlexAlign.SpaceAround }) { + Button('不同意') + .onClick(() => { + this.controller.close() + this.cancel() + }).backgroundColor(0x317aff).fontColor(Color.White) + Button('同 意') + .onClick(() => { + this.controller.close() + this.confirm() + }).backgroundColor(0x317aff).fontColor(Color.White) + }.margin({ bottom: 10 }) + } + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/fuc/privacy/Privacy.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/fuc/privacy/Privacy.ets new file mode 100644 index 0000000000000000000000000000000000000000..e3a6c3f7957b8c21f4ac5c0c8802c705817227d0 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/fuc/privacy/Privacy.ets @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router' + +@Entry +@Component +struct privacy { + @State message: string = 'Hello World' + scroller: Scroller = new Scroller() + + build() { + Row() { + Column() { + Text('隐私政策') + .fontSize(24) + .margin({ top: 10, bottom: 10 }) + .textAlign(TextAlign.Center) + + .margin({ bottom: 10 }) + Scroll(this.scroller) { + Text('隐私协议弹隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议弹' + + '隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议' + + '隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议' + + '隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议' + + '隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐私协议隐' + ) + .fontSize(16) + .margin({ left: 20, right: 20 }) + }.scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .onScroll((xOffset: number, yOffset: number) => { + this.scroller.scrollTo({ xOffset: xOffset, yOffset: this.scroller.currentOffset().yOffset + yOffset }) + }) + + Button('返回') + .onClick(() => { + router.back() + }) + } + } + .height('100%') + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/fuc/privacy/SecondPage.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/fuc/privacy/SecondPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..45bb14443bd6227e7d344d469f5606d785aa738e --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/fuc/privacy/SecondPage.ets @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; + +@Entry +@Component +struct SecondPage { + @State jumpFlag: boolean = false + private id: number + + onPageShow() { + this.jumpFlag = false + var that = this + this.id = setTimeout(function () { + if (!that.jumpFlag) { + router.replace({ uri: 'pages/fuc/privacy/ThirdPage' }) + } + }, 3000); + } + + onPageHide() { + clearTimeout(this.id) + } + + build() { + Row() { + Column() { + Image($r('app.media.example')).onClick(() => { + this.jumpFlag = true + router.push({ uri: 'pages/fuc/privacy/WebPage', params: { source: 'ad' } }) + }) + } + .width('100%') + } + .height('100%') + } +} diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/fuc/privacy/ThirdPage.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/fuc/privacy/ThirdPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..5ca72e16a729bafbf68037022a75343141501b36 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/fuc/privacy/ThirdPage.ets @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ThirdPage { + + build() { + Row() { + Column() { + Image($r('app.media.example')) + } + .width('100%') + } + .height('100%') + } +} diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/fuc/privacy/WebPage.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/fuc/privacy/WebPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..a9a84aa77c75c5b2376ca0da4c74ae50e9d60543 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/fuc/privacy/WebPage.ets @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct WebPage { + build() { + Column() { + Image($r('app.media.example')) + }.width('100%') + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/gesturetab/GestureGroupExample.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/gesturetab/GestureGroupExample.ets new file mode 100644 index 0000000000000000000000000000000000000000..2a2a7876cf1ae2d52d993aada1100c7284d2a605 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/gesturetab/GestureGroupExample.ets @@ -0,0 +1,41 @@ +// xxx.ets +@Entry +@Component +struct GestureGroupExample { + @State count: number = 0 + @State offsetX: number = 0 + @State offsetY: number = 0 + @State borderStyles: BorderStyle = BorderStyle.Solid + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Text('sequence gesture\n' + 'LongPress onAction:' + this.count + '\nPanGesture offset:\nX: ' + this.offsetX + '\n' + 'Y: ' + this.offsetY) + }.translate({ x: this.offsetX, y: this.offsetY, z: 5 }) + .height(100).width(200).padding(10).margin(80).border({ width: 1, style: this.borderStyles }) + .gesture( + GestureGroup(GestureMode.Sequence, + LongPressGesture({ repeat: true }) + .onAction((event: GestureEvent) => { + if (event.repeat) {this.count++} + console.log('LongPress onAction') + }) + .onActionEnd(() => { + console.log('LongPress end') + }), + PanGesture({}) + .onActionStart(() => { + this.borderStyles = BorderStyle.Dashed + console.log('pan start') + }) + .onActionUpdate((event: GestureEvent) => { + this.offsetX = event.offsetX + this.offsetY = event.offsetY + console.log('pan update') + }) + ) + .onCancel(() => { + console.log('sequence gesture canceled') + }) + ) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/gesturetab/LongPressGestureExample.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/gesturetab/LongPressGestureExample.ets new file mode 100644 index 0000000000000000000000000000000000000000..460e44ee86abd5f70bd407bb241afc482cd6f3c4 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/gesturetab/LongPressGestureExample.ets @@ -0,0 +1,24 @@ +// xxx.ets +@Entry +@Component +struct LongPressGestureExample { + @State count: number = 0 + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Text('LongPress onAction:' + this.count) + } + .height(200).width(300).padding(60).border({ width:1 }).margin(30) + .gesture( + LongPressGesture({ repeat: true }) + //长按动作存在会连续触发 + .onAction((event: GestureEvent) => { + if (event.repeat) { this.count++ } + }) + //长按动作一结束触发 + .onActionEnd(() => { + this.count = 0 + }) + ) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/gesturetab/PanGestureExample.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/gesturetab/PanGestureExample.ets new file mode 100644 index 0000000000000000000000000000000000000000..b7f87cad327c4ebe591fffcf5c6ca472e03271ff --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/gesturetab/PanGestureExample.ets @@ -0,0 +1,28 @@ +// xxx.ets +@Entry +@Component +struct PanGestureExample { + @State offsetX: number = 0 + @State offsetY: number = 0 + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Text('PanGesture offset:\nX: ' + this.offsetX + '\n' + 'Y: ' + this.offsetY) + } + .height(100).width(200).padding(20).border({ width: 1 }).margin(80) + .translate({ x: this.offsetX, y: this.offsetY, z: 5 }) + .gesture( + PanGesture({}) + .onActionStart((event: GestureEvent) => { + console.info('Pan start') + }) + .onActionUpdate((event: GestureEvent) => { + this.offsetX = event.offsetX + this.offsetY = event.offsetY + }) + .onActionEnd(() => { + console.info('Pan end') + }) + ) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/gesturetab/PinchGestureExample.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/gesturetab/PinchGestureExample.ets new file mode 100644 index 0000000000000000000000000000000000000000..d184c867b87fb9323fefbdab3b9b75c65e3bf16a --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/gesturetab/PinchGestureExample.ets @@ -0,0 +1,26 @@ +// xxx.ets +@Entry +@Component +struct PinchGestureExample { + @State scaleValue: number = 1 + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { +// Text('PinchGesture scale:' + this.scale) + } + .height(100).width(200).padding(20).border({ width: 1 }).margin(80) + .scale({ x: this.scaleValue, y: this.scaleValue, z: this.scaleValue }) + .gesture( + PinchGesture() + .onActionStart((event: GestureEvent) => { + console.info('Pinch start') + }) + .onActionUpdate((event: GestureEvent) => { + this.scaleValue = event.scale + }) + .onActionEnd(() => { + console.info('Pinch end') + }) + ) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/gesturetab/RotationGestureExample.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/gesturetab/RotationGestureExample.ets new file mode 100644 index 0000000000000000000000000000000000000000..b0ac7ca182e28b48a6e2af5100ce7818be5c2bc9 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/gesturetab/RotationGestureExample.ets @@ -0,0 +1,26 @@ +// xxx.ets +@Entry +@Component +struct RotationGestureExample { + @State angle: number = 0 + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Text('RotationGesture angle:' + this.angle) + } + .height(100).width(200).padding(20).border({ width:1 }) + .margin(80).rotate({ x:1, y:2, z:3, angle: this.angle }) + .gesture( + RotationGesture() + .onActionStart((event: GestureEvent) => { + console.log('Rotation start') + }) + .onActionUpdate((event: GestureEvent) => { + this.angle = event.angle + }) + .onActionEnd(() => { + console.log('Rotation end') + }) + ) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/giftab/AnimateToExample.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/giftab/AnimateToExample.ets new file mode 100644 index 0000000000000000000000000000000000000000..5c9a1868796499b4d7d65cc71eaae67f8f36a870 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/giftab/AnimateToExample.ets @@ -0,0 +1,51 @@ +// xxx.ets +@Entry +@Component +struct AnimateToExample { + @State widthSize: number = 200 + @State heightSize: number = 100 + private flag: boolean = true + + build() { + Column() { + Button('click me') + .width(this.widthSize) + .height(this.heightSize) + .backgroundColor(0x317aff) + .onClick((event: ClickEvent) => { + // 对Button组件的宽高属性进行动画配置 + if (this.flag) { + animateTo({ + duration: 1000, // 动画时长 + tempo: 0.5, // 播放速率 + curve: Curve.EaseInOut, // 动画曲线 + delay: 200, // 动画延迟 + iterations: 1, // 播放次数 + playMode: PlayMode.Normal, // 动画模式 + onFinish: () => { + console.info('play end') + } + }, () => { + this.widthSize = 100 + this.heightSize = 50 + }) + } else { + animateTo({ + duration: 200, // 动画时长 + curve: Curve.Ease, // 动画曲线 + delay: 200, // 动画延迟 + iterations: 1, // 播放次数 + playMode: PlayMode.Normal, // 动画模式 + onFinish: () => { + console.info('play end') + } + }, () => { + this.widthSize = 200 + this.heightSize = 100 + }) + } + this.flag = !this.flag + }) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/giftab/AttrAnimationExample.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/giftab/AttrAnimationExample.ets new file mode 100644 index 0000000000000000000000000000000000000000..601b346e66269e8dfc814e37df475e406f53f97c --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/giftab/AttrAnimationExample.ets @@ -0,0 +1,32 @@ +// xxx.ets +@Entry +@Component +struct AttrAnimationExample { + @State widthSize: number = 200 + @State heightSize: number = 100 + @State flag: boolean = true + + build() { + Column() { + Button('click me') + .onClick((event: ClickEvent) => { + if (this.flag) { + this.widthSize = 100 + this.heightSize = 50 + } else { + this.widthSize = 200 + this.heightSize = 100 + } + this.flag = !this.flag + }) + .width(this.widthSize).height(this.heightSize).backgroundColor(0x317aff) + .animation({ + duration: 2000, // 动画时长 + curve: Curve.EaseOut, // 动画曲线 + delay: 500, // 动画延迟 + iterations: 1, // 播放次数 + playMode: PlayMode.Normal // 动画模式 + }) // 对Button组件的宽高属性进行动画配置 + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/giftab/ClipAndMaskExample.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/giftab/ClipAndMaskExample.ets new file mode 100644 index 0000000000000000000000000000000000000000..1cade02359e3c8e8a2ea9423d9121057d5775006 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/giftab/ClipAndMaskExample.ets @@ -0,0 +1,34 @@ +// xxx.ets +@Entry +@Component +struct ClipAndMaskExample { + + build() { + Column({ space: 5 }) { + Text('clip').fontSize(9).width('90%').fontColor(0xCCCCCC) + // 用一个280px直径的圆对图像进行裁剪 + Image($r('app.media.example')) + .clip(new Circle({ width: 80, height: 80 })) + .width('500px').height('280px') + + Row() { + Image($r('app.media.example')).width('500px').height('280px') + } + .clip(true) + .borderRadius(20) + + Text('mask').fontSize(9).width('90%').fontColor(0xCCCCCC) + // 给图像添加了一个500px*280px的遮罩 + Image($r('app.media.example')) + .mask(new Rect({ width: '500px', height: '280px' }).fill(Color.Gray)) + .width('500px').height('280px') + + // 给图像添加了一个280px*280px的圆遮罩 + Image($r('app.media.example')) + .mask(new Circle({ width: '280px', height: '280px' }).fill(Color.Gray)) + .width('500px').height('281px') + } + .width('100%') + .margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/giftab/MotionPathExample.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/giftab/MotionPathExample.ets new file mode 100644 index 0000000000000000000000000000000000000000..f672df813fd6312ed84f7374e7e2bc87acde95d2 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/giftab/MotionPathExample.ets @@ -0,0 +1,20 @@ +// xxx.ets +@Entry +@Component +struct MotionPathExample { + @State offsetX: number = 0 + @State offsetY: number = 0 + @State toggle: boolean = true + + build() { + Column() { + Button('click me') + .motionPath({ path: 'Mstart.x start.y L300 200 L300 500 Lend.x end.y', from: 0.0, to: 1.0, rotatable: true }) + .onClick((event: ClickEvent) => { + animateTo({ duration: 4000, curve: Curve.Linear }, () => { + this.toggle = !this.toggle; + }) + }).backgroundColor(0x317aff) + }.width('100%').height('100%').alignItems(this.toggle ? HorizontalAlign.Start : HorizontalAlign.Center).padding(40) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/giftab/PageTransitionExample.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/giftab/PageTransitionExample.ets new file mode 100644 index 0000000000000000000000000000000000000000..063a63f5fcda5eebf3d114ad1b3ead0f49c2f370 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/giftab/PageTransitionExample.ets @@ -0,0 +1,24 @@ +// index.ets +@Entry +@Component +struct PageTransitionExample { + @State scale1: number = 1 + @State opacity1: number = 1 + + build() { + Column() { + Navigator({ target: 'pages/HomePage', type: NavigationType.Push }) { + Image($r('app.media.dino')).width("100%").height("100%") + } + }.scale({ x: this.scale1 }).opacity(this.opacity1) + } + + // 自定义方式2:使用系统提供的多种默认效果(平移、缩放、透明度等) + pageTransition() { + PageTransitionEnter({ duration: 1200 }) + .slide(SlideEffect.Left) + PageTransitionExit({ delay: 100 }) + .translate({ x: 100.0, y: 100.0 }) + .opacity(0) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/giftab/ShapeExample.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/giftab/ShapeExample.ets new file mode 100644 index 0000000000000000000000000000000000000000..3098d1144bc2b159a5efc5f9d18cb337703b230c --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/giftab/ShapeExample.ets @@ -0,0 +1,60 @@ +// xxx.ets +@Entry +@Component +struct ShapeExample { + build() { + Column({ space: 5 }) { + Text('basic').fontSize(30).fontColor(0xCCCCCC).width(320) + // 在Shape的(-2, -2)点绘制一个 300 * 50 带边框的矩形,颜色0x317Af7,边框颜色黑色,边框宽度4,边框间隙20,向左偏移10,尖端样式圆角,拐角样式圆角,抗锯齿(默认开启) + // 在Shape的(-2, 58)点绘制一个 300 * 50 带边框的椭圆,颜色0x317Af7,边框颜色黑色,边框宽度4,边框间隙20,向左偏移10,尖端样式圆角,拐角样式圆角,抗锯齿(默认开启) + // 在Shape的(-2, 118)点绘制一个 300 * 10 线段,颜色0x317Af7,边框颜色黑色,宽度4,间隙20,向左偏移10,尖端样式圆角,拐角样式圆角,抗锯齿(默认开启) + Shape() { + Rect().width(300).height(50) + Ellipse().width(300).height(50).offset({ x: 0, y: 60 }) + Path().width(300).height(10).commands('M0 0 L900 0').offset({ x: 0, y: 120 }) + } + .viewPort({ x: -2, y: -2, width: 304, height: 130 }) + .fill(0x317Af7).stroke(Color.Black).strokeWidth(4) + .strokeDashArray([20]).strokeDashOffset(10).strokeLineCap(LineCapStyle.Round) + .strokeLineJoin(LineJoinStyle.Round).antiAlias(true) + // 在Shape的(-1, -1)点绘制一个 300 * 50 带边框的矩形,颜色0x317Af7,边框颜色黑色,边框宽度2 + Shape() { + Rect().width(300).height(50) + }.viewPort({ x: -1, y: -1, width: 302, height: 52 }).fill(0x317Af7).stroke(Color.Black).strokeWidth(2) + + Text('border').fontSize(30).fontColor(0xCCCCCC).width(320).margin({top:30}) + // 在Shape的(0, -5)点绘制一个 300 * 10 直线,颜色0xEE8443,边框宽度10,边框间隙20 + Shape() { + Path().width(300).height(10).commands('M0 0 L900 0') + }.viewPort({ x: 0, y: -5, width: 300, height: 20 }).stroke(0xEE8443).strokeWidth(10).strokeDashArray([20]) + // 在Shape的(0, -5)点绘制一个 300 * 10 直线,颜色0xEE8443,边框宽度10,边框间隙20,向左偏移10 + Shape() { + Path().width(300).height(10).commands('M0 0 L900 0') + } + .viewPort({ x: 0, y: -5, width: 300, height: 20 }) + .stroke(0xEE8443).strokeWidth(10).strokeDashArray([20]).strokeDashOffset(10) + // 在Shape的(0, -5)点绘制一个 300 * 10 直线,颜色0xEE8443,边框宽度10,透明度0.5 + Shape() { + Path().width(300).height(10).commands('M0 0 L900 0') + }.viewPort({ x: 0, y: -5, width: 300, height: 20 }).stroke(0xEE8443).strokeWidth(10).strokeOpacity(0.5) + // 在Shape的(0, -5)点绘制一个 300 * 10 直线,颜色0xEE8443,边框宽度10,边框间隙20,向左偏移10,尖端样式圆角 + Shape() { + Path().width(300).height(10).commands('M0 0 L900 0') + } + .viewPort({ x: 0, y: -5, width: 300, height: 20 }) + .stroke(0xEE8443).strokeWidth(10).strokeDashArray([20]).strokeLineCap(LineCapStyle.Round) + // 在Shape的(-5, -5)点绘制一个 300 * 50 带边框的矩形,颜色0x317Af7,边框宽度10,边框颜色0xEE8443,拐角样式圆角 + Shape() { + Rect().width(300).height(100) + } + .viewPort({ x: -5, y: -5, width: 310, height: 120 }) + .fill(0x317Af7).stroke(0xEE8443).strokeWidth(10).strokeLineJoin(LineJoinStyle.Round) + Shape() { + Path().width(300).height(60).commands('M0 0 L400 0 L400 200 Z') + } + .viewPort({ x: -80, y: -5, width: 310, height: 100 }) + .fill(0x317Af7).stroke(0xEE8443).strokeWidth(10) + .strokeLineJoin(LineJoinStyle.Miter).strokeMiterLimit(5) + }.width('100%').margin({ top: 15 }) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/giftab/SharedTransitionExampleA.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/giftab/SharedTransitionExampleA.ets new file mode 100644 index 0000000000000000000000000000000000000000..f23c8a44d7075cf09a087fae5c5b0be6157a7d3d --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/giftab/SharedTransitionExampleA.ets @@ -0,0 +1,29 @@ +// xxx.ets +@Entry +@Component +struct SharedTransitionExampleA { + @State active: boolean = false + + build() { + List() { + + ListItem() { + Text("页面A").fontSize(30) + } + + ListItem() { + Row() { + Navigator({ target: 'pages/giftab/SharedTransitionExampleB', type: NavigationType.Push }) { + Image($r('app.media.dino')).width(50).height(50) + .sharedTransition('sharedImage1', { duration: 800, curve: Curve.Linear, delay: 100 }) + }.padding({ left: 10 }) + .onClick(() => { + this.active = true + }) + + Text('SharedTransition').width(80).height(80).textAlign(TextAlign.Center) + } + } + } + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/giftab/SharedTransitionExampleB.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/giftab/SharedTransitionExampleB.ets new file mode 100644 index 0000000000000000000000000000000000000000..544e97d19567d02e070cf3bc962a8bc82c372077 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/giftab/SharedTransitionExampleB.ets @@ -0,0 +1,17 @@ +@Entry +@Component +struct SharedTransitionExampleB { + + build() { + Column(){ + Text("页面B").fontSize(30) + + Stack() { + Image($r('app.media.dino')).width(150).height(150).sharedTransition('sharedImage1') + }.width('100%').height(400) + + } + + + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/giftab/TransitionExample.ets b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/giftab/TransitionExample.ets new file mode 100644 index 0000000000000000000000000000000000000000..3291824f1a1a838432207fd7eb39cf375caedfbd --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/ets/default/pages/giftab/TransitionExample.ets @@ -0,0 +1,29 @@ +// xxx.ets +@Entry +@Component +struct TransitionExample { + @State btn1: boolean = false + @State show: string = "show" + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,}) { + Button(this.show).width(80).height(30).backgroundColor(0x317aff).margin({bottom:50}) + .onClick(() => { + animateTo({ duration: 1000 }, () => { + this.btn1 = !this.btn1 + if(this.btn1){ + this.show = "hide" + }else{ + this.show = "show" + } + }) + }) + if (this.btn1) { + // 插入和删除配置为不同的过渡效果 + Button() { + Image($r('app.media.dino')).width("80%").height(300) + }.transition({ type: TransitionType.Insert, scale : {x:0,y:1.0} }) + .transition({ type: TransitionType.Delete, scale: { x: 1.0, y: 0.0 } }) + } + }.height(400).width("100%").padding({top:100}) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/java/com/huawei/shoppingdemoets/MainAbility.java b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/java/com/huawei/shoppingdemoets/MainAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..f9a2d531a49316eaf76aae2b89fff8c90d9a31ec --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/java/com/huawei/shoppingdemoets/MainAbility.java @@ -0,0 +1,19 @@ +package com.huawei.shoppingdemoets; + +import ohos.aafwk.content.Intent; +import ohos.ace.ability.AceAbility; + +/** + * MainAbility + */ +public class MainAbility extends AceAbility { + @Override + public void onStart(Intent intent) { + super.onStart(intent); + } + + @Override + public void onStop() { + super.onStop(); + } +} diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/java/com/huawei/shoppingdemoets/MyApplication.java b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/java/com/huawei/shoppingdemoets/MyApplication.java new file mode 100644 index 0000000000000000000000000000000000000000..286d83c4bd0e607cd5b4332c4a577791403a398b --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/java/com/huawei/shoppingdemoets/MyApplication.java @@ -0,0 +1,13 @@ +package com.huawei.shoppingdemoets; + +import ohos.aafwk.ability.AbilityPackage; + +/** + * MyApplication + */ +public class MyApplication extends AbilityPackage { + @Override + public void onInitialize() { + super.onInitialize(); + } +} diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/base/element/string.json b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1045e2ba3747e051a384997b81f4ca857b526f6f --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "WeuiEts" + }, + { + "name": "mainability_description", + "value": "weui风格的ets组件展示" + } + ] +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/base/media/dino.jpeg b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/base/media/dino.jpeg new file mode 100755 index 0000000000000000000000000000000000000000..14954e7eb42a911610e300bece1f8cd31997e3a8 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/base/media/dino.jpeg differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/base/media/example.jpg b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/base/media/example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f225534d65edc314225b2092d0283c6c94516b29 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/base/media/example.jpg differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/base/media/flower4.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/base/media/flower4.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/base/media/flower4.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/base/media/icon.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..23a2860e80f1743db8230b4749fb3386ecbdfaea Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/base/media/icon.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/computer1.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/computer1.png new file mode 100644 index 0000000000000000000000000000000000000000..3f780ef292cc5431d624ab80a491662532863d10 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/computer1.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/computer2.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/computer2.png new file mode 100644 index 0000000000000000000000000000000000000000..b034531da2ea5368e46446142fa0b48b4f02d99e Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/computer2.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/computer3.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/computer3.png new file mode 100644 index 0000000000000000000000000000000000000000..a85a6d3eca9208e21685fe56d58949a3ab90dbb6 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/computer3.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/computer4.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/computer4.png new file mode 100644 index 0000000000000000000000000000000000000000..7a6f195d7495a7a8201d6cf4c70e3eca097b4293 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/computer4.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/computer5.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/computer5.png new file mode 100644 index 0000000000000000000000000000000000000000..056d5ba0d2d283cb9db695c1528f4123abee68e6 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/computer5.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/computer6.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/computer6.png new file mode 100644 index 0000000000000000000000000000000000000000..056d5ba0d2d283cb9db695c1528f4123abee68e6 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/computer6.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/computer7.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/computer7.png new file mode 100644 index 0000000000000000000000000000000000000000..277e8c45a028d94129ecd6cd0eb03f05666b2101 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/computer7.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/computer8.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/computer8.png new file mode 100644 index 0000000000000000000000000000000000000000..75e52ff4c009564f3603ebe833b00498bd6bae02 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/computer8.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/icon-buy.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/icon-buy.png new file mode 100644 index 0000000000000000000000000000000000000000..6e81aff9bf1cc0694da7aa400212dd2501a0ddd3 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/icon-buy.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/icon-close.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/icon-close.png new file mode 100644 index 0000000000000000000000000000000000000000..69e0228930c3cbcc75e4cfe4b04bbcf1c4f793d1 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/icon-close.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/icon-pin.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/icon-pin.png new file mode 100644 index 0000000000000000000000000000000000000000..d82f70e7b6b28f08e9222f622bec6626fe72274b Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/icon-pin.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/icon-promotion.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/icon-promotion.png new file mode 100644 index 0000000000000000000000000000000000000000..dc81730ac0aace6bfe3aa29bd9cd1de4d873cff2 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/icon-promotion.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/icon-return1.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/icon-return1.png new file mode 100644 index 0000000000000000000000000000000000000000..21ef5b27d9b5c88991bfbbce66cf71fa783e6525 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/computer/icon-return1.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/detail/icon-more.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/detail/icon-more.png new file mode 100644 index 0000000000000000000000000000000000000000..a137fb3a56ebd52a7f1ae2bad7ecf3b5a64fad5b Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/detail/icon-more.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/detail/icon-return.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/detail/icon-return.png new file mode 100644 index 0000000000000000000000000000000000000000..7731718a55294ff7b8c5a852204675290cd86814 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/detail/icon-return.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/detail/icon-share.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/detail/icon-share.png new file mode 100644 index 0000000000000000000000000000000000000000..0d4c416922487483e99aef7081744dc54281e39c Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/detail/icon-share.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-buy.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-buy.png new file mode 100644 index 0000000000000000000000000000000000000000..8b62376d709e0459a442a91ff86f1f421c0e114e Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-buy.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-home.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-home.png new file mode 100644 index 0000000000000000000000000000000000000000..bb23b007555809e7b72af6edc7408514ece959e1 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-home.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-menu-buy.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-menu-buy.png new file mode 100644 index 0000000000000000000000000000000000000000..3110e637f77f48b238c163a86d4d46611e4dac80 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-menu-buy.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-menu-release.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-menu-release.png new file mode 100644 index 0000000000000000000000000000000000000000..b8e36aac6d4255ccef708a0f1e35e5de41114326 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-menu-release.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-menu-sell.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-menu-sell.png new file mode 100644 index 0000000000000000000000000000000000000000..e76c9ae6756fca5c51e6feea66d14386fa85d2d9 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-menu-sell.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-message-select.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-message-select.png new file mode 100644 index 0000000000000000000000000000000000000000..ccb928d92338f6717860182b0baeba5e670520f4 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-message-select.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-message.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-message.png new file mode 100644 index 0000000000000000000000000000000000000000..4d330b42415639fce3966594ed47eb75662859d2 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-message.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-my-select.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-my-select.png new file mode 100644 index 0000000000000000000000000000000000000000..4106e5e27443c7f023c61458c43eefa0eca40280 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-my-select.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-my.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-my.png new file mode 100644 index 0000000000000000000000000000000000000000..327a90d295d89f5222ca97072e3de8036e9a7f52 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-my.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-shopping-cart-select.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-shopping-cart-select.png new file mode 100644 index 0000000000000000000000000000000000000000..0e24df117362ed8337ebf8a30d57176dd35783c9 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-shopping-cart-select.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-shopping-cart.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-shopping-cart.png new file mode 100644 index 0000000000000000000000000000000000000000..c995e8fc6d25029ee27f0760585bc403861dade5 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-shopping-cart.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-user.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-user.png new file mode 100644 index 0000000000000000000000000000000000000000..873b52f9560c98347ccce32263f8add0250fc410 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/nav/icon-user.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (1).png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (1).png new file mode 100644 index 0000000000000000000000000000000000000000..c14053233a161826197f2b1bb5ba26f4af1fe33c Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (1).png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (10).png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (10).png new file mode 100644 index 0000000000000000000000000000000000000000..e9a41a3dd1b8b4fc51911ae266177d4ba02edfca Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (10).png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (11).png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (11).png new file mode 100644 index 0000000000000000000000000000000000000000..a1312a7a8dd7bafa42294bb447901f9b87b168ce Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (11).png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (12).png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (12).png new file mode 100644 index 0000000000000000000000000000000000000000..d2e6cdf28f410e51e39b9522e684afc3182ef27d Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (12).png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (13).png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (13).png new file mode 100644 index 0000000000000000000000000000000000000000..6f31d0e62d52f2984e3860560f8bfbdb99e06709 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (13).png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (14).png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (14).png new file mode 100644 index 0000000000000000000000000000000000000000..17d17b8640d5f5256ea32f72795c1851767c45f0 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (14).png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (15).png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (15).png new file mode 100644 index 0000000000000000000000000000000000000000..7fe532991dc7e8683bde1e765c3e0676fe5edc3b Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (15).png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (2).png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (2).png new file mode 100644 index 0000000000000000000000000000000000000000..d3051e228bc7be3df44f1e1adbd1adf9f8d0bc4a Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (2).png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (3).png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (3).png new file mode 100644 index 0000000000000000000000000000000000000000..3ef9053332df6ea36303113f06cab828632b54a2 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (3).png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (4).png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (4).png new file mode 100644 index 0000000000000000000000000000000000000000..45bf20d16a268649345bc964b68948d1b262d626 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (4).png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (5).png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (5).png new file mode 100644 index 0000000000000000000000000000000000000000..849dec3b281c1a72b49e3fc7f180f6bc870fd74d Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (5).png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (6).png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (6).png new file mode 100644 index 0000000000000000000000000000000000000000..78deb42f96210c86483ec9feb1d8550064a63ee1 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (6).png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (7).png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (7).png new file mode 100644 index 0000000000000000000000000000000000000000..a47fec66f35167ff0f53a50839a582fb102357c5 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (7).png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (8).png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (8).png new file mode 100644 index 0000000000000000000000000000000000000000..417a04a54bbf47fe383073c7e90b77630b50bbb7 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (8).png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (9).png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (9).png new file mode 100644 index 0000000000000000000000000000000000000000..20c5239a9e4c42fcc4ab3d9b4d32f04b7bd4376e Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/picture/HW (9).png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/windmill.png b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/windmill.png new file mode 100644 index 0000000000000000000000000000000000000000..9e6e0cfffaffaa4d2396c2752bf615fe7e55d461 Binary files /dev/null and b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/entry/src/main/resources/rawfile/windmill.png differ diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/gradle/wrapper/gradle-wrapper.properties b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000000000000000000000000000000000..6765baae6fe2db95c1c4d20412f81214ba8b21e4 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Mon Sep 26 15:19:18 CST 2022 +distributionBase=GRADLE_USER_HOME +distributionUrl=https\://repo.huaweicloud.com/gradle/gradle-7.3-bin.zip +distributionPath=wrapper/dists +zipStorePath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME diff --git a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/settings.gradle b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/settings.gradle new file mode 100644 index 0000000000000000000000000000000000000000..4773db73233a570c2d0c01a22e75321acfbf7a07 --- /dev/null +++ b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/settings.gradle @@ -0,0 +1 @@ +include ':entry' diff --git "a/2022_ArkUI_Bootcamp/fengforky+WeuiEts/\350\247\206\351\242\221\346\274\224\347\244\272.mp4" "b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/\350\247\206\351\242\221\346\274\224\347\244\272.mp4" new file mode 100644 index 0000000000000000000000000000000000000000..fd1c564e8198dbad8af39325512855737eac5b65 Binary files /dev/null and "b/2022_ArkUI_Bootcamp/fengforky+WeuiEts/\350\247\206\351\242\221\346\274\224\347\244\272.mp4" differ