From 02852b57be47497eaaab74991ef5240ba6c0f225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E5=8D=93=E4=BC=A6?= <2658469835@qq.com> Date: Thu, 8 May 2025 11:43:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E5=BA=9F=E5=BC=83?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3,=E5=8D=87=E7=BA=A7api(16)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build-profile.json5 | 18 ++++++++++++++++-- .../src/main/ets/graphics3d/ContainerPage.ets | 2 +- entry/src/main/ets/graphics3d/NodeBase.ets | 2 +- entry/src/main/ets/graphics3d/NodeCamera.ets | 2 +- entry/src/main/ets/graphics3d/NodeLight.ets | 2 +- .../src/main/ets/graphics3d/SceneAnimation.ets | 4 ++-- .../main/ets/graphics3d/SceneEnvironment.ets | 2 +- entry/src/main/ets/graphics3d/SceneShader.ets | 4 ++-- entry/src/main/ets/pages/Index.ets | 2 +- 9 files changed, 26 insertions(+), 12 deletions(-) diff --git a/build-profile.json5 b/build-profile.json5 index e3d955d..394bb00 100644 --- a/build-profile.json5 +++ b/build-profile.json5 @@ -1,11 +1,25 @@ { "app": { - "signingConfigs": [], + "signingConfigs": [ + { + "name": "default", + "type": "HarmonyOS", + "material": { + "certpath": "C:\\Users\\Admin\\.ohos\\config\\default_Graphics3D_jsqht8w2G3CqJCUgdYO_evm9AqgvCZ7f-OE1b0loEfs=.cer", + "keyAlias": "debugKey", + "keyPassword": "0000001BC76A9BC13E4A8CCBEBFE1556655D50D3479E437BFD44A2CE98208467E824B5067AABE8266A7587", + "profile": "C:\\Users\\Admin\\.ohos\\config\\default_Graphics3D_jsqht8w2G3CqJCUgdYO_evm9AqgvCZ7f-OE1b0loEfs=.p7b", + "signAlg": "SHA256withECDSA", + "storeFile": "C:\\Users\\Admin\\.ohos\\config\\default_Graphics3D_jsqht8w2G3CqJCUgdYO_evm9AqgvCZ7f-OE1b0loEfs=.p12", + "storePassword": "0000001BFB069D8812E4B2B640C196DA5F804AB04795DE1E8610E6C478CF2551C5E98814C0A2FEF9136ADC" + } + } + ], "products": [ { "name": "default", "signingConfig": "default", - "compatibleSdkVersion": '5.0.0(12)', + "compatibleSdkVersion": '5.0.4(16)', "runtimeOS": "HarmonyOS" } ] diff --git a/entry/src/main/ets/graphics3d/ContainerPage.ets b/entry/src/main/ets/graphics3d/ContainerPage.ets index ad83443..d6c5374 100644 --- a/entry/src/main/ets/graphics3d/ContainerPage.ets +++ b/entry/src/main/ets/graphics3d/ContainerPage.ets @@ -160,7 +160,7 @@ struct ContainerPage { Button($r('app.string.back')) .onClick(() => { - router.back(); + this.getUIContext().getRouter().back(); }) .width(Constants.FULL_PERCENT) } diff --git a/entry/src/main/ets/graphics3d/NodeBase.ets b/entry/src/main/ets/graphics3d/NodeBase.ets index da4aa11..54eb27f 100644 --- a/entry/src/main/ets/graphics3d/NodeBase.ets +++ b/entry/src/main/ets/graphics3d/NodeBase.ets @@ -242,7 +242,7 @@ struct NodeBase { if (this.scene) { this.scene.destroy(); } - router.back(); + this.getUIContext().getRouter().back(); }) .width(Constants.FULL_PERCENT) } diff --git a/entry/src/main/ets/graphics3d/NodeCamera.ets b/entry/src/main/ets/graphics3d/NodeCamera.ets index 8e04065..a18d2f8 100644 --- a/entry/src/main/ets/graphics3d/NodeCamera.ets +++ b/entry/src/main/ets/graphics3d/NodeCamera.ets @@ -265,7 +265,7 @@ struct NodeCamera { Button($r('app.string.back')) .onClick(() => { - router.back(); + this.getUIContext().getRouter().back(); }) .width(Constants.FULL_PERCENT) } diff --git a/entry/src/main/ets/graphics3d/NodeLight.ets b/entry/src/main/ets/graphics3d/NodeLight.ets index 09bde06..d8bc355 100644 --- a/entry/src/main/ets/graphics3d/NodeLight.ets +++ b/entry/src/main/ets/graphics3d/NodeLight.ets @@ -197,7 +197,7 @@ struct NodeLight { Button($r('app.string.back')) .onClick(() => { - router.back(); + this.getUIContext().getRouter().back(); }) .width(Constants.FULL_PERCENT) } diff --git a/entry/src/main/ets/graphics3d/SceneAnimation.ets b/entry/src/main/ets/graphics3d/SceneAnimation.ets index 8d5eea3..8e48d98 100644 --- a/entry/src/main/ets/graphics3d/SceneAnimation.ets +++ b/entry/src/main/ets/graphics3d/SceneAnimation.ets @@ -46,7 +46,7 @@ struct SceneAnimation { } init(): void { - this.backAnimator = Animator.create(Constants.ANIMATION_OPTION); + this.backAnimator = this.getUIContext().createAnimator(Constants.ANIMATION_OPTION); this.backAnimator.onFrame = () => { if (this.scene?.animations[0]) { this.animationEnabled = this.scene.animations[0].enabled; @@ -194,7 +194,7 @@ struct SceneAnimation { Button($r('app.string.back')) .onClick(() => { - router.back(); + this.getUIContext().getRouter().back(); }) .width(Constants.FULL_PERCENT) } diff --git a/entry/src/main/ets/graphics3d/SceneEnvironment.ets b/entry/src/main/ets/graphics3d/SceneEnvironment.ets index 3b09177..1cb3c62 100644 --- a/entry/src/main/ets/graphics3d/SceneEnvironment.ets +++ b/entry/src/main/ets/graphics3d/SceneEnvironment.ets @@ -199,7 +199,7 @@ struct sceneEnvironment { Button($r('app.string.back')) .onClick(() => { - router.back(); + this.getUIContext().getRouter().back(); }) .width(Constants.FULL_PERCENT) } diff --git a/entry/src/main/ets/graphics3d/SceneShader.ets b/entry/src/main/ets/graphics3d/SceneShader.ets index 3d72e8a..dadac82 100644 --- a/entry/src/main/ets/graphics3d/SceneShader.ets +++ b/entry/src/main/ets/graphics3d/SceneShader.ets @@ -84,7 +84,7 @@ struct sceneShader { } init(): void { - this.backAnimator = Animator.create(Constants.ANIMATION_OPTION); + this.backAnimator = this.getUIContext().createAnimator(Constants.ANIMATION_OPTION); this.backAnimator.onFrame = () => { this.step++; if (this.material && this.material.colorShader) { @@ -222,7 +222,7 @@ struct sceneShader { Button($r('app.string.back')) .onClick(() => { this.backAnimator?.cancel(); - router.back(); + this.getUIContext().getRouter().back(); }) .width(Constants.FULL_PERCENT) } diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index ce7861a..42ef3b1 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -23,7 +23,7 @@ const TAG: string = '[Index]'; @Component struct Index { onJumpClick(target_url: string): void { - router.pushUrl({ url: target_url }, router.RouterMode.Single, (err) => { + this.getUIContext().getRouter().pushUrl({ url: target_url }, router.RouterMode.Single, (err) => { if (err) { Logger.error(TAG, `Invoke pushUrl failed, code is ${err.code}, message is ${err.message}`); return; -- Gitee From 7c6344a6ffa4f583a562d281748ae8d967a05f91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E5=8D=93=E4=BC=A6?= <2658469835@qq.com> Date: Fri, 23 May 2025 15:23:03 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=E5=88=A0=E9=99=A4=E7=AD=BE=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build-profile.json5 | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/build-profile.json5 b/build-profile.json5 index 394bb00..eb683c9 100644 --- a/build-profile.json5 +++ b/build-profile.json5 @@ -1,20 +1,6 @@ { "app": { - "signingConfigs": [ - { - "name": "default", - "type": "HarmonyOS", - "material": { - "certpath": "C:\\Users\\Admin\\.ohos\\config\\default_Graphics3D_jsqht8w2G3CqJCUgdYO_evm9AqgvCZ7f-OE1b0loEfs=.cer", - "keyAlias": "debugKey", - "keyPassword": "0000001BC76A9BC13E4A8CCBEBFE1556655D50D3479E437BFD44A2CE98208467E824B5067AABE8266A7587", - "profile": "C:\\Users\\Admin\\.ohos\\config\\default_Graphics3D_jsqht8w2G3CqJCUgdYO_evm9AqgvCZ7f-OE1b0loEfs=.p7b", - "signAlg": "SHA256withECDSA", - "storeFile": "C:\\Users\\Admin\\.ohos\\config\\default_Graphics3D_jsqht8w2G3CqJCUgdYO_evm9AqgvCZ7f-OE1b0loEfs=.p12", - "storePassword": "0000001BFB069D8812E4B2B640C196DA5F804AB04795DE1E8610E6C478CF2551C5E98814C0A2FEF9136ADC" - } - } - ], + "signingConfigs": [], "products": [ { "name": "default", -- Gitee