123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203 |
- (function () {
-
-
- 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 += '\
- <div class="f-page-body f-scroll-wrapper">\
- <div class="f-scroll" id="gaojinginfo" style="transform: translate3d(0px, 0px, 0px) translateZ(0px);">';
-
-
- userinfo = learun.storage.get('userinfo');
- learun.httpget(config.webapi + "/?s=api/get_baojing_info&plate="+userinfo.baseinfo.plate, {}, function(res) {
- if(res){
- $.each(res, function (_index, _item) {
- msg_html += '\
- <div class="lr-list">\
- <div class="lr-list-item lr-list-item-multi" style="line-height: 25px;">\
- <h4 id="time">'+ _item.AddTime +'</h4>\
- <p class="lr-ellipsis">'+ _item.LicensePlate +'<span class="" style="right: 15px;position: absolute;top: 50%;transform: translateY(-50%);">'+ _item.DeviceNumber +'</span></p>\
- <a class="lr-nav-right" id="gaojingdetail">'+ _item.Type +'<span class="lr-badge lr-badge-primary lr-badge-inverted">详情</span></a>\
- </div>\
- </div>';
- });
- }else{
- msg_html += '<h4>暂无消息</h4>';
- }
- $page.find('#gaojinginfo').html(msg_html);
- var addtime = $('#time').text();
- $('#gaojingdetail').on('tap', function () {
- learun.nav.go({ path: 'alarmdetail', title: '告警详情', type: 'right', param:'{"addtime":'+addtime+'}'});
- });
- });
-
- msg_html += '\
- </div>\
- <div class="f-scrollbar f-scrollbar-vertical">\
- <div class="f-scrollbar-indicator" style="transition-duration: 0ms; display: none; height: 830px; transform: translate3d(0px, 0px, 0px) translateZ(0px);">\
- </div>\
- </div>\
- </div>';
- $this.html(msg_html);
- break;
- case 1:
- var msg_html = '';
- msg_html += '\
- <div class="f-page-body f-scroll-wrapper">\
- <div class="f-scroll" id="gonggaoinfo" style="transform: translate3d(0px, 0px, 0px) translateZ(0px);">';
-
- userinfo = learun.storage.get('userinfo');
- learun.httpget(config.webapi + "/?s=api/get_gonggao_info&plate="+userinfo.baseinfo.plate, {}, function(res) {
- if(res){
- $.each(res, function (_index, _item) {
- msg_html += '\
- <div class="lr-list">\
- <div class="lr-list-item lr-list-item-multi" style="line-height: 25px;">\
- <h4 id="time">'+ _item.AddTime +'</h4>\
- <p class="lr-ellipsis">'+ _item.LicensePlate +'<span class="" style="right: 15px;position: absolute;top: 50%;transform: translateY(-50%);">'+ _item.DeviceNumber +'</span></p>\
- <a class="lr-nav-right" id="gonggaodetail">'+ _item.Type +'<span class="lr-badge lr-badge-primary lr-badge-inverted">详情</span></a>\
- </div>\
- </div>';
- $page.find('.gonggaodetail').on('tap', function () {
- learun.nav.go({ path: 'baojing', title: '自助报警', type: 'right' });
- });
- });
-
- }else{
- msg_html += '<h4>暂无消息</h4>';
- }
- $page.find('#gonggaoinfo').html(msg_html);
- $('#gonggaodetail').on('tap', function () {
- var addtime = $('#time').text();
- learun.nav.go({ path: 'alarmdetail', title: '告警详情', type: 'right',param:'{"addtime":'+addtime+'}' });
- });
- });
- msg_html += '\
- </div>\
- <div class="f-scrollbar f-scrollbar-vertical">\
- <div class="f-scrollbar-indicator" style="transition-duration: 0ms; display: none; height: 830px; transform: translate3d(0px, 0px, 0px) translateZ(0px);">\
- </div>\
- </div>\
- </div>';
- $this.html(msg_html);
- break;
- }
- $this = null;
- });
- }
-
- };
- return page;
-
-
- })();
|