yangg 3 days ago
parent
commit
882fff4058

+ 55 - 1
pages/identity-verify/identity-verify.vue

@@ -351,6 +351,8 @@ export default {
       originalQuestionSubtitle: null, // 保存原始字幕信息
       isThinking: false, // 面试官思考中状态
       thinkingTimer: null, // 思考计时器
+      questionRetryMap: {}, // 用于跟踪每个问题的重试次数
+      maxQuestionRetries: 2, // 每个问题最大重试次数
     }
   },
   mounted() {
@@ -3686,12 +3688,64 @@ export default {
           }
         });
       }
+      
+      // 重置问题重试次数映射
+      this.questionRetryMap = {};
     },
 
-    // 修改 playLowScoreVideo 方法,优化字幕显示
+    // 修改 playLowScoreVideo 方法,优化字幕显示并添加重试次数限制
     playLowScoreVideo() {
       console.log('播放低分提示视频');
       
+      // 获取当前问题的重试次数
+      const currentQuestionId = this.getCurrentQuestionByIndex(this.currentVideoIndex)?.id;
+      if (!currentQuestionId) {
+        console.error('无法获取当前问题ID');
+        return;
+      }
+      
+      // 初始化或增加重试次数
+      if (!this.questionRetryMap[currentQuestionId]) {
+        this.questionRetryMap[currentQuestionId] = 1;
+      } else {
+        this.questionRetryMap[currentQuestionId]++;
+      }
+      
+      // 检查是否超过最大重试次数
+      if (this.questionRetryMap[currentQuestionId] > this.maxQuestionRetries) {
+        console.log(`问题 ${currentQuestionId} 已超过最大重试次数,自动进入下一题`);
+        // 重置低分视频状态
+        this.isPlayingLowScoreVideo = false;
+        // 重置追问相关状态
+        this.isFollowUpQuestion = false;
+        this.currentFollowUpQuestion = null;
+        this.followUpQuestion = '';
+        this.parentQuestion = '';
+        // 增加视频索引,进入下一题
+        this.currentVideoIndex++;
+        // 检查是否还有下一题
+        if (this.currentVideoIndex < this.videoList.length) {
+          // 获取下一题的字幕
+          const nextQuestion = this.getCurrentQuestionByIndex(this.currentVideoIndex);
+          if (nextQuestion) {
+            this.currentSubtitle = nextQuestion.digital_human_video_subtitle || nextQuestion.question;
+          }
+          // 播放下一题的视频
+          this.videoUrl = this.videoList[this.currentVideoIndex];
+          this.videoPlaying = true;
+          this.$nextTick(() => {
+            const videoContext = uni.createVideoContext('myVideo', this);
+            if (videoContext) {
+              videoContext.play();
+            }
+          });
+        } else {
+          // 如果没有下一题,结束面试
+          this.finishInterview();
+        }
+        return;
+      }
+      
       // 标记正在播放低分提示视频
       this.isPlayingLowScoreVideo = true;
       

+ 44 - 2
unpackage/dist/dev/mp-weixin/pages/identity-verify/identity-verify.js

@@ -227,8 +227,12 @@ const _sfc_main = {
       // 保存原始字幕信息
       isThinking: false,
       // 面试官思考中状态
-      thinkingTimer: null
+      thinkingTimer: null,
       // 思考计时器
+      questionRetryMap: {},
+      // 用于跟踪每个问题的重试次数
+      maxQuestionRetries: 2
+      // 每个问题最大重试次数
     };
   },
   mounted() {
@@ -2603,10 +2607,48 @@ const _sfc_main = {
           }
         });
       }
+      this.questionRetryMap = {};
     },
-    // 修改 playLowScoreVideo 方法,优化字幕显示
+    // 修改 playLowScoreVideo 方法,优化字幕显示并添加重试次数限制
     playLowScoreVideo() {
+      var _a;
       console.log("播放低分提示视频");
+      const currentQuestionId = (_a = this.getCurrentQuestionByIndex(this.currentVideoIndex)) == null ? void 0 : _a.id;
+      if (!currentQuestionId) {
+        console.error("无法获取当前问题ID");
+        return;
+      }
+      if (!this.questionRetryMap[currentQuestionId]) {
+        this.questionRetryMap[currentQuestionId] = 1;
+      } else {
+        this.questionRetryMap[currentQuestionId]++;
+      }
+      if (this.questionRetryMap[currentQuestionId] > this.maxQuestionRetries) {
+        console.log(`问题 ${currentQuestionId} 已超过最大重试次数,自动进入下一题`);
+        this.isPlayingLowScoreVideo = false;
+        this.isFollowUpQuestion = false;
+        this.currentFollowUpQuestion = null;
+        this.followUpQuestion = "";
+        this.parentQuestion = "";
+        this.currentVideoIndex++;
+        if (this.currentVideoIndex < this.videoList.length) {
+          const nextQuestion = this.getCurrentQuestionByIndex(this.currentVideoIndex);
+          if (nextQuestion) {
+            this.currentSubtitle = nextQuestion.digital_human_video_subtitle || nextQuestion.question;
+          }
+          this.videoUrl = this.videoList[this.currentVideoIndex];
+          this.videoPlaying = true;
+          this.$nextTick(() => {
+            const videoContext = common_vendor.index.createVideoContext("myVideo", this);
+            if (videoContext) {
+              videoContext.play();
+            }
+          });
+        } else {
+          this.finishInterview();
+        }
+        return;
+      }
       this.isPlayingLowScoreVideo = true;
       this.showStartRecordingButton = false;
       this.showStopRecordingButton = false;

+ 1 - 1
unpackage/dist/dev/mp-weixin/project.config.json

@@ -8,7 +8,7 @@
     "urlCheck": false,
     "es6": true,
     "postcss": false,
-    "minified": false,
+    "minified": true,
     "newFeature": true,
     "bigPackageSizeSupport": true,
     "babelSetting": {