(function () { /*function list(data, $page) { $.each(data, function (_index, _item) { learun.httpget(config.webapi + "learun/adms/desktop/data", { type: 'list', id: _item.F_Id }, function(data) { if (data) { var html = ''; $.each(data.value, function (_j, _jitem) { html += '\
\
'+ _jitem.f_title + '
\
'+ learun.date.format(_jitem.f_time, 'yyyy-MM-dd') + '
\
'; }); console.log(html); } $page.find('#lr_desktop_msg_content').append(html); }); }); }*/ var page = { isScroll: false, init: function ($page,param) { $page.find('#toptab').toptab(['告警', '公告']).each(function (index) { var $this = $(this); switch (index) { case 0: var msg_html = ''; msg_html += '\
\
\
\
\
\
\ \
\
'; $this.html(msg_html); //var baojing_info = ''; userinfo = learun.storage.get('userinfo'); learun.httpget(config.webapi + "/?s=api/get_baojing_info&plate="+userinfo.baseinfo.plate, {}, function(res) { if(res.success == true){ var msg_html_list = ''; $.each(res.data, function (_index, _item) { msg_html_list += '\
\

'+ _item.AddTime +'

\

'+ _item.LicensePlate +''+ _item.DeviceNumber +'

\ '+ _item.Type +'详情\
'; $page.find('.gaojinginfo').html(msg_html_list); var addtime = $('#time').text(); $('.gaojingdetail').on('tap', function () { learun.nav.go({ path: 'alarmdetail', title: '告警详情', type: 'right', param:'{"addtime":"'+addtime+'"}'}); }); }); }else{ msg_html += '

暂无消息

'; $page.find('.gaojinginfo').html(msg_html); } }); //msg_html += ''; break; case 1: var msg_html = ''; var msg_html = ''; msg_html += '\
\
\
\
\
\
\ \
\
'; $this.html(msg_html); //var baojing_info = '{"0":{"data":"1111","msg":"公告","time":"2/28"},"1":{"data":"2222","msg":"公告","time":"2/29"}}'; userinfo = learun.storage.get('userinfo'); learun.httpget(config.webapi + "/?s=api/get_gonggao_info&plate="+userinfo.baseinfo.plate, {}, function(res) { var msg_html_list = ''; if(res.success == true){ $.each(res.data, function (_index, _item) { msg_html_list += '\
\

'+ _item.AddTime +'

\

'+ _item.LicensePlate +''+ _item.DeviceNumber +'

\ '+ _item.Type +'详情\
'; $page.find('.gonggaoinfo').html(msg_html_list); $('.gonggaodetail').on('tap', function () { var addtime = $('#time').text(); learun.nav.go({ path: 'noticedetail', title: '告警详情', type: 'right', param:'{"addtime":"'+addtime+'"}'}); }); }); }else{ msg_html += '

暂无消息

'; $page.find('.gonggaoinfo').html(msg_html); } }); break; } $this = null; }); } /*reload: function ($page, pageinfo) { if (learun.isOutLogin) {// 如果是重新登录的情况刷新下桌面数据 learun.isOutLogin = false; $page.find('#toptab').toptab(['告警', '公告']).each(function (index) { var $this = $(this); switch (index) { case 0: var msg_html = ''; msg_html += '\
\
'; learun.http.get("http://czapp.rltest.cn/?s=api/get_baojing_info", {}, function(res) { if(res){ $.each(res.data, function (_index, _item) { msg_html += '\
\
\

'+ _item.AddTime +'

\

'+ _item.DeviceNumber +''+ _item.AddTime +'

\ '+ _item.Comment +'详情\
\
'; }); }else{ msg_html += '

暂无消息

'; } $page.find('#gaojinginfo').html(msg_html); }); msg_html += '\
\
\ \
\
'; $this.html(msg_html); break; case 1: var msg_html = ''; msg_html += '\
\
'; learun.http.get("http://czapp.rltest.cn/?s=api/get_baojing_info", {}, function(res) { if(res){ $.each(res.data, function (_index, _item) { msg_html += '\
\
\

'+ _item.AddTime +'

\

'+ _item.DeviceNumber +''+ _item.AddTime +'

\ '+ _item.Comment +'详情\
\
'; }); }else{ msg_html += '

暂无消息

'; } $page.find('#gonggaoinfo').html(msg_html); }); msg_html += '\
\
\ \
\
'; $this.html(msg_html); break; } $this = null; }); } }*/ }; return page; /*var page = { isScroll: false, init: function ($page) { learun.clientdata.get('desktop', { callback: function (data) { console.log(data); list(data.list || [], $page); } }); } }; return page;*/ })();