function(data){
if(data.status == 1){
plus.storage.setItem('phone',data.phone+'');
plus.storage.setItem('password',data.password+'');
mui.toast('登录成功');
setTimeout(function(){
var _self = plus.webview.currentWebview();
_self.close();
},1500);
mui.openWindow({
url:'sub4.html',
id:'sub4.html'
});
}else{
mui.toast(data.message);
}
}
以上代码是一个post请求的回调函数,登录成功之后有toast提示,也会执行setTimeout()关闭当前页面,但是mui.openWindow()不执行,不会跳到自己指定的sub4.html页面。
3***@qq.com (作者)
setTimeout(function(){
var _self = plus.webview.currentWebview();
_self.close();
mui.openWindow({
url:'sub4.html',
id:'sub4.html'
});
console.log(111);
},1500);
您说的是这样吗?这样111倒是可以打印出来,可是mui.openWindow并没有跳到指定的sub4.html页面。
2018-04-26 09:52
追梦随想
这不可能啊,或者你先把关闭当前页注释了试试
2018-04-26 09:57
3***@qq.com (作者)
回复 追梦随想:还是没有用 麻烦你看下我在底下把代码截图下来
2018-04-26 10:12