From f83e4ae029b5a0e67ca89c088ff42301de0972c0 Mon Sep 17 00:00:00 2001 From: hdw Date: Fri, 13 Jun 2025 16:26:45 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat=EF=BC=9A=E4=BF=AE=E6=94=B9readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.en.md | 6 +++--- README.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.en.md b/README.en.md index c2f46ce..3204a70 100644 --- a/README.en.md +++ b/README.en.md @@ -46,8 +46,8 @@ Ensure that these permissions are added in the **module.json5** file. 1. The sample is only supported on Huawei phones with standard systems. -2. The HarmonyOS version must be HarmonyOS 5.0.0 Release or later. +2. The HarmonyOS version must be HarmonyOS 5.0.4 Release or later. -3. The DevEco Studio version must be DevEco Studio 5.0.0 Release or later. +3. The DevEco Studio version must be DevEco Studio 5.0.4 Release or later. -4. The HarmonyOS SDK version must be HarmonyOS 5.0.0 Release SDK or later. \ No newline at end of file +4. The HarmonyOS SDK version must be HarmonyOS 5.0.4 Release SDK or later. \ No newline at end of file diff --git a/README.md b/README.md index 753a728..689da57 100644 --- a/README.md +++ b/README.md @@ -46,8 +46,8 @@ 1.本示例仅支持标准系统上运行,支持设备:华为手机。 -2.HarmonyOS系统:HarmonyOS 5.0.0 Release及以上。 +2.HarmonyOS系统:HarmonyOS 5.0.4 Release及以上。 -3.DevEco Studio版本:DevEco Studio 5.0.0 Release及以上。 +3.DevEco Studio版本:DevEco Studio 5.0.4 Release及以上。 -4.HarmonyOS SDK版本:HarmonyOS 5.0.0 Release SDK及以上。 \ No newline at end of file +4.HarmonyOS SDK版本:HarmonyOS 5.0.4 Release SDK及以上。 \ No newline at end of file -- Gitee From 5fedeae22355c7bff67c0fd2279de7bba747ae24 Mon Sep 17 00:00:00 2001 From: hdw Date: Fri, 13 Jun 2025 16:38:05 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat=EF=BC=9A=20=E4=BF=AE=E6=94=B9=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/pages/Index.ets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index fcf3585..2d7e216 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -149,7 +149,7 @@ struct Index { }) .margin({ bottom: '12' }) - Navigation() { + NavRouter() { Button($r('app.string.tab3')) .width(328) .height(40) -- Gitee From 6edf5d3f80256c90ad402ede3a33420929c38b13 Mon Sep 17 00:00:00 2001 From: hdw Date: Fri, 13 Jun 2025 17:17:05 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat=EF=BC=9A=E4=BF=AE=E6=94=B9=E5=BA=9F?= =?UTF-8?q?=E5=BC=83api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/pages/Index.ets | 29 ++++++----- entry/src/main/ets/view/File.ets | 79 ++++++++++++++++-------------- 2 files changed, 59 insertions(+), 49 deletions(-) diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index 2d7e216..69a62dc 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -25,6 +25,7 @@ import Logger from '../common/Logger'; @Entry @Component struct Index { + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack(); private dataPreferences: preferences.Preferences | null = null; private kvManager: distributedKVStore.KVManager | undefined = undefined; private context = this.getUIContext().getHostContext()! @@ -41,8 +42,15 @@ struct Index { }.alignItems(HorizontalAlign.Start) } + @Builder + PageMap(name: string) { + if (name === 'fileList') { + File() + } + } + build() { - Navigation() { + Navigation(this.pageInfos) { Column() { Button($r('app.string.tab2')) .width(328) @@ -149,23 +157,20 @@ struct Index { }) .margin({ bottom: '12' }) - NavRouter() { - Button($r('app.string.tab3')) - .width(328) - .height(40) - .margin({ bottom: '16' }) + Button($r('app.string.tab3')) + .width(328) + .height(40) + .margin({ bottom: '16' }) + .onClick(() => { + this.pageInfos.pushPathByName('fileList', null); + }) - NavDestination() { - Flex({ direction: FlexDirection.Row }) { - File(); - } - }.title(this.getUIContext().getHostContext()!.resourceManager.getStringSync($r('app.string.tab3'))) - } } .justifyContent(FlexAlign.End) .width('100%') .height('100%') } + .navDestination(this.PageMap) .title(this.NavigationTitle) .titleMode(NavigationTitleMode.Full) } diff --git a/entry/src/main/ets/view/File.ets b/entry/src/main/ets/view/File.ets index a85d0ef..10455e6 100644 --- a/entry/src/main/ets/view/File.ets +++ b/entry/src/main/ets/view/File.ets @@ -92,50 +92,55 @@ export struct File { } build() { - Column({ space: 12 }) { - Text($r('app.string.txt1')) - .width('100%') - .padding({ left: '16', top: '8' }) - .fontWeight(FontWeight.Medium) - .fontSize(18) + NavDestination() { + Flex({ direction: FlexDirection.Row }) { + Column({ space: 12 }) { + Text($r('app.string.txt1')) + .width('100%') + .padding({ left: '16', top: '8' }) + .fontWeight(FontWeight.Medium) + .fontSize(18) - TextArea({ text: this.fileList }) - .textAlign(TextAlign.Start) - .margin({ left: '16', right: '16' }) + TextArea({ text: this.fileList }) + .textAlign(TextAlign.Start) + .margin({ left: '16', right: '16' }) - Text($r('app.string.txt2')) - .textAlign(TextAlign.Start) - .width('100%') - .padding({ left: '16' }) - .fontWeight(FontWeight.Medium) - .fontSize(18) + Text($r('app.string.txt2')) + .textAlign(TextAlign.Start) + .width('100%') + .padding({ left: '16' }) + .fontWeight(FontWeight.Medium) + .fontSize(18) - TextArea({ text: this.preferenceList }) - .textAlign(TextAlign.Start) - .margin({ left: '16', right: '16' }) + TextArea({ text: this.preferenceList }) + .textAlign(TextAlign.Start) + .margin({ left: '16', right: '16' }) - Text($r('app.string.txt3')) - .textAlign(TextAlign.Start) - .width('100%') - .padding({ left: '16' }) - .fontWeight(FontWeight.Medium) - .fontSize(18) + Text($r('app.string.txt3')) + .textAlign(TextAlign.Start) + .width('100%') + .padding({ left: '16' }) + .fontWeight(FontWeight.Medium) + .fontSize(18) - TextArea({ text: this.rdbList }) - .textAlign(TextAlign.Start) - .margin({ left: '16', right: '16' }) + TextArea({ text: this.rdbList }) + .textAlign(TextAlign.Start) + .margin({ left: '16', right: '16' }) - Text($r('app.string.txt4')) - .textAlign(TextAlign.Start) - .width('100%') - .padding({ left: '16' }) - .fontWeight(FontWeight.Medium) - .fontSize(18) + Text($r('app.string.txt4')) + .textAlign(TextAlign.Start) + .width('100%') + .padding({ left: '16' }) + .fontWeight(FontWeight.Medium) + .fontSize(18) - TextArea({ text: this.kvStoreList }) - .textAlign(TextAlign.Start) - .margin({ left: '16', right: '16' }) - .enableAutoFill(true) + TextArea({ text: this.kvStoreList }) + .textAlign(TextAlign.Start) + .margin({ left: '16', right: '16' }) + .enableAutoFill(true) + } + } } + .title(this.getUIContext().getHostContext()!.resourceManager.getStringSync($r('app.string.tab3'))) } } \ No newline at end of file -- Gitee