<{import 
	file="header_top.html" 
	title="申请入驻" 
	css="public"
}>
<link rel="stylesheet" type="text/css" href="<{$__PUBLIC__}>plug/laydate/need/laydate.css"> 
<link rel="stylesheet" type="text/css" href="<{$__PUBLIC__}>plug/laydate/skins/default/laydate.css"> 
<style type="text/css"> 
.header_bar{ width:100%; background:#fff; border-bottom:1px solid #efefef; float:left;}
.header{ width:850px; margin:0 auto; }
.headerbox{ width:100%; padding:5px 0 10px; float:left; }
.headerbox .logo2{ width:330px; padding:25px 0 20px; float:left;}
.headerbox .logo2 .img{ float:left;}
.headerbox .logo2 .img img{ width:150px; overflow:hidden; float:left;}
.headerbox .logo2 span{ margin:8px 0 0 20px; font-size:16px; color:#333; float: left;}
.headerbox .back{ margin:30px 5px 0 0; float:right;}
.headerbox .back a{ font-size:14px; background:#f00; color:#fff; padding:5px 10px; border-radius:1px; }
 
/** **/
.progress{ width:450px; height:60px; margin:0; padding:10px 0; float:right; } 
.progress ul{ background:#f4f4f4; border-radius:20px; }
.progress li{ width:150px; height:18px; padding:2px 0 1px 0; text-align:center; position:relative; color:#999; z-index:2;float:left; } 
.step1::before{ position:absolute; right: 0; top:40px; content:' '; width:50%; height:2px; background:#f00;}
.step1::after{ position:absolute; left: 0; top:40px; content:' '; width:50%; height:2px; background:#f00; } 
.step1 .number{ background:#f00; } 
.step0::before{ position:absolute; right: 0; top:40px; content:' '; width:50%; height:2px; background: #ccc;}
.step0::after{ position:absolute; left: 0; top:40px; content:' '; width:50%; height:2px; background:#ccc; } 
.step0 .number{ background:#ccc; }
.step .ttl{ text-align:center; padding:5px 0; font-size:12px; }
.step .number{ width:21px; height:21px; z-index:2; position: relative; line-height:20px; text-align:center; margin:0 auto; border-radius:40px; color:#fff;} 
.step .meta{ padding:10px 0; } 


.reg_main_bar{ width:100%; padding:0 0 20px 0; float:left; }
.reg_main{ width:850px; margin:30px auto; } 

.atype{ width:100%; float:left; }
.atype .name{ width:100%; padding:12px 0 10px; background:#f8f8f8; float:left; }
.atype .name span{ padding:2px 0 0 10px; margin:0 0 0 15px; font-size:14px; font-weight:bold; line-height:15px; border-left:3px solid #f00; float:left; }
.atype .con{ width:100%; padding:20px 0; float:left; }
.atype .con .label{ margin:0 0 0 170px; float:left; }
.atype .con .label label{ padding:0 50px 0 0; float: left; }

table tr td.reg_name{ padding:5px 0 0 10px; font-size:16px; text-align:left; float:left;} 
table tr td span{ padding:5px 10px; float:left;}
table tr td span.red{ padding:8px 10px 0 5px; color:#f00; font-weight:bold; float:left;}
table tr td span.llong{ padding:5px 0 0 10px; float:left; } 
table tr td span.llong em{ font-style:inherit; padding:2px 0 0 0; float:left; }
td:first-child{ color:#999; }

.asubmit{ width:100%; float:left; }
.asubmit .con{ margin:0 0 0 270px; float:left; }
.asubmit .con input{ padding:10px 20px; background:#f00; color:#fff; float:left; }
.asubmit .con span{ margin:8px 0 0 20px; float:left; }

.companyBox{ display:none; }
.auth_status_msg{ width:100%; height:380px; line-height:120px; padding:20px 0; text-align:center; font-size:16px; float:left; }


/* 上传按钮 */
.upload_button{ background:#f8f8f8; border:1px solid #ddd; border-radius:2px; box-sizing: border-box; }
.upload_button a{ color:#000; }

.img_box{ width:80px; height:110px; margin-right:15px; float:left;}
.img_show{ width:80px; height:80px; background:#fff; float:left;}
.img_show img{ width:80px; height:80px; background:url(<{$__PUBLIC__}>svg/add.svg?dd) center center no-repeat; background-size:50px; float:left; }

/*按钮操作*/
.img_add{ width:80px; margin:10px 0 0 0; float:left; }
.img_add a{ width:80px; padding:0; text-align:center; }

</style>
</head> 
<body> 
<div class="header_bar">
	<div class="header">
		<div class="headerbox">
			<div class="logo2">
				<div class="img"><a href="<{$__URI__}>"><img src="<{$__IMG__}><{$UQCMS.site_logo}>"/></a></div>
				<span>商家入驻</span>
			</div> 
			<div class="progress">
				<ul> 
					<li class="step step1">
						<div class="ttl">申请入驻</div>
						<div class="number">1</div>  
					</li>
					<li class="step step1">
						<div class="ttl">等待审核</div>
						<div class="number">2</div> 
					</li>
					<li class="step step1">
						<div class="ttl">完成开店</div>
						<div class="number">3</div> 
					</li> 
				</ul>
			</div>
		</div>
	</div>
</div> 
<div class="reg_main_bar">
	<div class="reg_main">
		 
			<{if $row.status == '0'}> 
				<div class="auth_status_msg">已经提交，等待小二审核！</div>
			<{elseif $row.status == '1'}>
				<div class="auth_stauts_msg">
					<span>已经认证通过</span>
					<a href="<{$__URI__}>seller/index/index">已经认证通过，进入店铺中心。</a>
				</div>
			<{else}>  
				<{if $row.status == '2'}>
					<div class="astatus">认证结果：<{$row.auth_reason}></div>
				<{/if}> 
				<div class="atype">
					<div class="name"><span>申请类型</span></div> 
					<div class="con">
						<table class="etable" width="100%"> 
							<tr>
								<td width="260"><span>申请类型：</span></td>
								<td>
									<select name="type" id="select">
										<option value="1"<{if $smarty.get.type == '1'}> selected="selected"<{/if}>>个人申请</option>
										<option value="2"<{if $smarty.get.type == '2'}> selected="selected"<{/if}>>企业申请</option>
									</select>
								</td>
							</tr> 
						</table>
					</div>
				</div> 
				
				<form id="form" method="post"> 	
					<div class="atype">
						<div class="name"><span><{if $smarty.get.type == '1'}>个人身份证<{else}>法人身份证<{/if}></span></div> 
						<div class="con">
							<table class="etable" width="100%"> 
								<tr>
									<td width="260"><span>证件人姓名：</span></td>
									<td><input type="text" name="id_name" size="38" id="id_name" value="<{$row.id_name}>" autoComplete="off"/></td>
								</tr> 
								<tr>
									<td><span>身份证号码：</span></td>
									<td><input type="text" name="id_code" size="38" id="id_code" value="<{$row.id_code}>" autoComplete="off"/></td>
								</tr> 
								<tr>
									<td valign="top" style="padding-top:10px;"><span>证件照：</span></td>
									<td> 
		<div class="img_box">
			<div class="img_show">
				<img src="<{if $row.id_img_up}><{$__IMG__}><{$row.id_img_up|img_size:80x80}><{/if}>"/>
			</div>
			<div class="img_add upload_button">
				<a href="javascript:;" class="file">
					正面照上传<input type="file" name="id_img_up" class="upload_file"/>
				</a>
			</div>
			<input type="hidden" name="id_img_up" class="id_img_up" value="<{$row.id_img_up}>"/>
		</div>
		<div class="img_box">
			<div class="img_show">
				<img src="<{if $row.id_img_down}><{$__IMG__}><{$row.id_img_down|img_size:80x80}><{/if}>"/>
			</div>
			<div class="img_add upload_button">
				<a href="javascript:;" class="file">
					反面照上传<input type="file" name="id_img_down" class="upload_file"/>
				</a>
			</div>
			<input type="hidden" name="id_img_down" class="id_img_down" value="<{$row.id_img_down}>"/>
		</div>
		
		<div class="img_box">
			<div class="img_show">
				<img src="<{if $row.holder_img}><{$__IMG__}><{$row.holder_img|img_size:80x80}><{/if}>"/>
			</div>
			<div class="img_add upload_button">
				<a href="javascript:;" class="file">
					手持照上传<input type="file" name="holder_img" class="upload_file"/>
				</a>
			</div>
			<input type="hidden" name="holder_img" class="holder_img" value="<{$row.holder_img}>"/>
		</div>
									</td>
								</tr> 
							</table>
						</div>
					</div>
					<{if $smarty.get.type == '2'}>
						<div class="atype">
							<div class="name"><span>营业执照</span></div> 
							<div class="con"> 
								<table class="etable"> 
									<tr>
										<td width="260">营业执照注册号：</td>
										<td><input type="text" name="license_code" size="38" id="license_code" value="<{$row.license_code}>" autoComplete="off"/></td>
									</tr>
									<tr>
										<td>营业期限：</td>
										<td>
		<input type="text" name="license_start_time" size="18" id="license_start_time" value="<{$row.license_start_time}>" autoComplete="off"/>
		<span>至</span>
		<input type="text" name="license_end_time" size="18" id="license_end_time" value="<{if $row.license_long_time == '0'}><{$row.license_end_time}><{/if}>" autoComplete="off"/>
		<span class="llong">
			<label><input type="checkbox" value="1" name="license_long_time" <{if $row.license_long_time == '1'}>checked="checked"<{/if}>/><em>长期</em></label>
		</span>
										</td>
									</tr>
									<tr>
										<td>营业执照影印件：</td>
										<td> 
		<div class="img_box">
			<div class="img_show">
				<img src="<{if $row.license_img}><{$__IMG__}><{$row.license_img|img_size:80x80}><{/if}>"/>
			</div>
			<div class="img_add upload_button">
				<a href="javascript:;" class="file">
				营业执照上传<input type="file" name="license_img" class="upload_file"/>
				</a>
			</div>
			<input type="hidden" name="license_img" class="license_img" value="<{$row.license_img}>"/>
		</div>
										</td>
									</tr> 
								</table> 
							
							</div>
						</div>
						<input type="hidden" name="type" value="2"/>
					<{else}>	
						<input type="hidden" name="type" value="1"/>
					<{/if}> 
					<div class="asubmit">
						<div class="con"><input type="submit" name="submit" class="submit" value="申请开店"/><span>开通之后不能修改</span></div>
					</div> 
				</form>
			<{/if}> 
	</div>	
</div>
<{import file="footer.html"}>
<script type="text/javascript" src="<{$__PUBLIC__}>plug/laydate/laydate.js"></script>
<script type="text/javascript">
<{if $smarty.get.type == '2'}>
laydate({elem:'#license_start_time', event:'focus'});
laydate({elem:'#license_end_time', event:'focus'}); 
<{/if}>
$(function(){ 
	$('#select').change(function(){
		val = $(this).val(); 
		window.location.href="<{$__URI__}>user/reg_shop?type="+val;
	});
	
	$("form").submit(function(){ 
		$.loading();
		$.ajax({
			type:'POST',
			url:URI+'user/reg_shop_save',
			data:$("#form").serialize(), 
			success:function(result){
				$.loadingClose();
				var data = jQuery.parseJSON(result);
				if(data.error == '0'){
					$.alert('申请成功', function(){
						location.reload();
					}); 
				}else{
					$.alert(data.msg);
					return false;
				}
			},
			error:function(){
				$.alert('系统错误');
			} 
		}); 
		return false;
	});
	
	upload('.upload_file', URI+'album/upload?path=secret', function(data, $this){ 
		var fid = $this.attr('id'); 
		if(data.error == '0'){
			$this.parents('.img_box').find('.img_show img').attr('src', data.url); 
			$this.parents('.img_box').find('input[type=hidden]').val(data.name);
		}else{
			$.alert(data.msg);
		}
	});
	
});
 
</script>