|
|
@@ -1,31 +1,32 @@
|
|
|
<!-- -->
|
|
|
<template>
|
|
|
- <div v-if="curQue" class="NNPE-ArticleView">
|
|
|
+ <div class="NNPE-ArticleView" v-if="curQue">
|
|
|
<!-- <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
|
|
|
- ref="audioLine"
|
|
|
- audio-id="diaPraAudio"
|
|
|
+ audioId="diaPraAudio"
|
|
|
:mp3="curQue.mp3_list[0].url"
|
|
|
- :get-cur-time="getCurTime"
|
|
|
- :stop-audio="stopAudio"
|
|
|
+ :getCurTime="getCurTime"
|
|
|
+ ref="audioLine"
|
|
|
+ :stopAudio="stopAudio"
|
|
|
:width="colLength == 2 ? 175 : isPhone ? 200 : 750"
|
|
|
- :is-repeat="isRepeat"
|
|
|
- :mp3-source="curQue.mp3_list[0].source"
|
|
|
+ :isRepeat="isRepeat"
|
|
|
+ :mp3Source="curQue.mp3_list[0].source"
|
|
|
:ed="ed"
|
|
|
type="audioLine"
|
|
|
@handleChangeStopAudio="handleChangeStopAudio"
|
|
|
@emptyEd="emptyEd"
|
|
|
+ :attrib="attrib"
|
|
|
/>
|
|
|
</template>
|
|
|
</div>
|
|
|
@@ -66,14 +67,14 @@
|
|
|
</div>
|
|
|
|
|
|
<template v-if="resObj">
|
|
|
- <p v-if="curQue.notice" class="notice" style="padding-top: 24px">
|
|
|
+ <p class="notice" v-if="curQue.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' : '']"
|
|
|
>
|
|
|
<div
|
|
|
class="NNPE-detail"
|
|
|
@@ -87,7 +88,7 @@
|
|
|
>
|
|
|
<template v-if="item.sentArr[0].sentIndex == 0">
|
|
|
<RoleChs
|
|
|
- :cur-role="item.roleDetail"
|
|
|
+ :curRole="item.roleDetail"
|
|
|
:color="
|
|
|
(curQue.wordTime &&
|
|
|
curQue.wordTime[index] &&
|
|
|
@@ -131,7 +132,7 @@
|
|
|
>{{ item.roleDetail.detail.wordsList | handleChs }}</span
|
|
|
>
|
|
|
</div> -->
|
|
|
- <div v-if="item.roleDetail.fullName || item.roleDetail.fullPinyin" class="roleDetail">
|
|
|
+ <div class="roleDetail" v-if="item.roleDetail.fullName || item.roleDetail.fullPinyin">
|
|
|
<span
|
|
|
:class="[
|
|
|
'chs',
|
|
|
@@ -170,9 +171,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' : '',
|
|
|
@@ -301,12 +302,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
|
|
|
@@ -447,9 +448,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]
|
|
|
@@ -465,32 +466,33 @@
|
|
|
<Soundrecord
|
|
|
type="promax"
|
|
|
class="luyin-box"
|
|
|
- :TaskModel="TaskModel"
|
|
|
- v-if="refresh"
|
|
|
- :answer-record-list="
|
|
|
- curQue.Bookanswer.practiceModel[index] && curQue.Bookanswer.practiceModel[index].recordList
|
|
|
- "
|
|
|
- :tm-index="index"
|
|
|
- :sent-index="sentIndex"
|
|
|
@getWavblob="getWavblob"
|
|
|
@handleParentPlay="handleParentPlay"
|
|
|
@sentPause="sentPause"
|
|
|
+ :TaskModel="TaskModel"
|
|
|
+ :answerRecordList="
|
|
|
+ curQue.Bookanswer.practiceModel[index] && curQue.Bookanswer.practiceModel[index].recordList
|
|
|
+ "
|
|
|
+ :tmIndex="index"
|
|
|
@handleWav="handleWav"
|
|
|
+ :sentIndex="sentIndex"
|
|
|
+ v-if="refresh"
|
|
|
/>
|
|
|
- <div v-if="curQue.mp3_list && curQue.mp3_list.length > 0" class="compare-box">
|
|
|
+ <div class="compare-box" v-if="curQue.mp3_list && curQue.mp3_list.length > 0">
|
|
|
<Audio-compare
|
|
|
- :theme-color="attrib ? attrib.topic_color : '#e35454'"
|
|
|
+ :themeColor="attrib ? attrib.topic_color : '#e35454'"
|
|
|
:index="index"
|
|
|
- :sent-index="sentIndex"
|
|
|
+ :sentIndex="sentIndex"
|
|
|
:url="curQue.mp3_list[0].id"
|
|
|
:bg="curQue.wordTime[index].bg"
|
|
|
:ed="curQue.wordTime[index].ed"
|
|
|
:wavblob="wavblob"
|
|
|
- :get-cur-time="getCurTime"
|
|
|
- :sent-pause="sentPause"
|
|
|
- :is-record="isRecord"
|
|
|
- :handle-change-stop-audio="handleChangeStopAudio"
|
|
|
- :get-play-status="getPlayStatus"
|
|
|
+ :getCurTime="getCurTime"
|
|
|
+ :sentPause="sentPause"
|
|
|
+ :isRecord="isRecord"
|
|
|
+ :handleChangeStopAudio="handleChangeStopAudio"
|
|
|
+ :getPlayStatus="getPlayStatus"
|
|
|
+ :attrib="attrib"
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -504,9 +506,9 @@
|
|
|
</template>
|
|
|
<template v-for="(items, indexs) in curQue.detail">
|
|
|
<div
|
|
|
- v-if="curQue.property.multilingual_position === 'all' && items.multilingualTextList[multilingual]"
|
|
|
- :key="indexs"
|
|
|
class="multilingual"
|
|
|
+ :key="indexs"
|
|
|
+ v-if="curQue.property.multilingual_position === 'all' && items.multilingualTextList[multilingual]"
|
|
|
>
|
|
|
<div class="multilingual-para" :class="[items.isTitle ? 'multilingual-para-center' : '']">
|
|
|
{{
|
|
|
@@ -518,29 +520,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
|
|
|
- ref="audioLine"
|
|
|
- audio-id="diaPraAudio"
|
|
|
+ audioId="diaPraAudio"
|
|
|
:mp3="curQue.mp3_list[0].url"
|
|
|
- :get-cur-time="getCurTime"
|
|
|
- :stop-audio="stopAudio"
|
|
|
+ :getCurTime="getCurTime"
|
|
|
+ ref="audioLine"
|
|
|
+ :stopAudio="stopAudio"
|
|
|
:width="colLength == 2 ? 175 : isPhone ? 200 : 750"
|
|
|
- :is-repeat="isRepeat"
|
|
|
- :mp3-source="curQue.mp3_list[0].source"
|
|
|
+ :isRepeat="isRepeat"
|
|
|
+ :mp3Source="curQue.mp3_list[0].source"
|
|
|
:ed="ed"
|
|
|
type="audioLine"
|
|
|
@handleChangeStopAudio="handleChangeStopAudio"
|
|
|
@emptyEd="emptyEd"
|
|
|
+ :attrib="attrib"
|
|
|
/>
|
|
|
</template>
|
|
|
</div>
|
|
|
@@ -578,27 +581,27 @@
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div :id="'screen-' + mathNum" class="voice-full-screen">
|
|
|
+ <div class="voice-full-screen" :id="'screen-' + mathNum">
|
|
|
<Voicefullscreen
|
|
|
v-if="isFull && resObj"
|
|
|
- :theme-color="attrib ? attrib.topic_color : '#e35454'"
|
|
|
- :cur-que="curQue"
|
|
|
- :sent-list="resObj.sentList"
|
|
|
- :sent-index="sentIndex"
|
|
|
+ :themeColor="attrib ? attrib.topic_color : '#e35454'"
|
|
|
+ :curQue="curQue"
|
|
|
+ :sentList="resObj.sentList"
|
|
|
+ :sentIndex="sentIndex"
|
|
|
:mp3="curQue.mp3_list && curQue.mp3_list[0] ? curQue.mp3_list[0].id : ''"
|
|
|
- :no-font="noFont"
|
|
|
+ :noFont="noFont"
|
|
|
:NNPENewWordList="NNPENewWordList"
|
|
|
- :current-tree-i-d="currentTreeID"
|
|
|
- :is-full="isFull"
|
|
|
+ :currentTreeID="currentTreeID"
|
|
|
+ :isFull="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>
|
|
|
@@ -613,6 +616,20 @@ 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,
|
|
|
@@ -625,7 +642,7 @@ export default {
|
|
|
let str = '';
|
|
|
wordsList.forEach((item, index) => {
|
|
|
if (index < wordsList.length - 1) {
|
|
|
- str += `${item.pinyin} `;
|
|
|
+ str += item.pinyin + ' ';
|
|
|
} else {
|
|
|
str += item.pinyin;
|
|
|
}
|
|
|
@@ -636,7 +653,7 @@ export default {
|
|
|
let str = '';
|
|
|
wordsList.forEach((item, index) => {
|
|
|
if (index < wordsList.length - 1) {
|
|
|
- str += `${item.chs} `;
|
|
|
+ str += item.chs + ' ';
|
|
|
} else {
|
|
|
str += item.chs;
|
|
|
}
|
|
|
@@ -644,32 +661,18 @@ 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),
|
|
|
@@ -683,7 +686,7 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- isPlaying() {
|
|
|
+ isPlaying: function () {
|
|
|
let playing = false;
|
|
|
if (this.$refs.audioLine) {
|
|
|
playing = this.$refs.audioLine.audio.isPlaying;
|
|
|
@@ -693,7 +696,7 @@ export default {
|
|
|
},
|
|
|
watch: {
|
|
|
sentIndex: {
|
|
|
- handler(newVal, oldVal) {
|
|
|
+ handler: function (newVal, oldVal) {
|
|
|
let _this = this;
|
|
|
if (newVal != oldVal) {
|
|
|
let Bookanswer = _this.curQue.Bookanswer;
|
|
|
@@ -713,7 +716,7 @@ export default {
|
|
|
deep: true,
|
|
|
},
|
|
|
isFull: {
|
|
|
- handler(newVal, oldVal) {
|
|
|
+ handler: function (newVal, oldVal) {
|
|
|
let _this = this;
|
|
|
_this.refresh = false;
|
|
|
if (!newVal) {
|
|
|
@@ -726,25 +729,10 @@ 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');
|
|
|
@@ -762,7 +750,7 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
- // 语音全屏
|
|
|
+ //语音全屏
|
|
|
fullScreen(type) {
|
|
|
this.pauseAudio();
|
|
|
this.pauseVideo();
|
|
|
@@ -770,8 +758,8 @@ export default {
|
|
|
this.goFullscreen();
|
|
|
},
|
|
|
goFullscreen() {
|
|
|
- let id = `screen-${this.mathNum}`;
|
|
|
- let element = document.getElementById(id);
|
|
|
+ let id = 'screen-' + this.mathNum;
|
|
|
+ var element = document.getElementById(id);
|
|
|
if (element.requestFullscreen) {
|
|
|
element.requestFullscreen();
|
|
|
} else if (element.msRequestFullscreen) {
|
|
|
@@ -833,8 +821,8 @@ export default {
|
|
|
let trans_arr = item.translation.split('\n');
|
|
|
this.$set(this.multilingualTextList, item.type, trans_arr);
|
|
|
});
|
|
|
- let resArr = [];
|
|
|
- let sentArrTotal = [];
|
|
|
+ let resArr = [],
|
|
|
+ sentArrTotal = [];
|
|
|
let curQue = JSON.parse(JSON.stringify(this.curQue));
|
|
|
let wordTimeList = curQue.wordTime;
|
|
|
let dhaspinyin = false; // 每段是否有拼音
|
|
|
@@ -855,18 +843,20 @@ 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 {
|
|
|
- words = this.highWords ? this.highWords.words : '';
|
|
|
+ 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 : '';
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
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
|
|
|
@@ -877,11 +867,11 @@ export default {
|
|
|
padding: true,
|
|
|
className: wItem.className,
|
|
|
isShow: wItem.isShow,
|
|
|
- startIndex,
|
|
|
- endIndex,
|
|
|
+ startIndex: startIndex,
|
|
|
+ endIndex: endIndex,
|
|
|
leg: wItem.chs.length,
|
|
|
timeList: [],
|
|
|
- words,
|
|
|
+ words: words,
|
|
|
config: {
|
|
|
fontFamily: wItem.fontFamily,
|
|
|
},
|
|
|
@@ -890,10 +880,10 @@ export default {
|
|
|
if (wItem.pinyin) dhaspinyin = true;
|
|
|
});
|
|
|
let objs = {
|
|
|
- roleDetail,
|
|
|
- sentArr,
|
|
|
+ roleDetail: roleDetail,
|
|
|
+ sentArr: sentArr,
|
|
|
enwords: dItem.sentencesEn && dItem.sentencesEn[sIndex] && dItem.sentencesEn[sIndex].replace(/\'/g, '’'),
|
|
|
- dhaspinyin,
|
|
|
+ dhaspinyin: dhaspinyin,
|
|
|
};
|
|
|
sentArrTotal.push(sentArr);
|
|
|
resArr.push(objs);
|
|
|
@@ -905,7 +895,7 @@ export default {
|
|
|
|
|
|
this.resObj = { sentList: resArr };
|
|
|
},
|
|
|
- // 获取角色
|
|
|
+ //获取角色
|
|
|
getRole(dItem) {
|
|
|
let roleIndex = dItem.roleIndex;
|
|
|
let resObj = null;
|
|
|
@@ -931,7 +921,7 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
- // 词和标点合一起
|
|
|
+ //词和标点合一起
|
|
|
mergeWordSymbol(wItem) {
|
|
|
if (this.chsFhList.indexOf(wItem.chs) > -1 || this.NumberList.indexOf(wItem.pinyin) > -1) {
|
|
|
wItem.isShow = false;
|
|
|
@@ -940,41 +930,43 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
findLightWord(wItem, startIndex, sentence, sItem) {
|
|
|
- let endIndex = 0,
|
|
|
- words = '';
|
|
|
+ let words = '',
|
|
|
+ endIndex = 0;
|
|
|
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 : '';
|
|
|
+ } 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) {
|
|
|
+ if (chsStr == item && !wItem.banLight) {
|
|
|
+ words = item;
|
|
|
+ endIndex = index;
|
|
|
+ }
|
|
|
+ } else if (wItem.new_word && wItem.new_word == item && !wItem.banLight) {
|
|
|
words = item;
|
|
|
- endIndex = index;
|
|
|
+ endIndex = startIndex + 1;
|
|
|
}
|
|
|
- } else if (wItem.new_word && wItem.new_word == item && !wItem.banLight) {
|
|
|
- words = item;
|
|
|
- endIndex = startIndex + 1;
|
|
|
}
|
|
|
});
|
|
|
if (words) {
|
|
|
- this.highWords = { words, endIndex };
|
|
|
+ this.highWords = { words: words, endIndex: endIndex };
|
|
|
} else {
|
|
|
this.highWords = null;
|
|
|
}
|
|
|
},
|
|
|
- // 判断是否有padding
|
|
|
+ //判断是否有padding
|
|
|
judgePad(sItem, wItem, curIndex) {
|
|
|
let leg = sItem.length;
|
|
|
if (curIndex < leg - 1) {
|
|
|
@@ -990,7 +982,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- // 转化时间
|
|
|
+ //转化时间
|
|
|
handleTimeList(list) {
|
|
|
let listRes = [];
|
|
|
list.forEach((item) => {
|
|
|
@@ -999,7 +991,7 @@ export default {
|
|
|
});
|
|
|
return listRes;
|
|
|
},
|
|
|
- // 计算总时间
|
|
|
+ //计算总时间
|
|
|
countWordTime(sentArr) {
|
|
|
let total = 0;
|
|
|
sentArr.forEach((item) => {
|
|
|
@@ -1007,7 +999,7 @@ export default {
|
|
|
});
|
|
|
return total;
|
|
|
},
|
|
|
- // 点击播放某个句子
|
|
|
+ //点击播放某个句子
|
|
|
handleChangeTime(time, index, ed) {
|
|
|
let _this = this;
|
|
|
if (_this.isRepeat) {
|
|
|
@@ -1024,7 +1016,7 @@ export default {
|
|
|
this.ed = undefined;
|
|
|
},
|
|
|
handleWav(list, tmIndex) {
|
|
|
- tmIndex = tmIndex || 0;
|
|
|
+ tmIndex = tmIndex ? tmIndex : 0;
|
|
|
this.curQue.Bookanswer.practiceModel[tmIndex] = {
|
|
|
recordList: [],
|
|
|
};
|
|
|
@@ -1038,7 +1030,7 @@ export default {
|
|
|
handleChangeStopAudio() {
|
|
|
this.stopAudio = false;
|
|
|
},
|
|
|
- // 拼音的显示和隐藏
|
|
|
+ //拼音的显示和隐藏
|
|
|
changePinyin() {
|
|
|
if (this.config.isHasPY) {
|
|
|
this.$emit('changeConfig', 'isShowPY');
|
|
|
@@ -1069,7 +1061,22 @@ export default {
|
|
|
});
|
|
|
this.newWordList = JSON.parse(JSON.stringify(NewWordList));
|
|
|
},
|
|
|
- }, // 如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
+ },
|
|
|
+ //生命周期 - 创建完成(可以访问当前this实例)
|
|
|
+ created() {},
|
|
|
+ //生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
+ mounted() {
|
|
|
+ if (this.curQue) {
|
|
|
+ this.handleData();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ beforeCreate() {}, //生命周期 - 创建之前
|
|
|
+ beforeMount() {}, //生命周期 - 挂载之前
|
|
|
+ beforeUpdate() {}, //生命周期 - 更新之前
|
|
|
+ updated() {}, //生命周期 - 更新之后
|
|
|
+ beforeDestroy() {}, //生命周期 - 销毁之前
|
|
|
+ destroyed() {}, //生命周期 - 销毁完成
|
|
|
+ activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|