guhongwei 3 lat temu
rodzic
commit
45578bd9b2
1 zmienionych plików z 3 dodań i 2 usunięć
  1. 3 2
      pages/test/index.js

+ 3 - 2
pages/test/index.js

@@ -25,8 +25,9 @@ Page({
   searchHeight: function () {
     let frameStyle = this.data.frameStyle;
     let client = app.globalData.client;
-    // 减去状态栏
-    let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
+    let infoHeight = client.windowHeight;
+    // 是否去掉状态栏
+    if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
     // 是否减去底部菜单
     if (frameStyle.useBar) infoHeight = infoHeight - 50;
     if (infoHeight) this.setData({ infoHeight: infoHeight })