|
@@ -312,6 +312,7 @@
|
|
|
type="audioLine"
|
|
type="audioLine"
|
|
|
:attrib="data.unified_attrib"
|
|
:attrib="data.unified_attrib"
|
|
|
@handleListenRead="handleListenRead"
|
|
@handleListenRead="handleListenRead"
|
|
|
|
|
+ :stop-audio="stopAudios"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
<ul
|
|
<ul
|
|
@@ -337,6 +338,13 @@
|
|
|
isWholeRecord && sentIndex === sItem.sIndex ? 'active' : '',
|
|
isWholeRecord && sentIndex === sItem.sIndex ? 'active' : '',
|
|
|
]"
|
|
]"
|
|
|
@click="changeWholeIndex(sItem.sIndex)"
|
|
@click="changeWholeIndex(sItem.sIndex)"
|
|
|
|
|
+ :style="{
|
|
|
|
|
+ paddingRight: !(data.property.is_enable_score && data.property.is_enable_score === 'false')
|
|
|
|
|
+ ? isHasScore
|
|
|
|
|
+ ? '254px'
|
|
|
|
|
+ : '166px'
|
|
|
|
|
+ : '',
|
|
|
|
|
+ }"
|
|
|
>
|
|
>
|
|
|
<template v-if="isMobile">
|
|
<template v-if="isMobile">
|
|
|
<div class="content-box">
|
|
<div class="content-box">
|
|
@@ -1108,6 +1116,39 @@
|
|
|
@handleWav="handleWav"
|
|
@handleWav="handleWav"
|
|
|
/>
|
|
/>
|
|
|
</span>
|
|
</span>
|
|
|
|
|
+ <div v-if="data.audio_data.file_id || sItem.mp3_list" class="compare-box">
|
|
|
|
|
+ <Audio-compare
|
|
|
|
|
+ :theme-color="data.unified_attrib ? data.unified_attrib.topic_color : '#e35454'"
|
|
|
|
|
+ :index="sItem.sIndex"
|
|
|
|
|
+ :sent-index="sItem.sIndex"
|
|
|
|
|
+ :url="data.audio_data.file_id ? data.audio_data.url : sItem.mp3_list_url"
|
|
|
|
|
+ :bg="
|
|
|
|
|
+ data.lrc_arr.length > 0 && data.lrc_arr[sItem.sIndex] ? data.lrc_arr[sItem.sIndex].bg : 0
|
|
|
|
|
+ "
|
|
|
|
|
+ :ed="
|
|
|
|
|
+ data.lrc_arr.length > 0 && data.lrc_arr[sItem.sIndex]
|
|
|
|
|
+ ? data.lrc_arr[sItem.sIndex].ed
|
|
|
|
|
+ : 1000000
|
|
|
|
|
+ "
|
|
|
|
|
+ :wavblob="
|
|
|
|
|
+ answer &&
|
|
|
|
|
+ answer.answer_list &&
|
|
|
|
|
+ answer.answer_list[index][sIndex] &&
|
|
|
|
|
+ answer.answer_list[index][sIndex].recordList &&
|
|
|
|
|
+ answer.answer_list[index][sIndex].recordList.length > 0
|
|
|
|
|
+ ? answer.answer_list[index][sIndex].recordList[
|
|
|
|
|
+ answer.answer_list[index][sIndex].recordList.length - 1
|
|
|
|
|
+ ].wavData
|
|
|
|
|
+ : ''
|
|
|
|
|
+ "
|
|
|
|
|
+ :get-cur-time="getCurTimes"
|
|
|
|
|
+ :sent-pause="sentPause"
|
|
|
|
|
+ :is-record="isRecord"
|
|
|
|
|
+ :handle-change-stop-audio="handleChangeStopAudio"
|
|
|
|
|
+ :get-play-status="getPlayStatus"
|
|
|
|
|
+ :attrib="data.unified_attrib"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
<el-button
|
|
<el-button
|
|
|
v-if="!(data.property.is_enable_score && data.property.is_enable_score === 'false')"
|
|
v-if="!(data.property.is_enable_score && data.property.is_enable_score === 'false')"
|
|
|
type="text"
|
|
type="text"
|
|
@@ -1121,7 +1162,7 @@
|
|
|
? 'record-score-btn-has'
|
|
? 'record-score-btn-has'
|
|
|
: '',
|
|
: '',
|
|
|
]"
|
|
]"
|
|
|
- :loading="scoreLoading"
|
|
|
|
|
|
|
+ :loading="scoreIndex === sItem.sIndex && scoreLoading"
|
|
|
@click="handleSingleScore(sItem, sItem.sIndex, index, sIndex)"
|
|
@click="handleSingleScore(sItem, sItem.sIndex, index, sIndex)"
|
|
|
>评分</el-button
|
|
>评分</el-button
|
|
|
>
|
|
>
|
|
@@ -1250,6 +1291,7 @@
|
|
|
<div
|
|
<div
|
|
|
v-if="!(data.property.is_enable_score && data.property.is_enable_score === 'false')"
|
|
v-if="!(data.property.is_enable_score && data.property.is_enable_score === 'false')"
|
|
|
style="display: flex; padding-left: 12px; border-top: 1px solid rgba(0, 0, 0, 10%)"
|
|
style="display: flex; padding-left: 12px; border-top: 1px solid rgba(0, 0, 0, 10%)"
|
|
|
|
|
+ :style="{ width: isMobile ? '100%' : rowWidth + 'px' }"
|
|
|
>
|
|
>
|
|
|
<RecordScoreWholeBtn
|
|
<RecordScoreWholeBtn
|
|
|
v-if="data && data.option_list"
|
|
v-if="data && data.option_list"
|
|
@@ -1262,6 +1304,7 @@
|
|
|
record-type="word"
|
|
record-type="word"
|
|
|
:attrib="data.unified_attrib"
|
|
:attrib="data.unified_attrib"
|
|
|
:standard-url="data.audio_data.file_id ? data.audio_data.url : ''"
|
|
:standard-url="data.audio_data.file_id ? data.audio_data.url : ''"
|
|
|
|
|
+ :standard-url-list="data.new_word_list"
|
|
|
:word-time="data.new_word_list"
|
|
:word-time="data.new_word_list"
|
|
|
:sent-list="sentList"
|
|
:sent-list="sentList"
|
|
|
@changeWholeStatus="changeWholeStatus"
|
|
@changeWholeStatus="changeWholeStatus"
|
|
@@ -1286,6 +1329,7 @@
|
|
|
type="audioLine"
|
|
type="audioLine"
|
|
|
:attrib="data.unified_attrib"
|
|
:attrib="data.unified_attrib"
|
|
|
@handleListenRead="handleListenRead"
|
|
@handleListenRead="handleListenRead"
|
|
|
|
|
+ :stop-audio="stopAudios"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
<div
|
|
<div
|
|
@@ -1631,6 +1675,7 @@ import writeTableZoom from './components/writeTableZoom.vue';
|
|
|
import RecordScoreWholeBtn from '../../common/RecordScoreWholeBtn.vue';
|
|
import RecordScoreWholeBtn from '../../common/RecordScoreWholeBtn.vue';
|
|
|
import RecordScoreSingleDetail from '../../common/RecordScoreSingleDetail.vue';
|
|
import RecordScoreSingleDetail from '../../common/RecordScoreSingleDetail.vue';
|
|
|
import { recordSocreSingle } from '@/utils/recordScore.js';
|
|
import { recordSocreSingle } from '@/utils/recordScore.js';
|
|
|
|
|
+import AudioCompare from '../article/components/AudioCompare.vue';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'NewWordPreview',
|
|
name: 'NewWordPreview',
|
|
@@ -1643,6 +1688,7 @@ export default {
|
|
|
writeTableZoom,
|
|
writeTableZoom,
|
|
|
RecordScoreWholeBtn,
|
|
RecordScoreWholeBtn,
|
|
|
RecordScoreSingleDetail,
|
|
RecordScoreSingleDetail,
|
|
|
|
|
+ AudioCompare,
|
|
|
},
|
|
},
|
|
|
mixins: [PreviewMixin],
|
|
mixins: [PreviewMixin],
|
|
|
inject: ['getCoursewareId'],
|
|
inject: ['getCoursewareId'],
|
|
@@ -1707,6 +1753,10 @@ export default {
|
|
|
whileRecordHasScoreList: [], // 保存多次整篇录音每次是否已评分
|
|
whileRecordHasScoreList: [], // 保存多次整篇录音每次是否已评分
|
|
|
sentList: [], // 整篇录音保存单词内容
|
|
sentList: [], // 整篇录音保存单词内容
|
|
|
showRecordScoreList: [], // 显示每条生词后面分数数组
|
|
showRecordScoreList: [], // 显示每条生词后面分数数组
|
|
|
|
|
+ scoreIndex: null, // 单个评分按钮的索引
|
|
|
|
|
+ isHasScore: false, // 是否有录音评分分数
|
|
|
|
|
+ isRecord: false,
|
|
|
|
|
+ stopAudios: false,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -1857,7 +1907,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
palyAudio(url, sIndex) {
|
|
palyAudio(url, sIndex) {
|
|
|
- this.stopAudio();
|
|
|
|
|
|
|
+ this.stopNewWordAudio();
|
|
|
const mp3 = url;
|
|
const mp3 = url;
|
|
|
const node = document.getElementById(`word${this.indexStr}${sIndex}`);
|
|
const node = document.getElementById(`word${this.indexStr}${sIndex}`);
|
|
|
// 列表中的 audio 数量很多,点击时才赋 src,避免一次性创建大量媒体实例
|
|
// 列表中的 audio 数量很多,点击时才赋 src,避免一次性创建大量媒体实例
|
|
@@ -1907,7 +1957,7 @@ export default {
|
|
|
this.dataWord = this.optionRes[this.detailIndex];
|
|
this.dataWord = this.optionRes[this.detailIndex];
|
|
|
// this.getWordLiju(this.data.new_word);
|
|
// this.getWordLiju(this.data.new_word);
|
|
|
},
|
|
},
|
|
|
- stopAudio() {
|
|
|
|
|
|
|
+ stopNewWordAudio() {
|
|
|
this.$refs.newwordAudio.pause();
|
|
this.$refs.newwordAudio.pause();
|
|
|
},
|
|
},
|
|
|
initData() {
|
|
initData() {
|
|
@@ -1920,6 +1970,7 @@ export default {
|
|
|
this.colHasContent = [];
|
|
this.colHasContent = [];
|
|
|
this.sentList = [];
|
|
this.sentList = [];
|
|
|
this.showRecordScoreList = [];
|
|
this.showRecordScoreList = [];
|
|
|
|
|
+ this.isHasScore = false;
|
|
|
this.showObj = {
|
|
this.showObj = {
|
|
|
pinyin: true,
|
|
pinyin: true,
|
|
|
newWord: true,
|
|
newWord: true,
|
|
@@ -2179,6 +2230,7 @@ export default {
|
|
|
)
|
|
)
|
|
|
return;
|
|
return;
|
|
|
this.scoreLoading = true;
|
|
this.scoreLoading = true;
|
|
|
|
|
+ this.scoreIndex = index;
|
|
|
let text = item.new_word;
|
|
let text = item.new_word;
|
|
|
let scoreObj = await recordSocreSingle({
|
|
let scoreObj = await recordSocreSingle({
|
|
|
text,
|
|
text,
|
|
@@ -2193,7 +2245,10 @@ export default {
|
|
|
? 0
|
|
? 0
|
|
|
: 1,
|
|
: 1,
|
|
|
standard:
|
|
standard:
|
|
|
- (this.data.audio_data.file_id && this.data.audio_data.url && this.wordTime && this.wordTime[index]) ||
|
|
|
|
|
|
|
+ (this.data.audio_data.file_id &&
|
|
|
|
|
+ this.data.audio_data.url &&
|
|
|
|
|
+ this.data.lrc_arr.length > 0 &&
|
|
|
|
|
+ this.data.lrc_arr[index]) ||
|
|
|
(item.mp3_list && item.mp3_list_url)
|
|
(item.mp3_list && item.mp3_list_url)
|
|
|
? 'false'
|
|
? 'false'
|
|
|
: 'true',
|
|
: 'true',
|
|
@@ -2204,17 +2259,25 @@ export default {
|
|
|
this.$set(scoreObj, 'score_total', score_total);
|
|
this.$set(scoreObj, 'score_total', score_total);
|
|
|
// 如果有音频 记录课文音频及开始结束时间
|
|
// 如果有音频 记录课文音频及开始结束时间
|
|
|
if (
|
|
if (
|
|
|
- (this.data.audio_data.file_id && this.data.audio_data.url && this.wordTime && this.wordTime[index]) ||
|
|
|
|
|
|
|
+ (this.data.audio_data.file_id &&
|
|
|
|
|
+ this.data.audio_data.url &&
|
|
|
|
|
+ this.data.lrc_arr.length > 0 &&
|
|
|
|
|
+ this.data.lrc_arr[index]) ||
|
|
|
(item.mp3_list && item.mp3_list_url)
|
|
(item.mp3_list && item.mp3_list_url)
|
|
|
) {
|
|
) {
|
|
|
- if (this.data.audio_data.file_id && this.data.audio_data.url && this.wordTime && this.wordTime[index]) {
|
|
|
|
|
|
|
+ if (
|
|
|
|
|
+ this.data.audio_data.file_id &&
|
|
|
|
|
+ this.data.audio_data.url &&
|
|
|
|
|
+ this.data.lrc_arr.length > 0 &&
|
|
|
|
|
+ this.data.lrc_arr[index]
|
|
|
|
|
+ ) {
|
|
|
this.$set(scoreObj, 'audio_url_standard', this.data.audio_data.url);
|
|
this.$set(scoreObj, 'audio_url_standard', this.data.audio_data.url);
|
|
|
- this.$set(scoreObj, 'audio_url_standard_bg', this.wordTime[index].bg);
|
|
|
|
|
- this.$set(scoreObj, 'audio_url_standard_ed', this.wordTime[index].ed);
|
|
|
|
|
|
|
+ this.$set(scoreObj, 'audio_url_standard_bg', this.data.lrc_arr[index].bg);
|
|
|
|
|
+ this.$set(scoreObj, 'audio_url_standard_ed', this.data.lrc_arr[index].ed);
|
|
|
} else {
|
|
} else {
|
|
|
this.$set(scoreObj, 'audio_url_standard', item.mp3_list_url);
|
|
this.$set(scoreObj, 'audio_url_standard', item.mp3_list_url);
|
|
|
this.$set(scoreObj, 'audio_url_standard_bg', 0);
|
|
this.$set(scoreObj, 'audio_url_standard_bg', 0);
|
|
|
- this.$set(scoreObj, 'audio_url_standard_ed', 10000);
|
|
|
|
|
|
|
+ this.$set(scoreObj, 'audio_url_standard_ed', 1000000);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -2225,6 +2288,7 @@ export default {
|
|
|
(item.def_str ? ' · ' + item.def_str : '');
|
|
(item.def_str ? ' · ' + item.def_str : '');
|
|
|
this.$set(scoreObj, 'singleText', singleText);
|
|
this.$set(scoreObj, 'singleText', singleText);
|
|
|
this.showRecordScoreList[index] = scoreObj;
|
|
this.showRecordScoreList[index] = scoreObj;
|
|
|
|
|
+ this.isHasScore = true;
|
|
|
},
|
|
},
|
|
|
recordScoreStyle(score) {
|
|
recordScoreStyle(score) {
|
|
|
let style = {
|
|
let style = {
|
|
@@ -2256,6 +2320,7 @@ export default {
|
|
|
getWholeRecordIndex(index, result) {
|
|
getWholeRecordIndex(index, result) {
|
|
|
this.wholeRecordIndex = index;
|
|
this.wholeRecordIndex = index;
|
|
|
this.showRecordScoreList = result;
|
|
this.showRecordScoreList = result;
|
|
|
|
|
+ this.isHasScore = true;
|
|
|
// let indexs = 0;
|
|
// let indexs = 0;
|
|
|
// this.answer.answer_list.forEach((item) => {
|
|
// this.answer.answer_list.forEach((item) => {
|
|
|
// item.forEach((items) => {
|
|
// item.forEach((items) => {
|
|
@@ -2314,8 +2379,33 @@ export default {
|
|
|
this.$set(item, 'singleText', singleText);
|
|
this.$set(item, 'singleText', singleText);
|
|
|
});
|
|
});
|
|
|
this.showRecordScoreList = score;
|
|
this.showRecordScoreList = score;
|
|
|
|
|
+ this.isHasScore = true;
|
|
|
this.whileRecordScoreList[this.wholeRecordIndex] = list;
|
|
this.whileRecordScoreList[this.wholeRecordIndex] = list;
|
|
|
},
|
|
},
|
|
|
|
|
+ getCurTimes(curTime) {
|
|
|
|
|
+ this.curTime = curTime * 1000;
|
|
|
|
|
+ // this.getSentIndex(this.curTime);
|
|
|
|
|
+ },
|
|
|
|
|
+ getSentIndex(curTime) {
|
|
|
|
|
+ for (let i = 0; i < this.data.lrc_arr.length; i++) {
|
|
|
|
|
+ let bg = this.data.lrc_arr[i].bg;
|
|
|
|
|
+ let ed = this.data.lrc_arr[i].ed;
|
|
|
|
|
+ if (curTime >= bg && curTime <= ed) {
|
|
|
|
|
+ this.sentIndex = i;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ sentPause(isRecord) {
|
|
|
|
|
+ this.isRecord = isRecord;
|
|
|
|
|
+ },
|
|
|
|
|
+ // 音频播放时改变布尔值
|
|
|
|
|
+ handleChangeStopAudio() {
|
|
|
|
|
+ this.stopAudios = false;
|
|
|
|
|
+ },
|
|
|
|
|
+ getPlayStatus(val) {
|
|
|
|
|
+ // this.isPlaying = val;
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|