From dbfd20f2a09b1056e87070d34c4fff1c9c9dca3f Mon Sep 17 00:00:00 2001 From: lnn19986213 <1667908750@qq.com> Date: Thu, 30 Mar 2023 09:07:37 +0800 Subject: [PATCH] gx --- src/pages/improveData/improveData.vue | 67 +++++++++++++-------------- src/request/interface.js | 4 +- 2 files changed, 36 insertions(+), 35 deletions(-) diff --git a/src/pages/improveData/improveData.vue b/src/pages/improveData/improveData.vue index 78b00a7..1311cac 100644 --- a/src/pages/improveData/improveData.vue +++ b/src/pages/improveData/improveData.vue @@ -9,13 +9,13 @@ - 姓名 + *姓名 - 性别 + *性别 @@ -24,7 +24,7 @@ - 出生日期 + *出生日期 @@ -33,7 +33,7 @@ - 身份证号 + *身份证号 @@ -43,25 +43,23 @@ - - 民族 - + + *民族 + - - 籍贯 - + + *籍贯 + - 政治面貌 + *政治面貌 @@ -78,7 +76,7 @@ v-model="model1.userInfo.phoneNum" border="none"> --> - 密码 + *密码 @@ -89,7 +87,7 @@ - 头像上传 + *头像上传 - + @@ -391,6 +389,7 @@ xieValue: '', zuShow: false, xieShow: false, + upLoadReady: true, artResultList: '', artlist: [''], honorList: [''], @@ -452,7 +451,7 @@ rules: { 'userInfo.pasw': [{ required: true, - message: '请填写密码', + message: '请设置登录密码', trigger: ['blur', 'change'] }, { min: 6, @@ -571,16 +570,10 @@ res.data.records.map((v, i) => { return this.xiehuiObj[v.name] = v.id }) - var xieList = res.data.records.map((v, i) => { return v.name }) this.xiecolumns.push(xieList) - - - - console.log('this.xiehuiObj', this.xiehuiObj); - }).catch((error) => { console.log("error", error); }) @@ -714,7 +707,6 @@ })) fileListLen++ } - console.log("fileList", this[`fileList${event.name}`]); }, // 新增图片 async afterRead1(event) { @@ -743,10 +735,11 @@ })) fileListLen++ } - console.log("fileList", this.fileList2[event.name]); }, uploadFilePromise(url) { + this.upLoadReady = false + let that = this let token = uni.getStorageSync('token'); return new Promise((resolve, reject) => { let a = uni.uploadFile({ @@ -759,13 +752,14 @@ success: (res) => { setTimeout(() => { resolve(JSON.parse(res.data).data.path) + that.upLoadReady = true }, 1000) } }); }) }, submit() { - if (this.fileList3) { + if (this.fileList3.length > 0) { var fl3 = this.fileList3[0].url } else { var fl3 = '' @@ -804,8 +798,6 @@ } else { opsArr = [] } - console.log("opsArr====", opsArr); - console.log("honorList", this.honorList); var yishucj = null if (this.artlist[0] == "") { @@ -850,8 +842,10 @@ "fzr": that.DutyPeopleName, "wyrc": this.wyrc, } - console.log("dataddddddddd", data); - this.$refs.form1.validate().then(res => { + if (!data.userName || !data.sex || !data.idCard || !data.images || !data.password || !data.politics) { + this.upLoadReady = false + } + if (this.upLoadReady) { this.http.request('/auth/init', data, "POST").then(res => { if (res.code == 200) { uni.navigateTo({ @@ -868,10 +862,15 @@ icon: "none", }); }) - }).catch(errors => { + } else { uni.$u.toast('您的资料还未补充完整') - return - }) + } + // this.$refs.form1.validate().then(res => { + // + // }).catch(errors => { + // uni.$u.toast('您的资料还未补充完整') + // return + // }) } } @@ -1004,4 +1003,4 @@ .zhan_w { height: 160rpx; } - + \ No newline at end of file diff --git a/src/request/interface.js b/src/request/interface.js index a5d030f..84076d0 100644 --- a/src/request/interface.js +++ b/src/request/interface.js @@ -75,6 +75,9 @@ export default { } else if (response.data.code == 401) { //登录过期 reject(response) } else if (response.data.code == 402) { //信息未完善 + if(response.data.data){ + uni.setStorageSync('token', response.data.data.tokenValue) + } uni.showToast({ title: '信息未完善', icon: 'none', @@ -84,7 +87,6 @@ export default { url: '../SelectId/SelectId' }) }, 1200) - } else { uni.showToast({ title: response.data.msg,