<?php /*a:5:{s:61:"/www/wwwroot/btn.millet-mirth.com/view/admin/article/add.html";i:1665550519;s:60:"/www/wwwroot/btn.millet-mirth.com/view/admin/common/top.html";i:1625466448;s:64:"/www/wwwroot/btn.millet-mirth.com/view/admin/common/ueditor.html";i:1646121304;s:62:"/www/wwwroot/btn.millet-mirth.com/view/admin/common/field.html";i:1641638552;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>
<script type="text/javascript" charset="utf-8" src="/static/tqcms/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/static/tqcms/ueditor/ueditor.all.js"> </script>
<script type="text/javascript" charset="utf-8" src="/static/tqcms/ueditor/lang/zh-cn/zh-cn.js"></script>


<div class="body_top">
	<ul class="title">
    	<li class="active"><a>添加<?php echo htmlentities($model_name); ?></a></li>
    	<li class="seo_show"><a>SEO设置</a></li>
    </ul>
</div>

<div class="common_content scroll" style="overflow-y:scroll">
<form action="<?php echo url('create'); ?>" class="layui-form" name="TQform" id="TQform" method="post" onsubmit="return TQsubmit();">
<input name="table" type="hidden" value="<?php echo htmlentities($model_table); ?>" />
<div class="common_content_left">
<table width="100%" border="1" class="common_table left_table">
  <tr>
    <td class="name">栏目</td>
    <td class="td_input"><input name="pid" type="hidden" value="<?php echo htmlentities($info['id']); ?>" /><strong><?php echo htmlentities($info['catename']); ?></strong></td>
  </tr>
  
  <tbody class="seo_box">
  <tr>
    <td class="name">SEO标　题</td>
    <td class="td_input"><input type="text" name="seo_title" value="" placeholder="" autocomplete="off" class="layui-input"></td>
  </tr>
  <tr>
    <td class="name">SEO关键字</td>
    <td class="td_input"><input type="text" name="seo_keywords" value="" placeholder="" autocomplete="off" class="layui-input"></td>
  </tr>
  <tr>
    <td class="name">SEO描　述</td>
    <td class="td_textarea"><textarea name="seo_description" cols="" rows="" class="layui-textarea"></textarea></td>
  </tr>
  </tbody>

  <tr>
    <td class="name">标题</td>
    <td>
    	<table width="100%" border="0">
          <tr>
            <td class="td_input" style="padding:0 !important; width:420px"><input type="text" name="title" value="" lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input layui-form-danger"></td>
            <td style="padding:0 !important; width:36px">来源</td>
            <td class="td_input" style="padding:0 !important; width:200px"><input type="text" name="admin" value="" autocomplete="off" class="layui-input input180"></td>
            <td style="padding:0 !important; width:36px">排序</td>
            <td class="td_input" style="padding:0 !important; width:100px"><input type="text" name="sort" value="<?php echo htmlentities($info['new_sort']); ?>" autocomplete="off" class="layui-input input80"></td>
            <td style="padding:0 !important; width:63px">点击次数</td>
            <td class="td_input" style="padding:0 !important"><input type="text" name="number" value="" autocomplete="off" class="layui-input input80"></td>
            <td></td>
          </tr>
        </table>
    </td>
  </tr>

    <?php 
    $F=F($info['id']);
     ?>
    <style>
    .tr_pic1 { display:none}
    </style>
    
    <?php if($info['id']==24): ?>
    <style>
    .tr_pic1 { display:table-row}
    </style>
    <?php endif; if(is_array($field_list_array) || $field_list_array instanceof \think\Collection || $field_list_array instanceof \think\Paginator): $i = 0; $__LIST__ = $field_list_array;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;if($v['field_mk']=='文本框'): ?>
<!--文本框-->
<tr class="tr_<?php echo htmlentities($v['field_name']); ?>">
    <td class="name"><?php echo htmlentities($v['field_cn_name']); ?></td>
    <td class="td_input"><input name="<?php echo htmlentities($v['field_name']); ?>" value="<?php echo htmlentities($info[$v['field_name']]); ?>" autocomplete="off" type="text" class="layui-input" /></td>
</tr>
<?php endif; if($v['field_mk']=='多行文本框'): ?>
<!--多行文本框-->
<tr class="tr_<?php echo htmlentities($v['field_name']); ?>">
    <td class="name"><?php echo htmlentities($v['field_cn_name']); ?></td>
    <td class="td_textarea"><textarea name="<?php echo htmlentities($v['field_name']); ?>" cols="" rows="" class="layui-textarea"><?php echo htmlentities($info[$v['field_name']]); ?></textarea></td>
</tr>
<?php endif; if($v['field_mk']=='在线编辑器'): ?>
<!--在线编辑器-->
<tr class="tr_<?php echo htmlentities($v['field_name']); ?>">
    <td class="name"><?php echo htmlentities($v['field_cn_name']); ?></td>
    <td class="td_ueditor">
		<script  id="<?php echo $v['field_name'] ?>" type="text/plain" style="width:100%; height:250px;" name="<?php echo $v['field_name'] ?>" ><?php echo $info[$v['field_name']]; ?></script>
		<script type="text/javascript">
			var ue_<?php echo $v['field_name'] ?> = UE.getEditor("<?php echo $v['field_name'] ?>");
		</script></td>
</tr>
<?php endif; if($v['field_mk']=='上传图片'): ?>
<!--上传图片-->
<tr class="tr_<?php echo htmlentities($v['field_name']); ?>">
    <td class="name"><?php echo htmlentities($v['field_cn_name']); ?></td>
    <td class="td_input">
    	
		<input type="text" name="<?php echo $v['field_name'] ?>" id="upimg_<?php echo $v['field_name'] ?>" value="<?php echo $info[$v['field_name']]; ?>" class="layui-input" /> 
		<input type="file" id="for_<?php echo $v['field_name'] ?>" name="" onchange="upload_<?php echo $v['field_name'] ?>(this)" style="display:none">
		<label for="for_<?php echo $v['field_name'] ?>" class="for_label"><p class="layui-btn layui-btn-normal layui-btn-sm"><i class="layui-icon">&#xe67c;</i>上传图片</p></label>
		
		<script>
		function upload_<?php echo $v['field_name'] ?>(obj){
			if(obj.value==""){return;}
			var formdata = new FormData();
			formdata.append("file" , $(obj)[0].files[0]);
			$.ajax({
				type :"post",
				url : "<?php echo url("index/Upload/upload"); ?>",
				data : formdata,
				cache : true,
				processData : false,
				contentType : false,
				success : function(date){
					if(date.type==1){
						layer.msg(date.info, {icon:1,time:1500});
						$("#upimg_<?php echo $v['field_name'] ?>").val(date.file);
						$(".yulan_<?php echo $v['field_name'] ?>").show().attr("data-file",date.file);
					}else{
						layer.msg(date.info, {icon:2,time:1500});
					}
				},
				error : function(){ }
			});
		}			
		</script>
    	<a data-file="<?php echo htmlentities($info[$v['field_name']]); ?>" class="tq_img_look yulan_<?php echo htmlentities($v['field_name']); ?> layui-btn layui-btn-normal layui-btn-sm" style="display:<?php if($info[$v['field_name']]==''): ?>none<?php endif; ?>">预览</a>
    </td>
</tr>
<?php endif; if($v['field_mk']=='上传文件'): ?>
<!--上传文件-->
<tr class="tr_<?php echo htmlentities($v['field_name']); ?>">
    <td class="name"><?php echo htmlentities($v['field_cn_name']); ?></td>
    <td class="td_input">
    	
		<input type="text" name="<?php echo $v['field_name'] ?>" id="upimg_<?php echo $v['field_name'] ?>" value="<?php echo $info[$v['field_name']]; ?>" class="layui-input" /> 
		<input type="file" id="for_<?php echo $v['field_name'] ?>" name="" onchange="upload_<?php echo $v['field_name'] ?>(this)" style="display:none">
		<label for="for_<?php echo $v['field_name'] ?>" class="for_label"><p class="layui-btn layui-btn-normal layui-btn-sm"><i class="layui-icon">&#xe67c;</i>上传文件</p></label>
		
		<script>
		function upload_<?php echo $v['field_name'] ?>(obj){
			if(obj.value==""){return;}
			var formdata = new FormData();
			formdata.append("file" , $(obj)[0].files[0]);
			$.ajax({
				type :"post",
				url : "<?php echo url("index/Upload/upload_file"); ?>",
				data : formdata,
				cache : true,
				processData : false,
				contentType : false,
				success : function(date){
					if(date.type==1){
						layer.msg(date.info, {icon:1,time:1500});
						$("#upimg_<?php echo $v['field_name'] ?>").val(date.file);
						$(".yulan_<?php echo $v['field_name'] ?>").show().attr("data-file",date.file);
					}else{
						layer.msg(date.info, {icon:2,time:1500});
					}
				},
				error : function(){ }
			});
		}			
		</script>
    </td>
</tr>
<?php endif; if($v['field_mk']=='组合字段'): ?>
<!--组合字段-->
<tr class="tr_<?php echo htmlentities($v['field_name']); ?>">
    <td class="name"><?php echo htmlentities($v['field_cn_name']); ?></td>
    <td class="td_input"><?php if(empty($_GET['id'])): ?><span style="color:#f00">本处需要在数据添加完成后在编辑页面进行操作</span><?php else: ?><a href="javascript:cate_frame('<?php echo url('/admin/Article/field',array('pid'=>$v['field_name']."_".$info['id']."",'catename'=>$info['catename'].$v['field_cn_name'])); ?>');" class="layui-btn layui-btn-sm">查看管理</a><?php endif; ?></td>
</tr>
<?php endif; if($v['field_mk']=='系统字典'): ?>
<!--组合字段-->
<tr class="tr_<?php echo htmlentities($v['field_name']); ?>">
    <td class="name"><?php echo htmlentities($v['field_cn_name']); ?></td>
    <td class="field_td_select">
    	<select name="<?php echo htmlentities($v['field_name']); ?>" lay-ignore class="select_ys">
            <option value="">请选择</option>
            <?php $_result=Label($v['field_name'],0);if(is_array($_result) || $_result instanceof \think\Collection || $_result instanceof \think\Paginator): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$c): $mod = ($i % 2 );++$i;?>
            <option value="<?php echo htmlentities($c['id']); ?>" <?php if($info[$v['field_name']]==$c['id']): ?>selected<?php endif; ?>><?php echo htmlentities($c['name']); ?></option>
            <?php endforeach; endif; else: echo "" ;endif; ?>
         </select>
    </td>
</tr>
<?php endif; if($v['field_mk']=='城市联动'): ?>
<!--系统字典-->
<tr class="tr_<?php echo htmlentities($v['field_name']); ?>">
    <td class="name"><?php echo htmlentities($v['field_cn_name']); ?></td>
    <td class="field_td_select">
    	
        <?php 
        if(empty($info['city'])){
            $field_city='';
            $pid='';
        }else{
            $field_city=$info['city'];
            $pid=tq_value($field_city,'pid','label');
        }
         ?>
    	省份：<select name="" id="address_sf" lay-ignore class="select_ys" onchange="ceshi(this.value);">
    	  		<option value="">请选择</option>
    	  		<?php $_result=Label('city',0);if(is_array($_result) || $_result instanceof \think\Collection || $_result instanceof \think\Paginator): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$c): $mod = ($i % 2 );++$i;?>
                <option value="<?php echo htmlentities($c['id']); ?>" <?php if($pid==$c['id']): ?>selected<?php endif; ?>><?php echo htmlentities($c['name']); ?></option>
                <?php endforeach; endif; else: echo "" ;endif; ?>
    		 </select>
        城市：
        	<select name="<?php echo htmlentities($v['field_name']); ?>" id="shict" class="select_ys" lay-ignore>
    	  		<option value="">请选择</option>
    		</select>
            </span>
    </td>
</tr>
<script>
$(document).ready(function(){
	var pid="<?php echo htmlentities($pid); ?>";
	if(pid!=''){ ceshi(pid); }
});

function ceshi(pid){
	$.post('/index/Ajax/label',{field:'city',pid:pid},function(data){
		html='';
		var s=data.list.length;
		html+="<option value=\"\">请选择</option>";
		if(pid!=''){
			for(i=0;i<s;i++){
				if(data.list[i].id=="<?php echo htmlentities($field_city); ?>"){
				html+="<option value=\""+data.list[i].id+"\" selected>"+data.list[i].name+"</option>";
				}else{
				html+="<option value=\""+data.list[i].id+"\">"+data.list[i].name+"</option>";
				}
			}
		}
		$('#shict').html(html);
    });
	return false;
}
</script>
<?php endif; ?>

<?php endforeach; endif; else: echo "" ;endif; ?>
  
</table>

</div>
<div class="common_content_right">

<table width="100%" border="1" class="right_table">
  <tr>
    <td>缩略图</td>
  </tr>
  <tr>
    <td class="td_img pic_a">
		<input type="<?php if(TQ('IS_SYSTEM','true')==true): ?>text<?php else: ?>hidden<?php endif; ?>" name="pic" id="upimg_pic" class="layui-input" value="" /> 
		<input type="file" id="for_pic" name="" onchange="upload_pic(this)" style="display:none">
		<label for="for_pic"><img src="/static/tqcms/img/upload-pic.png" id="img_pic_show" /></label>
		<a data-file="" class="tq_img_look layui-btn layui-btn-normal layui-btn-sm yulan_pic">预览</a>
		<a class="layui-btn layui-btn-danger layui-btn-sm tq_img_delete">删除</a>
    </td>
  </tr>
  <tr>
    <td>文章日期</td>
  </tr>
  <tr>
    <td class="r_td_input"><input type="text" name="article_time" value="<?php echo date('Y-m-d'); ?>" id="date" lay-verify="date" autocomplete="off" class="layui-input"></td>
  </tr>
  <tr>
    <td>发布日期</td>
  </tr>
  <tr>
    <td class="r_td_input"><input type="text" name="create_time" value="<?php echo date('Y-m-d H:i:s'); ?>" id="date1" lay-verify="date" autocomplete="off" class="layui-input"></td>
  </tr>
  <tr>
    <td>显示截止时间</td>
  </tr>
  <tr>
    <td class="r_td_input"><input type="text" name="end_time" value="" id="date2" lay-verify="date" placeholder="永久" autocomplete="off" class="layui-input"></td>
  </tr>
  <tr>
    <td>自定义属性</td>
  </tr>
  <tr>
    <td class="r_td_checkbox">
	
	<!--
	用于特定模型不需要看到特定自定义属性
	<?php if($info['model_id']!=3 and $key=='a'): ?><input type="checkbox" name="att[]" <?php if(inarray($key,$att)==1): ?>checked<?php endif; ?> value="<?php echo htmlentities($key); ?>" lay-skin="primary" title="<?php echo htmlentities($v); ?>"><?php endif; if($info['model_id']==3): ?><input type="checkbox" name="att[]" <?php if(inarray($key,$att)==1): ?>checked<?php endif; ?> value="<?php echo htmlentities($key); ?>" lay-skin="primary" title="<?php echo htmlentities($v); ?>"><?php endif; ?>
	-->
	
    <?php if(is_array($ARTICLE_ATT) || $ARTICLE_ATT instanceof \think\Collection || $ARTICLE_ATT instanceof \think\Paginator): $i = 0; $__LIST__ = $ARTICLE_ATT;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
    <input type="checkbox" name="att[]" value="<?php echo htmlentities($key); ?>" lay-skin="primary" title="<?php echo htmlentities($v); ?>">
    <?php endforeach; endif; else: echo "" ;endif; ?>
    </td>
  </tr>
  <tr>
    <td>外链</td>
  </tr>
  <tr>
    <td class="r_td_input"><input type="text" name="link" value="" placeholder="http://" autocomplete="off" class="layui-input"></td>
  </tr>

</table>

</div>




</form>

</div>

<div class="common_foot">
<input name="" type="submit" onclick="TQsubmit();" class="layui-btn TQmovesubmit" />　　
<input name="" type="button" onclick="article_close();" value="关闭" 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>
iname=self.frameElement.name;
function TQsubmit(){
	//TQform.submit();
	$('.TQmovesubmit').attr('onclick','');
	$.post('create',$("#TQform").serialize(),function(data){
		if(data.type==2){
			window.top.article_submit('添加',iname);
		}else{
			layer.msg(data['msg'], {icon:2,time:1000});
			$('.TQmovesubmit').attr('onclick','TQsubmit();');
		}
		
    });
	return false;
}

layui.use(['form', 'laydate'], function(){
	var form = layui.form
	,laydate = layui.laydate;

	//日期
	laydate.render({
		elem: '#date', //需要渲染的input id
		type: 'date',
		position: 'fixed',
		ready: function(date){
			date_top('150px');
		}
	});

	laydate.render({
		elem: '#date1', //需要渲染的input id
		type: 'datetime',
		position: 'fixed',
		ready: function(date){
			date_top('232px');
		}
	});

	laydate.render({
		elem: '#date2', //需要渲染的input id
		type: 'datetime',
		position: 'fixed',
		ready: function(date){
			date_top('309px');
		}
	});

  
});


$("body").on('click','.pic_click',function(){
   	var t=$(this);
	t.siblings('.upload_pic').show();
});

//关闭当前iframe
function article_close(){
	window.top.article_close(iname);
}

function date_top(px){
	var common_content_height=$('.common_content').height();
	var common_content_right_height=$('.common_content_right').height();
	var tp=((common_content_height-324)/2)+60;
	if(common_content_height<=common_content_right_height){
		$('.layui-laydate').hide();
		setTimeout(function(){
			$(".layui-laydate").css('top',tp);
			$('.layui-laydate').show();
		},100);
	}else{
		$(".layui-laydate").css('top',px);
	}
}


$(document).ready(function(){
	$('.seo_show').click(function(){
		$('.seo_box').fadeToggle();
	});
});

window.onresize = function(){
	var common_content_height=$('.common_content').height();
	var common_content_right_height=$('.common_content_right').height();
	if(common_content_height<=common_content_right_height){
		$('.common_content_right').addClass('right_op');
	}else{
		$('.common_content_right').removeClass('right_op');
	}
};
window.onload = function(){
	var common_content_height=$('.common_content').height();
	var common_content_right_height=$('.common_content_right').height();
	if(common_content_height<=common_content_right_height){
		$('.common_content_right').addClass('right_op');
	}else{
		$('.common_content_right').removeClass('right_op');
	}
};

function upload_pic(obj){
	if(obj.value==""){return;}
	var formdata = new FormData();
	formdata.append("file" , $(obj)[0].files[0]);
	$.ajax({
		type :"post",
		url : "<?php echo url('index/Upload/upload'); ?>",
		data : formdata,
		cache : true,
		processData : false,
		contentType : false,
		success : function(date){
			if(date.type==1){
				layer.msg(date.info, {icon:1,time:1500});
				$("#upimg_pic").val(date.file);
				$("#img_pic_show").attr("src",date.file);
				$(".yulan_pic").attr("data-file",date.file);
			}else{
				layer.msg(date.info, {icon:2,time:1500});
			}
		},
		error : function(){ }
	});
}			
</script>