classify_list.html 1.7 KB
<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="#">分类管理</a></li>
        <li ><a href="{:url('Label/lab_list')}">标签管理</a></li>
    </ul>
   <a href="{:url('Label/classify_add')}"><button type="button" class="btn btn-default" style="margin-top: 10px;">添加分类</button></a>
    <table class="table table-hover table-bordered table-list">
        <caption>分类管理列表</caption>
        <thead>
        <tr>
            <th>分类名称</th>
            <th>创建时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody class="tb">
            <volist name="data" id="vo">
                <tr class="tr{$vo.id}">
                    <td>{$vo.name}</td>
                    <td>{$vo.create_time|date="Y-m-d H:i:s",###}</td>
                    <td>
                        <a href="{:url('Label/classify_edit',array('id'=>$vo.id))}"><button type="button" class="btn btn-default">编辑</button></a>
                        <button type="button" class="btn btn-default" onclick="del({$vo.id})">删除</button>
                    </td>
                </tr>
            </volist>
        </tbody>
    </table>
</div>

<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script>
    //删除
    function del(id){
        ccc = window.confirm('这条分类下的所有商品也会删除,是否删除这条分类?');
        if(ccc){
            $.post("{:url('Label/classify_del')}",{id:id},function(data){
                if(data){
                    $('.tr'+id).remove();
                }else{
                    alert('删除失败');
                }
            });
        }
    }
</script>
</body>
</html>