index.html 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. {extend name='admin@main'}
  2. {block name="button"}
  3. <button data-action='{:url("remove")}' data-confirm="确定要删除吗?" data-csrf="{:systoken('remove')}" data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>批量删除</button>
  4. <button data-open='{:url("add")}' data-title="添加" class='layui-btn layui-btn-sm layui-btn-primary'>添加</button>
  5. {/block}
  6. {block name="content"}
  7. <div class="think-box-shadow">
  8. {include file='platform_demand/index_search'}
  9. <table class="layui-table margin-top-20" lay-skin="line">
  10. <thead>
  11. <tr>
  12. <th class='list-table-check-td think-checkbox'><input data-auto-none data-check-target='.list-check-box' type='checkbox'></th>
  13. <th class='list-table-sort-td'>
  14. <button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
  15. </th>
  16. <th class='text-left nowrap'>ID</th>
  17. <th class='text-left nowrap'>标题</th>
  18. <th class='text-left nowrap'>封面</th>
  19. <th class='text-left '>价格</th>
  20. <th class="text-left" style="width: 20%">操作</th>
  21. </tr>
  22. </thead>
  23. <tbody>
  24. {foreach $list as $key=>$vo}
  25. <tr>
  26. <td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
  27. <td class='list-table-sort-td'>
  28. <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">
  29. </td>
  30. <td class='text-left nowrap'>{$vo.id|default='--'}</td>
  31. <td class='text-left nowrap'>{$vo.title|default='--'}</td>
  32. <td class='text-left nowrap'>
  33. <img data-tips-image style="width:50px;height:50px" src="{$vo.cover|default=''}" class="margin-right-5 text-top">
  34. </td>
  35. <td class='text-left nowrap'>{$vo.money|default='--'}</td>
  36. <td class='text-left' style="width: 20%">
  37. <a data-title="查看" class="layui-btn layui-btn-sm" data-open='{:url("edit")}?id={$vo.id}'>查看</a>
  38. {if isset($vo.status) and $vo.status eq 1}
  39. <a class="layui-btn layui-btn-sm layui-btn-normal" data-action="{:url('down')}" data-value="id#{$vo.id};status#0">下 架</a>
  40. {else}
  41. <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('up')}" data-value="id#{$vo.id};status#1">上 架</a>
  42. {/if}
  43. <span data-title="评论" class="layui-btn layui-btn-sm" data-open='{:url("/operate/demand_comment/index")}?first_id={$vo.id}'>评 论</span>
  44. <span class="layui-btn layui-btn-sm layui-btn-danger" onclick="btn_confirm('删除','del','{$vo.id}');">删 除</span>
  45. </td>
  46. </tr>
  47. {/foreach}
  48. </tbody>
  49. </table>
  50. {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
  51. </div>
  52. <script>
  53. function btn_confirm(msg,fun,id) {
  54. layer.confirm('请确定是否'+msg, {btn: ['确定', '取消'], title: "提示"}, function () {
  55. var url = "/operate/platform_demand/"+fun;
  56. layer.closeAll();
  57. $.ajax({
  58. type: "post",
  59. url: url,
  60. data: {id:id},
  61. dataType: "json",
  62. async: false,
  63. success: function (data) {
  64. layer.msg(data.info);
  65. setTimeout(function () {
  66. window.location.reload();
  67. },1000)
  68. }
  69. });
  70. });
  71. }
  72. </script>
  73. {/block}