<!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" />
|
|
<style>
|
.mui-bar-nav {
|
background: #245ca7;
|
-webkit-box-shadow: none;
|
box-shadow: none;
|
}
|
|
.mui-title {
|
color: #FFFFFF;
|
}
|
|
.mui-icon-back:before,
|
.mui-icon-left-nav:before {
|
color: #FFFFFF;
|
}
|
|
.mui-grid-view.mui-grid-9 {
|
margin: auto;
|
background-color: #4e555b;
|
border-left: none;
|
border-top: none;
|
}
|
|
.mui-grid-view.mui-grid-9 .mui-table-view-cell {
|
padding: 10px 10px;
|
}
|
|
.mui-grid-view.mui-grid-9 .mui-table-view-cell>a:not(.mui-btn) {
|
padding: 8px 0;
|
}
|
|
.mui-col-xs-4 {
|
width: 33.333333%;
|
}
|
|
.mui-icon-list,
|
.mui-icon-chat,
|
.mui-icon-contact,
|
.mui-icon-gear,
|
.mui-icon-close {
|
color: #FFFFFF;
|
}
|
|
.mui-grid-view.mui-grid-9 .mui-media .mui-icon {
|
font-size: 2.4em;
|
position: relative;
|
border-radius: 50px;
|
padding: 12px;
|
}
|
|
.mui-table-view.mui-grid-view .mui-table-view-cell .mui-media-body {
|
color: #FFFFFF;
|
}
|
|
.mui-grid-view.mui-grid-9:after,
|
.mui-grid-view.mui-grid-9:before {
|
display: none;
|
|
}
|
|
.depot_img {
|
width: 60px;
|
height: auto;
|
display: block;
|
margin: auto;
|
}
|
</style>
|
</head>
|
<body>
|
<header class="mui-bar mui-bar-nav">
|
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
|
<h1 class="mui-title"><span id="typeName"></span>仓库列表</h1>
|
</header>
|
<div class="mui-content">
|
<div class="mui-content">
|
<div>
|
<ul id="depotList" class="mui-table-view mui-grid-view mui-grid-9">
|
<!-- <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
|
<a href="javascript:void(0)" onclick="toDetail()">
|
<div class="mui-media-body">入库中</div>
|
<img class="depot_img" src="./images/ico_depot1.png">
|
<div class="mui-media-body">1号仓</div>
|
</a>
|
</li>-->
|
</ul>
|
</div>
|
</div>
|
</div>
|
<script src="./js/mui.js"></script>
|
<script src="./js/jquery.min.js"></script>
|
<script src="./js/echarts.min.js"></script>
|
|
<script type="text/javascript" charset="utf-8">
|
var url; //接口路径
|
var depotList; //视频设备集合
|
var tag;
|
var data = {
|
"interfaceId": "5401",
|
"sign": "10301",
|
"outId": "10301",
|
"reqDateTime": new Date(),
|
"tokenAuth": "",
|
"data": {
|
"type": ""
|
}
|
};
|
mui.init()
|
mui.plusReady(function() {
|
//获取参数
|
var curr = plus.webview.currentWebview();
|
$("#typeName").html(curr.typeName+" - ");
|
tag = curr.tag + '.html';
|
var user = JSON.parse(localStorage.getItem('user'));
|
data.tokenAuth = user.tokenAuth;
|
url = user.url + "/api-phone/gateway";
|
getdepotList();
|
})
|
|
//获取仓库信息
|
function getdepotList() {
|
//发送请求获取仓库信息
|
mui.ajax(url, {
|
type: "POST",
|
dataType: "json",
|
crossDomain: true,
|
contentType: "application/json;charset=utf-8",
|
data: JSON.stringify(data),
|
success: function(result) {
|
if (result.code == "0000") {
|
depotList = result.data;
|
if (depotList != null && depotList.length > 0) {
|
renderDepotList();
|
} else {
|
mui.alert("暂无数据!", '提示',["确定"],function(){},"div");
|
}
|
} else {
|
mui.alert(result.msg, '提示',["确定"],function(){},"div");
|
}
|
},
|
error: function() {
|
mui.alert('系统繁忙,请重试!', '提示',["确定"],function(){},"div");
|
}
|
})
|
}
|
|
//渲染
|
function renderDepotList() {
|
var html = '';
|
|
$.each(depotList, function(index, item) {
|
html += '<li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">';
|
html += '<a href="javascript:void(0)" onclick="toDetail(\'' + index + '\')">';
|
html += '<div class="mui-media-body">' + (item.depotStatusName ? item.depotStatusName:'') + '</div>';
|
html += '<img class="depot_img" ';
|
if (item.depotType == "01") {
|
if (item.depotStatus == "01") {
|
html += 'src="./images/ico_depot1.png">';
|
} else if (item.depotStatus == "02") {
|
html += 'src="./images/ico_depot2.png">';
|
} else if (item.depotStatus == "03") {
|
html += 'src="./images/ico_depot3.png">';
|
} else if (item.depotStatus == "04") {
|
html += 'src="./images/ico_depot4.png">';
|
} else if (item.depotStatus == "08") {
|
html += 'src="./images/ico_depot8.png">';
|
} else {
|
html += 'src="./images/ico_depot5.png">';
|
}
|
} else if (item.depotType == "02" || item.depotType == "04") {
|
if (item.depotStatus == "01") {
|
html += 'src="./images/ico_depot111.png">';
|
} else if (item.depotStatus == "02") {
|
html += 'src="./images/ico_depot222.png">';
|
} else if (item.depotStatus == "03") {
|
html += 'src="./images/ico_depot333.png">';
|
} else if (item.depotStatus == "04") {
|
html += 'src="./images/ico_depot444.png">';
|
} else if (item.depotStatus == "08") {
|
html += 'src="./images/ico_depot888.png">';
|
} else {
|
html += 'src="./images/ico_depot555.png">';
|
}
|
} else if (item.depotType == "03") {
|
if (item.depotStatus == "01") {
|
html += 'src="./images/ico_depot11.png">';
|
} else if (item.depotStatus == "02") {
|
html += 'src="./images/ico_depot22.png">';
|
} else if (item.depotStatus == "03") {
|
html += 'src="./images/ico_depot33.png">';
|
} else if (item.depotStatus == "04") {
|
html += 'src="./images/ico_depot44.png">';
|
} else if (item.depotStatus == "08") {
|
html += 'src="./images/ico_depot88.png">';
|
} else {
|
html += 'src="./images/ico_depot55.png">';
|
}
|
}
|
html += '<div class="mui-media-body">' + item.depotName + '</div>';
|
html += '</a></li>';
|
})
|
$("#depotList").html(html);
|
}
|
|
//跳转设备操作页面
|
function toDetail(index){
|
|
//判断是否为门禁,若为门禁,则需要输入权限码进行验证,验证成功方可跳转对应仓库
|
if(tag == 'device-control-door.html'){
|
|
mui.prompt('', '请输入权限码', '门禁权限码', ['确定', '取消'], function(e) {
|
if (e.index == 0) {
|
var token = e.value;
|
mui.openWindow({
|
url: tag,
|
id: tag,
|
extras: {
|
doorToken: token,
|
depotId: depotList[index].depotId,
|
depotName: depotList[index].depotName
|
}
|
})
|
}
|
}, 'div')
|
|
}else{
|
mui.openWindow({
|
url: tag,
|
id: tag,
|
extras: {
|
depotId: depotList[index].depotId,
|
depotName: depotList[index].depotName
|
}
|
})
|
}
|
}
|
</script>
|
</body>
|
</html>
|