getSystemInfo.js 486 B

123456789101112131415161718
  1. export default {
  2. data() {
  3. return {
  4. h:uni.getSystemInfoSync().windowHeight,//屏幕高度
  5. mt:uni.getSystemInfoSync().statusBarHeight + 44,//自定义头部组件高度(使用自定义头部组件的上边距)
  6. th:50+uni.getSystemInfoSync().safeAreaInsets.bottom//底部tabbar高度
  7. }
  8. },
  9. onShow(){
  10. uni.getSystemInfo({
  11. success:res=>{
  12. if(res.platform === 'android'){
  13. this.th = res.screenHeight - res.windowHeight - res.statusBarHeight - 48;
  14. }
  15. }
  16. })
  17. }
  18. }