From 4df8612bbab095526140610dc0230b03c258dffd Mon Sep 17 00:00:00 2001 From: wpp <58198665+879356503@users.noreply.github.com> Date: Fri, 11 Apr 2025 15:30:58 +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 --- .../main/ets/constants/CommonConstants.ets | 20 ------------------- .../main/ets/entryability/EntryAbility.ets | 16 ++++++++------- .../ets/pages/TableAdaptiveExtensionIndex.ets | 1 - 3 files changed, 9 insertions(+), 28 deletions(-) diff --git a/entry/src/main/ets/constants/CommonConstants.ets b/entry/src/main/ets/constants/CommonConstants.ets index c9f3418..9bc69fb 100644 --- a/entry/src/main/ets/constants/CommonConstants.ets +++ b/entry/src/main/ets/constants/CommonConstants.ets @@ -53,26 +53,10 @@ export class CommonConstants { * number 2 */ public static readonly NUMBER_TWO: number = 2; - /** - * Tab adaptive padding md. - */ - public static readonly TAB_PADDING_MD: string = '33vp'; - /** - * Tab adaptive padding lg. - */ - public static readonly TAB_PADDING_LG: string = '63vp'; /** * Double tab adaptive padding sm. */ public static readonly DOUBLE_TAB_PADDING_SM: string = '16vp'; - /** - * Double tab adaptive padding md. - */ - public static readonly DOUBLE_TAB_PADDING_MD1: string = '61vp'; - /** - * Double tab adaptive padding lg. - */ - public static readonly DOUBLE_TAB_PADDING_LG1: string = '71vp'; /** * Double tab adaptive padding md. */ @@ -85,10 +69,6 @@ export class CommonConstants { * The full percentage of component. */ public static readonly FULL_WIDTH_PERCENT: string = '100%'; - /** - * The ninety percent of the components. - */ - public static readonly NINETY_PERCENT: string = '90%'; /** * The eighty percent. */ diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets index 24f1044..f8537c5 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -25,11 +25,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 { @@ -57,6 +53,8 @@ export default class EntryAbility extends UIAbility { } catch (err) { hilog.error(0x0000, 'testTag', '%{public}s', 'config main window fail. Cause: ' + err.message); } + }).catch((err: BusinessError) => { + hilog.error(0x0000, 'testTag', `Failed to get main window. Cause: ${err.message}`); }); windowStage.loadContent('pages/Index', (err) => { if (err.code) { @@ -68,9 +66,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); } }); } @@ -88,7 +89,8 @@ export default class EntryAbility extends UIAbility { } AppStorage.setOrCreate('breakPoint', curBp); } catch (exception) { - hilog.error(0x0000, 'testTag', '%{public}s', `UpdateBreakpoint fail, error code: ${(exception as BusinessError).code}`); + hilog.error(0x0000, 'testTag', '%{public}s', + `UpdateBreakpoint fail, error code: ${(exception as BusinessError).code}`); } } diff --git a/entry/src/main/ets/pages/TableAdaptiveExtensionIndex.ets b/entry/src/main/ets/pages/TableAdaptiveExtensionIndex.ets index 098faab..630b87d 100644 --- a/entry/src/main/ets/pages/TableAdaptiveExtensionIndex.ets +++ b/entry/src/main/ets/pages/TableAdaptiveExtensionIndex.ets @@ -21,7 +21,6 @@ import { BreakpointType } from '../utils/BreakpointType'; export struct TableAdaptiveExtensionIndex { @StorageLink('breakPoint') breakPoint: string = CommonConstants.BREAK_POINT_SM; @Consume('pageInfos') pageInfos: NavPathStack; - @State tabIndexSelected: number = 0; @StorageProp('topRectHeight') topRectHeight: number = 0; @Builder -- Gitee