|
@@ -8,6 +8,7 @@
|
|
|
"
|
|
|
>
|
|
|
<AudioLine
|
|
|
+ audioId="artNormalAudio"
|
|
|
:mp3="curQue.mp3_list[0].id"
|
|
|
:getCurTime="getCurTime"
|
|
|
ref="audioLine"
|
|
@@ -70,18 +71,25 @@
|
|
|
pItem.sentIndex == sentIndex
|
|
|
? 'overActive'
|
|
|
: '',
|
|
|
- item.timeList &&
|
|
|
- item.timeList[pItem.sentIndex] &&
|
|
|
- curTime >=
|
|
|
- item.timeList[pItem.sentIndex].wordsResultList[
|
|
|
- pItem.wordIndex
|
|
|
- ].wordBg &&
|
|
|
- curTime <= item.timeList[pItem.sentIndex].ed
|
|
|
- ? 'wordActive'
|
|
|
- : '',
|
|
|
]"
|
|
|
- >{{ pItem.chs }}</span
|
|
|
>
|
|
|
+ <template>
|
|
|
+ <span
|
|
|
+ v-for="(wItem, wIndex) in pItem.leg"
|
|
|
+ :key="'ci' + wIndex + pIndex + index"
|
|
|
+ :class="[
|
|
|
+ isPlaying &&
|
|
|
+ pItem.chstimeList &&
|
|
|
+ pItem.chstimeList[wIndex] &&
|
|
|
+ curTime >= pItem.chstimeList[wIndex].wordBg &&
|
|
|
+ curTime < item.timeList[pItem.sentIndex].ed
|
|
|
+ ? 'wordActive'
|
|
|
+ : '',
|
|
|
+ ]"
|
|
|
+ >{{ pItem.chs[wIndex] }}</span
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </span>
|
|
|
<span
|
|
|
v-if="curQue.pyPosition == 'bottom'"
|
|
|
:class="[
|
|
@@ -109,6 +117,7 @@
|
|
|
class="NNPE-chs"
|
|
|
style="text-align: left"
|
|
|
:class="[
|
|
|
+ isPlaying &&
|
|
|
item.timeList &&
|
|
|
item.timeList[pItem.sentIndex] &&
|
|
|
curTime >= item.timeList[pItem.sentIndex].bg &&
|
|
@@ -119,11 +128,11 @@
|
|
|
pItem.sentIndex == sentIndex
|
|
|
? 'overActive'
|
|
|
: '',
|
|
|
- curTime >= item.timeList &&
|
|
|
- item.timeList[pItem.sentIndex] &&
|
|
|
- item.timeList[pItem.sentIndex].wordsResultList[
|
|
|
- pItem.wordIndex
|
|
|
- ].wordBg &&
|
|
|
+ pItem.chstimeList &&
|
|
|
+ pItem.chstimeList[pItem.leg - 1] &&
|
|
|
+ curTime >=
|
|
|
+ pItem.chstimeList[pItem.leg - 1].wordBg &&
|
|
|
+ curQue.wordTime &&
|
|
|
curTime <= item.timeList[pItem.sentIndex].ed
|
|
|
? 'wordActive'
|
|
|
: '',
|
|
@@ -169,17 +178,25 @@
|
|
|
pItem.sentIndex == sentIndex
|
|
|
? 'overActive'
|
|
|
: '',
|
|
|
- curTime >= item.timeList &&
|
|
|
- item.timeList[pItem.sentIndex] &&
|
|
|
- item.timeList[pItem.sentIndex].wordsResultList[
|
|
|
- pItem.wordIndex
|
|
|
- ].wordBg &&
|
|
|
- curTime <= item.timeList[pItem.sentIndex].ed
|
|
|
- ? 'wordActive'
|
|
|
- : '',
|
|
|
]"
|
|
|
- >{{ pItem.chs }}</span
|
|
|
>
|
|
|
+ <template>
|
|
|
+ <span
|
|
|
+ v-for="(wItem, wIndex) in pItem.leg"
|
|
|
+ :key="'ci' + wIndex + pIndex + index"
|
|
|
+ :class="[
|
|
|
+ isPlaying &&
|
|
|
+ pItem.chstimeList &&
|
|
|
+ pItem.chstimeList[wIndex] &&
|
|
|
+ curTime >= pItem.chstimeList[wIndex].wordBg &&
|
|
|
+ curTime < item.timeList[pItem.sentIndex].ed
|
|
|
+ ? 'wordActive'
|
|
|
+ : '',
|
|
|
+ ]"
|
|
|
+ >{{ pItem.chs[wIndex] }}</span
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </span>
|
|
|
<span
|
|
|
v-if="curQue.pyPosition == 'bottom'"
|
|
|
class="NNPE-pinyin"
|
|
@@ -216,7 +233,7 @@ import { timeStrToSen } from "@/utils/index";
|
|
|
import AudioLine from "../AudioLine.vue";
|
|
|
export default {
|
|
|
name: "NormalModelChs",
|
|
|
- props: ["curQue","noFont"],
|
|
|
+ props: ["curQue", "noFont"],
|
|
|
components: {
|
|
|
AudioLine,
|
|
|
},
|
|
@@ -227,7 +244,7 @@ export default {
|
|
|
chsFhList: [",", "。", "“", ":", "》", "《", "?", "!", ";"],
|
|
|
enFhList: [",", ".", ";", "?", "!", ":", ">", "<"],
|
|
|
newWords: ["鱼", "辩礼义"],
|
|
|
-
|
|
|
+
|
|
|
oldHz: "",
|
|
|
hz: "",
|
|
|
top: 0,
|
|
@@ -237,7 +254,12 @@ export default {
|
|
|
sentIndex: -1, // 句子索引
|
|
|
};
|
|
|
},
|
|
|
- computed: {},
|
|
|
+ computed: {
|
|
|
+ isPlaying: function () {
|
|
|
+ let playing = this.$refs.audioLine.audio.isPlaying;
|
|
|
+ return playing;
|
|
|
+ },
|
|
|
+ },
|
|
|
watch: {},
|
|
|
//方法集合
|
|
|
methods: {
|
|
@@ -246,8 +268,9 @@ export default {
|
|
|
},
|
|
|
handleData() {
|
|
|
let resArr = [];
|
|
|
- let leg = this.curQue.detail.length;
|
|
|
let curQue = JSON.parse(JSON.stringify(this.curQue));
|
|
|
+ let wordTimeList = curQue.wordTime;
|
|
|
+ let asIndex = 0;
|
|
|
curQue.detail.forEach((dItem, dIndex) => {
|
|
|
let paraArr = [
|
|
|
{
|
|
@@ -264,8 +287,17 @@ export default {
|
|
|
},
|
|
|
];
|
|
|
dItem.wordsList.forEach((sItem, sIndex) => {
|
|
|
+ let sentArr = [];
|
|
|
sItem.forEach((wItem, wIndex) => {
|
|
|
- //this.judgePad(sItem, wItem, wIndex);
|
|
|
+ let startIndex =
|
|
|
+ wIndex == 0
|
|
|
+ ? 0
|
|
|
+ : sentArr[wIndex - 1].startIndex +
|
|
|
+ sentArr[wIndex - 1].chs.length;
|
|
|
+ let endIndex =
|
|
|
+ wIndex == 0
|
|
|
+ ? wItem.chs.length
|
|
|
+ : sentArr[wIndex - 1].endIndex + wItem.chs.length;
|
|
|
this.mergeWordSymbol(wItem);
|
|
|
let obj = {
|
|
|
paraIndex: dIndex, //段落索引
|
|
@@ -278,8 +310,21 @@ export default {
|
|
|
className: wItem.className,
|
|
|
isShow: wItem.isShow,
|
|
|
isNewWord: this.newWords.indexOf(wItem.chs) > -1 ? true : false,
|
|
|
+ startIndex: startIndex,
|
|
|
+ endIndex: endIndex,
|
|
|
+ leg: wItem.chs.length,
|
|
|
};
|
|
|
+ if (wordTimeList && wordTimeList.length > 0) {
|
|
|
+ obj.chstimeList = wordTimeList[asIndex].wordsResultList.slice(
|
|
|
+ startIndex,
|
|
|
+ endIndex
|
|
|
+ );
|
|
|
+ }
|
|
|
+ sentArr.push(obj);
|
|
|
paraArr.push(obj);
|
|
|
+ if (wIndex == sItem.length - 1) {
|
|
|
+ asIndex++;
|
|
|
+ }
|
|
|
});
|
|
|
});
|
|
|
let curSentencesLeg = dItem.sentences.length;
|
|
@@ -414,15 +459,19 @@ export default {
|
|
|
font-size: 20px;
|
|
|
line-height: 28px;
|
|
|
color: #000000;
|
|
|
- &.active {
|
|
|
- background: rgba(222, 68, 68, 0.15);
|
|
|
- }
|
|
|
&.overActive {
|
|
|
background: rgba(0, 0, 0, 0.06);
|
|
|
}
|
|
|
+ &.active {
|
|
|
+ background: rgba(222, 68, 68, 0.15);
|
|
|
+ }
|
|
|
+
|
|
|
&.wordActive {
|
|
|
color: rgba(222, 68, 68, 1);
|
|
|
}
|
|
|
+ .wordActive {
|
|
|
+ color: rgba(222, 68, 68, 1);
|
|
|
+ }
|
|
|
}
|
|
|
&.padding {
|
|
|
padding: 0 3px;
|
|
@@ -456,15 +505,19 @@ export default {
|
|
|
font-size: 20px;
|
|
|
line-height: 28px;
|
|
|
color: #000000;
|
|
|
- &.active {
|
|
|
- background: rgba(222, 68, 68, 0.15);
|
|
|
- }
|
|
|
&.overActive {
|
|
|
background: rgba(0, 0, 0, 0.06);
|
|
|
}
|
|
|
+ &.active {
|
|
|
+ background: rgba(222, 68, 68, 0.15);
|
|
|
+ }
|
|
|
+
|
|
|
&.wordActive {
|
|
|
color: rgba(222, 68, 68, 1);
|
|
|
}
|
|
|
+ .wordActive {
|
|
|
+ color: rgba(222, 68, 68, 1);
|
|
|
+ }
|
|
|
}
|
|
|
&.padding {
|
|
|
padding: 0 3px;
|