fix(mini-program): ScriptView 模板闭合标签和 setupRecorder H5 兼容性

This commit is contained in:
2026-07-19 12:56:38 +08:00
parent 0190941df7
commit 1b566d574c
+8 -8
View File
@@ -296,13 +296,8 @@
</view>
<view class="chat-send-btn" :class="{ disabled: !chatInput.trim() || generating }" @click="sendChat">发送</view>
</view>
@blur="resultInputFocused = false"
@confirm="sendResultChat('text')"
/>
</view>
<view class="chat-send-btn" :class="{ disabled: !resultChatInput.trim() || resultChatting }" @click="sendResultChat('text')">发送</view>
</view>
</scroll-view>
</view>
</view>
</template>
@@ -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_'