|
|
@@ -1,32 +1,32 @@
|
|
|
<!-- -->
|
|
|
<template>
|
|
|
- <div class="NNPE-ArticleView" v-if="curQue">
|
|
|
+ <div v-if="curQue" class="NNPE-ArticleView">
|
|
|
<!-- <a class="ArticleView-full" @click="fullScreen">黑板模式</a> -->
|
|
|
<div
|
|
|
- class="aduioLine-box aduioLine-practice-npc"
|
|
|
v-if="
|
|
|
((curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].url) ||
|
|
|
config.isHasPY ||
|
|
|
config.isHasEN) &&
|
|
|
curQue.property.mp3_position === 'top'
|
|
|
"
|
|
|
+ class="aduioLine-box aduioLine-practice-npc"
|
|
|
>
|
|
|
<div class="aduioLine-content">
|
|
|
<template v-if="curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].url">
|
|
|
<AudioLine
|
|
|
- audioId="diaPraAudio"
|
|
|
- :mp3="curQue.mp3_list[0].url"
|
|
|
- :getCurTime="getCurTime"
|
|
|
ref="audioLine"
|
|
|
- :stopAudio="stopAudio"
|
|
|
+ audio-id="diaPraAudio"
|
|
|
+ :mp3="curQue.mp3_list[0].url"
|
|
|
+ :get-cur-time="getCurTime"
|
|
|
+ :stop-audio="stopAudio"
|
|
|
:width="colLength == 2 ? 175 : isPhone ? 200 : 750"
|
|
|
- :isRepeat="isRepeat"
|
|
|
- :mp3Source="curQue.mp3_list[0].source"
|
|
|
+ :is-repeat="isRepeat"
|
|
|
+ :mp3-source="curQue.mp3_list[0].source"
|
|
|
:ed="ed"
|
|
|
type="audioLine"
|
|
|
+ :attrib="attrib"
|
|
|
@handleChangeStopAudio="handleChangeStopAudio"
|
|
|
@emptyEd="emptyEd"
|
|
|
- :attrib="attrib"
|
|
|
/>
|
|
|
</template>
|
|
|
</div>
|
|
|
@@ -67,14 +67,17 @@
|
|
|
</div>
|
|
|
|
|
|
<template v-if="resObj">
|
|
|
- <p class="notice" v-if="curQue.notice" style="padding-top: 24px">
|
|
|
+ <p v-if="curQue.notice" class="notice" style="padding-top: 24px">
|
|
|
{{ curQue.notice }}
|
|
|
</p>
|
|
|
<div class="NPC-sentences-list">
|
|
|
<div
|
|
|
- :class="['NNPE-detail-box', sentIndex == index ? 'active' : '']"
|
|
|
v-for="(item, index) in resObj.sentList"
|
|
|
:key="'detail' + index"
|
|
|
+ :class="['NNPE-detail-box', sentIndex == index ? 'active' : '']"
|
|
|
+ :style="{
|
|
|
+ backgroundColor: sentIndex == index && attrib ? attrib.assist_color : '',
|
|
|
+ }"
|
|
|
>
|
|
|
<div
|
|
|
class="NNPE-detail"
|
|
|
@@ -88,7 +91,7 @@
|
|
|
>
|
|
|
<template v-if="item.sentArr[0].sentIndex == 0">
|
|
|
<RoleChs
|
|
|
- :curRole="item.roleDetail"
|
|
|
+ :cur-role="item.roleDetail"
|
|
|
:color="
|
|
|
(curQue.wordTime &&
|
|
|
curQue.wordTime[index] &&
|
|
|
@@ -132,7 +135,7 @@
|
|
|
>{{ item.roleDetail.detail.wordsList | handleChs }}</span
|
|
|
>
|
|
|
</div> -->
|
|
|
- <div class="roleDetail" v-if="item.roleDetail.fullName || item.roleDetail.fullPinyin">
|
|
|
+ <div v-if="item.roleDetail.fullName || item.roleDetail.fullPinyin" class="roleDetail">
|
|
|
<span
|
|
|
:class="[
|
|
|
'chs',
|
|
|
@@ -171,9 +174,9 @@
|
|
|
<div style="overflow: hidden; clear: both"></div>
|
|
|
<div class="NNPE-words-box">
|
|
|
<div
|
|
|
- class="NNPE-words"
|
|
|
v-for="(pItem, pIndex) in item.sentArr"
|
|
|
:key="'wordsList' + pIndex"
|
|
|
+ class="NNPE-words"
|
|
|
:class="[
|
|
|
pItem.chs != '“' && pItem.wordIndex == 0 ? 'textLeft' : 'textCenter',
|
|
|
pItem.chs == '“' ? 'textRight' : '',
|
|
|
@@ -231,6 +234,17 @@
|
|
|
fontFamily: pItem.config.fontFamily,
|
|
|
height: '28px',
|
|
|
display: 'inline-block',
|
|
|
+ color:
|
|
|
+ isPlaying &&
|
|
|
+ pItem.timeList &&
|
|
|
+ pItem.timeList[wIndex] &&
|
|
|
+ curTime >= pItem.timeList[wIndex].wordBg &&
|
|
|
+ curQue.wordTime &&
|
|
|
+ curQue.wordTime[index] &&
|
|
|
+ curTime <= curQue.wordTime[index].ed &&
|
|
|
+ attrib
|
|
|
+ ? attrib.topic_color
|
|
|
+ : '',
|
|
|
}"
|
|
|
>{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.chs[wIndex] : '' }}</span
|
|
|
>
|
|
|
@@ -279,6 +293,16 @@
|
|
|
fontFamily: item.sentArr[pIndex + 1].config.fontFamily,
|
|
|
height: '28px',
|
|
|
display: 'inline-block',
|
|
|
+ color:
|
|
|
+ isPlaying &&
|
|
|
+ pItem.timeList[pItem.leg - 1] &&
|
|
|
+ curTime >= pItem.timeList[pItem.leg - 1].wordBg &&
|
|
|
+ curQue.wordTime &&
|
|
|
+ curQue.wordTime[index] &&
|
|
|
+ curTime <= curQue.wordTime[index].ed &&
|
|
|
+ attrib
|
|
|
+ ? attrib.topic_color
|
|
|
+ : '',
|
|
|
}"
|
|
|
>
|
|
|
{{
|
|
|
@@ -302,12 +326,12 @@
|
|
|
</template>
|
|
|
</span>
|
|
|
<span
|
|
|
- class="NNPE-words-box"
|
|
|
v-if="
|
|
|
item.sentArr[pIndex + 2] &&
|
|
|
item.sentArr[pIndex + 2].chs &&
|
|
|
chsFhList.indexOf(item.sentArr[pIndex + 2].chs) > -1
|
|
|
"
|
|
|
+ class="NNPE-words-box"
|
|
|
>
|
|
|
<template v-if="curQue.property.pinyin_position == 'top'">
|
|
|
<span
|
|
|
@@ -338,6 +362,16 @@
|
|
|
fontFamily: item.sentArr[pIndex + 2].config.fontFamily,
|
|
|
height: '28px',
|
|
|
display: 'inline-block',
|
|
|
+ color:
|
|
|
+ isPlaying &&
|
|
|
+ pItem.timeList[pItem.leg - 1] &&
|
|
|
+ curTime >= pItem.timeList[pItem.leg - 1].wordBg &&
|
|
|
+ curQue.wordTime &&
|
|
|
+ curQue.wordTime[index] &&
|
|
|
+ curTime <= curQue.wordTime[index].ed &&
|
|
|
+ attrib
|
|
|
+ ? attrib.topic_color
|
|
|
+ : '',
|
|
|
}"
|
|
|
>
|
|
|
{{
|
|
|
@@ -404,6 +438,17 @@
|
|
|
fontFamily: pItem.config.fontFamily,
|
|
|
height: '28px',
|
|
|
display: 'inline-block',
|
|
|
+ color:
|
|
|
+ isPlaying &&
|
|
|
+ pItem.timeList &&
|
|
|
+ pItem.timeList[wIndex] &&
|
|
|
+ curTime >= pItem.timeList[wIndex].wordBg &&
|
|
|
+ curQue.wordTime &&
|
|
|
+ curQue.wordTime[index] &&
|
|
|
+ curTime <= curQue.wordTime[index].ed &&
|
|
|
+ attrib
|
|
|
+ ? attrib.topic_color
|
|
|
+ : '',
|
|
|
}"
|
|
|
>{{ pItem.chs[wIndex] }}</span
|
|
|
>
|
|
|
@@ -448,9 +493,9 @@
|
|
|
{{ item.enwords }}
|
|
|
</div>
|
|
|
<div
|
|
|
+ v-if="curQue.property.multilingual_position === 'para'"
|
|
|
class="multilingual-para"
|
|
|
:class="[item.isTitle ? 'multilingual-para-center' : '']"
|
|
|
- v-if="curQue.property.multilingual_position === 'para'"
|
|
|
>
|
|
|
{{
|
|
|
multilingualTextList[multilingual] && multilingualTextList[multilingual][index]
|
|
|
@@ -466,37 +511,46 @@
|
|
|
<Soundrecord
|
|
|
type="promax"
|
|
|
class="luyin-box"
|
|
|
- @getWavblob="getWavblob"
|
|
|
- @handleParentPlay="handleParentPlay"
|
|
|
- @sentPause="sentPause"
|
|
|
:TaskModel="TaskModel"
|
|
|
- :answerRecordList="
|
|
|
+ :answer-record-list="
|
|
|
curQue.Bookanswer.practiceModel[index] && curQue.Bookanswer.practiceModel[index].recordList
|
|
|
"
|
|
|
- :tmIndex="index"
|
|
|
- @handleWav="handleWav"
|
|
|
- :sentIndex="sentIndex"
|
|
|
+ :tm-index="index"
|
|
|
v-if="refresh"
|
|
|
+ :sent-index="sentIndex"
|
|
|
+ :attrib="attrib"
|
|
|
+ @getWavblob="getWavblob"
|
|
|
+ @handleParentPlay="handleParentPlay"
|
|
|
+ @sentPause="sentPause"
|
|
|
+ @handleWav="handleWav"
|
|
|
/>
|
|
|
- <div class="compare-box" v-if="curQue.mp3_list && curQue.mp3_list.length > 0">
|
|
|
+ <div v-if="curQue.mp3_list && curQue.mp3_list.length > 0" class="compare-box">
|
|
|
<Audio-compare
|
|
|
- :themeColor="attrib ? attrib.topic_color : '#e35454'"
|
|
|
+ :theme-color="attrib ? attrib.topic_color : '#e35454'"
|
|
|
:index="index"
|
|
|
- :sentIndex="sentIndex"
|
|
|
+ :sent-index="sentIndex"
|
|
|
:url="curQue.mp3_list[0].id"
|
|
|
:bg="curQue.wordTime[index].bg"
|
|
|
:ed="curQue.wordTime[index].ed"
|
|
|
:wavblob="wavblob"
|
|
|
- :getCurTime="getCurTime"
|
|
|
- :sentPause="sentPause"
|
|
|
- :isRecord="isRecord"
|
|
|
- :handleChangeStopAudio="handleChangeStopAudio"
|
|
|
- :getPlayStatus="getPlayStatus"
|
|
|
+ :get-cur-time="getCurTime"
|
|
|
+ :sent-pause="sentPause"
|
|
|
+ :is-record="isRecord"
|
|
|
+ :handle-change-stop-audio="handleChangeStopAudio"
|
|
|
+ :get-play-status="getPlayStatus"
|
|
|
:attrib="attrib"
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <span class="full-screen-icon" @click="fullScreen"> </span>
|
|
|
+ <span class="full-screen-icon" @click="fullScreen">
|
|
|
+ <svg-icon
|
|
|
+ icon-class="icon-full"
|
|
|
+ size="24"
|
|
|
+ :style="{
|
|
|
+ color: attrib && attrib.topic_color ? attrib.topic_color : '',
|
|
|
+ }"
|
|
|
+ />
|
|
|
+ </span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- <div class="multilingual" v-for="(items, indexs) in multilingualTextList" :key="indexs">
|
|
|
@@ -506,9 +560,9 @@
|
|
|
</template>
|
|
|
<template v-for="(items, indexs) in curQue.detail">
|
|
|
<div
|
|
|
- class="multilingual"
|
|
|
- :key="indexs"
|
|
|
v-if="curQue.property.multilingual_position === 'all' && items.multilingualTextList[multilingual]"
|
|
|
+ :key="indexs"
|
|
|
+ class="multilingual"
|
|
|
>
|
|
|
<div class="multilingual-para" :class="[items.isTitle ? 'multilingual-para-center' : '']">
|
|
|
{{
|
|
|
@@ -520,30 +574,30 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<div
|
|
|
- class="aduioLine-box aduioLine-practice-npc aduioLine-box-bottom"
|
|
|
v-if="
|
|
|
((curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].url) ||
|
|
|
config.isHasPY ||
|
|
|
config.isHasEN) &&
|
|
|
curQue.property.mp3_position === 'bottom'
|
|
|
"
|
|
|
+ class="aduioLine-box aduioLine-practice-npc aduioLine-box-bottom"
|
|
|
>
|
|
|
<div class="aduioLine-content">
|
|
|
<template v-if="curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].url">
|
|
|
<AudioLine
|
|
|
- audioId="diaPraAudio"
|
|
|
- :mp3="curQue.mp3_list[0].url"
|
|
|
- :getCurTime="getCurTime"
|
|
|
ref="audioLine"
|
|
|
- :stopAudio="stopAudio"
|
|
|
+ audio-id="diaPraAudio"
|
|
|
+ :mp3="curQue.mp3_list[0].url"
|
|
|
+ :get-cur-time="getCurTime"
|
|
|
+ :stop-audio="stopAudio"
|
|
|
:width="colLength == 2 ? 175 : isPhone ? 200 : 750"
|
|
|
- :isRepeat="isRepeat"
|
|
|
- :mp3Source="curQue.mp3_list[0].source"
|
|
|
+ :is-repeat="isRepeat"
|
|
|
+ :mp3-source="curQue.mp3_list[0].source"
|
|
|
:ed="ed"
|
|
|
type="audioLine"
|
|
|
+ :attrib="attrib"
|
|
|
@handleChangeStopAudio="handleChangeStopAudio"
|
|
|
@emptyEd="emptyEd"
|
|
|
- :attrib="attrib"
|
|
|
/>
|
|
|
</template>
|
|
|
</div>
|
|
|
@@ -581,27 +635,27 @@
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="voice-full-screen" :id="'screen-' + mathNum">
|
|
|
+ <div :id="'screen-' + mathNum" class="voice-full-screen">
|
|
|
<Voicefullscreen
|
|
|
v-if="isFull && resObj"
|
|
|
- :themeColor="attrib ? attrib.topic_color : '#e35454'"
|
|
|
- :curQue="curQue"
|
|
|
- :sentList="resObj.sentList"
|
|
|
- :sentIndex="sentIndex"
|
|
|
+ :theme-color="attrib ? attrib.topic_color : '#e35454'"
|
|
|
+ :cur-que="curQue"
|
|
|
+ :sent-list="resObj.sentList"
|
|
|
+ :sent-index="sentIndex"
|
|
|
:mp3="curQue.mp3_list && curQue.mp3_list[0] ? curQue.mp3_list[0].id : ''"
|
|
|
- :noFont="noFont"
|
|
|
+ :no-font="noFont"
|
|
|
:NNPENewWordList="NNPENewWordList"
|
|
|
- :currentTreeID="currentTreeID"
|
|
|
- :isFull="isFull"
|
|
|
+ :current-tree-i-d="currentTreeID"
|
|
|
+ :is-full="isFull"
|
|
|
:config="config"
|
|
|
:TaskModel="TaskModel"
|
|
|
+ :NpcNewWordMp3="NpcNewWordMp3"
|
|
|
+ :attrib="attrib"
|
|
|
@handleWav="handleWav"
|
|
|
@changePinyin="changePinyin"
|
|
|
@changeEN="changeEN"
|
|
|
@exitFullscreen="exitFullscreen"
|
|
|
@changeIsFull="changeIsFull"
|
|
|
- :NpcNewWordMp3="NpcNewWordMp3"
|
|
|
- :attrib="attrib"
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -616,20 +670,6 @@ import AudioCompare from '../article/components/AudioCompare.vue';
|
|
|
import Voicefullscreen from '../article/Voicefullscreen.vue';
|
|
|
export default {
|
|
|
name: 'ArticleView',
|
|
|
- props: [
|
|
|
- 'curQue',
|
|
|
- 'colorBox',
|
|
|
- 'noFont',
|
|
|
- 'attrib',
|
|
|
- 'config',
|
|
|
- 'NNPENewWordList',
|
|
|
- 'currentTreeID',
|
|
|
- 'TaskModel',
|
|
|
- 'colLength',
|
|
|
- 'NpcNewWordMp3',
|
|
|
- 'isPhone',
|
|
|
- 'multilingual',
|
|
|
- ],
|
|
|
components: {
|
|
|
AudioLine,
|
|
|
Soundrecord,
|
|
|
@@ -642,7 +682,7 @@ export default {
|
|
|
let str = '';
|
|
|
wordsList.forEach((item, index) => {
|
|
|
if (index < wordsList.length - 1) {
|
|
|
- str += item.pinyin + ' ';
|
|
|
+ str += `${item.pinyin} `;
|
|
|
} else {
|
|
|
str += item.pinyin;
|
|
|
}
|
|
|
@@ -653,7 +693,7 @@ export default {
|
|
|
let str = '';
|
|
|
wordsList.forEach((item, index) => {
|
|
|
if (index < wordsList.length - 1) {
|
|
|
- str += item.chs + ' ';
|
|
|
+ str += `${item.chs} `;
|
|
|
} else {
|
|
|
str += item.chs;
|
|
|
}
|
|
|
@@ -661,18 +701,32 @@ export default {
|
|
|
return str;
|
|
|
},
|
|
|
},
|
|
|
+ props: [
|
|
|
+ 'curQue',
|
|
|
+ 'colorBox',
|
|
|
+ 'noFont',
|
|
|
+ 'attrib',
|
|
|
+ 'config',
|
|
|
+ 'NNPENewWordList',
|
|
|
+ 'currentTreeID',
|
|
|
+ 'TaskModel',
|
|
|
+ 'colLength',
|
|
|
+ 'NpcNewWordMp3',
|
|
|
+ 'isPhone',
|
|
|
+ 'multilingual',
|
|
|
+ ],
|
|
|
data() {
|
|
|
return {
|
|
|
wavblob: null,
|
|
|
resObj: null,
|
|
|
- curTime: 0, //单位s
|
|
|
+ curTime: 0, // 单位s
|
|
|
chsFhList: [',', '。', '”', ':', '》', '?', '!', ';', '、'],
|
|
|
enFhList: [',', '.', ';', '?', '!', ':', '>', '<'],
|
|
|
NumberList: ['①', '②', '③', '④', '⑤', '⑥', '⑦', '⑧', '⑨', '⑩', '⑪', '⑫', '⑬', '⑭', '⑮', '⑯', '⑰', '⑱', '⑲', '⑳'],
|
|
|
stopAudio: false,
|
|
|
sentIndex: 0,
|
|
|
isRepeat: false,
|
|
|
- currSent: null, //当前句子的时间
|
|
|
+ currSent: null, // 当前句子的时间
|
|
|
isRecord: false,
|
|
|
isFull: false,
|
|
|
mathNum: Math.random().toString(36).substr(2),
|
|
|
@@ -686,7 +740,7 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- isPlaying: function () {
|
|
|
+ isPlaying() {
|
|
|
let playing = false;
|
|
|
if (this.$refs.audioLine) {
|
|
|
playing = this.$refs.audioLine.audio.isPlaying;
|
|
|
@@ -696,7 +750,7 @@ export default {
|
|
|
},
|
|
|
watch: {
|
|
|
sentIndex: {
|
|
|
- handler: function (newVal, oldVal) {
|
|
|
+ handler(newVal, oldVal) {
|
|
|
let _this = this;
|
|
|
if (newVal != oldVal) {
|
|
|
let Bookanswer = _this.curQue.Bookanswer;
|
|
|
@@ -716,7 +770,7 @@ export default {
|
|
|
deep: true,
|
|
|
},
|
|
|
isFull: {
|
|
|
- handler: function (newVal, oldVal) {
|
|
|
+ handler(newVal, oldVal) {
|
|
|
let _this = this;
|
|
|
_this.refresh = false;
|
|
|
if (!newVal) {
|
|
|
@@ -729,10 +783,25 @@ export default {
|
|
|
deep: true,
|
|
|
},
|
|
|
},
|
|
|
- //方法集合
|
|
|
+ // 生命周期 - 创建完成(可以访问当前this实例)
|
|
|
+ created() {},
|
|
|
+ // 生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
+ mounted() {
|
|
|
+ if (this.curQue) {
|
|
|
+ this.handleData();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ beforeCreate() {}, // 生命周期 - 创建之前
|
|
|
+ beforeMount() {}, // 生命周期 - 挂载之前
|
|
|
+ beforeUpdate() {}, // 生命周期 - 更新之前
|
|
|
+ updated() {}, // 生命周期 - 更新之后
|
|
|
+ beforeDestroy() {}, // 生命周期 - 销毁之前
|
|
|
+ destroyed() {}, // 生命周期 - 销毁完成
|
|
|
+ activated() {},
|
|
|
+ // 方法集合
|
|
|
methods: {
|
|
|
getPlayStatus(val) {
|
|
|
- //this.isPlaying = val;
|
|
|
+ // this.isPlaying = val;
|
|
|
},
|
|
|
pauseAudio() {
|
|
|
let audio = document.getElementsByTagName('audio');
|
|
|
@@ -750,7 +819,7 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
- //语音全屏
|
|
|
+ // 语音全屏
|
|
|
fullScreen(type) {
|
|
|
this.pauseAudio();
|
|
|
this.pauseVideo();
|
|
|
@@ -758,8 +827,8 @@ export default {
|
|
|
this.goFullscreen();
|
|
|
},
|
|
|
goFullscreen() {
|
|
|
- let id = 'screen-' + this.mathNum;
|
|
|
- var element = document.getElementById(id);
|
|
|
+ let id = `screen-${this.mathNum}`;
|
|
|
+ let element = document.getElementById(id);
|
|
|
if (element.requestFullscreen) {
|
|
|
element.requestFullscreen();
|
|
|
} else if (element.msRequestFullscreen) {
|
|
|
@@ -821,8 +890,8 @@ export default {
|
|
|
let trans_arr = item.translation.split('\n');
|
|
|
this.$set(this.multilingualTextList, item.type, trans_arr);
|
|
|
});
|
|
|
- let resArr = [],
|
|
|
- sentArrTotal = [];
|
|
|
+ let resArr = [];
|
|
|
+ let sentArrTotal = [];
|
|
|
let curQue = JSON.parse(JSON.stringify(this.curQue));
|
|
|
let wordTimeList = curQue.wordTime;
|
|
|
let dhaspinyin = false; // 每段是否有拼音
|
|
|
@@ -843,20 +912,18 @@ export default {
|
|
|
if (!this.highWords) {
|
|
|
this.findLightWord(wItem, wIndex, sentence, sItem);
|
|
|
words = this.highWords ? this.highWords.words : '';
|
|
|
+ } else if (wIndex > this.highWords.endIndex - 1) {
|
|
|
+ this.highWords = null;
|
|
|
+ this.findLightWord(wItem, wIndex, sentence, sItem);
|
|
|
+ words = this.highWords ? this.highWords.words : '';
|
|
|
} else {
|
|
|
- if (wIndex > this.highWords.endIndex - 1) {
|
|
|
- this.highWords = null;
|
|
|
- this.findLightWord(wItem, wIndex, sentence, sItem);
|
|
|
- words = this.highWords ? this.highWords.words : '';
|
|
|
- } else {
|
|
|
- words = this.highWords ? this.highWords.words : '';
|
|
|
- }
|
|
|
+ words = this.highWords ? this.highWords.words : '';
|
|
|
}
|
|
|
}
|
|
|
let obj = {
|
|
|
- paraIndex: dIndex, //段落索引
|
|
|
- sentIndex: sIndex, //在段落中句子索引
|
|
|
- wordIndex: wIndex, //单词的索引
|
|
|
+ paraIndex: dIndex, // 段落索引
|
|
|
+ sentIndex: sIndex, // 在段落中句子索引
|
|
|
+ wordIndex: wIndex, // 单词的索引
|
|
|
pinyin:
|
|
|
curQue.pinyin_type === 'pinyin'
|
|
|
? curQue.property.is_first_sentence_first_hz_pinyin_first_char_upper_case === 'true' && wIndex === 0
|
|
|
@@ -867,11 +934,11 @@ export default {
|
|
|
padding: true,
|
|
|
className: wItem.className,
|
|
|
isShow: wItem.isShow,
|
|
|
- startIndex: startIndex,
|
|
|
- endIndex: endIndex,
|
|
|
+ startIndex,
|
|
|
+ endIndex,
|
|
|
leg: wItem.chs.length,
|
|
|
timeList: [],
|
|
|
- words: words,
|
|
|
+ words,
|
|
|
config: {
|
|
|
fontFamily: wItem.fontFamily,
|
|
|
},
|
|
|
@@ -880,10 +947,10 @@ export default {
|
|
|
if (wItem.pinyin) dhaspinyin = true;
|
|
|
});
|
|
|
let objs = {
|
|
|
- roleDetail: roleDetail,
|
|
|
- sentArr: sentArr,
|
|
|
+ roleDetail,
|
|
|
+ sentArr,
|
|
|
enwords: dItem.sentencesEn && dItem.sentencesEn[sIndex] && dItem.sentencesEn[sIndex].replace(/\'/g, '’'),
|
|
|
- dhaspinyin: dhaspinyin,
|
|
|
+ dhaspinyin,
|
|
|
};
|
|
|
sentArrTotal.push(sentArr);
|
|
|
resArr.push(objs);
|
|
|
@@ -895,7 +962,7 @@ export default {
|
|
|
|
|
|
this.resObj = { sentList: resArr };
|
|
|
},
|
|
|
- //获取角色
|
|
|
+ // 获取角色
|
|
|
getRole(dItem) {
|
|
|
let roleIndex = dItem.roleIndex;
|
|
|
let resObj = null;
|
|
|
@@ -921,7 +988,7 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
- //词和标点合一起
|
|
|
+ // 词和标点合一起
|
|
|
mergeWordSymbol(wItem) {
|
|
|
if (this.chsFhList.indexOf(wItem.chs) > -1 || this.NumberList.indexOf(wItem.pinyin) > -1) {
|
|
|
wItem.isShow = false;
|
|
|
@@ -930,43 +997,41 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
findLightWord(wItem, startIndex, sentence, sItem) {
|
|
|
- let words = '',
|
|
|
- endIndex = 0;
|
|
|
+ let endIndex = 0,
|
|
|
+ words = '';
|
|
|
this.newWordList.forEach((item) => {
|
|
|
if (item.length == 1) {
|
|
|
if (item == wItem.chs && !wItem.banLight) {
|
|
|
words = wItem.chs;
|
|
|
endIndex = startIndex + 1;
|
|
|
}
|
|
|
- } else {
|
|
|
- if (item[0] == wItem.chs && sentence.indexOf(item) > -1) {
|
|
|
- let index = null;
|
|
|
- let chsStr = '';
|
|
|
- for (let i = startIndex; i < sItem.length + 1; i++) {
|
|
|
- index = i;
|
|
|
- if (chsStr.length == item.length) {
|
|
|
- break;
|
|
|
- } else {
|
|
|
- chsStr += sItem[i] ? sItem[i].chs : '';
|
|
|
- }
|
|
|
- }
|
|
|
- if (chsStr == item && !wItem.banLight) {
|
|
|
- words = item;
|
|
|
- endIndex = index;
|
|
|
+ } else if (item[0] == wItem.chs && sentence.indexOf(item) > -1) {
|
|
|
+ let index = null;
|
|
|
+ let chsStr = '';
|
|
|
+ for (let i = startIndex; i < sItem.length + 1; i++) {
|
|
|
+ index = i;
|
|
|
+ if (chsStr.length == item.length) {
|
|
|
+ break;
|
|
|
+ } else {
|
|
|
+ chsStr += sItem[i] ? sItem[i].chs : '';
|
|
|
}
|
|
|
- } else if (wItem.new_word && wItem.new_word == item && !wItem.banLight) {
|
|
|
+ }
|
|
|
+ if (chsStr == item && !wItem.banLight) {
|
|
|
words = item;
|
|
|
- endIndex = startIndex + 1;
|
|
|
+ endIndex = index;
|
|
|
}
|
|
|
+ } else if (wItem.new_word && wItem.new_word == item && !wItem.banLight) {
|
|
|
+ words = item;
|
|
|
+ endIndex = startIndex + 1;
|
|
|
}
|
|
|
});
|
|
|
if (words) {
|
|
|
- this.highWords = { words: words, endIndex: endIndex };
|
|
|
+ this.highWords = { words, endIndex };
|
|
|
} else {
|
|
|
this.highWords = null;
|
|
|
}
|
|
|
},
|
|
|
- //判断是否有padding
|
|
|
+ // 判断是否有padding
|
|
|
judgePad(sItem, wItem, curIndex) {
|
|
|
let leg = sItem.length;
|
|
|
if (curIndex < leg - 1) {
|
|
|
@@ -982,7 +1047,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- //转化时间
|
|
|
+ // 转化时间
|
|
|
handleTimeList(list) {
|
|
|
let listRes = [];
|
|
|
list.forEach((item) => {
|
|
|
@@ -991,7 +1056,7 @@ export default {
|
|
|
});
|
|
|
return listRes;
|
|
|
},
|
|
|
- //计算总时间
|
|
|
+ // 计算总时间
|
|
|
countWordTime(sentArr) {
|
|
|
let total = 0;
|
|
|
sentArr.forEach((item) => {
|
|
|
@@ -999,7 +1064,7 @@ export default {
|
|
|
});
|
|
|
return total;
|
|
|
},
|
|
|
- //点击播放某个句子
|
|
|
+ // 点击播放某个句子
|
|
|
handleChangeTime(time, index, ed) {
|
|
|
let _this = this;
|
|
|
if (_this.isRepeat) {
|
|
|
@@ -1016,7 +1081,7 @@ export default {
|
|
|
this.ed = undefined;
|
|
|
},
|
|
|
handleWav(list, tmIndex) {
|
|
|
- tmIndex = tmIndex ? tmIndex : 0;
|
|
|
+ tmIndex = tmIndex || 0;
|
|
|
this.curQue.Bookanswer.practiceModel[tmIndex] = {
|
|
|
recordList: [],
|
|
|
};
|
|
|
@@ -1030,7 +1095,7 @@ export default {
|
|
|
handleChangeStopAudio() {
|
|
|
this.stopAudio = false;
|
|
|
},
|
|
|
- //拼音的显示和隐藏
|
|
|
+ // 拼音的显示和隐藏
|
|
|
changePinyin() {
|
|
|
if (this.config.isHasPY) {
|
|
|
this.$emit('changeConfig', 'isShowPY');
|
|
|
@@ -1061,22 +1126,7 @@ export default {
|
|
|
});
|
|
|
this.newWordList = JSON.parse(JSON.stringify(NewWordList));
|
|
|
},
|
|
|
- },
|
|
|
- //生命周期 - 创建完成(可以访问当前this实例)
|
|
|
- created() {},
|
|
|
- //生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
- mounted() {
|
|
|
- if (this.curQue) {
|
|
|
- this.handleData();
|
|
|
- }
|
|
|
- },
|
|
|
- beforeCreate() {}, //生命周期 - 创建之前
|
|
|
- beforeMount() {}, //生命周期 - 挂载之前
|
|
|
- beforeUpdate() {}, //生命周期 - 更新之前
|
|
|
- updated() {}, //生命周期 - 更新之后
|
|
|
- beforeDestroy() {}, //生命周期 - 销毁之前
|
|
|
- destroyed() {}, //生命周期 - 销毁完成
|
|
|
- activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
+ }, // 如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
@@ -1348,11 +1398,12 @@ export default {
|
|
|
}
|
|
|
|
|
|
.full-screen-icon {
|
|
|
- width: 16px;
|
|
|
- height: 16px;
|
|
|
+ width: 24px;
|
|
|
+ height: 24px;
|
|
|
cursor: pointer;
|
|
|
- background: url('@/assets/full-screen-red.png') no-repeat left top;
|
|
|
- background-size: 100% 100%;
|
|
|
+
|
|
|
+ // background: url('@/assets/full-screen-red.png') no-repeat left top;
|
|
|
+ // background-size: 100% 100%;
|
|
|
}
|
|
|
}
|
|
|
|