1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- {extend name='admin@main'}
- {block name="button"}
- <button data-modal='{:url("add")}?datum_id={$datum_id}' data-title="添加" class='layui-btn layui-btn-sm layui-btn-primary'>添加</button>
- {/block}
- {block name="content"}
- <div class="think-box-shadow">
- <table class="layui-table margin-top-20" lay-skin="line">
- <thead>
- <tr>
- <th class='text-left nowrap'>ID</th>
- <th class='text-left nowrap'>标题</th>
- <th class='text-left nowrap'>文件</th>
- <th class='text-left nowrap'>是否VIP</th>
- <th class="text-left" style="width: 20%">操作</th>
- </tr>
- </thead>
- <tbody>
- {foreach $list as $key=>$vo}
- <tr>
- <td class='text-left nowrap'>{$vo.id|default=''}</td>
- <td class='text-left nowrap'>{$vo.title|default=''}</td>
- <td class='text-left nowrap'>{$vo.url|default=''}</td>
- <td class='text-left nowrap'>{$vo.is_vip ? '是':'否'}</td>
- <td class='text-left' style="width: 20%">
- <a data-title="编辑" class="layui-btn layui-btn-xs" data-modal='{:url("edit")}?id={$vo.id}&datum_id={$vo.datum_id}'>编 辑</a>
- <span class="layui-btn layui-btn-xs layui-btn-danger" onclick="btn_confirm('删除','del','{$vo.id}');">删 除</span>
- </td>
- </tr>
- {/foreach}
- </tbody>
- </table>
- {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
- </div>
- <script>
- function btn_confirm(msg,fun,id) {
- layer.confirm('请确定是否'+msg, {btn: ['确定', '取消'], title: "提示"}, function () {
- var url = "/nutrition/datum_url/"+fun;
- layer.closeAll();
- $.ajax({
- type: "post",
- url: url,
- data: {id:id},
- dataType: "json",
- async: false,
- success: function (data) {
- layer.msg(data.info);
- setTimeout(function () {
- window.location.reload();
- },1000)
- }
- });
- });
- }
- </script>
- {/block}
|