发送手机验证码
/* 发送手机验证码 */
function sendSMS(obj){
var _this = $(obj);
$.get("/HAIHANG/ajax/getCode.json", {mobile:_User_Mobile}, function(data){
if(!data) {
_this.attr('disabled',false);
alert("验证码发送失败,请联系管理员");
}else if(data && data.code == '0001') {
_this.attr('disabled',true).after('<span class="color-gray f12">(今日发送次数已达上限)</span>');
alert(data.msg);
}else if(data && data.code == '0002') {
_this.attr('disabled',false);
alert(data.msg);
}else if(data && data.code == '0000') {
_this.attr('disabled',true).html('重新发送(60)');
var count = 60;
var t = setInterval(function(){
if (count < 1) {
clearInterval(t);
_this.attr('disabled',false).html('重新发送');
}else {
_this.html('重新发送('+ count-- +')')
}
},1000);
}
}, "json");
}