From 66f4a45e05a432f683792d3d30265dcd2a81ab66 Mon Sep 17 00:00:00 2001 From: raoyanhui Date: Tue, 8 May 2018 18:02:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=20=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E6=97=B6=E5=80=99=EF=BC=8C=20=E5=BA=95=E9=83=A8=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E5=8D=A1=EF=BC=8C=20=20=E5=87=BA=E7=8E=B0=E7=A9=BA?= =?UTF-8?q?=E7=99=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/main.html | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fangija-zsyf/main.html b/fangija-zsyf/main.html index 3baae00..5804d1b 100644 --- a/fangija-zsyf/main.html +++ b/fangija-zsyf/main.html @@ -127,12 +127,14 @@ } self.append(sub); } + }); //当前激活选项 var activeTab = subpages[0]; var title = document.getElementById("title"); //选项卡点击事件 mui('.mui-bar-tab').on('tap', 'a', function(e) { + var self = plus.webview.currentWebview(); plus.nativeUI.showWaiting(); var targetTab = this.getAttribute('href'); if (targetTab == activeTab) { @@ -144,7 +146,8 @@ //显示目标选项卡 //若为iOS平台或非首次显示,则直接显示 if(plus.webview.getWebviewById(targetTab)==null){ - plus.webview.create(targetTab, targetTab, subpage_style) + var sub = plus.webview.create(targetTab, targetTab, subpage_style) + self.append(sub); } if(mui.os.ios||aniShow[targetTab]){ plus.webview.show(targetTab); @@ -211,9 +214,9 @@ }) } - // 推送消息跳转页面 window.addEventListener('switchView',function(event){ + var self = plus.webview.currentWebview(); console.log(event.detail.name) plus.webview.show(plus.webview.getWebviewById("HBuilder")); var targetTab = event.detail.name; @@ -224,7 +227,8 @@ //若为iOS平台或非首次显示,则直接显示 if(mui.os.ios||aniShow[targetTab]){ if(plus.webview.getWebviewById(targetTab)==null){ - plus.webview.create(targetTab, targetTab, subpage_style) + var sub = plus.webview.create(targetTab, targetTab, subpage_style) + self.append(sub); } plus.webview.show(targetTab); }else{