代码拉取完成,页面将自动刷新
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover" />
<title>江北新区智慧管网</title>
<link href="css/mui.min.css" rel="stylesheet" />
<link href="css/iconfont.css" rel="stylesheet" />
<link href="css/style.css" rel="stylesheet" />
</head>
<body>
<nav class="mui-bar mui-bar-tab" id="tabBar">
<a class="mui-tab-item mui-active" id="jichu.html">
<span class="mui-icon iconfont icon-list"></span>
<span class="mui-tab-label">基础</span>
</a>
<a class="mui-tab-item" id="shenpi.html">
<span class="mui-icon iconfont icon-shenpi"></span>
<span class="mui-tab-label">审批</span>
</a>
<a class="mui-tab-item" id="xunjian.html">
<span class="mui-icon iconfont icon-jiancha"></span>
<span class="mui-tab-label">任务</span>
</a>
<a class="mui-tab-item" id="gaojing.html">
<span class="mui-icon iconfont icon-warning"></span>
<span class="mui-tab-label">告警</span>
</a>
<a class="mui-tab-item" id="wode.html">
<span class="mui-icon iconfont icon-wode"></span>
<span class="mui-tab-label">我的</span>
</a>
</nav>
<script src="js/mui.min.js"></script>
<script src="js/common.js"></script>
<script type="text/javascript" charset="utf-8">
// tabbar页面切换
var initEnd=false;
mui.plusReady(function(){
var token=Session.getToken();
if(!token){
showLogin();
}else{
initSub();
initEnd=true;
}
})
function initSub(){
mui.init({
subpages: [
{ url: 'html/jichu.html', id: 'jichu.html', styles: { top: '0', bottom: '50px' } ,show:{autoShow:true}},
{ url: 'html/shenpi.html', id: 'shenpi.html', styles: { top: '0', bottom: '50px' },show:{autoShow:false} },
{ url: 'html/xunjian.html', id: 'xunjian.html', styles: { top: '0', bottom: '50px' },show:{autoShow:false} },
{ url: 'html/gaojing.html', id: 'gaojing.html', styles: { top: '0', bottom: '50px' } ,show:{autoShow:false}},
{ url: 'html/wode.html', id: 'wode.html', styles: { top: '0', bottom: '50px' },show:{autoShow:false} }
]
});
}
function plusReady(){
window.addEventListener('homeReady', function() {
var view = plus.webview.getWebviewById('jichu.html');
view.show();
});
}
if (window.plus) {
plusReady();
} else {
document.addEventListener('plusready',plusReady,false);
}
mui("#tabBar").on('tap', 'a', function(e) {
var id = this.getAttribute('id');
var view = plus.webview.getWebviewById(id);
view.show();
var idArr=['jichu.html','shenpi.html','xunjian.html','gaojing.html','wode.html'];
for(var i=0;i<idArr.length;i++){
var tempId=idArr[i];
if(id!=tempId){
// console.log('hide:'+tempId);
plus.webview.getWebviewById(tempId).hide();
}
}
});
// 设置状态栏
mui.plusReady(function() {
plus.navigator.setStatusBarStyle('light');
plus.navigator.setStatusBarBackground('#3697ff');
var clientInfo=plus.push.getClientInfo();
// console.log(JSON.stringify(clientInfo));
// 扩展API加载完毕,现在可以正常调用扩展API
// 添加监听从系统消息中心点击某条消息启动应用事件
plus.push.addEventListener( "receive", function ( msg ) {
// 分析msg.payload处理业务逻辑
if (plus.os.name == "iOS") {
console.log(msg.payload);
if(("string"==typeof msg.payload)&&msg.payload.indexOf('LocalMSG')>=0) {
console.log('本地消息不处理');
}else{
// console.log(44);
createLocalPushMsg(msg);
}
}else{
// console.log(55)
}
// console.log(55)
}, false );
plus.push.addEventListener( "click", function ( msg ) {
// console.log('click');
// console.log('msg\t'+JSON.stringify(msg));
plus.nativeUI.showWaiting();
setTimeout(function(){
plus.nativeUI.closeWaiting();
if(plus.webview.getWebviewById('login')){
console.log('未登录')
return;
}
var payLoad=msg.payload;
if(typeof payLoad=="string"){
payLoad=payLoad.replace('LocalMSG','')
payLoad=JSON.parse(payLoad);
}
showPushPage(payLoad);
},1000);
}, false );
//创建本地消息
function createLocalPushMsg(msg) {
var options = {cover: false};
if(msg.payload.type==0){
options.title='【告警通知】';
}else if(msg.payload.type==1){
options.title='【提示通知】';
}else if(msg.payload.type==2){
options.title='【巡检任务通知】';
}else if(msg.payload.type==3){
options.title='【工单派发通知】';
}else if(msg.payload.type==3){
options.title='【流程单】';
}
// console.log('msg.payload'+msg.payload);
plus.push.createMessage(msg.content, 'LocalMSG'+JSON.stringify(msg.payload) , options);
if (plus.os.name == "iOS") {
outLine('*如果无法创建消息,请到"设置"->"通知"中配置应用在通知中心显示!');
}
}
});
function showPushPage(data){
var id=data.param;
if(data.type==0||data.type==1){
// console.log('打开消息');
var webview=plus.webview.getWebviewById('info-detail');
if(webview&&webview.close){
webview.close('none');
}
setTimeout(function(){
mui.openWindow({
url: 'html/info-detail.html',
id: 'info-detail',
extras:{
gaojingId:id
}
});
},100);
}else if(data.type==2){
console.log('巡检');
var webview=plus.webview.getWebviewById('xunjian-detail');
if(webview&&webview.close){
webview.close('none');
}
setTimeout(function(){
mui.openWindow({
url: 'html/xunjian-detail.html',
id: 'xunjian-detail',
extras:{
inspectId:id
}
});
},100);
}else if(data.type==3){
// console.log('巡检');
var webview=plus.webview.getWebviewById('work-order-detail');
if(webview&&webview.close){
webview.close('none');
}
setTimeout(function(){
mui.openWindow({
url: 'html/work-order-detail.html',
id: 'work-order-detail',
extras:{
workOrderId:id
}
});
},100);
}
else if(data.type==4){
// console.log('巡检');
var webview=plus.webview.getWebviewById('shenpi.html');
webview.show();
mui.fire(webview,'daiban');
}
}
function checkLogin(){
var token=Session.getToken();
if(!token){
}
}
function showLogin(){
if(!plus.webview.getWebviewById('login')){
mui.openWindow({
url: 'html/login.html',
id:'login',
waiting: {
autoShow: true
}
});
}
}
window.addEventListener('loginSuccess', function(event){
if(!initEnd){
initSub();
}
var wvs=plus.webview.all();
for(var i=0;i<wvs.length;i++){
mui.fire(wvs[i],'refresh');
}
})
window.addEventListener('showLogin', function(event){
showLogin();
});
window.addEventListener('showWode',function(){
})
</script>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。