user_list.html 8.2 KB

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