From ef1a85e88e299ce368ee88b88070966de655f477 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=97=AB=E6=99=93=E8=8C=B9?= <1935832701@qq.com> Date: Fri, 18 Aug 2023 10:49:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/add/add.vue | 66 ++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 35 deletions(-) diff --git a/pages/add/add.vue b/pages/add/add.vue index 3ecc48f..a02efb7 100644 --- a/pages/add/add.vue +++ b/pages/add/add.vue @@ -224,6 +224,11 @@ }, //提交 submitend() { + if(this.form.studentSex=='男'){ + this.$set(this.form,'studentSex','MALE') + }else if(this.form.studentSex=='女'){ + this.$set(this.form,'studentSex','FEMALE') + } if (!this.form.kindergartenName) { this.$refs.uToast.show({ message: "请选择所属幼儿园", @@ -236,43 +241,34 @@ type: 'error', duration: '2000' }) - } - if(this.form.studentSex=='男'){ - this.$set(this.form,'studentSex','MALE') - }else if(this.form.studentSex=='女'){ - this.$set(this.form,'studentSex','FEMALE') - } - this.$refs.uForm.validate().then(res => { - // uni.$u.toast('校验通过') - updateStudent(this.form).then(res => { - if (res.code == 200) { - this.$refs.uToast.show({ - message: "提交成功", - type: 'success', - duration: '2000' - }) - setTimeout(e => { - uni.reLaunch({ - url: '/pages/Personal/Personal' + }else{ + this.$refs.uForm.validate().then(res => { + // uni.$u.toast('校验通过') + updateStudent(this.form).then(res => { + if (res.code == 200) { + this.$refs.uToast.show({ + message: "提交成功", + type: 'success', + duration: '2000' }) - }, 1000) - - } else if (res.code == 500) { - console.log('11111111') - this.$refs.uToast.show({ - message: res.msg, - type: 'error', - duration: '2000' - }) - } + setTimeout(e => { + uni.reLaunch({ + url: '/pages/Personal/Personal' + }) + }, 1000) + + } else if (res.code == 500) { + this.$refs.uToast.show({ + message: res.msg, + type: 'error', + duration: '2000' + }) + } + }) + }).catch(errors => { }) - }).catch(errors => { - this.$refs.uToast.show({ - message: errors, - type: 'error', - duration: '2000' - }) - }) + } + },