| | |
| | | return { |
| | | show: false, |
| | | visit: '', |
| | | type: '', |
| | | columns: [[{name: '身份证', id: 0}, {name: '港澳证件', id: 1},{name: '护照', id: 2}]], |
| | | fileList: [], |
| | | visitorData: { |
| | |
| | | onLoad(option) { |
| | | this.visitorData.userAnswerId = option.userAnswerId |
| | | this.getVisit() |
| | | uni.$on('update', (data) => { |
| | | this.uploadImg(data.tempFilePath) |
| | | }) |
| | | }, |
| | | |
| | | methods: { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | uploadImg(file) { |
| | | uni.showLoading({ title: '上传中', mask: true }); |
| | | uni.uploadFile({ |
| | | url: `${this.$baseUrl}public/api/uploadFtp.do`, |
| | | filePath: file, |
| | | name: 'file', |
| | | formData: { |
| | | folderCode: 'MEMBER_IMG' |
| | | }, |
| | | success: (uploadFileRes) => { |
| | | let res = JSON.parse(uploadFileRes.data) |
| | | if (this.type === 'faceImg') { |
| | | this.visitorData.faceImg = res.data.halfPath |
| | | this.visitorData.faceImgUrl = res.data.prefixPath + res.data.folder + res.data.halfPath |
| | | } else { |
| | | this.visitorData.imgurl = res.data.halfPath |
| | | this.visitorData.imgurlUrl = res.data.prefixPath + res.data.folder + res.data.halfPath |
| | | } |
| | | }, |
| | | complete() { |
| | | uni.hideLoading(); |
| | | } |
| | | }); |
| | | }, |
| | | upload(type) { |
| | | this.type = type |
| | | uni.chooseImage({ |
| | | count: 1, |
| | | success: (chooseImageRes) => { |
| | | // console.log(chooseImageRes.tempFilePaths[0]) |
| | | uni.navigateTo({ |
| | | url: `/pages/cropping/cropping?item=${JSON.stringify({ tempFilePath: chooseImageRes.tempFilePaths[0] })}` |
| | | }) |
| | | return |
| | | if (type === 'faceImg') { |
| | | uni.navigateTo({ |
| | | url: `/pages/cropping/cropping?item=${JSON.stringify({ tempFilePath: chooseImageRes.tempFilePaths[0] })}` |
| | | }) |
| | | return |
| | | } |
| | | uni.showLoading({ title: '上传中', mask: true }); |
| | | for (let i = 0; i < chooseImageRes.tempFilePaths.length; i++) { |
| | | uni.uploadFile({ |