From 17efddc6a667670dca682bf36b51a43e99615e6d Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期三, 16 十月 2024 15:59:38 +0800
Subject: [PATCH] 代码初始化

---
 h5/pages/userinfo/userinfo.vue |   99 +++++++++++++++++++++++++++----------------------
 1 files changed, 55 insertions(+), 44 deletions(-)

diff --git a/h5/pages/userinfo/userinfo.vue b/h5/pages/userinfo/userinfo.vue
index 17c52c0..74e4685 100644
--- a/h5/pages/userinfo/userinfo.vue
+++ b/h5/pages/userinfo/userinfo.vue
@@ -10,14 +10,14 @@
 			<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">
 				<view class="title"><b>*</b>璇佷欢绫诲瀷</view>
 				<view class="content" @click="show = true">
 					<text :style="{color: visitorData.idcardTypeName ? '#000000' : ''}">{{visitorData.idcardTypeName ? visitorData.idcardTypeName : '璇烽�夋嫨'}}</text>
-					<u-icon name="arrow-right" color="#CCCCCC" size="20"></u-icon>
+					<u-icon name="arrow-right" color="#CCCCCC" size="16" class="ml6"></u-icon>
 				</view>
 			</view>
 			<view class="cell">
@@ -26,6 +26,7 @@
 					<input class="input" maxlength="18" placeholder-style="color: #999999;" v-model="visitorData.idcardNo" placeholder="璇疯緭鍏ユ偍鐨勮瘉浠跺彿鐮�" />
 				</view>
 			</view>
+			<view class="empty"></view>
 			<view class="cell">
 				<view class="title"><b>*</b>鍏徃鍚嶇О</view>
 				<view class="content">
@@ -40,7 +41,7 @@
 				</view>
 				<view class="content">
 					<view class="content_uplaod" @click="upload('faceImg')" v-if="!visitorData.faceImgUrl">
-						<u-icon name="plus" color="rgb(153, 153, 153)" size="28"></u-icon>
+						<u-icon name="plus" color="rgb(153, 153, 153)" size="20"></u-icon>
 					</view>
 					<view class="content_uplaod" @click="upload('faceImg')" v-else>
 						<image :src="visitorData.faceImgUrl" mode="widthFix"></image>
@@ -73,7 +74,8 @@
 	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 {
@@ -87,7 +89,7 @@
 					userAnswerId: '',
 					name: '',
 					phone: '',
-					idcardType: '0',
+					idcardType: 0,
 					idcardTypeName: '韬唤璇�',
 					idcardNo: '',
 					faceImg: '',
@@ -98,38 +100,37 @@
 				}
 			}
 		},
-		
-		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)
 			// })
@@ -137,6 +138,7 @@
 
 		methods: {
 			submit() {
+				const { visitorData } = this
 				if (!this.visitorData.name) return uni.showToast({
 					title: '濮撳悕涓嶈兘涓虹┖',
 					icon: 'none'
@@ -173,19 +175,20 @@
 					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 => {
@@ -199,7 +202,7 @@
 				that.$refs.cropper.close()
 				uni.showLoading({ title: '涓婁紶涓�', mask: true });
 				uni.uploadFile({
-					url: uploadUrl,
+					url: uploadAvatar,
 					filePath: file.tempFilePath,
 					name: 'file',
 					formData: {
@@ -235,7 +238,7 @@
 						if (type === 'imgurl') {
 							uni.showLoading({ title: '涓婁紶涓�', mask: true });
 							uni.uploadFile({
-								url: uploadUrl,
+								url: uploadAvatar,
 								filePath: chooseImageRes.tempFilePaths[0],
 								name: 'file',
 								formData: {
@@ -277,7 +280,9 @@
 	.content_uplaod {
 		width: 120rpx;
 		height: 120rpx;
-		background-color: #ececec;
+		background: #F7F7F7;
+		border-radius: 8rpx;
+		border: 2rpx solid #E5E5E5;
 		display: flex;
 		align-items: center;
 		justify-content: center;
@@ -287,6 +292,12 @@
 		width: 100%;
 		height: 100%;
 	}
+	.empty{
+		width: 750rpx;
+		height: 20rpx;
+		margin: 0 -30rpx;
+		background-color: #f7f7f7;;
+	}
 	.title {
 		font-size: 30rpx;
 		font-weight: 400;

--
Gitblit v1.9.3