Spaces:
Running
Running
File size: 1,915 Bytes
e850ec0 e3bbdaf 0cd5390 e3bbdaf 0cd5390 e3bbdaf 0cd5390 e3bbdaf f62f528 0cd5390 e3bbdaf 0cd5390 e3bbdaf 0cd5390 e3bbdaf f62f528 bebf4ea 0cd5390 e3bbdaf 0cd5390 e3bbdaf f62f528 bebf4ea 0cd5390 f62f528 0cd5390 f62f528 0cd5390 f62f528 0cd5390 bebf4ea 0cd5390 bebf4ea 0cd5390 e3bbdaf e850ec0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | <script setup lang="ts">
import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
onLaunch(() => {
console.log("App Launch");
});
onShow(() => {
console.log("App Show");
});
onHide(() => {
console.log("App Hide");
});
</script>
<style lang="scss">
/* H5 网页全局布局优化:严格模拟手机端居中显示 */
/* #ifdef H5 */
html,
body {
background-color: #f5f5f5 !important;
height: 100%;
overflow: hidden; /* 禁止最外层 body 滚动 */
}
uni-app {
max-width: 450px !important;
height: 100% !important;
margin: 0 auto !important;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
background-color: #fff;
display: flex;
flex-direction: column;
position: relative;
overflow: hidden; /* 内部容器自包含 */
}
/* 头部导航栏:强制居中且宽度一致 */
uni-page-head {
max-width: 450px !important;
left: 0 !important;
right: 0 !important;
margin: 0 auto !important;
position: fixed !important;
z-index: 999;
}
/* 底部 TabBar:强制居中且宽度一致 */
uni-tabbar {
max-width: 450px !important;
left: 0 !important;
right: 0 !important;
margin: 0 auto !important;
position: fixed !important;
z-index: 999;
/* 针对 uni-tabbar 内部容器的特殊处理,防止内容溢出 */
.uni-tabbar {
max-width: 450px !important;
margin: 0 auto !important;
left: 0 !important;
right: 0 !important;
}
}
/* 内容区域:允许内部滚动,解决无内容却能滚动的问题 */
uni-page-wrapper {
background-color: #fff !important;
height: 100% !important;
overflow-y: auto !important; /* 只在内容区允许滚动 */
-webkit-overflow-scrolling: touch;
}
/* 隐藏滚动条 */
::-webkit-scrollbar {
display: none;
width: 0 !important;
height: 0 !important;
}
/* 修复标题栏显示 */
.uni-page-head-bd {
font-size: 16px !important;
font-weight: bold !important;
}
/* #endif */
</style>
|