代码拉取完成,页面将自动刷新
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link href="css/mui.min.css" rel="stylesheet" />
</head>
<body>
<header class="mui-bar mui-bar-nav">
<span class="mui-icon mui-icon-reload mui-spin mui-pull-left" id='update' style="display: none;"></span>
<h1 class="mui-title" id="title">通恒干部管理系统</h1>
<span class="mui-icon mui-icon-search mui-pull-right" id='search' style="display: none;"></span>
</header>
<script src="js/mui.min.js"></script>
<script src="js/main.js" type="text/javascript"></script>
<script src="js/app.js"></script>
<script src="js/md5.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
mui.init();
var subpages = ['main.html', 'login.html', 'search.html', 'modify_password.html'];
var aniShow = {};
//创建子页面,首个选项卡页面显示,其它均隐藏;、、
mui.plusReady(function() {
// d = new Date();
// y = d.getFullYear();
// if(y != 2016){
// mui.alert("已过期,请联系管理员");
// return;
// }
plus.storage.removeItem('isRunning');
token = localStorage.getItem("token");
autoLogin = localStorage.getItem("autoLogin");
passwordChange = localStorage.getItem("passwordChange");
if(!passwordChange) {
localStorage.setItem("user_init", "test");
localStorage.setItem("ps_init", "123456");
}
// autoLogin = false;
if(autoLogin && token) {
var mainPage = mui.preload({
"id": 'main',
"url": 'main.html',
"styles": subpage_style
});
var main_loaded_flag = false;
mainPage.addEventListener("loaded", function() {
main_loaded_flag = true;
});
var toMain = function() {
var id = setInterval(function() {
if(main_loaded_flag) {
clearInterval(id);
mui.fire(mainPage, 'show', null);
mui("#search")[0].style.display = '';
mui("#update")[0].style.display = '';
mainPage.show("pop-in");
}
}, 20);
};
// document.getElementById("title").innerHTML = '';
toMain();
plus.navigator.closeSplashscreen();
} else {
var loginPage = mui.preload({
"id": 'login',
"url": 'login.html',
"styles": subpage_style
});
var main_loaded_flag = false;
loginPage.addEventListener("loaded", function() {
main_loaded_flag = true;
});
var toMain = function() {
var id = setInterval(function() {
if(main_loaded_flag) {
clearInterval(id);
mui.fire(loginPage, 'show', null);
loginPage.show("pop-in");
}
}, 20);
};
document.getElementById("title").innerHTML = '登录';
plus.navigator.closeSplashscreen();
toMain();
}
window.addEventListener('setTitle', function(e) {
mui('#title')[0].innerText = e.detail.title;
});
window.addEventListener('showSearchIcon', function(e) {
mui("#search")[0].style.display = '';
mui("#update")[0].style.display = '';
});
var searchPage = mui.preload({
"id": 'search',
"url": 'search.html',
"styles": subpage_style
});
var main_loaded_flag = false;
searchPage.addEventListener("loaded", function() {
main_loaded_flag = true;
});
var toMain = function() {
var id = setInterval(function() {
if(main_loaded_flag) {
clearInterval(id);
mui.fire(searchPage, 'show', null);
searchPage.show("pop-in");
}
}, 20);
};
document.getElementById("search").addEventListener("tap", function() {
user_name = mui('#title')[0].innerText;
localStorage.setItem('user_name',user_name);
mui('#title')[0].innerText = '检索';
toMain();
});
document.getElementById("update").addEventListener("tap", function() {
var btnArray = ['是', '否'];
// var u = update();
plus.nativeUI.confirm("从服务端同步数据到本机", updateBtnCB, "更新?", btnArray);
});
updateBtnCB = function(event){
if(event.index == 0){
main = plus.webview.getWebviewById('main');
mui.fire(main,'update',null);
}
};
var backButtonPress = 0;
mui.back = function(event) {
backButtonPress++;
if(backButtonPress > 1) {
plus.runtime.quit();
} else {
plus.nativeUI.toast('再按一次退出应用');
}
setTimeout(function() {
backButtonPress = 0;
}, 1000);
return false;
};
});
</script>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。