From 617351d0dd74549db8b0faa68c1491c7531789c7 Mon Sep 17 00:00:00 2001 From: zhangyh Date: Mon, 20 Oct 2025 11:24:11 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20=E8=AF=AD=E9=9F=B3=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E5=8A=A8=E7=94=BB=E9=87=8D=E5=A4=8D=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/icons/pause.svg | 1 + .../asistant/components/AudioVisualizer.vue | 32 ++----------------- src/views/asistant/components/InputArea.vue | 15 ++++----- 3 files changed, 10 insertions(+), 38 deletions(-) create mode 100644 src/assets/icons/pause.svg diff --git a/src/assets/icons/pause.svg b/src/assets/icons/pause.svg new file mode 100644 index 0000000..50ae47b --- /dev/null +++ b/src/assets/icons/pause.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/views/asistant/components/AudioVisualizer.vue b/src/views/asistant/components/AudioVisualizer.vue index f983c8a..101596e 100644 --- a/src/views/asistant/components/AudioVisualizer.vue +++ b/src/views/asistant/components/AudioVisualizer.vue @@ -13,7 +13,7 @@ @@ -170,7 +143,6 @@ onUnmounted(() => { justify-content: center; align-items: center; padding: 20px; - min-height: 200px; border-radius: 10px; } diff --git a/src/views/asistant/components/InputArea.vue b/src/views/asistant/components/InputArea.vue index b341d4b..331045d 100644 --- a/src/views/asistant/components/InputArea.vue +++ b/src/views/asistant/components/InputArea.vue @@ -13,7 +13,8 @@
- + +
@@ -97,12 +98,12 @@ const handleInput = (): void => { if (textareaRef.value) { textareaRef.value.style.height = 'auto' - // const lineHeight = 4.8 + // const lineHeight = 4.8 // const maxLines = 3 // const maxHeight = lineHeight * maxLines const scrollHeight = textareaRef.value.scrollHeight - // const newHeight = Math.min(scrollHeight, maxHeight * 10) + // const newHeight = Math.min(scrollHeight, maxHeight * 10) textareaRef.value.style.height = `${scrollHeight}px` } @@ -138,9 +139,6 @@ const handleClickAudio = async (): Promise => { audioVisualizerRef.value.updateLines?.() } }, 50) - } - - if (isRecording.value) { startRecording() } else { stopRecording() @@ -174,7 +172,7 @@ const startRecording = () => { } // 识别结果 - speechRecognition.onresult = (event) => { + speechRecognition.onresult = (event: any) => { let finalTranscript = '' let interimTranscript = '' @@ -213,7 +211,7 @@ const startRecording = () => { } // 识别错误 - speechRecognition.onerror = (event) => { + speechRecognition.onerror = (event: any) => { console.error('语音识别错误:', event.error) isRecording.value = false // alert('语音识别失败,请重试') @@ -273,6 +271,7 @@ const stopRecording = () => { align-items: center; justify-content: center; cursor: pointer; + color: #6d6868; &.send-icon { margin-left: 4.38rem;