index.html 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. {extend name='admin@main'}
  2. {block name="button"}
  3. <button data-open='{: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. <table class="layui-table margin-top-20" lay-skin="line">
  8. <thead>
  9. <tr>
  10. <th class='list-table-check-td think-checkbox'><input data-auto-none data-check-target='.list-check-box' type='checkbox'></th>
  11. <th class='list-table-sort-td'><button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button></th>
  12. <th class='text-left nowrap'>名称</th>
  13. <th class='text-left nowrap'>轮播图</th>
  14. <!-- <th class='text-left nowrap' style="width: 30%;">链接</th>-->
  15. <th class="text-left" style="width: 20%">操作</th>
  16. </tr>
  17. </thead>
  18. <tbody>
  19. {foreach $list as $key=>$vo}
  20. <tr>
  21. <td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
  22. <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>
  23. <td class='text-left nowrap'>{$vo.name|default=''}</td>
  24. <td class='text-left nowrap'><img data-tips-image="{$vo.cover|default=''}" src="{$vo.cover|default=''}" height="50" width="110px"></td>
  25. <!-- <td class='text-left nowrap'>{$vo.link|default=''}</td>-->
  26. <td class='text-left' style="width: 20%">
  27. <a data-title="编辑轮播图" class="layui-btn layui-btn-sm" data-open='{:url("edit")}?id={$vo.id}'>编 辑</a>
  28. <span class="layui-btn layui-btn-sm layui-btn-danger" onclick="btn_confirm('删除','del','{$vo.id}');">删 除</span>
  29. </td>
  30. </tr>
  31. {/foreach}
  32. </tbody>
  33. </table>
  34. {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
  35. </div>
  36. <script>
  37. function btn_confirm(msg,fun,id) {
  38. layer.confirm('请确定是否'+msg, {btn: ['确定', '取消'], title: "提示"}, function () {
  39. var url = "/store/banner/"+fun;
  40. layer.closeAll();
  41. $.ajax({
  42. type: "post",
  43. url: url,
  44. data: {id:id},
  45. dataType: "json",
  46. async: false,
  47. success: function (data) {
  48. layer.msg(data.info);
  49. setTimeout(function () {
  50. window.location.reload();
  51. },1000)
  52. }
  53. });
  54. });
  55. }
  56. </script>
  57. {/block}