<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0">
<title>{echo admin_title()}</title>
<!--header-->
{template _:header}
</head>
<body>
<div class="layui-layout layui-layout-admin">
<!--top-->
{template _main_top}
<!--nav-->
{template _main_nav}
	<div class="position">
		<h1>商品列表</h1>
	</div>
	<div class="layui-body admin-body">
		<div class="admin-content">
			<div class="searcher">
				<div class="right"><button type="button" class="layui-btn layui-add">添加分类</button></div>
				<div class="clear"></div>
			</div>
			<form name="theform" id="theform" method="post" action="{echo \befen\get_url()}">
			<table class="layui-table">
				<thead>
					<tr>
						<th>分类ID</th>
						<th>分类名</th>
						<th>排序</th>
						<th>显示</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<!--{loop $list $key $val}-->
					<tr>
						<td>{$val[cat_id]}</td>
						<td>{$val[cat_name]}</td>
						<td>{$val[sort]}</td>
						<td><span class="layui-badge layui-bg-status-{$val[is_show]}">{echo $val[is_show]?'是':'否'}</span></td>
						<td class="op">
							<a op="detail" lay-url="{echo url('goodsCat/detail', ['cat_id' => $val['cat_id']])}" class="layui-btn layui-btn-xs layui-btn-normal">分类详情</a>
						</td>
					</tr>
					<!--{/loop}-->
				</tbody>
			</table>
			</form>
		</div>
	</div>
</div>
<!--footer-->
{template _:footer}
<script>
$(".layui-add").click(function(){	
	showWindow('添加分类', "{echo url('goodsCat/add')}", '600px');
});
$("a[op=detail]").click(function(){
	showWindow('分类详情', $(this).attr('lay-url'), '600px');
});
</script>
</body>
</html>