<{import file="common.html" title="忘记密码"}>
<link rel="stylesheet" type="text/css" href="<{$__APP__}>public/css/login.css"/> 
<div class="cnav">
	<a class="back">&nbsp;</a>找回密码<a href="javascript:;" class="thome">主页</a>
</div>
<div class="main">
	<div class="loginBox"> 
		<form  method="post">
			<div id="error_msg" style="display:none;"></div>
			<div class="tbtr"><i>电话号码</i><p><input type="text" name="username" class="input_text" placeholder="输入手机号码"/></p></div> 
			<div class="tbtr">
				<i>验证码</i><p>
				<input type="text" name="vcode" class="input_vcode" placeholder="请输入验证码"/>
				<a href="javascript:;"><img id="vcode" src="index.php?m=ajax&a=vcode"></a>
				</p>
			</div>
			<div class="tbtr">
				<i>手机验证码</i><p>
					<input type="text" name="sms_code" class="input_vcode" id="smscode" placeholder="手机验证码"/>
					<input id="zphone" type="button" value="获取手机验证码" onClick="get_mobile_code();">  
				</p>
			</div>
			<div class="tbtr" style="border-bottom:none; margin-top:5px;">
				<input type="submit" name="vcode" class="login_submit" value="找回密码"/> 
			</div> 
		</form>
		<div class="find_pass">
			<a href="?m=member&a=login" class="l">账户登陆</a>
			<a href="?m=member&a=register" class="r">立即注册</a>
		</div> 
	</div>
</div>
<{import file="footer.html"}>
<script type="text/javascript">
$(function(){ 
	$('form').submit(function(){
		username = $('input[name=username]').val();
		if(!username.match(/^(?:13\d|15\d|18\d)\d{5}(\d{3}|\*{3})$/)){ 
			$.alert('请输入正确的手机号码');
			return false;
		}
		if(username == ''){
			$.alert('请输入手机号码');
			return false;
		}
		
		sms_code = $('input[name=sms_code]').val(); 
		if(sms_code == ''){ 
			$.alert('短信验证码不能为空'); 
			return false; 
		} 
		$.ajax({
			type:'POST',
			url:'member.php?m=index&a=forget_check',
			data:{username:username, sms_code:sms_code}, 
			success:function(result){
				var data = jQuery.parseJSON(result); 
				if(data.error == 0){
					location.href="wap.php?m=member&a=forget_reset";
				}else{ 
					$.alert(data.msg);
					$(".submit_reg").attr("disabled",false);  
				}
			},
			error:function(){
				alert('错误');
			}
		});
		return false; 
	}); 
	// 获得验证码 
	$("#zphone").click(function(){
		var mobile = $('input[name=username]').val();  
		var vcode = $('input[name=vcode]').val(); 
		send_sms(mobile, vcode, '#zphone', '1');
	}); 
});
 
</script>
