Browse Source

修改bug

cr 4 years ago
parent
commit
799457edc6
1 changed files with 6 additions and 2 deletions
  1. 6 2
      src/pages/index/register.vue

+ 6 - 2
src/pages/index/register.vue

@@ -193,6 +193,7 @@ export default {
193 193
 
194 194
             hideReturn: false,
195 195
             inviteCode: "",
196
+            timer: null,
196 197
         };
197 198
     },
198 199
 
@@ -281,10 +282,10 @@ export default {
281 282
             this.timeing = true;
282 283
             let t = 60;
283 284
             this.codeStr = t + "s重新获取";
284
-            let timer = setInterval(() => {
285
+            this.timer = setInterval(() => {
285 286
                 t--;
286 287
                 if (t === 0) {
287
-                    clearInterval(timer);
288
+                    clearInterval(this.timer);
288 289
                     this.codeStr = "发送验证码";
289 290
                     this.timeing = false;
290 291
                 } else {
@@ -343,6 +344,9 @@ export default {
343 344
                     sendData.code = result.code;
344 345
                     this.api.post("/Login/Register", sendData).then((res) => {
345 346
                         uni.hideLoading();
347
+                        clearInterval(this.timer);
348
+                        this.codeStr = "发送验证码";
349
+                        this.timeing = false;
346 350
                         if (res.success) {
347 351
                             res.data.companyId = res.data.companyId || null;
348 352
                             this.fn.showToast(`注册成功`);