index.html 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <include file="public@header"/>
  2. </head>
  3. <body>
  4. <div class="wrap js-check-wrap">
  5. <ul class="nav nav-tabs">
  6. <li class="active"><a>用户列表</a></li>
  7. </ul>
  8. <form class="well form-inline margin-top-20" method="post" action="{:url('user/adminIndex/index')}">
  9. 用户ID:
  10. <input class="form-control" type="text" name="uid" style="width: 200px;" value="{:input('request.uid')}"
  11. placeholder="请输入用户ID">
  12. 关键字:
  13. <input class="form-control" type="text" name="keyword" style="width: 200px;" value="{:input('request.keyword')}"
  14. placeholder="用户名/昵称/真实姓名/手机">
  15. <input type="submit" class="btn btn-primary" value="搜索"/>
  16. <a class="btn btn-default" href="{:url('user/adminIndex/index')}">清空</a>
  17. <a class="btn btn-warning" href="{:url('user/adminIndex/export')}">导出</a>
  18. <a class="btn btn-danger" onclick="doDelete()">批量删除</a>
  19. </form>
  20. <form method="post" class="js-ajax-form">
  21. <table class="table table-hover table-bordered">
  22. <thead>
  23. <tr>
  24. <th><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">全选</th>
  25. <th>ID</th>
  26. <th>账号</th>
  27. <th>{:lang('NICENAME')}</th>
  28. <th>真实姓名</th>
  29. <th>级别</th>
  30. <th>积分</th>
  31. <th>余额</th>
  32. <!--<th>微信号</th>-->
  33. <!--<th>{:lang('AVATAR')}</th>-->
  34. <!--<th>{:lang('EMAIL')}</th>-->
  35. <th>手机</th>
  36. <th>{:lang('REGISTRATION_TIME')}</th>
  37. <th>{:lang('LAST_LOGIN_TIME')}</th>
  38. <!--<th>{:lang('LAST_LOGIN_IP')}</th>-->
  39. <th>{:lang('STATUS')}</th>
  40. <th>{:lang('ACTIONS')}</th>
  41. </tr>
  42. </thead>
  43. <tbody>
  44. <php>
  45. $user_statuses=array("0"=>lang('USER_STATUS_BLOCKED'),"1"=>lang('USER_STATUS_ACTIVATED'),"2"=>lang('USER_STATUS_UNVERIFIED'));
  46. </php>
  47. <foreach name="list" item="vo">
  48. <tr>
  49. <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
  50. value="{$vo.id}" title="ID:{$vo.id}"></td>
  51. <td>{$vo.id}</td>
  52. <td>{$vo['user_login']?$vo['user_login']:($vo['mobile']?$vo['mobile']:lang('THIRD_PARTY_USER'))}
  53. </td>
  54. <td>{$vo['user_nickname']?$vo['user_nickname']:lang('NOT_FILLED')}</td>
  55. <td>{$vo['real_name']?$vo['real_name']:lang('NOT_FILLED')}</td>
  56. <!--<td><img width="25" height="25" src="{:url('user/public/avatar',array('id'=>$vo['id']))}"/></td>-->
  57. <!--<td>{$vo.user_email}</td>-->
  58. <td>v{$vo.level}</td>
  59. <td>{$vo.score}</td>
  60. <td>{$vo.balance}</td>
  61. <!--<td>v{$vo.wechat_account}</td>-->
  62. <td>{$vo.mobile}</td>
  63. <td>{:date('y-m-d H:i',$vo['create_time'])}</td>
  64. <td>{:date('y-m-d H:i',$vo['last_login_time'])}</td>
  65. <!--<td>{$vo.last_login_ip}</td>-->
  66. <td>
  67. <switch name="vo.user_status">
  68. <case value="0">
  69. <span class="label label-danger">已冻结</span>
  70. </case>
  71. <case value="1">
  72. <span class="label label-success">{$user_statuses[$vo['user_status']]}</span>
  73. </case>
  74. <case value="2">
  75. <span class="label label-warning">{$user_statuses[$vo['user_status']]}</span>
  76. </case>
  77. </switch>
  78. </td>
  79. <td>
  80. <a class="btn btn-xs btn-primary" href="{:url('adminIndex/edit',array('id'=>$vo['id']))}">编辑</a>
  81. <neq name="vo.id" value="1">
  82. <empty name="vo.user_status">
  83. <a class="btn btn-xs btn-success js-ajax-dialog-btn"
  84. href="{:url('adminIndex/cancelban',array('id'=>$vo['id']))}"
  85. data-msg="{:lang('ACTIVATE_USER_CONFIRM_MESSAGE')}">{:lang('ACTIVATE_USER')}</a>
  86. <else/>
  87. <a class="btn btn-xs btn-warning js-ajax-dialog-btn"
  88. href="{:url('adminIndex/ban',array('id'=>$vo['id']))}"
  89. data-msg="确认冻结该用户?">冻结</a>
  90. </empty>
  91. <else/>
  92. <a class="btn btn-xs btn-warning disabled">冻结</a>
  93. </neq>
  94. </td>
  95. </tr>
  96. </foreach>
  97. </tbody>
  98. </table>
  99. <div class="pagination">{$page}</div>
  100. </form>
  101. </div>
  102. <script src="__STATIC__/js/admin.js"></script>
  103. <script>
  104. function reloadPage(win) {
  105. win.location.reload();
  106. }
  107. $(function () {
  108. setCookie("refersh_time", 3);
  109. Wind.use('ajaxForm', 'artDialog', 'iframeTools', function () {
  110. //批量冻结
  111. $('#js-batch-delete').click(function (e) {
  112. var ids = [];
  113. $("input[name='ids[]']").each(function () {
  114. if ($(this).is(':checked')) {
  115. ids.push($(this).val());
  116. }
  117. });
  118. if (ids.length == 0) {
  119. return false;
  120. }
  121. ids = ids.join(',');
  122. /*art.dialog.open("/user/admin_index/del.html?ids="+ids, {
  123. title: "批量冻结",
  124. width: "300px",
  125. close : function () {
  126. art.dialog.open.origin.location.reload();
  127. }
  128. });*/
  129. });
  130. //end
  131. });
  132. });
  133. </script>
  134. <script>
  135. function doDelete() {
  136. // Wind.use('artDialog', function () {
  137. var ids = [];
  138. $(".js-check:checked").each(function () {
  139. var id = $(this).val();
  140. if (id > 0) {
  141. ids.push(id);
  142. }
  143. });
  144. if (ids.length <= 0) {
  145. showMsg('请先选择操作项');
  146. return false;
  147. }
  148. if(confirm('确定批量删除选择项?不可恢复')){
  149. $.post('/user/admin_index/del',{id:ids},function(res){
  150. if(res.code == 1){
  151. showMsg(res.msg);
  152. setTimeout(function () {
  153. location.reload();
  154. }, 800)
  155. }else{
  156. showMsg(res.msg);
  157. }
  158. },"json")
  159. }
  160. // });
  161. }
  162. /* function showMsg(msg, time){
  163. time = time? time : 1000;
  164. art.dialog({
  165. content: msg,
  166. icon: 'warning'
  167. });
  168. setTimeout(function () {
  169. }, time)
  170. }*/
  171. </script>
  172. </body>
  173. </html>