<?xml version="1.0"?>
<logintemplate>
  <direction name="WeiXin">
  <![CDATA[
	  <!--微信扫码登录 begin-->
	<div id="login_container"></div>
	<script src="http://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>
	<script src="{$GetSiteUrl}user/api/weixin/weixinjs.aspx"></script>
	<script>
		function loginOut(){
			 KesionJS.Confirm('确认退出吗？',"location.href='{=GetRewriteUrl(LoginOut)}';",'');
		}
		 jQuery(document).ready(function(){
						   jQuery.ajax({
							  type:"POST",
							  datatype: "xml",
							  url:"{$GetSiteUrl}plus/ajaxs.ashx",
							  data:"a=checkislogin",
							  success:function(xml){
								  var islogin=jQuery(xml).find("login islogin").text();
							  if (islogin=='false') return;
							  var str="<img onerror=\"this.src='{$GetSiteUrl}SysImg/face/boy.jpg'\" src='"+jQuery(xml).find("login userface").text()+"' align='texttop' class='userface' /> <a href='{=GetRewriteUrl(user)}' style='color:#059FE5'>"+jQuery(xml).find("login username").text()+"</a> <a onclick=\"loginOut();return false;\" href='#'>退出</a>  <a href='{=GetRewriteUrl(user)}?mainurl=message/receivedmessage.aspx'>消息"+jQuery(xml).find("login message").text()+"</a>";
							 jQuery("#login_container").html(str);
							  }
							 });
				 });
	 </script>
	<!--微信扫码登录 end-->
  ]]>
  </direction>
 <direction name="Vertical">
  <![CDATA[
   <div id="loginForm">
	        <div id="haslogin"></div>
			<form name="myform" action="{$GetSiteUrl}User/UserLogin.aspx" method="post" id="loginForm">
			<input type="hidden" name="action" value="checklogin"/>
			<input type="hidden" name="from" value="Vertical"/>
			<div id="nologin">
	         <table align="center" width="98%" border="0" cellspacing="0" cellpadding="0">
				  <tr>
					<td height="25">用户名：
					<input name="UserName" type="text" class="textbox" value="{$GetLoginUserNameTips}" id="TxtUserName" size="15" maxlength="20"/></td>
				  </tr>
				  <tr>
					<td height="25">密　码：
					<input name="PassWord" type="password" class="textbox" value="******" id="TxtPassWord" size="16" maxlength="20"/></td>
				  </tr>
				  <tr{$ShowVerify}>
					<td height="25">验证码：
					<input name="VerifyCode" maxlength="6" type="password" class="textbox" id="TxtVerifyCode" size="6">
					<img src="{#GetFullDomain}/Plus/ValidateCode.aspx" border="0" style="cursor:hand" onclick="this.src='{#GetFullDomain}/Plus/ValidateCode.aspx?t='+Math.random();" />
					</td>
				  </tr>
				  
				  <tr>
					<td height="25"><div align="center"><img src="{#GetFullDomain}/user/images/losspass.gif" align="absmiddle"> <a href="{$GetPassWordUrl}" target="_parent">忘记密码</a> <img src="{#GetFullDomain}/user/images/mas.gif" align="absmiddle"> <a href="{$GetRegUrl}" target="_parent">新会员注册</a>    </div></td>
				  </tr>
				  
				  <tr>
					<td height="25"><div align="center">
					  <input type="submit" name="button1" id="loginbtn" class="inputButton" value="登录" onClick="return(CheckLogin())"/>
	                  <label>
					  <input name="Cookies" type="checkbox" id="ExpiresDate" value="checkbox">永久登录</label>
					  </div></td>
				  </tr>
				</table>
		 </div>
		 </form>
    </div>
	 ]]>

 </direction>
 <direction name="Horizontal">
  <![CDATA[
  <div id="loginForm">
    <div id="haslogin"></div>
	<form name="myform" action="{$GetSiteUrl}User/UserLogin.aspx" method="post" id="loginForm">
	<input type="hidden" name="action" value="checklogin"/>
	<input type="hidden" name="from" value="Horizontal"/>
	 <div id="nologin" >
			  用户名:<input name="username" type="text" class="username" id="TxtUserName" size="10" maxlength="20" value="{$GetLoginUserNameTips}"/> 密码:<input name="passWord" type="password" class="password" id="TxtPassWord" size="10" maxlength="20" value="******"/>
			   <span{$ShowVerify}>验证码:<input name="VerifyCode" maxlength="6" type="password" class="textbox" id="TxtVerifyCode" size="3" />
								<img src="{#GetFullDomain}/Plus/ValidateCode.aspx" border="0" style="cursor:hand" onclick="this.src='{#GetFullDomain}/Plus/ValidateCode.aspx?t='+Math.random();" /></span>
								<span style="display:none"><input name="Cookies" type="checkbox" id="ExpiresDate" value="checkbox"></span>
			   <input type="submit" name="button1" class="loginbtn" id="loginbtn" value="登录" onClick="return(CheckLogin())"/>
			  <a href="{$GetRegUrl}" target="_parent">注册</a> <a href="{$GetPassWordUrl}">忘记密码？</a>{$ShowApiLogin}
	  </div>
	</form>
   </div>
     ]]>
 </direction>
 
 <loginjs>
	<![CDATA[
	<script>
	jQuery(document).ready(function(){
	  CheckIsLogin();
    });
    //回车
   $("#nologin").die().live("keydown",function(event){  
			if(event.keyCode==13){  
						  $("#loginbtn").click();
						  return false;
			}      
	});    
	
	function CheckIsLogin(){ 
			 jQuery.ajax({
			  type:"POST",
			  datatype: "xml",
			  url:"{#GetFullDomain}/plus/ajaxs.ashx",
			  data:"a=checkislogin",
			  success:IsLogin
			 });
	}
	function IsLogin(xml){  
		 var islogin=jQuery(xml).find("login islogin").text();
		 if (islogin=='false'){
		  jQuery("#TxtUserName").focus(function(){
		    if (jQuery("#TxtUserName").val()=='{$GetLoginUserNameTips}') jQuery("#TxtUserName").val('');
		  });
		  jQuery("#TxtUserName").blur(function(){
		    if (jQuery("#TxtUserName").val()=='') jQuery("#TxtUserName").val('{$GetLoginUserNameTips}');
		  });
		  jQuery("#TxtPassWord").focus(function(){
		   if (jQuery("#TxtPassWord").val()=='******') jQuery("#TxtPassWord").val('');
		  });
		  jQuery("#TxtPassWord").blur(function(){
		   if (jQuery("#TxtPassWord").val()=='') jQuery("#TxtPassWord").val('******');
		  });
		  
		 jQuery("#nologin").show();
		 jQuery("#haslogin").hide();
		 }else{
	      jQuery("#nologin").hide();
		  jQuery("#haslogin").show();
		  var str="";
		  var logindirection="{$LoginDirection}";
		  str+="<div class='ulogin'>您好!<span style='color:#ee0000;padding:0px 5px 0px 5px'>"+jQuery(xml).find("login username").text()+"</span>";
		  if (logindirection=="Vertical"){
		  str+="<br/>";
		  str+=jQuery(xml).find("login point").text()+"<br/>";
		  str+=jQuery(xml).find("login message").text()+"<br/>";
		  str+="登录次数:"+jQuery(xml).find("login logintimes").text()+"次<br/>";
		  str+="【<a href='{=GetRewriteUrl(user)}'>会员中心</a>】【<a href='{=GetRewriteUrl(loginout)}'>退出登录</a>】";
		  str+="</div>"
		  }else{
		   str+="欢迎来到会员中心!&nbsp;登录次数"+jQuery(xml).find("login logintimes").text()+"次&nbsp;&nbsp;<a href='{=GetRewriteUrl(user)}' >[会员中心]</a>";
		   
		    if (jQuery(xml).find("login groupid").text()==-1 || jQuery(xml).find("login groupid").text()==-2){
			 str+="<a href='{#GetFullDomain}/agent/index.aspx'>[代理商平台]</a>";
			}else if (jQuery(xml).find("login groupid").text()==-3){
			 str+="<a href='{#GetFullDomain}/agent/index.aspx'>[店长平台]</a>";
			}else if (jQuery(xml).find("login groupid").text()==-4){
			 str+="<a href='{#GetFullDomain}/agent/index.aspx'>[供应商平台]</a>";
			}
			str+="<a href='{=GetRewriteUrl(LoginOut)}' onclick='return(LoginOut())'>[退出]</a>";
		  }
		  jQuery("#haslogin").html(str);
		 }
	}
	function CheckLogin()
	{
	     if (jQuery("#TxtUserName").val()==''||jQuery("#TxtUserName").val()=='{$GetLoginUserNameTips}')
		 {
		  jQuery.dialog.alert("请输入{$GetLoginUserNameTips}!",function(){
		  jQuery("#TxtUserName").focus();
		  });
		  return false;
		 }
	     if (jQuery("#TxtPassWord").val()==''||jQuery("#TxtPassWord").val()=='******')
		 {
		  jQuery.dialog.alert("请输入会员登录密码!",function(){
		  jQuery("#TxtPassWord").focus();
		  });
		  return false;
		 }
		 if (jQuery("#TxtPassWord").val().length<6)
		 {
		  jQuery.dialog.alert("登录密码长度不能少于6位!",function(){
		  jQuery("#TxtPassWord").focus();
		  });
		  return false;
		 }
		 if ({$CheckVerifyCode}){
			 if (jQuery("#TxtVerifyCode").val()==''){
			  jQuery.dialog.alert("请输入验证码!",function(){
			  jQuery("#TxtVerifyCode").focus();
			  });
			  return false;
			 }
		 }
		return true;
	  }
	</script>
 ]]>
  </loginjs>
</logintemplate>