| | |
| | | <script th:src="@{/wx/wx-common.js}"></script> |
| | | <script th:src="@{/ajax/libs/mui/js/mui.js}"></script> |
| | | <script th:inline="javascript"> |
| | | |
| | | var loginType = [[${loginType}]]; //登录方式 |
| | | var userName = [[${userName}]]; |
| | | openid = [[${openid}]]; //用户的openid |
| | |
| | | var total; |
| | | var pageCount; //总页码数 |
| | | var warnList; //每页数据 |
| | | $(function () { |
| | | // 监听页面显示事件(微信 H5 环境) |
| | | window.addEventListener('pageshow', function() { |
| | | if (localStorage.getItem('needRefresh') === 'true') { |
| | | localStorage.removeItem('needRefresh'); |
| | | refreshData(); |
| | | } |
| | | }); |
| | | |
| | | }); |
| | | |
| | | |
| | | mui.init({ |
| | | pullRefresh: { |
| | |
| | | } |
| | | }); |
| | | |
| | | |
| | | //初始出加载页面数据 |
| | | function pullupRefresh() { |
| | | $("#pullrefresh").addClass("head1"); |
| | | //请求获取数据 |
| | | getWarnData(); |
| | | } |
| | | |
| | | function refreshData() { |
| | | // 重置分页参数 |
| | | pageNo = 1; |
| | | |
| | | // 调用浏览器刷新 |
| | | location.reload(); |
| | | } |
| | | |
| | | |
| | | //初始化页面数据 |
| | | function initData() { |
| | |
| | | li.className = 'mui-table-view-cell'; |
| | | var html = ''; |
| | | html += '<div onclick="toWarnDetail(\'' + warnList[i].id +'\',\'' + warnList[i].companyId + '\')" class="mui-table">'; |
| | | html += '<div class="mui-table-cell mui-col-xs-10"><h4 class="mui-ellipsis">' + warnList[i].warnTitle; |
| | | // if(warnList[i].warnStatus == '10' || warnList[i].warnStatus == '20'){ |
| | | // html += '<span class="first1">' + warnList[i].warnStatusName; |
| | | // }else { |
| | | // html += '<span class="first2">' + warnList[i].warnStatusName; |
| | | // } |
| | | html += '</span></h4><h5>所属库区:<span>' + warnList[i].deviceName; |
| | | html += '</span></h5><h5>警告时间:<span>' + warnList[i].warnTime; |
| | | html += '</span></h5><p class="mui-h6 mui-ellipsis">警告说明:' +warnList[i].warnInfo; |
| | | html += '<div class="mui-table-cell mui-col-xs-10"><h4 class="mui-ellipsis">' + warnList[i].id; |
| | | html += '</span></h4><h5>所属库区:<span>' + warnList[i].deptId; |
| | | html += '</span></h5><h5>警告时间:<span>' + warnList[i].createTime; |
| | | html += '</span></h5><p class="mui-h6 mui-ellipsis">警告说明:' +warnList[i].content; |
| | | li.innerHTML = html; |
| | | table.appendChild(li); |
| | | } |
| | |
| | | |
| | | //请求获取警告数据 |
| | | function getWarnData() { |
| | | var data = JSON.stringify({ |
| | | "interfaceId": "app_1008", |
| | | "sign": "01", |
| | | "outId": "01-01", |
| | | "reqDateTime": new Date(), |
| | | "data": { |
| | | var data = { |
| | | "userName": userName, |
| | | "loginType": loginType, |
| | | "openid": openid, |
| | | "pageSize": pageSize, |
| | | "pageNo": pageNo |
| | | } |
| | | }); |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "../wx/gateway", |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | data: data, |
| | | success: function (result) { |
| | | }; |
| | | wxCommon.postJson("../wx/getSnapReplyPage", data,function (result) { |
| | | if (result.code == "0000") { |
| | | warnList = null; |
| | | warnList = result.data.records; |
| | |
| | | initData(); |
| | | } else { |
| | | mui.toast("没有更多数据了!"); |
| | | } |
| | | } |
| | | }); |
| | | } |