diff --git a/my/renzheng/index.vue b/my/renzheng/index.vue index 7c58560..5f75b76 100644 --- a/my/renzheng/index.vue +++ b/my/renzheng/index.vue @@ -52,14 +52,13 @@ 请选择认证类型 - + {{item.value}} - + 上传身份证正面 @@ -137,7 +136,8 @@ - + 持有资质证书(可多张) @@ -220,7 +220,7 @@ - + @@ -254,7 +254,7 @@ export default { data() { return { - selected:[], + selected: [], showAgree: false, form: { name: '', @@ -325,9 +325,9 @@ closeable: true, XCXIsSelect: '否', renzhengStatus: false, - typeList:[], - url:'', - urlUol:'' + typeList: [], + url: '', + urlUol: '', } }, onLoad() { @@ -379,12 +379,23 @@ }] this.openWay = 2; // #endif + //this.dateValue = this.getDate(); }, onShow() { // this.Getmoney() this.checkRenzhengStatus(); }, methods: { + getDate() { //年月日 + const date = new Date(); + // const date = new Date(); + let year = date.getFullYear(); + let month = date.getMonth() + 1; + let day = date.getDate(); + month = month > 9 ? month : '0' + month; + day = day > 9 ? day : '0' + day; + return `${year}-${month}-${day}`; + }, gukeBtn(item) { var index = this.selected.indexOf(item); if (index === -1) { @@ -394,12 +405,12 @@ } var data = []; for (var i = 0; i < this.selected.length; i++) { - data.push(this.selected[i].id) + data.push(this.selected[i].id) } this.typeId = data.join(",") - console.log("this.typeId",this.typeId) + console.log("this.typeId", this.typeId) }, - fuwuType(){ + fuwuType() { this.$Request.get("/app/dict/list", { type: '服务类型' }).then(res => { @@ -740,45 +751,49 @@ for (let i = 0; i < res.tempFilePaths.length; i++) { that.$queue.showLoading("上传中..."); uni.getFileInfo({ - filePath: res.tempFilePaths[i], - success: (infoRes) => { - const size = infoRes.size; - if (size / 1024 / 1024 > 4) { - // 图片大于2MB - uni.showToast({ - icon:'error', - title:'图片超出2MB限制,请重新选择' - }) - } else { - // 图片小于等于2MB - uni.uploadFile({ // 上传接口 - //url: websocketUtils.uploadFileUrl(), //真实的接口地址 - url: urlName, - filePath: res.tempFilePaths[i], - name: 'file', - success: (uploadFileRes) => { - if (e == 3) { - if (that.infantImg.length <= 5) { - that.infantImg.push(JSON.parse(uploadFileRes.data) - .data) + filePath: res.tempFilePaths[i], + success: (infoRes) => { + const size = infoRes.size; + if (size / 1024 / 1024 > 4) { + // 图片大于2MB + uni.showToast({ + icon: 'error', + title: '图片超出2MB限制,请重新选择' + }) + } else { + // 图片小于等于2MB + uni.uploadFile({ // 上传接口 + //url: websocketUtils.uploadFileUrl(), //真实的接口地址 + url: urlName, + filePath: res.tempFilePaths[i], + name: 'file', + success: (uploadFileRes) => { + if (e == 3) { + if (that.infantImg.length <= 5) { + that.infantImg.push(JSON.parse( + uploadFileRes.data) + .data) + } + } else if (e == 2) { + if (that.certificateImg.length <= + 5) { + that.certificateImg.push(JSON + .parse(uploadFileRes + .data) + .data) + // that.image = JSON.parse(uploadFileRes.data) + // .data + } } - } else if (e == 2) { - if (that.certificateImg.length <= 5) { - that.certificateImg.push(JSON.parse(uploadFileRes.data) - .data) - // that.image = JSON.parse(uploadFileRes.data) - // .data - } + uni.hideLoading(); } - uni.hideLoading(); - } - }); - } - }, - fail: () => { - cons.log("上传失败") - } + }); + } + }, + fail: () => { + cons.log("上传失败") + } }); } @@ -786,11 +801,11 @@ }) }, onok(ev) { - var that=this; + var that = this; this.url = ""; // that.form.headImg = ev.path; var url = null; - if(ev.path){ + if (ev.path) { that.$queue.showLoading("上传中..."); // 图片小于等于2MB uni.uploadFile({ // 上传接口 @@ -805,7 +820,7 @@ } }); } - console.log("asdasdasdasd",this.avatar) + console.log("asdasdasdasd", this.avatar) }, oncancel() { // url设置为空,隐藏控件 @@ -820,24 +835,24 @@ success: res => { for (let i = 0; i < res.tempFilePaths.length; i++) { uni.getFileInfo({ - filePath: res.tempFilePaths[i], - success: (infoRes) => { - const size = infoRes.size; - console.log("size----------->",size / 1024 / 1024) - if (size / 1024 / 1024 > 4) { - // 图片大于2MB - uni.showToast({ - icon:'error', - title:'图片超出4MB限制,请重新选择' - }) - } else { - that.url=res.tempFilePaths[i]; - that.urlUol=res.tempFilePaths[i]; - } - }, - fail: () => { - cons.log("上传失败") - } + filePath: res.tempFilePaths[i], + success: (infoRes) => { + const size = infoRes.size; + console.log("size----------->", size / 1024 / 1024) + if (size / 1024 / 1024 > 4) { + // 图片大于2MB + uni.showToast({ + icon: 'error', + title: '图片超出4MB限制,请重新选择' + }) + } else { + that.url = res.tempFilePaths[i]; + that.urlUol = res.tempFilePaths[i]; + } + }, + fail: () => { + cons.log("上传失败") + } }); } } @@ -852,39 +867,42 @@ for (let i = 0; i < res.tempFilePaths.length; i++) { uni.getFileInfo({ - filePath: res.tempFilePaths[i], - success: (infoRes) => { - const size = infoRes.size; - if (size / 1024 / 1024 > 4) { - // 图片大于2MB - uni.showToast({ - icon:'error', - title:'图片超出2MB限制,请重新选择' - }) - } else { - // 图片小于等于2MB - uni.uploadFile({ // 上传接口 - url: websocketUtils.uploadFileUrl(), //真实的接口地址 - filePath: res.tempFilePaths[i], - name: 'file', - success: (uploadFileRes) => { - if (e == 1) { - that.form.front = JSON.parse(uploadFileRes.data).data - } else if (e == 2) { - that.form.back = JSON.parse(uploadFileRes.data).data - } else if (e == 4) { - that.form.headImg = JSON.parse(uploadFileRes.data).data - console.log(that.form.headImg) - } - uni.hideLoading(); + filePath: res.tempFilePaths[i], + success: (infoRes) => { + const size = infoRes.size; + if (size / 1024 / 1024 > 4) { + // 图片大于2MB + uni.showToast({ + icon: 'error', + title: '图片超出2MB限制,请重新选择' + }) + } else { + // 图片小于等于2MB + uni.uploadFile({ // 上传接口 + url: websocketUtils.uploadFileUrl(), //真实的接口地址 + filePath: res.tempFilePaths[i], + name: 'file', + success: (uploadFileRes) => { + if (e == 1) { + that.form.front = JSON.parse( + uploadFileRes.data).data + } else if (e == 2) { + that.form.back = JSON.parse( + uploadFileRes.data).data + } else if (e == 4) { + that.form.headImg = JSON.parse( + uploadFileRes.data).data + console.log(that.form.headImg) + } + uni.hideLoading(); - } - }); - } - }, - fail: () => { - cons.log("上传失败") - } + } + }); + } + }, + fail: () => { + cons.log("上传失败") + } }); } @@ -1073,24 +1091,27 @@ + + /deep/.uni-picker-view-wrapper uni-picker-view-column:nth-child(1) { + display: block !important; + } + \ No newline at end of file