<?php
$cates = app(MOD)->cids(0, 1);
?>
<div class="layuimini-container layuimini-page-anim">
	<div class="layuimini-main">
		<fieldset class="table-search-fieldset">
			<legend>搜索信息</legend>
			<div style="margin: 10px 10px 10px 10px">
				<form class="layui-form layui-form-pane" action="">
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">名称</label>
							<div class="layui-input-inline">
								<input type="text" name="title" autocomplete="off" class="layui-input">
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">分类</label>
							<div class="layui-input-inline">
								<?= select2($cates, $row['cid'], "cid") ?>
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">状态</label>
							<div class="layui-input-inline">
								<?= select2(array(1 => "正常", 2 => "禁用"), 0, "status") ?>
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">推荐</label>
							<div class="layui-input-inline">
								<?= select2(array(1 => "不推荐", 2 => "推荐"), 0, "tj") ?>
							</div>
						</div>
						<div class="layui-inline">
							<button type="submit" class="layui-btn" lay-submit lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索</button>
						</div>
					</div>
				</form>
			</div>
		</fieldset>
		<script type="text/html" id="toolbarDemo">
			<div class="layui-btn-container">
				<button class="layui-btn layui-btn-sm data-add-btn" lay-event="add"> 添加 </button>
				<button class="layui-btn layui-btn-danger  layui-btn-sm data-add-btn" lay-event="delete"> 批量删除 </button>
			</div>
		</script>
		<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
		<script type="text/html" id="currentTableBar">
			<a class="layui-btn layui-btn-xs data-count-edit" lay-event="edit"><i class="layui-icon">&#xe642;</i></a>
			<a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete"><i class="layui-icon">&#xe640;</i></a>
		</script>
		<script type="text/html" id="tj_switch">
			<input type="checkbox" name="tj" {{#  if(d.tj==2){ }}checked{{#  } }} lay-skin="switch" lay-text="推荐|不推荐" lay-filter="tj" value="{{d.id}}">
			<div class="layui-unselect layui-form-switch" lay-skin="_switch">
		</script>
		<script type="text/html" id="qrcode">
			<div>
				{{#   if(d.qrcode!=null && d.qrcode != false){ }}<img src="{{d.qrcode}}" style="width: 30px; height: 30px; object-fit: cover;"/>{{# } else { }} 无 {{#} }}
			</div>
		</script>
	</div>
</div>
<script>
	var cols = [
		[{
				type: "checkbox",
				width: 50
			},
			{
				field: 'title',
				title: '名称',
				minWidth: 300
			},
			{
				field: 'cname',
				title: '分类',
				minWidth: 100,
			},
			{
				field: 'maximum',
				title: '最高可贷',
				minWidth: 100,
				align: "center"
			},
			{
				field: 'interest',
				title: '最低月息',
				minWidth: 100,
				align: "center"
			},
			{
				field: 'longtime',
				title: '最长可贷',
				minWidth: 100,
				align: "center"
			},
			{
				field: 'loan',
				title: '最快放款',
				minWidth: 100,
				align: "center"
			},
			{
				title: '二维码',
				templet: '#qrcode',
				width: 100,
				align: "center"
			},
			{
				title: '状态',
				templet: '#status_switch',
				width: 100,
				align: "center"
			},
			{
				title: '推荐',
				templet: '#tj_switch',
				width: 100,
				align: "center"
			},
			{
				field: 'sort',
				title: '排序',
				minWidth: 100,
				align: "center",
				edit: true
			},
			{
				title: '操作',
				minWidth: 150,
				toolbar: '#currentTableBar',
				align: "center"
			}
		]
	]
</script>

<?
//$duoduo->get_table_desc("article");
$name = "产品";
include(ADMINROOT . '/template/public/list.tpl.php'); //公共模板
?>