zjh 5 년 전
부모
커밋
ff300a9c6e
2개의 변경된 파일19개의 추가작업 그리고 7개의 파일을 삭제
  1. 11 5
      pages/drop/drop.js
  2. 8 2
      pages/rise/rise.js

+ 11 - 5
pages/drop/drop.js

@@ -145,11 +145,17 @@ Page({
     // 获取系统信息 
     wx.getSystemInfo({
       success: function(res) {
-        
-        that.setData({
-          winWidth: res.windowWidth,
-          winHeight: res.windowHeight
-        });
+        let navHeight,
+        isiOS = res.system.indexOf('iOS') > -1
+        if(isiOS){
+          navHeight=44
+        }else{
+          navHeight=48
+        }
+      that.setData({
+        winWidth: res.windowWidth,
+        winHeight: res.windowHeight - res.statusBarHeight - navHeight
+      });
       }
     });
   },

+ 8 - 2
pages/rise/rise.js

@@ -137,10 +137,16 @@ Page({
     // 获取系统信息 
     wx.getSystemInfo({
       success: function(res) {
-        
+          let navHeight,
+          isiOS = res.system.indexOf('iOS') > -1
+          if(isiOS){
+            navHeight=44
+          }else{
+            navHeight=48
+          }
         that.setData({
           winWidth: res.windowWidth,
-          winHeight: res.windowHeight
+          winHeight: res.windowHeight - res.statusBarHeight - navHeight
         });
       }
     });