yangg 2 ヶ月 前
コミット
0cdb194098

+ 1 - 1
pages/face-photo/face-photo.vue

@@ -285,7 +285,7 @@ export default {
       uni.uploadFile({
         url: `${apiBaseUrl}/job/upload_posture_photo`,
         filePath: this.mediaSource,
-        name: 'photo_file',  // 确保文件参数名称正确
+        name: 'photo',  // 确保文件参数名称正确
         formData: {  // 使用formData传递参数
           'application_id': uni.getStorageSync('appId'),
           'tenant_id': tenant_id,

+ 23 - 4
pages/index/index.vue

@@ -103,7 +103,13 @@ import { apiBaseUrl } from '@/common/config.js';
 				isNameValid: false,
 				isIdCardValid: false,
 				genderOptions: ['男', '女'],
-				genderIndex: 0
+				genderIndex: 0,
+				genderMapping: {
+					'男': '1',
+					'女': '2',
+					'1': '男',
+					'2': '女'
+				}
 			}
 		},
 		onLoad() {
@@ -206,7 +212,17 @@ import { apiBaseUrl } from '@/common/config.js';
 							if (!userData.name || !userData.phone) {
 								this.userInfoFilled = true;
 								this.formData.name = userData.name || '';
-								this.formData.gender = userData.gender || '';
+								
+								if (userData.gender) {
+									this.formData.gender = this.genderMapping[userData.gender] || userData.gender;
+									const index = this.genderOptions.findIndex(item => item === this.formData.gender);
+									if (index !== -1) {
+										this.genderIndex = index;
+									}
+								} else {
+									this.formData.gender = '';
+								}
+								
 								this.formData.phone = userData.phone || '';
 								this.formData.idCard = userData.id_card || '';
 								this.formData.emergencyContact = userData.emergency_contact || '';
@@ -427,6 +443,8 @@ import { apiBaseUrl } from '@/common/config.js';
 				});
 			},
 			submitUserInfo() {
+				const genderValue = this.genderMapping[this.formData.gender] || this.formData.gender;
+				
 				const submitData = {
 					openid: JSON.parse(uni.getStorageSync('userInfo') || '{}').openid || '',
 					name: this.formData.name,
@@ -441,7 +459,7 @@ import { apiBaseUrl } from '@/common/config.js';
 					relation: this.formData.relation, */
 					age: '20',
 					job_id: this.selectedJobId,
-					gender: this.formData.gender
+					gender: genderValue
 				};
 
 				fillUserInfo(submitData)
@@ -505,7 +523,8 @@ import { apiBaseUrl } from '@/common/config.js';
 			},
 			genderChange(e) {
 				this.genderIndex = e.detail.value;
-				this.formData.gender = this.genderOptions[this.genderIndex];
+				const displayGender = this.genderOptions[this.genderIndex];
+				this.formData.gender = displayGender;
 			}
 		}
 	}

+ 2 - 2
pages/interview/interview.vue

@@ -267,7 +267,7 @@ import { apiBaseUrl } from '@/common/config.js'; // Import the base URL from a c
 					
 					const formData = new FormData();
 					// 确保文件参数名称正确
-					formData.append('photo_file', blob, `${type}.jpg`);
+					formData.append('photo', blob, `${type}.jpg`);
 					formData.append('application_id', uni.getStorageSync('appId'));
 					formData.append('tenant_id', tenant_id);
 					formData.append('description', `手部照片-${type}`);
@@ -320,7 +320,7 @@ import { apiBaseUrl } from '@/common/config.js'; // Import the base URL from a c
 					uni.uploadFile({
 						url: `${apiBaseUrl}/job/upload_posture_photo`,
 						filePath: filePathOrData,
-						name: 'photo_file',  // 确保文件参数名称正确
+						name: 'photo',  // 确保文件参数名称正确
 						formData: {  // 使用formData替代data以确保参数正确传递
 							'application_id': uni.getStorageSync('appId'),
 							'tenant_id': tenant_id,

+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/face-photo/face-photo.js

@@ -215,7 +215,7 @@ const _sfc_main = {
       common_vendor.index.uploadFile({
         url: `${common_config.apiBaseUrl}/job/upload_posture_photo`,
         filePath: this.mediaSource,
-        name: "photo_file",
+        name: "photo",
         // 确保文件参数名称正确
         formData: {
           // 使用formData传递参数

+ 20 - 4
unpackage/dist/dev/mp-weixin/pages/index/index.js

@@ -26,7 +26,13 @@ const _sfc_main = {
       isNameValid: false,
       isIdCardValid: false,
       genderOptions: ["男", "女"],
-      genderIndex: 0
+      genderIndex: 0,
+      genderMapping: {
+        "男": "1",
+        "女": "2",
+        "1": "男",
+        "2": "女"
+      }
     };
   },
   onLoad() {
@@ -107,7 +113,15 @@ const _sfc_main = {
           if (!userData.name || !userData.phone) {
             this.userInfoFilled = true;
             this.formData.name = userData.name || "";
-            this.formData.gender = userData.gender || "";
+            if (userData.gender) {
+              this.formData.gender = this.genderMapping[userData.gender] || userData.gender;
+              const index = this.genderOptions.findIndex((item) => item === this.formData.gender);
+              if (index !== -1) {
+                this.genderIndex = index;
+              }
+            } else {
+              this.formData.gender = "";
+            }
             this.formData.phone = userData.phone || "";
             this.formData.idCard = userData.id_card || "";
             this.formData.emergencyContact = userData.emergency_contact || "";
@@ -304,6 +318,7 @@ const _sfc_main = {
       });
     },
     submitUserInfo() {
+      const genderValue = this.genderMapping[this.formData.gender] || this.formData.gender;
       const submitData = {
         openid: JSON.parse(common_vendor.index.getStorageSync("userInfo") || "{}").openid || "",
         name: this.formData.name,
@@ -318,7 +333,7 @@ const _sfc_main = {
         relation: this.formData.relation, */
         age: "20",
         job_id: this.selectedJobId,
-        gender: this.formData.gender
+        gender: genderValue
       };
       api_user.fillUserInfo(submitData).then((res) => {
         common_vendor.index.hideLoading();
@@ -372,7 +387,8 @@ const _sfc_main = {
     },
     genderChange(e) {
       this.genderIndex = e.detail.value;
-      this.formData.gender = this.genderOptions[this.genderIndex];
+      const displayGender = this.genderOptions[this.genderIndex];
+      this.formData.gender = displayGender;
     }
   }
 };

+ 2 - 2
unpackage/dist/dev/mp-weixin/pages/interview/interview.js

@@ -131,7 +131,7 @@ const _sfc_main = {
         const base64Data = filePathOrData.split(",")[1];
         const blob = this.base64ToBlob(base64Data, "image/jpeg");
         const formData = new FormData();
-        formData.append("photo_file", blob, `${type}.jpg`);
+        formData.append("photo", blob, `${type}.jpg`);
         formData.append("application_id", common_vendor.index.getStorageSync("appId"));
         formData.append("tenant_id", tenant_id);
         formData.append("description", `手部照片-${type}`);
@@ -173,7 +173,7 @@ const _sfc_main = {
         common_vendor.index.uploadFile({
           url: `${common_config.apiBaseUrl}/job/upload_posture_photo`,
           filePath: filePathOrData,
-          name: "photo_file",
+          name: "photo",
           // 确保文件参数名称正确
           formData: {
             // 使用formData替代data以确保参数正确传递