<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib uri="/cmsTag" prefix="cms"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
	<head>

		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

		<title>门户演示站 - 本站基于JTopcms构建</title>


		<link href="${ResBase}member/css/style.css" rel="stylesheet" type="text/css"></link>
		<link href="${ResBase}member/css/login.css" rel="stylesheet" type="text/css"></link>

		<script type="text/javascript" src="${ResBase}js/jquery-1.7.min.js"></script>
		<script type="text/javascript" src="${ResBase}js/common.js"></script>



	</head>


	<body>
		<div class="login-main">
			<div class="login-main_m">
				<div class="login-main_bd">

					<div class="yskj step1">
						<div class="yskj_tt">
							<ins>
								还没有账号？
								<a id="sigup_now1" class="btn3" href="${SiteBase}member/member_reg.jsp">免费注册</a>
							</ins>
							<b class="login-logo"><img src="${ResBase}member/images/login-logo.png"/><a href="${SiteBase}"></a></b>
						</div>
						<form id="memForm" name="memForm" method="post">

							<div class="yskj_bd fl-login">
								<ul class="ul">
									<li>
										<label>
											邮箱/用户名：
										</label>
										<%--
										err_label
										--%>
										<input name="memberName" id="memberName" type="text" class="txt1 txt " placeholder="邮箱/用户名"></input>
									</li>
									<div class="err_tip" style="display:none">
										<div class="dis_box">
											<em class="icon_error"></em><span>请输入手机号码</span>
										</div>
									</div>
									<li>
										<label>
											密码：
										</label>
										<input name="password" id="password" type="password" class="txt1 txt" placeholder="密码"></input>
									</li>
									<div class="err_tip" style="display:none">
										<div class="dis_box">
											<em class="icon_error"></em><span>请输入手机号码</span>
										</div>
									</div>

									<li id="captchas1" class="positon-r dn">
										<label>
											验证码：
										</label>
										<input name="sysCheckCode" id="sysCheckCode" class="txt1 txt" placeholder="验证码" style=" width:130px;" />
										<a href="javascript:changeCode();" class="yzm-img"><img id="checkCodeImg" src="${SiteBase}common/authImg.cmd?count=4&line=1&point=100&width=100&height=34&jump=7" /> </a>
									</li>


									<li>
										<div class="form-field">
											<div class="fl">
												<input type="checkbox" id="rememberMember" checked onclick="javascript:checkRem();" />
												<label for="checkbox">
													记住密码
												</label>
											</div>
											<a href="${SiteBase}member/member_forget_pw1.jsp" class="fr">忘记密码？</a>
										</div>
									</li>
									<li class="login-padding">
										<div style="width:140px; height:40px;" class="fl"></div>
										<input type="button" name="dosubmit" value="登录" class="btn btn4 fl btn-primary" onclick="javascript:loginMember();"></input>

									</li>
								</ul>

							</div>
						</form>
					</div>
					<div class="thirdlogin">
						<div class="m-box-login">
							<h4>
								用第三方帐号直接登录&nbsp;&nbsp;&nbsp;&nbsp;
							</h4>
							<ul>
								<li id="sinal">
									<a href="${SiteBase}member/thirdLoginReq.cmd?flag=weibo">微博账号登录</a>
								</li>
								<li id="qql">
									<a href="${SiteBase}member/thirdLoginReq.cmd?flag=qq">QQ账号登录</a>
								</li>
							</ul>

						</div>
					</div>
				</div>
			</div>
		</div>



		<!--注册弹出代码-->

		<div id="reg_setp">
			<div class="back_setp">
				返回
			</div>
			<div class="blogo">
				<div class="user-box">
					<div class="register-logo">
						<img src="${ResBase}member/images/register-logo.png" />
					</div>
				</div>
			</div>
			<div class="user-box" id="setp_quicklogin">
				<div class="register-form">
					<div class="title-item">
						<ins>
							已有帐号，现在
							<a href="#" id="title-item-a">登录</a>
						</ins>
						<h4 class="title-biggest">
							注册新账号
						</h4>
					</div>
					<div class="regbox step1">
						<form id="form1" name="form1" method="post">
							<div class="yskj_bd fl-register">
								<ul class="ul">
									<li>
										<label>
											邮箱/用户名：
										</label>
										<input id="account" name="account" type="text" class="txt1 txt err_label" placeholder="邮箱/用户名"></input>
										<script>
											var rememberMember = getCookie('jtopcms_member_login_name');

											if(rememberMember != null && rememberMember !='')
											{
												$('#memberName').val(rememberMember);
											}
										</script>
									</li>
									<div class="err_tip">
										<div class="dis_box">
											<em class="icon_error"></em><span>请输入手机号码</span>
										</div>
									</div>
									<li>
										<label>
											创建密码：
										</label>
										<input type="text" name="textfield" id="textfield" class="txt1 txt" placeholder="创建密码"></input>
									</li>
									<li>
										<label>
											确认密码：
										</label>
										<input type="text" name="textfield" id="textfield" class="txt1 txt" placeholder="确认密码">
									</li>

									<li id="captchas" class="positon-r">
										<label>
											验证码：
										</label>
										<input name="sysCheckCode" id="sysCheckCode" class="txt1 txt" placeholder="验证码" style=" width:130px;" />
										<a href="javascript:changeCode();" class="yzm-img"><img id="checkCodeImg" src="${SiteBase}common/authImg.cmd?count=4&line=1&point=100&width=90&height=24&jump=4" /> </a>
									</li>
									<li class="reg">
										<div style="width:140px; height:40px;" class="fl"></div>
										<input type="submit" name="dosubmit" value="注册" class="btn btn-primary btn4">
									</li>
								</ul>

							</div>

							<div class="thirdlogin-fr">
								<div class="m-box-register">
									<h4>
										用第三方帐号直接登录
									</h4>
									<ul>
										<li id="sinal">
											<a href="#">微博账号登录</a>
										</li>
										<li id="qql">
											<a href="#">微博账号登录</a>
										</li>
									</ul>
								</div>
							</div>
						</form>
					</div>

				</div>
			</div>
			<!--reg_setp end-->
			<script type="text/javascript" src="${ResBase}js/jquery-1.7.min.js"></script>
			<script type="text/javascript" src="${ResBase}member/js/jquery.easing.min.js"></script>
			<!--弹出注册界面-->
			<script type="text/javascript">
  
  $("#sigup_now").click(function(){
		$("#reg_setp,#setp_quicklogin").show();
		$("#reg_setp").animate({left:0},500,"easeOutQuart")
	});																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																								
	
	$(".back_setp,#title-item-a").click(function(){
		"block"==$("#setp_quicklogin").css("display")&&$("#reg_setp").animate({left:"100%"},500,"easeOutQuart",function(){$("#reg_setp,#setp_quicklogin").hide()})
	});
	
	$(document).ready(function(){
   		$("#account").focus();
	}); 

</script>

			<script>

//alert('${sessionScope.loginErrorMore}');
if('true' == '${sessionScope.loginErrorMore}')
{
	$('#captchas1').removeClass('dn');
}

if('-3' == '${param.error}')
{
 alert('当前会员 ${param.memberName} 被停用!');
}

	
		
function loginMember()
{ 
   var a =$('#memberName').val(); 
  
  if(a.length<3)
  {
	    alert('请输入有效的会员名或邮件地址');
        return false;
	
  }
	
 
  
   var pwd =  $('#password').val(); 
   if(pwd.length<6||pwd.length>16)
   {
        alert('请输入有效的密码');
        return false;
   }
  
  if('positon-r dn' != $('#captchas1').attr('class'))
  {
	  var code =  $('#sysCheckCode').val(); 
	     if(code.length != 4)
	     {
	        alert('请输入正确验证码');
	        return false;
	     }
   }
  
     
  
       

	var url = "${SiteBase}member/memberLogin.cmd";
    var postData = encodeURI($("#memberName, #password, #sysCheckCode").serialize());
    
    $.ajax({
      	type: "POST",
       	url: url,
       	data:postData,
   
       	success: function(msg)
        {        
             //alert(msg);
            if('1' == msg)
			{
					alert('登录成功!');
					
					if (document.getElementById('rememberMember').checked == true)
					{
						setLastLoginSuccessUser($('#memberName').val());
					}
				 
					 //window.location.reload();
					window.location.href = '${SiteBase}';

			}
			else if('-1' == msg)
			{		 
					 $('#checkCodeImg').attr('src','${SiteBase}common/authImg.cmd?count=4&line=1&point=100&width=90&height=24&jump=4&rand='+Math.random());
		     
					 alert('请输入正确的验证码');
		     		 
					 
			}
			else if('-2' == msg)
			{		 
					 $('#checkCodeImg').attr('src','${SiteBase}common/authImg.cmd?count=4&line=1&point=100&width=90&height=24&jump=4&rand='+Math.random());
		     
		     		 alert('用户名或密码错误!');
					 
			}
			else if('-3' == msg)
			{		 
					 $('#checkCodeImg').attr('src','${SiteBase}common/authImg.cmd?count=4&line=1&point=100&width=90&height=24&jump=4&rand='+Math.random());
		     
		     		 alert('当前会员被停用!');
					 
			}
			else if('-4' == msg)
			{		 
					 $('#checkCodeImg').attr('src','${SiteBase}common/authImg.cmd?count=4&line=1&point=100&width=90&height=24&jump=4&rand='+Math.random());
		     
		     		 $('#captchas1').removeClass('dn');
		     
		     		 alert('用户名或密码错误!！');					 
			}
			
			 
			$('#sysCheckCode').val('');
			 
        }
     });	
    
    
    
	// var x = document.getElementById('memberRegForm');
	// x.action= url;
	// x.submit();
	
}

function checkRem()
{
	if (document.getElementById('rememberMember').checked == false)
	{
		resetCookie();
	
	}


}


 function handler()
 {
      window.location.href = '${SiteBase}member/reg_phone.jsp';
 }
 
function changeCode()
{
	$('#checkCodeImg').attr('src','${SiteBase}common/authImg.cmd?count=4&line=1&point=100&width=100&height=34&jump=7?rand='+Math.random());

}
</script>
	</body>
</html>
