|
@@ -90,7 +90,7 @@ const _sfc_main = {
|
|
|
try {
|
|
|
this.loading = true;
|
|
|
if (data && Array.isArray(data)) {
|
|
|
- this.questions = data.map((q, index) => ({
|
|
|
+ this.questions = data.filter((q) => q.question_form !== 0).map((q, index) => ({
|
|
|
id: q.id || index + 1,
|
|
|
text: q.question || "未知问题",
|
|
|
options: q.options || [],
|
|
@@ -121,7 +121,7 @@ const _sfc_main = {
|
|
|
// 处理面试数据
|
|
|
processInterviewData(data) {
|
|
|
this.questions = [];
|
|
|
- if (data) {
|
|
|
+ if (data && data.question_form !== 0) {
|
|
|
const formattedQuestion = {
|
|
|
id: data.id || 1,
|
|
|
text: data.question || "未知问题",
|
|
@@ -140,7 +140,7 @@ const _sfc_main = {
|
|
|
this.totalQuestions = this.questions.length;
|
|
|
this.startTimer();
|
|
|
} else {
|
|
|
- this.handleLoadError("面试中没有问题");
|
|
|
+ this.handleLoadError("没有可用的选择题");
|
|
|
}
|
|
|
},
|
|
|
// 处理加载错误
|
|
@@ -306,7 +306,8 @@ const _sfc_main = {
|
|
|
answerContent = selectedOptionIds.join(",");
|
|
|
}
|
|
|
const submitData = {
|
|
|
- application_id: common_vendor.index.getStorageSync("appId"),
|
|
|
+ job_id: JSON.parse(common_vendor.index.getStorageSync("selectedJob")).id,
|
|
|
+ applicant_id: common_vendor.index.getStorageSync("appId"),
|
|
|
// 或者使用其他合适的ID
|
|
|
question_id: this.currentAnswer.questionId,
|
|
|
answer_content: answerContent,
|
|
@@ -509,13 +510,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
}, $options.currentQuestion.isImportant ? {} : {}, {
|
|
|
g: common_vendor.t($options.currentQuestion.questionTypeName),
|
|
|
h: common_vendor.t($options.currentQuestion.text),
|
|
|
- i: $options.currentQuestion.questionType == 0
|
|
|
- }, $options.currentQuestion.questionType == 0 ? {
|
|
|
- j: $data.openQuestionAnswer,
|
|
|
- k: common_vendor.o(($event) => $data.openQuestionAnswer = $event.detail.value),
|
|
|
- l: common_vendor.t($data.openQuestionAnswer.length)
|
|
|
- } : {
|
|
|
- m: common_vendor.f($options.currentQuestion.options, (option, index, i0) => {
|
|
|
+ i: $options.currentQuestion.questionType !== 0
|
|
|
+ }, $options.currentQuestion.questionType !== 0 ? {
|
|
|
+ j: common_vendor.f($options.currentQuestion.options, (option, index, i0) => {
|
|
|
return {
|
|
|
a: common_vendor.t(option.option_text || (typeof option === "string" ? option : JSON.stringify(option))),
|
|
|
b: index,
|
|
@@ -525,32 +522,32 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
f: common_vendor.o(($event) => $options.selectOption(index), index)
|
|
|
};
|
|
|
}),
|
|
|
- n: common_vendor.t($options.currentQuestion.questionType === 1 ? "●" : "☐")
|
|
|
- }, {
|
|
|
- o: common_vendor.t($data.showResult ? "下一题" : "提交答案"),
|
|
|
- p: common_vendor.o(($event) => $options.nextQuestion(_ctx.option)),
|
|
|
- q: $options.currentQuestion.questionType === 0 && $data.openQuestionAnswer.trim() === "" || $options.currentQuestion.questionType === 1 && $data.selectedOption === null || $options.currentQuestion.questionType === 2 && $data.selectedOptions.length === 0,
|
|
|
- r: $data.showEndModal
|
|
|
+ k: common_vendor.t($options.currentQuestion.questionType === 1 ? "●" : "☐")
|
|
|
+ } : {}, {
|
|
|
+ l: common_vendor.t($data.showResult ? "下一题" : "提交答案"),
|
|
|
+ m: common_vendor.o(($event) => $options.nextQuestion(_ctx.option)),
|
|
|
+ n: $options.currentQuestion.questionType === 0 && $data.openQuestionAnswer.trim() === "" || $options.currentQuestion.questionType === 1 && $data.selectedOption === null || $options.currentQuestion.questionType === 2 && $data.selectedOptions.length === 0,
|
|
|
+ o: $data.showEndModal
|
|
|
}, $data.showEndModal ? {
|
|
|
- s: common_vendor.o((...args) => $options.navigateToInterview && $options.navigateToInterview(...args))
|
|
|
+ p: common_vendor.o((...args) => $options.navigateToInterview && $options.navigateToInterview(...args))
|
|
|
} : {}, {
|
|
|
- t: $data.interviewCompleted
|
|
|
+ q: $data.interviewCompleted
|
|
|
}, $data.interviewCompleted ? {
|
|
|
- v: common_assets._imports_0,
|
|
|
- w: common_vendor.o((...args) => $options.back && $options.back(...args))
|
|
|
+ r: common_assets._imports_0,
|
|
|
+ s: common_vendor.o((...args) => $options.back && $options.back(...args))
|
|
|
} : {}, {
|
|
|
- x: $data.loading
|
|
|
+ t: $data.loading
|
|
|
}, $data.loading ? {
|
|
|
- y: common_vendor.p({
|
|
|
+ v: common_vendor.p({
|
|
|
status: "loading",
|
|
|
contentText: {
|
|
|
contentdown: "加载中..."
|
|
|
}
|
|
|
})
|
|
|
} : {}, {
|
|
|
- z: !$data.loading && $data.loadError
|
|
|
+ w: !$data.loading && $data.loadError
|
|
|
}, !$data.loading && $data.loadError ? {
|
|
|
- A: common_vendor.o((...args) => $options.fetchInterviewData && $options.fetchInterviewData(...args))
|
|
|
+ x: common_vendor.o((...args) => $options.fetchInterviewData && $options.fetchInterviewData(...args))
|
|
|
} : {});
|
|
|
}
|
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|