|
|
@@ -252,6 +252,7 @@ import Practice from './Practicechs.vue'; // 语音练习模式
|
|
|
import WordModel from './WordModelChs.vue'; // 语音练习模式
|
|
|
import Voicefullscreen from '../article/Voicefullscreen.vue';
|
|
|
import { getToken } from '@/utils/auth';
|
|
|
+import { GetFileURLMap } from '@/api/app';
|
|
|
import { analysSubmit, getSysConfig } from '@/api/article';
|
|
|
import NewWordPreview from '../new_word/NewWordPreview.vue';
|
|
|
import NotesPreview from '../notes/NotesPreview.vue';
|
|
|
@@ -540,6 +541,77 @@ export default {
|
|
|
// this.data.mp3_list[0].url = url_map[this.data.mp3_list[0].file_id];
|
|
|
// });
|
|
|
}
|
|
|
+ // 处理课文里生词表的音频和时间
|
|
|
+ if (this.data.new_word_list && this.data.new_word_list.new_word_list) {
|
|
|
+ if (this.data.new_word_list.audio_data && this.data.new_word_list.audio_data.temporary_url) {
|
|
|
+ // 如果大音频存在
|
|
|
+ this.data.new_word_list.new_word_list.forEach((item, index) => {
|
|
|
+ this.$set(item, 'audio_file_url', this.data.new_word_list.audio_data.temporary_url);
|
|
|
+ this.$set(
|
|
|
+ item,
|
|
|
+ 'audio_begin_time',
|
|
|
+ this.data.new_word_list.lrc_arr[index] ? this.data.new_word_list.lrc_arr[index].bg : null,
|
|
|
+ );
|
|
|
+ this.$set(
|
|
|
+ item,
|
|
|
+ 'audio_end_time',
|
|
|
+ this.data.new_word_list.lrc_arr[index] ? this.data.new_word_list.lrc_arr[index].ed : null,
|
|
|
+ );
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ let mp3_list = [];
|
|
|
+ this.data.new_word_list.new_word_list.forEach((item, index) => {
|
|
|
+ mp3_list.push(item.mp3_list);
|
|
|
+ });
|
|
|
+ GetFileURLMap({ file_id_list: mp3_list }).then(({ url_map }) => {
|
|
|
+ this.data.new_word_list.new_word_list.forEach((item, index) => {
|
|
|
+ this.$set(item, 'audio_file_url', url_map[item.mp3_list]);
|
|
|
+ this.$set(item, 'audio_begin_time', null);
|
|
|
+ this.$set(item, 'audio_end_time', null);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 处理课文里其他词汇表的音频和时间
|
|
|
+ if (this.data.other_word_list && this.data.other_word_list.new_word_list) {
|
|
|
+ if (this.data.other_word_list.audio_data && this.data.other_word_list.audio_data.temporary_url) {
|
|
|
+ // 如果大音频存在
|
|
|
+ this.data.other_word_list.new_word_list.forEach((item, index) => {
|
|
|
+ this.$set(item, 'audio_file_url', this.data.other_word_list.audio_data.temporary_url);
|
|
|
+ this.$set(
|
|
|
+ item,
|
|
|
+ 'audio_begin_time',
|
|
|
+ this.data.other_word_list.lrc_arr[index] ? this.data.other_word_list.lrc_arr[index].bg : -1,
|
|
|
+ );
|
|
|
+ this.$set(
|
|
|
+ item,
|
|
|
+ 'audio_end_time',
|
|
|
+ this.data.other_word_list.lrc_arr[index] ? this.data.other_word_list.lrc_arr[index].ed : -1,
|
|
|
+ );
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ let mp3_list = [];
|
|
|
+ this.data.other_word_list.new_word_list.forEach((item, index) => {
|
|
|
+ mp3_list.push(item.mp3_list);
|
|
|
+ });
|
|
|
+ GetFileURLMap({ file_id_list: mp3_list }).then(({ url_map }) => {
|
|
|
+ this.data.other_word_list.new_word_list.forEach((item, index) => {
|
|
|
+ this.$set(item, 'audio_file_url', url_map[item.mp3_list]);
|
|
|
+ this.$set(item, 'audio_begin_time', null);
|
|
|
+ this.$set(item, 'audio_end_time', null);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.data.new_word_list_other_component_input) {
|
|
|
+ this.data.new_word_list_other_component_input.forEach((item) => {
|
|
|
+ if (item.audio_begin_time === -1) {
|
|
|
+ item.audio_begin_time = null;
|
|
|
+ item.audio_end_time = null;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
this.NNPENewWordList = (
|
|
|
this.data.new_word_list_other_component_input ? this.data.new_word_list_other_component_input : []
|
|
|
)
|