118 lines
2.4 KiB
Vue
118 lines
2.4 KiB
Vue
<script>
|
|
import config from './config'
|
|
import store from '@/store'
|
|
import {
|
|
getToken
|
|
} from '@/utils/auth'
|
|
|
|
export default {
|
|
onLaunch: function() {
|
|
this.initApp()
|
|
},
|
|
methods: {
|
|
// 初始化应用
|
|
initApp() {
|
|
// 初始化应用配置
|
|
this.initConfig()
|
|
this.getSys()
|
|
this.calcNavBarInfo()
|
|
},
|
|
getSys() {
|
|
uni.getSystemInfo({
|
|
success: res => {
|
|
this.globalData.sys = res
|
|
}
|
|
})
|
|
},
|
|
initConfig() {
|
|
this.globalData.config = config
|
|
},
|
|
calcNavBarInfo () {
|
|
// 获取系统信息
|
|
const systemInfo = uni.getSystemInfoSync();
|
|
// 胶囊按钮位置信息
|
|
const menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
|
// 导航栏高度 = 状态栏到胶囊的间距(胶囊上坐标位置-状态栏高度) * 2 + 胶囊高度 + 状态栏高度
|
|
this.globalData.navBarHeight = (menuButtonInfo.top - systemInfo.statusBarHeight) * 2 + menuButtonInfo.height + systemInfo.statusBarHeight;
|
|
// 状态栏和菜单按钮(标题栏)之间的间距
|
|
// 等同于菜单按钮(标题栏)到正文之间的间距(胶囊上坐标位置-状态栏高度)
|
|
this.globalData.menuBottom = menuButtonInfo.top - systemInfo.statusBarHeight;
|
|
// 菜单按钮栏(标题栏)的高度
|
|
this.globalData.menuHeight = menuButtonInfo.height;
|
|
// 按钮的宽度
|
|
this.globalData.menuWidth = menuButtonInfo.width;
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
@import "@/uni_modules/uview-ui/libs/css/flex.scss";
|
|
/* #ifndef APP-PLUS-NVUE */
|
|
@import '@/static/font/common.css';
|
|
@import '@/static/scss/currency.css';
|
|
@import '@/static/scss/index.scss';
|
|
@import "@/uni_modules/uview-ui/index.scss";
|
|
|
|
page {
|
|
background-color: #fff;
|
|
}
|
|
|
|
body {
|
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
|
}
|
|
|
|
.flex {
|
|
display: flex;
|
|
}
|
|
|
|
.f-jce {
|
|
display: flex;
|
|
justify-content: end;
|
|
}
|
|
|
|
.f-jcsa {
|
|
display: flex;
|
|
justify-content: space-around;
|
|
}
|
|
|
|
.f-jcsb {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
|
|
}
|
|
|
|
.f-jc-c {
|
|
display: flex;
|
|
justify-content: center;
|
|
}
|
|
|
|
.f-a-i {
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.f-a-e {
|
|
display: flex;
|
|
align-items: flex-end;
|
|
}
|
|
|
|
.flex-center {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.ma-top {
|
|
margin-top: 16rpx;
|
|
}
|
|
|
|
|
|
.header-left {
|
|
padding: 12rpx 24rpx;
|
|
border-radius: 30rpx;
|
|
background: #fff;
|
|
}
|
|
|
|
/* #endif */
|
|
</style> |