/////////////////获取短信验证码 begin
var wait = 60;//倒计时60秒
var intervalId;//定时
var i = wait;//倒计时递减 1
function getVCode(){
i = wait;
var phone = $('#mobile').val();
var phoneBool = checkPhone();
if(!phoneBool){
return;
}else{
$("#yzCode").attr('disabled','disabled');
$.ajax({
type:'GET',
url:'/password/sendVilidateCodeByPhone',
data:{'phone':phone},
success:getVCodeBack
});
}
}
function getVCodeBack(data){
if(data=='SUCCESS'){
intervalId = setInterval("exit()", 1000);
}else{
alert('系统繁忙,请稍后再试!');
}
}
//递归让短信发送按钮可点击
function exit() {
$("#yzCode").text(i + "秒后重新发送");
$("#yzCode").attr('disabled','disabled');
$("#yzCode").css({ "color": "#666","cursor":"text"});
i = i - 1;
if (i <= -1) {
clearInterval(intervalId);
$("#yzCode").removeAttr("disabled");
$("#yzCode").text("获取短信验证码").css({ "color": "#30C0CE","cursor":"pointer"});
}
}
///////////////获取短信验证码 end