$('#J_sendSms').click(function(){
var _this = $(this);
if(!$("#mobile").val()) return alert("手机号码不能为空");
$.get("/member/getCode", {mobile:$("#mobile").val()}, 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");
});