<{import file="mheader.html" title="电话修改"}>
<div class="tab"><a href="<{$__URI__}>user/safe" class="ch">电话修改</a></div>
<div class="lbox">
	<{uqcms m="user" v="urow" c="get_info"}>
	<form id="next">
		<table class="etable">
			<tr>
				<td width="120">手机号码： </td>
				<td><{$urow.mobile_hide}></td>
			</tr> 
			<tr>
				<td>验证码：</td>
				<td>
					<input type="text" name="vcode" id="vcode" class="reg_input2" size="10"/>
					<img id="vcode_img" src="<{$__URI__}>ajax/vcode"/></a>
					<a href="javascript:;" class="refreshImg" onClick="freshVcode()">
				</td>
			</tr> 
			<tr>
				<td>短信验证码：</td>
				<td>
					<input type="text" name="smscode" class="reg_input2" id="sms_code" placeholder="手机验证码"/>
					<input id="zphone" type="button" value="获取手机验证码">
				</td>
			</tr> 
			<tr>
				<td>&nbsp; </td>
				<td><input type="submit" name="submit" class="submit" value="下一步"/></td>
			</tr>
		</table>  
	</form> 	
</div> 
<{import file="mfooter.html"}>
<script type="text/javascript">
$(function(){
	$('form#next').submit(function(){ 
		sms_code = $("#sms_code").val();
		if(sms_code){
			$.post(URI+'user/mobile_next',{sms_code:sms_code},function(result){ 
				data = jQuery.parseJSON(result); 
				if(data.error == '0'){
					location.href=URI+"user/mobile_update?code="+data.code;
				}else{
					alert(data.msg);
				}
			});
		}else{
			alert('短信验证码不能为空');
		}
		return false;
	});
	
	// 获得验证码 
	$("#zphone").click(function(){
		var mobile = '<{$urow.mobile}>';
		var vcode = $('input[name=vcode]').val(); 
		send_sms(mobile, vcode, '#zphone', '1');
	});
});
</script>