ux: 无有效语音时友好提示
onStop 时: - 识别文字 >=2 字: 自动发送 (正常流程) - 识别文字 =1 字: toast '语音过短,请重试' - 无识别文字: toast '未检测到语音,请重试'
This commit is contained in:
@@ -184,6 +184,10 @@ function initRecorder() {
|
||||
if (text && text.length >= 2) {
|
||||
inputText.value = text
|
||||
sendAnswer()
|
||||
} else if (text && text.length === 1) {
|
||||
uni.showToast({ title: '语音过短,请重试', icon: 'none' })
|
||||
} else if (!text) {
|
||||
uni.showToast({ title: '未检测到语音,请重试', icon: 'none' })
|
||||
}
|
||||
}
|
||||
manager.onError = (res) => {
|
||||
|
||||
Reference in New Issue
Block a user