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