diff --git a/pages/mine/bindBank/bindBank.vue b/pages/mine/bindBank/bindBank.vue index 776f89d..e3eb8e7 100644 --- a/pages/mine/bindBank/bindBank.vue +++ b/pages/mine/bindBank/bindBank.vue @@ -134,7 +134,7 @@ this.tips = text; }, getCode() { - if (this.dataForm.phone) { + if (this.dataForm.phone && this.$u.test.mobile(this.dataForm.phone)) { if (this.$refs.uCode.canGetCode) { // 模拟向后端请求验证码 uni.showLoading({ @@ -153,7 +153,7 @@ uni.$u.toast('倒计时结束后再发送'); } } else { - uni.$u.toast('请先输入手机号') + uni.$u.toast(this.dataForm.phone ? '手机号格式不正确' : '请先输入手机号') return } }, diff --git a/pages/mine/realName/realName.vue b/pages/mine/realName/realName.vue index 679d3e9..b0c58c8 100644 --- a/pages/mine/realName/realName.vue +++ b/pages/mine/realName/realName.vue @@ -252,7 +252,7 @@ this.tips = text; }, getCode() { - if (this.dataForm.phone) { + if (this.dataForm.phone && this.$u.test.mobile(this.dataForm.phone)) { if (this.$refs.uCode.canGetCode) { // 模拟向后端请求验证码 uni.showLoading({ @@ -271,7 +271,7 @@ uni.$u.toast('倒计时结束后再发送'); } } else { - uni.$u.toast('请先输入手机号') + uni.$u.toast(this.dataForm.phone ? '手机号格式不正确' : '请先输入手机号') return } }, diff --git a/pages/selfService/realName/realName.vue b/pages/selfService/realName/realName.vue index 99ad557..0d96ae1 100644 --- a/pages/selfService/realName/realName.vue +++ b/pages/selfService/realName/realName.vue @@ -517,7 +517,7 @@ export default { this.tips = text }, getCode() { - if (this.dataForm.phone) { + if (this.dataForm.phone && this.$u.test.mobile(this.dataForm.phone)) { if (this.$refs.uCode.canGetCode) { // 模拟向后端请求验证码 uni.showLoading({ @@ -538,7 +538,7 @@ export default { uni.$u.toast('倒计时结束后再发送') } } else { - uni.$u.toast('请先输入手机号') + uni.$u.toast(this.dataForm.phone ? '手机号格式不正确' : '请先输入手机号') return } },