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