{volist name="field_list_array" id="v"}

{if $v['field_mk']=='文本框'}
<!--文本框-->
<tr class="tr_{$v.field_name}">
    <td class="name">{$v.field_cn_name}</td>
    <td class="td_input"><input name="{$v.field_name}" value="{$info[$v['field_name']]}" autocomplete="off" type="text" class="layui-input" /></td>
</tr>
{/if}

{if $v['field_mk']=='多行文本框'}
<!--多行文本框-->
<tr class="tr_{$v.field_name}">
    <td class="name">{$v.field_cn_name}</td>
    <td class="td_textarea"><textarea name="{$v.field_name}" cols="" rows="" class="layui-textarea">{$info[$v['field_name']]}</textarea></td>
</tr>
{/if}

{if $v['field_mk']=='在线编辑器'}
<!--在线编辑器-->
<tr class="tr_{$v.field_name}">
    <td class="name">{$v.field_cn_name}</td>
    <td class="td_ueditor">{tp:editor id="<?php echo $v['field_name'] ?>" name="<?php echo $v['field_name'] ?>" type="UEDITOR"  style="width:100%; height:250px;" change=""}{$info[$v['field_name']]|raw}{/tp:editor}</td>
</tr>
{/if}

{if $v['field_mk']=='上传图片'}
<!--上传图片-->
<tr class="tr_{$v.field_name}">
    <td class="name">{$v.field_cn_name}</td>
    <td class="td_input">
    	{tp:upload id="<?php echo $v['field_name'] ?>" name="<?php echo $v['field_name'] ?>" value="<?php echo $info[$v['field_name']]; ?>" }
    	<a data-file="{$info[$v['field_name']]}" class="tq_img_look yulan_{$v.field_name} layui-btn layui-btn-normal layui-btn-sm" style="display:{if $info[$v['field_name']]==''}none{/if}">预览</a>
    </td>
</tr>
{/if}

{if $v['field_mk']=='上传文件'}
<!--上传文件-->
<tr class="tr_{$v.field_name}">
    <td class="name">{$v.field_cn_name}</td>
    <td class="td_input">
    	{tp:upload_file id="<?php echo $v['field_name'] ?>" name="<?php echo $v['field_name'] ?>" value="<?php echo $info[$v['field_name']]; ?>" }
    </td>
</tr>
{/if}

{if $v['field_mk']=='组合字段'}
<!--组合字段-->
<tr class="tr_{$v.field_name}">
    <td class="name">{$v.field_cn_name}</td>
    <td class="td_input">{if empty($_GET['id'])}<span style="color:#f00">本处需要在数据添加完成后在编辑页面进行操作</span>{else/}<a href="javascript:cate_frame('{: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>{/if}</td>
</tr>
{/if}

{if $v['field_mk']=='系统字典'}
<!--组合字段-->
<tr class="tr_{$v.field_name}">
    <td class="name">{$v.field_cn_name}</td>
    <td class="field_td_select">
    	<select name="{$v.field_name}" lay-ignore class="select_ys">
            <option value="">请选择</option>
            {volist name=":Label($v['field_name'],0)" id="c"}
            <option value="{$c.id}" {if $info[$v['field_name']]==$c['id']}selected{/if}>{$c.name}</option>
            {/volist}
         </select>
    </td>
</tr>
{/if}

{if $v['field_mk']=='城市联动'}
<!--系统字典-->
<tr class="tr_{$v.field_name}">
    <td class="name">{$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');
        }
        {/php}
    	省份：<select name="" id="address_sf" lay-ignore class="select_ys" onchange="ceshi(this.value);">
    	  		<option value="">请选择</option>
    	  		{volist name=":Label('city',0)" id="c"}
                <option value="{$c.id}" {if $pid==$c['id']}selected{/if}>{$c.name}</option>
                {/volist}
    		 </select>
        城市：
        	<select name="{$v.field_name}" id="shict" class="select_ys" lay-ignore>
    	  		<option value="">请选择</option>
    		</select>
            </span>
    </td>
</tr>
<script>
$(document).ready(function(){
	var pid="{$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=="{$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>
{/if}

{/volist}