comment_list.html 9.2 KB

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