飞上青天
飞上青天
  • 发布:2014-12-13 12:17
  • 更新:2016-03-10 17:19
  • 阅读:4986

登陆成功后关闭以前的页面时页面白屏或闪退,如何解决?

分类:MUI
mui

登陆页面的代码

    success:function(data){  
                if(data.Result){  
                    var rs = data.Other.split(',');  
                    tdol.setItem(tdol.cacheKey.userId,rs[0]); //缓存用户id  
                    tdol.setItem(tdol.cacheKey.password,psold);  //缓存密码  
                    tdol.setItem(tdol.cacheKey.isMember,Boolean(parseInt(rs[1])));  
                    if(rs[1] =="1"){   //如果是会员  
                        mui.openWindow({  
                        id:'main-index',  
                        url:'/module/main_loaded/main_index.html',  
                        show:{  
                            aniShow:"slide-in-left"  
                        },  
                        waiting:{  
                            autoShow:false  
                        }  
                    });  
                    //关闭以前打开的页面  
                    tdol.closeWebView('newIndex');  
                    tdol.closeWebView('main-menu');  
                    tdol.closeWebView('/module/main/tab-infomation.html')  
                    tdol.closeWebView('/module/main/tab-activitiy.html');  
                    tdol.closeWebView('/module/main/tab-product.html');  
                    tdol.closeWebView('/module/main/tab-interact.html');  
                    tdol.closeWebView(plus.runtime.appid);

这是closeView的方法实现

  closeWebView:function(selfId){  
            var self = plus.webview.getWebviewById(selfId);  
            if(self){  
                self.close();  
            }  
        },

新打开的页面就会白屏或者闪退,发现在运行时关闭页面就很容易出问题,比如页面加载的时候我写个

mui.plusready(function(){  
plus.webview.getWebviewById("login").close();  
})

有时候就会出现问题,官方难道没有遇见到这个问题么?现在我这边遇到的问题主要集中在登陆的时候
打开新的主页面,关闭以前匿名用户开的页面,这个时候iphone上就好好的,但是在安卓上就会出现白屏或闪退,有没有好的解决方案?

2014-12-13 12:17 负责人:无 分享
已邀请:
飞上青天

飞上青天 (作者)

能来个人回答一下么?

年二十二

年二十二

先hide再close就不会出现这种奇怪的问题了

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