bug处理

This commit is contained in:
2026-07-16 18:36:40 +08:00
parent 15971bffd9
commit 5f4aab8d04
7 changed files with 61 additions and 10 deletions
+44 -2
View File
@@ -99,7 +99,7 @@
"真没想到校招居然可以这么轻松高效!一周就收到了3个面试邀约。"
</p>
<div class="home-mobile__quote-author">
<div class="home-mobile__quote-avatar"></div>
<div class="home-mobile__quote-avatar"><img class="w45 h45 " src="@/assets/images/home/student-avatar-0.png" alt=""></div>
<div class="home-mobile__quote-info">
<span class="home-mobile__quote-name">李同学</span>
<span class="home-mobile__quote-school">西安交通大学</span>
@@ -170,9 +170,51 @@
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { ref, onMounted, onUnmounted } from 'vue'
import { getDailyJobCount } from '@/utils/dailyJobCount'
// ==================== 移动端缩放重置 ====================
/**
* 确保 HomeMobile 页面不受全局 transform scale 缩放影响
* 部分浏览器中 remAdapt 插件的 recalc 在路由切换后未及时重新执行,
* 导致 body 上仍残留 PC 端 scale 样式,这里在组件挂载时主动重置
*/
function resetMobileScale() {
const docEl = document.documentElement
const body = document.body
const clientWidth = docEl.clientWidth || window.innerWidth
// 移动端首页 1rem = 视口宽度 / 3.90(设计稿 390px
const mobileFontSize = clientWidth / 3.90
docEl.style.fontSize = mobileFontSize + 'px'
// 清除 scale 缩放相关样式
body.style.width = ''
body.style.height = ''
body.style.minHeight = ''
body.style.overflowY = ''
body.style.transform = ''
body.style.transformOrigin = ''
docEl.style.height = ''
docEl.style.overflow = ''
docEl.style.setProperty('--app-height', '100vh')
docEl.style.setProperty('--chat-width', '100%')
}
/** 窗口 resize 时重新执行重置 */
function onResize() {
resetMobileScale()
}
onMounted(() => {
resetMobileScale()
window.addEventListener('resize', onResize)
window.addEventListener('orientationchange', onResize)
})
onUnmounted(() => {
window.removeEventListener('resize', onResize)
window.removeEventListener('orientationchange', onResize)
})
// 声明友盟统计 _czc 对象
const _czc: any[] = (window as any)._czc || [];
(window as any)._czc = _czc;