修改语音掉线

This commit is contained in:
田岩
2025-09-17 22:30:31 +08:00
parent 1f27e0ebf5
commit 0d708632ea
6 changed files with 44 additions and 23 deletions
+9 -8
View File
@@ -190,10 +190,9 @@
papersId: '', // 试卷ID
limitTm: 0, // 考试限制时间
papersName: '', // 试卷名称
isCacheExam: '' ,// 是否是缓存试卷(继续答题试卷)
flagQuery: '' ,
flagQueryDetail: '' ,
isCacheExam: '', // 是否是缓存试卷(继续答题试卷)
flagQuery: '',
flagQueryDetail: ''
}); // 试卷信息
const topicList = reactive([]); // 问题列表
const popup_input_bottom = ref('0px');
@@ -304,6 +303,7 @@
const topic = topicList[questionNumber.value];
touchBtnRef.value?.clearinputText(); // 清除发送框数据
if (type === 'voice') {
if(topic.es_status == '00') return;
topic.es_status = '00'; // 00转圈
const voicePath = submitObj;
commonUploadVoiceFile(voicePath, '/traask/traAskchat/voiceTrans', {})
@@ -326,9 +326,11 @@
}
}
})
.catch((err) => {
.catch((error) => {
topic.es_status = ''; // 取消转圈
common.msg('系统异常,请联系管理员');
if (error === 'Other') {
common.msg('系统异常,请联系管理员');
}
});
} else if (type === 'text') {
topic.es_status = '01';
@@ -339,14 +341,13 @@
}
};
const answerCacheList = ref({});
const setAnswerCacheList = (value) => {
console.log('触发变化', value);
answerCacheList.value = value;
common.setValue(examinationAnswerCacheKey, value);
};
// 添加试题答案缓存
const addTopicAnswerCache = () => {
const my_answer = topic.value.my_answer;
+5 -2
View File
@@ -306,6 +306,7 @@
const topic = topicList[questionNumber.value]
touchBtnRef.value?.clearinputText(); // 清除发送框数据
if (type === 'voice') {
if(topic.es_status == '00') return;
topic.es_status = '00'; // 00转圈
const voicePath = submitObj;
commonUploadVoiceFile(voicePath, '/traask/traAskchat/voiceTrans', {})
@@ -327,9 +328,11 @@
}
}
})
.catch((err) => {
.catch((error) => {
topic.es_status = ''; // 取消转圈
common.msg('系统异常,请联系管理员');
if (error === 'Other') {
common.msg('系统异常,请联系管理员');
}
});
} else if (type === 'text') {
topic.es_status = '01';
+10 -2
View File
@@ -287,18 +287,24 @@
const touchBtnSubmit = (type, submitObj) => {
const topic = topicList[questionNumber.value];
touchBtnRef.value?.clearinputText(); // 清除发送框数据
console.log('录音组件提交');
if (type === 'voice') {
if(topic.es_status == '00') return;
topic.es_status = '00'; // 00转圈
const voicePath = submitObj;
commonUploadVoiceFile(voicePath, '/traask/traAskchat/voiceTrans', {})
.then((res) => {
console.log('_contentsssss', res);
let _res = JSON.parse(res.data);
if (_res.rtnCode === '0000') {
const _content = _res.body.transContent.trim();
console.log('_content', _content);
if (_content === '') {
topic.es_status = ''; // 取消转圈
console.log('未识别到文字');
return common.msg('未识别到文字');
} else {
console.log('识别到了文字', _content);
topic.es_status = '02';
topic.my_answer = {
anserResult: _res.body.transContent,
@@ -309,9 +315,11 @@
}
}
})
.catch((err) => {
.catch((error) => {
topic.es_status = ''; // 取消转圈
common.msg('系统异常,请联系管理员');
if (error === 'Other') {
common.msg('系统异常,请联系管理员');
}
});
} else if (type === 'text') {
topic.es_status = '01';