详细问题描述
ios 10.1 https下 append的方法,在Webview窗口中添加子窗口失效,场景:无等待窗体切换,head跟body分开导致无法使用,另外经测试mui.init(subpages:[{}]) children opened 等方法无法使用
期望:希望请官方帮忙看看,告知解决的办法,谢谢。
运行环境
ios10.1.1
var templates = {};
var aniShow = "pop-in";
return {
initTemplates:function(winid){
this.getTemplate(winid);
},
getTemplate : function(name) {
var template = templates[name];
if (!template) {
var templateUrl = 'template.html';
var headerWebview = mui.preload({
url: templateUrl,
id: name + "-main",
styles: {
popGesture: "hide"
},
extras: {
mType: 'main'
}
});
var subWebview = mui.preload({
url: "",
id: name + "-sub",
styles: {
scrollIndicator:'none',
top: '0px',
bottom: '0px'
},
show:{
autoShow: false
},
extras: {
mType: 'sub'
}
});
subWebview.addEventListener('loaded', function() {
setTimeout(function() {
subWebview.show();
}, 0);
});
headerWebview.append(subWebview);
if (mui.os.ios) {
headerWebview.addEventListener('hide', function() {
subWebview.hide("none");
});
}
templates[name] = template = {
name: name,
header: headerWebview,
content: subWebview,
};
}
return template;
},
Click : function(alink,winid){
var href = alink.href;
var template = this.getTemplate(winid);
var header = template.header;
var content = template.content;
var params = {
showMenu: false,
target:href,
aniShow:aniShow
}
mui.fire(header, 'updateHeader', params);
if(mui.os.ios || (mui.os.android&&parseFloat(mui.os.version)<4.4)){
var reload = true;
if (!template.loaded) {
content.loadURL(href);
} else {
reload = false;
}
(!reload) && content.show();
header.show(aniShow);
}
}
}
联系方式
260948133
15018820530
0 个回复