From 32ff8b86e89ae95b67e5648dba32e5c123e79a0a Mon Sep 17 00:00:00 2001 From: lvyuanyuan Date: Fri, 20 Sep 2024 22:35:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=97=E7=AC=A6=E4=B8=B2=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/common/Constant.ets | 4 ++-- entry/src/main/ets/entryability/EntryAbility.ets | 2 +- entry/src/main/ets/pages/VuePage.ets | 6 ++---- entry/src/main/ets/pages/WebPage.ets | 7 ++----- entry/src/main/ets/viewmodel/NavigatorBean.ets | 3 +-- entry/src/main/resources/base/element/string.json | 12 ++++++++++++ entry/src/main/resources/en_US/element/string.json | 12 ++++++++++++ entry/src/main/resources/zh_CN/element/string.json | 12 ++++++++++++ 8 files changed, 44 insertions(+), 14 deletions(-) diff --git a/entry/src/main/ets/common/Constant.ets b/entry/src/main/ets/common/Constant.ets index c655661..b899519 100755 --- a/entry/src/main/ets/common/Constant.ets +++ b/entry/src/main/ets/common/Constant.ets @@ -29,7 +29,7 @@ export class CommonConstant { /** * Dialog text value. */ - static readonly WEB_ALERT_DIALOG_TEXT_VALUE: string = '恭喜您抽中:'; + static readonly WEB_ALERT_DIALOG_TEXT_VALUE: ResourceStr = $r('app.string.congratulate'); /** * Size. */ @@ -82,4 +82,4 @@ export class CommonConstant { static readonly MAIN_CONSTANT_BUTTON_WIDTH: string = '86.7%'; static readonly MAIN_CONSTANT_BUTTON_BORDER_RADIUS: number = 20; static readonly MAIN_CONSTANT_BUTTON_FONT_SIZE: number = 16; -} +} \ No newline at end of file diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets index 6250afa..d1e9492 100755 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -63,4 +63,4 @@ export default class EntryAbility extends UIAbility { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); } -} +} \ No newline at end of file diff --git a/entry/src/main/ets/pages/VuePage.ets b/entry/src/main/ets/pages/VuePage.ets index f893d2c..d239570 100755 --- a/entry/src/main/ets/pages/VuePage.ets +++ b/entry/src/main/ets/pages/VuePage.ets @@ -33,14 +33,12 @@ class LinkClass { } } -const TITLE: string = '以上为Vue页面'; - @Entry @Component struct VuePage { - webController: webview.WebviewController = new webview.WebviewController(); @State params: object = router.getParams(); @State linkObj: LinkClass = new LinkClass(); + webController: webview.WebviewController = new webview.WebviewController(); build() { Stack({ alignContent: Alignment.TopStart }) { @@ -82,7 +80,7 @@ struct VuePage { controller: this.webController }) Column() { - Text(TITLE) + Text($r('app.string.tip_vue')) .fontSize(Const.WEB_CONSTANT_TEXT_VALUE_FONT_SIZE) .textAlign(TextAlign.Center) .fontColor($r('app.color.text_value_font_color')) diff --git a/entry/src/main/ets/pages/WebPage.ets b/entry/src/main/ets/pages/WebPage.ets index 450ad83..2882b88 100755 --- a/entry/src/main/ets/pages/WebPage.ets +++ b/entry/src/main/ets/pages/WebPage.ets @@ -13,9 +13,8 @@ * limitations under the License. */ -import { router } from '@kit.ArkUI'; +import { promptAction, router } from '@kit.ArkUI'; import { webview } from '@kit.ArkWeb'; -import { promptAction } from '@kit.ArkUI'; import { CommonConstant as Const } from '../common/Constant'; class LinkClass { @@ -33,8 +32,6 @@ class LinkClass { } } -const TITLE: string = '以上为HTML页面'; - @Entry @Component struct WebPage { @@ -114,7 +111,7 @@ struct WebPage { }) Column() { - Text(TITLE) + Text($r('app.string.tip_html')) .fontSize(Const.WEB_CONSTANT_TEXT_VALUE_FONT_SIZE) .textAlign(TextAlign.Center) .fontColor($r('app.color.text_value_font_color')) diff --git a/entry/src/main/ets/viewmodel/NavigatorBean.ets b/entry/src/main/ets/viewmodel/NavigatorBean.ets index e09aa4a..a7e6107 100755 --- a/entry/src/main/ets/viewmodel/NavigatorBean.ets +++ b/entry/src/main/ets/viewmodel/NavigatorBean.ets @@ -26,5 +26,4 @@ export class NavigatorBean { * Prompt message. */ tips: Resource | string = ''; -} - +} \ No newline at end of file diff --git a/entry/src/main/resources/base/element/string.json b/entry/src/main/resources/base/element/string.json index c2a3844..546e62e 100755 --- a/entry/src/main/resources/base/element/string.json +++ b/entry/src/main/resources/base/element/string.json @@ -79,6 +79,18 @@ { "name": "reason", "value": "Used to initiate network data requests." + }, + { + "name": "congratulate", + "value": "Congratulations on winning: " + }, + { + "name": "tip_vue", + "value": "The above is the Vue page." + }, + { + "name": "tip_html", + "value": "The above is the HTML page." } ] } \ No newline at end of file diff --git a/entry/src/main/resources/en_US/element/string.json b/entry/src/main/resources/en_US/element/string.json index a768a80..e23d670 100755 --- a/entry/src/main/resources/en_US/element/string.json +++ b/entry/src/main/resources/en_US/element/string.json @@ -79,6 +79,18 @@ { "name": "reason", "value": "Used to initiate network data requests." + }, + { + "name": "congratulate", + "value": "Congratulations on winning: " + }, + { + "name": "tip_vue", + "value": "The above is the Vue page." + }, + { + "name": "tip_html", + "value": "The above is the HTML page." } ] } \ No newline at end of file diff --git a/entry/src/main/resources/zh_CN/element/string.json b/entry/src/main/resources/zh_CN/element/string.json index 5c8c70e..55a768d 100755 --- a/entry/src/main/resources/zh_CN/element/string.json +++ b/entry/src/main/resources/zh_CN/element/string.json @@ -79,6 +79,18 @@ { "name": "reason", "value": "Used to initiate network data requests." + }, + { + "name": "congratulate", + "value": "恭喜您抽中: " + }, + { + "name": "tip_vue", + "value": "以上为Vue页面" + }, + { + "name": "tip_html", + "value": "以上为HTML页面" } ] } \ No newline at end of file -- Gitee