109 lines
1.8 KiB
Vue
109 lines
1.8 KiB
Vue
<script>
|
|
import { provide } from 'vue'
|
|
|
|
export default {
|
|
onLaunch: function() {
|
|
console.log('App Launch')
|
|
|
|
let windowInfo = uni.getWindowInfo()
|
|
provide('statusHeight',windowInfo.statusBarHeight)
|
|
provide('windowWidth',windowInfo.windowWidth)
|
|
provide('safeAreaTop',windowInfo.safeArea.top)
|
|
var safeAreaBottom = windowInfo.safeAreaInsets.bottom
|
|
let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
|
provide('navHeight',menuButtonInfo.bottom + menuButtonInfo.top - windowInfo.statusBarHeight)
|
|
provide('menuTop',menuButtonInfo.top)
|
|
provide('menuHeight',menuButtonInfo.height)
|
|
provide('isiPhoneX',safeAreaBottom==34?true:false)
|
|
},
|
|
onShow: function() {
|
|
console.log('App Show')
|
|
},
|
|
onHide: function() {
|
|
console.log('App Hide')
|
|
},
|
|
globalData:{
|
|
mobileReg:/^1[3456789][0-9]{9}$/
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
/*每个页面公共css */
|
|
.flex
|
|
{
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
.flexCenter
|
|
{
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
.flexColumn
|
|
{
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
.flexColumnCenter
|
|
{
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
}
|
|
.flex1
|
|
{
|
|
flex: 1;
|
|
}
|
|
.flexWrap
|
|
{
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
}
|
|
.flexStretch
|
|
{
|
|
display: flex;
|
|
align-items: stretch;
|
|
}
|
|
.between
|
|
{
|
|
justify-content: space-between;
|
|
}
|
|
.flexEnd
|
|
{
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: flex-end;
|
|
}
|
|
.relative
|
|
{
|
|
position: relative;
|
|
}
|
|
.absolute
|
|
{
|
|
position: absolute;
|
|
}
|
|
.fixed
|
|
{
|
|
position: fixed;
|
|
}
|
|
view,input,textarea,scroll-view,swiper
|
|
{
|
|
box-sizing: border-box;
|
|
}
|
|
button
|
|
{
|
|
background-color: transparent;
|
|
}
|
|
button::after
|
|
{
|
|
border: none;
|
|
}
|
|
::-webkit-scrollbar
|
|
{
|
|
color: transparent;
|
|
width: 0;
|
|
}
|
|
</style>
|