Browse Source

处理手机端注册优化

Administrator 7 years ago
parent
commit
d1192f4bf7

+ 30 - 32
components/mobile/registerEnterprise/index.vue

@@ -244,10 +244,10 @@
       },
       // 验证手机
       checkPhone () {
-        this.validateMobile()
-        this.validateCode()
-        if (this.state.mobile !== 'success' || this.state.token !== 'success') {
-          this.downToast('请确认填写部分是否有误')
+        if (this.state.mobile !== 'success') {
+          this.validateMobile()
+        } else if (this.state.token !== 'success') {
+          this.validateCode()
         } else if (this.checked === false) {
           this.downToast('您对阅读条款未做勾选')
         } else {
@@ -468,44 +468,42 @@
       },
       // 企业注册
       sureRegister () {
-        this.validateSpaceName()
-        this.validateBusinessCode()
-        if (!this.hasRegister) {
-          this.validateVipName()
-          this.validatePasswordTip()
-          this.validateConfirm()
-        } else {
-          this.validatePasswordTipHas()
-        }
-        if (!this.hasEmail) {
-          this.validateEmail()
-        }
         if (!this.hasRegister) {
-          if (this.state.spaceName !== 'success' ||
-            this.state.businessCode !== 'success' ||
-            this.state.vipName !== 'success' ||
-            this.state.password !== 'success' ||
-            this.state.confirm !== 'success' ||
-            this.state.email !== 'success') {
-            this.downToast('请确认填写部分是否有误')
+          if (this.state.spaceName !== 'success') {
+            this.validateSpaceName()
+          } else if (this.state.businessCode !== 'success') {
+            this.validateBusinessCode()
+          } else if (this.state.vipName !== 'success') {
+            this.validateVipName()
+          } else if (this.state.password !== 'success') {
+            this.validatePasswordTip()
+          } else if (this.state.confirm !== 'success') {
+            this.validateConfirm()
+          } else if (this.state.email !== 'success') {
+            this.validateEmail()
           } else {
             this.sbmitRegister()
           }
         } else {
           if (!this.hasEmail) {
-            if (this.state.spaceName !== 'success' ||
-              this.state.businessCode !== 'success' ||
-              this.state.password !== 'success' ||
-              this.state.email !== 'success') {
-              this.downToast('请确认填写部分是否有误')
+            if (this.state.spaceName !== 'success') {
+              this.validateSpaceName()
+            } else if (this.state.businessCode !== 'success') {
+              this.validateBusinessCode()
+            } else if (this.state.password !== 'success') {
+              this.validatePasswordTip()
+            } else if (this.state.email !== 'success') {
+              this.validateEmail()
             } else {
               this.sbmitRegister()
             }
           } else {
-            if (this.state.spaceName !== 'success' ||
-              this.state.businessCode !== 'success' ||
-              this.state.password !== 'success') {
-              this.downToast('请确认填写部分是否有误')
+            if (this.state.spaceName !== 'success') {
+              this.validateSpaceName()
+            } else if (this.state.businessCode !== 'success') {
+              this.validateBusinessCode()
+            } else if (this.state.password !== 'success') {
+              this.validatePasswordTipHas()
             } else {
               this.sbmitRegister()
             }

+ 10 - 11
components/mobile/registerPersonal/index.vue

@@ -254,17 +254,16 @@
       },
       // 表单提交
       submit () {
-        this.codeVipName()
-        this.codePwdBlur()
-        this.codePassword()
-        this.codeMobile()
-        this.codeToken()
-        if (this.state.vipName !== 'success' ||
-          this.state.password !== 'success' ||
-          this.state.confirm !== 'success' ||
-          this.state.mobile !== 'success' ||
-          this.state.token !== 'success') {
-          this.downToast('请确认填写部分是否有误')
+        if (this.state.vipName !== 'success') {
+          this.codeVipName()
+        } else if (this.state.password !== 'success') {
+          this.codePwdBlur()
+        } else if (this.state.confirm !== 'success') {
+          this.codePassword()
+        } else if (this.state.mobile !== 'success') {
+          this.codeMobile()
+        } else if (this.state.token !== 'success') {
+          this.codeToken()
         } else if (this.checked === false) {
           this.downToast('您对阅读条款未做勾选')
         } else {