index.html 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <include file="public@header"/>
  2. <style>
  3. .table img{
  4. width:25px;
  5. height:25px;
  6. }
  7. #pop{
  8. display:none;
  9. }
  10. </style>
  11. </head>
  12. <body>
  13. <div class="wrap js-check-wrap">
  14. <ul class="nav nav-tabs">
  15. <li class="active"><a>{:lang('USER_INDEXADMIN_INDEX')}</a></li>
  16. <li><a href="{:url('adminIndex/add')}">{:lang('ADD')}</a></li>
  17. </ul>
  18. <form class="well form-inline margin-top-20" method="post" action="{:url('user/adminIndex/index')}">
  19. 热门:
  20. <select class="form-control" name="ishot">
  21. <option value="">全部</option>
  22. <option value="1" <if condition="input('request.ishot') neq '' && input('request.ishot') eq 1">selected</if>>是</option>
  23. <option value="0" <if condition="input('request.ishot') neq '' && input('request.ishot') eq 0">selected</if>>否</option>
  24. </select>
  25. 设备来源:
  26. <select class="form-control" name="source">
  27. <option value="">全部</option>
  28. <option value="pc" <if condition="input('request.source') neq '' && input('request.source') eq 'pc'">selected</if>>PC</option>
  29. <option value="android" <if condition="input('request.source') neq '' && input('request.source') eq 'android'">selected</if>>安卓APP</option>
  30. <option value="ios" <if condition="input('request.source') neq '' && input('request.source') eq 'ios'">selected</if>>苹果APP</option>
  31. </select>
  32. 提交时间:
  33. <input class="form-control js-bootstrap-date" name="start_time" id="start_time" autocomplete="off" value="{:input('request.start_time')}" aria-invalid="false" style="width: 110px;"> -
  34. <input class="form-control js-bootstrap-date" name="end_time" id="end_time" autocomplete='off' value="{:input('request.end_time')}" aria-invalid="false" style="width: 110px;">
  35. 用户ID:
  36. <input class="form-control" type="text" name="uid" style="width: 200px;" value="{:input('request.uid')}"
  37. placeholder="请输入用户ID">
  38. 关键字:
  39. <input class="form-control" type="text" name="keyword" style="width: 200px;" value="{:input('request.keyword')}"
  40. placeholder="用户名/昵称">
  41. <input type="submit" class="btn btn-primary" value="搜索"/>
  42. <a class="btn btn-danger" href="{:url('user/adminIndex/index')}">清空</a>
  43. <br>
  44. <br>
  45. 用户数:{$nums} (根据条件统计)
  46. </form>
  47. <form method="post" class="js-ajax-form">
  48. <table class="table table-hover table-bordered">
  49. <thead>
  50. <tr>
  51. <th width="16">
  52. <label>
  53. <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
  54. </label>
  55. </th>
  56. <th>ID</th>
  57. <th>{:lang('USERNAME')}</th>
  58. <th>{:lang('NICENAME')}</th>
  59. <th>{:lang('AVATAR')}</th>
  60. <th>手机</th>
  61. <th>{$name_coin}余额</th>
  62. <th>累计消费{$name_coin}</th>
  63. <th>{$name_votes}余额</th>
  64. <th>累计{$name_votes}</th>
  65. <th>注册设备</th>
  66. <th>{:lang('REGISTRATION_TIME')}</th>
  67. <th>{:lang('LAST_LOGIN_TIME')}</th>
  68. <th>{:lang('LAST_LOGIN_IP')}</th>
  69. <th>{:lang('ACTIONS')}</th>
  70. </tr>
  71. </thead>
  72. <tbody>
  73. <foreach name="list" item="vo">
  74. <tr>
  75. <td>
  76. <input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$vo.id}">
  77. </td>
  78. <td>{$vo.id}</td>
  79. <td>{$vo['user_login']?$vo['user_login']:($vo['mobile']?$vo['mobile']:lang('THIRD_PARTY_USER'))}
  80. </td>
  81. <td>{$vo['user_nicename']?$vo['user_nicename']:lang('NOT_FILLED')}</td>
  82. <td><img src="{$vo['avatar']}" class="imgtip" /></td>
  83. <td>{$vo.mobile}</td>
  84. <td>{$vo.coin}</td>
  85. <td>{$vo.consumption}</td>
  86. <td>{$vo.votes}</td>
  87. <td>{$vo.votestotal}</td>
  88. <td>{$vo.source}</td>
  89. <td>{:date('Y-m-d H:i:s',$vo['create_time'])}</td>
  90. <td><if condition="$vo['last_login_time'] gt 0">{:date('Y-m-d H:i:s',$vo['last_login_time'])}<else />--</if></td>
  91. <td>{$vo.last_login_ip}</td>
  92. <td>
  93. <if condition="$vo.ishot eq '1'">
  94. <a class="btn btn-xs btn-info js-ajax-dialog-btn"
  95. href="{:url('adminIndex/sethot',array('id'=>$vo['id'],'ishot'=>0))}">取消热门</a>
  96. <else/>
  97. <a class="btn btn-xs btn-info js-ajax-dialog-btn"
  98. href="{:url('adminIndex/sethot',array('id'=>$vo['id'],'ishot'=>1))}">热门</a>
  99. </if>
  100. <a class="btn btn-xs btn-primary" href='{:url("adminIndex/edit",array("id"=>$vo["id"]))}'>{:lang('EDIT')}</a>
  101. <a class="btn btn-xs btn-danger js-ajax-delete" href="{:url('adminIndex/del',array('id'=>$vo['id']))}">{:lang('DELETE')}</a>
  102. </td>
  103. </tr>
  104. </foreach>
  105. </tbody>
  106. </table>
  107. <div class="pagination">{$page}</div>
  108. </form>
  109. </div>
  110. <div id="pop">
  111. <div class="wrap" style="padding-bottom:40px;">
  112. <form method="post" class="form-horizontal margin-top-20">
  113. <div class="form-group">
  114. <label for="input-user_login" class="col-sm-2 control-label"><span class="form-required">*</span>禁用截止日期</label>
  115. <div class="col-md-6 col-sm-10">
  116. <input class="form-control js-bootstrap-date" name="ban_long" contenteditable="off" id="ban_long" value="" aria-invalid="false">
  117. </div>
  118. </div>
  119. <div class="form-group">
  120. <label for="input-user_login" class="col-sm-2 control-label"><span class="form-required">*</span>禁用原因</label>
  121. <div class="col-md-6 col-sm-10">
  122. <textarea class="form-control" id="ban_reason" name="ban_reason" placeholder="200字以内"></textarea>
  123. </div>
  124. </div>
  125. <div class="form-group">
  126. <div class="col-sm-offset-2 col-sm-10">
  127. <a href="javascript:void(0)" class="btn btn-primary" onclick="xiajia_submit()">禁用</a>
  128. </div>
  129. </div>
  130. </form>
  131. </div>
  132. </div>
  133. <script src="__STATIC__/js/admin.js"></script>
  134. <script src="__STATIC__/js/laydate/laydate.js"></script>
  135. <script>
  136. Wind.use('layer');
  137. var clickuid='0';
  138. function showlayer(id){
  139. clickuid=id;
  140. layer.open({
  141. type: 1,
  142. title: '禁用',
  143. shadeClose: true,
  144. shade: 0.8,
  145. area: ['800px', '300px'],
  146. content: $('#pop'),
  147. success:function(){
  148. laydate.render({
  149. elem: '#ban_long',//指定元素
  150. trigger: 'click'
  151. });
  152. }
  153. });
  154. }
  155. var xiajia_status=0;
  156. function xiajia_submit(){
  157. var ban_long=$("#ban_long").val();
  158. var reason=$("#ban_reason").val();
  159. if(ban_long==''){
  160. layer.msg("请选择禁用截止日期");
  161. return;
  162. }
  163. if(reason==''){
  164. layer.msg("请填写禁用原因");
  165. return;
  166. }
  167. if(reason.length>200){
  168. layer.msg("禁用原因必须在200字以内");
  169. return;
  170. }
  171. if(xiajia_status==1){
  172. return;
  173. }
  174. xiajia_status=1;
  175. $.ajax({
  176. url: '{:url('user/adminIndex/setBan')}',
  177. type: 'POST',
  178. dataType: 'json',
  179. data: {id:clickuid,reason: reason,ban_long:ban_long},
  180. success:function(data){
  181. var code=data.code;
  182. if(code==0){
  183. layer.msg(data.msg);
  184. return !1;
  185. }
  186. xiajia_status=0;
  187. layer.msg("操作成功",{},function(){
  188. //layer.closeAll();
  189. clickuid=0;
  190. $("#ban_long").val("");
  191. $("#ban_reason").attr("value","");
  192. layer.closeAll();
  193. reloadPage(window);
  194. });
  195. },
  196. error:function(e){
  197. }
  198. });
  199. }
  200. </script>
  201. </body>
  202. </html>