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
         });
       }
     });