yangg 2 mesiacov pred
rodič
commit
bab016d442

+ 23 - 32
pages/camera/camera.vue

@@ -47,22 +47,9 @@
 					</view>
 
 					<view class="options">
-						<!-- 开放问题 (question_form: 0) - 显示文本输入框 -->
-							<!-- {{ currentQuestion }} -->
-						<view v-if="currentQuestion.questionType == 0" class="open-question-container">
-						
-							<textarea 
-								class="open-question-input" 
-								v-model="openQuestionAnswer" 
-								placeholder="请输入您的回答..."
-								maxlength="500"
-							></textarea>
-							<view class="word-count">{{openQuestionAnswer.length}}/500</view>
-						</view>
-						
-						<!-- 单选题和多选题 (question_form: 1 或 2) -->
+						<!-- 只渲染非开放问题 (questionType: 1 或 2) -->
 						<view 
-							v-else
+							v-if="currentQuestion.questionType !== 0"
 							v-for="(option, index) in currentQuestion.options" 
 							:key="index" 
 							class="option-item"
@@ -222,6 +209,7 @@
 					console.log(res);
 										// 使用第一个面试
 					this.interviewId = res//[0].id;
+					
 					this.fetchInterviewData(res);
 				} catch (error) {
 					console.error('获取面试列表失败:', error);
@@ -238,20 +226,22 @@
 					
 					// 如果返回的是问题列表
 					if (data && Array.isArray(data)) {
-						// 处理多个问题
-						this.questions =data.map((q, index) => ({
-							id: q.id || index + 1,
-							text: q.question || '未知问题',
-							options:q.options || [],
-							correctAnswer: q.correctAnswer || 0,
-							isImportant: q.is_system || false,
-							explanation: q.explanation || '',
-							questionType: q.question_form,
-							questionTypeName: q.question_form_name || '单选题',
-							correctAnswers: q.correct_answers || [],
-							difficulty: q.difficulty || 1,
-							difficultyName: q.difficulty_name || '初级'
-						}));
+						// 处理多个问题,并过滤掉 question_form 为 0 的问题
+						this.questions = data
+							.filter(q => q.question_form !== 0) // 过滤掉开放问题
+							.map((q, index) => ({
+								id: q.id || index + 1,
+								text: q.question || '未知问题',
+								options: q.options || [],
+								correctAnswer: q.correctAnswer || 0,
+								isImportant: q.is_system || false,
+								explanation: q.explanation || '',
+								questionType: q.question_form,
+								questionTypeName: q.question_form_name || '单选题',
+								correctAnswers: q.correct_answers || [],
+								difficulty: q.difficulty || 1,
+								difficultyName: q.difficulty_name || '初级'
+							}));
 					} else {
 						// 处理单个问题
 						this.processInterviewData(res);
@@ -278,7 +268,7 @@
 				this.questions = [];
 				
 				// 检查数据格式并处理
-				if (data) {
+				if (data && data.question_form !== 0) { // 只处理非开放问题
 					// 创建一个格式化的问题对象
 					const formattedQuestion = {
 						id: data.id || 1,
@@ -303,7 +293,7 @@
 					// 启动倒计时
 					this.startTimer();
 				} else {
-					this.handleLoadError('面试中没有问题');
+					this.handleLoadError('没有可用的选择题');
 				}
 			},
 			
@@ -521,7 +511,8 @@
 					}
 					
 					const submitData = {
-						application_id: uni.getStorageSync('appId'), // 或者使用其他合适的ID
+						job_id: JSON.parse(uni.getStorageSync('selectedJob')).id,
+						applicant_id: uni.getStorageSync('appId'), // 或者使用其他合适的ID
 						question_id: this.currentAnswer.questionId,
 						answer_content: answerContent,
 						answer_duration: this.currentAnswer.answerDuration || 0,

+ 22 - 25
unpackage/dist/dev/mp-weixin/pages/camera/camera.js

@@ -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]]);

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
unpackage/dist/dev/mp-weixin/pages/camera/camera.wxml


Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov