|
@@ -74,31 +74,36 @@
|
|
|
var interval;
|
|
|
|
|
|
function sendsmg() {
|
|
|
- if (seconds > 59 || seconds < 1) {
|
|
|
- var phone = $("#phone").val();
|
|
|
- if (phone == null || phone == '') {
|
|
|
- layer.msg("请输入手机号码");
|
|
|
- return false;
|
|
|
- } else {
|
|
|
- $.post("sendsms.html", {"phone": phone}, function (data) {
|
|
|
+ $(".get_codes").removeAttr("onclick");
|
|
|
+ var phone = $("#phone").val();
|
|
|
+ if (phone == null || phone == '') {
|
|
|
+ layer.msg("请输入手机号码");
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ $.post("sendsms.html", {"phone": phone}, function (data) {
|
|
|
+ if(!data.is){
|
|
|
+ layer.msg("该手机号已被限流,限流规则:一条/分钟,5条/小时,10条/天!", {icon: 0, time: 5000});
|
|
|
+ }
|
|
|
+ },"json");
|
|
|
+
|
|
|
+ interval = setInterval(function () {
|
|
|
+ if (seconds > 0) {
|
|
|
+ seconds--;
|
|
|
+ $(".get_codes").text(seconds + 's');
|
|
|
+ $(".get_codes").attr("disabled", true)
|
|
|
+ } else {
|
|
|
+ clearInterval(interval)
|
|
|
+ $(".get_codes").attr("onclick","sendsmg()");
|
|
|
+ $(".get_codes").text('重新获取');
|
|
|
+ $(".get_codes").attr("disabled", false)
|
|
|
+ seconds = 60;
|
|
|
+ }
|
|
|
+ }, 1000)
|
|
|
|
|
|
- });
|
|
|
- interval = setInterval(function () {
|
|
|
- if (seconds > 0) {
|
|
|
- seconds--;
|
|
|
- $(".get_codes").text(seconds + 's');
|
|
|
- $(".get_codes").attr("disabled", true)
|
|
|
- } else {
|
|
|
- clearInterval(interval)
|
|
|
- $(".get_codes").text('重新获取');
|
|
|
- $(".get_codes").attr("disabled", false)
|
|
|
- seconds = 60;
|
|
|
- }
|
|
|
- }, 1000)
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 表单提交
|
|
|
*/
|