YYC
2026-03-03 59c99660816a0833f74ff1162b47bbf05d6805b5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
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 {
                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+'</span></div><div class="txt">';
            html += '<div class="box"><div class="group c"><div class="desc">'+item.depotData.name+'</div><div class="ort">仓房名称</div></div></div>';
            html += '<div class="box"><div class="group c1"><div class="desc">'+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+' KG</span></div>';
            html += '<div class="time">检测时间: <span>'+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
});