joey1988
joey1988
  • 发布:2015-10-18 15:05
  • 更新:2016-02-23 17:23
  • 阅读:2202

【报bug】后退按钮出现白屏

分类:MUI

首页点击后退按钮,触发方法

var first = null;  
        mui.back = function() {  
            //首次按键,提示‘再按一次退出应用’  
            if (!first) {  
                first = new Date().getTime();  
                mui.toast('再按一次退出应用');  
                setTimeout(function() {  
                    first = null;  
                }, 1000);  

            } else {  
                if (new Date().getTime() - first < 1000) {  
                    plus.runtime.quit();  
                }  
            }         
        };

出现提示“再按一次退出应用”,后直接白屏了
找到问题了,是common.js那边有
w.back=function(hide){
if(w.plus){
ws||(ws=plus.webview.currentWebview());
if(hide||ws.preate){
ws.hide('auto');
}else{
ws.close('auto');
}
}else if(history.length>1){
history.back();
}else{
w.close();
}
};
这个地方导致的,一个坑,找了好久

2015-10-18 15:05 负责人:无 分享
已邀请:
tuchaofu

tuchaofu - 没有不能实现的功能,只有没有理清楚的逻辑

ws||(ws=plus.webview.currentWebview());
if(hide||ws.preate){
ws.hide('auto');
}else{
ws.close('auto');

去掉就好了

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