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