123456789101112131415161718192021 |
- /**
- * 获取导航栏高度
- */
- export const getNavBarHeight = () =>{
- return new Promise((resolve, reject) => {
- // 在 App.vue 中初始化
- uni.getSystemInfo({
- success: (res) => {
- const statusBarHeight = res.statusBarHeight;
- console.log('res.platform',res.platform);
-
- const navBarHeight =
- (res.platform === 'android' ? 48 : 44) + res.statusBarHeight;
- resolve( { statusBarHeight, navBarHeight })
- },
- fail: (err) => {
- reject(err)
- }
- })
- })
- }
|