<include file="Common/base" />
<div class="am-cf admin-main">
<include file="Common/sidebar" nav="goods" navv="goods_cat"/>
<style type="text/css">
  a.am-text-secondary:visited{color:#3bb4f2;}
  a.am-text-danger:visited{color:#dd514c;}
  .am-btn-default {background-color: #fff;}
  th {text-align:center;}
  tr td{text-align:center;}
  select{padding: 4px;border: 1px solid #ccc;}
  .am-popup-bd {background:#fff;}
  .am-popup-bd img {max-width: 100%}
  .am-u-sm-2 {border-top: 1px solid #ddd;margin-top: 10px;}
  .am-u-sm-10 {border-left: 1px solid #ddd;margin-top: 10px;}
  .am-table>tbody>tr>td.user-info {padding: 1px;text-align: left;}
  .am-table>tbody>tr>td.user-info img{height: 42px}
  myred{color:#dd514c;}
  mygreen {color:#1aad19;}
  mygery {color:#999;}
  .wxgreen {color:#1aad19;}
  .search-div.am-input-group .am-form-field{width:120px;float: right;}
  .search-div select {float: right;}
  .ttt-switch {margin: 0 auto;}
  .am-form select{
    font-size: 1.2rem;
    border-color: #e6e6e6;
    width: unset;
    padding: .5em 2em .5em 1em;
    margin: 0 auto;
  }
  .am-table>tbody>tr>td.td-img {
    padding: 1px;
    text-align: left;
  }
  .am-table>tbody>tr>td.td-img img {
    height: 42px;
    float: right;
  }
</style>
<div class="admin-content">
  <div class="admin-content-body">
    <div class="am-cf am-padding">
      <div class="am-fl am-cf">
        <strong class="am-text-primary am-text-lg">商品管理</strong> / 
        <small>商品二级分类</small>
      </div>
    </div>
    <hr style="margin-top:0px;">

    <?php if($auth){ ?>
    <div class="am-g">
      <div class="am-u-sm-12 am-u-md-4">
        <div class="am-btn-toolbar">
          <div class="am-btn-group am-btn-group-xs">
            <a class="am-btn am-btn-secondary" href="{:U('goods_cat_op')}?pid={$_GET['pid']}">
            <span class="am-icon-plus"> 新增分类 </span></a>
          </div>
        </div>
      </div>
    </div>
    <?php } ?>

    <div class="am-g">
      <div class="am-u-sm-12">
        <form class="am-form am-scrollable-horizontal">
          <table class="am-table table-main am-text-nowrap">
            <thead>
              <tr>
                <th width="10%">排序</th>
                <th width="5%"></th>
                <th width="10%" style="text-align: left;">分类名称</th>
                <th width="10%">首页显示</th>
                <th width="10%">状态</th>
                <th width="10%">操作</th>
              </tr>
            </thead>
            <tbody>
              <if condition="!$cat">
                <tr><td colspan="6" style="text-align:center;">这里啥都没有</td></tr>
              </if>
              <volist name="cat" id="vo" key="k">
                <tr>
                  <td>{$vo.seat_no}</td>
                  <td class="td-img"><img src="{$vo.img}"></td>
                  <td style="text-align: left;">{$vo.title}</td>
                  <td><?php echo $vo['home_show']==1?"是":"<mygery>否</mygery>";?></td>
                  <td><?php echo $vo['status']==1?"启用":"<mygery>禁用</mygery>";?></td>
                  <td style="padding:.45rem;">
                    <?php if($auth){ ?>
                    <a href="{:U('goods_cat_op')}?op=edit&id={$vo.id}" class="am-btn am-btn-default am-btn-xs">编辑</a>
                    <a href="{:U('goods_cat_op')}?op=dele&id={$vo.id}" class="am-btn am-btn-default am-btn-xs">删除</a>
                    <a href="{:U('cateattr_lists')}?pid={$vo.id}" class="am-btn am-btn-default am-btn-xs">查看分类属性</a>
                    <?php } ?>
                  </td>
                </tr>
              </volist>
            </tbody>
          </table>
        </form>
        <div class="am-cf">
          <div class="am-fr">
            {$page}
          </div>
        </div>
      </div>
    </div>
  </div>
  <footer class="admin-content-footer"><hr></footer>
</div>
<include file="Common/foot" />