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_'