inspection_system.html 5.1 KB

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