<?php /*a:1:{s:82:"F:\wpf\WpfApp1\WpfApp1\bin\x64\Debug\web\im\application\index\view\user\login.html";i:1598445523;}*/ ?>
<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<title>用户登录</title>	
	<link href="/im/public/index/css/user.css" rel="stylesheet" type="text/css"/>  
	<link href="/im/public/common/font.css" rel="stylesheet" type="text/css"/> 
   	<script type="text/javascript" src="/im/public/index/js/jquery-1.7.2.min.js"></script>
	
</head>

<body>
	<!--logo start-->
	<div class="logo w100 register_logo">
		<div class="logo_in in_width">
			<h1 class="logo_pic fl"><a href="<?php echo url('index/index'); ?>"><img title="YERSHOP" src="<?php echo api("logo"); ?>" width="201" height="59" /></a></h1>			
			<div class="home fr"><a href="<?php echo url('index/index'); ?>" class="red">进入网站首页</a></div>
		</div>
	</div>
	<!--/logo end--> 
	<!--main start-->
	<div class="main w100 register_main login_main" style="background: url(<?php echo api('dl'); ?>) no-repeat center center;background-color: #9876d7;">
		<div class="main_in in_width register_main_in login_main_in">
			<div class="con">
				<div class="login_div fr">
					<div class="top_div">
						<h3 class="f18 dlsc active">用户登录</h3>
					    <h3 class="f18 dlsc">快捷登录</h3>
					</div>
					<div class="content_tab">
					<div class="info">
						<form  id="form" method="post">             
							<dl class="yhm">
								<dt><img  class="img " src="/im/public/index/images/user.jpg"></dt>
								<dd>
									<input type="text" name="mobile"  value="" placeholder="邮箱/手机/用户名"  >
								</dd>
							</dl>
							<dl class="pss">
								<dt>  <img  class="img " src="/im/public/index/images/pas.jpg"></dt>
								<dd>
									<input type="text"   name="password" value="" placeholder="请输入密码"   >	
								</dd><input type="hidden" name="type" value="1" >
							</dl>
						 </form>						
					</div>
					<div id="state"></div>
					<button id="login_btn" class="login_btn f18" type="button">登录</button>					
					</div>
					
					<div class="content_tab none">
						<div class="info">
						<form  id="form" method="post">             
							<dl class="yhm">
								<dt><img  class="img" src="/im/public/index/images/m1.png"></dt>
								<dd>
									<input type="text" id="phone" name="mobile"  value="" placeholder="手机号"  >
								</dd>
							</dl>
							<dl class="pss">
								<dt>  <img class="img"  style="margin-top:3px;" src="/im/public/index/images/m2.png"></dt>
								<dd>
									<input type="text" id="smscode"   name="password" value="" placeholder="请输入验证码"   >	<a id="getCode"  onclick="sendsms(this)" class="btn_code f12 fr" type="button">获取验证码</a>
								</dd><input type="hidden" name="type" value="1" >
							</dl>
						 </form>						
					</div>
					<div id="status"></div>
					<button id="mobile_btn" class="login_btn f18" type="button">登录</button>	
					
					
					</div>
					<script>
					$(".login_div .top_div .dlsc").click(function(){
					if(!$(this).hasClass("active")){
						var index = $(".login_div .top_div .dlsc").index($(this));
						console.log(index);
						$(".content_tab").addClass("none");
						$(".content_tab").eq(index).removeClass("none");
						
						$(this).addClass("active").siblings().removeClass("active");
					}
					
			});
				function sendsms(obj) {		
	 var s="<?php echo htmlentities($code); ?>";
   if(checkPhone($('#phone').val())){
               $("#status").html("");
				//document.getElementById("status").style.visibility="hidden";
			$.post('<?php echo U("User/sendSms"); ?>',{mobile:$('#phone').val(),send_code:s,verify:$('#verify').val()},function(data){
				  if (data.code) {
					  alert(data.msg); 
					  $("#status").html("");
				      //document.getElementById("status").style.visibility="hidden";
					  RemainTime(obj);           
				  }
                  else{
					 openerror(data);
				      //document.getElementById("status").style.visibility="visible";
					            
				  }
				 
            });
    }
    else{ 
	    //$("#status").html("手机号码格式不正确"); 
		 layer.alert("手机号码格式不正确", {
                            icon: 2,
                             skin: 'layer-ext-moon' //该皮肤由layer.seaning.com友情扩展。关于皮肤的扩展规则，去这里查阅
                     })  ; 
					 setTimeout(function(){
                        if (data.url) {
                          location.href=data.url;
                        }
               },1000);
		//document.getElementById("status").style.visibility="visible";
      return false;
    }
}
	function checkPhone(phone) {
            var res = !!phone.match(/^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/);
            return res;
 }
var wait=60;
function RemainTime(obj) {
        if (wait == 0) {     
            obj.innerHTML="发送验证码";
            wait = 60; 
			$(this).removeClass('current');	
            $(obj).attr('onclick','sendSms(this);return false;');
        } else {  
			$(obj).attr('onclick','');$(obj).addClass('active');	
					 obj.innerHTML= wait +"秒" ;
					 wait--;
					 setTimeout(function() {
						RemainTime(obj)
					 },
					 1000)
		   	
        }
    }		
			</script>

					<div class="mima f12">
						
						<a href="<?php echo url('forget'); ?>" class="wj fl">忘记密码？</a>
						<a href="<?php echo url('register'); ?>" class="wj fr">新用户注册</a>
					</div>
					<div class="co_div f12">
						<p>使用合作网站帐号登录</p>
                     <ul>
							<li class="li_01 fl">
								<?php echo hook('qq'); ?>
							</li>
                           <li class="li_03 fl">
								 <?php echo hook('wechat'); ?>
							</li>
						
							
						</ul>
					</div>																	
				</div>
			</div>
			
		</div>
	</div>
	<!--/main end-->	
	<!--copy  start-->
	<div class="copy w100 register_copy">
		<div class="copy_in in_width">
		
			<div class="info  f12">
				<p class="list">
					<a href="<?php echo url('help/index?id=6'); ?>">关于我们</a>|
					 <?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=>$vo1): $mod = ($i % 2 );++$i;?> 
					 <a href="<?php echo url('help/index?id='.$vo1['id']); ?>"><?php echo htmlentities($vo1['title']); ?></a>|
					<?php endforeach; endif; else: echo "" ;endif; ?>	<a href="<?php echo url('help/index?id=16'); ?>">退换货政策</a>
				
				</p>
				<p class="p_01"><?php echo api('copyright'); ?></p>
				<div class="pic_03"></div>
			</div>
		</div>
	</div>
	<!--/copy  end-->
	<script type="text/javascript">
	 // 手机号验证



function http(){
	
	 var self =$('#reg_form');
			var url="<?php echo url('user/reg'); ?>"
	 $.post(url, self.serialize(),function(data){
					 if(data.code){
    				     window.location.href = data.url;
    			         }
					 else{
					      $("#status").html(data.msg)
				  document.getElementById("status").style.visibility="visible";
					 }
              });
	  
	}

		$(function(){
			$("#register_btn").click(function(){
    		var self =$('#register_form');
			var url="<?php echo url('user/register'); ?>"
    		$.post(url, self.serialize(), success, "json");
    		return false;

    		function success(data){
    			if(data.code){
    				window.location.href = data.url;
    			} else {
    			  $("#state").html(data.msg)
				  document.getElementById("state").style.visibility="visible";
    				//刷新验证码
    				//$(".reloadverify").click();
    			}
    		}
    	});	

   

	</script>
	<script type="text/javascript" src="/im/public/common/layer/layer.js"></script>
	<script type="text/javascript">
	
	$("#login_btn").click(function(){
    		var self =$('#form');
			var url="<?php echo url('user/login'); ?>"
    		$.post(url, self.serialize(), success, "json");
    		return false;

    		function success(data){
    			if(data.code){
    				window.location.href = data.url;
    			} else {
    			  $("#state").html(data.msg)
				  document.getElementById("state").style.visibility="visible";
    				//刷新验证码
    				//$(".reloadverify").click();
    			}
    		}
    	});		
$("#mobile_btn").click(function(){
    		var self =$('#form');
			var url="<?php echo url('mobile/login'); ?>"
    		$.post(url, {mobile:$('#phone').val(),mobile_code:$('#smscode').val()}, success, "json");
    		return false;

    		function success(data){
    			if(data.code){
    				window.location.href = data.url;
    			} else {
    			openerror(data);
    				//刷新验证码
    				//$(".reloadverify").click();
    			}
    		}
    	});
$(function(){
		var verifyimg = $(".verifyimg").attr("src");
            $(".reloadverify,.reloadverify_a").click(function(){
               if( verifyimg.indexOf('?')>0){
                    $(".verifyimg").attr("src", verifyimg+'&random='+Math.random());
                }else{
                    $(".verifyimg").attr("src", verifyimg.replace(/\?.*$/,'')+'?'+Math.random());
                }
            });
});
		
		function opensuccess(data){
			  
				   layer.alert(data.msg, {
                            icon: 1,
                             skin: 'layer-ext-moon' //该皮肤由layer.seaning.com友情扩展。关于皮肤的扩展规则，去这里查阅
                     });
				//$(".alert_success").parents(".mask").removeClass("none"); 
			   setTimeout(function(){
                        if (data.url) {
                          location.href=data.url;
                        }
               },1000);
				
			}
			function openerror(data){
			      layer.alert(data.msg, {
                            icon: 2,
                             skin: 'layer-ext-moon' //该皮肤由layer.seaning.com友情扩展。关于皮肤的扩展规则，去这里查阅
                     })  ; 
					 setTimeout(function(){
                        if (data.url) {
                          location.href=data.url;
                        }
               },1000);
			}
	</script>
</body>
</html>
