| | |
| | | </view> |
| | | </view> |
| | | <view class="cell"> |
| | | <view class="title">公司</view> |
| | | <view class="title">公司<b>*</b></view> |
| | | <view class="content"> |
| | | <input class="input" maxlength="50" placeholder-style="color: #999999;" v-model="visitorData.companyName" placeholder="请输入您的公司名称" /> |
| | | </view> |
| | | </view> |
| | | <view class="cell"> |
| | | <view class="title1"> |
| | | <text class="title1_a">人脸照片<b>*</b></text> |
| | | <text class="title1_b">1、请提供五官清晰,人脸居中的正面人脸免</text> |
| | | <text class="title1_a">人脸照片<b style="color: red;">*</b></text> |
| | | <text class="title1_b">1、请提供五官清晰,人脸居中的正面人脸免冠照片;</text> |
| | | <text class="title1_b">2、照片无逆光、无PS、无过度美颜处理</text> |
| | | </view> |
| | | <view class="content"> |
| | |
| | | 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: { |
| | |
| | | title: '手机号不能为空', |
| | | icon: 'none' |
| | | }) |
| | | const regExp = /^1[3456789]\d{9}$/; |
| | | if (!regExp.test(this.visitorData.phone)) return uni.showToast({ |
| | | title: '手机号格式错误', |
| | | icon: 'none' |
| | | }) |
| | | if (!String(this.visitorData.idcardType)) return uni.showToast({ |
| | | title: '证件类型不能为空', |
| | | icon: 'none' |
| | |
| | | title: '证件号码不能为空', |
| | | icon: 'none' |
| | | }) |
| | | if (this.visitorData.idcardType === 0) { |
| | | const regex = /^[1-9]\d{5}(19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{3}[\dxX]$/; |
| | | if (!regex.test(this.visitorData.idcardNo)) return uni.showToast({ |
| | | title: '证件号码格式错误', |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | if (!this.visitorData.companyName) return uni.showToast({ |
| | | title: '公司不能为空', |
| | | icon: 'none' |
| | | }) |
| | | if (!this.visitorData.faceImg) return uni.showToast({ |
| | | title: '人脸照片不能为空', |
| | | icon: 'none' |
| | | }) |
| | | if (this.visit === '1') { |
| | | if (!this.visitorData.imgurl) return uni.showToast({ |
| | | title: '人脸照片不能为空', |
| | | title: '健康证不能为空', |
| | | icon: 'none' |
| | | }) |
| | | } |
| | |
| | | label: 'HEALTH_CARD' |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | console.log(res) |
| | | this.visit = res.data.code |
| | | } |
| | | }) |
| | | }, |
| | | 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) => { |
| | | 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({ |
| | |
| | | formData: { |
| | | folderCode: 'MEMBER_IMG' |
| | | }, |
| | | success: (uploadFileRes) => { |
| | | success: (uploadFileRes) => { |
| | | let res = JSON.parse(uploadFileRes.data) |
| | | if (type === 'faceImg') { |
| | | this.visitorData.faceImg = res.data.halfPath |