소스 검색

Merge branch 'lsa/验证码登录' into 莱斯奥/2.4.1

xiaohaizhao 1 년 전
부모
커밋
1ed191babd
3개의 변경된 파일6개의 추가작업 그리고 8개의 파일을 삭제
  1. 0 3
      pages/login/modules/account.js
  2. 3 5
      pages/login/modules/phone.js
  3. 3 0
      pages/login/phone.js

+ 0 - 3
pages/login/modules/account.js

@@ -23,9 +23,6 @@ Component({
 			setTimeout(() => {
 				this.allowOrNot();
 			}, 300)
-			setTimeout(() => {
-				this.allowOrNot();
-			}, 500)
 		}
 	},
 	methods: {

+ 3 - 5
pages/login/modules/phone.js

@@ -26,9 +26,6 @@ Component({
             setTimeout(() => {
                 this.allowOrNot();
             }, 300)
-            setTimeout(() => {
-                this.allowOrNot();
-            }, 500)
         }
     },
     methods: {
@@ -68,14 +65,15 @@ Component({
             this.setData({
                 [e.target.dataset.name]: e.detail.value.trim()
             })
-            // this.allowOrNot();
+            this.allowOrNot();
         },
         /* 验证是否允许登录 */
         allowOrNot() {
+            console.log("查询", this.data.phonenumber.length != 0)
             getCurrentPages().forEach(v => {
                 if (['pages/login/phone'].includes(v.__route__)) {
                     v.setData({
-                        disabled: this.data.phonenumber.length != 0
+                        disabled: this.data.phonenumber.length == 0 && this.data.password.length == 0
                     })
                 }
             })

+ 3 - 0
pages/login/phone.js

@@ -24,6 +24,9 @@ Page({
         this.setData({
             loginFunc: this.data.loginFunc == 'account' ? "phone" : "account"
         })
+        setTimeout(() => {
+            this.selectComponent('#login').allowOrNot();
+        }, 800)
     },
     /* 微信登录 */
     wechatLogin() {