zhaoxiaohai пре 2 година
родитељ
комит
91edad2bc6
1 измењених фајлова са 7 додато и 3 уклоњено
  1. 7 3
      pages/login/modules/phone.js

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

@@ -21,7 +21,7 @@ Component({
             this.setData({
                 ...wx.getStorageSync('loginMsg')
             });
-            this.allowOrNot();
+            setTimeout(this.allowOrNot, 300)
         }
     },
     methods: {
@@ -65,8 +65,12 @@ Component({
         },
         /* 验证是否允许登录 */
         allowOrNot() {
-            getCurrentPages()[0].setData({
-                disabled: (this.data.phonenumber.length > 0 && this.data.password.length > 0) ? false : true
+            getCurrentPages().forEach(v => {
+                if (['pages/login/phone'].includes(v.__route__)) {
+                    v.setData({
+                        disabled: this.data.phonenumber && this.data.password.length
+                    })
+                }
             })
         },
         /* 处理登录 */