device_list.html 8.0 KB

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