|
|
@@ -1,24 +1,24 @@
|
|
|
<!-- -->
|
|
|
<template>
|
|
|
- <div class="NNPE-ArticleView" v-if="curQue">
|
|
|
+ <div v-if="curQue" class="NNPE-ArticleView">
|
|
|
<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="diaPhraAudio"
|
|
|
+ ref="audioLine"
|
|
|
+ audio-id="diaPhraAudio"
|
|
|
:mp3="curQue.mp3_list[0].url"
|
|
|
- :getCurTime="getCurTime"
|
|
|
- :mp3Source="curQue.mp3_list[0].source"
|
|
|
+ :get-cur-time="getCurTime"
|
|
|
+ :mp3-source="curQue.mp3_list[0].source"
|
|
|
:width="colLength == 2 ? 200 : isPhone ? 200 : 790"
|
|
|
- ref="audioLine"
|
|
|
/>
|
|
|
</template>
|
|
|
</div>
|
|
|
@@ -54,23 +54,23 @@
|
|
|
<div :class="['empty-left', isHasRemark ? 'hasRemark' : '']"></div>
|
|
|
<div class="empty-right"></div>
|
|
|
</div>
|
|
|
- <p :class="['notice', isHasRemark ? 'hasRemark' : '']" v-if="curQue.notice">
|
|
|
+ <p v-if="curQue.notice" :class="['notice', isHasRemark ? 'hasRemark' : '']">
|
|
|
{{ curQue.notice }}
|
|
|
</p>
|
|
|
<div
|
|
|
- :class="['NNPE-detail', item.isTitle ? 'NNPE-detail-title' : '']"
|
|
|
v-for="(item, index) in resArr"
|
|
|
:key="'detail' + index"
|
|
|
+ :class="['NNPE-detail', item.isTitle ? 'NNPE-detail-title' : '']"
|
|
|
>
|
|
|
<div :class="['article-content', isHasRemark ? 'hasRemark' : '']">
|
|
|
- <RoleChs :curRole="item.roleDetail" :type="curQue.property.role_img_type" />
|
|
|
+ <RoleChs :cur-role="item.roleDetail" :type="curQue.property.role_img_type" />
|
|
|
<div class="wordsList-box">
|
|
|
- <img :src="articleImg[index]" v-if="articleImg[0] && index == 0" />
|
|
|
+ <img v-if="articleImg[0] && index == 0" :src="articleImg[index]" />
|
|
|
<!-- <div class="roleDetail" v-if="item.roleDetail.detail && item.roleDetail.detail.wordsList.length > 0">
|
|
|
<span class="pinyin">{{ item.roleDetail.detail.wordsList | handlePinyin }}</span>
|
|
|
<span class="chs">{{ 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">{{ item.roleDetail.fullName }}</span>
|
|
|
<span class="pinyin">{{ item.roleDetail.fullPinyin }}</span>
|
|
|
</div>
|
|
|
@@ -83,9 +83,9 @@
|
|
|
</div>
|
|
|
<div style="overflow: hidden; clear: both"></div>
|
|
|
<div
|
|
|
- class="NNPE-words"
|
|
|
v-for="(pItem, pIndex) in item.wordsList"
|
|
|
:key="'wordsList' + pIndex"
|
|
|
+ class="NNPE-words"
|
|
|
:class="[
|
|
|
pItem.chs != '“' && pItem.wordIndex == 0 ? 'textLeft' : 'textCenter',
|
|
|
pItem.chs == '“' ? 'textRight' : '',
|
|
|
@@ -119,12 +119,12 @@
|
|
|
newWordList.indexOf(pItem.chs) > -1 ? 'newActive' : '',
|
|
|
pItem.words ? 'newActive' : '',
|
|
|
]"
|
|
|
- @click.stop="viewNotes($event, pItem.words ? pItem.words : pItem.chs)"
|
|
|
:style="{
|
|
|
fontFamily: pItem.config.fontFamily,
|
|
|
height: '28px',
|
|
|
display: 'inline-block',
|
|
|
}"
|
|
|
+ @click.stop="viewNotes($event, pItem.words ? pItem.words : pItem.chs)"
|
|
|
>{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.chs : '' }}</span
|
|
|
>
|
|
|
<span
|
|
|
@@ -150,6 +150,11 @@
|
|
|
<span
|
|
|
class="NNPE-chs"
|
|
|
style="text-align: left"
|
|
|
+ :style="{
|
|
|
+ fontFamily: item.wordsList[pIndex + 1].config.fontFamily,
|
|
|
+ height: '28px',
|
|
|
+ display: 'inline-block',
|
|
|
+ }"
|
|
|
@click.stop="
|
|
|
viewNotes(
|
|
|
$event,
|
|
|
@@ -158,11 +163,6 @@
|
|
|
: item.wordsList[pIndex + 1].chs,
|
|
|
)
|
|
|
"
|
|
|
- :style="{
|
|
|
- fontFamily: item.wordsList[pIndex + 1].config.fontFamily,
|
|
|
- height: '28px',
|
|
|
- display: 'inline-block',
|
|
|
- }"
|
|
|
>{{
|
|
|
NumberList.indexOf(item.wordsList[pIndex + 1].pinyin) == -1
|
|
|
? item.wordsList[pIndex + 1].chs
|
|
|
@@ -173,19 +173,19 @@
|
|
|
v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
|
|
|
class="NNPE-pinyin"
|
|
|
:class="[noFont.indexOf(item.wordsList[pIndex + 1].pinyin) > -1 ? 'noFont' : '']"
|
|
|
- @click.stop="viewNotes($event, item.wordsList[pIndex + 1].pinyin)"
|
|
|
style="text-align: left"
|
|
|
+ @click.stop="viewNotes($event, item.wordsList[pIndex + 1].pinyin)"
|
|
|
>{{ item.wordsList[pIndex + 1].pinyin }}</span
|
|
|
>
|
|
|
</span>
|
|
|
<span
|
|
|
- class="NNPE-words-box"
|
|
|
v-if="
|
|
|
item.wordsList[pIndex + 2] &&
|
|
|
item.wordsList[pIndex + 2].chs &&
|
|
|
(chsFhList.indexOf(item.wordsList[pIndex + 2].chs) > -1 ||
|
|
|
NumberList.indexOf(item.wordsList[pIndex + 2].chs) > -1)
|
|
|
"
|
|
|
+ class="NNPE-words-box"
|
|
|
>
|
|
|
<span
|
|
|
v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
|
|
|
@@ -193,8 +193,8 @@
|
|
|
'NNPE-pinyin',
|
|
|
noFont.indexOf(item.wordsList[pIndex + 2].pinyin) > -1 ? 'noFont' : '',
|
|
|
]"
|
|
|
- @click.stop="viewNotes($event, item.wordsList[pIndex + 2].pinyin)"
|
|
|
style="text-align: left"
|
|
|
+ @click.stop="viewNotes($event, item.wordsList[pIndex + 2].pinyin)"
|
|
|
>{{ item.wordsList[pIndex + 2].pinyin }}</span
|
|
|
>
|
|
|
<span
|
|
|
@@ -209,6 +209,11 @@
|
|
|
? 'wordActive'
|
|
|
: '',
|
|
|
]"
|
|
|
+ :style="{
|
|
|
+ fontFamily: item.wordsList[pIndex + 2].config.fontFamily,
|
|
|
+ height: '28px',
|
|
|
+ display: 'inline-block',
|
|
|
+ }"
|
|
|
@click.stop="
|
|
|
viewNotes(
|
|
|
$event,
|
|
|
@@ -217,11 +222,6 @@
|
|
|
: item.wordsList[pIndex + 2].chs,
|
|
|
)
|
|
|
"
|
|
|
- :style="{
|
|
|
- fontFamily: item.wordsList[pIndex + 2].config.fontFamily,
|
|
|
- height: '28px',
|
|
|
- display: 'inline-block',
|
|
|
- }"
|
|
|
>{{
|
|
|
NumberList.indexOf(item.wordsList[pIndex + 2].pinyin) == -1
|
|
|
? item.wordsList[pIndex + 2].chs
|
|
|
@@ -234,8 +234,8 @@
|
|
|
'NNPE-pinyin',
|
|
|
noFont.indexOf(item.wordsList[pIndex + 2].pinyin) > -1 ? 'noFont' : '',
|
|
|
]"
|
|
|
- @click.stop="viewNotes($event, item.wordsList[pIndex + 2].pinyin)"
|
|
|
style="text-align: left"
|
|
|
+ @click.stop="viewNotes($event, item.wordsList[pIndex + 2].pinyin)"
|
|
|
>{{ item.wordsList[pIndex + 2].pinyin }}</span
|
|
|
>
|
|
|
</span>
|
|
|
@@ -260,12 +260,12 @@
|
|
|
pItem.chs != '“' && pItem.padding && config.isShowPY ? 'padding' : '',
|
|
|
pItem.words ? 'newActive' : '',
|
|
|
]"
|
|
|
- @click.stop="viewNotes($event, pItem.words ? pItem.words : pItem.chs)"
|
|
|
:style="{
|
|
|
fontFamily: pItem.config.fontFamily,
|
|
|
height: '28px',
|
|
|
display: 'inline-block',
|
|
|
}"
|
|
|
+ @click.stop="viewNotes($event, pItem.words ? pItem.words : pItem.chs)"
|
|
|
>{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.chs : '' }}</span
|
|
|
>
|
|
|
<span
|
|
|
@@ -303,9 +303,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'"
|
|
|
>
|
|
|
{{
|
|
|
curQue.detail[index].multilingualTextList && curQue.detail[index].multilingualTextList[multilingual]
|
|
|
@@ -314,13 +314,13 @@
|
|
|
}}
|
|
|
</div>
|
|
|
</div>
|
|
|
- <img :src="articleImg[index + 1]" v-if="articleImg[index + 1]" />
|
|
|
+ <img v-if="articleImg[index + 1]" :src="articleImg[index + 1]" />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="remarkBox remark-top">
|
|
|
<RemarkChs
|
|
|
- :remarkDetail="item.remarkDetail"
|
|
|
- :marginTop="item.roleDetail.detail && item.roleDetail.detail.wordsList.length > 0 ? 44 : 8"
|
|
|
+ :remark-detail="item.remarkDetail"
|
|
|
+ :margin-top="item.roleDetail.detail && item.roleDetail.detail.wordsList.length > 0 ? 44 : 8"
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -330,9 +330,9 @@
|
|
|
</div>
|
|
|
<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' : '']">
|
|
|
{{
|
|
|
@@ -343,29 +343,29 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <div class="dia-article-record" v-if="1 == 2">
|
|
|
- <Soundrecord @handleWav="handleWav" type="promax" class="luyin-box" />
|
|
|
+ <div v-if="1 == 2" class="dia-article-record">
|
|
|
+ <Soundrecord type="promax" class="luyin-box" @handleWav="handleWav" />
|
|
|
</div>
|
|
|
</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="diaPhraAudio"
|
|
|
+ ref="audioLine"
|
|
|
+ audio-id="diaPhraAudio"
|
|
|
:mp3="curQue.mp3_list[0].url"
|
|
|
- :getCurTime="getCurTime"
|
|
|
- :mp3Source="curQue.mp3_list[0].source"
|
|
|
+ :get-cur-time="getCurTime"
|
|
|
+ :mp3-source="curQue.mp3_list[0].source"
|
|
|
:width="colLength == 2 ? 200 : isPhone ? 200 : 790"
|
|
|
- ref="audioLine"
|
|
|
/>
|
|
|
</template>
|
|
|
</div>
|
|
|
@@ -404,16 +404,16 @@
|
|
|
>
|
|
|
<Wordcard
|
|
|
:word="word"
|
|
|
- :changeWordCard="changeWordCard"
|
|
|
- :themeColor="attrib ? attrib.topic_color : '#e35454'"
|
|
|
- :currentTreeID="currentTreeID"
|
|
|
+ :change-word-card="changeWordCard"
|
|
|
+ :theme-color="attrib ? attrib.topic_color : '#e35454'"
|
|
|
+ :current-tree-i-d="currentTreeID"
|
|
|
:TaskModel="TaskModel"
|
|
|
- :writeList="curQue.Bookanswer.writeModel"
|
|
|
- @changeCurQue="changeCurQue"
|
|
|
- :mp3Url="wordPlayMp3"
|
|
|
+ :write-list="curQue.Bookanswer.writeModel"
|
|
|
+ :mp3-url="wordPlayMp3"
|
|
|
:bg="wordbgs"
|
|
|
:ed="wordeds"
|
|
|
:attrib="attrib"
|
|
|
+ @changeCurQue="changeCurQue"
|
|
|
/>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -426,7 +426,7 @@
|
|
|
left: windowWidth > 642 ? '' : '0px',
|
|
|
}"
|
|
|
>
|
|
|
- <Notecard :item="curNoteCon" :changeCard="changeCard" :attrib="attrib" />
|
|
|
+ <Notecard :item="curNoteCon" :change-card="changeCard" :attrib="attrib" />
|
|
|
</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
@@ -442,22 +442,6 @@ import RemarkChs from './RemarkChs.vue';
|
|
|
import Soundrecord from '../../common/SoundRecord.vue';
|
|
|
export default {
|
|
|
name: 'PhraseModelChs',
|
|
|
- props: [
|
|
|
- 'curQue',
|
|
|
- 'bodyLeft',
|
|
|
- 'NNPENewWordList',
|
|
|
- 'NNPEAnnotationList',
|
|
|
- 'colorBox',
|
|
|
- 'attrib',
|
|
|
- 'noFont',
|
|
|
- 'currentTreeID',
|
|
|
- 'config',
|
|
|
- 'TaskModel',
|
|
|
- 'colLength',
|
|
|
- 'NpcNewWordMp3',
|
|
|
- 'isPhone',
|
|
|
- 'multilingual',
|
|
|
- ],
|
|
|
components: {
|
|
|
AudioLine,
|
|
|
Wordcard,
|
|
|
@@ -471,7 +455,7 @@ export default {
|
|
|
let str = '';
|
|
|
wordsList.forEach((item, index) => {
|
|
|
if (index < wordsList.length - 1) {
|
|
|
- str += item.pinyin + ' ';
|
|
|
+ str += `${item.pinyin} `;
|
|
|
} else {
|
|
|
str += item.pinyin;
|
|
|
}
|
|
|
@@ -482,7 +466,7 @@ export default {
|
|
|
let str = '';
|
|
|
wordsList.forEach((item, index) => {
|
|
|
if (index < wordsList.length - 1) {
|
|
|
- str += item.chs + ' ';
|
|
|
+ str += `${item.chs} `;
|
|
|
} else {
|
|
|
str += item.chs;
|
|
|
}
|
|
|
@@ -490,10 +474,26 @@ export default {
|
|
|
return str;
|
|
|
},
|
|
|
},
|
|
|
+ props: [
|
|
|
+ 'curQue',
|
|
|
+ 'bodyLeft',
|
|
|
+ 'NNPENewWordList',
|
|
|
+ 'NNPEAnnotationList',
|
|
|
+ 'colorBox',
|
|
|
+ 'attrib',
|
|
|
+ 'noFont',
|
|
|
+ 'currentTreeID',
|
|
|
+ 'config',
|
|
|
+ 'TaskModel',
|
|
|
+ 'colLength',
|
|
|
+ 'NpcNewWordMp3',
|
|
|
+ 'isPhone',
|
|
|
+ 'multilingual',
|
|
|
+ ],
|
|
|
data() {
|
|
|
return {
|
|
|
resArr: [],
|
|
|
- curTime: 0, //单位s
|
|
|
+ curTime: 0, // 单位s
|
|
|
chsFhList: [',', '。', '”', ':', '》', '?', '!', ';', '#', '、'],
|
|
|
enFhList: [',', '.', ';', '?', '!', ':', '>', '<'],
|
|
|
NumberList: ['①', '②', '③', '④', '⑤', '⑥', '⑦', '⑧', '⑨', '⑩', '⑪', '⑫', '⑬', '⑭', '⑮', '⑯', '⑰', '⑱', '⑲', '⑳'],
|
|
|
@@ -528,7 +528,7 @@ export default {
|
|
|
computed: {},
|
|
|
watch: {
|
|
|
hz: {
|
|
|
- handler: function (val, oldVal) {
|
|
|
+ handler(val, oldVal) {
|
|
|
let _this = this;
|
|
|
if (val) {
|
|
|
_this.handleNewWords(val, _this.top, _this.left);
|
|
|
@@ -538,7 +538,7 @@ export default {
|
|
|
deep: true,
|
|
|
},
|
|
|
isShow: {
|
|
|
- handler: function (val, oldVal) {
|
|
|
+ handler(val, oldVal) {
|
|
|
let _this = this;
|
|
|
if (val) {
|
|
|
setTimeout(() => {
|
|
|
@@ -555,7 +555,7 @@ export default {
|
|
|
deep: true,
|
|
|
},
|
|
|
noteNum: {
|
|
|
- handler: function (val, oldVal) {
|
|
|
+ handler(val, oldVal) {
|
|
|
let _this = this;
|
|
|
if (val) {
|
|
|
_this.handleNote(val);
|
|
|
@@ -565,7 +565,7 @@ export default {
|
|
|
deep: true,
|
|
|
},
|
|
|
isNoteShow: {
|
|
|
- handler: function (val, oldVal) {
|
|
|
+ handler(val, oldVal) {
|
|
|
let _this = this;
|
|
|
if (val) {
|
|
|
setTimeout(() => {
|
|
|
@@ -582,9 +582,31 @@ export default {
|
|
|
deep: true,
|
|
|
},
|
|
|
},
|
|
|
- //方法集合
|
|
|
+ // 生命周期 - 创建完成(可以访问当前this实例)
|
|
|
+ created() {},
|
|
|
+ // 生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
+ mounted() {
|
|
|
+ if (this.NNPENewWordList && this.NNPENewWordList.length > 0) {
|
|
|
+ this.handleNewword();
|
|
|
+ }
|
|
|
+ if (this.curQue) {
|
|
|
+ this.handleData();
|
|
|
+ }
|
|
|
+ window.addEventListener('resize', this.getScreenHeight);
|
|
|
+ this.getScreenHeight();
|
|
|
+ },
|
|
|
+ beforeCreate() {}, // 生命周期 - 创建之前
|
|
|
+ beforeMount() {}, // 生命周期 - 挂载之前
|
|
|
+ beforeUpdate() {}, // 生命周期 - 更新之前
|
|
|
+ updated() {}, // 生命周期 - 更新之后
|
|
|
+ beforeDestroy() {
|
|
|
+ window.removeEventListener('resize', this.getScreenHeight);
|
|
|
+ }, // 生命周期 - 销毁之前
|
|
|
+ destroyed() {}, // 生命周期 - 销毁完成
|
|
|
+ activated() {},
|
|
|
+ // 方法集合
|
|
|
methods: {
|
|
|
- //拼音的显示和隐藏
|
|
|
+ // 拼音的显示和隐藏
|
|
|
changePinyin() {
|
|
|
if (this.config.isHasPY) {
|
|
|
this.$emit('changeConfig', 'isShowPY');
|
|
|
@@ -620,27 +642,25 @@ export default {
|
|
|
dItem.wordsList.forEach((sItem, sIndex) => {
|
|
|
let sentence = dItem.sentences[sIndex];
|
|
|
sItem.forEach((wItem, wIndex) => {
|
|
|
- //this.judgePad(sItem, wItem, wIndex);
|
|
|
+ // this.judgePad(sItem, wItem, wIndex);
|
|
|
this.mergeWordSymbol(wItem);
|
|
|
let words = '';
|
|
|
if (this.newWordList.length > 0) {
|
|
|
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
|
|
|
@@ -648,11 +668,11 @@ export default {
|
|
|
: wItem.pinyin
|
|
|
: wItem.pinyin_tone,
|
|
|
chs: wItem.chs,
|
|
|
- padding: true, //wItem.padding,
|
|
|
+ padding: true, // wItem.padding,
|
|
|
className: wItem.className,
|
|
|
isShow: wItem.isShow,
|
|
|
- words: words,
|
|
|
- isNewWord: this.newWords.indexOf(wItem.chs) > -1 ? true : false,
|
|
|
+ words,
|
|
|
+ isNewWord: this.newWords.indexOf(wItem.chs) > -1,
|
|
|
config: {
|
|
|
fontFamily: wItem.fontFamily,
|
|
|
},
|
|
|
@@ -662,13 +682,13 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
let enwords =
|
|
|
- dItem.sentencesEn && dItem.sentencesEn.length > 0 ? dItem.sentencesEn.join(' ').replace(/\'/g, '’') : '';
|
|
|
+ dItem.sentencesEn && dItem.sentencesEn.length > 0 ? dItem.sentencesEn.join(' ').replace(/\\'/g, '’') : '';
|
|
|
let paraObj = {
|
|
|
wordsList: paraArr,
|
|
|
- enwords: enwords,
|
|
|
- roleDetail: roleDetail,
|
|
|
- remarkDetail: remarkDetail,
|
|
|
- dhaspinyin: dhaspinyin,
|
|
|
+ enwords,
|
|
|
+ roleDetail,
|
|
|
+ remarkDetail,
|
|
|
+ dhaspinyin,
|
|
|
};
|
|
|
resArr.push(paraObj);
|
|
|
});
|
|
|
@@ -682,43 +702,41 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
findLightWord(wItem, startIndex, sentence, sItem) {
|
|
|
- let words = '',
|
|
|
- endIndex = 0;
|
|
|
+ let endIndex = 0;
|
|
|
+ let words = '';
|
|
|
this.newWordList.forEach((item) => {
|
|
|
- if (item.length == 1) {
|
|
|
- if (item == wItem.chs && !wItem.banLight) {
|
|
|
+ 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;
|
|
|
}
|
|
|
},
|
|
|
- //词和标点合一起
|
|
|
+ // 词和标点合一起
|
|
|
mergeWordSymbol(wItem) {
|
|
|
if (this.chsFhList.indexOf(wItem.chs) > -1 || this.NumberList.indexOf(wItem.chs) > -1) {
|
|
|
wItem.isShow = false;
|
|
|
@@ -726,14 +744,14 @@ export default {
|
|
|
wItem.isShow = true;
|
|
|
}
|
|
|
},
|
|
|
- //获取角色
|
|
|
+ // 获取角色
|
|
|
getRole(dItem) {
|
|
|
let roleIndex = dItem.roleIndex;
|
|
|
let resObj = null;
|
|
|
let roleList = JSON.parse(JSON.stringify(this.curQue.property.role_list));
|
|
|
for (let i = 0; i < roleList.length; i++) {
|
|
|
let item = roleList[i];
|
|
|
- if (item.id == roleIndex) {
|
|
|
+ if (item.id === roleIndex) {
|
|
|
resObj = item;
|
|
|
// resObj.color = this.colorBox[i];
|
|
|
break;
|
|
|
@@ -742,7 +760,7 @@ export default {
|
|
|
|
|
|
return resObj;
|
|
|
},
|
|
|
- //判断是否有padding
|
|
|
+ // 判断是否有padding
|
|
|
judgePad(sItem, wItem, curIndex) {
|
|
|
let leg = sItem.length;
|
|
|
if (curIndex < leg - 1) {
|
|
|
@@ -758,7 +776,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- //转化时间
|
|
|
+ // 转化时间
|
|
|
handleTimeList(list) {
|
|
|
let listRes = [];
|
|
|
list.forEach((item) => {
|
|
|
@@ -767,7 +785,7 @@ export default {
|
|
|
});
|
|
|
return listRes;
|
|
|
},
|
|
|
- //点击播放某个句子
|
|
|
+ // 点击播放某个句子
|
|
|
handleChangeTime(time) {
|
|
|
this.curTime = time;
|
|
|
this.$refs.audioLine.onTimeupdateTime(time);
|
|
|
@@ -794,12 +812,12 @@ export default {
|
|
|
if (word && this.newWordList.indexOf(word) > -1) {
|
|
|
this.highWordsArr.push(word);
|
|
|
}
|
|
|
- if (words && word != words && this.newWordList.indexOf(words) > -1) {
|
|
|
+ if (words && word !== words && this.newWordList.indexOf(words) > -1) {
|
|
|
this.highWordsArr.push(words);
|
|
|
}
|
|
|
if (this.newWordList.indexOf(word) > -1 || this.newWordList.indexOf(words) > -1) {
|
|
|
if (word && this.newWordList.indexOf(word) > -1) {
|
|
|
- if (_this.oldHz != word) {
|
|
|
+ if (_this.oldHz !== word) {
|
|
|
this.isShow = false;
|
|
|
setTimeout(() => {
|
|
|
_this.hz = word;
|
|
|
@@ -854,8 +872,8 @@ export default {
|
|
|
JSON.stringify({
|
|
|
list: wordlist,
|
|
|
detail: item,
|
|
|
- top: top,
|
|
|
- left: left,
|
|
|
+ top,
|
|
|
+ left,
|
|
|
}),
|
|
|
);
|
|
|
break;
|
|
|
@@ -881,36 +899,34 @@ export default {
|
|
|
if (_this.NumberList.indexOf(noteNum) > -1) {
|
|
|
for (let i = 0; i < _this.NumberList.length; i++) {
|
|
|
if (_this.NumberList[i] == noteNum) {
|
|
|
- noteIndex = '' + i + '';
|
|
|
+ noteIndex = `${String(i)}`;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
this.showNoteDetail(e, noteIndex);
|
|
|
- } else {
|
|
|
- if (this.newWordList.indexOf(noteNum) > -1) {
|
|
|
- if (_this.oldHz != noteNum) {
|
|
|
- this.isShow = false;
|
|
|
- setTimeout(() => {
|
|
|
- _this.hz = noteNum;
|
|
|
- }, 50);
|
|
|
- }
|
|
|
- _this.clientY = e.clientY;
|
|
|
- let left = e.clientX;
|
|
|
- let width = 0;
|
|
|
-
|
|
|
- if (noteNum.length == 1 || noteNum.length == 2) {
|
|
|
- width = 304;
|
|
|
- } else if (noteNum.length == 3 || noteNum.length == 4) {
|
|
|
- width = 432;
|
|
|
- } else if (noteNum.length > 3) {
|
|
|
- width = 560;
|
|
|
- }
|
|
|
+ } else if (this.newWordList.indexOf(noteNum) > -1) {
|
|
|
+ if (_this.oldHz != noteNum) {
|
|
|
+ this.isShow = false;
|
|
|
+ setTimeout(() => {
|
|
|
+ _this.hz = noteNum;
|
|
|
+ }, 50);
|
|
|
+ }
|
|
|
+ _this.clientY = e.clientY;
|
|
|
+ let left = e.clientX;
|
|
|
+ let width = 0;
|
|
|
|
|
|
- if (left - this.bodyLeft > this.contentWidth / 2) {
|
|
|
- _this.left = left - width + 10;
|
|
|
- } else {
|
|
|
- _this.left = left;
|
|
|
- }
|
|
|
+ if (noteNum.length == 1 || noteNum.length == 2) {
|
|
|
+ width = 304;
|
|
|
+ } else if (noteNum.length == 3 || noteNum.length == 4) {
|
|
|
+ width = 432;
|
|
|
+ } else if (noteNum.length > 3) {
|
|
|
+ width = 560;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (left - this.bodyLeft > this.contentWidth / 2) {
|
|
|
+ _this.left = left - width + 10;
|
|
|
+ } else {
|
|
|
+ _this.left = left;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -954,40 +970,17 @@ export default {
|
|
|
if (answer) {
|
|
|
let writeModel = this.curQue.Bookanswer.writeModel;
|
|
|
let hz = answer.hz;
|
|
|
- if (writeModel.hasOwnProperty(hz)) {
|
|
|
+ if (writeModel.hasOwn(hz)) {
|
|
|
writeModel[hz].push(answer);
|
|
|
} else {
|
|
|
writeModel[hz] = [answer];
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- },
|
|
|
- //生命周期 - 创建完成(可以访问当前this实例)
|
|
|
- created() {},
|
|
|
- //生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
- mounted() {
|
|
|
- if (this.NNPENewWordList && this.NNPENewWordList.length > 0) {
|
|
|
- this.handleNewword();
|
|
|
- }
|
|
|
- if (this.curQue) {
|
|
|
- this.handleData();
|
|
|
- }
|
|
|
- window.addEventListener('resize', this.getScreenHeight);
|
|
|
- this.getScreenHeight();
|
|
|
- },
|
|
|
- beforeCreate() {}, //生命周期 - 创建之前
|
|
|
- beforeMount() {}, //生命周期 - 挂载之前
|
|
|
- beforeUpdate() {}, //生命周期 - 更新之前
|
|
|
- updated() {}, //生命周期 - 更新之后
|
|
|
- beforeDestroy() {
|
|
|
- window.removeEventListener('resize', this.getScreenHeight);
|
|
|
- }, //生命周期 - 销毁之前
|
|
|
- destroyed() {}, //生命周期 - 销毁完成
|
|
|
- activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
+ }, // 如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
-//@import url(); 引入公共css类
|
|
|
.NNPE-ArticleView {
|
|
|
width: 100%;
|
|
|
|