|
@@ -51,7 +51,6 @@
|
|
|
src="https://beta.cloud.cocorobo.cn/browser/public/index1.html"
|
|
|
ref="iiframe2"
|
|
|
v-show="false"
|
|
|
- v-if="show"
|
|
|
></iframe>
|
|
|
|
|
|
<mini-audio
|
|
@@ -104,6 +103,11 @@ export default {
|
|
|
this.aiText = "";
|
|
|
this.userText = "";
|
|
|
this.stopRecord();
|
|
|
+ if(this.curRequestController){
|
|
|
+ this.curRequestController.abort();
|
|
|
+ console.log("请求已终止");
|
|
|
+ this.curRequestController = null;
|
|
|
+ }
|
|
|
},
|
|
|
stopOne(){
|
|
|
if(this.source){
|
|
@@ -112,12 +116,18 @@ export default {
|
|
|
}
|
|
|
if (this.talkLoading) {
|
|
|
this.stopTalk();
|
|
|
+ }
|
|
|
+ if(this.curRequestController){
|
|
|
+ this.curRequestController.abort();
|
|
|
+ console.log("请求已终止");
|
|
|
+ this.curRequestController = null;
|
|
|
}
|
|
|
this.showIndex = 0;
|
|
|
this.showTextIndex = 0;
|
|
|
this.aiText = "您好,我是小可,有什么可以帮助您的?";
|
|
|
this.aiStatus = 0;
|
|
|
this.chatLoading = false;
|
|
|
+
|
|
|
},
|
|
|
recordStart(_text) {
|
|
|
var OpenCC = require("opencc-js");
|
|
@@ -132,7 +142,7 @@ export default {
|
|
|
return this.$message.info("已开启语音助手,无需重复开启");
|
|
|
let iiframe = this.$refs["iiframe"];
|
|
|
iiframe.contentWindow.window.document.getElementById(
|
|
|
- "languageOptions"
|
|
|
+ "languageOptions"
|
|
|
).selectedIndex = 2; //普通话
|
|
|
iiframe.contentWindow.testdoContinuousPronunciationAssessment();
|
|
|
//this.talkTextList.push("我在");
|
|
@@ -153,7 +163,7 @@ export default {
|
|
|
iiframe.contentWindow.onRecognizedResult = e => {
|
|
|
let _msg = converter(e.privText);
|
|
|
// let _msg2 = e.privText;
|
|
|
- // let _msg = _text;
|
|
|
+ // let _msg = "你好呀!";
|
|
|
console.log("👇");
|
|
|
console.log(_msg);
|
|
|
// _msg = converter(_msg)
|
|
@@ -416,9 +426,6 @@ export default {
|
|
|
iiframe.contentWindow.window.document
|
|
|
.getElementById("scenarioStopButton")
|
|
|
.click();
|
|
|
- if (this.talkLoading) {
|
|
|
- this.$refs.iiframe2.contentWindow.closesynthesizer();
|
|
|
- }
|
|
|
// this.stopTalk();
|
|
|
// 录音借宿
|
|
|
iiframe.contentWindow.onSessionStopped = (s, e) => {
|
|
@@ -434,9 +441,17 @@ export default {
|
|
|
this.userText = "";
|
|
|
this.aiText = "";
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
} catch (error) {
|
|
|
+ console.log(error)
|
|
|
+ this.isOpen = false;
|
|
|
+ this.show = false;
|
|
|
+ this.showTextIndex = 3;
|
|
|
+ this.showIndex = 2;
|
|
|
this.$parent.changeRecordType(0);
|
|
|
+ this.$message.success("已关闭语音助手");
|
|
|
+ this.userText = "";
|
|
|
+ this.aiText = "";
|
|
|
}
|
|
|
|
|
|
},
|