<%@ Page Language="C#" AutoEventWireup="true" debug="true" Inherits="WinLibClass.Form.User.RegUser" CodePage="65001" GameType="1" PageFileFlag="RegUser" PageFileTitle="新会员注册" DataBindingType="1" PageFlagId="1"  %>

<%@ Register TagPrefix="Site" TagName="Menu" Src="~/WUC/Common/Site_Menu.ascx" %>
<%@ Register TagPrefix="Site" TagName="UserPicNote" Src="~/WUC/Common/Site_UserPicNote.ascx" %>
<%@ Register TagPrefix="Site" TagName="Game1" Src="~/WUC/Common/Site_Game1.ascx" %>

<%@ Register TagPrefix="Site" TagName="Side_UserPicNote" Src="~/WUC/Common/Site_Side_UserPicNote.ascx" %>
<%@ Register TagPrefix="Site" TagName="Side_Future" Src="~/WUC/Common/Site_Side_Future.ascx" %>
<%@ Register TagPrefix="Site" TagName="Side_Main" Src="~/WUC/Common/Site_Side_Menu.ascx" %>




<!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">
<head>
<Site:Menu id="menu_headtitle" runat="server" Flag="HeadTitle" CurrentPageTitle = "新会员注册" />
<Site:Menu id="menu_headjs" runat="server" Flag="HeadJs"  />

<link href="/css/common.css" type="text/css" rel="stylesheet" />
<link href="/css/reg.css" type="text/css" rel="stylesheet" />

<script language="javascript" src="/paipaijs/jquery.checkform2.js"></script>
</head>

<body>
<!--start 头部-->

<Site:Menu id="menu_topmenu" runat="server" Flag="TopMenu"  CurrentPageFlag="Reg" />

<!--end 头部-->
<!--start 通用(上) -->

<!--start Adv-->
<%/*
<div class=" PageWidth Adv1"><img src="/images/ad_01.png" /></div>
<div class=" clear"></div>
*/%><!--end Adv-->

<div class="PageWidth">

<!--start left cont-->
<div class="Grid-Base ">
	<div class="Title">
		新用户注册
	</div>
	<div class="MG20   LH35">

			<div class="RegBox W680 FL TextCenter ">
	
			<DIV class="RegItem">
				<div class="InfoTitle ">用户名:</div>
				<div id="DivInput_UserNickName" class="InfoInput defColor "><input type="text" id="UserNickName" name="UserNickName" maxlength="20" class="W235" />&nbsp;</div>
				<div id="DivMsg_UserNickName" class="InfoMsg InfoMsgColor ">2~20位中英文字符、数字、下划线等&nbsp;</div>
				<div class=" clear"></div>
			</DIV>	
	
			<DIV class="RegItem">
				<div class="InfoTitle ">密码: </div>
				<div id="DivInput_UserPassword" class="InfoInput defColor "><input type="password" id="UserPassword" name="UserPassword"  class="W235" />&nbsp;</div>
				<div id="DivMsg_UserPassword" class="InfoMsg InfoMsgColor ">至少6位英文字符、数字、下划线等&nbsp;</div>
				<div class=" clear"></div>
			</DIV>	
			
			<DIV class="RegItem">
				<div class="InfoTitle ">确认密码: </div>
				<div id="DivInput_ReUserPass" class="InfoInput defColor "><input type="password" id="ReUserPass" name="ReUserPass"   class="W235" />&nbsp;</div>
				<div id="DivMsg_ReUserPass" class="InfoMsg InfoMsgColor ">至少6位英文字符、数字、下划线等&nbsp;</div>
				<div class=" clear"></div>
			</DIV>	

			<DIV class="RegItem">
				<div class="InfoTitle ">手机号: </div>
				<div id="DivInput_UserMobile" class="InfoInput defColor "><input type="text" id="UserMobile" name="UserMobile"  class="W235" />&nbsp;</div>
				<div id="DivMsg_UserMobile" class="InfoMsg InfoMsgColor ">11位数字（中国标准）&nbsp;</div>
				<div class=" clear"></div>
			</DIV>	

			<DIV class="RegItem">
				<div class="InfoTitle ">邮箱: </div>
				<div id="DivInput_UserEmail" class="InfoInput defColor  "><input type="text"   id="UserEmail" name="UserEmail"  class="W235" />&nbsp;</div>
				<div id="DivMsg_UserEmail" class="InfoMsg InfoMsgColor ">例:zhangsan@qq.com&nbsp;</div>
				<div class=" clear"></div>
			</DIV>				
			<DIV class="RegItem">
				<div class="InfoTitle ">验证码: </div>
				<div id="DivInput_VerifyCode" class="InfoInput defColor ">
				<input type="text"   id="VerifyCode" name="VerifyCode"   class="W60" maxlength="4" />&nbsp;</div>
				
				<div class="InfoInput pic "><input type="image" id="safecode" value="" onclick="reloadcode();">&nbsp; </div>	
				<div class="InfoInput pic "> <a  class=" LH25" onclick="reloadcode();" >看不清楚，换一张</a></div>	
				<div id="DivMsg_VerifyCode" class="InfoMsg InfoMsgColor ">4位验证码&nbsp;</div>
				<div class=" clear"></div>
			</DIV>				

			<DIV class="RegItem MGT10">
				<input type="image" id="regSub" src="/images/Agree.gif">
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<div class=" clear"></div>
			</div>
			
			<DIV class="RegItem">
			
				<textarea id="reginfoText" class="Box W600 H90 OverFlow-Scroll-Y LH20" style="font-size:12px;margin-left:50px" ><!--#include file="duty.aspx" -->	</textarea>

			<div class=" clear"></div>
			</div>
					
			
	
			
			</div>

			<div class="LogBox  W200 FL MGL10 TextCenter">
			已有9拍帐户？直接登陆
			<input type="image" src="/images/login.gif" onclick='return CheckIsLoginForLogin();' >
			
			</div>
	<div class=" clear"></div>
	</div>	
		<div class=" clear"></div>
</div>
<div class=" clear"></div>
<!--end left cont-->
</div>



<script>

//function reloadcode() {jQuery('#safecode').attr("src", '/index.aspx?s=/User/verify/&w=120&h=60&tid=' + (new Date().getTime().toString(36)));}
function reloadcode() {jQuery('#safecode').attr("src", '/CommonTools/AjaxCommonUI.aspx?PageFileFlag=VerifyCode&w=120&h=60&tid=' + (new Date().getTime().toString(36)));}
function funSucc(id,msg){jQuery("#DivInput_"+ id).removeClass("warnColor");jQuery("#DivMsg_"+ id).removeClass("InfoWarning").addClass("InfoSuccess").html(msg+"&nbsp;");}
function funFail(id,msg){jQuery("#DivInput_"+ id).addClass("warnColor");jQuery("#DivMsg_"+ id).removeClass("InfoSuccess").addClass("InfoWarning").html(msg+"&nbsp;");}
function checkform(){
    var ok = jQuery.checkForm2({
        ctrls: [                                   
            	{id: "UserNickName",type:"mustRegular", par: /[\w\u4e00-\u9fa5]{2,20}$/,funSuccess: function(ctr){ funSucc(ctr.id,"");},funFailed:function(ctr){funFail(ctr.id,"2~20位中英文字符、数字、下划线等");}}//
            	,{id: "UserPassword",type:"mustRegular", par: /^[\w~!@#$%^&*()_+]{6,}$/,funSuccess: function(ctr){ funSucc(ctr.id,"");CheckPass();},funFailed:function(ctr){funFail(ctr.id,"至少6位英文字符、数字、下划线等");} }//                    		
            	,{id: "ReUserPass",type:"mustEqualTo", par: "UserPassword",funSuccess: function(ctr){ funSucc(ctr.id,"");},funFailed:function(ctr){funFail(ctr.id,"两次输入的密码不一致");} }//                    		
           	,{id: "UserMobile",type:"mustRegular", par: /^1[3-9][0-9]{9,9}$/,funSuccess: function(ctr){ funSucc(ctr.id,"");},funFailed:function(ctr){funFail(ctr.id,"好像没这个号码");} }//                    		
		,{id: "UserEmail",type:"mustEmail", par:"",funSuccess: function(ctr){ funSucc(ctr.id,"");},funFailed:function(ctr){funFail(ctr.id,"这个邮箱不存在吧？");}}
		,{id: "VerifyCode",type:"mustMoreThan", par:4,funSuccess: function(ctr){ funSucc(ctr.id,"");},funFailed:function(ctr){funFail(ctr.id,"验证码须4位");}}
            ],
        success: function(){ //验证通过mustEqualTo
            },
        failed: function(msg){  //Alert("验证失败");
            }
        });
	return ok;	

}

//密码强度处理

function CheckPass()
{
	var o =jQuery("#UserPassword");
	var c = Common.CheckPasswordStrong(o.val());////0：太短 1：弱 2：一般 3：极佳

	var _msg =["<font color='red'>密码太短</font>","<font color='#B64A1D'>密码强度：弱</font>","<font color='#666666'>密码强度：一般</font>","<font color='green'>密码强度：极佳</font"];
	if(c<0|| c>_msg.length)c=0;
	if(c<1){funFail("UserPassword",_msg[c]);}
	else {funSucc("UserPassword",_msg[c]);}
	return (c>0);
}

//进行用户存在性验证
//进行邮箱验证
//进行手机号验证
//验证通过后，
function CheckBeforeSubmit()
{
	var value="";
	var t = checkform();
	if(t){value = jQuery("#UserNickName").val();CheckExisted("UserNickName",value,function (msg) {if (msg == 1) {funFail("UserNickName",'该用户名已存在。');t =  false;}else {funSucc("UserNickName","");t =  true;}});}
	if(t){value = jQuery("#UserMobile").val();CheckExisted("UserMobile",value,function (msg) {if (msg == 1) {funFail("UserMobile",'该手机号已被使用。');t=false;}else {funSucc('UserMobile','');t =  true;}});}
	if(t){value = jQuery("#UserEmail").val();CheckExisted("UserEmail",value,function (msg) {if (msg == 1) {funFail('UserEmail','该邮箱已被使用。');t=false;} else {funSucc('UserEmail',"");t =  true;}});}	
	return t;
}        

var  __x ;
function SubmitAfterSuccess()
{
			var queryString= jQuery(".RegItem  input").serialize();
			AjaxSubmit(
			"POST"
			//,"/index.aspx?s=/UserInfo/UserRegister2/&IsAdd=7&t="+ new Date().getTime()
			,"/UserInfo/UserInfo_Update.aspx?IsAdd=7&t="+ new Date().getTime()
			,queryString
			,function(msg)
			{
				switch(msg)
				{
					case "-1":alert("注册不成功(可能的原因有：\r\n 1.用户名（即昵称）已被注册；\r\n 2.用户邮箱已被注册；\r\n 3.手机号已被注册；\r\n 4.未知错误。");break;
					case "-2":alert("验证码不正确。");break;
					case "0":alert("注册不成功(可能的原因有：\r\n 1.用户名（即昵称）已被注册；\r\n 2.用户邮箱已被注册；\r\n 3.手机号已被注册；\r\n 4.未知错误。");break;
					case "1":alert("恭喜您，您已注册。");  Common.GoTo("/index.aspx");break;
					case "100":alert("短信验证码不正确。");break;
					case "201":alert("手机号无效。");break;
					case  "-100":alert("此版本为免费版，只支持100个用户注册，请联系官方购买授权版，郑州全搜索官方网站：www.paipaicms.com");break;
					//document.location.replace("/index.aspx");
					break;
					
				}
				reloadcode();
			}
			,function(msg)
			{
				Alert(msg,20);
				reloadcode();
			}
			);		


}



jQuery("#regSub").click(function(){

if(CheckBeforeSubmit()){SubmitAfterSuccess();}

});

jQuery(function(){
reloadcode();
});
</script>





















<div class=" clear"></div>
<!--start 通用(下) -->
<!--start 底部帮助-->
<!--end 底部帮助-->
<!--start 友情链接-->
<!--end 友情链接-->

<Site:Menu id="menu_foot" runat="server" Flag="Foot"   />


</body>
</html>
