06c753bc7248ad31c4d00198d44aa3a6.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  5. <meta charset="utf-8">
  6. <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
  7. <meta content="yes" name="apple-mobile-web-app-capable">
  8. <meta content="black" name="apple-mobile-web-app-status-bar-style">
  9. <meta content="telephone=no" name="format-detection">
  10. <title>永天消防</title>
  11. </head>
  12. <link rel="stylesheet" type="text/css" href="/jdxf/Public/wxapp/css/style.css">
  13. <!--<script type="text/javascript" src="/jdxf/Public/wxapp/js/jquery-1.11.3.min.js"></script>-->
  14. <script src="/jdxf/Public/wxapp/js/lib/jquery-2.2.3.min.js"></script>
  15. <script src="/jdxf/Public/wxapp/js/lib/dropload.js"></script>
  16. <script type="text/javascript"
  17. src="/jdxf/Public/wxapp/js/jquery.mloading-master/jquery.mloading-master/src/jquery.mloading.js"></script>
  18. <body>
  19. <!--头部-->
  20. <div class="header"><a class="comblack"
  21. href="/jdxf/wxapp2.php/Home/ComprehensiveAlarm/index<?php echo ($tokenurl); ?>/companyid/<?php echo ($companyid); ?>"></a> 井盖监测
  22. </div>
  23. <!--内容-->
  24. <div class="content">
  25. <!--导航-->
  26. <div class="fire-alarm-title">
  27. <span onclick="tabset(this)" name="all" class="title-label select-color">全部
  28. <?php if($wcl == 0 ): else: ?> <p><?php echo ($wcl); ?></p><?php endif; ?>
  29. <!--<p><?php echo ($wcl); ?></p>-->
  30. </span>
  31. <span onclick="tabset(this)" name="untreated" class="title-label">未处理</span>
  32. <span onclick="tabset(this)" name="treated" class="title-label">已处理</span>
  33. </div>
  34. <!--选择内容-->
  35. <!-- <div class="content-bottom" id="content-data">-->
  36. <!-- </div>-->
  37. <article class="content-bottom">
  38. <section class="khfxPane" style="display:block">
  39. </section>
  40. <section class="khfxPane">
  41. </section>
  42. <section class="khfxPane">
  43. </section>
  44. </article>
  45. </div>
  46. <!--底部-->
  47. <div class="footer"></div>
  48. </body>
  49. <script type="text/javascript">
  50. // $(document).ready(function(){
  51. // $(function(){
  52. // $(".title-label").click(function(){
  53. // $("#content-data").mLoading("show");
  54. //
  55. // });
  56. // });
  57. // });
  58. var type = 'all';
  59. let load_one = function () {
  60. var page = 0;
  61. let companyid = '<?php echo ($companyid); ?>';
  62. // var name_type=document.getElementById('name_type').value
  63. $('.content-bottom').dropload({
  64. scrollArea: window,
  65. distance: 50, // 拉动距离
  66. threshold: 100, // 提前加载距离
  67. domDown: { // 下方DOM
  68. domClass: 'dropload-down',
  69. domRefresh: '',
  70. domRefresh: '',
  71. domLoad: '',
  72. domNoData: ''
  73. },
  74. loadDownFn: function (me) {
  75. // alert(me);
  76. page++;
  77. var result = '';
  78. $.ajax({
  79. url: "/jdxf/wxapp2.php/Home/ManholeCover/change<?php echo ($tokenurl); ?>",
  80. type: "POST",
  81. data: {
  82. type: type,
  83. companyid: companyid,
  84. page: page
  85. },
  86. dataType: "JSON",
  87. success: function (res) {
  88. console.log(res);
  89. var arr_length = res.length;
  90. result = '';
  91. if (arr_length > 0) {
  92. for (var i = 0; i < arr_length; i++) {
  93. var clzt = res[i].clzt;
  94. var clztHtml = '';
  95. if (clzt == 1) {
  96. clztHtml = '<a href="/jdxf/wxapp2.php/Home/Fireinfo/index<?php echo ($tokenurl); ?>/type/128/id/' + res[i].id + '">已处理</a>';
  97. } else {
  98. clztHtml = '<a class="bule" href="/jdxf/wxapp2.php/Home/Fireinfo/index<?php echo ($tokenurl); ?>/type/128/id/' + res[i].id + '">未处理</a>';
  99. }
  100. var device_status = '';
  101. if (res[i].device_status == 0) {
  102. device_status = '打开恢复';
  103. } else if (res[i].device_status == 1) {
  104. device_status = '打开告警';
  105. } else if (res[i].device_status == 2) {
  106. device_status = '满溢恢复';
  107. } else if (res[i].device_status == 3) {
  108. device_status = '满溢告警';
  109. }
  110. result += ''
  111. + '<div class="item-list">'
  112. + '<p>' + res[i].time + ' <span class="size" >' + device_status + '</span></p>'
  113. + '<p>' + res[i].owner_name + ''
  114. + '<span>'
  115. + clztHtml
  116. + '</span></p>'
  117. + '<p>'
  118. + device_status
  119. + '</p>'
  120. + '</div>';
  121. }
  122. ;
  123. setTimeout(function () {
  124. if (type == "all") {
  125. $('.khfxPane').eq(0).append(result);
  126. } else if (type == "untreated") {
  127. $('.khfxPane').eq(1).append(result);
  128. } else if (type == "treated") {
  129. $('.khfxPane').eq(2).append(result);
  130. }
  131. // $('#content-data').append(result);
  132. me.resetload();
  133. }, 500);
  134. // alert(page);
  135. } else {
  136. // alert("page"+page);
  137. // 锁定
  138. me.lock();
  139. // 无数据
  140. me.noData();
  141. me.resetload();
  142. }
  143. },
  144. error: function (xhr, type) {
  145. alert('Ajax error!');
  146. // 即使加载出错,也得重置
  147. me.resetload();
  148. }
  149. });
  150. }
  151. });
  152. // load_one();
  153. }
  154. //点击 tab页 切换tab页
  155. $('.khfxPane').eq(0).html("");
  156. $('.khfxPane').eq(1).html("");
  157. $('.khfxPane').eq(2).html("");
  158. // $("#content-data").mLoading("show");
  159. let tabset = function (tab) {
  160. page = 0;
  161. pageNum = 1;
  162. $('.khfxPane').eq(0).html("");
  163. $('.khfxPane').eq(1).html("");
  164. $('.khfxPane').eq(2).html("");
  165. let companyid = '<?php echo ($companyid); ?>';
  166. type = $(tab).attr("name");
  167. if (type == 'all' || tab == 'all') {
  168. type = 'all';
  169. $(tab).siblings().removeClass('select-color');
  170. $(tab).addClass('select-color');
  171. $('.khfxPane').eq(0).css("display", "block");
  172. $('.khfxPane').eq(1).css("display", "none");
  173. $('.khfxPane').eq(2).css("display", "none");
  174. // $('.khfxPane').eq(0).unlock();
  175. // $('.khfxPane').eq(0).noData(false);
  176. // dropload.lock('down');
  177. // dropload.noData();
  178. } else if (type == 'untreated') {
  179. // type = $(tab).attr("name");
  180. $(tab).siblings().removeClass('select-color');
  181. $(tab).addClass('select-color');
  182. type = 'untreated';
  183. $('.khfxPane').eq(0).css("display", "none");
  184. $('.khfxPane').eq(1).css("display", "block");
  185. $('.khfxPane').eq(2).css("display", "none");
  186. // $('.khfxPane').eq(1).unlock();
  187. // $('.khfxPane').eq(1).noData(false);
  188. } else if (type == 'treated') {
  189. type = 'treated';
  190. $(tab).siblings().removeClass('select-color');
  191. $(tab).addClass('select-color');
  192. $('.khfxPane').eq(0).css("display", "none");
  193. $('.khfxPane').eq(1).css("display", "none");
  194. $('.khfxPane').eq(2).css("display", "block");
  195. // $('.khfxPane').eq(1).unlock();
  196. // $('.khfxPane').eq(1).noData(false);
  197. }
  198. // document.getElementById("name_type").value=type;
  199. // load_two();
  200. load_one()
  201. // load_two();
  202. // load_one();
  203. //let index=$(".fire-alarm-title span").index(tab);获取点击的是第几个tab页
  204. // $.post('/jdxf/wxapp2.php/Home/GateMagnetism/change<?php echo ($tokenurl); ?>', {'type': type, 'companyid': companyid}, function (res) {
  205. // $("#content-data").mLoading("hide");
  206. // $('#content-data').html(res);
  207. // });
  208. }
  209. // let tabset = function (tab) {
  210. // document.getElementById("content-data").innerHTML = "";
  211. // $("#content-data").mLoading("show");
  212. // let companyid = '<?php echo ($companyid); ?>';
  213. // if (tab == 'all') {
  214. // var type = 'all';
  215. // } else {
  216. // var type = $(tab).attr("name");
  217. // $(tab).siblings().removeClass('select-color');
  218. // $(tab).addClass('select-color');
  219. // }
  220. // //let index=$(".fire-alarm-title span").index(tab);获取点击的是第几个tab页
  221. // $.post('/jdxf/wxapp2.php/Home/ManholeCover/change<?php echo ($tokenurl); ?>', {'type': type, 'companyid': companyid}, function (res) {
  222. // $("#content-data").mLoading("hide");
  223. // $('#content-data').html(res);
  224. // });
  225. //
  226. // }
  227. tabset('all');
  228. </script>
  229. </html>