diff --git a/src/pages/improveData/improveADD.vue b/src/pages/improveData/improveADD.vue new file mode 100644 index 0000000..42d822d --- /dev/null +++ b/src/pages/improveData/improveADD.vue @@ -0,0 +1,900 @@ + + + + + diff --git a/src/pages/improveData/improveData.vue b/src/pages/improveData/improveData.vue index f060315..bf6259f 100644 --- a/src/pages/improveData/improveData.vue +++ b/src/pages/improveData/improveData.vue @@ -70,13 +70,20 @@ - + + + 密码 + - + + + @@ -86,6 +93,7 @@ + @@ -94,19 +102,26 @@ - + *所属协会 - + + + + + + + + + 入会时间 - @@ -159,32 +174,42 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - + @@ -192,13 +217,13 @@ - + + 入会时间 - - @@ -261,11 +286,11 @@ - + @@ -276,7 +301,8 @@ - + + @close="close('showBirthday')" @cancel="close('showBirthday')"> + :value="model1.userInfo.serveTime" mode="time" closeOnClickOverlay @confirm="ServeTimeConfirm" + @close="close('showServeTime')" @cancel="close('showServeTime')"> + :value="model1.userInfo.serveTimeend" mode="time" closeOnClickOverlay @confirm="ServeTimeConfirmend" + @close="close('showServeTimeend')" @cancel="close('showServeTimeend')"> + @close="close('showJionmeet')" @cancel="close('showJionmeet')"> - + + + + + + - - + - + @@ -337,8 +370,9 @@ export default { data() { return { + xiehuiObj: {}, //协会对象 + xiehuiId: '', showJionmeet: false, - pageTypeId: '', isJioned: false, renCaiShow: false, @@ -346,10 +380,12 @@ zhengzhiValue: '', renCaiValue: '', zuValue: "", + xieValue: '', zuShow: false, + xieShow: false, artResultList: '', artlist: [''], - honorList: [""], + honorList: [''], StandradList: [''], peopleSkillColums: [ ["天才", "卓越", "平平"] @@ -357,6 +393,7 @@ Zucolumns: [ ["汉族", "朝鲜族"], ], + xiecolumns: [], Zhengcolumns: [ ["群众", "党员", '共青团员'], ], @@ -366,11 +403,10 @@ ], fileList4: [], //资质照片上传 fileList1: [], //实景照片上传 - fileList2: [], //代表作 + fileList2: [ + [] + ], //代表作照片 fileList3: [], //照片上传 - - - jiguan: '', jigaunShow: false, showBirthday: false, @@ -390,11 +426,10 @@ sex: '', birthday: "", idCOde: '', - zuValue: '', phoneNum: '', meeting: '', - meetingTime: '', + // meetingTime: '', ServerName: '', Address: '', serverInstrutor: '', //服务介绍 @@ -402,10 +437,17 @@ serveTimeend: '', jionTime: '', DutyPeopleName: '', //负责人名称 - ServephoneNum: '', //服务商电话 + // ServephoneNum: '', //服务商电话 + pasw: '' }, }, rules: { + 'userInfo.pasw': [{ + type: 'string', + required: true, + message: '密码不能为空', + trigger: ['blur'] + }], 'userInfo.serverInstrutor': [{ type: 'string', required: true, @@ -447,34 +489,37 @@ trigger: ['blur', 'change'] }, 'userInfo.idCOde': [{ - required: true, - message: '请输入身份证号号', - trigger: ['change', 'blur'], - }, - { - // 自定义验证函数,见上说明 - validator: (rule, value, callback) => { - return uni.$u.test.idCard(value); + required: true, + message: '请输入身份证号号', + trigger: ['change', 'blur'], }, - message: '身份证号码格式不正确', + { + // 自定义验证函数,见上说明 + validator: (rule, value, callback) => { + return uni.$u.test.idCard(value); + }, + message: '身份证号码格式不正确', - trigger: ['change', 'blur'], - } - ], - "userInfo.phoneNum": [{ - required: true, - message: '请输入联系电话', - trigger: ['change', 'blur'], - }, - { - - validator: (rule, value, callback) => { - return uni.$u.test.mobile(value); + trigger: ['change', 'blur'], + } + ] + /* , + "userInfo.phoneNum": [{ + required: true, + message: '请输入联系电话', + trigger: ['change', 'blur'], }, - message: '手机号码不正确', - trigger: ['change', 'blur'], - } - ], + }, + { + + validator: (rule, value, callback) => { + return uni.$u.test.mobile(value); + }, + message: '手机号码不正确', + trigger: ['change', 'blur'], + } + ] */ + /* , "userInfo.ServephoneNum": [{ required: true, message: '请输入联系电话', @@ -488,7 +533,8 @@ message: '手机号码不正确', trigger: ['change', 'blur'], } - ], + ] */ + , 'userInfo.ServerName': [{ type: 'string', required: true, @@ -530,11 +576,29 @@ onReady() { this.$refs.form1.setRules(this.rules); + + this.http.request('/association/list', {}, "GET").then((res) => { + 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); + }) }, methods: { - close() { - this.showSex = false + close(show) { + this[show] = false }, AddItem(typNum) { @@ -548,6 +612,7 @@ break; case 2: this.StandradList.push('') + this.fileList2.push([]) break; } @@ -564,6 +629,7 @@ break; case 2: this.StandradList.splice(num, 1) + break; } @@ -583,42 +649,29 @@ }, ServeTimeConfirm(e) { this.showServeTime = false - - this.model1.userInfo.serveTime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd') + this.model1.userInfo.serveTime = e.value }, ServeTimeConfirmend(e) { this.showServeTimeend = false - - this.model1.userInfo.serveTimeend = uni.$u.timeFormat(e.value, 'yyyy-mm-dd') - + this.model1.userInfo.serveTimeend = e.value }, jionMeetConfirm(e) { this.showJionmeet = false this.model1.userInfo.jionTime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd') }, - birthdayClose() { - this.showBirthday = false - // this.$refs.form1.validateField('userInfo.birthday') - }, - ServeTimeClose() { - this.showServeTime = false - // this.$refs.form1.validateField('userInfo.birthday') - }, - JionTimeClose() { - this.showJionmeet = false - }, - selctZU(e) { - console.log(e); - }, - selctJi(e) { - console.log(e); - }, + confimZu(e) { this.zuShow = false this.zuValue = e.value[0] // console.log(e.value[0]); }, + confirmxie(e) { + this.xieShow = false + this.xieValue = e.value[0] + this.xiehuiId = this.xiehuiObj[this.xieValue] + console.log("xiehuiId", this.xiehuiId); + }, confimZheng(e) { this.zhengzhiShow = false this.zhengzhiValue = e.value[0] @@ -635,6 +688,10 @@ deletePic(event) { this[`fileList${event.name}`].splice(event.index, 1) }, + // 删除图片 + deletePic1(event) { + this.fileList2[event.name].splice(event.index, 1) + }, // 新增图片 async afterRead(event) { // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式 @@ -662,6 +719,36 @@ } console.log("fileList", this[`fileList${event.name}`]); }, + // 新增图片 + async afterRead1(event) { + // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式 + let lists = [].concat(event.file) + console.log(this.fileList2[event.name]) + let fileListLen = this.fileList2[event.name].length + + lists.map((item) => { + this.fileList2[event.name].push({ + ...item, + status: 'uploading', + message: '上传中' + }) + }) + for (let i = 0; i < lists.length; i++) { + const result = await this.uploadFilePromise(lists[i].url) + + console.log("result", result); + + let item = this.fileList2[event.name][fileListLen] + this.fileList2[event.name].splice(fileListLen, 1, Object.assign(item, { + status: 'success', + message: '', + url: result + })) + fileListLen++ + } + console.log("fileList", this.fileList2[event.name]); + }, + uploadFilePromise(url) { return new Promise((resolve, reject) => { let a = uni.uploadFile({ @@ -673,7 +760,7 @@ setTimeout(() => { - // console.log("upload1",JSON.parse(res.data).data.path); + resolve(JSON.parse(res.data).data.path) }, 1000) } @@ -687,35 +774,73 @@ uni.$u.toast('您的资料还未补充完整') return }) - var fl3 = this.fileList3.map((v, i) => { - return v.url - }) + if (this.fileList3) { + var fl3 = JSON.stringify(this.fileList3.map((v, i) => { + return v.url + })) + } else { + var fl3 = '[]' + } + // 营业执照 + if (this.fileList4) { + var fl4 = JSON.stringify(this.fileList4.map((v, i) => { + return v.url + })) + } else { + var fl4 = '[]' + } + // 实景 + if (this.fileList1) { + var fl1 = JSON.stringify(this.fileList1.map((v, i) => { + return v.url + })) + } else { + var fl1 = '[]' + } + var opsArr = [] + if (this.StandradList[0]) { + for (let i = 0; i < this.StandradList.length; i++) { + console.log("=====", this.fileList2); + + opsArr.push({ + name: this.StandradList[i], + value: this.fileList2[i].map((v, num) => { + return v.url + }) + }) + } + } + + + + var yishucj = JSON.stringify(this.artlist) + var rongyujx = JSON.stringify(this.honorList) let that = this.model1.userInfo let data = { // "phone": that.phoneNum, - "artAtt": "", - "associationId": "", + "artAtt": yishucj, + "associationId": this.xiehuiId, "base": this.jiguan, "birthDay": that.birthday, - "cfPhoto": "", - "comeTime": "", - "greats": "", + "cfPhoto": fl4, + "comeTime": that.jionTime, + "greats": rongyujx, "idCard": that.idCOde, - "images": JSON.stringify(fl3), - "info": "", - "isAssociation": true, + "images": fl3, + "info": that.serverInstrutor, + "isAssociation": this.isJioned, "nation": this.zuValue, - "nickName": "", - "opus": "", - "password": "", - "photo": "", + // "nickName": "", + "opus": opsArr, + // "password": "", + "photo": fl1, "politics": this.zhengzhiValue, - "rcType": "", - "serviceAddress": "", - "serviceName": "", + "rcType": this.renCaiValue, + "serviceAddress": that.Address, + "serviceName": that.ServerName, "sex": that.sex, - "timeEnd": 0, - "timeStart": 0, + "timeEnd": that.serveTimeend, + "timeStart": that.serveTime, "userName": that.name, "userType": this.pageTypeId, } @@ -723,8 +848,8 @@ this.http.request('/user/init', data, "POST").then(res => { if (res.code == 200) { /* uni.navigateTo({ - url: '/pages/pageHome/pageHome' - }) */ + url: '/pages/pageHome/pageHome' + }) */ uni.showToast({ title: "成功了", icon: "none", @@ -762,8 +887,9 @@ } .WenYiUpload { - padding: 32rpx; - background-color: #F8F8F8; + + // padding: 32rpx; + // background-color: #F8F8F8; margin-top: 16rpx; } diff --git a/src/static/improveData/imgjia.png b/src/static/improveData/imgjia.png index 6a585cb..4becfc0 100644 Binary files a/src/static/improveData/imgjia.png and b/src/static/improveData/imgjia.png differ