<%@ page language="C#" autoeventwireup="true" inherits="user_telVali, kfenlei" %><%@ Register TagPrefix="qth8" TagName="userLeft" Src="~/inc/userLeft.ascx" %><%@ Register TagPrefix="qth8" TagName="userManageTop" Src="~/inc/userManageTop.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>
<title><%=sWebName %> - 手机认证</title>
<link rel="stylesheet" type="text/css" href="css.css" />
<link rel="stylesheet" type="text/css" href="/template/css.css" />
</head>
<body>
<div align="center">
<qth8:userManageTop runat="server" ID="userManageTop" selectValue="1" />
<div class="main" align="left">
<div class="clear"></div>
<qth8:userLeft runat="server" selectValue="3" ID="userLeft" />
<div class="userRight">
<div class="userRightContent">
<div class="userRightContentTop">手机认证</div>
<%if (sValiTel != "1")
  { %>
<form action="action.aspx?s=telVali" method="post" id="fTelVali" name="fTelVali">
<input type="hidden" name="jump" value="<%=sJump %>">
<table width="970" class="formTable" border="0" cellspacing="0" cellpadding="5">
<tr>
<td class="head" width="100">手机号：</td>
<td><input type="text" name="valiTelValue" id="valiTelValue" class="textInput" size="25" /></td>
</tr>
<tr>
<td class="head">验证码：</td>
<td><input type="text" name="vali"  id="vali"class="textInputP fl5" size="15" /> <img src="/validate/" id="valiPic" onclick="this.src='/validate/?cache='+Math.random()" alt="点击更换图片" style="cursor:pointer;" align="absmiddle" /> <a href="#nogo" onclick="document.getElementById('valiPic').src='/validate/?cache='+Math.random()">看不清？换一张</a></td>
</tr>
<tr>
<td class="head"></td>
<td><div class="bt2 fl5" id="btValiGet">获取手机验证码</div></td>
</tr>
<tr>
<td class="head">手机验证码：</td>
<td><input type="text" name="valiTel" id="valiTel" class="textInputP" size="15" /></td>
</tr>
<tr>
<td></td>
<td><input type="button" class="inputSubmit" id="btSubmit" value="提交认证" /></td>
</tr>
</table>
</form>
<script type="text/javascript">
var timeCount=0;
$("#btValiGet").click(function(){
  if(timeCount<=0)
  {
  		if(!(/^1[3456789]\d{9}$/.test($("#valiTelValue").val())))
		{
			layer.open({title:"提示",content:'请输入正确手机号!',scrollbar:false,shadeClose:true});
		}
		else
		{
			$.get("/action/?s=valiSession&n=9&v="+$("#vali").val()+"&time="+new Date(),function(data,status){
			if(data)
			{
				$("#btValiGet").html("验证码发送中……");
				timeCount=100;
				$.get("/services/?s=smsPost&c=1&t="+$("#valiTelValue").val()+"&v="+$("#vali").val()+"&time="+new Date(),function(data,status){
					if(data.indexOf("发送成功")>-1)
					{
						var timeSet=setInterval(function(){timeCount--;$("#btValiGet").html("验证码已发送，"+timeCount+"秒后重新获取");if(timeCount<=0){window.clearTimeout(timeSet);$("#btValiGet").html("获取手机验证码");}},1000);
					}
					else
					{
						timeCount=0;
						$("#btValiGet").html("获取手机验证码");
						layer.open({title:"提示",content:data,scrollbar: false,shadeClose:true});
					}
				});
				
			}
			else
			{
				layer.open({title:"提示",content:'请输入正确验证码!',scrollbar: false,shadeClose:true});
			}
  			});
		}
  }
  else
  {
  		
  }
});

$("#btSubmit").click(function(){
	$.get("/action/?s=valiSession&n=22&v="+$("#valiTel").val()+"&t="+$("#valiTelValue").val()+"&time="+new Date(),function(data,status){
			if(data)
			{
				$("#fTelVali").submit();
			}
			else
			{
				layer.open({title:"提示",content:'手机验证码错误，验证码有效期1小时！',scrollbar: false,shadeClose:true});
			}
		});
});
</script>
<%}
         else
         {%><div class="renzheng">已通过手机认证：<strong><%=sValiTelValue %></strong></div>
		 <a href="telVali.aspx?s=1"><div class="inputSubmit">更换手机认证</div></a><%} %>
</div></div>
   </div>
    </div>
</body>
</html>
