index.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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('shop/index')}">
  9. 关键字:
  10. <input class="form-control" type="text" name="keyword" style="width: 200px;" value="{:input('request.keyword')}"
  11. placeholder="商家名称/手机号">
  12. <input type="submit" class="btn btn-primary" value="搜索"/>
  13. <a class="btn btn-default" href="{:url('shop/index')}">清空</a>
  14. <a class="btn btn-warning" href="{:url('shop/export')}">导出</a>
  15. <a class="btn btn-danger" onclick="doDelete()">批量删除</a>
  16. </form>
  17. <form method="post" class="js-ajax-form">
  18. <table class="table table-hover table-bordered">
  19. <thead>
  20. <tr>
  21. <th><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">全选</th>
  22. <th>ID</th>
  23. <th>账号</th>
  24. <th width="80">LOGO</th>
  25. <th width="80">商家名称</th>
  26. <th>行业</th>
  27. <th>分类1</th>
  28. <th>分类2</th>
  29. <!--<th>联系人</th>-->
  30. <th>手机号</th>
  31. <th width="60">省份</th>
  32. <th width="80">地址</th>
  33. <th width="60">账户余额</th>
  34. <th width="80">申请时间</th>
  35. <th width="80">审核时间</th>
  36. <th>{:lang('STATUS')}</th>
  37. <th>{:lang('ACTIONS')}</th>
  38. </tr>
  39. </thead>
  40. <tbody>
  41. <php>
  42. $user_statuses=array("0"=>lang('USER_STATUS_BLOCKED'),"1"=>lang('USER_STATUS_ACTIVATED'),"2"=>lang('USER_STATUS_UNVERIFIED'));
  43. </php>
  44. <foreach name="list" item="vo">
  45. <tr>
  46. <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
  47. value="{$vo.id}" title="ID:{$vo.id}"></td>
  48. <td>{$vo.id}</td>
  49. <td>{$vo['user_login']?$vo['user_login']:($vo['mobile']?$vo['mobile']:lang('THIRD_PARTY_USER'))}
  50. </td>
  51. <td>
  52. <a href="javascript:imagePreviewDialog('{:cmf_get_image_preview_url($vo.logo)}');">
  53. <img src="{:cmf_get_image_preview_url($vo.logo)}" alt="" width="48" height="48">
  54. </a>
  55. </td>
  56. <td>{$vo['name']?$vo['name']:lang('NOT_FILLED')}</td>
  57. <td>{$vo['business_project']?$vo['business_project']:lang('NOT_FILLED')}</td>
  58. <td>{$vo['cate_name1']}</td>
  59. <td>{$vo['cate_name2']}</td>
  60. <!--<td>{$vo['contact_name']?$vo['contact_name']:lang('NOT_FILLED')}</td>-->
  61. <td>{$vo['mobile']?$vo['mobile']:lang('NOT_FILLED')}</td>
  62. <td>{$vo['province']}</td>
  63. <td>{$vo['address']}</td>
  64. <td>{$vo['balance']}</td>
  65. <td>{$vo['created_at']?$vo['created_at']:lang('NOT_FILLED')}</td>
  66. <td>{$vo['auth_at']?$vo['auth_at']:lang('NOT_FILLED')}</td>
  67. <td>
  68. <switch name="vo.user_status">
  69. <case value="1">
  70. <span class="label label-success">正常</span>
  71. </case>
  72. <case value="0">
  73. <span class="label label-danger">已冻结</span>
  74. </case>
  75. </switch>
  76. </td>
  77. <td>
  78. <if condition="$vo.user_status == 1">
  79. <a class="btn btn-xs btn-success js-ajax-dialog-btn"
  80. href="{:url('shop/state',array('id'=>$vo['id'],'status'=>0))}"
  81. data-msg="确认冻结该商家?">冻结</a>
  82. <else/>
  83. <a class="btn btn-xs btn-warning js-ajax-dialog-btn"
  84. href="{:url('shop/state',array('id'=>$vo['id'],'status'=>1))}"
  85. data-msg="确认解冻该商家?">解冻</a>
  86. </if>
  87. <a class="btn btn-xs btn-danger js-ajax-dialog-btn"
  88. href="{:url('shop/del',array('id'=>$vo['id']))}"
  89. data-msg="确认删除该商家?">删除</a>
  90. </td>
  91. </tr>
  92. </foreach>
  93. </tbody>
  94. </table>
  95. <div class="pagination">{$page}</div>
  96. </form>
  97. </div>
  98. <script src="__STATIC__/js/admin.js"></script>
  99. <script>
  100. function reloadPage(win) {
  101. win.location.reload();
  102. }
  103. $(function () {
  104. setCookie("refersh_time", 3);
  105. Wind.use('ajaxForm', 'artDialog', 'iframeTools', function () {
  106. //批量冻结
  107. $('#js-batch-delete').click(function (e) {
  108. var ids = [];
  109. $("input[name='ids[]']").each(function () {
  110. if ($(this).is(':checked')) {
  111. ids.push($(this).val());
  112. }
  113. });
  114. if (ids.length == 0) {
  115. return false;
  116. }
  117. ids = ids.join(',');
  118. });
  119. //end
  120. });
  121. });
  122. </script>
  123. <script>
  124. function doDelete() {
  125. // Wind.use('artDialog', function () {
  126. var ids = [];
  127. $(".js-check:checked").each(function () {
  128. var id = $(this).val();
  129. if (id > 0) {
  130. ids.push(id);
  131. }
  132. });
  133. if (ids.length <= 0) {
  134. showMsg('请先选择操作项');
  135. return false;
  136. }
  137. if (confirm('确定批量删除选择项?不可恢复')) {
  138. $.post('/admin/shop/del', {id: ids}, function (res) {
  139. if (res.code == 1) {
  140. showMsg(res.msg);
  141. setTimeout(function () {
  142. location.reload();
  143. }, 800)
  144. } else {
  145. showMsg(res.msg);
  146. }
  147. }, "json")
  148. }
  149. }
  150. </script>
  151. </body>
  152. </html>