| | |
| | | <view class="cell"> |
| | | <view class="title"><b>*</b>手机号</view> |
| | | <view class="content"> |
| | | <input class="input" maxlength="11" placeholder-style="color: #999999;" v-model="visitorData.phone" placeholder="请输入您的手机号" /> |
| | | <input type="number" class="input" maxlength="11" placeholder-style="color: #999999;" v-model="visitorData.phone" placeholder="请输入您的手机号" /> |
| | | </view> |
| | | </view> |
| | | <view class="cell"> |
| | |
| | | import tlyPictureCut from "@/components/tly-picture-cut/tlyPictureCut.vue"; |
| | | import QfImageCropper from '@/uni_modules/qf-image-cropper/components/qf-image-cropper/qf-image-cropper.vue'; |
| | | import { mapState } from 'vuex' |
| | | import { uploadUrl } from "@/utils/config" |
| | | import { uploadAvatar } from "@/utils/config" |
| | | import { getSystemDictData, visitorSub } from '@/api' |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | userAnswerId: '', |
| | | name: '', |
| | | phone: '', |
| | | idcardType: '0', |
| | | idcardType: 0, |
| | | idcardTypeName: '身份证', |
| | | idcardNo: '', |
| | | faceImg: '', |
| | |
| | | } |
| | | } |
| | | }, |
| | | |
| | | computed: { |
| | | ...mapState(['member']) |
| | | }, |
| | | |
| | | components: { tlyPictureCut, QfImageCropper }, |
| | | |
| | | onLoad(option) { |
| | | if (this.member) { |
| | | this.visitorData.name = this.member.name |
| | | this.visitorData.phone = this.member.phone |
| | | this.visitorData.idcardNo = this.member.idcardDecode |
| | | this.visitorData.companyName = this.member.visitCompanyName |
| | | this.visitorData.faceImg = this.member.faceImg |
| | | if (this.member.faceImg) { |
| | | this.visitorData.faceImgUrl = this.member.prefixUrl + this.member.faceImg |
| | | } |
| | | this.visitorData.imgurl = this.member.imgurl |
| | | if (this.member.imgurl) { |
| | | this.visitorData.imgurlUrl = this.member.prefixUrl + this.member.imgurl |
| | | } |
| | | this.visitorData.idcardType = this.member.idcardType |
| | | if (this.member.idcardType === 0) { |
| | | this.visitorData.idcardTypeName = '身份证' |
| | | } else if (this.member.idcardType === 1) { |
| | | this.visitorData.idcardTypeName = '港澳证件' |
| | | } else if (this.member.idcardType === 2) { |
| | | this.visitorData.idcardTypeName = '护照' |
| | | } |
| | | const visitorData = uni.getStorageSync('visitorData') |
| | | if(visitorData && visitorData.name){ |
| | | this.visitorData = visitorData |
| | | } |
| | | this.visitorData.userAnswerId = option.userAnswerId |
| | | this.getVisit() |
| | | // if (this.member ) { |
| | | // this.visitorData.name = this.member.name |
| | | // this.visitorData.phone = this.member.phone |
| | | // this.visitorData.idcardNo = this.member.idcardDecode |
| | | // this.visitorData.companyName = this.member.visitCompanyName |
| | | // this.visitorData.faceImg = this.member.faceImg |
| | | // if (this.member.faceImg) { |
| | | // this.visitorData.faceImgUrl = this.member.prefixUrl + this.member.faceImg |
| | | // } |
| | | // this.visitorData.imgurl = this.member.imgurl |
| | | // if (this.member.imgurl) { |
| | | // this.visitorData.imgurlUrl = this.member.prefixUrl + this.member.imgurl |
| | | // } |
| | | // this.visitorData.idcardType = this.member.idcardType |
| | | // if (this.member.idcardType === 0) { |
| | | // this.visitorData.idcardTypeName = '身份证' |
| | | // } else if (this.member.idcardType === 1) { |
| | | // this.visitorData.idcardTypeName = '港澳证件' |
| | | // } else if (this.member.idcardType === 2) { |
| | | // this.visitorData.idcardTypeName = '护照' |
| | | // } |
| | | // } |
| | | this.visitorData.userAnswerId = option.answerId || '' |
| | | // this.getVisit() |
| | | // uni.$on('update', (data) => { |
| | | // this.uploadImg(data.tempFilePath) |
| | | // }) |
| | |
| | | |
| | | methods: { |
| | | submit() { |
| | | uni.navigateTo({ |
| | | url: `/pages/visitorApplication/visitorApplication?data=${JSON.stringify(this.visitorData)}` |
| | | }); |
| | | const { visitorData } = this |
| | | if (!this.visitorData.name) return uni.showToast({ |
| | | title: '姓名不能为空', |
| | | icon: 'none' |
| | |
| | | title: '人脸照片不能为空', |
| | | icon: 'none' |
| | | }) |
| | | if (this.visit === '1') { |
| | | if (!this.visitorData.imgurl) return uni.showToast({ |
| | | title: '健康证不能为空', |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | // if (this.visit === '1') { |
| | | // if (!this.visitorData.imgurl) return uni.showToast({ |
| | | // title: '健康证不能为空', |
| | | // icon: 'none' |
| | | // }) |
| | | // } |
| | | uni.setStorageSync('visitorData', this.visitorData) |
| | | uni.navigateTo({ |
| | | url: `/pages/visitorApplication/visitorApplication?data=${JSON.stringify(this.visitorData)}` |
| | | }); |
| | | }, |
| | | getVisit() { |
| | | // 是否需要答题 |
| | | this.$u.api.getSystemDictData({ |
| | | // 是否需要 健康证 |
| | | getSystemDictData({ |
| | | dictCode: 'SYSTEM', |
| | | label: 'HEALTH_CARD' |
| | | }).then(res => { |
| | |
| | | that.$refs.cropper.close() |
| | | uni.showLoading({ title: '上传中', mask: true }); |
| | | uni.uploadFile({ |
| | | url: uploadUrl, |
| | | url: uploadAvatar, |
| | | filePath: file.tempFilePath, |
| | | name: 'file', |
| | | formData: { |
| | |
| | | if (type === 'imgurl') { |
| | | uni.showLoading({ title: '上传中', mask: true }); |
| | | uni.uploadFile({ |
| | | url: uploadUrl, |
| | | url: uploadAvatar, |
| | | filePath: chooseImageRes.tempFilePaths[0], |
| | | name: 'file', |
| | | formData: { |