bug处理
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user