From be5afdf49938b5830313740b12c25c6851847e3f Mon Sep 17 00:00:00 2001
From: nidapeng <jp@doumee.com>
Date: 星期五, 08 三月 2024 15:42:56 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 h5/pages/visitorApplication/visitorApplication.vue |   85 ++++++++++++++++++++++++++++++++++++------
 1 files changed, 73 insertions(+), 12 deletions(-)

diff --git a/h5/pages/visitorApplication/visitorApplication.vue b/h5/pages/visitorApplication/visitorApplication.vue
index 4b65e9c..927e769 100644
--- a/h5/pages/visitorApplication/visitorApplication.vue
+++ b/h5/pages/visitorApplication/visitorApplication.vue
@@ -45,6 +45,7 @@
 					<text>璁块棶闂ㄧ</text>
 					<text>*</text>
 				</view>
+				 <!-- @click="show6 = true" -->
 				<view class="list_item_content">
 					<text :style="{color: form1.doorSelectName ? '#000000' : ''}">{{form1.doorSelectName ? form1.doorSelectName : '璇烽�夋嫨'}}</text>
 					<u-icon name="arrow-right" color="#CCCCCC" size="20"></u-icon>
@@ -64,8 +65,9 @@
 					<text>闅忚杞﹁締</text>
 					<text></text>
 				</view>
-				<view class="list_item_content">
-					<input type="text" placeholder="璇疯緭鍏ヨ溅鐗屽彿" v-model="form1.carNos" maxlength="8" placeholder-style="color: #999999;" />
+				<view class="list_item_content" @click="openInput(1)">
+					<text :style="{color: form1.carNos ? '#000000' : ''}">{{form1.carNos ? form1.carNos : '璇疯緭鍏ヨ溅鐗屽彿鐮�'}}</text>
+					<!-- <input type="text" placeholder="璇疯緭鍏ヨ溅鐗屽彿" v-model="form1.carNos" maxlength="8" placeholder-style="color: #999999;" /> -->
 				</view>
 			</view>
 		</view>
@@ -226,7 +228,7 @@
 					<view class="adduser_list_item">
 						<view class="adduser_list_item_label">
 							<text>鍏徃</text>
-							<text></text>
+							<text>*</text>
 						</view>
 						<view class="adduser_list_item_ipt">
 							<input type="text" v-model="withUserList.companyName" placeholder-style="color: #999999;font-size: 28rpx;" placeholder="璇疯緭鍏ュ叕鍙稿悕绉�" />
@@ -237,8 +239,9 @@
 							<text>闅忚杞﹁締</text>
 							<text></text>
 						</view>
-						<view class="adduser_list_item_ipt">
-							<input type="text" v-model="withUserList.carNos" placeholder-style="color: #999999;font-size: 28rpx;" placeholder="璇疯緭鍏ヨ溅鐗屽彿" />
+						<view class="adduser_list_item_ipt" @click="openInput(2)">
+							<text :style="{color: withUserList.carNos ? '#000000' : ''}">{{withUserList.carNos ? withUserList.carNos : '璇疯緭鍏ヨ溅鐗屽彿鐮�'}}</text>
+							<!-- <input type="text" v-model="withUserList.carNos" disabled placeholder-style="color: #999999;font-size: 28rpx;" placeholder="璇疯緭鍏ヨ溅鐗屽彿" /> -->
 						</view>
 					</view>
 					<view class="adduser_list_item">
@@ -278,13 +281,22 @@
 			</view>
 		</u-popup>
 		<u-picker keyName="name" :show="show6" :columns="columns1" @confirm="seleIdcard" @cancel="show6 = false"></u-picker>
+		<!-- <tly-picture-cut ref="tlyPictureCut" :pictureSrc="photoSrc" @createImg="uploadImg"></tly-picture-cut> -->
+		<keyboardInput ref="keyboard" @export="setPlate" @close="closeInput" />
+		<qf-image-cropper ref="cropper" :width="280" :height="280" :radius="30" @crop="uploadImg"></qf-image-cropper>
 	</view>
 </template>
 
 <script>
+	import tlyPictureCut from "@/components/tly-picture-cut/tlyPictureCut.vue";
+	import keyboardInput from "@/components/keyboard-input/keyboard-input.vue";
+	import QfImageCropper from '@/uni_modules/qf-image-cropper/components/qf-image-cropper/qf-image-cropper.vue';
 	export default {
 		data() {
 			return {
+				photoSrc: '',
+				type: '',
+				inputType: '',
 				show: false,
 				show1: false,
 				show2: false,
@@ -292,6 +304,7 @@
 				show4: false,
 				show5: false,
 				show6: false,
+				show7: false,
 				fileList: [],
 				columns1: [[{name: '韬唤璇�', id: 0}, {name: '娓境璇佷欢', id: 1},{name: '鎶ょ収', id: 2}]],
 				columns: [],
@@ -328,13 +341,52 @@
 				verify: ''
 			};
 		},
+		components: { tlyPictureCut, keyboardInput, QfImageCropper },
 		onLoad(options) {
-			this.form = JSON.parse(options.data)
+			if (options.data) {
+				this.form = JSON.parse(options.data)
+			}
 			this.getvisit()
 			this.getVisit1()
 			this.getUserValid()
 		},
 		methods: {
+			openInput(type) {
+				this.inputType = type
+				this.$refs.keyboard.open()
+			},
+			setPlate(e) {
+				if (this.inputType === 1) {
+					this.form1.carNos = e
+				} else if (this.inputType === 2) {
+					this.withUserList.carNos = e
+				}
+				this.$forceUpdate()
+				this.closeInput()
+			},
+			closeInput() {
+				this.$refs.keyboard.close()
+			},
+			uploadImg(file) {
+				this.$refs.cropper.close()
+				uni.showLoading({ title: '涓婁紶涓�', mask: true });
+				uni.uploadFile({
+					url: `${this.$baseUrl}public/api/uploadFtp.do`,
+					filePath: file.tempFilePath,
+					name: 'file',
+					formData: {
+						folderCode: 'MEMBER_IMG'
+					},
+					success: (uploadFileRes) => {
+						let res = JSON.parse(uploadFileRes.data)
+						this.withUserList.faceImg = res.data.halfPath
+						this.withUserList.faceImgUrl = res.data.prefixPath + res.data.folder + res.data.halfPath
+					},
+					complete() {
+						uni.hideLoading();
+					}
+				});
+			},
 			closeMJ() {
 				this.show = false
 				this.columns.forEach(item => {
@@ -354,7 +406,7 @@
 					title: '绂诲満鏃堕棿涓嶈兘涓虹┖',
 					icon: 'none'
 				})
-				if (!this.form1.doorSelectName) return uni.showToast({
+				if (!this.form1.doorSelectName && this.accessControl == 1) return uni.showToast({
 					title: '璁块棶闂ㄧ涓嶈兘涓虹┖',
 					icon: 'none'
 				})
@@ -374,7 +426,6 @@
 					withUserList: this.personnel
 				}).then(res => {
 					if (res.code === 200) {
-						console.log(res)
 						uni.reLaunch({
 							url: `/pages/appointmentDetails/appointmentDetails?id=${res.data}`
 						})
@@ -424,6 +475,10 @@
 						icon: 'none'
 					})
 				}
+				if (!this.withUserList.companyName) return uni.showToast({
+					title: '鍏徃涓嶈兘涓虹┖',
+					icon: 'none'
+				})
 				if (!this.withUserList.faceImg) return uni.showToast({
 					title: '浜鸿劯鐓х墖涓嶈兘涓虹┖',
 					icon: 'none'
@@ -449,8 +504,18 @@
 				this.withUserList.imgurlUrl = ''
 			},
 			upload(type) {
+				this.type = type
+				if (type === 'faceImg') {
+					this.$refs.cropper.open()
+					return
+				}
 				uni.chooseImage({
 					success: (chooseImageRes) => {
+						// if (type === 'faceImg') {
+						// 	this.photoSrc = chooseImageRes.tempFilePaths[0];
+						// 	this.$refs.tlyPictureCut.showPop();
+						// 	return
+						// }
 						uni.showLoading({ title: '涓婁紶涓�', mask: true });
 						for (let i = 0; i < chooseImageRes.tempFilePaths.length; i++) {
 							uni.uploadFile({
@@ -533,9 +598,6 @@
 			},
 			// 鏌ヨ鐢ㄦ埛
 			getUser() {
-				console.log(this.verify)
-				console.log(this.form1.phone1)
-				console.log(this.form1.receptMemberName)
 				if (this.verify === '0') {
 					if (this.form1.phone1) {
 						this.$u.api.getVisitedMember({
@@ -568,7 +630,6 @@
 					label: 'BEVISITED_USER_VALID'
 				}).then(res => {
 					if (res.code === 200) {
-						console.log(res)
 						this.verify = res.data.code
 					}
 				})

--
Gitblit v1.9.3