<?php /*a:3:{s:58:"/www/wwwroot/btn.millet-mirth.com/view/admin/cate/add.html";i:1641355030;s:60:"/www/wwwroot/btn.millet-mirth.com/view/admin/common/top.html";i:1625466448;s:63:"/www/wwwroot/btn.millet-mirth.com/view/admin/common/bottom.html";i:1629163316;}*/ ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title><?php echo config('common.CMS_NAME'); ?></title>
<link rel="stylesheet" href="/static/tqcms/css/common.css">
<link rel="stylesheet" href="/static/tqcms/layui/css/layui.css"><!--layui css-->
<link rel="stylesheet" href="/static/tqcms/css/skin.css">
<script src="/static/tqcms/js/jquery.js"></script>
</head>
<body>

<div class="cate_content">
	<form action="" class="layui-form" name="TQform" id="TQform" method="post" onsubmit="return TQsubmit();">
    <div class="layui-tab">
        <ul class="layui-tab-title">
            <li class="layui-this">基本信息</li>
            <li>模板页面</li>
            <li>SEO设置</li>
        </ul>
        
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
            
                <ul class="<?php if(TQ('IS_SYSTEM')==1): ?>li_margin<?php endif; ?>">
                    <li>
                    <label class="layui-form-label">上级栏目</label>
                    <div class="layui-input-block layui-cate-pid cate_select_dl" lay-filter="layui-cate-pid">
                    <select name="pid" lay-filter="pid" lay-search>
                    <option value="">顶级栏目</option>
                    <?php if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
                    <option value="<?php echo htmlentities($v['id']); ?>" data-lv="<?php echo htmlentities($v['level']); ?>" <?php if($pid==$v['id']): ?>selected<?php endif; ?>><?php echo htmlentities($v['catename']); ?></option>
                    <?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                    </div>
                    </li>
                    <li>
                    <label class="layui-form-label">所属模型</label>
                    <div class="layui-input-block layui-model_id" lay-filter="layui-model_id">
                    <select name="model_id" lay-filter="model_id" lay-search>
                        <?php if(is_array($cate_type_list) || $cate_type_list instanceof \think\Collection || $cate_type_list instanceof \think\Paginator): $i = 0; $__LIST__ = $cate_type_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
                        <option value="<?php echo htmlentities($v['id']); ?>" data-list="<?php echo htmlentities($v['list']); ?>" data-info="<?php echo htmlentities($v['info']); ?>"><?php echo htmlentities($v['name']); ?></option>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                    
                    </div>
                    </li>
                    <li><label class="layui-form-label">栏目名称</label><input type="text" name="catename" value="" placeholder="" autocomplete="off" class="layui-input"></li>
                    <li><label class="layui-form-label">栏目目录</label><input type="text" name="cateseo" value="" placeholder="用于URL美化,如:about" autocomplete="off" class="layui-input"></li>
                    <li><label class="layui-form-label">分页数量</label><input type="text" name="catepage" value="30" placeholder="" autocomplete="off" class="layui-input"></li>
                    <li>
                        <label class="layui-form-label">是否显示</label>
                        <div>
                        <input type="radio" name="is_effect" value="1" title="启用" checked>
                        <div class="layui-unselect layui-form-radio layui-form-radioed"><i class="layui-anim layui-icon"></i><div>启用</div></div>
                        <input type="radio" name="is_effect" value="2" title="停用">
                        <div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i><div>停用</div></div>
                        </div>
                    </li>
                    <li>
                        <label class="layui-form-label">顶部导航</label>
                        <div>
                        <input type="radio" name="is_top" value="2" title="否" checked>
                        <div class="layui-unselect layui-form-radio layui-form-radioed"><i class="layui-anim layui-icon"></i><div>否</div></div>
                        <input type="radio" name="is_top" value="1" title="是">
                        <div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i><div>是</div></div>
                        </div>
                    </li>
                    <li>
                        <label class="layui-form-label">底部导航</label>
                        <div>
                        <input type="radio" name="is_foot" value="2" title="否" checked>
                        <div class="layui-unselect layui-form-radio layui-form-radioed"><i class="layui-anim layui-icon"></i><div>否</div></div>
                        <input type="radio" name="is_foot" value="1" title="是">
                        <div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i><div>是</div></div>
                        </div>
                    </li>

                    <?php if(TQ('IS_SYSTEM')==1): ?>
                    <li>
                        <label class="layui-form-label">系统栏目</label>
                        <div>
                        <input type="radio" name="is_system" value="2" title="否" checked>
                        <div class="layui-unselect layui-form-radio layui-form-radioed"><i class="layui-anim layui-icon"></i><div>否</div></div>
                        <input type="radio" name="is_system" value="1" title="是">
                        <div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i><div>是</div></div>
                        </div>
                    </li>

                    <li>
                        <label class="layui-form-label">内容排序</label>
                        <div>
                        <input type="radio" name="is_sort" value="desc" title="desc" checked>
                        <div class="layui-unselect layui-form-radio layui-form-radioed"><i class="layui-anim layui-icon"></i><div>desc</div></div>
                        <input type="radio" name="is_sort" value="asc" title="asc">
                        <div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i><div>asc</div></div>
                        </div>
                    </li>
                    
                    <li>
                        <label class="layui-form-label">有无详情</label>
                        <div>
                        <input type="radio" name="is_info" value="0" title="有" checked>
                        <input type="radio" name="is_info" value="1" title="无">
                        </div>
                    </li>
					<?php endif; ?>
                    
                    <li>
                        <label class="layui-form-label">下拉菜单</label>
                        <div>
                        <input type="radio" name="is_down" value="1" title="是" checked>
                        <input type="radio" name="is_down" value="2" title="否">
                        </div>
                    </li>


                </ul>
            
            </div>
            <div class="layui-tab-item">
                <ul class="cate_view">
                    <li><label class="layui-form-label">列表模板</label><input type="text" name="view_list" id="view_list" value="list_cate" placeholder="" autocomplete="off" class="layui-input"></li>
                    <li><label class="layui-form-label">详情模板</label><input type="text" name="view_info" id="view_info" value="" placeholder="" autocomplete="off" class="layui-input"></li>
                    <li>
                    <label class="layui-form-label">栏目属性</label>
                    <div class="layui-input-block layui-link">
                    <select name="link" lay-filter="link" lay-search>
                        <option value="1">本栏目</option>
                        <option value="2" disabled>跳转下级</option>
                        <option value="3">外链</option>
                    </select>
                    </div>
                    </li>

                    <li>
                        <label class="layui-form-label">跳新窗口</label>
                        <div>
                        <input type="radio" name="is_new" value="2" title="否" checked>
                        <div class="layui-unselect layui-form-radio layui-form-radioed"><i class="layui-anim layui-icon"></i><div>否</div></div>
                        <input type="radio" name="is_new" value="1" title="是">
                        <div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i><div>是</div></div>
                        </div>
                    </li>
                    
                    <li class="link_url"><label class="layui-form-label">链接地址</label><input type="text" name="link_url" value="http://" placeholder="" autocomplete="off" class="layui-input"></li>
                </ul>
            </div>
            <div class="layui-tab-item">
            	<ul class="cate_seo">
                    <li><label class="layui-form-label">SEO标　题</label><input type="text" name="seo_title" value="" placeholder="" autocomplete="off" class="layui-input"></li>
                    <li><label class="layui-form-label">SEO关键字</label><input type="text" name="seo_keywords" value="" placeholder="" autocomplete="off" class="layui-input"></li>
                    <li><label class="layui-form-label">SEO描　述</label><textarea name="seo_description" class="layui-textarea" cols="" rows=""></textarea></li>
                </ul>
            </div>
        </div>
    </div>
	
        </form>
    

	
</div>

<div class="iframe_foot">
<input name="" type="submit" onclick="TQsubmit();" class="layui-btn" />　　
<input name="" type="button" value="关闭" onclick="open_iframe_close();" class="layui-btn layui-btn-danger" />
</div>
<script src="/static/tqcms/layui/layui.js"></script><!--layui js-->
<script src="/static/tqcms/layui/laytq.js"></script><!--layui js-->
<script src="/static/tqcms/js/common.js"></script>
<script src="/static/tqcms/js/md5.js"></script>
<script src="/static/tqcms/js/url.js"></script>
</body>
</html>
<script>
function TQsubmit(){
	$.post('insert',$("#TQform").serialize(),function(data){
		if(data.type==2){
			layer.msg(data['msg'], {icon:2,time:1000});
		}else{
			layer.msg(data['msg'], {icon:1,time:1000});
			$("body",parent.document).find('#open_iframe').val(1);
			setTimeout(function(){ window.location.reload(); },1500);
		}
    });
	return false;
}

layui.use('form', function(){
	var form = layui.form;
	form.on('select(pid)', function(data){
		var id=$(data.elem).parent().attr('lay-filter');
		var lv=$(data.elem).find("option:selected").attr('data-lv');
		var text=$.trim($('.'+id+' .layui-input').val());
		$('.'+id+' .layui-input').val(text);
		$(data.elem).find("option:selected").text(text);
	});
	
	form.on('select(model_id)', function(data){
		var t=$(data.elem).find("option:selected");
		var list=t.attr('data-list');
		var info=t.attr('data-info');
		$('#view_list').val(list);
		$('#view_info').val(info);
	});

	form.on('select(link)', function(data){
		var t=$(data.elem).find("option:selected").val();
		if(t==3){
			$('.link_url').show();
		}else{
			$('.link_url').hide();
		}
	});
	
});
</script>
