user_list.html 8.3 KB

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