|
@@ -31,7 +31,9 @@
|
|
|
</div>
|
|
|
|
|
|
<template v-if="resObj">
|
|
|
- <p class="notice" v-if="curQue.notice">{{ curQue.notice }}</p>
|
|
|
+ <p class="notice" v-if="curQue.notice">
|
|
|
+ {{ curQue.notice }}
|
|
|
+ </p>
|
|
|
<div class="NPC-sentences-list">
|
|
|
<div
|
|
|
:class="['NNPE-detail-box', sentIndex == index ? 'active' : '']"
|
|
@@ -40,21 +42,65 @@
|
|
|
>
|
|
|
<div
|
|
|
class="NNPE-detail"
|
|
|
- @click="handleChangeTime(curQue.wordTime[index].bg, index)"
|
|
|
+ @click="
|
|
|
+ handleChangeTime(
|
|
|
+ curQue.wordTime &&
|
|
|
+ curQue.wordTime[index] &&
|
|
|
+ curQue.wordTime[index].bg,
|
|
|
+ index
|
|
|
+ )
|
|
|
+ "
|
|
|
>
|
|
|
<template v-if="item.sentArr[0].sentIndex == 0">
|
|
|
<RoleChs
|
|
|
:curRole="item.roleDetail"
|
|
|
:color="
|
|
|
- (curTime >= curQue.wordTime[index].bg &&
|
|
|
+ (curQue.wordTime &&
|
|
|
+ curQue.wordTime[index] &&
|
|
|
+ curTime >= curQue.wordTime[index].bg &&
|
|
|
curTime <= curQue.wordTime[index].ed) ||
|
|
|
sentIndex == index
|
|
|
? 'rgba(0,0,0,0.85)'
|
|
|
: 'rgba(0,0,0,0.45)'
|
|
|
"
|
|
|
+ :type="1"
|
|
|
/>
|
|
|
</template>
|
|
|
+ <div v-else style="width: 36px; height: 36px"></div>
|
|
|
<div class="sentence-box">
|
|
|
+ <template v-if="item.sentArr[0].sentIndex == 0">
|
|
|
+ <div
|
|
|
+ class="roleDetail"
|
|
|
+ v-if="item.roleDetail.detail.wordsList.length > 0"
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ :class="[
|
|
|
+ 'pinyin',
|
|
|
+ (curQue.wordTime &&
|
|
|
+ curQue.wordTime[index] &&
|
|
|
+ curTime >= curQue.wordTime[index].bg &&
|
|
|
+ curTime <= curQue.wordTime[index].ed) ||
|
|
|
+ sentIndex == index
|
|
|
+ ? 'color85'
|
|
|
+ : 'color45',
|
|
|
+ ]"
|
|
|
+ >{{ item.roleDetail.detail.wordsList | handlePinyin }}</span
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ :class="[
|
|
|
+ 'chs',
|
|
|
+ (curQue.wordTime &&
|
|
|
+ curQue.wordTime[index] &&
|
|
|
+ curTime >= curQue.wordTime[index].bg &&
|
|
|
+ curTime <= curQue.wordTime[index].ed) ||
|
|
|
+ sentIndex == index
|
|
|
+ ? 'color85'
|
|
|
+ : 'color45',
|
|
|
+ ]"
|
|
|
+ >{{ item.roleDetail.detail.wordsList | handleChs }}</span
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<div
|
|
|
class="sentence-box-inner"
|
|
|
:style="{ background: item.roleDetail.color.bg }"
|
|
@@ -94,17 +140,16 @@
|
|
|
sentIndex == index ? 'wordBlank' : '',
|
|
|
]"
|
|
|
>
|
|
|
- <template
|
|
|
- v-if="
|
|
|
- pItem.timeList && pItem.timeList.length > 0
|
|
|
- "
|
|
|
- >
|
|
|
+ <template>
|
|
|
<span
|
|
|
v-for="(wItem, wIndex) in pItem.leg"
|
|
|
:key="'ci' + wIndex + pIndex + index"
|
|
|
:class="[
|
|
|
+ pItem.timeList &&
|
|
|
pItem.timeList[wIndex] &&
|
|
|
curTime >= pItem.timeList[wIndex].wordBg &&
|
|
|
+ curQue.wordTime &&
|
|
|
+ curQue.wordTime[index] &&
|
|
|
curTime <= curQue.wordTime[index].ed
|
|
|
? 'active'
|
|
|
: '',
|
|
@@ -144,6 +189,8 @@
|
|
|
pItem.timeList[pItem.leg - 1] &&
|
|
|
curTime >=
|
|
|
pItem.timeList[pItem.leg - 1].wordBg &&
|
|
|
+ curQue.wordTime &&
|
|
|
+ curQue.wordTime[index] &&
|
|
|
curTime <= curQue.wordTime[index].ed
|
|
|
? 'active'
|
|
|
: '',
|
|
@@ -167,22 +214,21 @@
|
|
|
</span>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
- <template
|
|
|
- v-if="
|
|
|
- curQue.pyPosition == 'top' ||
|
|
|
- NumberList.indexOf(pItem.pinyin) < 0
|
|
|
- "
|
|
|
- >
|
|
|
- <span
|
|
|
- v-if="isShowPY"
|
|
|
- class="NNPE-pinyin"
|
|
|
- :class="[
|
|
|
- pItem.padding ? 'padding' : '',
|
|
|
- pItem.className ? pItem.className : '',
|
|
|
- sentIndex == index ? 'wordBlank' : '',
|
|
|
- ]"
|
|
|
- >{{ pItem.pinyin }}</span
|
|
|
+ <template v-if="curQue.pyPosition == 'top'">
|
|
|
+ <template
|
|
|
+ v-if="NumberList.indexOf(pItem.pinyin) < 0"
|
|
|
>
|
|
|
+ <span
|
|
|
+ v-if="isShowPY"
|
|
|
+ class="NNPE-pinyin"
|
|
|
+ :class="[
|
|
|
+ pItem.padding ? 'padding' : '',
|
|
|
+ pItem.className ? pItem.className : '',
|
|
|
+ sentIndex == index ? 'wordBlank' : '',
|
|
|
+ ]"
|
|
|
+ >{{ pItem.pinyin }}</span
|
|
|
+ >
|
|
|
+ </template>
|
|
|
</template>
|
|
|
<span
|
|
|
v-if="pItem.chs != '#'"
|
|
@@ -192,15 +238,16 @@
|
|
|
sentIndex == index ? 'wordBlank' : '',
|
|
|
]"
|
|
|
>
|
|
|
- <template
|
|
|
- v-if="pItem.timeList && pItem.timeList.length > 0"
|
|
|
- >
|
|
|
+ <template>
|
|
|
<span
|
|
|
v-for="(wItem, wIndex) in pItem.leg"
|
|
|
:key="'ci' + wIndex + pIndex + index"
|
|
|
:class="[
|
|
|
+ pItem.timeList &&
|
|
|
pItem.timeList[wIndex] &&
|
|
|
curTime >= pItem.timeList[wIndex].wordBg &&
|
|
|
+ curQue.wordTime &&
|
|
|
+ curQue.wordTime[index] &&
|
|
|
curTime <= curQue.wordTime[index].ed
|
|
|
? 'active'
|
|
|
: '',
|
|
@@ -210,16 +257,20 @@
|
|
|
</template>
|
|
|
</span>
|
|
|
<template v-if="curQue.pyPosition == 'bottom'">
|
|
|
- <span
|
|
|
- v-if="isShowPY"
|
|
|
- class="NNPE-pinyin"
|
|
|
- :class="[
|
|
|
- pItem.padding ? 'padding' : '',
|
|
|
- pItem.className ? pItem.className : '',
|
|
|
- sentIndex == index ? 'wordBlank' : '',
|
|
|
- ]"
|
|
|
- >{{ pItem.pinyin }}</span
|
|
|
+ <template
|
|
|
+ v-if="NumberList.indexOf(pItem.pinyin) < 0"
|
|
|
>
|
|
|
+ <span
|
|
|
+ v-if="isShowPY"
|
|
|
+ class="NNPE-pinyin"
|
|
|
+ :class="[
|
|
|
+ pItem.padding ? 'padding' : '',
|
|
|
+ pItem.className ? pItem.className : '',
|
|
|
+ sentIndex == index ? 'wordBlank' : '',
|
|
|
+ ]"
|
|
|
+ >{{ pItem.pinyin }}</span
|
|
|
+ >
|
|
|
+ </template>
|
|
|
</template>
|
|
|
</template>
|
|
|
</template>
|
|
@@ -270,6 +321,30 @@ export default {
|
|
|
Soundrecord,
|
|
|
RoleChs,
|
|
|
},
|
|
|
+ filters: {
|
|
|
+ handlePinyin(wordsList) {
|
|
|
+ let str = "";
|
|
|
+ wordsList.forEach((item, index) => {
|
|
|
+ if (index < wordsList.length - 1) {
|
|
|
+ str += item.pinyin + " ";
|
|
|
+ } else {
|
|
|
+ str += item.pinyin;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return str;
|
|
|
+ },
|
|
|
+ handleChs(wordsList) {
|
|
|
+ let str = "";
|
|
|
+ wordsList.forEach((item, index) => {
|
|
|
+ if (index < wordsList.length - 1) {
|
|
|
+ str += item.chs + " ";
|
|
|
+ } else {
|
|
|
+ str += item.chs;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return str;
|
|
|
+ },
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
resObj: null,
|
|
@@ -386,7 +461,9 @@ export default {
|
|
|
|
|
|
timeArr.push(dItem.timeList);
|
|
|
});
|
|
|
- this.mergeWordTime(sentArrTotal, wordTimeList);
|
|
|
+ if (wordTimeList && wordTimeList.length > 0) {
|
|
|
+ this.mergeWordTime(sentArrTotal, wordTimeList);
|
|
|
+ }
|
|
|
let timeList = [];
|
|
|
timeArr.forEach((item) => {
|
|
|
item.forEach((aItem) => {
|
|
@@ -537,8 +614,10 @@ export default {
|
|
|
_this.currSent = _this.curQue.wordTime[index];
|
|
|
}
|
|
|
_this.sentIndex = index;
|
|
|
- _this.curTime = time;
|
|
|
- _this.$refs.audioLine.onTimeupdateTime(time / 1000);
|
|
|
+ if (time) {
|
|
|
+ _this.curTime = time;
|
|
|
+ _this.$refs.audioLine.onTimeupdateTime(time / 1000);
|
|
|
+ }
|
|
|
},
|
|
|
handleWav(data) {},
|
|
|
// 录音时暂停音频播放
|
|
@@ -582,8 +661,9 @@ export default {
|
|
|
//@import url(); 引入公共css类
|
|
|
.NNPE-ArticleView {
|
|
|
width: 100%;
|
|
|
+ padding-top: 24px;
|
|
|
.NPC-sentences-list {
|
|
|
- padding: 24px 0;
|
|
|
+ padding: 0px 0 24px 0;
|
|
|
}
|
|
|
.aduioLine-content {
|
|
|
flex: 1;
|
|
@@ -624,6 +704,9 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
.NNPE-detail {
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-start;
|
|
|
+ align-items: flex-start;
|
|
|
clear: both;
|
|
|
overflow: hidden;
|
|
|
width: 100%;
|
|
@@ -632,7 +715,7 @@ export default {
|
|
|
color: rgba(0, 0, 0, 0.45);
|
|
|
|
|
|
.sentence-box {
|
|
|
- padding-left: 36px;
|
|
|
+ padding-left: 8px;
|
|
|
clear: both;
|
|
|
overflow: hidden;
|
|
|
&-inner {
|
|
@@ -642,6 +725,31 @@ export default {
|
|
|
border: 1px solid rgba(0, 0, 0, 0.1);
|
|
|
float: left;
|
|
|
}
|
|
|
+ .roleDetail {
|
|
|
+ height: 36px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-start;
|
|
|
+ align-items: center;
|
|
|
+ .pinyin {
|
|
|
+ font-family: "GB-PINYINOK-B";
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 22px;
|
|
|
+ color: rgba(0, 0, 0, 0.85);
|
|
|
+ margin-right: 4px;
|
|
|
+ }
|
|
|
+ .chs {
|
|
|
+ font-family: "FZJCGFKTK";
|
|
|
+ font-size: 16px;
|
|
|
+ line-height: 24px;
|
|
|
+ color: rgba(0, 0, 0, 0.85);
|
|
|
+ }
|
|
|
+ .color85 {
|
|
|
+ color: rgba(0, 0, 0, 0.85);
|
|
|
+ }
|
|
|
+ .color45 {
|
|
|
+ color: rgba(0, 0, 0, 0.45);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
.NNPE-words {
|
|
|
float: left;
|