From de1dc12dac69d4f51256db21b89196633776f613 Mon Sep 17 00:00:00 2001 From: shidongli Date: Wed, 1 Nov 2023 17:35:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/register/register.vue | 52 ++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/pages/register/register.vue b/pages/register/register.vue index 64aaa0f..90178e1 100644 --- a/pages/register/register.vue +++ b/pages/register/register.vue @@ -369,8 +369,10 @@ console.log(e, '打印e') }, submit() { - console.log(this.query) + var that = this + // console.log(that.query) + // console.log(that.query.diseaseList.length,'000') that.query.openid = uni.getStorageSync('openid'); that.query.cityCode = uni.getStorageSync('region'); @@ -378,33 +380,41 @@ that.query.sex = 'MALE'; } else if (that.query.sexname == '女') { that.query.sex = 'FEMALE'; - } - if (that.query.sex == "") { - that.$refs.uToast.show({ - title: '请选择性别', - type: 'error' - }) - } - if (!that.query.locationName) { - that.$refs.uToast.show({ - title: '请选择所在位置', - type: 'error' - }) - } - if (!that.query.birthDate) { - that.$refs.uToast.show({ - title: '请选择出生日期', - type: 'error' - }) - } + }s that.$refs.uForm.validate(valid => { if (valid) { + if (that.selected == 1) { that.$refs.uToast.show({ title: '请审核并同意用户协议', type: 'error' }) - } else { + } + else if (that.query.sex == "") { + that.$refs.uToast.show({ + title: '请选择性别', + type: 'error' + }) + } + else if (!that.query.locationName) { + that.$refs.uToast.show({ + title: '请选择所在位置', + type: 'error' + }) + } + else if (!that.query.birthDate) { + that.$refs.uToast.show({ + title: '请选择出生日期', + type: 'error' + }) + } + else if (that.query.diseaseList.length==0) { + that.$refs.uToast.show({ + title: '请选择基础疾病', + type: 'error' + }) + } + else { registerdata(that.query).then(res => { if (res.code == 200) { getCurrentUser(that.query.openid, that.query.cityCode).then(res => {