yangg 2 сар өмнө
parent
commit
c51652f397

+ 10 - 14
pages/camera/camera.vue

@@ -69,7 +69,9 @@
 								:key="index" 
 								:key="index" 
 								class="option-item"
 								class="option-item"
 								:class="{
 								:class="{
-									'option-selected': currentQuestion.questionType === 1 || currentQuestion.questionType === 3 ? selectedOption === index : selectedOptions.includes(index),	
+									'option-selected': currentQuestion.questionType === 1 || currentQuestion.questionType === 3 ? selectedOption === index : selectedOptions.includes(index),
+									
+									
 								}" 
 								}" 
 								@click="selectOption(index)">
 								@click="selectOption(index)">
 								<!-- 使用字母标识 A、B、C、D、E 等 -->
 								<!-- 使用字母标识 A、B、C、D、E 等 -->
@@ -225,7 +227,7 @@
 			async fetchInterviewList() {
 			async fetchInterviewList() {
 				try {
 				try {
 					this.loading = true;
 					this.loading = true;
-					const res = await getInterviewList({job_id:JSON.parse(uni.getStorageSync('selectedJob')).id});
+					const res = await getInterviewList({job_id:JSON.parse(uni.getStorageSync('selectedJob')).id,page:1,limit:999});
 					console.log(res);
 					console.log(res);
 										// 使用第一个面试
 										// 使用第一个面试
 					this.interviewId = res//[0].id;
 					this.interviewId = res//[0].id;
@@ -547,39 +549,33 @@
 					
 					
 					// 构建提交数据
 					// 构建提交数据
 					let answerContent = '';
 					let answerContent = '';
-					let answerOptions = [];
 					
 					
 					if (this.currentAnswer.questionType === 0) {
 					if (this.currentAnswer.questionType === 0) {
 						// 开放题直接使用文本答案
 						// 开放题直接使用文本答案
 						answerContent = this.currentAnswer.answer;
 						answerContent = this.currentAnswer.answer;
-						answerOptions = []; // 开放题没有选项
 					} else if (this.currentAnswer.questionType === 1 || this.currentAnswer.questionType === 3) {
 					} else if (this.currentAnswer.questionType === 1 || this.currentAnswer.questionType === 3) {
 						// 单选题或看图答题,获取选项ID而不是索引
 						// 单选题或看图答题,获取选项ID而不是索引
 						const selectedIndex = this.currentAnswer.answer;
 						const selectedIndex = this.currentAnswer.answer;
 						const selectedOption = this.currentQuestion.options[selectedIndex];
 						const selectedOption = this.currentQuestion.options[selectedIndex];
-						console.log('selectedOption', selectedOption);
+						console.log('selectedOption',selectedOption);
 						// 使用选项的ID或其他唯一标识符
 						// 使用选项的ID或其他唯一标识符
-						const optionId = selectedOption.id ? selectedOption.id : selectedIndex;
-						answerContent = optionId.toString();
-						answerOptions = [optionId]; // 单选题,将选项ID放入数组
+						answerContent = selectedOption.id ? selectedOption.id.toString() : selectedIndex.toString();
 					} else if (this.currentAnswer.questionType === 2) {
 					} else if (this.currentAnswer.questionType === 2) {
-						// 多选题,将选项ID数组转为数组格式
+						// 多选题,将选项ID数组转为逗号分隔的字符串
 						const selectedIndices = this.currentAnswer.answer;
 						const selectedIndices = this.currentAnswer.answer;
 						const selectedOptionIds = selectedIndices.map(index => {
 						const selectedOptionIds = selectedIndices.map(index => {
 							const option = this.currentQuestion.options[index];
 							const option = this.currentQuestion.options[index];
 							// 使用选项的ID或其他唯一标识符
 							// 使用选项的ID或其他唯一标识符
 							return option.id ? option.id : index;
 							return option.id ? option.id : index;
 						});
 						});
-						answerContent = selectedOptionIds.join(','); // 保持原有的逗号分隔字符串格式
-						answerOptions = selectedOptionIds; // 多选题,直接使用选项ID数组
+						answerContent = selectedOptionIds.join(',');
 					}
 					}
 					
 					
 					const submitData = {
 					const submitData = {
 						job_id: JSON.parse(uni.getStorageSync('selectedJob')).id,
 						job_id: JSON.parse(uni.getStorageSync('selectedJob')).id,
 						applicant_id: JSON.parse(uni.getStorageSync('userInfo')).id,
 						applicant_id: JSON.parse(uni.getStorageSync('userInfo')).id,
-						job_position_question_id: this.currentAnswer.questionId,
-						// answer_content: answerContent,
-						answer_options: answerOptions, // 使用数组格式
+						question_id: this.currentAnswer.questionId,
+						answer_content: answerContent,
 						answer_duration: this.currentAnswer.answerDuration || 0,
 						answer_duration: this.currentAnswer.answerDuration || 0,
 						tenant_id: 1
 						tenant_id: 1
 					};
 					};

+ 4 - 11
unpackage/dist/dev/mp-weixin/pages/camera/camera.js

@@ -78,7 +78,7 @@ const _sfc_main = {
     async fetchInterviewList() {
     async fetchInterviewList() {
       try {
       try {
         this.loading = true;
         this.loading = true;
-        const res2 = await api_user.getInterviewList({ job_id: JSON.parse(common_vendor.index.getStorageSync("selectedJob")).id });
+        const res2 = await api_user.getInterviewList({ job_id: JSON.parse(common_vendor.index.getStorageSync("selectedJob")).id, page: 1, limit: 999 });
         console.log(res2);
         console.log(res2);
         this.interviewId = res2;
         this.interviewId = res2;
         this.fetchInterviewData(res2);
         this.fetchInterviewData(res2);
@@ -320,17 +320,13 @@ const _sfc_main = {
           title: "正在提交答案..."
           title: "正在提交答案..."
         });
         });
         let answerContent = "";
         let answerContent = "";
-        let answerOptions = [];
         if (this.currentAnswer.questionType === 0) {
         if (this.currentAnswer.questionType === 0) {
           answerContent = this.currentAnswer.answer;
           answerContent = this.currentAnswer.answer;
-          answerOptions = [];
         } else if (this.currentAnswer.questionType === 1 || this.currentAnswer.questionType === 3) {
         } else if (this.currentAnswer.questionType === 1 || this.currentAnswer.questionType === 3) {
           const selectedIndex = this.currentAnswer.answer;
           const selectedIndex = this.currentAnswer.answer;
           const selectedOption = this.currentQuestion.options[selectedIndex];
           const selectedOption = this.currentQuestion.options[selectedIndex];
           console.log("selectedOption", selectedOption);
           console.log("selectedOption", selectedOption);
-          const optionId = selectedOption.id ? selectedOption.id : selectedIndex;
-          answerContent = optionId.toString();
-          answerOptions = [optionId];
+          answerContent = selectedOption.id ? selectedOption.id.toString() : selectedIndex.toString();
         } else if (this.currentAnswer.questionType === 2) {
         } else if (this.currentAnswer.questionType === 2) {
           const selectedIndices = this.currentAnswer.answer;
           const selectedIndices = this.currentAnswer.answer;
           const selectedOptionIds = selectedIndices.map((index) => {
           const selectedOptionIds = selectedIndices.map((index) => {
@@ -338,15 +334,12 @@ const _sfc_main = {
             return option.id ? option.id : index;
             return option.id ? option.id : index;
           });
           });
           answerContent = selectedOptionIds.join(",");
           answerContent = selectedOptionIds.join(",");
-          answerOptions = selectedOptionIds;
         }
         }
         const submitData = {
         const submitData = {
           job_id: JSON.parse(common_vendor.index.getStorageSync("selectedJob")).id,
           job_id: JSON.parse(common_vendor.index.getStorageSync("selectedJob")).id,
           applicant_id: JSON.parse(common_vendor.index.getStorageSync("userInfo")).id,
           applicant_id: JSON.parse(common_vendor.index.getStorageSync("userInfo")).id,
-          job_position_question_id: this.currentAnswer.questionId,
-          // answer_content: answerContent,
-          answer_options: answerOptions,
-          // 使用数组格式
+          question_id: this.currentAnswer.questionId,
+          answer_content: answerContent,
           answer_duration: this.currentAnswer.answerDuration || 0,
           answer_duration: this.currentAnswer.answerDuration || 0,
           tenant_id: 1
           tenant_id: 1
         };
         };