|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<div class="levitatedSphere" v-show="show">
|
|
<div class="levitatedSphere" v-show="show">
|
|
- <div class="ls_hello" v-if="showIndex == 0">
|
|
|
|
|
|
+ <div :class="['ls_hello']" v-show="showIndex == 0">
|
|
<el-image
|
|
<el-image
|
|
style="width: 100%; height: 100%"
|
|
style="width: 100%; height: 100%"
|
|
v-show="aiStatus == 1"
|
|
v-show="aiStatus == 1"
|
|
@@ -115,6 +115,8 @@ export default {
|
|
} else if (this.show == true) {
|
|
} else if (this.show == true) {
|
|
if (this.showTextIndex == 2 || this.chatLoading || this.talkLoading) {
|
|
if (this.showTextIndex == 2 || this.chatLoading || this.talkLoading) {
|
|
return console.log("组织语言中");
|
|
return console.log("组织语言中");
|
|
|
|
+ // }else if(_msg.indexOf('可可同学') && _msg.indexOf("停止")){
|
|
|
|
+ // this.stopTalk();
|
|
} else {
|
|
} else {
|
|
this.showTextIndex = 1;
|
|
this.showTextIndex = 1;
|
|
this.aiText = "";
|
|
this.aiText = "";
|
|
@@ -235,11 +237,13 @@ export default {
|
|
iiframe.contentWindow.window.document
|
|
iiframe.contentWindow.window.document
|
|
.getElementById("scenarioStopButton")
|
|
.getElementById("scenarioStopButton")
|
|
.click();
|
|
.click();
|
|
|
|
+ // this.stopTalk();
|
|
// 录音借宿
|
|
// 录音借宿
|
|
iiframe.contentWindow.onSessionStopped = (s, e) => {
|
|
iiframe.contentWindow.onSessionStopped = (s, e) => {
|
|
this.isOpen = false;
|
|
this.isOpen = false;
|
|
this.show = false;
|
|
this.show = false;
|
|
this.showTextIndex = 3;
|
|
this.showTextIndex = 3;
|
|
|
|
+ this.showIndex = 2;
|
|
this.$parent.changeRecordType(0);
|
|
this.$parent.changeRecordType(0);
|
|
this.$message.success("已关闭语音助手");
|
|
this.$message.success("已关闭语音助手");
|
|
if (this.talkLoading) {
|
|
if (this.talkLoading) {
|
|
@@ -388,15 +392,20 @@ export default {
|
|
clearTimeout(this.timer);
|
|
clearTimeout(this.timer);
|
|
this.timer = null;
|
|
this.timer = null;
|
|
}
|
|
}
|
|
- // console.log(`👉转语音:${_text}`);
|
|
|
|
|
|
+ console.log(`👉转语音:${_text}`);
|
|
|
|
+ if(this.talkTextList.length==0){
|
|
|
|
+ console.log("👉最后一个了,执行结束 👈")
|
|
|
|
+ _talkTextIiframe2.contentWindow.closesynthesizer();
|
|
|
|
+ }
|
|
// setTimeout(()=>{
|
|
// setTimeout(()=>{
|
|
// this.talkText();
|
|
// this.talkText();
|
|
// },2000)
|
|
// },2000)
|
|
- _talkTextIiframe2.contentWindow.texttospeech(_text, this.talkText);
|
|
|
|
- } else {
|
|
|
|
- console.log("👉转语音结束👈");
|
|
|
|
- _talkTextIiframe2.contentWindow.closesynthesizer();
|
|
|
|
- this.talkLoading = false;
|
|
|
|
|
|
+ _talkTextIiframe2.contentWindow.texttospeech(_text, this.talkText,this.endTalk);
|
|
|
|
+ }
|
|
|
|
+ // else {
|
|
|
|
+ // console.log("👉转语音结束👈");
|
|
|
|
+ // _talkTextIiframe2.contentWindow.closesynthesizer();
|
|
|
|
+ // this.talkLoading = false;
|
|
// this.timer = setTimeout(() => {
|
|
// this.timer = setTimeout(() => {
|
|
// this.showTextIndex = 3;
|
|
// this.showTextIndex = 3;
|
|
// this.aiStatus = 2;
|
|
// this.aiStatus = 2;
|
|
@@ -404,8 +413,23 @@ export default {
|
|
// this.userText = "";
|
|
// this.userText = "";
|
|
// this.time = null;
|
|
// this.time = null;
|
|
// }, 5000);
|
|
// }, 5000);
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ // }
|
|
|
|
+ },
|
|
|
|
+ endTalk(){
|
|
|
|
+ console.log("👉转语音结束👈");
|
|
|
|
+ // let _talkTextIiframe2 = this.$refs.iiframe2;
|
|
|
|
+ // _talkTextIiframe2.contentWindow.closesynthesizer();
|
|
|
|
+ this.talkLoading = false;
|
|
|
|
+ },
|
|
|
|
+ stopTalk(){
|
|
|
|
+ this.talkTextList = [];
|
|
|
|
+ let _talkTextIiframe2 = this.$refs.iiframe2;
|
|
|
|
+ _talkTextIiframe2.contentWindow.closesynthesizer();
|
|
|
|
+ this.talkLoading = false;
|
|
|
|
+ // this.talkLoading = false;
|
|
|
|
+ // let _talkTextIiframe2 = this.$refs.iiframe2;
|
|
|
|
+ // _talkTextIiframe2.contentWindow.closesynthesizer();
|
|
|
|
+ },
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
// // this.recordStart()
|
|
// // this.recordStart()
|
|
@@ -417,7 +441,7 @@ export default {
|
|
// this.recordStart("位于哪里。他温度怎么样。")
|
|
// this.recordStart("位于哪里。他温度怎么样。")
|
|
// },2000)
|
|
// },2000)
|
|
// },2000)
|
|
// },2000)
|
|
- // },2000)
|
|
|
|
|
|
+ // },5000)
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
@@ -439,6 +463,19 @@ export default {
|
|
position: absolute;
|
|
position: absolute;
|
|
top: 0;
|
|
top: 0;
|
|
right: 0;
|
|
right: 0;
|
|
|
|
+ animation: smallToBig 1s both;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/* 定义渐入动画 */
|
|
|
|
+@keyframes smallToBig {
|
|
|
|
+ from {
|
|
|
|
+ opacity: 0;
|
|
|
|
+ transform: scale(0.1);
|
|
|
|
+ }
|
|
|
|
+ to {
|
|
|
|
+ opacity: 1;
|
|
|
|
+ transform: scale(1);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
.ls_text {
|
|
.ls_text {
|