mui退出软件点击两次提示

来源:互联网 发布:封印者n卡优化 编辑:程序博客网 时间:2024/06/03 17:22
/点击两次就退出软件
var backcount=0;
mui.back = function () {
if (mui.os.ios) return;
if (backcount > 0) {
if (window.plus) plus.runtime.quit();
return;
};
mui.toast(‘再按一次退出应用’);
backcount++;
setTimeout(function () {
backcount = 0;
}, 2000);
};

 

退出登录

<ul class=”mui-table-view”>
<li class=”mui-table-view-cell” style=”text-align: center;cursor:pointer;background-color:#E4393F;color:#fff;”>
<a id=”logout” href=”login.html”>退出登录</a>
</li>
</ul>

mui(“.mui-table-view”).on(“tap”,”#logout”,function(){

var usr=JSON.parse(localstorage[‘user’]);    //把你在login页面存储的内容获取到重置                                                                   // localStorage[‘user’]=JSON.stringify(data.data);

user=””;

mui.openWindow({
url:”login.html”,
id:”login.html”
})

 

});

0 0