system.js 416 B

1234567891011121314
  1. const SYSTEM_INFO = uni.getSystemInfoSync();
  2. export const getStatusBarHeight = ()=>SYSTEM_INFO.statusBarHeight || 10;
  3. export const getTitleBarHeight = ()=>{
  4. if(uni.getMenuButtonBoundingClientRect){
  5. let {top,height} = uni.getMenuButtonBoundingClientRect();
  6. return height + (top - getStatusBarHeight())*2;
  7. }else{
  8. return 40
  9. }
  10. }
  11. export const getNavBarHerder = ()=> getStatusBarHeight() + getTitleBarHeight();