|
@@ -3,7 +3,7 @@
|
|
|
<div class="newWord-preview" :style="getAreaStyle()">
|
|
|
<SerialNumberPosition v-if="isEnable(data.property.sn_display_mode)" :property="data.property" />
|
|
|
|
|
|
- <div class="main" v-if="data">
|
|
|
+ <div v-if="data" class="main">
|
|
|
<div class="NPC-zhedie">
|
|
|
<div class="topTitle">
|
|
|
<div class="NPC-top-left">
|
|
@@ -16,28 +16,28 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<el-collapse-transition>
|
|
|
- <div class="NPC-word-list" v-if="data.option && data.option.length > 0" v-show="wordShow">
|
|
|
- <div class="aduioLine-box" v-if="data.audio_data.file_id">
|
|
|
+ <div v-if="data.option && data.option.length > 0" v-show="wordShow" class="NPC-word-list">
|
|
|
+ <div v-if="data.audio_data.file_id" class="aduioLine-box">
|
|
|
<AudioLine
|
|
|
- :audioId="'newWordAudio' + indexStr"
|
|
|
+ ref="audioLine"
|
|
|
+ :audio-id="'newWordAudio' + indexStr"
|
|
|
:mp3="data.audio_data.url"
|
|
|
- :getCurTime="getCurTime"
|
|
|
+ :get-cur-time="getCurTime"
|
|
|
:ed="ed"
|
|
|
type="audioLine"
|
|
|
- ref="audioLine"
|
|
|
@handleListenRead="handleListenRead"
|
|
|
/>
|
|
|
</div>
|
|
|
<ul class="NPC-word-table" cellspacing="0" border="0" cellpadding="0">
|
|
|
- <li class="NPC-word-tr" v-for="(item, index) in data.option_list" :key="'curQue.option' + index">
|
|
|
+ <li v-for="(item, index) in data.option_list" :key="'curQue.option' + index" class="NPC-word-tr">
|
|
|
<div
|
|
|
+ v-for="(sItem, sIndex) in item"
|
|
|
+ :key="'curQue.option.child' + sIndex"
|
|
|
:class="[
|
|
|
'NPC-word-row',
|
|
|
playClass && mp3_index == sItem.sIndex ? 'active' : '',
|
|
|
curTime >= sItem.bg && curTime < sItem.ed && stopAudioS ? 'active' : '',
|
|
|
]"
|
|
|
- v-for="(sItem, sIndex) in item"
|
|
|
- :key="'curQue.option.child' + sIndex"
|
|
|
>
|
|
|
<template v-if="sItem.bg || sItem.ed">
|
|
|
<a
|
|
@@ -65,15 +65,15 @@
|
|
|
<template v-if="sItem.pinyin_site && (sItem.pinyin_site == 'top' || sItem.pinyin_site == 'bottom')">
|
|
|
<div class="NPC-word-tab-box">
|
|
|
<span
|
|
|
- class="NPC-word-tab-common NPC-word-tab-pinyin"
|
|
|
v-if="sItem.pinyin_site == 'top'"
|
|
|
+ class="NPC-word-tab-common NPC-word-tab-pinyin"
|
|
|
v-html="sItem.pinyin"
|
|
|
>
|
|
|
</span>
|
|
|
<span class="NPC-word-tab-common NPC-word-tab-word" v-html="sItem.new_word"> </span>
|
|
|
<span
|
|
|
- class="NPC-word-tab-common NPC-word-tab-pinyin"
|
|
|
v-if="sItem.pinyin_site == 'bottom'"
|
|
|
+ class="NPC-word-tab-common NPC-word-tab-pinyin"
|
|
|
v-html="sItem.pinyin"
|
|
|
>
|
|
|
</span>
|
|
@@ -87,15 +87,15 @@
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
<span
|
|
|
- class="NPC-word-tab-common NPC-word-tab-pinyin"
|
|
|
v-if="!sItem.pinyin_site || sItem.pinyin_site == 'first'"
|
|
|
+ class="NPC-word-tab-common NPC-word-tab-pinyin"
|
|
|
v-html="sItem.pinyin"
|
|
|
>
|
|
|
</span>
|
|
|
<span class="NPC-word-tab-common NPC-word-tab-word" v-html="sItem.new_word"> </span>
|
|
|
<span
|
|
|
- class="NPC-word-tab-common NPC-word-tab-pinyin"
|
|
|
v-if="sItem.pinyin_site == 'last'"
|
|
|
+ class="NPC-word-tab-common NPC-word-tab-pinyin"
|
|
|
v-html="sItem.pinyin"
|
|
|
>
|
|
|
</span>
|
|
@@ -109,14 +109,14 @@
|
|
|
<span>
|
|
|
<!-- :answerRecordList="data.answer.answer_list[index][sIndex].recordList" -->
|
|
|
<SoundRecord
|
|
|
- :tmIndex="index"
|
|
|
- :tmsIndex="sIndex"
|
|
|
+ :tm-index="index"
|
|
|
+ :tms-index="sIndex"
|
|
|
:task-model="isJudgingRightWrong ? 'ANSWER' : ''"
|
|
|
- @handleWav="handleWav"
|
|
|
- :answerRecordList="[]"
|
|
|
+ :answer-record-list="[]"
|
|
|
type="mini"
|
|
|
class="luyin-box-wordphrase"
|
|
|
:style="{ marginLeft: '8px' }"
|
|
|
+ @handleWav="handleWav"
|
|
|
/>
|
|
|
</span>
|
|
|
<span v-if="isEnable(data.property.is_has_infor)">
|
|
@@ -150,7 +150,7 @@
|
|
|
type="newWordDetail"
|
|
|
/>
|
|
|
</div> -->
|
|
|
- <audio ref="newwordAudio" />
|
|
|
+ <audio ref="newwordAudio"></audio>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -160,7 +160,6 @@
|
|
|
import { getNewWordData, isEnable } from '@/views/book/courseware/data/newWord';
|
|
|
|
|
|
import PreviewMixin from '../common/PreviewMixin';
|
|
|
-import AudioFill from '../fill/components/AudioFillPlay.vue';
|
|
|
import SoundRecord from '../../common/SoundRecord.vue';
|
|
|
import AudioLine from '../voice_matrix/components/AudioLine.vue';
|
|
|
import { GetFileURLMap } from '@/api/app';
|
|
@@ -168,11 +167,11 @@ import { GetFileURLMap } from '@/api/app';
|
|
|
export default {
|
|
|
name: 'NewWordPreview',
|
|
|
components: {
|
|
|
- AudioFill,
|
|
|
SoundRecord,
|
|
|
AudioLine,
|
|
|
},
|
|
|
mixins: [PreviewMixin],
|
|
|
+ inject: ['courseware_id'],
|
|
|
data() {
|
|
|
return {
|
|
|
data: getNewWordData(),
|
|
@@ -210,18 +209,15 @@ export default {
|
|
|
immediate: true,
|
|
|
},
|
|
|
},
|
|
|
- computed: {},
|
|
|
- created() {},
|
|
|
methods: {
|
|
|
- handleChange(val) {},
|
|
|
palyAudio(url, sIndex) {
|
|
|
this.stopAudio();
|
|
|
let mp3 = url;
|
|
|
- let node = document.getElementById('word' + this.indexStr + sIndex);
|
|
|
+ let node = document.getElementById(`word${this.indexStr}${sIndex}`);
|
|
|
let audio = document.getElementsByTagName('audio');
|
|
|
- if (audio && audio.length > 0 && audio.forEach && window.location.href.indexOf('GCLS-Learn') == -1) {
|
|
|
+ if (audio && audio.length > 0 && audio.forEach && window.location.href.indexOf('GCLS-Learn') === -1) {
|
|
|
audio.forEach((item) => {
|
|
|
- if (item.src != mp3) {
|
|
|
+ if (item.src !== mp3) {
|
|
|
item.pause();
|
|
|
}
|
|
|
});
|
|
@@ -262,20 +258,20 @@ export default {
|
|
|
this.detailShow = val;
|
|
|
},
|
|
|
changeDetailIndex(val) {
|
|
|
- if (val == 'last') {
|
|
|
- this.detailIndex--;
|
|
|
+ if (val === 'last') {
|
|
|
+ this.detailIndex -= 1;
|
|
|
} else {
|
|
|
- this.detailIndex++;
|
|
|
+ this.detailIndex += 1;
|
|
|
}
|
|
|
this.dataWord = null;
|
|
|
this.dataWord = this.optionRes[this.detailIndex];
|
|
|
- //this.getWordLiju(this.data.new_word);
|
|
|
+ // this.getWordLiju(this.data.new_word);
|
|
|
},
|
|
|
handlePlayVoice3(mp3) {
|
|
|
let audio = document.getElementsByTagName('audio');
|
|
|
if (audio && audio.length > 0 && window.location.href.indexOf('GCLS-Learn') == -1) {
|
|
|
audio.forEach((item) => {
|
|
|
- if (item.src != mp3) {
|
|
|
+ if (item.src !== mp3) {
|
|
|
item.pause();
|
|
|
}
|
|
|
});
|
|
@@ -297,7 +293,7 @@ export default {
|
|
|
let audio = document.getElementsByTagName('audio');
|
|
|
if (audio && audio.length > 0 && window.location.href.indexOf('GCLS-Learn') == -1) {
|
|
|
audio.forEach((item) => {
|
|
|
- if (item.src != mp3) {
|
|
|
+ if (item.src !== mp3) {
|
|
|
item.pause();
|
|
|
}
|
|
|
});
|
|
@@ -306,9 +302,9 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
// setTimeout(() => {
|
|
|
- //this.$refs.newwordAudio.pause();
|
|
|
+ // this.$refs.newwordAudio.pause();
|
|
|
this.$refs.newwordAudio.src = mp3;
|
|
|
- //this.$refs.newwordAudio.load();
|
|
|
+ // this.$refs.newwordAudio.load();
|
|
|
this.$refs.newwordAudio.play();
|
|
|
// }, 1000);
|
|
|
},
|
|
@@ -330,12 +326,10 @@ export default {
|
|
|
this.data.option.forEach((item) => {
|
|
|
if (item.number) {
|
|
|
option_list.push([item]);
|
|
|
+ } else if (option_list[option_list.length - 1]) {
|
|
|
+ option_list[option_list.length - 1].push(item);
|
|
|
} else {
|
|
|
- if (option_list[option_list.length - 1]) {
|
|
|
- option_list[option_list.length - 1].push(item);
|
|
|
- } else {
|
|
|
- option_list.push([item]);
|
|
|
- }
|
|
|
+ option_list.push([item]);
|
|
|
}
|
|
|
if (item.mp3_list) {
|
|
|
GetFileURLMap({ file_id_list: [item.mp3_list] }).then(({ url_map }) => {
|
|
@@ -373,7 +367,7 @@ export default {
|
|
|
getCurTime(curTime) {
|
|
|
this.curTime = curTime * 1000;
|
|
|
},
|
|
|
- //点击播放某个句子
|
|
|
+ // 点击播放某个句子
|
|
|
handleChangeTime(time, edTime) {
|
|
|
this.curTime = time;
|
|
|
this.stopAudioS = true;
|
|
@@ -387,8 +381,8 @@ export default {
|
|
|
this.ed = null;
|
|
|
},
|
|
|
handleWav(list, tmIndex, tmsIndex) {
|
|
|
- tmIndex = tmIndex ? tmIndex : 0;
|
|
|
- tmsIndex = tmsIndex ? tmsIndex : 0;
|
|
|
+ tmIndex = tmIndex || 0;
|
|
|
+ tmsIndex = tmsIndex || 0;
|
|
|
this.$set(this.data.answer.answer_list[tmIndex][tmsIndex], 'recordList', list);
|
|
|
},
|
|
|
},
|