From e0923e81d2331ad356f6c875b469f92011b6b337 Mon Sep 17 00:00:00 2001 From: wpp <58198665+879356503@users.noreply.github.com> Date: Fri, 11 Apr 2025 15:07:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E8=8C=83=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ets/common/constants/CommonConstants.ets | 40 ------------------- .../main/ets/entryability/EntryAbility.ets | 13 +++--- 2 files changed, 7 insertions(+), 46 deletions(-) diff --git a/entry/src/main/ets/common/constants/CommonConstants.ets b/entry/src/main/ets/common/constants/CommonConstants.ets index 1664826..ffaf983 100644 --- a/entry/src/main/ets/common/constants/CommonConstants.ets +++ b/entry/src/main/ets/common/constants/CommonConstants.ets @@ -17,50 +17,10 @@ * Common constants for all features. */ export class CommonConstants { - /** - * Promotional activities. - */ - public static readonly TAB_NAME_1: string = '促销活动'; - /** - * Trip Services. - */ - public static readonly TAB_NAME_2: string = '行程服务'; - /** - * Promotional goods. - */ - public static readonly LIST_NAME_1: string = '促销商品'; - /** - * Itinerary Arrangements. - */ - public static readonly LIST_NAME_2: string = '行程安排'; /** * font weight is 500. */ public static readonly FONT_WEIGHT_FIVE: number = 500; - /** - * font weight is 500. - */ - public static readonly FONT_WEIGHT_FOUR: number = 400; - /** - * The width of the split line is 2. - */ - public static readonly STROKE_WIDTH: number = 2; - /** - * list space is 12. - */ - public static readonly LIST_SPACE: number = 12; - /** - * stack height. - */ - public static readonly STACK_HEIGHT: Length = 'calc(100% - 60vp)'; - /** - * Transparency is 1. - */ - public static readonly FULL_OPACITY: number = 1; - /** - * Transparency is 0. - */ - public static readonly ZERO_OPACITY: number = 0; /** * Width the percentage of the 100. */ diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets index 83ad01f..38b535e 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -46,11 +46,7 @@ export default class EntryAbility extends UIAbility { onCreate(): void { hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); AppStorage.setOrCreate('systemColorMode', this.context.config.colorMode); - try { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - } catch (err) { - hilog.error(0x0000, 'testTag', '%{public}s', `setColorMode fail. error code: ${err.code}`); - } + this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); } onDestroy(): void { @@ -75,6 +71,8 @@ export default class EntryAbility extends UIAbility { } catch (err) { hilog.error(0x0000, 'testTag', '%{public}s', `config window fail. Cause: ${err.code}`); } + }).catch((err: BusinessError) => { + hilog.error(0x0000, 'testTag', `Failed to get main window. Cause: ${err.message}`); }); // Main window is created, set main page for this ability hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); @@ -91,9 +89,12 @@ export default class EntryAbility extends UIAbility { let isLayoutFullScreen = true; windowClass.setWindowLayoutFullScreen(isLayoutFullScreen).then(() => { hilog.info(0x0000, 'testTag', '%{public}s', 'Succeeded in setting the window layout to full-screen mode.'); + }).catch((err: BusinessError) => { + hilog.error(0x0000, 'testTag', `Failed to set the window layout to full-screen mode. Cause: ${err.message}`); }); } catch (err) { - hilog.error(0x0000, 'testTag', '%{public}s', `Failed to set the window layout to full-screen mode. ${err.code}`); + hilog.error(0x0000, 'testTag', '%{public}s', + `Failed to set the window layout to full-screen mode. ${err.code}`); } }); } -- Gitee