From 1b566d574c927fea0860c7bd8a44e661b14d7ed0 Mon Sep 17 00:00:00 2001 From: Peanut Date: Sun, 19 Jul 2026 12:56:38 +0800 Subject: [PATCH] =?UTF-8?q?fix(mini-program):=20ScriptView=20=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E9=97=AD=E5=90=88=E6=A0=87=E7=AD=BE=E5=92=8C=20setupR?= =?UTF-8?q?ecorder=20H5=20=E5=85=BC=E5=AE=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mini-program/src/pages/main/ScriptView.vue | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mini-program/src/pages/main/ScriptView.vue b/mini-program/src/pages/main/ScriptView.vue index c34b59c..c90e9ba 100644 --- a/mini-program/src/pages/main/ScriptView.vue +++ b/mini-program/src/pages/main/ScriptView.vue @@ -296,13 +296,8 @@ 发送 - - @blur="resultInputFocused = false" - @confirm="sendResultChat('text')" - /> - - 发送 + @@ -1209,8 +1204,10 @@ const handleVoiceRecognizeFail = (reason, message = '语音识别失败,请重 const setupRecorder = () => { if (!uni.getRecorderManager) return - recorderManager = uni.getRecorderManager() - recorderManager.onStop(async (res) => { + try { + recorderManager = uni.getRecorderManager() + if (!recorderManager) return + recorderManager.onStop(async (res) => { if (recordCancelled) { voiceState.value = 'idle' return @@ -1236,6 +1233,9 @@ const setupRecorder = () => { recorderManager.onError((error) => { handleVoiceRecognizeFail(error?.errMsg || 'recorder_error', '录音失败,请检查麦克风权限') }) + } catch { + recorderManager = null + } } const SCRIPT_CHAT_HISTORY_PREFIX = 'script_conversation_history_'