Showing
1 changed file
with
24 additions
and
35 deletions
@@ -115,29 +115,6 @@ export default { | @@ -115,29 +115,6 @@ export default { | ||
115 | this.shopPhone = checkTel; | 115 | this.shopPhone = checkTel; |
116 | }); | 116 | }); |
117 | }, | 117 | }, |
118 | - | ||
119 | - //验证短信验证码 | ||
120 | - verifySmsCode(verifyCode) { | ||
121 | - if (!verifyCode || verifyCode === '') { | ||
122 | - this.$Notice.error({ | ||
123 | - title: '提交错误', | ||
124 | - desc: '验证码不能为空', | ||
125 | - }); | ||
126 | - return false; | ||
127 | - } | ||
128 | - this.financeService.verifySmsCode({ phone: this.shopPhone, verifyCode }).then(res => { | ||
129 | - if (res.code !== 200) { | ||
130 | - this.$Notice.error({ | ||
131 | - title: '提交错误', | ||
132 | - desc: res.message, | ||
133 | - }); | ||
134 | - return false; | ||
135 | - } else { | ||
136 | - return true; | ||
137 | - } | ||
138 | - }); | ||
139 | - }, | ||
140 | - | ||
141 | //获取短信验证码 | 118 | //获取短信验证码 |
142 | getVerifyCode() { | 119 | getVerifyCode() { |
143 | if (this.shopPhone === '') { | 120 | if (this.shopPhone === '') { |
@@ -226,30 +203,42 @@ export default { | @@ -226,30 +203,42 @@ export default { | ||
226 | return false; | 203 | return false; |
227 | } | 204 | } |
228 | const applyParams = this.beforeSave(); | 205 | const applyParams = this.beforeSave(); |
229 | - | ||
230 | - if (!this.verifySmsCode(applyParams.verifyCode)) { | 206 | + if (!applyParams.verifyCode || applyParams.verifyCode === '') { |
207 | + this.$Notice.error({ | ||
208 | + title: '提交错误', | ||
209 | + desc: '验证码不能为空', | ||
210 | + }); | ||
231 | return false; | 211 | return false; |
232 | } | 212 | } |
233 | - | ||
234 | - this.$Loading.start(); | ||
235 | - this.submitDisabled = true; | ||
236 | - return this.financeService.shopWithdrawApply(applyParams).then(result => { | 213 | + const _this = this; |
214 | + this.financeService.verifySmsCode({ phone: this.shopPhone, verifyCode: applyParams.verifyCode }).then(res => { | ||
215 | + if (res.code !== 200) { | ||
216 | + _this.$Notice.error({ | ||
217 | + title: '提交错误', | ||
218 | + desc: res.message, | ||
219 | + }); | ||
220 | + return false; | ||
221 | + } | ||
222 | + _this.$Loading.start(); | ||
223 | + _this.submitDisabled = true; | ||
224 | + _this.financeService.shopWithdrawApply(applyParams).then(result => { | ||
237 | if (result.code === 200) { | 225 | if (result.code === 200) { |
238 | - this.$Loading.finish(); | ||
239 | - this.$Notice.success({ | 226 | + _this.$Loading.finish(); |
227 | + _this.$Notice.success({ | ||
240 | title: '提交成功', | 228 | title: '提交成功', |
241 | desc: '确认提现成功!', | 229 | desc: '确认提现成功!', |
242 | }); | 230 | }); |
243 | - this.backList(); | 231 | + _this.backList(); |
244 | } else { | 232 | } else { |
245 | - this.$Loading.error(); | ||
246 | - this.submitDisabled = false; | ||
247 | - this.$Notice.error({ | 233 | + _this.$Loading.error(); |
234 | + _this.submitDisabled = false; | ||
235 | + _this.$Notice.error({ | ||
248 | title: '提交错误', | 236 | title: '提交错误', |
249 | desc: result.message, | 237 | desc: result.message, |
250 | }); | 238 | }); |
251 | } | 239 | } |
252 | }); | 240 | }); |
241 | + }); | ||
253 | }, | 242 | }, |
254 | submit() { | 243 | submit() { |
255 | this.validateWithdrawApply() | 244 | this.validateWithdrawApply() |
-
Please register or login to post a comment