user_list.html 8.3 KB

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