2cf7d1f56e674f81e9c95df1d0b322a4.php 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  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($wjcn[0]['count(*)'] == 0 ): else: ?> <p><?php echo ($wjcn[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. <article class="content-bottom" >
  66. <section class="khfxPane" style="display:block">
  67. </section>
  68. <section class="khfxPane">
  69. </section>
  70. <section class="khfxPane">
  71. </section>
  72. </article>
  73. <!-- <div class="content-bottom" id="content-data">-->
  74. <!-- </div>-->
  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/Efire/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/7/id/' + res[i].id + '">已处理</a>';
  119. }else {
  120. clztHtml='<a class="bule" href="/jdxf/wxapp2.php/Home/Fireinfo/index<?php echo ($tokenurl); ?>/type/7/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. let tabset = function (tab) {
  167. page = 0;
  168. pageNum = 1;
  169. $('.khfxPane').eq(0).html("");
  170. $('.khfxPane').eq(1).html("");
  171. $('.khfxPane').eq(2).html("");
  172. let companyid = '<?php echo ($companyid); ?>';
  173. type = $(tab).attr("name");
  174. if (type == 'all'||tab == 'all') {
  175. type = 'all';
  176. $(tab).siblings().removeClass('select-color');
  177. $(tab).addClass('select-color');
  178. $('.khfxPane').eq(0).css("display","block");
  179. $('.khfxPane').eq(1).css("display","none");
  180. $('.khfxPane').eq(2).css("display","none");
  181. } else if (type == 'untreated'){
  182. $(tab).siblings().removeClass('select-color');
  183. $(tab).addClass('select-color');
  184. type = 'untreated';
  185. $('.khfxPane').eq(0).css("display","none");
  186. $('.khfxPane').eq(1).css("display","block");
  187. $('.khfxPane').eq(2).css("display","none");
  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. }
  196. load_one()
  197. }
  198. // let tabset = function (tab) {
  199. // document.getElementById("content-data").innerHTML = "";
  200. // $("#content-data").mLoading("show");
  201. // let companyid = '<?php echo ($companyid); ?>';
  202. // if (tab == 'all') {
  203. // var type = 'all';
  204. // } else {
  205. // var type = $(tab).attr("name");
  206. // $(tab).siblings().removeClass('select-color');
  207. // $(tab).addClass('select-color');
  208. // }
  209. // //let index=$(".fire-alarm-title span").index(tab);获取点击的是第几个tab页
  210. // $.post('/jdxf/wxapp2.php/Home/Efire/change<?php echo ($tokenurl); ?>', {'type': type, 'companyid': companyid}, function (res) {
  211. // // $('#content-data').html(res);
  212. // $("#content-data").mLoading("hide");
  213. // $('#content-data').html(res);
  214. // });
  215. //
  216. // }
  217. tabset('all');
  218. </script>
  219. </html>