var url = null; var videoList = null; var playData = null; var data = { "interfaceId": "5604", "tokenAuth": "", "outId": "56041", "reqDateTime": new Date(), "data": { "deptId": "" } }; var data1 = { "interfaceId": "5605", "tokenAuth": "", "outId": "56051", "reqDateTime": new Date(), "data": { "id": "", "playType": "" } }; function init() { var user = JSON.parse(localStorage.getItem('user')); var selectDeptId = JSON.parse(localStorage.getItem('selectDeptId')); data.tokenAuth = user.tokenAuth; data1.tokenAuth = user.tokenAuth; data.data.deptId = selectDeptId; url = user.url + "/api-phone/v35/gateway"; getVideoList(); } function getVideoList() { console.log(JSON.stringify(data.data)) //发送请求获取视频设备 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") { videoList = result.data; renderVideo(); } else { renderVideo(); mui.alert(result.msg, '提示', ["确定"], function() {}, "div"); } }, error: function() { renderVideo(); mui.alert('系统繁忙,请重试!', '提示', ["确定"], function() {}, "div"); } }) videoList = [{ "id": "45", "name": "东图习多", "status": "01", "playType": "id ea", "type": "02" }, { "id": "52", "name": "老出亲事先", "status": "02", "playType": "Ut", "type": "01" }, { "id": "70", "name": "解领文确团离照", "status": "02", "playType": "nisi nostrud", "type": "02" }, { "id": "13", "name": "因局员", "status": "01", "playType": "ex labore esse", "type": "01" } ] } //渲染视频监控设备 function renderVideo() { var html = ''; if (videoList && videoList.length > 0) { $.each(videoList, function(index, item) { if (index % 3 == 0) { html += '