Showing
1 changed file
with
11 additions
and
1 deletions
@@ -196,10 +196,18 @@ let question = { | @@ -196,10 +196,18 @@ let question = { | ||
196 | } | 196 | } |
197 | }, | 197 | }, |
198 | saveAnswers: function(info) { | 198 | saveAnswers: function(info) { |
199 | - if (!info || !info.length) { | 199 | + var that = this; |
200 | + | ||
201 | + if (this.saving || !info || !info.length) { | ||
200 | return; | 202 | return; |
201 | } | 203 | } |
202 | 204 | ||
205 | + this.saving = true; | ||
206 | + | ||
207 | + setTimeout(function() { | ||
208 | + that.saving = false; | ||
209 | + }, 5000); | ||
210 | + | ||
203 | $.ajax({ | 211 | $.ajax({ |
204 | type: 'POST', | 212 | type: 'POST', |
205 | url: '/3party/questionnaire/submit', | 213 | url: '/3party/questionnaire/submit', |
@@ -211,6 +219,8 @@ let question = { | @@ -211,6 +219,8 @@ let question = { | ||
211 | frontAnswers: JSON.stringify(info) | 219 | frontAnswers: JSON.stringify(info) |
212 | } | 220 | } |
213 | }).then(function(data) { | 221 | }).then(function(data) { |
222 | + that.saving = false; | ||
223 | + | ||
214 | if (data.code === 200) { | 224 | if (data.code === 200) { |
215 | tipDg.show('调查问卷已成功提交,感谢您的帮助!'); | 225 | tipDg.show('调查问卷已成功提交,感谢您的帮助!'); |
216 | 226 |
-
Please register or login to post a comment