Monokeros
Monokeros
  • 发布:2017-03-28 10:43
  • 更新:2017-03-28 10:43
  • 阅读:1030

【报Bug】Webview的close事件有时不触发

分类:HTML5+

详细问题描述
如题。频繁操作create, open, close后,webview的close会出现不触发的情况。

重现步骤
偶尔,无法规律性重现,怀疑和操作频率有关

运行环境
HBuilder 8.0.2.201703061842
Nubia Z11

附件

row.addEvent('click', function(){  
	// 原本应该在close event里清空_questionWV,结果偶尔因为不触发event而导致这条判断永远true  
	if ( APP.QList._questionWV )  
		return;  
  
	// 开始怀疑是代码相应造成的问题,所以加上了setTimeout来强制执行秩序,可是没有效果。APP.wvMgr是我自己的webview管理封装。  
	setTimeout(function(){  
	window.APP.QList._questionWV = APP.wvMgr.create("_www/html/single/question.html", 'html/single/question.html', {}, {}, {  
		noappend : true,  
		parentwv : plus.webview.getLaunchWebview()  
	});  
	}, 0);  
				  
	setTimeout(function(){  
	window.APP.wvMgr.create("_www/html/single/question_c.html", 'html/single/question_c.html', {  
		top : '45px',  
		bottom : '0px'  
	}, {  
		qid : q.id  
	}, {  
		parentwv : window.APP.QList._questionWV  
	});  
	}, 0);  
				  
	setTimeout(function(){  
	window.APP.QList._questionWV.addEventListener('close', function(){  
		console.log('>>>>>>>>>> close event!');  
		window.APP.QList._questionWV = null;  
	}, false);  
	}, 0);  
				  
	setTimeout(function(){  
	window.APP.QList._questionWV.show('pop-in');  
	}, 0);  
});

联系方式
QQ:847547233

2017-03-28 10:43 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复