在app.js中获取状态栏信息和胶囊按钮信息
onLaunch() {
// 展示本地存储能力
const logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
// 获取系统信息
this.globalData.systemInfo = wx.getSystemInfoSync();
// 获取状态栏高度
this.globalData.statusBarHeight = this.globalData.systemInfo.statusBarHeight
// 胶囊按钮位置信息
this.globalData.menuButtonInfo = wx.getMenuButtonBoundingClientRect();
// 获取导航栏高度
this.globalData.navBarHeight = this.globalData.menuButtonInfo.bottom + (this.globalData.menuButtonInfo.top - this.globalData.statusBarHeight)
},
globalData: {
statusBarHeight: '',
menuButtonInfo: {
}