柒零 il y a 1 an
Parent
commit
746afb6c72
2 fichiers modifiés avec 14 ajouts et 1 suppressions
  1. 11 1
      app.js
  2. 3 0
      pages/index/index.js

+ 11 - 1
app.js

@@ -4,7 +4,16 @@
 const homeApi_empower = "https://aipush.aidsleep.cn";
 App({
   onLaunch() {
-    wx.hideTabBar()
+    // 在需要隐藏 tabBar 的页面的脚本中调用
+    wx.hideTabBar({
+      animation: false, // 是否需要动画效果,默认为 false
+      success: function () {
+        console.log('TabBar 已经被隐藏');
+      },
+      fail: function (err) {
+        console.error('隐藏 TabBar 失败', err);
+      }
+    });
     // 展示本地存储能力
     // const logs = wx.getStorageSync('logs') || []
     // logs.unshift(Date.now())
@@ -84,6 +93,7 @@ App({
     })
   },
   onShow() {
+    wx.hideTabBar()
   },
   globalData: {
     userInfo: null,

+ 3 - 0
pages/index/index.js

@@ -214,6 +214,7 @@ Page({
    */
   onLoad(options) {
 
+    wx.hideTabBar()
   },
 
   /**
@@ -221,6 +222,7 @@ Page({
    */
   onReady() {
 
+    wx.hideTabBar()
   },
 
   /**
@@ -228,6 +230,7 @@ Page({
    */
   onShow() {
 
+    wx.hideTabBar()
     this.checkAuth()
   },
   showDialog() {