...
|
...
|
@@ -39,7 +39,6 @@ |
|
|
<script>
|
|
|
$(function () {
|
|
|
//获取短信验证码
|
|
|
var times = 1;
|
|
|
var validCode = true;
|
|
|
$(".get_code").click(function () {
|
|
|
if (validCode) {
|
...
|
...
|
@@ -47,36 +46,33 @@ |
|
|
if (!user_phone) {
|
|
|
layer.msg("手机号码格式不正确")
|
|
|
} else {
|
|
|
if (times == 1) {
|
|
|
times++;
|
|
|
$.ajax({
|
|
|
type: "post",
|
|
|
url: "{:url('portal/tool/get_sms_code')}",
|
|
|
data: {
|
|
|
mobile: user_phone
|
|
|
},
|
|
|
success: function () {
|
|
|
var time = 60;
|
|
|
var code = $(".get_code");
|
|
|
if (validCode) {
|
|
|
code.html("60秒");
|
|
|
validCode = false;
|
|
|
code.addClass("msgs1");
|
|
|
var t = setInterval(function () {
|
|
|
if (time >= 0) {
|
|
|
time--;
|
|
|
code.html(time + "秒");
|
|
|
validCode = false;
|
|
|
} else {
|
|
|
code.html("重新获取");
|
|
|
clearInterval(t);
|
|
|
validCode = true;
|
|
|
}
|
|
|
}, 1000)
|
|
|
}
|
|
|
$.ajax({
|
|
|
type: "post",
|
|
|
url: "{:url('portal/tool/get_sms_code')}",
|
|
|
data: {
|
|
|
mobile: user_phone
|
|
|
},
|
|
|
success: function () {
|
|
|
var time = 60;
|
|
|
var code = $(".get_code");
|
|
|
if (validCode) {
|
|
|
code.html("60秒");
|
|
|
validCode = false;
|
|
|
code.addClass("msgs1");
|
|
|
var t = setInterval(function () {
|
|
|
if (time >= 0) {
|
|
|
time--;
|
|
|
code.html(time + "秒");
|
|
|
validCode = false;
|
|
|
} else {
|
|
|
code.html("重新获取");
|
|
|
clearInterval(t);
|
|
|
validCode = true;
|
|
|
}
|
|
|
}, 1000)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
});
|
...
|
...
|
|