From e28aa13d3e657c3a7b54d913ec36c3b6c5ab880e Mon Sep 17 00:00:00 2001 From: "yang.huaxiang" Date: Fri, 27 Nov 2020 10:59:00 +0800 Subject: [PATCH] =?UTF-8?q?hotfix=EF=BC=9A=E5=86=85=E5=A4=96=E5=8B=A4?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E8=B0=83=E6=95=B4=20--=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E4=BA=BA=EF=BC=9A=E9=98=B3=E5=8D=8E=E7=A5=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/CheckAgent.vue | 3 +- src/views/ebiz/my/LogoutAgent.vue | 43 +++++++++++++++++++--------- 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/src/components/common/CheckAgent.vue b/src/components/common/CheckAgent.vue index aad99550b..5cee004b2 100644 --- a/src/components/common/CheckAgent.vue +++ b/src/components/common/CheckAgent.vue @@ -126,7 +126,8 @@ export default { async checkModelFilter() { const agentInfoRes = await getCheckModelAgentInfo({}) if (agentInfoRes.result == 0) { - if (!/^N{1}/.test(agentInfoRes.branchType)) { + if (/^[0-9][0-9]*$/.test(agentInfoRes.branchType)) { + // 内勤 并且手机号码正确 this.checkModel.mobile = agentInfoRes.phoneNo this.checkModel.show = true this.isShowSms = false diff --git a/src/views/ebiz/my/LogoutAgent.vue b/src/views/ebiz/my/LogoutAgent.vue index a46cc9c0b..6660cff3b 100644 --- a/src/views/ebiz/my/LogoutAgent.vue +++ b/src/views/ebiz/my/LogoutAgent.vue @@ -2,6 +2,7 @@
- + {{ codeDisabled ? `${countDown}s后重新获取` : '获取验证码' }} @@ -65,7 +75,8 @@ export default { countDown: 60, // 倒计时 codeDisabled: true, // 获取验证码按钮是否禁用 branchType: null, - checkNextDisabled: true // 禁用修改 + checkNextDisabled: true, // 禁用修改 + clickMobileDisabled: false // 手机号是否存在 } }, async mounted() { @@ -73,10 +84,11 @@ export default { // 获取代理人信息 const res = await getAgentInfo({ '89': '890' }) if (res.result == 0) { - this.branchType = /^N{1}/.test(res.branchType) ? '1' : '0' //res.branchType 以N打头的是内勤 其他是外勤 - if (this.branchType == '0') { + if (/^[0-9][0-9]*$/.test(res.branchType)) { + // 内勤 手机号格式正确 this.logoutDTO.mobile = res.phoneNo this.codeDisabled = false + this.clickMobileDisabled = true } } else { return this.$toast(res.resultMessage) @@ -127,9 +139,11 @@ export default { }, //操作下一步按钮状态 validateNext() { - if (!this.logoutDTO.smsCode || this.logoutDTO.smsCode == '') { - this.checkNextDisabled = true - return + if (this.clickMobileDisabled) { + if (!this.logoutDTO.smsCode || this.logoutDTO.smsCode == '') { + this.checkNextDisabled = true + return + } } // 2、判断密码是否一致 if (!this.logoutDTO.pwd || this.logoutDTO.pwd == '') { @@ -150,12 +164,14 @@ export default { // 注销 logoutAgent() { // 1、判断计时器 - if (!this.codeDisabled) { - return this.$toast('请先获取验证码') - } - // - if (!this.logoutDTO.smsCode || this.logoutDTO.smsCode == '') { - return this.$toast('请输入短信验证码') + if (this.clickMobileDisabled) { + if (!this.codeDisabled) { + return this.$toast('请先获取验证码') + } + // + if (!this.logoutDTO.smsCode || this.logoutDTO.smsCode == '') { + return this.$toast('请输入短信验证码') + } } // 2、判断密码是否一致 if (!this.logoutDTO.pwd || this.logoutDTO.pwd == '') { @@ -185,6 +201,7 @@ export default { this.$toast('用户注销成功') // 跳转登陆页面 this.$CacheUtils.removeLocItem('token') + // eslint-disable-next-line no-undef EWebBridge.webCallAppInJs('bridge', { flag: 'login' }) } else { this.$toast(res.resultMessage)