debugger
This commit is contained in:
@@ -33,6 +33,12 @@ import { ref, onMounted, onUnmounted, computed } from 'vue'
|
|||||||
const log = ref('')
|
const log = ref('')
|
||||||
|
|
||||||
const updateInfo = () => {
|
const updateInfo = () => {
|
||||||
|
// 获取真实的视口高度(PWA 模式下准确)
|
||||||
|
const vh = window.innerHeight
|
||||||
|
// 设置 CSS 变量,让所有组件使用准确的视口高度
|
||||||
|
document.documentElement.style.setProperty('--vh', `${vh}px`)
|
||||||
|
document.documentElement.style.setProperty('--vh-offset', `${vh}px`)
|
||||||
|
|
||||||
log.value = JSON.stringify({
|
log.value = JSON.stringify({
|
||||||
innerHeight: window.innerHeight,
|
innerHeight: window.innerHeight,
|
||||||
outerHeight: window.outerHeight,
|
outerHeight: window.outerHeight,
|
||||||
@@ -43,16 +49,24 @@ const updateInfo = () => {
|
|||||||
offsetTop: window.visualViewport.offsetTop,
|
offsetTop: window.visualViewport.offsetTop,
|
||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
|
cssVarVh: getComputedStyle(document.documentElement).getPropertyValue('--vh'),
|
||||||
}, null, 2)
|
}, null, 2)
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
updateInfo()
|
updateInfo()
|
||||||
window.addEventListener('resize', updateInfo)
|
window.addEventListener('resize', updateInfo)
|
||||||
|
// 监听 iOS Safari 视口变化
|
||||||
|
if (window.visualViewport) {
|
||||||
|
window.visualViewport.addEventListener('resize', updateInfo)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
window.removeEventListener('resize', updateInfo)
|
window.removeEventListener('resize', updateInfo)
|
||||||
|
if (window.visualViewport) {
|
||||||
|
window.visualViewport.removeEventListener('resize', updateInfo)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
@@ -98,14 +112,27 @@ const handleTabClick = (path) => {
|
|||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.app-provider {
|
.app-provider {
|
||||||
/* 关键:让 config-provider 本身先占满视口 */
|
/* 使用准确的视口高度 CSS 变量 */
|
||||||
height: 100%;
|
height: var(--vh, 100vh);
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.app-root {
|
.app-root {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
position: relative;
|
||||||
border: 2px solid red; /* 调试用红框 */
|
border: 2px solid red; /* 调试用红框 */
|
||||||
display: flex;
|
}
|
||||||
flex-direction: column;
|
|
||||||
|
/* TabBar 固定在底部 */
|
||||||
|
:deep(.van-tabbar) {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
padding-bottom: 0 !important;
|
||||||
|
/* 移除可能的安全区域内边距 */
|
||||||
|
padding-bottom: constant(safe-area-inset-bottom) !important;
|
||||||
|
padding-bottom: env(safe-area-inset-bottom) !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ html, body {
|
|||||||
overscroll-behavior-y: none;
|
overscroll-behavior-y: none;
|
||||||
-webkit-overflow-scrolling: touch;
|
-webkit-overflow-scrolling: touch;
|
||||||
touch-action: pan-y;
|
touch-action: pan-y;
|
||||||
position: fixed;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: hidden;
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
@@ -22,12 +22,8 @@ body {
|
|||||||
max-width: 1280px;
|
max-width: 1280px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
position: absolute;
|
width: 100%;
|
||||||
top: 0;
|
height: 100%;
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
overflow-y: auto;
|
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
-webkit-overflow-scrolling: touch;
|
-webkit-overflow-scrolling: touch;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
/* 通用页面容器样式 */
|
/* 通用页面容器样式 */
|
||||||
.page-container {
|
.page-container {
|
||||||
min-height: 100vh;
|
min-height: var(--vh, 100vh);
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
|
padding-bottom: calc(50px + env(safe-area-inset-bottom, 0px));
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
@@ -12,7 +13,7 @@
|
|||||||
|
|
||||||
/* 下拉刷新包装器 */
|
/* 下拉刷新包装器 */
|
||||||
.refresh-wrapper {
|
.refresh-wrapper {
|
||||||
min-height: calc(100vh - 46px);
|
min-height: calc(var(--vh, 100vh) - 46px - 50px - env(safe-area-inset-bottom, 0px));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 增加卡片组的对比度 */
|
/* 增加卡片组的对比度 */
|
||||||
|
|||||||
@@ -183,13 +183,16 @@ fetchDailyStatistics(now.getFullYear(), now.getMonth() + 1)
|
|||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.calendar-container {
|
.calendar-container {
|
||||||
height: 100vh;
|
/* 使用准确的视口高度减去 TabBar 高度(50px)和安全区域 */
|
||||||
|
height: calc(var(--vh, 100vh) - 50px - env(safe-area-inset-bottom, 0px));
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.calendar-container :deep(.van-calendar) {
|
.calendar-container :deep(.van-calendar) {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.date-transactions {
|
.date-transactions {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="email-record-container">
|
<div class="email-record-container" style="padding-bottom: calc(50px + env(safe-area-inset-bottom, 0px));">
|
||||||
<!-- 顶部导航栏 -->
|
<!-- 顶部导航栏 -->
|
||||||
<van-nav-bar title="邮件记录" fixed placeholder>
|
<van-nav-bar title="邮件记录" fixed placeholder>
|
||||||
<template #right>
|
<template #right>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div style="padding-bottom: calc(50px + env(safe-area-inset-bottom, 0px));">
|
||||||
<van-nav-bar title="设置" />
|
<van-nav-bar title="设置" />
|
||||||
<div class="detail-header">
|
<div class="detail-header">
|
||||||
<p>账单导入</p>
|
<p>账单导入</p>
|
||||||
|
|||||||
@@ -292,8 +292,8 @@ onMounted(() => {
|
|||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.smart-classification {
|
.smart-classification {
|
||||||
min-height: 100vh;
|
min-height: var(--vh, 100vh);
|
||||||
padding-bottom: 60px;
|
padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 统计信息 */
|
/* 统计信息 */
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="transaction-record-container">
|
<div class="transaction-record-container" style="padding-bottom: calc(50px + env(safe-area-inset-bottom, 0px));">
|
||||||
<!-- 顶部导航栏 -->
|
<!-- 顶部导航栏 -->
|
||||||
<van-nav-bar title="交易记录" fixed placeholder style="z-index: 9999;">
|
<van-nav-bar title="交易记录" fixed placeholder style="z-index: 9999;">
|
||||||
<template #right>
|
<template #right>
|
||||||
|
|||||||
Reference in New Issue
Block a user