f0d6f7d2f3656b5fbe829805106ad3f1.php 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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. <link rel="stylesheet" href="/jdxf/Public/wxapp/css/style1.css">
  12. </head>
  13. <style>
  14. .pages a,.pages span {
  15. display:inline-block;
  16. padding:2px 5px;
  17. margin:0 1px;
  18. border:1px solid #f0f0f0;
  19. -webkit-border-radius:3px;
  20. -moz-border-radius:3px;
  21. border-radius:3px;
  22. }
  23. .pages a,.pages li {
  24. display:inline-block;
  25. list-style: none;
  26. text-decoration:none; 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. a:link,a:visited,a:hover,a:active {
  41. text-decoration:none;
  42. }
  43. </style>
  44. <link rel="stylesheet" type="text/css" href="/jdxf/Public/wxapp/css/style1.css">
  45. <!--引入微信js-->
  46. <script src='https://res.wx.qq.com/open/js/jweixin-1.4.0.js'></script>
  47. <script type="text/javascript" src="/jdxf/Public/wxapp/js/jquery-1.11.3.min.js"></script>
  48. <body>
  49. <!--头部-->
  50. <div class="header"><a class="comblack" href="/jdxf/wxapp2.php/Home/Inspection/xj_index<?php echo ($tokenurl); ?>/companyid/<?php echo ($companyid); ?>"></a> 巡检</div>
  51. <!--内容-->
  52. <div>
  53. <?php if(is_array($res5)): $i = 0; $__LIST__ = $res5;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><div class="content">
  54. <div class="item-list">
  55. <p><?php echo ($vo["plan_name"]); ?>
  56. <span><?php echo ($vo["completion"]); ?>%</span>
  57. </p>
  58. </div>
  59. <div >
  60. <?php if(is_array($vo)): $i = 0; $__LIST__ = $vo;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo1): $mod = ($i % 2 );++$i; if(is_array($vo1)): $i = 0; $__LIST__ = $vo1;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo2): $mod = ($i % 2 );++$i; if($vo2["data3"] == 1 ): ?><a class="wxcode" name="<?php echo ($vo["id"]); ?>" title="<?php echo ($vo2["id"]); ?>">
  61. <div class="bl">
  62. <p><?php echo ($vo2["spot_name"]); ?><span>未巡检</span></p>
  63. </div>
  64. </a>
  65. <?php else: ?>
  66. <a href="###" >
  67. <div class="bl">
  68. <p><?php echo ($vo2["spot_name"]); ?><span>已巡检</span></p>
  69. </div>
  70. </a><?php endif; endforeach; endif; else: echo "" ;endif; endforeach; endif; else: echo "" ;endif; ?>
  71. </div>
  72. </div><?php endforeach; endif; else: echo "" ;endif; ?>
  73. </div>
  74. <!--底部-->
  75. <div class="footer"></div>
  76. </body>
  77. <script type="text/javascript">
  78. var wbr_id=<?php echo ($wbr_id); ?>;
  79. // var companyid=<?php echo ($companyid); ?>;
  80. function ajasscan(data,jh_id,dw_id){
  81. // alert(data);
  82. // alert(jh_id);
  83. // alert(dw_id);
  84. // alert(wbr_id);
  85. $.ajax({
  86. type: 'POST',
  87. url: "<?php echo U('Scan/pdsflr');?>",
  88. data: {data:data,jh_id:jh_id,dw_id:dw_id},
  89. dataType: 'json',
  90. success: function(res1){
  91. // alert(res1);
  92. if (res1==1){
  93. alert('巡检点位不匹配');
  94. } else {
  95. // alert(wbr_id);
  96. window.location.href ="<?php echo U('Scan/from');?>?jh_id="+res1.jh_id+"&dw_id="+res1.dw_id+"&wbr_id="+wbr_id;
  97. }
  98. }
  99. })
  100. }
  101. $(document).ready(function () {
  102. $(".item-list").click(function () {
  103. $(this).next().slideToggle();
  104. })
  105. })
  106. var jh_id;
  107. var dw_id;
  108. $('.wxcode').click(function(){
  109. jh_id=$(this).attr("name");
  110. dw_id=$(this).attr("title");
  111. })
  112. wx.config({
  113. // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  114. debug: false,
  115. // 必填,公众号的唯一标识
  116. appId: "<?php echo ($wxConfig["appId"]); ?>",
  117. // 必填,生成签名的时间戳
  118. timestamp:"<?php echo ($wxConfig["timestamp"]); ?>",
  119. // 必填,生成签名的随机串
  120. nonceStr:"<?php echo ($wxConfig["nonceStr"]); ?>",
  121. // 必填,签名,见附录1
  122. signature:"<?php echo ($wxConfig["signature"]); ?>",
  123. // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
  124. jsApiList : [ 'scanQRCode' ]
  125. });
  126. wx.error(function(res) {
  127. // alert("----------出错了-----------:" + res.errMsg);//这个地方的好处就是wx.config配置错误,会弹出窗口哪里错误,然后根据微信文档查询即可。
  128. });
  129. wx.ready(function() {
  130. wx.checkJsApi({
  131. jsApiList : ['scanQRCode'],
  132. success : function(res) {
  133. }
  134. });
  135. //点击按钮扫描二维码
  136. $('.wxcode').click(function(){
  137. // alert(1);
  138. wx.scanQRCode({
  139. needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
  140. scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码,默认二者都有
  141. success: function (res) {
  142. var result = res.resultStr; // 当needResult 为 1 时,扫码返回的结果
  143. // alert(result);
  144. // alert(jh_id);
  145. // alert(dw_id);
  146. ajasscan(result,jh_id,dw_id)
  147. }
  148. });
  149. })
  150. });
  151. </script>
  152. </html>