|
@@ -60,11 +60,11 @@
|
|
<el-tooltip
|
|
<el-tooltip
|
|
class="item"
|
|
class="item"
|
|
effect="light"
|
|
effect="light"
|
|
- content="暂停语音"
|
|
|
|
|
|
+ content="暂停"
|
|
placement="top"
|
|
placement="top"
|
|
- v-if="talkLoading"
|
|
|
|
|
|
+ v-if="canTalk"
|
|
>
|
|
>
|
|
- <span @click.stop="stopTalk">
|
|
|
|
|
|
+ <span @click.stop="canNotTalk">
|
|
<img :src="require('../../../assets/icon/course/stop1.png')" />
|
|
<img :src="require('../../../assets/icon/course/stop1.png')" />
|
|
<!-- <svg
|
|
<!-- <svg
|
|
@click.stop="recordStart"
|
|
@click.stop="recordStart"
|
|
@@ -87,11 +87,11 @@
|
|
<el-tooltip
|
|
<el-tooltip
|
|
class="item"
|
|
class="item"
|
|
effect="light"
|
|
effect="light"
|
|
- content="朗读"
|
|
|
|
|
|
+ content="开启"
|
|
placement="top"
|
|
placement="top"
|
|
v-else
|
|
v-else
|
|
>
|
|
>
|
|
- <span class="readAloud" @click.stop="talkAllText">
|
|
|
|
|
|
+ <span class="readAloud" @click.stop="canTalkFn">
|
|
<img :src="require('../../../assets/icon/course/start2.png')" />
|
|
<img :src="require('../../../assets/icon/course/start2.png')" />
|
|
<!-- <svg
|
|
<!-- <svg
|
|
t="1721117381559"
|
|
t="1721117381559"
|
|
@@ -190,7 +190,8 @@ export default {
|
|
talkLoading: false,
|
|
talkLoading: false,
|
|
source: null,
|
|
source: null,
|
|
talkTextList: [],
|
|
talkTextList: [],
|
|
- openMessage: true
|
|
|
|
|
|
+ openMessage: true,
|
|
|
|
+ canTalk:true,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -215,18 +216,18 @@ export default {
|
|
},
|
|
},
|
|
recordStart(_text) {
|
|
recordStart(_text) {
|
|
try {
|
|
try {
|
|
- let iiframe = this.$refs["iiframe"];
|
|
|
|
- iiframe.contentWindow.window.document.getElementById(
|
|
|
|
- "languageOptions"
|
|
|
|
- ).selectedIndex = 2; //普通话
|
|
|
|
- iiframe.contentWindow.testdoContinuousPronunciationAssessment();
|
|
|
|
|
|
+ // let iiframe = this.$refs["iiframe"];
|
|
|
|
+ // iiframe.contentWindow.window.document.getElementById(
|
|
|
|
+ // "languageOptions"
|
|
|
|
+ // ).selectedIndex = 2; //普通话
|
|
|
|
+ // iiframe.contentWindow.testdoContinuousPronunciationAssessment();
|
|
|
|
|
|
- // return
|
|
|
|
- var OpenCC = require("opencc-js");
|
|
|
|
- let converter = OpenCC.Converter({
|
|
|
|
- from: "hk",
|
|
|
|
- to: "cn"
|
|
|
|
- });
|
|
|
|
|
|
+ // // return
|
|
|
|
+ // var OpenCC = require("opencc-js");
|
|
|
|
+ // let converter = OpenCC.Converter({
|
|
|
|
+ // from: "hk",
|
|
|
|
+ // to: "cn"
|
|
|
|
+ // });
|
|
this.show = true;
|
|
this.show = true;
|
|
this.showIndex = 0;
|
|
this.showIndex = 0;
|
|
this.showTextIndex = 0;
|
|
this.showTextIndex = 0;
|
|
@@ -235,12 +236,14 @@ export default {
|
|
this.isOpen = true;
|
|
this.isOpen = true;
|
|
this.show = true;
|
|
this.show = true;
|
|
this.aiText = "我是可可同学,我是个小小百事通,你有什么想和我聊一聊?";
|
|
this.aiText = "我是可可同学,我是个小小百事通,你有什么想和我聊一聊?";
|
|
|
|
+ return;
|
|
iiframe.contentWindow.onRecognizedResult = e => {
|
|
iiframe.contentWindow.onRecognizedResult = e => {
|
|
let _msg = converter(e.privText);
|
|
let _msg = converter(e.privText);
|
|
|
|
|
|
console.log("👇");
|
|
console.log("👇");
|
|
console.log(_msg);
|
|
console.log(_msg);
|
|
// _msg = converter(_msg)
|
|
// _msg = converter(_msg)
|
|
|
|
+ if(!this.canTalk)return;
|
|
if (!_msg) return console.log("输出为空");
|
|
if (!_msg) return console.log("输出为空");
|
|
if (this.show == true) {
|
|
if (this.show == true) {
|
|
if (
|
|
if (
|
|
@@ -584,7 +587,24 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.stopTalk();
|
|
this.stopTalk();
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ canNotTalk(){
|
|
|
|
+ this.canTalk = false;
|
|
|
|
+ this.showIndex = 2;
|
|
|
|
+ this.chatLoading = false;
|
|
|
|
+ this.stopTalk();
|
|
|
|
+ if(this.source){
|
|
|
|
+ this.source.close();
|
|
|
|
+ this.source = null;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ canTalkFn(){
|
|
|
|
+ this.canTalk = true;
|
|
|
|
+ this.showIndex = 0;
|
|
|
|
+ this.showTextIndex = 0;
|
|
|
|
+ this.aiText = "我是可可同学,我是个小小百事通,你有什么想和我聊一聊";
|
|
|
|
+ this.chatLoading = false;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|