From 533507e4ae3cf220105d8b6a358685aec37d45d4 Mon Sep 17 00:00:00 2001 From: cc <94575594@qq.com> Date: Thu, 16 Apr 2026 15:57:21 +0800 Subject: [PATCH] =?UTF-8?q?refactor(speaking-evaluation):=20=E9=87=8D?= =?UTF-8?q?=E6=9E=84=E5=90=AC=E8=AF=BB=E8=AF=84=E6=B5=8B=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=BB=93=E6=9E=84=E4=B8=8E=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 重构了组件的脚本部分,优化状态管理与函数组织 - 统一管理TTS合成与播放逻辑,提升代码可维护性 - 优化ASR语音识别流程,增加错误处理和状态反馈 - 改进AI评测接口调用及结果解析逻辑,确保稳定性 - 清理录音和播放资源,防止内存泄漏 - 重新编排模板结构,提升交互体验和代码可读性 - 优化样式细节,增强界面一致性和响应式表现 --- src/views/SpeakingEvaluation.vue | 371 ++++++++++++++++++++++++++++++- 1 file changed, 359 insertions(+), 12 deletions(-) diff --git a/src/views/SpeakingEvaluation.vue b/src/views/SpeakingEvaluation.vue index 04e66c5..daf57da 100644 --- a/src/views/SpeakingEvaluation.vue +++ b/src/views/SpeakingEvaluation.vue @@ -1,5 +1,5 @@ @@ -638,11 +716,7 @@ onUnmounted(() => { error: asrStatus === 'error', }" :disabled="!currentWord || isEvaluating" - @mousedown="startRecording" - @mouseup="stopRecording" - @mouseleave="isRecording && stopRecording()" - @touchstart.prevent="startRecording" - @touchend.prevent="stopRecording" + @click="toggleRecording" >
@@ -656,7 +730,7 @@ onUnmounted(() => { d="M12 1a4 4 0 0 1 4 4v6a4 4 0 0 1-8 0V5a4 4 0 0 1 4-4zm0 2a2 2 0 0 0-2 2v6a2 2 0 0 0 4 0V5a2 2 0 0 0-2-2zm-1 14.93V20H9v2h6v-2h-2v-2.07A7.001 7.001 0 0 0 19 11h-2a5 5 0 0 1-10 0H5a7.001 7.001 0 0 0 6 6.93z" /> - 录音中... + 录音中 {{ recordingSeconds }}s 点击停止
+ +
+ 识别结果: + {{ recognizedText || interimText }} +
+
@@ -679,6 +762,26 @@ onUnmounted(() => {
+ +
+ 近期记录: +
+
+ {{ h.overallScore }} + {{ h.time }} +
+
+
+
@@ -688,17 +791,21 @@ onUnmounted(() => { cy="50" r="45" class="score-progress" + :class="scoreLevel.cls" :style="{ strokeDashoffset: 283 - (283 * evaluationResult.overallScore) / 100, }" > -
+
{{ evaluationResult.overallScore }}
综合评分
+
+ {{ scoreLevel.label }} +
@@ -726,6 +833,44 @@ onUnmounted(() => {
+ +
+

对比分析

+
+ 标准: +
+ {{ d.word }} +
+
+
+ 实际: +
+ {{ d.actual || '—' }} +
+
+
+