123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 |
- <?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
- <html lang="en">
- <head>
- <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
- <meta charset="utf-8">
- <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
- <meta content="yes" name="apple-mobile-web-app-capable">
- <meta content="black" name="apple-mobile-web-app-status-bar-style">
- <meta content="telephone=no" name="format-detection">
- <title>永天消防</title>
- </head>
- <style>
- .khfxPane {
- display: none;
- }
- </style>
- <link rel="stylesheet" type="text/css" href="/jdxf/Public/wxapp/css/style.css">
- <!--<script type="text/javascript" src="/jdxf/Public/wxapp/js/jquery-1.11.3.min.js"></script>-->
- <script src="/jdxf/Public/wxapp/js/lib/jquery-2.2.3.min.js"></script>
- <script src="/jdxf/Public/wxapp/js/lib/dropload.js"></script>
- <script type="text/javascript"
- src="/jdxf/Public/wxapp/js/jquery.mloading-master/jquery.mloading-master/src/jquery.mloading.js"></script>
- <body>
- <!--头部-->
- <div class="header"><a class="comblack"
- href="/jdxf/wxapp2.php/Home/ComprehensiveAlarm/index<?php echo ($tokenurl); ?>/companyid/<?php echo ($companyid); ?>"></a> 火警
- </div>
- <!--内容-->
- <div class="content">
- <!--导航-->
- <div class="fire-alarm-title">
- <span onclick="tabset(this)" name="all" class="title-label select-color">全部
- <?php if($wcl == 0 ): else: ?> <p><?php echo ($wcl); ?></p><?php endif; ?>
- <!--<p><?php echo ($wcl); ?></p>-->
- </span>
- <span onclick="tabset(this)" name="untreated" class="title-label">未处理</span>
- <span onclick="tabset(this)" name="treated" class="title-label">已处理</span>
- </div>
- <!--选择内容-->
- <!-- <div class="content-bottom" id="content-data" >-->
- <!-- -->
- <!-- </div>-->
- <article class="content-bottom">
- <section class="khfxPane" style="display:block">
- </section>
- <section class="khfxPane">
- </section>
- <section class="khfxPane">
- </section>
- </article>
- </div>
- <!--底部-->
- <div class="footer"></div>
- </body>
- <script type="text/javascript">
- // $(document).ready(function(){
- // $(function(){
- // $(".title-label").click(function(){
- // $("#content-data").mLoading("show");
- //
- // });
- // });
- // });
- var type = 'all';
- let load_one = function () {
- var page = 0;
- let companyid = '<?php echo ($companyid); ?>';
- // var name_type=document.getElementById('name_type').value
- $('.content-bottom').dropload({
- scrollArea: window,
- distance: 50, // 拉动距离
- threshold: 100, // 提前加载距离
- domDown: { // 下方DOM
- domClass: 'dropload-down',
- domRefresh: '',
- domRefresh: '',
- domLoad: '',
- domNoData: ''
- },
- loadDownFn: function (me) {
- // alert(me);
- page++;
- var result = '';
- $.ajax({
- url: "/jdxf/wxapp2.php/Home/Fire/change<?php echo ($tokenurl); ?>",
- type: "POST",
- data: {
- type: type,
- companyid: companyid,
- page: page
- },
- dataType: "JSON",
- success: function (res) {
- console.log(res);
- var arr_length = res.length;
- result = '';
- if (arr_length > 0) {
- for (var i = 0; i < arr_length; i++) {
- var clzt = res[i].clzt;
- var clztHtml = '';
- if (clzt == 1) {
- clztHtml = '<a href="/jdxf/wxapp2.php/Home/Fireinfo/index<?php echo ($tokenurl); ?>/type/1/id/' + res[i].id + '">已处理</a>';
- } else {
- clztHtml = '<a class="bule" href="/jdxf/wxapp2.php/Home/Fireinfo/index<?php echo ($tokenurl); ?>/type/1/id/' + res[i].id + '">未处理</a>';
- }
- result += ''
- + '<div class="item-list">'
- + '<p>' + res[i].time + ' <span class="size" >' + res[i].ftype + '</span></p>'
- + '<p>' + res[i].owner_name + ''
- + '<span>'
- + clztHtml
- + '</span></p>'
- +'<p>'
- +res[i].data4
- +'</p>'
- + '</div>';
- }
- ;
- setTimeout(function () {
- if (type == "all") {
- $('.khfxPane').eq(0).append(result);
- } else if (type == "untreated") {
- $('.khfxPane').eq(1).append(result);
- } else if (type == "treated") {
- $('.khfxPane').eq(2).append(result);
- }
- // $('#content-data').append(result);
- me.resetload();
- }, 500);
- // alert(page);
- } else {
- // alert("page"+page);
- // 锁定
- me.lock();
- // 无数据
- me.noData();
- me.resetload();
- }
- },
- error: function (xhr, type) {
- alert('Ajax error!');
- // 即使加载出错,也得重置
- me.resetload();
- }
- });
- }
- });
- // load_one();
- }
- //点击 tab页 切换tab页
- $('.khfxPane').eq(0).html("") ;
- $('.khfxPane').eq(1).html("") ;
- $('.khfxPane').eq(2).html("") ;
- let tabset = function (tab) {
- page = 0;
- pageNum = 1;
- $('.khfxPane').eq(0).html("");
- $('.khfxPane').eq(1).html("");
- $('.khfxPane').eq(2).html("");
- let companyid = '<?php echo ($companyid); ?>';
- type = $(tab).attr("name");
- if (type == 'all'||tab == 'all') {
- type = 'all';
- $(tab).siblings().removeClass('select-color');
- $(tab).addClass('select-color');
- $('.khfxPane').eq(0).css("display","block");
- $('.khfxPane').eq(1).css("display","none");
- $('.khfxPane').eq(2).css("display","none");
- } else if (type == 'untreated'){
- $(tab).siblings().removeClass('select-color');
- $(tab).addClass('select-color');
- type = 'untreated';
- $('.khfxPane').eq(0).css("display","none");
- $('.khfxPane').eq(1).css("display","block");
- $('.khfxPane').eq(2).css("display","none");
- }else if (type == 'treated'){
- type = 'treated';
- $(tab).siblings().removeClass('select-color');
- $(tab).addClass('select-color');
- $('.khfxPane').eq(0).css("display","none");
- $('.khfxPane').eq(1).css("display","none");
- $('.khfxPane').eq(2).css("display","block");
- }
- load_one()
- }
- // let tabset = function (tab) {
- // document.getElementById("content-data").innerHTML = "";
- // $("#content-data").mLoading("show");
- // let companyid = '<?php echo ($companyid); ?>';
- // if (tab == 'all') {
- // var type = 'all';
- // } else {
- // var type = $(tab).attr("name");
- // $(tab).siblings().removeClass('select-color');
- // $(tab).addClass('select-color');
- // }
- // //let index=$(".fire-alarm-title span").index(tab);获取点击的是第几个tab页
- // $.post('/jdxf/wxapp2.php/Home/Fire/change<?php echo ($tokenurl); ?>', {'type': type, 'companyid': companyid}, function (res) {
- // $("#content-data").mLoading("hide");
- // $('#content-data').html(res);
- // });
- //
- // }
- tabset('all');
- </script>
- </html>
|