From c09f05ac8d68b313fefa24d4548d96dff3934817 Mon Sep 17 00:00:00 2001 From: zhanghao <774378400@qq.com> Date: Thu, 23 Jul 2026 10:22:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=99=90=E5=88=B6=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E7=AB=96=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 60 ++++++++++-- src/components/LandscapeGuard.vue | 153 ++++++++++++++++++++++++++++++ src/style.scss | 19 ++++ src/views/Address.vue | 2 + src/views/Home.vue | 21 ---- 5 files changed, 227 insertions(+), 28 deletions(-) create mode 100644 src/components/LandscapeGuard.vue diff --git a/src/App.vue b/src/App.vue index ad7faf7..190afe1 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,12 +1,58 @@ - - \ No newline at end of file + diff --git a/src/components/LandscapeGuard.vue b/src/components/LandscapeGuard.vue new file mode 100644 index 0000000..780e398 --- /dev/null +++ b/src/components/LandscapeGuard.vue @@ -0,0 +1,153 @@ + + + + + diff --git a/src/style.scss b/src/style.scss index f6812c6..f188935 100644 --- a/src/style.scss +++ b/src/style.scss @@ -29,6 +29,7 @@ * { padding: 0; margin: 0; + box-sizing: border-box; } html, @@ -37,3 +38,21 @@ body, width: 100%; height: 100%; } + +body { + overflow: hidden; +} + +html.is-portrait-tablet, +html.is-portrait-tablet body { + overflow: hidden !important; + background: #0b1526; +} + +html.is-portrait-tablet #app { + visibility: hidden; +} + +html.is-portrait-tablet .landscape-guard__mask { + visibility: visible; +} diff --git a/src/views/Address.vue b/src/views/Address.vue index d5693b2..cd3f511 100644 --- a/src/views/Address.vue +++ b/src/views/Address.vue @@ -144,6 +144,8 @@ const testConnect = async () => { :deep(.el-input__inner) { height: 40px; + // 避免 iPad Safari 聚焦小字号输入框时自动缩放页面。 + font-size: 16px; } .connect { diff --git a/src/views/Home.vue b/src/views/Home.vue index 4255e2c..8f90ace 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -36,14 +36,6 @@ import MechanicalArm from './arm/MechanicalArm.vue'; import Camera from './camera/index.vue' import { useRouter } from 'vue-router'; -import autofit from 'autofit.js' -autofit.init({ - designHeight: 1080, - designWidth: 1920, - renderDom: '#app', - resize: true - }) - const router = useRouter() const currentTime = ref('') @@ -83,25 +75,12 @@ const back = () => { router.back() } -const resetAutoFit = () => { - autofit.destroy() // 销毁旧缩放 - autofit.init({ - designHeight: 1080, - designWidth: 1920, - renderDom: '#app', - resize: true - }) -} - let clockTimer, binaryTimer; onMounted(() => { updateClock(); clockTimer = setInterval(updateClock, 1000); animateBinary() binaryTimer = setInterval(animateBinary, 400); - - document.addEventListener('fullscreenchange', resetAutoFit) - document.addEventListener('webkitfullscreenchange', resetAutoFit) }) onUnmounted(() => {