Showing
1 changed file
with
9 additions
and
0 deletions
@@ -134,10 +134,17 @@ Timer.prototype.reset = function() { | @@ -134,10 +134,17 @@ Timer.prototype.reset = function() { | ||
134 | * 点击发送短信事件 | 134 | * 点击发送短信事件 |
135 | */ | 135 | */ |
136 | $('#send-sms').click(function() { | 136 | $('#send-sms').click(function() { |
137 | + var self = this; | ||
138 | + | ||
139 | + if ($(this).data('running')) { | ||
140 | + return false; | ||
141 | + } | ||
142 | + | ||
137 | $.get('/home/installment/starting-service/verify-code', { | 143 | $.get('/home/installment/starting-service/verify-code', { |
138 | mobile: formModel.mobile | 144 | mobile: formModel.mobile |
139 | }).then(function(result) { | 145 | }).then(function(result) { |
140 | if (result.code === 200) { | 146 | if (result.code === 200) { |
147 | + $(self).data('running', true); | ||
141 | new Timer().startCountdown(function() { | 148 | new Timer().startCountdown(function() { |
142 | }, function(counter) { | 149 | }, function(counter) { |
143 | // 进度回调 | 150 | // 进度回调 |
@@ -145,10 +152,12 @@ $('#send-sms').click(function() { | @@ -145,10 +152,12 @@ $('#send-sms').click(function() { | ||
145 | }, function() { | 152 | }, function() { |
146 | // 倒计时结束后再次显示 "获取验证码" | 153 | // 倒计时结束后再次显示 "获取验证码" |
147 | $('#send-sms').text('获取验证码'); | 154 | $('#send-sms').text('获取验证码'); |
155 | + $(self).data('running', false); | ||
148 | }); | 156 | }); |
149 | 157 | ||
150 | } else { | 158 | } else { |
151 | tip.show(result.message); | 159 | tip.show(result.message); |
160 | + $(self).data('running', false); | ||
152 | } | 161 | } |
153 | }); | 162 | }); |
154 | 163 |
-
Please register or login to post a comment