详细问题描述
[内容]
从A页面到B地图页面 然后返回A页面的时候地图页面黑屏,从B地图页面到C页面 然后返回的时候地图页面也黑屏 还特别严重
重现步骤
[步骤]
A ==> B B == >A 地图页面黑屏 B==>C C==>B地图页面黑屏
在线等 急急急
运行环境
[系统版本]
5.1.1
[浏览器版本]
真机调试
[IDE版本]
HBuilder
7.5.0.201610110231-alpha
[mui版本]
V3.0.0
附件
[代码片段]
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link href="../../css/mui.min.css" rel="stylesheet" />
<style type="text/css">
html,
body {
background-color: #efeff4;
/*background-color: #ccc;*/
}
.mui-action-back.mui-btn-link {
color: white;
font-size: 16px;
vertical-align: middle;
/*margin-top: 2px;*/
}
.mui-action-back.mui-btn-link span {
font-size: 25px;
}
#header .mui-icon span {
font-size: 16px;
vertical-align: baseline;
}
.tab_map {
/*display: none;*/
}
.mui-title .mui-icon {
font-size: 16px;
}
#look_list {
background-color: #fff;
padding: 0;
bottom: 5px;
/*display: none;*/
}
#look_list .mui-input-row label {
font-family: Muiicons;
line-height: 37px;
height: 35px;
padding: 0 5px;
width: 30%;
font-size: 12px;
}
#look_list .mui-input-row input {
height: 35px;
line-height: 35px;
color: #666;
padding-left: 5px;
}
.mui-bar .mui-input-row .mui-input-clear~.mui-icon-clear {
top: 8px;
right: 0;
}
#look_list input[placeholder] {
font-size: 14px;
text-align: left;
text-indent: 5px;
}
.mui-bar .mui-icon:active {
opacity: 1;
}
</style>
</head>
<body>
<header id="header" class="mui-bar mui-bar-nav">
<button class="mui-action-back mui-btn mui-btn-blue mui-btn-link mui-btn-nav mui-pull-left">
<span class="mui-icon mui-icon-left-nav "></span>
</button>
<h1 class="mui-title clitybtn" id="titles" data-type = "city"><span class="mui-icon mui-icon-arrowdown mui-right">---</span></h1>
<h1 class="mui-title" id="look_list">
<div class="mui-input-row">
<label class="mui-icon mui-icon-arrowdown clitybtn mui-right mui-btn-primary" data-type = "city"></label>
<input type="text" class="mui-input-clear" id="search" placeholder="师傅名称 如:薛剑">
</div>
</h1>
<a class="mui-icon mui-icon-map mui-pull-right tab_map">
<!--<span>地图</span>--></a>
<a class="mui-icon mui-icon-bars mui-pull-right tab_list">
<!--<span>列表</span>--></a>
</header>
<div class="mui-content">
</div>
<script src="../../js/mui.min.js"></script>
<script src="../../js/jquery-2.1.4.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
mui.init();
var type = null;
var mapwe, listwe;
var ws;
var city;
var webview={
'top': topoffset+'px',
'bottom': '0',
zindex: 99,
popGesture:'none'
}
var searchs=null;
function plusReady() {
var ws = plus.webview.currentWebview();
type = ws.type;
searchs=ws.search_extras;
var webcity = 'selectcity.html';
var webcitystyles = {
top: '0',
bottoom: '0',
zindex: 999,
background: 'transparent',
height: '100%'
}
var webcityextras = {
type: type
}
var tab_map=document.querySelector('#header .tab_map');
var titles=document.querySelector('#titles');
var look_list=document.querySelector('#look_list');
var tab_list=document.querySelector('#header .tab_list');
//创建地图页面
mapwe = plus.webview.create('map.html', 'map.html',webview, {type: type});
//创建列表页面
listwe = plus.webview.create('master_list.html', 'master_list.html', webview, {type: type});
//创建选择城市控件页面
city = plus.webview.create(
webcity,
webcity,
webcitystyles,
webcityextras
);
ws.append(mapwe);
ws.append(listwe);
ws.append(city);
console.log(searchs);
//判断是否是正常找师傅
if (searchs == false) {
plus.webview.hide(listwe);
tab_map.style.display='none';
look_list.style.display='none';
}else{
plus.webview.hide(mapwe);
tab_list.style.display='none';
titles.style.display='none';
}
plus.webview.hide(city)
var con = 0;
mui('#header').on('tap', '.mui-pull-right', function() {
con++;
if(con == 1) {
if (searchs == false) {
plus.webview.hide(mapwe, "none");
plus.webview.show(listwe, "none");
tab_list.style.display='none';
tab_map.style.display='block';
titles.style.display='none';
look_list.style.display='block';
}else{
plus.webview.show(mapwe, "none");
plus.webview.hide(listwe, "none");
tab_list.style.display='block';
tab_map.style.display='none';
titles.style.display='block';
look_list.style.display='none';
}
} else {
if (searchs == false) {
plus.webview.hide(listwe, "none");
plus.webview.show(mapwe, "none");
tab_map.style.display='none';
tab_list.style.display='block';
look_list.style.display='none';
titles.style.display='block';
}else{
plus.webview.show(listwe,"none");
plus.webview.hide(mapwe, "none");
tab_map.style.display='block';
tab_list.style.display='none';
look_list.style.display='block';
titles.style.display='none';
}
con = 0;
}
$(this).hide();
});
//初始化用户的位置 获取用户当前城市名称
plus.geolocation.getCurrentPosition(function(p) {
console.log(p.address.city);
document.querySelector('#titles span').innerText = p.address.city;
document.querySelector('#look_list label').innerText = p.address.city;
}, function(e) {
mui.toast("Gelocation Error: code - " + e.code + "; message - " + e.message);
});
}
//创建选择城市子页面
mui('#header').on('tap', '.clitybtn', function() {
var citytype= this.getAttribute('data-type');
var selectcity = plus.webview.getWebviewById('selectcity.html');
mui.fire(selectcity, 'citytap',{
citytype:citytype
});
plus.webview.show(city)
});
//获取到监听到选择性的城市
document.addEventListener('cityconfirm', function(event) {
document.querySelector('#titles span').innerText = event.detail.city;
document.querySelector('#look_list label').innerText = event.detail.city;
// console.log("选择省 "+event.detail.province)
// console.log("选择市 "+event.detail.city)
// console.log("选择区 "+event.detail.area)
});
//监听输入框
document.getElementById('search').addEventListener('keyup',function(){
var url = API_HOME + 'Employer/searchMaster';
var inputval=this.value;
mui.get(url,{name:inputval},function(html){
if (html) {
//数据传递到列表
var list=plus.webview.getWebviewById('master_list.html');
mui.fire(list,'searchlist',{
html:html,
inputval:inputval
});
}
},'html');
});
if(window.plus) {
plusReady();
} else {
document.addEventListener("plusready", plusReady, false);
}
var contentWebview = null;
document.querySelector('header').addEventListener('doubletap', function() {
if(contentWebview == null) {
contentWebview = plus.webview.currentWebview().children()[0];
}
contentWebview.evalJS("mui('#pullrefresh').pullRefresh().scrollTo(0,0,100)");
});
// var old_back = mui.back;
// mui.back = function(){
// plus.webview.currentWebview().close();
// var masterlist= plus.webview.getWebviewById('master_list');
// var maps= plus.webview.getWebviewById('map.html');
// plus.webview.hide( masterlist, 'none');
// plus.webview.hide( maps, 'none');
// plus.webview.close( masterlist, 'none');
// plus.webview.close( maps, 'none');
// mui.back();
// var wes=plus.webview.all();
// for (var i = 0; i < wes.length; i++) {
//
// console.log(wes[i].id);
// }
// }
</script>
</body>
</html>
[安装包]
联系方式
[QQ]
864173267
[电话]
qiubcym
目前是否已修复?
2016-12-07 20:42