From d22f39bae25161982c5532dc1b2145fe6bc6d8a1 Mon Sep 17 00:00:00 2001 From: Cassianvale Date: Tue, 11 Mar 2025 14:00:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=97=B6=E9=97=B4=E5=8D=A1=E7=89=87?= =?UTF-8?q?=E9=80=82=E9=85=8D=E7=A7=BB=E5=8A=A8=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/ApiConfigPanel.vue | 12 ++- frontend/src/components/MarketTimeDisplay.vue | 86 ++++++++++++++-- frontend/src/components/SafeAreaBottom.vue | 24 ----- frontend/src/components/StockAnalysisApp.vue | 16 ++- frontend/src/style.css | 99 ++++++++++++++++++- 5 files changed, 197 insertions(+), 40 deletions(-) delete mode 100644 frontend/src/components/SafeAreaBottom.vue diff --git a/frontend/src/components/ApiConfigPanel.vue b/frontend/src/components/ApiConfigPanel.vue index 1509ebf..eb0bcd1 100644 --- a/frontend/src/components/ApiConfigPanel.vue +++ b/frontend/src/components/ApiConfigPanel.vue @@ -465,8 +465,9 @@ onMounted(() => { diff --git a/frontend/src/components/SafeAreaBottom.vue b/frontend/src/components/SafeAreaBottom.vue deleted file mode 100644 index 0f3f46e..0000000 --- a/frontend/src/components/SafeAreaBottom.vue +++ /dev/null @@ -1,24 +0,0 @@ - - - - - \ No newline at end of file diff --git a/frontend/src/components/StockAnalysisApp.vue b/frontend/src/components/StockAnalysisApp.vue index 9a73e6e..3100cc8 100644 --- a/frontend/src/components/StockAnalysisApp.vue +++ b/frontend/src/components/StockAnalysisApp.vue @@ -143,9 +143,7 @@ - - - + @@ -182,7 +180,6 @@ import MarketTimeDisplay from './MarketTimeDisplay.vue'; import ApiConfigPanel from './ApiConfigPanel.vue'; import StockSearch from './StockSearch.vue'; import StockCard from './StockCard.vue'; -import SafeAreaBottom from './SafeAreaBottom.vue'; import AnnouncementBanner from './AnnouncementBanner.vue'; import { apiService } from '@/services/api'; @@ -974,6 +971,8 @@ function handleAnnouncementClose() { width: 100%; max-width: 100vw; overflow-x: hidden; + padding-bottom: 20px; /* 增加底部内边距 */ + box-sizing: border-box; } .main-layout { @@ -981,6 +980,7 @@ function handleAnnouncementClose() { width: 100%; max-width: 100vw; overflow-x: hidden; + min-height: calc(100vh - 20px); /* 确保至少占满视口高度减去底部空间 */ } .main-content { @@ -1084,6 +1084,10 @@ function handleAnnouncementClose() { width: 100% !important; max-width: 100% !important; } + + .app-container { + padding-bottom: 30px; /* 增加移动端底部内边距 */ + } } /* 小屏幕手机适配 */ @@ -1116,5 +1120,9 @@ function handleAnnouncementClose() { :deep(.n-dropdown-menu) { max-width: 90vw; } + + .app-container { + padding-bottom: 40px; /* 增加小屏幕底部内边距 */ + } } diff --git a/frontend/src/style.css b/frontend/src/style.css index cfc7325..f9077c4 100644 --- a/frontend/src/style.css +++ b/frontend/src/style.css @@ -24,10 +24,9 @@ a:hover { body { margin: 0; - display: flex; - place-items: center; min-width: 320px; min-height: 100vh; + background-color: #f5f5f7; } h1 { @@ -63,6 +62,8 @@ button:focus-visible { max-width: 1280px; margin: 0 auto; padding: 2rem; + width: 100%; + box-sizing: border-box; text-align: center; } @@ -113,3 +114,97 @@ input::-moz-focus-inner { outline: none !important; box-shadow: 0 0 0 2px rgba(32, 128, 240, 0.2) !important; } +/* 组件宽度统一规范 */ +.component-container { + width: 100%; + max-width: 1200px; + margin-left: auto; + margin-right: auto; + box-sizing: border-box; +} + +.form-container { + width: 100%; + max-width: 900px; + margin-left: auto; + margin-right: auto; + box-sizing: border-box; +} + +.control-container { + width: 100%; + max-width: 600px; + margin-left: auto; + margin-right: auto; + box-sizing: border-box; +} + +/* 移动端适配 */ +@media (max-width: 768px) { + body { + background-color: #f5f5f7; + overflow-x: hidden; + padding: 0; + margin: 0; + } + + #app { + width: 100%; + overflow-x: hidden; + padding: 1rem; + margin: 0 auto; + } + + .component-container { + width: calc(100% - 20px); + max-width: 560px; + } + + .form-container { + width: calc(100% - 20px); + max-width: 480px; + } + + .control-container { + width: calc(100% - 16px); + max-width: 440px; + } +} + +@media (max-width: 480px) { + #app { + padding: 0.5rem; + } + + .component-container { + width: calc(100% - 16px); + max-width: 360px; + } + + .form-container { + width: calc(100% - 12px); + max-width: 320px; + } + + .control-container { + width: calc(100% - 8px); + max-width: 300px; + } +} + +/* 表单控件统一样式 */ +.uniform-input, +.uniform-select, +.uniform-button { + width: 100%; + box-sizing: border-box; + border-radius: 0.5rem; +} + +.button-group { + display: flex; + gap: 0.5rem; + width: 100%; + justify-content: center; +} +