diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue index 2839caa..224a258 100644 --- a/src/layout/components/AppMain.vue +++ b/src/layout/components/AppMain.vue @@ -53,10 +53,13 @@ export default { overflow: hidden; @media (max-width: 768px) { - min-height: calc(100vh - 48px); + min-height: calc(100vh - 48px - 60px); // 减去头部和底部导航 overflow-x: hidden; - overflow-y: auto; + overflow-y: visible; -webkit-overflow-scrolling: touch; + height: auto; + max-height: none; + position: static; } } diff --git a/src/layout/index.vue b/src/layout/index.vue index d74ed00..af4a49e 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -87,6 +87,18 @@ export default { position: fixed; top: 0; } + + @media (max-width: 768px) { + &.mobile { + height: auto; + min-height: 100vh; + position: relative; + + &.openSidebar { + position: relative; + } + } + } } .drawer-bg { @@ -136,6 +148,9 @@ export default { .main-container { margin-left: 0 !important; width: 100%; + height: auto !important; + min-height: 100vh; + overflow: visible; &.mobile-layout { padding-bottom: 60px; // 为底部导航预留空间 diff --git a/src/views/system/jd-instruction/index.vue b/src/views/system/jd-instruction/index.vue index 6d1d391..89b6118 100644 --- a/src/views/system/jd-instruction/index.vue +++ b/src/views/system/jd-instruction/index.vue @@ -197,6 +197,16 @@ export default { fullMessage() { if (!this.resultList || this.resultList.length === 0) return '' return this.resultList.join('\n\n\n') + }, + // 检测移动端 + isMobile() { + if (this.$store?.getters?.device === 'mobile') { + return true + } + if (typeof window !== 'undefined' && window.innerWidth < 768) { + return true + } + return false } }, mounted() {