var url = null;
|
var dateTime;
|
var heightList = null;
|
var data = {
|
"interfaceId": "5206",
|
"tokenAuth": "",
|
"outId": "10206",
|
"reqDateTime": new Date(),
|
"data": {
|
"deptId": "",
|
"dataTime": ""
|
}
|
};
|
|
function init() {
|
|
var user = JSON.parse(localStorage.getItem('user'));
|
var selectDeptId = JSON.parse(localStorage.getItem('selectDeptId'));
|
data.tokenAuth = user.tokenAuth;
|
data.data.deptId = selectDeptId;
|
url = user.url + "/api/phone/v1/gateway";
|
|
//获取警告记录
|
getHeightList();
|
|
}
|
|
|
//获取警告记录
|
function getHeightList() {
|
warnData = null;
|
//赋值参数的日期
|
//请求
|
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") {
|
heightList = result.data;
|
renderHeight();
|
} else {
|
heightList = ''
|
renderHeight();
|
mui.toast(result.msg);
|
console.log(JSON.stringify(result))
|
}
|
},
|
error: function() {
|
mui.alert("系统繁忙,请重试!", "提示", ["确定"], function() {}, "div")
|
}
|
})
|
|
}
|
|
//渲染页面
|
function renderHeight() {
|
var html = '';
|
if (heightList && heightList.length > 0) {
|
console.log(JSON.stringify(heightList))
|
$.each(heightList, function(index, item) {
|
html += '<li><div class="con myfancy"><div class="tit">库区名称: <span>'+(item.deptName == null?"--":item.deptName)+'</span></div><div class="txt">';
|
html += '<div class="box"><div class="group c"><div class="desc">'+(item.depotData.name == null?"--":item.depotData.name)+'</div><div class="ort">仓房名称</div></div></div>';
|
html += '<div class="box"><div class="group c1"><div class="desc">'+(item.depotData.foodVarietyName == null?"--":item.depotData.foodVarietyName)+'</div><div class="ort">粮食品种</div></div></div>';
|
html += '<div class="box"><div class="group level-1"><div class="desc">'+item.height+' 米</div><div class="ort">高度</div></div></div></div>';
|
html += '<div class="tit coation">计算储量: <span>'+(item.weight == null?"--":item.weight)+' KG</span></div>';
|
html += '<div class="time">检测时间: <span>'+(item.receiveDate == null?"--":item.receiveDate)+'</span></div></div></li>';
|
|
})
|
} else {
|
html +=
|
'<li><div class="con"><div style="text-align: center;font-size: 20px;color:#dd524d;">暂无料位总览信息</div></div></li>';
|
|
}
|
$("#recordList").html(html);
|
}
|
|
//滑动
|
mui('.mui-scroll-wrapper').scroll({
|
indicators: true, //是否显示滚动条
|
deceleration: 0.0006, //阻尼系数,系数越小滑动越灵敏
|
bounce: false, //是否启用回弹
|
deceleration: 0.0005 //flick 减速系数,系数越大,滚动速度越慢,滚动距离越小,默认值0.0006
|
});
|