device_list.html 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport"
  6. content="width=daily-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  7. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  8. <link rel="stylesheet" href="/static/bootstrap-3.3.7/css/bootstrap.css">
  9. <link rel="stylesheet" href="/static/dropload-gh-pages/dropload.css">
  10. <script type="text/javascript" src="/static/jquery-2.2.4.min.js"></script>
  11. <script type="text/javascript" src="/static/dropload-gh-pages/dropload.min.js"></script>
  12. <script type="text/javascript" src="/static/layer/layer.js"></script>
  13. <link rel="stylesheet" href="/static/h5/css/common.css">
  14. <title>列表</title>
  15. <style>
  16. body{
  17. background-color: #F1F1F1;
  18. }
  19. .container{
  20. max-width: 750px;
  21. height: auto;
  22. margin: 0 auto;
  23. padding: 0px 6px;
  24. }
  25. .daily-lists{
  26. width: 100%;
  27. height: auto;
  28. }
  29. .daily-info{
  30. width: 100%;
  31. height: 100px;
  32. border-radius: 10px;
  33. margin-top: 5px;
  34. background-color: #ffffff;
  35. padding: 0px 13px;
  36. }
  37. .daily-info-title{
  38. width: 100%;
  39. height: 40px;
  40. line-height: 40px;
  41. font-size: 15px;
  42. font-weight: 600;
  43. letter-spacing: 1px;
  44. color: var(--themeColor);
  45. border-bottom:1.2px solid #F1F1F1;
  46. }
  47. .daily-info-content{
  48. width: 100%;
  49. height: 60px;
  50. }
  51. .daily-info-user{
  52. width: 100%;
  53. height: 30px;
  54. line-height: 30px;
  55. }
  56. .left{
  57. width: 30%;
  58. height: 30px;
  59. line-height: 30px;
  60. display: inline-block;
  61. font-size: 14px;
  62. float: left;
  63. }
  64. .right{
  65. width: 66%;
  66. height: 30px;
  67. line-height: 30px;
  68. display: inline-block;
  69. float: right;
  70. font-size: 13px;
  71. color: #A9A9A9;
  72. overflow: hidden;
  73. text-align: right;
  74. }
  75. .daily-info-time{
  76. width: 100%;
  77. height: 30px;
  78. line-height: 30px;
  79. }
  80. .nulldata{
  81. width: 100%;
  82. height: 200px;
  83. text-align: center;
  84. position: fixed;
  85. top: 22%;
  86. }
  87. .nulldata img{
  88. width: 200px;
  89. height: 160px;
  90. text-align: center;
  91. }
  92. .nulldata-text{
  93. margin-top: 15px;
  94. font-size: 14px;
  95. letter-spacing: 2px;
  96. text-align: center;
  97. }
  98. .footer-back{
  99. position: fixed;
  100. z-index: 1000;
  101. width: 100%;
  102. height: 45px;
  103. line-height: 45px;
  104. background-color: #ffffff;
  105. bottom: 0;
  106. left: 0;
  107. box-shadow: 0px 0px 10px 0px rgba(26, 25, 26, 0.05);
  108. display: table-cell;
  109. vertical-align: middle;
  110. text-align: center;
  111. }
  112. .footer-back a img{
  113. width: 43px;
  114. height: 43px;
  115. }
  116. </style>
  117. </head>
  118. <body>
  119. {if $list}
  120. <div class="container">
  121. <div class="daily-lists">
  122. {foreach $list as $k=>$v}
  123. <div class="daily-info">
  124. <div class="daily-info-title">{$v['title']}</div>
  125. <div class="daily-info-content">
  126. <div class="daily-info-user">
  127. <div class="left">工作人员:</div>
  128. <div class="right">{$v['work_user']}</div>
  129. </div>
  130. {if $v['enable'] == 1}
  131. <div class="daily-info-time">
  132. <div class="left">状态:</div>
  133. <div class="right">可用</div>
  134. </div>
  135. {else /}
  136. <div class="daily-info-time">
  137. <div class="left">状态:</div>
  138. <div class="right">不可用</div>
  139. </div>
  140. {/if}
  141. </div>
  142. </div>
  143. {/foreach}
  144. </div>
  145. </div>
  146. {else /}
  147. <div class="nulldata">
  148. <img src="/img/nulldata.png" alt="">
  149. <div class="nulldata-text">空空如也 ~</div>
  150. </div>
  151. {/if}
  152. <div class="footer-back">
  153. <a href="javascript:;" onclick="javascript:history.back(-1);"><img src="/img/back.png"></a>
  154. </div>
  155. </body>
  156. </html>
  157. <script>
  158. var orgId = '{$orgId}';
  159. var day= '{$day}';
  160. $(function(){
  161. // 页数
  162. var page = 1;
  163. // 每页展示20个
  164. var size = 20;
  165. // dropload
  166. $('.container').dropload({
  167. scrollArea : window,
  168. domDown : {
  169. domClass : 'dropload-down',
  170. domRefresh : '<div class="dropload-refresh">↑上拉加载更多</div>',
  171. domLoad : '<div class="dropload-load"><span class="loading"></span>加载中...</div>',
  172. domNoData : '<div class="dropload-noData"></div>'
  173. },
  174. loadDownFn : function(me){
  175. page++;
  176. // 拼接HTML
  177. var result = '';
  178. var url= "{:url('Statistics/deviceList')}";
  179. $.ajax({
  180. type: 'GET',
  181. url: url+'?page='+page+'&size='+size+'&orgId='+orgId+'&day='+day,
  182. dataType: 'json',
  183. success: function(res){
  184. var data = res.data;
  185. var arrLen = data.length;
  186. if(arrLen > 0){
  187. for(var i = 0; i < data.length; i++){
  188. if(arrLen > 0){
  189. result +='<div class="daily-info">';
  190. result +='<div class="daily-info-title">'+data[i].title+'</div>';
  191. result +='<div class="daily-info-content">';
  192. result +='<div class="daily-info-user">';
  193. result +='<div class="left">工作人员:</div>';
  194. result +='<div class="right">'+data[i].workUser+'</div>';
  195. result +='</div>';
  196. if(data[i].enable == 1){
  197. result +='<div class="device-info-time">';
  198. result +='<div class="left">状态:</div>';
  199. result +='<div class="right">可用</div>';
  200. }else {
  201. result +='<div class="device-info-time">';
  202. result +='<div class="left">状态:</div>';
  203. result +='<div class="right">不可用</div>';
  204. }
  205. result +='</div>';
  206. result +='</div>';
  207. result +='</div>';
  208. }
  209. }
  210. // 如果没有数据
  211. }else{
  212. // 锁定
  213. me.lock();
  214. // 无数据
  215. me.noData();
  216. }
  217. //延迟1秒加载
  218. setTimeout(function(){
  219. // 插入数据到页面,放到最后面
  220. $('.daily-lists').append(result);
  221. // 每次数据插入,必须重置
  222. me.resetload();
  223. },1000);
  224. },
  225. error: function(xhr, type){
  226. // 即使加载出错,也得重置
  227. me.resetload();
  228. }
  229. });
  230. },
  231. threshold : 50
  232. });
  233. });
  234. </script>