Files
yunzerwebsiteallinone/uniapp/App.vue
T
2026-10-07 13:46:32 +08:00

68 lines
1.7 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script>
import { getBaseURL } from '@/api/request.js'
export default {
onLaunch() {
console.log('App Launch, API:', getBaseURL())
},
onShow() {
console.log('App Show')
},
onHide() {
console.log('App Hide')
}
}
</script>
<style lang="scss">
@import 'uview-plus/index.scss';
@import './src/styles/theme.scss';
@import './src/styles/tint.scss';
@import './src/styles/fontawesome.scss';
@import './src/styles/rich-content.scss';
page {
height: 100%;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
background-color: $color-bg-page;
color: $color-text;
box-sizing: border-box;
}
/* 全局统一 border-box:必须显式覆盖 scroll-view / swiper / input 等盒元素,
否则它们 width:100% + padding 会按 content-box 溢出视口(小程序端高发),
导致带左右内边距的列表/弹层右侧内容被裁切。 */
view,
text,
scroll-view,
swiper,
swiper-item,
button,
input,
textarea,
label,
navigator {
box-sizing: border-box;
}
/* ============ 全局自适应(宽屏:桌面 / 平板 H5)============
说明:手机竖屏 CSS 宽度普遍 < 560px,此断链不会命中,App / 小程
序 / 手机 H5 行为完全不变;仅在宽屏下把整个应用收敛为居中的手机列,
避免页面铺满超宽屏、两侧大片留白。配合 pages.json 的 rpx 上限,
无需逐页适配。 */
@media (min-width: 560px) {
body {
background: #e9edf3;
}
#app {
max-width: 560px;
min-height: 100vh;
margin-left: auto;
margin-right: auto;
background: $color-bg-page;
box-shadow: 0 0 1px rgba(15, 23, 42, 0.16), 0 10px 40px rgba(15, 23, 42, 0.08);
}
}
</style>