From 300d75d257dbe60401dfb97123ae39e32f37380e Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期三, 28 二月 2024 18:28:39 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 h5/pages/userinfo/userinfo.vue |   41 ++++++++++++++++++++++++++++++++++++-----
 1 files changed, 36 insertions(+), 5 deletions(-)

diff --git a/h5/pages/userinfo/userinfo.vue b/h5/pages/userinfo/userinfo.vue
index ae9cb78..0c56d64 100644
--- a/h5/pages/userinfo/userinfo.vue
+++ b/h5/pages/userinfo/userinfo.vue
@@ -73,6 +73,7 @@
 			return {
 				show: false,
 				visit: '',
+				type: '',
 				columns: [[{name: '韬唤璇�', id: 0}, {name: '娓境璇佷欢', id: 1},{name: '鎶ょ収', id: 2}]],
 				fileList: [],
 				visitorData: {
@@ -93,6 +94,9 @@
 		onLoad(option) {
 			this.visitorData.userAnswerId = option.userAnswerId
 			this.getVisit()
+			uni.$on('update', (data) => {
+				this.uploadImg(data.tempFilePath)
+			})
 		},
 
 		methods: {
@@ -150,14 +154,41 @@
 					}
 				})
 			},
+			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({

--
Gitblit v1.9.3