Ver código fonte

【功能修复】App.vue 延迟 200 毫秒,避免 {errMsg: 'hideTabBar:fail not TabBar page'}(来自 cursor 修复建议)

YunaiV 6 meses atrás
pai
commit
ea28ca6875
1 arquivos alterados com 7 adições e 9 exclusões
  1. 7 9
      App.vue

+ 7 - 9
App.vue

@@ -3,33 +3,31 @@
   import { ShoproInit } from './sheep';
 
   onLaunch(() => {
-    // 隐藏原生导航栏 使用自定义底部导航
-    uni.hideTabBar();
+    // 延时隐藏原生导航栏
+    setTimeout(() => {
+      uni.hideTabBar();
+    }, 200);
 
     // 加载Shopro底层依赖
     ShoproInit();
   });
 
-  onError((err) => {
-    console.log('AppOnError:', err);
-  });
-
   onShow((options) => {
     // #ifdef APP-PLUS
     // 获取urlSchemes参数
     const args = plus.runtime.arguments;
     if (args) {
-    } 
+    }
 
     // 获取剪贴板
     uni.getClipboardData({
-      success: (res) => { },
+      success: (res) => {},
     });
     // #endif
 
     // #ifdef MP-WEIXIN
     // 确认收货回调结果
-    console.log(options,'options');
+    console.log(options, 'options');
     // #endif
   });
 </script>