comment_list.html 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport"
  6. content="width=comment-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. .comment-lists{
  25. width: 100%;
  26. height: auto;
  27. }
  28. .comment-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. .comment-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. .comment-info-content{
  47. width: 100%;
  48. height: 60px;
  49. }
  50. .comment-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. .comment-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="comment-lists">
  121. {foreach $list as $k=>$v}
  122. <div class="comment-info" onclick="details(this)" data-id="{$v['id']}" data-orgId="{$v['org_id']}">
  123. {if $v['type'] == 1 }
  124. <div class="comment-info-title">报修</div>
  125. {elseif($v['type'] == 2) }
  126. <div class="comment-info-title">保洁</div>
  127. {elseif($v['type'] == 3) }
  128. <div class="comment-info-title">运送</div>
  129. {elseif($v['type'] == 4 )}
  130. <div class="comment-info-title">安保</div>
  131. {elseif($v['type'] == 15) }
  132. <div class="comment-info-title">品质整改</div>
  133. {else}
  134. <div class="comment-info-title"></div>
  135. {/if}
  136. <div class="comment-info-content">
  137. <div class="comment-info-user">
  138. <div class="left">评论用户:</div>
  139. <div class="right">{$v['user_name']}</div>
  140. </div>
  141. <div class="comment-info-time">
  142. <div class="left">评论时间:</div>
  143. <div class="right">{$v['create_time']}</div>
  144. </div>
  145. </div>
  146. </div>
  147. {/foreach}
  148. </div>
  149. </div>
  150. {else /}
  151. <div class="nulldata">
  152. <img src="/img/nulldata.png" alt="">
  153. <div class="nulldata-text">空空如也 ~</div>
  154. </div>
  155. {/if}
  156. <div class="footer-back">
  157. <a href="javascript:;" onclick="javascript:history.back(-1);"><img src="/img/back.png"></a>
  158. </div>
  159. </body>
  160. </html>
  161. <script>
  162. function details(obj) {
  163. var id = $(obj).attr('data-id');
  164. var orgId = $(obj).attr('data-orgId');
  165. var url = "{:url('Statistics/commentDetails')}?id="+id+'&orgId='+orgId;
  166. window.location.href=url;
  167. }
  168. </script>
  169. <script>
  170. var orgId = '{$orgId}';
  171. var day= '{$day}';
  172. var mode= '{$mode}';
  173. $(function(){
  174. // 页数
  175. var page = 1;
  176. // 每页展示20个
  177. var size = 20;
  178. // dropload
  179. $('.container').dropload({
  180. scrollArea : window,
  181. domDown : {
  182. domClass : 'dropload-down',
  183. domRefresh : '<div class="dropload-refresh">↑上拉加载更多</div>',
  184. domLoad : '<div class="dropload-load"><span class="loading"></span>加载中...</div>',
  185. domNoData : '<div class="dropload-noData"></div>'
  186. },
  187. loadDownFn : function(me){
  188. page++;
  189. // 拼接HTML
  190. var result = '';
  191. var url= "{:url('Statistics/commentList')}";
  192. $.ajax({
  193. type: 'GET',
  194. url: url+'?page='+page+'&size='+size+'&orgId='+orgId+'&day='+day+'&mode='+mode,
  195. dataType: 'json',
  196. success: function(res){
  197. var data = res.data;
  198. var arrLen = data.length;
  199. if(arrLen > 0){
  200. for(var i = 0; i < data.length; i++){
  201. if(arrLen > 0){
  202. result +='<div class="comment-info" onclick="details(this)" data-id="'+data[i].id+'" data-orgId="'+data[i].orgId+'">';
  203. if(data[i].type==1){
  204. result +='<div class="comment-info-title">报修</div>';
  205. }
  206. if(data[i].type==2){
  207. result +='<div class="comment-info-title">保洁</div>';
  208. }
  209. if(data[i].type==3){
  210. result +='<div class="comment-info-title">运送</div>';
  211. }
  212. if(data[i].type==4){
  213. result +='<div class="comment-info-title">安保</div>';
  214. }
  215. if(data[i].type==15){
  216. result +='<div class="comment-info-title">品质整改</div>';
  217. }
  218. result +='<div class="comment-info-content">';
  219. result +='<div class="comment-info-user">';
  220. result +='<div class="left">评论用户:</div>';
  221. result +='<div class="right">'+data[i].userName+'</div>';
  222. result +='</div>';
  223. result +='<div class="device-info-time">';
  224. result +='<div class="left">评论时间:</div>';
  225. result +='<div class="right">'+data[i].createTime+'</div>';
  226. result +='</div>';
  227. result +='</div>';
  228. result +='</div>';
  229. }
  230. }
  231. // 如果没有数据
  232. }else{
  233. // 锁定
  234. me.lock();
  235. // 无数据
  236. me.noData();
  237. }
  238. //延迟1秒加载
  239. setTimeout(function(){
  240. // 插入数据到页面,放到最后面
  241. $('.comment-lists').append(result);
  242. // 每次数据插入,必须重置
  243. me.resetload();
  244. },1000);
  245. },
  246. error: function(xhr, type){
  247. // 即使加载出错,也得重置
  248. me.resetload();
  249. }
  250. });
  251. },
  252. threshold : 50
  253. });
  254. });
  255. </script>