wkw 7 miesięcy temu
rodzic
commit
f844978425
1 zmienionych plików z 17 dodań i 1 usunięć
  1. 17 1
      pages/public/loginphone.vue

+ 17 - 1
pages/public/loginphone.vue

@@ -120,6 +120,19 @@
 					});
 				}
 			},
+			countDown() {
+				  const { count } = this;
+				  if (count === 1) {
+				    this.count = 60;
+				    this.sending = false;
+				    this.sendTime = "获取验证码";
+				  } else {
+				    this.count = count - 1;
+				    this.sending = true;
+				    this.sendTime = count - 1 + "秒后重新获取";
+				    setTimeout(this.countDown.bind(this), 1000);
+				  }
+			},
 			toLogin() {
 				this.$queue.loginClear();
 				const {
@@ -145,20 +158,23 @@
 						phone: phone,
 						wxOpenId: this.$queue.getData("openId") || '',
 					}
+					let url = ''
 					if (this.type == 1) {
 						params = {
 							...params,
 							password: password,
 						}
+						url = '/app/Login/loginApp'
 					}
 					if (this.type == 2) {
 						params = {
 							...params,
 							msg: code
 						}
+						url = '/app/Login/registerCode'
 					}
 					this.$Request
-						.post("/app/Login/loginApp", params)
+						.post(url, params)
 						.then((res) => {
 							if (res.code == 0) {
 								this.$queue.setData("userId", res.user.userId);