From 091485d3ecebc0e8e723ae61b8436ca13df4f0ba Mon Sep 17 00:00:00 2001 From: zlong <953829746@qq.com> Date: Mon, 18 Nov 2024 00:08:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9ToolFun=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/auto-imports.d.ts | 4 ++-- src/pages.json | 2 +- src/pages/feed-plan/index.vue | 2 +- src/utils/index.js | 10 ---------- src/utils/index.ts | 10 ++++++++++ 5 files changed, 14 insertions(+), 14 deletions(-) delete mode 100644 src/utils/index.js create mode 100644 src/utils/index.ts diff --git a/src/auto-imports.d.ts b/src/auto-imports.d.ts index a2bb48c..ef53d16 100644 --- a/src/auto-imports.d.ts +++ b/src/auto-imports.d.ts @@ -293,7 +293,7 @@ declare global { const useWindowFocus: typeof import('@vueuse/core')['useWindowFocus'] const useWindowScroll: typeof import('@vueuse/core')['useWindowScroll'] const useWindowSize: typeof import('@vueuse/core')['useWindowSize'] - const utils: typeof import('./utils/index.js')['default'] + const utils: typeof import('./utils/index')['default'] const watch: typeof import('vue')['watch'] const watchArray: typeof import('@vueuse/core')['watchArray'] const watchAtMost: typeof import('@vueuse/core')['watchAtMost'] @@ -609,7 +609,7 @@ declare module 'vue' { readonly useWindowFocus: UnwrapRef readonly useWindowScroll: UnwrapRef readonly useWindowSize: UnwrapRef - readonly utils: UnwrapRef + readonly utils: UnwrapRef readonly watch: UnwrapRef readonly watchArray: UnwrapRef readonly watchAtMost: UnwrapRef diff --git a/src/pages.json b/src/pages.json index 67484a9..b9d5964 100644 --- a/src/pages.json +++ b/src/pages.json @@ -34,4 +34,4 @@ "navigationStyle": "custom" }, "subPackages": [] -} +} \ No newline at end of file diff --git a/src/pages/feed-plan/index.vue b/src/pages/feed-plan/index.vue index 37979ab..1798e87 100644 --- a/src/pages/feed-plan/index.vue +++ b/src/pages/feed-plan/index.vue @@ -3,7 +3,7 @@ import bg from '@/static/image/feed-plan/bg.png' import circle from '@/static/image/feed-plan/circle.png' import message from '@/static/image/feed-plan/message.png' -import ToolFun from '@/utils' +import ToolFun from '@/utils/index' interface ListItem { img: string diff --git a/src/utils/index.js b/src/utils/index.js deleted file mode 100644 index a76042b..0000000 --- a/src/utils/index.js +++ /dev/null @@ -1,10 +0,0 @@ -class ToolFun { - static getSafeHeight() { - const systemInfo = uni.getSystemInfoSync() - const safeAreaInsetBottom = systemInfo.safeAreaInsets.bottom + systemInfo.safeAreaInsets.top - const menuButtonInfoHeight = uni.getMenuButtonBoundingClientRect().height + 60 - return safeAreaInsetBottom + menuButtonInfoHeight - } -} - -export default ToolFun diff --git a/src/utils/index.ts b/src/utils/index.ts new file mode 100644 index 0000000..9e46897 --- /dev/null +++ b/src/utils/index.ts @@ -0,0 +1,10 @@ +class ToolFun { + static getSafeHeight(): number { + const systemInfo: UniApp.GetSystemInfoResult = uni.getSystemInfoSync() + const safeAreaInsetBottom: number = systemInfo.safeAreaInsets.bottom + systemInfo.safeAreaInsets.top + const menuButtonInfoHeight: number = uni.getMenuButtonBoundingClientRect().height + 60 + return safeAreaInsetBottom + menuButtonInfoHeight + } +} + +export default ToolFun