const getMenuTop = () => {
let system = uni.getSystemInfoSync() //获取设备信息
// let custom = uni.getMenuButtonBoundingClientRect() //获取右上角胶囊信息
// this.globalData.capsuleTop = custom.top //胶囊距离顶部位置
// console.log(system.statusBarHeight + system.safeArea.top,'system.statusBarHeight + system.safeArea.top');
this.headerTop = system.statusBarHeight + system.safeArea.top
}
如果设置的自定义的头部 可以用这个方法 设置头部距离