From 14f064bc4549bc0fbc8f22071cda071cb826f7f2 Mon Sep 17 00:00:00 2001 From: wangzhiyusss Date: Tue, 3 Jan 2023 15:23:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8C=89=E9=92=AE=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98&&jscrash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangzhiyusss --- .../src/main/resources/rawfile/editor.html | 6 +++--- .../main/resources/rawfile/icon/picture_white.svg | 1 + .../src/main/resources/rawfile/icon/styles.svg | 11 +++++++++++ .../src/main/resources/rawfile/icon/todo1.svg | 1 + .../src/main/ets/MainAbility/MainAbility.ts | 14 +++++++++----- 5 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 common/resources/src/main/resources/rawfile/icon/picture_white.svg create mode 100644 common/resources/src/main/resources/rawfile/icon/styles.svg create mode 100644 common/resources/src/main/resources/rawfile/icon/todo1.svg diff --git a/common/resources/src/main/resources/rawfile/editor.html b/common/resources/src/main/resources/rawfile/editor.html index 67cd2a0..4288cfb 100644 --- a/common/resources/src/main/resources/rawfile/editor.html +++ b/common/resources/src/main/resources/rawfile/editor.html @@ -19,15 +19,15 @@
- + 清单
- + 样式
- + 相册
diff --git a/common/resources/src/main/resources/rawfile/icon/picture_white.svg b/common/resources/src/main/resources/rawfile/icon/picture_white.svg new file mode 100644 index 0000000..1def639 --- /dev/null +++ b/common/resources/src/main/resources/rawfile/icon/picture_white.svg @@ -0,0 +1 @@ +图片 \ No newline at end of file diff --git a/common/resources/src/main/resources/rawfile/icon/styles.svg b/common/resources/src/main/resources/rawfile/icon/styles.svg new file mode 100644 index 0000000..4fb5bb6 --- /dev/null +++ b/common/resources/src/main/resources/rawfile/icon/styles.svg @@ -0,0 +1,11 @@ + + + +样式 + + diff --git a/common/resources/src/main/resources/rawfile/icon/todo1.svg b/common/resources/src/main/resources/rawfile/icon/todo1.svg new file mode 100644 index 0000000..7778298 --- /dev/null +++ b/common/resources/src/main/resources/rawfile/icon/todo1.svg @@ -0,0 +1 @@ +todo \ No newline at end of file diff --git a/product/default/src/main/ets/MainAbility/MainAbility.ts b/product/default/src/main/ets/MainAbility/MainAbility.ts index 07704b5..e9a8efa 100644 --- a/product/default/src/main/ets/MainAbility/MainAbility.ts +++ b/product/default/src/main/ets/MainAbility/MainAbility.ts @@ -30,10 +30,14 @@ export default class MainAbility extends Ability { onCreate(want, launchParam) { // @ts-ignore - window.getLastWindow(this.context,(err,data)=>{ - let windowWidth = data.getWindowProperties().windowRect.width - LogUtil.info(this.Tag, " getLastWindow:" + windowWidth) - this.screenBreakPoints(windowWidth) + window.getLastWindow(this.context, (err, data) => { + if (data && data.getWindowProperties()) { + let windowWidth = data.getWindowProperties().windowRect.width + LogUtil.info(this.Tag, " getLastWindow:" + windowWidth) + this.screenBreakPoints(windowWidth) + } else { + LogUtil.info(this.Tag, "getWindowProperties error:" + JSON.stringify(err)) + } }) LogUtil.info(this.Tag, " onCreate, launchReason is " + launchParam.launchReason + ", deviceType" + deviceInfo.deviceType) if (deviceInfo.deviceType === 'phone' || deviceInfo.deviceType === 'default') { @@ -200,7 +204,7 @@ export default class MainAbility extends Ability { } } - screenBreakPoints(data){ + screenBreakPoints(data) { let displayClass = null let screenDpi = null displayClass = display.getDefaultDisplaySync() -- Gitee