|
|
@@ -152,21 +152,21 @@
|
|
|
<el-button
|
|
|
@click="startRecording"
|
|
|
class="start-button"
|
|
|
- :disabled="!isHomeworkStarted || isHomeworkSubmitted || hasStartPlay"
|
|
|
+ :disabled="!isHomeworkStarted || isHomeworkSubmitted || hasStartPlay || isLoading"
|
|
|
>
|
|
|
{{ hasStopRecording ? "继续" : "开始" }}
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
@click="stopRecording"
|
|
|
class="stop-button"
|
|
|
- :disabled="!isHomeworkStarted || isHomeworkSubmitted || hasStartPlay"
|
|
|
+ :disabled="!isHomeworkStarted || isHomeworkSubmitted || hasStartPlay || isLoading"
|
|
|
>
|
|
|
暂停
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
@click="resetRecording"
|
|
|
class="reset-button"
|
|
|
- :disabled="!isHomeworkStarted || isHomeworkSubmitted"
|
|
|
+ :disabled="!isHomeworkStarted || isHomeworkSubmitted || isLoading"
|
|
|
>
|
|
|
重试
|
|
|
</el-button>
|
|
|
@@ -425,7 +425,7 @@ const stopRecording = async() => {
|
|
|
|
|
|
console.log("识别结果:", resultText.value);
|
|
|
// 只有当有识别结果时才追加
|
|
|
- if (resultText.value && resultText.value.trim() !== '') {
|
|
|
+ if (resultText.value) {
|
|
|
userInput.value += resultText.value;
|
|
|
ElMessage.success("语音识别完成");
|
|
|
} else {
|
|
|
@@ -606,6 +606,9 @@ const autoPlay = (message) => {
|
|
|
};
|
|
|
|
|
|
const playAudio = (message) => {
|
|
|
+ if(isLoading.value) {
|
|
|
+ ElMessage.warning('正在发送中,无法处理语音');
|
|
|
+ }
|
|
|
if (message.audioUrl) {
|
|
|
if (message.isPlaying) {
|
|
|
// 如果正在播放,则暂停
|