如图,想问问,app启动执行的这段提示框代码怎么修改,我已经在app.js的launch事件里面写了判断网络的代码,运行也是正常的,但是还是要显示这个提示框,想问问这个提示框如何修改或者怎么让他隐藏或不执行,谢谢!
代码如下
-
onLaunch: function() {
//console.log('launch');
//var nh = true;
function plusReady(){
var types = {};
types[plus.networkinfo.CONNECTION_UNKNOW] = "Unknown connection";
types[plus.networkinfo.CONNECTION_NONE] = "No connection";
types[plus.networkinfo.CONNECTION_ETHERNET] = "Ethernet connection";
types[plus.networkinfo.CONNECTION_WIFI] = "WiFi connection";
types[plus.networkinfo.CONNECTION_CELL2G] = "Cellular 2G connection";
types[plus.networkinfo.CONNECTION_CELL3G] = "Cellular 3G connection";
types[plus.networkinfo.CONNECTION_CELL4G] = "Cellular 4G connection";if (plus.networkinfo.getCurrentType() == plus.networkinfo.CONNECTION_NONE || plus.networkinfo.getCurrentType() == plus.networkinfo.CONNECTION_UNKNOW) { mui.toast("No connection", "Tip"); return false; } } if(window.plus){ plusReady(); return false; }else{ document.addEventListener("plusready",plusReady,false); }
},
7***@qq.com
if (plus.networkinfo.getCurrentType() == plus.networkinfo.CONNECTION_NONE || plus.networkinfo.getCurrentType() == plus.networkinfo.CONNECTION_UNKNOW) {
mui.toast("No connection", "Tip");
return false;
}
}
如果不想提示的话把mui.toast("No connection", "Tip"); 这个注释掉试下
2018-04-02 10:46
g***@126.com (作者)
我是想重写一个方法来替换本来断网提示的弹窗,但是这样子做的话,会弹窗和toast都会执行,我就不明白哪里修改弹窗,一直困扰我
2018-04-02 11:26