<!DOCTYPE html>
<html>
	<?php echo $this->fetch('head.html'); ?>
	<body>
		<div class="header">
			<div class="header-back"></div>
			<div class="header-title">商家入驻申请</div>
		</div>
		<div class="header-row"></div>
		<div class="main-body">
			<?php if ($this->_var['apply']): ?>
				<div class="pd-10 f14 ">你已提交申请，正在审核中..</div>
			<?php endif; ?>
			<form <?php if ($this->_var['apply']): ?>class="none"<?php endif; ?>  id="form" >
				
				<div class="input-flex ">
					<div class="input-flex-label input-flex-require">公司名称</div>
					<input type="text" name="title" class="input-flex-text" />
				</div>
				<div class="input-flex flex-ai-center">
					<div class="input-flex-label input-flex-require">营业执照</div>
					<div class="flex-1">
						<div class="upimg-box bg-fff">
							
							<div class="upimg-item <?php if ($this->_var['data']['yyzz'] == ""): ?>none<?php endif; ?> js-upimg-btn">
								<img class="upimg-img" <?php if ($this->_var['data']['yyzz']): ?>src="<?php echo $this->_var['data']['trueyyzz']; ?>.100x100.jpg"<?php endif; ?> >								 
							</div>
							<?php if ($this->_var['data']['yyzz'] == ""): ?>	 
							<div class="upimg-btn js-upimg-btn">
								<i class="upimg-btn-icon"></i>
							</div>
							<?php endif; ?>
							<input type="hidden" name="yyzz" value="<?php echo $this->_var['data']['yyzz']; ?>" class="imgurl" />
							<input style="display: none;" type="file" class="js-upimg-file" name="upimg" id="upimg" /> 
						</div> 
					</div>
				</div>
				<div class="input-flex ">
					<div class="input-flex-label input-flex-require">联系人</div>
					<input type="text" name="nickname" class="input-flex-text" />
				</div>
				<div class="input-flex">
					<div class="input-flex-label input-flex-require">手机</div>
					<input type="text" id="telephone" name="telephone" class="input-flex-text" />
				</div>
				<div class="input-flex">					
					<div class="input-flex-label">验证码</div>					 
					<input type="text" name="yzm" class="input-flex-text">				 
					<div class="input-flex-btn" id="sendSms">获取验证码</div>
				</div> 
				 
				<div class="input-flex">
					<div class="input-flex-label input-flex-require">公司地址</div>
					<input type="text" name="address" class="input-flex-text" />
				</div>
				<div class="textarea-flex">
					<div class="textarea-flex-label">业务介绍</div>
					<textarea class="textarea-flex-text" name="description"></textarea>
				</div>
				 
				<div class="btn-row-submit" id="submit">提交申请</div>
			</form>
		</div>
		<?php echo $this->fetch('footer.html'); ?>
		<script src="/plugin/lrz/lrz.bundle.js"></script>
		<script src="/plugin/dt-ui/dt-ui-upload.js"></script>
		<script>
			$(document).on("click","#sendSms",function(res){
				var telephone=$("#telephone").val();
				if(telephone==''){
					skyToast("请输入手机号码");
					return false;
				}
				$.get("/module.php?m=car_shop_apply&a=SendSms&ajax=1",{
					telephone:$("#telephone").val(),
				},function(res){
					skyToast(res.message);
				},"json");
			})
			$(document).on("click","#submit",function(){
				$.post("/module.php?m=car_shop_apply&a=save&ajax=1",$("#form").serialize(),function(res){
					skyToast(res.message);
					if(!res.error){
						goBack();
					}
				},"json")
			})
		</script>
	</body>
</html>
