From aaa44fbea08aeae6cd55cd806f3cc3a7f1f09ad6 Mon Sep 17 00:00:00 2001 From: Pure Date: Mon, 7 Jul 2025 17:07:09 +0800 Subject: [PATCH] =?UTF-8?q?dts=E5=8D=95=E9=97=AD=E7=8E=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build-profile.json5 | 7 +++++-- entry/build-profile.json5 | 8 ++++---- entry/src/main/ets/pages/Index.ets | 8 +++++++- entry/src/official_pages/VersionInfo.ets | 4 +++- entry/src/test_pages/VersionInfo.ets | 4 +++- myhar/build-profile.json5 | 8 ++++---- myhar/src/main/ets/components/MainPage.ets | 8 ++++++++ myhar/src/official_pages/OfficialSecondPage.ets | 2 +- myhar/src/test_pages/TestSecondPage.ets | 2 +- 9 files changed, 36 insertions(+), 15 deletions(-) diff --git a/build-profile.json5 b/build-profile.json5 index 5653ed8..b62ce28 100644 --- a/build-profile.json5 +++ b/build-profile.json5 @@ -1,6 +1,8 @@ +// [Start lock] { "app": { - "signingConfigs": [], + "signingConfigs": [ + ], "products": [ { "name": "official", @@ -85,4 +87,5 @@ ] } ] -} \ No newline at end of file +} +// [End lock] \ No newline at end of file diff --git a/entry/build-profile.json5 b/entry/build-profile.json5 index fb20b58..e4e1a33 100644 --- a/entry/build-profile.json5 +++ b/entry/build-profile.json5 @@ -9,14 +9,13 @@ "obfuscation": { "ruleOptions": { "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] + "files": [] } } } }, ], + // [Start targets] "targets": [ { "name": "official", @@ -52,5 +51,6 @@ ] } }, - ] + ], + // [End targets] } \ No newline at end of file diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index e13a98b..7db78ed 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -13,6 +13,7 @@ * limitations under the License. */ import { MainPage } from 'myhar' +// [Start main_page] import { getName, getTitleName } from 'entry/VersionInfo' @Entry @@ -36,6 +37,7 @@ struct Index { .height(19) .margin({ top: 2 }) } + // [StartExclude main_page] .height(78) .width('100%') .alignItems(HorizontalAlign.Start) @@ -51,10 +53,14 @@ struct Index { .backgroundColor('#F1F3F5') } .layoutWeight(1) + // [EndExclude main_page] } + // [StartExclude main_page] .width('100%') .height('100%') .backgroundColor('#F1F3F5') .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) + // [EndExclude main_page] } -} \ No newline at end of file +} +// [End main_page] \ No newline at end of file diff --git a/entry/src/official_pages/VersionInfo.ets b/entry/src/official_pages/VersionInfo.ets index ffbd127..38bd207 100644 --- a/entry/src/official_pages/VersionInfo.ets +++ b/entry/src/official_pages/VersionInfo.ets @@ -12,5 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start getName] export const getName = () => "This is official version." -export const getTitleName = () => $r('app.string.title') \ No newline at end of file +export const getTitleName = () => $r('app.string.title') +// [End getName] \ No newline at end of file diff --git a/entry/src/test_pages/VersionInfo.ets b/entry/src/test_pages/VersionInfo.ets index c38a68b..3796036 100644 --- a/entry/src/test_pages/VersionInfo.ets +++ b/entry/src/test_pages/VersionInfo.ets @@ -12,5 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start test] export const getName = () => "This is test version." -export const getTitleName = () => $r('app.string.title') \ No newline at end of file +export const getTitleName = () => $r('app.string.title') +// [End test] \ No newline at end of file diff --git a/myhar/build-profile.json5 b/myhar/build-profile.json5 index 95a23bd..1b5693a 100644 --- a/myhar/build-profile.json5 +++ b/myhar/build-profile.json5 @@ -7,9 +7,7 @@ "obfuscation": { "ruleOptions": { "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] + "files": [] }, "consumerFiles": [ "./consumer-rules.txt" @@ -18,6 +16,7 @@ }, }, ], + // [Start official] "targets": [ { "name": "official", @@ -80,5 +79,6 @@ ] } } - ] + ], + // [End official] } diff --git a/myhar/src/main/ets/components/MainPage.ets b/myhar/src/main/ets/components/MainPage.ets index 4fed1c1..ef759ba 100644 --- a/myhar/src/main/ets/components/MainPage.ets +++ b/myhar/src/main/ets/components/MainPage.ets @@ -12,12 +12,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start import] import BuildProfile from '../../../../BuildProfile'; import { OfficialSecond } from '../../../official_pages/OfficialSecondPage'; import { TestSecond } from '../../../test_pages/TestSecondPage'; +// [End import] @Component export struct MainPage { + // [Start page_Info] @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack(); @Builder @@ -28,11 +31,13 @@ export struct MainPage { TestSecond(); } } + // [End page_Info] build() { Navigation(this.pageInfos) { Row() { Column() { + // [Start text_Area] TextArea({ text: $r('app.string.title_description') }) .fontSize(16) .width('100%') @@ -44,7 +49,9 @@ export struct MainPage { .width('100%') .borderRadius(12) .padding({ top: 16 }) + // [End text_Area] Blank() + // [Start btn] Button($r('app.string.button_describe')) .fontSize(16) .height(40) @@ -52,6 +59,7 @@ export struct MainPage { .onClick(() => { this.pageInfos.pushPath({ name: BuildProfile.productName }); }) + // [End btn] } .width('100%') .height('100%') diff --git a/myhar/src/official_pages/OfficialSecondPage.ets b/myhar/src/official_pages/OfficialSecondPage.ets index c5b9e43..174f3ee 100644 --- a/myhar/src/official_pages/OfficialSecondPage.ets +++ b/myhar/src/official_pages/OfficialSecondPage.ets @@ -30,7 +30,7 @@ export struct OfficialSecond { } customToast(str: ResourceStr) { - promptAction.showToast({ message: str, duration: 2000, bottom: '80vp' }) + this.getUIContext().getPromptAction().showToast({ message: str, duration: 2000, bottom: '80vp' }); } build() { diff --git a/myhar/src/test_pages/TestSecondPage.ets b/myhar/src/test_pages/TestSecondPage.ets index f6d492b..789e5ad 100644 --- a/myhar/src/test_pages/TestSecondPage.ets +++ b/myhar/src/test_pages/TestSecondPage.ets @@ -44,7 +44,7 @@ export struct TestSecond { } customToast(str: ResourceStr) { - promptAction.showToast({ message: str, duration: 2000, bottom: '80vp' }) + this.getUIContext().getPromptAction().showToast({ message: str, duration: 2000, bottom: '80vp' }); } build() { -- Gitee