|
@@ -50,13 +50,13 @@
|
|
<span
|
|
<span
|
|
:class="[
|
|
:class="[
|
|
'NPC-play-btn',
|
|
'NPC-play-btn',
|
|
- mp3_index == index ? 'active' : '',
|
|
|
|
|
|
+ mp3_index == sItem.sIndex ? 'active' : '',
|
|
]"
|
|
]"
|
|
- @click="palyAudio(item.new_word, index)"
|
|
|
|
|
|
+ @click="palyAudio(sItem.new_word, sItem.sIndex)"
|
|
></span>
|
|
></span>
|
|
<audio
|
|
<audio
|
|
:id="sItem.new_word"
|
|
:id="sItem.new_word"
|
|
- :src="sItem.mp3_list[0].url"
|
|
|
|
|
|
+ :src="sItem.mp3_list[0].id"
|
|
></audio>
|
|
></audio>
|
|
</template>
|
|
</template>
|
|
<template v-else>
|
|
<template v-else>
|
|
@@ -140,12 +140,12 @@ export default {
|
|
//方法集合
|
|
//方法集合
|
|
methods: {
|
|
methods: {
|
|
handleChange(val) {},
|
|
handleChange(val) {},
|
|
- palyAudio(new_word, index) {
|
|
|
|
|
|
+ palyAudio(new_word, sIndex) {
|
|
let _this = this;
|
|
let _this = this;
|
|
let node = document.getElementById(new_word);
|
|
let node = document.getElementById(new_word);
|
|
_this.playWord = node;
|
|
_this.playWord = node;
|
|
if (node) {
|
|
if (node) {
|
|
- this.mp3_index = index;
|
|
|
|
|
|
+ this.mp3_index = sIndex;
|
|
node.play();
|
|
node.play();
|
|
}
|
|
}
|
|
this.handleListenPlay();
|
|
this.handleListenPlay();
|
|
@@ -238,16 +238,16 @@ export default {
|
|
let _this = this;
|
|
let _this = this;
|
|
let mp3_index = 0;
|
|
let mp3_index = 0;
|
|
_this.mp3_index = mp3_index;
|
|
_this.mp3_index = mp3_index;
|
|
- let leg = this.curQue.option.length;
|
|
|
|
- let mp3 = this.curQue.option[mp3_index].mp3_list[0].url;
|
|
|
|
|
|
+ let leg = this.optionRes.length;
|
|
|
|
+ let mp3 = this.optionRes[mp3_index].mp3_list[0].id;
|
|
_this.handlePlayVoice(mp3);
|
|
_this.handlePlayVoice(mp3);
|
|
_this.audio.addEventListener("ended", function () {
|
|
_this.audio.addEventListener("ended", function () {
|
|
if (mp3_index < leg - 1) {
|
|
if (mp3_index < leg - 1) {
|
|
mp3_index = mp3_index + 1;
|
|
mp3_index = mp3_index + 1;
|
|
_this.mp3_index = mp3_index;
|
|
_this.mp3_index = mp3_index;
|
|
mp3 =
|
|
mp3 =
|
|
- _this.curQue.option[mp3_index].mp3_list.length > 0 &&
|
|
|
|
- _this.curQue.option[mp3_index].mp3_list[0].url;
|
|
|
|
|
|
+ _this.optionRes[mp3_index].mp3_list.length > 0 &&
|
|
|
|
+ _this.optionRes[mp3_index].mp3_list[0].id;
|
|
if (mp3) {
|
|
if (mp3) {
|
|
_this.handlePlayVoice(mp3);
|
|
_this.handlePlayVoice(mp3);
|
|
}
|
|
}
|
|
@@ -280,13 +280,14 @@ export default {
|
|
console.log(this.curQue);
|
|
console.log(this.curQue);
|
|
|
|
|
|
if (this.curQue.type == "NewWord_chs") {
|
|
if (this.curQue.type == "NewWord_chs") {
|
|
|
|
+ let resIndex = 0;
|
|
let optionRes = [];
|
|
let optionRes = [];
|
|
this.curQue.option.forEach((item, index) => {
|
|
this.curQue.option.forEach((item, index) => {
|
|
optionRes = optionRes.concat(item);
|
|
optionRes = optionRes.concat(item);
|
|
item.index = index + 1;
|
|
item.index = index + 1;
|
|
item.forEach((sItem, sIndex) => {
|
|
item.forEach((sItem, sIndex) => {
|
|
- sItem.sIndex =
|
|
|
|
- index == 0 ? sIndex : sIndex + this.curQue.option[index - 1].length;
|
|
|
|
|
|
+ sItem.sIndex = resIndex;
|
|
|
|
+ resIndex++;
|
|
sItem.def_str =
|
|
sItem.def_str =
|
|
sItem.definition_list.length > 0
|
|
sItem.definition_list.length > 0
|
|
? sItem.definition_list.join(";")
|
|
? sItem.definition_list.join(";")
|
|
@@ -294,6 +295,8 @@ export default {
|
|
});
|
|
});
|
|
});
|
|
});
|
|
this.optionRes = JSON.parse(JSON.stringify(optionRes));
|
|
this.optionRes = JSON.parse(JSON.stringify(optionRes));
|
|
|
|
+ console.log("======console.log(this.optionRes);");
|
|
|
|
+ console.log(this.optionRes);
|
|
}
|
|
}
|
|
console.log(this.curQue);
|
|
console.log(this.curQue);
|
|
},
|
|
},
|
|
@@ -515,4 +518,18 @@ export default {
|
|
padding: 4px 0;
|
|
padding: 4px 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+.NNPE-Big-Book-preview-green {
|
|
|
|
+ .NPC-zhedie {
|
|
|
|
+ .el-collapse-item__header {
|
|
|
|
+ background: #24b99e !important;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+.NNPE-Big-Book-preview-brown {
|
|
|
|
+ .NPC-zhedie {
|
|
|
|
+ .el-collapse-item__header {
|
|
|
|
+ background: #bd8865 !important;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
</style>
|
|
</style>
|