Index.html 3.03 KB
<%include '../../common/__ui/header'%>
<%include '../../common/__partail/ListHeader'%>

<div class="contentpanel">
    <div class="panel" style="padding: 20px">
        <div id="showCategory" style="display: none"></div>
    </div>
</div>

<script type="text/template" id="addTemplate">
    <div class="form-horizontal" id="shopCategoryAdd">
        <div class="form-group">
            <label for="categoryName" class="col-sm-3 control-label">商品分类名称:</label>
            <div class="col-sm-5">
                <input type="text" id="categoryName" value="[[data]]" class="form-control" />
            </div>
            <div class="col-sm-2"><label style="color: #ff0000; line-height: 40px"> * 必填</label></div>
        </div>
    </div>
</script>

<script type="text/template" id="listTemplate">
    <div class="addCategory" style="margin-bottom: 20px">
        <a class="btn btn-success addBtn"><i class="fa fa-plus"></i> 新增商品分类</a>
        <a href="/shop/shopCategory/batch" class="btn btn-primary large">批量关联类目</a>
        <span style="float: right;font-size: 16px;line-height:37px;font-family:'simhei'">
            当前店铺共有:<b style="color: #5cb85c;font-size: 20px">[[data.length]]</b>&nbsp;条商品分类,<font color="#f0ad4e">最多可以添加20条</font>
        </span>
    </div>
    <table class="table table-striped table-bordered responsive dataTable no-footer" style="text-align: center">
        <thead>
            <tr>
                <th style="text-align: center">类目ID</th>
                <th style="text-align: center">类目名称</th>
                <th style="text-align: center">创建时间</th>
                <th style="text-align: center">已关联商品数量</th>
                <th style="text-align: center">操作</th>
            </tr>
        </thead>
        <tbody style="line-height: 27px">
            [[if data.length > 0]]
            [[each data as item _index]]
            <tr>
                <td style="line-height: 27px">[[item.categoryId]]</td>
                <td style="line-height: 27px">[[item.categoryName]]</td>
                <td style="line-height: 27px">[[item.addTime]]</td>
                <td style="line-height: 27px">[[item.productNum]]</td>
                <td style="line-height: 27px">
                    <a href='javascript:' class='btn btn-xs btn-primary editCategory' data-categoryid='[[item.categoryId]]'>编辑名称</a>
                    <a href='/shop/shopCategory/edit/[[item.categoryId]]/' class='btn btn-xs btn-info'>关联商品</a>
                    <a href='/shop/shopCategory/info/[[item.categoryId]]/' class='btn btn-xs btn-info' style="display: none">查看</a>
                    <a href='javascript:' class='btn btn-xs btn-danger deleteBtn' data-categoryid='[[item.categoryId]]'>删除</a>
                </td>
            </tr>
            [[/each]]
            [[else]]
            <tr><td colspan="6">当前店铺暂无商品分类!</td></tr>
            [[/if]]
        </tbody>
    </table>
</script>

<%include '../../common/__ui/footer'%>