From fb2f28d70c7b299e49a85bc545d9a5f838732883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E5=90=89=E6=AC=A2?= Date: Mon, 7 May 2018 11:30:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=87=E6=8D=A2=E4=B8=BB?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/main.html | 45 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/fangija-zsyf/main.html b/fangija-zsyf/main.html index b0b0305..7ac35c6 100644 --- a/fangija-zsyf/main.html +++ b/fangija-zsyf/main.html @@ -35,17 +35,17 @@ 首页 - + 行情 - + 评估 - + 我的 @@ -72,8 +72,6 @@ localStorage.removeItem("user_token"); localStorage.removeItem("user_token_add_time"); } - //document.getElementById("quotations").setAttribute("href", BASE_PATH + '/quotations/index'); - //document.getElementById("selfInfo").setAttribute("href", BASE_PATH + '/selfInfo/index'); //mui初始化 mui.init(); var subpages = ['yfindex.html', 'views/house/houseDetail.html', 'views/house/houseManageList.html', 'views/user/userInfo.html']; @@ -217,6 +215,43 @@ } }) } + + + // 推送消息跳转页面 + window.addEventListener('switchView',function(event){ + console.log(event.detail.name) + plus.webview.show(plus.webview.getWebviewById("HBuilder")); + var targetTab = event.detail.name; + if (targetTab == activeTab) { + return; + } + //若为iOS平台或非首次显示,则直接显示 + if(mui.os.ios||aniShow[targetTab]){ + if(plus.webview.getWebviewById(targetTab)==null){ + plus.webview.create(targetTab, targetTab, subpage_style) + } + plus.webview.show(targetTab); + }else{ + //否则,使用fade-in动画,且保存变量 + var temp = {}; + temp[targetTab] = "true"; + mui.extend(aniShow,temp); + plus.webview.show(targetTab,"fade-in",300); + } + //隐藏当前; + plus.webview.hide(activeTab); + //更改当前活跃的选项卡 + activeTab = targetTab; + var defaultTab = document.getElementById(targetTab); + //模拟首页点击 + 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'); + } + });