f22f7ddf4c7e21bea7be72151dc11182.php 8.7 KB

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