index.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  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. <div class="qrcode">
  9. <form class="well form-inline margin-top-20" method="post" onsubmit="return false;">
  10. <span>生成参数</span>
  11. <input class="form-control" id="url" type="text" name="url" style="width: 400px;" placeholder="请填写生成参数:如用户地址">
  12. &nbsp;
  13. <input type="button" class="btn btn-primary" onclick="makeQrcode()" value="生成二维码"/>
  14. <span class="qrcode">
  15. <a title="点击放大" data-href="">
  16. </a>
  17. </span>
  18. </form>
  19. </div>
  20. <form class="well form-inline margin-top-20" method="post" action="{:url('user/recommend/index')}">
  21. 用户ID:
  22. <input class="form-control" type="text" name="uid" style="width: 200px;" value="{:input('request.uid')}"
  23. placeholder="请输入用户ID">
  24. 关键字:
  25. <input class="form-control" type="text" name="keyword" style="width: 200px;" value="{:input('request.keyword')}" placeholder="用户名/昵称/真实姓名/手机">
  26. <input type="submit" class="btn btn-primary" value="搜索"/>
  27. <a class="btn btn-default" href="{:url('user/recommend/index')}">清空</a>
  28. <a class="btn btn-warning" href="{:url('user/recommend/export')}">导出</a>
  29. <a class="btn btn-danger" onclick="doDelete()">批量删除</a>
  30. </form>
  31. <form method="post" class="js-ajax-form">
  32. <div class="table-actions">
  33. <button class="btn btn-primary btn-sm js-ajax-submit" style="width: 88px; background-color: #d9534f; border-color: #d9534f;" type="submit" data-action="{:url('AdminIndex/totuijian',array('no'=>0))}" onclick="return confirm('确定取消单身推荐吗?')" data-subcheck="true">取消单身推荐
  34. </button>
  35. </div>
  36. <table class="table table-hover table-bordered">
  37. <thead>
  38. <tr>
  39. <th><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">全选</th>
  40. <th>ID</th>
  41. <th>账号</th>
  42. <th>{:lang('NICENAME')}</th>
  43. <th>真实姓名</th>
  44. <th>爱心</th>
  45. <!-- <th>级别</th>
  46. <th>积分</th>
  47. <th>余额</th> -->
  48. <th style="text-align: center;">是否推荐</th>
  49. <th style="text-align: center;">来源</th>
  50. <!--<th>{:lang('AVATAR')}</th>-->
  51. <!--<th>{:lang('EMAIL')}</th>-->
  52. <th>手机</th>
  53. <th>网址</th>
  54. <th>{:lang('REGISTRATION_TIME')}</th>
  55. <th>{:lang('LAST_LOGIN_TIME')}</th>
  56. <!--<th>{:lang('LAST_LOGIN_IP')}</th>-->
  57. <th>{:lang('STATUS')}</th>
  58. <th>{:lang('ACTIONS')}</th>
  59. </tr>
  60. </thead>
  61. <tbody>
  62. <php>
  63. $user_statuses=array("0"=>lang('USER_STATUS_BLOCKED'),"1"=>lang('USER_STATUS_ACTIVATED'),"2"=>lang('USER_STATUS_UNVERIFIED'));
  64. </php>
  65. <foreach name="list" item="vo">
  66. <tr>
  67. <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
  68. value="{$vo.id}" title="ID:{$vo.id}"></td>
  69. <td>{$vo.id}</td>
  70. <td>{$vo['user_login']?$vo['user_login']:($vo['mobile']?$vo['mobile']:lang('THIRD_PARTY_USER'))}
  71. </td>
  72. <td>{$vo['user_nickname']?$vo['user_nickname']:lang('NOT_FILLED')}</td>
  73. <td>{$vo['real_name']?$vo['real_name']:lang('NOT_FILLED')}</td>
  74. <!--<td><img width="25" height="25" src="{:url('user/public/avatar',array('id'=>$vo['id']))}"/></td>-->
  75. <!--<td>{$vo.user_email}</td>-->
  76. <!-- <td>v{$vo.level}</td>
  77. <td>{$vo.score}</td>
  78. <td>{$vo.balance}</td> -->
  79. <td>{$vo['redheart']}</td>
  80. <!--<td>v{$vo.wechat_account}</td>-->
  81. <td style="text-align: center;">
  82. <switch name="vo.is_tuijian">
  83. <case value="1">
  84. <span style="color: blue">是</span>
  85. </case>
  86. <case value="0">
  87. <span style="color: red">否</span>
  88. </case>
  89. </switch>
  90. </td>
  91. <!-- <td style="text-align: center;color: #c11f1f"> -->
  92. <td style="text-align: center;">
  93. <switch name="vo.is_books">
  94. <case value="1"><span style="color:blue">单身推荐活动</span> </case>
  95. <case value="0"><span style="color:#d9534f">本站用户</span></case>
  96. </switch>
  97. </td>
  98. <td>{$vo.mobile}</td>
  99. <td><span class="label label-primary copy-btn copy" data-url="{:url('/weixin/member/home?id=','','',true)}{$vo.id}">复制</span></td>
  100. <td>{:date('Y-m-d H:i',$vo['create_time'])}</td>
  101. <td>{:date('Y-m-d H:i',$vo['last_login_time'])}</td>
  102. <!--<td>{$vo.last_login_ip}</td>-->
  103. <td>
  104. <switch name="vo.user_status">
  105. <case value="0">
  106. <span class="label label-danger">已冻结</span>
  107. </case>
  108. <case value="1">
  109. <span class="label label-success">{$user_statuses[$vo['user_status']]}</span>
  110. </case>
  111. <case value="2">
  112. <span class="label label-warning">{$user_statuses[$vo['user_status']]}</span>
  113. </case>
  114. </switch>
  115. </td>
  116. <td>
  117. <a class="btn btn-xs btn-primary" href="{:url('adminIndex/edit',array('id'=>$vo['id']))}">编辑</a>
  118. <neq name="vo.id" value="1">
  119. <empty name="vo.user_status">
  120. <a class="btn btn-xs btn-success js-ajax-dialog-btn"
  121. href="{:url('adminIndex/cancelban',array('id'=>$vo['id']))}"
  122. data-msg="{:lang('ACTIVATE_USER_CONFIRM_MESSAGE')}">{:lang('ACTIVATE_USER')}</a>
  123. <else/>
  124. <a class="btn btn-xs btn-warning js-ajax-dialog-btn"
  125. href="{:url('adminIndex/ban',array('id'=>$vo['id']))}"
  126. data-msg="确认冻结该用户?">冻结</a>
  127. </empty>
  128. <else/>
  129. <a class="btn btn-xs btn-warning disabled">冻结</a>
  130. </neq>
  131. <a class="btn btn-xs btn-danger" href="{:url('adminIndex/accountadd',array('id'=>$vo['id']))}">爱心充值</a>
  132. </td>
  133. </tr>
  134. </foreach>
  135. </tbody>
  136. </table>
  137. <div class="pagination">{$page}</div>
  138. </form>
  139. </div>
  140. <script src="__STATIC__/js/admin.js"></script>
  141. <script src="__STATIC__/js/clipboard.min.js"></script>
  142. <script>
  143. function reloadPage(win) {
  144. win.location.reload();
  145. }
  146. /**
  147. * 生成二维啊
  148. * @returns {boolean}
  149. */
  150. function makeQrcode() {
  151. var url = $("#url").val();
  152. if(url == '' || url == null){
  153. showMsg('请填写生成参数');
  154. return false;
  155. }
  156. // 生成处理
  157. $(".qrcode a").html("二维码生成中...");
  158. $.post('/user/recommend/makeQrcode', {url: url}, function(res){
  159. if(res.code == 'success'){
  160. showMsg(res.message);
  161. $(".qrcode a").attr('data-href', res.data.qrcode);
  162. $(".qrcode a").html('<img src="'+res.data.qrcode+'" width="48" height="48"/>');
  163. }else{
  164. $(".qrcode a").html("");
  165. showMsg(res.message);
  166. }
  167. },'json');
  168. }
  169. $(function () {
  170. var copyText = '';
  171. var copyBox = new ClipboardJS('.copy',{
  172. text: function (e) {
  173. if(copyText=='' || copyText == null){
  174. showMsg('暂无复制内容');
  175. return false;
  176. }
  177. return copyText;
  178. }
  179. });
  180. copyBox.on("success",function(e){
  181. console.log(e);
  182. showMsg('复制成功');
  183. });
  184. copyBox.on("error",function(e){
  185. showMsg('复制失败');
  186. });
  187. $(".copy-btn").click(function(){
  188. copyText = $(this).attr('data-url');
  189. });
  190. $(".qrcode a").click(function(){
  191. var url = $(this).attr('data-href');
  192. if(url){
  193. imagePreviewDialog(url);
  194. }
  195. })
  196. setCookie("refersh_time", 3);
  197. Wind.use('ajaxForm', 'artDialog', 'iframeTools', function () {
  198. //批量冻结
  199. $('#js-batch-delete').click(function (e) {
  200. var ids = [];
  201. $("input[name='ids[]']").each(function () {
  202. if ($(this).is(':checked')) {
  203. ids.push($(this).val());
  204. }
  205. });
  206. if (ids.length == 0) {
  207. return false;
  208. }
  209. ids = ids.join(',');
  210. /*art.dialog.open("/user/admin_index/del.html?ids="+ids, {
  211. title: "批量冻结",
  212. width: "300px",
  213. close : function () {
  214. art.dialog.open.origin.location.reload();
  215. }
  216. });*/
  217. });
  218. //end
  219. });
  220. });
  221. </script>
  222. <script>
  223. function doDelete() {
  224. // Wind.use('artDialog', function () {
  225. var ids = [];
  226. $(".js-check:checked").each(function () {
  227. var id = $(this).val();
  228. if (id > 0) {
  229. ids.push(id);
  230. }
  231. });
  232. if (ids.length <= 0) {
  233. showMsg('请先选择操作项');
  234. return false;
  235. }
  236. if(confirm('确定批量删除选择项?不可恢复')){
  237. $.post('/user/admin_index/del',{id:ids},function(res){
  238. if(res.code == 1){
  239. showMsg(res.msg);
  240. setTimeout(function () {
  241. location.reload();
  242. }, 800)
  243. }else{
  244. showMsg(res.msg);
  245. }
  246. },"json")
  247. }
  248. // });
  249. }
  250. /* function showMsg(msg, time){
  251. time = time? time : 1000;
  252. art.dialog({
  253. content: msg,
  254. icon: 'warning'
  255. });
  256. setTimeout(function () {
  257. }, time)
  258. }*/
  259. </script>
  260. </body>
  261. </html>