<?php
//$duoduo->get_table_desc("article");
$cates = app(MOD)->cids(0, 1);
//$data['switch']['tj']=array("openvalue"=>2,"default"=>"close");
//include(ADMINROOT.'/template/public/'.$act.'.tpl.php'); //公共模板

$row = $duoduo->select(MOD, "*", "id=" . $_GET['id']);
?>
<br>
<div class="layui-form layuimini-main">

	<!-- <blockquote class="layui-elem-quote layui-text">
		设置为推荐，并设置图片大小为750px*400，则会显示到首页的广告图中.只针对站内资讯类别
	</blockquote> -->

	<div class="layui-form-item" id="app">
		<label class="layui-form-label required">标题</label>
		<div class="layui-input-block">
			<input type="text" name="title" lay-verify="required" lay-reqtext="" placeholder="请输入名称" value="<?= $row['title'] ?>" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item" id="subapp">
		<label class="layui-form-label required">描述</label>
		<div class="layui-input-block">
			<input type="text" name="subtitle" lay-verify="required" lay-reqtext="" placeholder="请输入副标题" value="<?= $row['subtitle'] ?>" class="layui-input">
		</div>
	</div>

	<?
	$title = "二维码";
	$field = "qrcode";
	$name = "qrcode";
	$fvalue = $row['qrcode'];
	$desc = "用于客户提交信息的二维码";
	include(ADMINROOT . '/template/tpl/inputimg.tpl.php');
	?>

	<div class="layui-form-item">
		<label class="layui-form-label required">推荐</label>
		<div class="layui-input-block">
			<?= html_radio1(array(1 => "不推荐", 2 => "推荐"), $row['tj'] ? $row['tj'] : 1, "tj") ?>
		</div>
	</div>

	<div class="layui-form-item">
		<label class="layui-form-label">状态</label>
		<div class="layui-input-block">
			<?= html_radio1(array(1 => "正常", 2 => "禁用"), $row['status'] ? $row['status'] : 1, "status") ?>
		</div>
	</div>


	<div class="layui-form-item">
		<label class="layui-form-label required">最高可贷</label>
		<div class="layui-input-inline">
			<input type="text" name="maximum" id="maximumvalue" lay-verify="required" lay-reqtext="" placeholder="如：300万" value="<?= $row['maximum'] ?>" class="layui-input">
		</div>
		<label class="layui-form-label required">最低月息</label>
		<div class="layui-input-inline">
			<input type="text" name="interest" id="interestvalue" lay-verify="required" lay-reqtext="" placeholder="如：3.35厘" value="<?= $row['interest'] ?>" class="layui-input">
		</div>
		<label class="layui-form-label required">最长可贷</label>
		<div class="layui-input-inline">
			<input type="text" name="longtime" id="longtimevalue" lay-verify="required" lay-reqtext="" placeholder="如：3年" value="<?= $row['longtime'] ?>" class="layui-input">
		</div>
	</div>

	<div class="layui-form-item">
		<label class="layui-form-label required">最快放款</label>
		<div class="layui-input-inline">
			<input type="text" name="loan" id="loanvalue" lay-verify="required" lay-reqtext="" placeholder="如：当天、三天、当月" value="<?= $row['loan'] ?>" class="layui-input">
		</div>
		<label class="layui-form-label">分类</label>
		<div class="layui-input-inline">
			<?= select3($cates, $row['cid'], "cid") ?>
		</div>
		<label class="layui-form-label required">排序</label>
		<div class="layui-input-inline">
			<input type="text" name="sort" lay-verify="required|number" lay-reqtext="" placeholder="请输入数字" value="<?= $row['sort'] ? $row['sort'] : 0 ?>" class="layui-input">
		</div>
	</div>

	<!-- 
	<div class="layui-form-item">
		<label class="layui-form-label required">小程序跳转类型</label>
		<div class="layui-input-block">
			<?= html_radio1(array(1 => "普通", 2 => "导航"), $row['xcx_type'] ? $row['xcx_type'] : 1, "xcx_type") ?>
		</div>
	</div>

	<div class="layui-form-item">
		<label class="layui-form-label required">小程序跳转URL</label>
		<div class="layui-input-block">
			<input type="text" name="xcx_url" lay-reqtext="" placeholder="" value="<?= $row['xcx_url'] ?>" class="layui-input">
		</div>
	</div> -->

	<!--  <div class="layui-form-item layui-form-text">
		    <label class="layui-form-label">描述</label>
		    <div class="layui-input-block">
		      <textarea placeholder="" class="layui-textarea"  name="desc"><?= $row["desc"] ?></textarea>
		    </div>
      </div> -->


	<div class="layui-form-item">
		<div class="layui-input-block">
			<div class="layui-tab">
				<ul class="layui-tab-title">
					<li class="layui-this">产品详情</li>
					<li>申请条件</li>
					<li>所需材料</li>
					<li>利率说明</li>
					<li>费用说明</li>
				</ul>
				<div class="layui-tab-content">
					<div class="layui-tab-item layui-show">
						<?php
						$title = '';
						$field = "detail";
						$fvalue = $row['detail'];
						include(ADMINROOT . '/template/tpl/kindeditor.tpl.php');
						?>
					</div>
					<div class="layui-tab-item">
					<?php
						$field = "condition";
						$fvalue = $row['condition'];
						include(ADMINROOT . '/template/tpl/kindeditor.tpl.php');
						?>
					</div>
					<div class="layui-tab-item">
					<?php
						$field = "material";
						$fvalue = $row['material'];
						include(ADMINROOT . '/template/tpl/kindeditor.tpl.php');
						?>
					</div>
					<div class="layui-tab-item">
					<?php
						$field = "rate_desc";
						$fvalue = $row['rate_desc'];
						include(ADMINROOT . '/template/tpl/kindeditor.tpl.php');
						?>
					</div>
					<div class="layui-tab-item">
					<?php
						$field = "cost_desc";
						$fvalue = $row['cost_desc'];
						include(ADMINROOT . '/template/tpl/kindeditor.tpl.php');
						?>
					</div>
				</div>
			</div>
		</div>
	</div>
	<?php
	// $field = "content";
	// $title = "内容";
	// $fvalue = $row['content'];
	// include(ADMINROOT . '/template/tpl/kindeditor.tpl.php');
	?>

	<div class="layui-form-item">
		<div class="layui-input-block">

			<input type="hidden" value="<?= $row['id'] ?>" name="id">
			<button class="layui-btn layui-btn-normal jian_save" lay-submit lay-filter="saveBtn">确认保存</button>
		</div>
	</div>



</div>
<script>
	layui.use(['form', 'table', 'miniAdmin', 'layedit'], function() {
		var form = layui.form,
			layer = layui.layer,
			miniAdmin = layui.miniAdmin,
			layedit = layui.layedit;
		table = layui.table,
			$ = layui.jquery;
		/**
		 * 初始化表单，要加上，不然刷新部分组件可能会不加载
		 */
		form.render();
		form.on('select(node_id)', function(data) {
			$('#nodevalue').val(data.value);
		})
	});
</script>