diff --git a/fangija-zsyf/main.html b/fangija-zsyf/main.html index 7ac35c6..f85cbe4 100644 --- a/fangija-zsyf/main.html +++ b/fangija-zsyf/main.html @@ -30,7 +30,7 @@ - + 首页 @@ -132,8 +132,10 @@ var title = document.getElementById("title"); //选项卡点击事件 mui('.mui-bar-tab').on('tap', 'a', function(e) { + plus.nativeUI.showWaiting(); var targetTab = this.getAttribute('href'); if (targetTab == activeTab) { + plus.nativeUI.closeWaiting(); return; } //更换标题 @@ -156,18 +158,7 @@ plus.webview.hide(activeTab); //更改当前活跃的选项卡 activeTab = targetTab; - }); - //自定义事件,模拟点击“首页选项卡” - document.addEventListener('gohome', function() { - var defaultTab = document.getElementById("defaultTab"); - //模拟首页点击 - mui.trigger(defaultTab, 'tap'); - //切换选项卡高亮 - var current = document.querySelector(".mui-bar-tab>.mui-tab-item.mui-active"); - if (defaultTab !== current) { - current.classList.remove('mui-active'); - defaultTab.classList.add('mui-active'); - } + plus.nativeUI.closeWaiting(); }); // 加载启动页信息 @@ -223,6 +214,7 @@ plus.webview.show(plus.webview.getWebviewById("HBuilder")); var targetTab = event.detail.name; if (targetTab == activeTab) { + plus.webview.show(targetTab); return; } //若为iOS平台或非首次显示,则直接显示