|
@@ -1,20 +1,39 @@
|
|
|
<!-- -->
|
|
|
<template>
|
|
|
<div class="NNPE-ArticleView" v-if="curQue">
|
|
|
- <div
|
|
|
- class="aduioLine-box"
|
|
|
- v-if="
|
|
|
- curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].id
|
|
|
- "
|
|
|
- >
|
|
|
- <AudioLine
|
|
|
- audioId="artNormalAudio"
|
|
|
- :mp3="curQue.mp3_list[0].id"
|
|
|
- :getCurTime="getCurTime"
|
|
|
- :duration="curQue.mp3_list[0].media_duration"
|
|
|
- :mp3Source="curQue.mp3_list[0].source"
|
|
|
- ref="audioLine"
|
|
|
- />
|
|
|
+ <div class="aduioLine-box aduioLine-practice">
|
|
|
+ <div class="aduioLine-content">
|
|
|
+ <template
|
|
|
+ v-if="
|
|
|
+ curQue.mp3_list &&
|
|
|
+ curQue.mp3_list.length > 0 &&
|
|
|
+ curQue.mp3_list[0].id
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <AudioLine
|
|
|
+ audioId="artNormalAudio"
|
|
|
+ :mp3="curQue.mp3_list[0].id"
|
|
|
+ :getCurTime="getCurTime"
|
|
|
+ :duration="curQue.mp3_list[0].media_duration"
|
|
|
+ :mp3Source="curQue.mp3_list[0].source"
|
|
|
+ :width="590"
|
|
|
+ :ed="ed"
|
|
|
+ type="audioLine"
|
|
|
+ ref="audioLine"
|
|
|
+ @emptyEd="emptyEd"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ <div class="aduioLine-right">
|
|
|
+ <span
|
|
|
+ :class="['pinyin-16', config.isShowPY ? '' : 'disabled']"
|
|
|
+ @click="changePinyin"
|
|
|
+ ></span>
|
|
|
+ <span
|
|
|
+ :class="['EN-16', config.isShowEN ? '' : 'disabled']"
|
|
|
+ @click="changeEN"
|
|
|
+ ></span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<template v-if="resArr.length > 0">
|
|
|
<div class="NPC-sentences-list">
|
|
@@ -35,7 +54,10 @@
|
|
|
handleChangeTime(
|
|
|
item.timeList &&
|
|
|
item.timeList[pItem.sentIndex] &&
|
|
|
- item.timeList[pItem.sentIndex].bg
|
|
|
+ item.timeList[pItem.sentIndex].bg,
|
|
|
+ item.timeList &&
|
|
|
+ item.timeList[pItem.sentIndex] &&
|
|
|
+ item.timeList[pItem.sentIndex].ed
|
|
|
)
|
|
|
"
|
|
|
@mouseover="handleMouseover(pItem)"
|
|
@@ -52,7 +74,7 @@
|
|
|
>
|
|
|
<span class="NNPE-words-box">
|
|
|
<span
|
|
|
- v-if="curQue.pyPosition == 'top'"
|
|
|
+ v-if="curQue.pyPosition == 'top' && config.isShowPY"
|
|
|
:class="[
|
|
|
'NNPE-pinyin',
|
|
|
pItem.className ? pItem.className : '',
|
|
@@ -93,7 +115,9 @@
|
|
|
</template>
|
|
|
</span>
|
|
|
<span
|
|
|
- v-if="curQue.pyPosition == 'bottom'"
|
|
|
+ v-if="
|
|
|
+ curQue.pyPosition == 'bottom' && config.isShowPY
|
|
|
+ "
|
|
|
:class="[
|
|
|
'NNPE-pinyin',
|
|
|
pItem.className ? pItem.className : '',
|
|
@@ -104,7 +128,7 @@
|
|
|
</span>
|
|
|
<span class="NNPE-words-box">
|
|
|
<span
|
|
|
- v-if="curQue.pyPosition == 'top'"
|
|
|
+ v-if="curQue.pyPosition == 'top' && config.isShowPY"
|
|
|
:class="[
|
|
|
'NNPE-pinyin',
|
|
|
noFont.indexOf(item.wordsList[pIndex + 1].pinyin) >
|
|
@@ -142,7 +166,9 @@
|
|
|
>{{ item.wordsList[pIndex + 1].chs }}</span
|
|
|
>
|
|
|
<span
|
|
|
- v-if="curQue.pyPosition == 'bottom'"
|
|
|
+ v-if="
|
|
|
+ curQue.pyPosition == 'bottom' && config.isShowPY
|
|
|
+ "
|
|
|
:class="[
|
|
|
'NNPE-pinyin',
|
|
|
noFont.indexOf(item.wordsList[pIndex + 1].pinyin) >
|
|
@@ -157,7 +183,7 @@
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
<span
|
|
|
- v-if="curQue.pyPosition == 'top'"
|
|
|
+ v-if="curQue.pyPosition == 'top' && config.isShowPY"
|
|
|
class="NNPE-pinyin"
|
|
|
:class="[
|
|
|
pItem.padding ? 'padding' : '',
|
|
@@ -200,7 +226,7 @@
|
|
|
</template>
|
|
|
</span>
|
|
|
<span
|
|
|
- v-if="curQue.pyPosition == 'bottom'"
|
|
|
+ v-if="curQue.pyPosition == 'bottom' && config.isShowPY"
|
|
|
class="NNPE-pinyin"
|
|
|
:class="[
|
|
|
pItem.padding ? 'padding' : '',
|
|
@@ -235,7 +261,7 @@ import { timeStrToSen } from "@/utils/index";
|
|
|
import AudioLine from "../AudioLine.vue";
|
|
|
export default {
|
|
|
name: "NormalModelChs",
|
|
|
- props: ["curQue", "noFont"],
|
|
|
+ props: ["curQue", "noFont", "config"],
|
|
|
components: {
|
|
|
AudioLine,
|
|
|
},
|
|
@@ -254,6 +280,7 @@ export default {
|
|
|
articleImg: {}, // 文章图片
|
|
|
paraIndex: -1, //段落索引
|
|
|
sentIndex: -1, // 句子索引
|
|
|
+ ed: undefined,
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -268,6 +295,18 @@ export default {
|
|
|
watch: {},
|
|
|
//方法集合
|
|
|
methods: {
|
|
|
+ //拼音的显示和隐藏
|
|
|
+ changePinyin() {
|
|
|
+ if (this.config.isHasPY) {
|
|
|
+ this.$emit("changeConfig", "isShowPY");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 英文的显示和隐藏
|
|
|
+ changeEN() {
|
|
|
+ if (this.config.isHasEN) {
|
|
|
+ this.$emit("changeConfig", "isShowEN");
|
|
|
+ }
|
|
|
+ },
|
|
|
getCurTime(curTime) {
|
|
|
this.curTime = curTime * 1000;
|
|
|
},
|
|
@@ -390,12 +429,16 @@ export default {
|
|
|
return listRes;
|
|
|
},
|
|
|
//点击播放某个句子
|
|
|
- handleChangeTime(time) {
|
|
|
+ handleChangeTime(time, ed) {
|
|
|
if (time) {
|
|
|
this.curTime = time;
|
|
|
this.$refs.audioLine.onTimeupdateTime(time / 1000, true);
|
|
|
+ this.ed = ed;
|
|
|
}
|
|
|
},
|
|
|
+ emptyEd() {
|
|
|
+ this.ed = undefined;
|
|
|
+ },
|
|
|
//经过每个词,高亮句子
|
|
|
handleMouseover(pItem) {
|
|
|
this.paraIndex = pItem.paraIndex;
|
|
@@ -428,6 +471,29 @@ export default {
|
|
|
//@import url(); 引入公共css类
|
|
|
.NNPE-ArticleView {
|
|
|
width: 100%;
|
|
|
+ .aduioLine-practice {
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-start;
|
|
|
+ align-items: center;
|
|
|
+ .aduioLine-content {
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+ .aduioLine-right {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ width: 69px;
|
|
|
+ height: 40px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 0 12px;
|
|
|
+ border-left: 1px solid rgba(0, 0, 0, 0.1);
|
|
|
+ > span {
|
|
|
+ width: 16px;
|
|
|
+ height: 16px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
.NPC-sentences-list {
|
|
|
padding: 24px 0;
|
|
|
color: rgba(0, 0, 0, 0.85);
|
|
@@ -567,75 +633,75 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
.NPC-Big-Book-preview-green {
|
|
|
- .NNPE-ArticleView {
|
|
|
- .NNPE-detail {
|
|
|
- .NNPE-words {
|
|
|
- &-box {
|
|
|
- > span {
|
|
|
- &.NNPE-chs {
|
|
|
- &.active {
|
|
|
- background: rgba(36, 185, 158, 0.15);
|
|
|
- }
|
|
|
- &.wordActive {
|
|
|
- color: rgba(36, 185, 158, 1);
|
|
|
- }
|
|
|
- .wordActive {
|
|
|
- color: rgba(36, 185, 158, 1);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- > span {
|
|
|
- &.NNPE-chs {
|
|
|
- &.active {
|
|
|
- background: rgba(36, 185, 158, 0.15);
|
|
|
- }
|
|
|
- &.wordActive {
|
|
|
- color: rgba(36, 185, 158, 1);
|
|
|
- }
|
|
|
- .wordActive {
|
|
|
- color: rgba(36, 185, 158, 1);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ .NNPE-ArticleView {
|
|
|
+ .NNPE-detail {
|
|
|
+ .NNPE-words {
|
|
|
+ &-box {
|
|
|
+ > span {
|
|
|
+ &.NNPE-chs {
|
|
|
+ &.active {
|
|
|
+ background: rgba(36, 185, 158, 0.15);
|
|
|
+ }
|
|
|
+ &.wordActive {
|
|
|
+ color: rgba(36, 185, 158, 1);
|
|
|
+ }
|
|
|
+ .wordActive {
|
|
|
+ color: rgba(36, 185, 158, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ > span {
|
|
|
+ &.NNPE-chs {
|
|
|
+ &.active {
|
|
|
+ background: rgba(36, 185, 158, 0.15);
|
|
|
+ }
|
|
|
+ &.wordActive {
|
|
|
+ color: rgba(36, 185, 158, 1);
|
|
|
}
|
|
|
+ .wordActive {
|
|
|
+ color: rgba(36, 185, 158, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+ }
|
|
|
}
|
|
|
+ }
|
|
|
}
|
|
|
.NPC-Big-Book-preview-brown {
|
|
|
- .NNPE-ArticleView {
|
|
|
- .NNPE-detail {
|
|
|
- .NNPE-words {
|
|
|
- &-box {
|
|
|
- > span {
|
|
|
- &.NNPE-chs {
|
|
|
- &.active {
|
|
|
- background: rgba(189, 136, 101, 0.15);
|
|
|
- }
|
|
|
- &.wordActive {
|
|
|
- color: rgba(189, 136, 101, 1);
|
|
|
- }
|
|
|
- .wordActive {
|
|
|
- color: rgba(189, 136, 101, 1);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- > span {
|
|
|
- &.NNPE-chs {
|
|
|
- &.active {
|
|
|
- background: rgba(189, 136, 101, 0.15);
|
|
|
- }
|
|
|
- &.wordActive {
|
|
|
- color: rgba(189, 136, 101, 1);
|
|
|
- }
|
|
|
- .wordActive {
|
|
|
- color: rgba(189, 136, 101, 1);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ .NNPE-ArticleView {
|
|
|
+ .NNPE-detail {
|
|
|
+ .NNPE-words {
|
|
|
+ &-box {
|
|
|
+ > span {
|
|
|
+ &.NNPE-chs {
|
|
|
+ &.active {
|
|
|
+ background: rgba(189, 136, 101, 0.15);
|
|
|
+ }
|
|
|
+ &.wordActive {
|
|
|
+ color: rgba(189, 136, 101, 1);
|
|
|
+ }
|
|
|
+ .wordActive {
|
|
|
+ color: rgba(189, 136, 101, 1);
|
|
|
+ }
|
|
|
}
|
|
|
+ }
|
|
|
}
|
|
|
+ > span {
|
|
|
+ &.NNPE-chs {
|
|
|
+ &.active {
|
|
|
+ background: rgba(189, 136, 101, 0.15);
|
|
|
+ }
|
|
|
+ &.wordActive {
|
|
|
+ color: rgba(189, 136, 101, 1);
|
|
|
+ }
|
|
|
+ .wordActive {
|
|
|
+ color: rgba(189, 136, 101, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|