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;