28bc6c72df526d898c7c75e41ed80e04.php 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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. <style>
  13. .pages a, .pages span {
  14. display: inline-block;
  15. padding: 2px 5px;
  16. margin: 0 1px;
  17. border: 1px solid #f0f0f0;
  18. -webkit-border-radius: 3px;
  19. -moz-border-radius: 3px;
  20. border-radius: 3px;
  21. }
  22. .pages a, .pages li {
  23. display: inline-block;
  24. list-style: none;
  25. text-decoration: none;
  26. color: #58A0D3;
  27. }
  28. .pages a.first, .pages a.prev, .pages a.next, .pages a.end {
  29. margin: 0;
  30. }
  31. .pages a:hover {
  32. border-color: #50A8E6;
  33. }
  34. .pages span.current {
  35. background: #50A8E6;
  36. color: #FFF;
  37. font-weight: 700;
  38. border-color: #50A8E6;
  39. }
  40. .khfxPane{display: none;}
  41. </style>
  42. <link rel="stylesheet" type="text/css" href="/jdxf/Public/wxapp/css/style.css">
  43. <!--<script type="text/javascript" src="/jdxf/Public/wxapp/js/jquery-1.11.3.min.js"></script>-->
  44. <script src="/jdxf/Public/wxapp/js/lib/jquery-2.2.3.min.js"></script>
  45. <script src="/jdxf/Public/wxapp/js/lib/dropload.js"></script>
  46. <script type="text/javascript"
  47. src="/jdxf/Public/wxapp/js/jquery.mloading-master/jquery.mloading-master/src/jquery.mloading.js"></script>
  48. <body>
  49. <!--头部-->
  50. <div class="header"><a class="comblack"
  51. href="/jdxf/wxapp2.php/Home/ComprehensiveAlarm/index<?php echo ($tokenurl); ?>/companyid/<?php echo ($companyid); ?>"></a> 可燃气体
  52. </div>
  53. <!--内容-->
  54. <div class="content">
  55. <!--导航-->
  56. <div class="fire-alarm-title">
  57. <span onclick="tabset(this)" name="all" class="title-label select-color">全部
  58. <?php if($gassl[0]['count(*)'] == 0 ): else: ?> <p><?php echo ($gassl[0]['count(*)']); ?></p><?php endif; ?>
  59. <!--<p><?php echo ($wjcn); ?></p>-->
  60. </span>
  61. <span onclick="tabset(this)" name="untreated" class="title-label">未处理</span>
  62. <span onclick="tabset(this)" name="treated" class="title-label">已处理</span>
  63. </div>
  64. <!--选择内容-->
  65. <!-- <div class="content-bottom" id="content-data">-->
  66. <!-- </div>-->
  67. <article class="content-bottom" >
  68. <section class="khfxPane" style="display:block">
  69. </section>
  70. <section class="khfxPane">
  71. </section>
  72. <section class="khfxPane">
  73. </section>
  74. </article>
  75. </div>
  76. <!--底部-->
  77. <div class="footer"></div>
  78. </body>
  79. <script type="text/javascript">
  80. var type = 'all';
  81. let load_one = function () {
  82. var page = 0;
  83. let companyid = '<?php echo ($companyid); ?>';
  84. // var name_type=document.getElementById('name_type').value
  85. $('.content-bottom').dropload({
  86. scrollArea: window,
  87. distance : 50, // 拉动距离
  88. threshold : 100, // 提前加载距离
  89. domDown : { // 下方DOM
  90. domClass : 'dropload-down',
  91. domRefresh : '',
  92. domRefresh : '',
  93. domLoad : '',
  94. domNoData : ''
  95. },
  96. loadDownFn: function (me) {
  97. // alert(me);
  98. page++;
  99. var result = '';
  100. $.ajax({
  101. url: "/jdxf/wxapp2.php/Home/CombustibleGas/change<?php echo ($tokenurl); ?>",
  102. type: "POST",
  103. data: {
  104. type: type,
  105. companyid: companyid,
  106. page: page
  107. },
  108. dataType: "JSON",
  109. success: function (res) {
  110. console.log(res);
  111. var arr_length = res.length;
  112. result = '';
  113. if( arr_length>0 ){
  114. for(var i = 0; i < arr_length; i++){
  115. var clzt = res[i].clzt;
  116. var clztHtml = '';
  117. if (clzt==1){
  118. clztHtml='<a href="/jdxf/wxapp2.php/Home/Fireinfo/index<?php echo ($tokenurl); ?>/type/131/id/' + res[i].id + '">已处理</a>';
  119. }else {
  120. clztHtml='<a class="bule" href="/jdxf/wxapp2.php/Home/Fireinfo/index<?php echo ($tokenurl); ?>/type/131/id/' + res[i].id + '">未处理</a>';
  121. }
  122. result += ''
  123. + '<div class="item-list">'
  124. + '<p>'+res[i].time+' <span class="size" >'+res[i].wtype+'</span></p>'
  125. + '<p>'+res[i].owner_name+''
  126. + '<span>'
  127. + clztHtml
  128. + '</span></p>'
  129. + '</div>';
  130. };
  131. setTimeout(function () {
  132. if (type=="all"){
  133. $('.khfxPane').eq(0).append(result);
  134. }else if (type=="untreated") {
  135. $('.khfxPane').eq(1).append(result);
  136. }else if (type=="treated") {
  137. $('.khfxPane').eq(2).append(result);
  138. }
  139. // $('#content-data').append(result);
  140. me.resetload();
  141. }, 500);
  142. // alert(page);
  143. }else{
  144. // alert("page"+page);
  145. // 锁定
  146. me.lock();
  147. // 无数据
  148. me.noData();
  149. me.resetload();
  150. }
  151. },
  152. error: function(xhr, type){
  153. alert('Ajax error!');
  154. // 即使加载出错,也得重置
  155. me.resetload();
  156. }
  157. });
  158. }
  159. });
  160. // load_one();
  161. }
  162. //点击 tab页 切换tab页
  163. $('.khfxPane').eq(0).html("") ;
  164. $('.khfxPane').eq(1).html("") ;
  165. $('.khfxPane').eq(2).html("") ;
  166. // $("#content-data").mLoading("show");
  167. let tabset = function (tab) {
  168. page = 0;
  169. pageNum = 1;
  170. $('.khfxPane').eq(0).html("");
  171. $('.khfxPane').eq(1).html("");
  172. $('.khfxPane').eq(2).html("");
  173. let companyid = '<?php echo ($companyid); ?>';
  174. type = $(tab).attr("name");
  175. if (type == 'all'||tab == 'all') {
  176. type = 'all';
  177. $(tab).siblings().removeClass('select-color');
  178. $(tab).addClass('select-color');
  179. $('.khfxPane').eq(0).css("display","block");
  180. $('.khfxPane').eq(1).css("display","none");
  181. $('.khfxPane').eq(2).css("display","none");
  182. // $('.khfxPane').eq(0).unlock();
  183. // $('.khfxPane').eq(0).noData(false);
  184. // dropload.lock('down');
  185. // dropload.noData();
  186. } else if (type == 'untreated'){
  187. // type = $(tab).attr("name");
  188. $(tab).siblings().removeClass('select-color');
  189. $(tab).addClass('select-color');
  190. type = 'untreated';
  191. $('.khfxPane').eq(0).css("display","none");
  192. $('.khfxPane').eq(1).css("display","block");
  193. $('.khfxPane').eq(2).css("display","none");
  194. // $('.khfxPane').eq(1).unlock();
  195. // $('.khfxPane').eq(1).noData(false);
  196. }else if (type == 'treated'){
  197. type = 'treated';
  198. $(tab).siblings().removeClass('select-color');
  199. $(tab).addClass('select-color');
  200. $('.khfxPane').eq(0).css("display","none");
  201. $('.khfxPane').eq(1).css("display","none");
  202. $('.khfxPane').eq(2).css("display","block");
  203. // $('.khfxPane').eq(1).unlock();
  204. // $('.khfxPane').eq(1).noData(false);
  205. }
  206. // document.getElementById("name_type").value=type;
  207. // load_two();
  208. load_one()
  209. // load_two();
  210. // load_one();
  211. //let index=$(".fire-alarm-title span").index(tab);获取点击的是第几个tab页
  212. // $.post('/jdxf/wxapp2.php/Home/GateMagnetism/change<?php echo ($tokenurl); ?>', {'type': type, 'companyid': companyid}, function (res) {
  213. // $("#content-data").mLoading("hide");
  214. // $('#content-data').html(res);
  215. // });
  216. }
  217. // document.getElementById("content-data").innerHTML = "";
  218. // $("#content-data").mLoading("show");
  219. // let tabset = function (tab) {
  220. // let companyid = '<?php echo ($companyid); ?>';
  221. // if (tab == 'all') {
  222. // var type = 'all';
  223. // } else {
  224. // var type = $(tab).attr("name");
  225. // $(tab).siblings().removeClass('select-color');
  226. // $(tab).addClass('select-color');
  227. // }
  228. // //let index=$(".fire-alarm-title span").index(tab);获取点击的是第几个tab页
  229. // $.post('/jdxf/wxapp2.php/Home/CombustibleGas/change<?php echo ($tokenurl); ?>', {'type': type, 'companyid': companyid}, function (res) {
  230. // $("#content-data").mLoading("hide");
  231. // $('#content-data').html(res);
  232. // });
  233. //
  234. // }
  235. tabset('all');
  236. </script>
  237. </html>