index.html 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. {extend name='admin@main'}
  2. {block name="button"}
  3. <button data-modal='{:url("add")}' data-title="添加" class='layui-btn layui-btn-sm layui-btn-primary'>添加</button>
  4. {/block}
  5. {block name="content"}
  6. <div class="think-box-shadow">
  7. {include file='banner/index_search'}
  8. <table class="layui-table margin-top-20" lay-skin="line">
  9. <thead>
  10. <tr>
  11. <th class='list-table-check-td think-checkbox'><input data-auto-none data-check-target='.list-check-box' type='checkbox'></th>
  12. <th class='list-table-sort-td'><button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button></th>
  13. <th class='text-left nowrap'>管理员</th>
  14. <th class='text-left nowrap'>名称</th>
  15. <th class='text-left nowrap'>Logo</th>
  16. <th class="text-left" style="width: 20%">操作</th>
  17. </tr>
  18. </thead>
  19. <tbody>
  20. {foreach $list as $key=>$vo}
  21. <tr>
  22. <td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
  23. <td class='list-table-sort-td'><input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input"></td>
  24. <td class='text-left nowrap'>
  25. <img data-tips-image style="width:50px;height:50px" src="{$vo.headimg|default=''}" class="margin-right-5 text-top">
  26. <div class="inline-block">
  27. 用户ID:{$vo.user_id|default='--'}<br>
  28. 用户昵称:{$vo.user_name|default='--'}
  29. </div>
  30. </td>
  31. <td class='text-left nowrap'>{$vo.name|default=''}</td>
  32. <td class='text-left nowrap'><img data-tips-image="{$vo.cover|default=''}" src="{$vo.cover|default=''}" height="50" ></td>
  33. <td class='text-left' style="width: 20%">
  34. <a data-title="编辑轮播图" class="layui-btn layui-btn-sm" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
  35. <span class="layui-btn layui-btn-sm layui-btn-danger" onclick="btn_confirm('删除','del','{$vo.id}');">删 除</span>
  36. </td>
  37. </tr>
  38. {/foreach}
  39. </tbody>
  40. </table>
  41. {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
  42. </div>
  43. <script>
  44. function btn_confirm(msg,fun,id) {
  45. layer.confirm('请确定是否'+msg, {btn: ['确定', '取消'], title: "提示"}, function () {
  46. var url = "/mall/banner/"+fun;
  47. layer.closeAll();
  48. $.ajax({
  49. type: "post",
  50. url: url,
  51. data: {id:id},
  52. dataType: "json",
  53. async: false,
  54. success: function (data) {
  55. layer.msg(data.info);
  56. setTimeout(function () {
  57. window.location.reload();
  58. },1000)
  59. }
  60. });
  61. });
  62. }
  63. </script>
  64. {/block}