From ebbde8afd39d9f82e808b98350ed6eece5e4e6d1 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Thu, 10 Apr 2025 11:13:19 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/assets/js/App.vue | 6 +++--- resources/assets/js/app.js | 3 ++- resources/assets/js/store/state.js | 3 +++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/resources/assets/js/App.vue b/resources/assets/js/App.vue index c751ad1ca..e5978d87d 100755 --- a/resources/assets/js/App.vue +++ b/resources/assets/js/App.vue @@ -36,10 +36,10 @@ - + - + @@ -134,7 +134,7 @@ export default { }, computed: { - ...mapState(['ws', 'themeConf', 'windowOrientation', 'safeAreaSize', 'mobileTabbar']), + ...mapState(['ws', 'themeConf', 'windowOrientation', 'safeAreaSize', 'isFirstPage', 'mobileTabbar']), statusColor({routeName}) { if (!routeName) { diff --git a/resources/assets/js/app.js b/resources/assets/js/app.js index f09d88a53..8860cbaf9 100644 --- a/resources/assets/js/app.js +++ b/resources/assets/js/app.js @@ -339,7 +339,8 @@ const $preload = async () => { return } const pageInfo = $A.eeuiAppGetPageInfo() || {}; - if (pageInfo.pageName === 'firstPage') { + store.state.isFirstPage = pageInfo.pageName === 'firstPage' + if (store.state.isFirstPage) { $A.eeuiAppGetSafeAreaInsets().then(data => { const proportion = data.height / window.outerHeight store.state.safeAreaSize = { diff --git a/resources/assets/js/store/state.js b/resources/assets/js/store/state.js index c009614dc..9c0bfa65b 100644 --- a/resources/assets/js/store/state.js +++ b/resources/assets/js/store/state.js @@ -23,6 +23,9 @@ export default { windowHeight: windowHeight, safeAreaSize: {top: 0, bottom: 0, data: null}, // 安全区域尺寸 + // 是否第一个页面(eeui) + isFirstPage: false, + // 浏览器窗口方向 windowOrientation: windowOrientation, windowLandscape: windowOrientation === 'landscape', // 横屏