|
|
@@ -299,9 +299,8 @@
|
|
|
height: hzSize * 1.17 + 'px',
|
|
|
}"
|
|
|
>
|
|
|
- <template>
|
|
|
+ <template v-for="(wItem, wIndex) in pItem.leg">
|
|
|
<span
|
|
|
- v-for="(wItem, wIndex) in pItem.leg"
|
|
|
:key="'ci' + wIndex + pIndex + curSentIndex"
|
|
|
:class="[
|
|
|
pItem.timeList &&
|
|
|
@@ -557,8 +556,6 @@
|
|
|
|
|
|
<script>
|
|
|
import AudioLineSentence from './components/AudioLineSentence.vue';
|
|
|
-import Soundrecorddiff from './components/Soundrecorddiff.vue';
|
|
|
-import AudioCompare from './components/AudioCompare.vue';
|
|
|
import Wordcard from './components/Wordcard.vue';
|
|
|
import Notecard from './components/Notecard.vue'; // 注释
|
|
|
import { LearnWebSI } from '@/api/app';
|
|
|
@@ -567,8 +564,6 @@ export default {
|
|
|
name: 'VoiceFullScreen',
|
|
|
components: {
|
|
|
AudioLineSentence,
|
|
|
- Soundrecorddiff,
|
|
|
- AudioCompare,
|
|
|
Wordcard,
|
|
|
Notecard,
|
|
|
},
|
|
|
@@ -658,7 +653,7 @@ export default {
|
|
|
},
|
|
|
watch: {
|
|
|
isRecording: {
|
|
|
- handler(newVal, oldVal) {
|
|
|
+ handler(newVal) {
|
|
|
if (newVal) {
|
|
|
this.isBottomShow = newVal;
|
|
|
}
|
|
|
@@ -666,7 +661,7 @@ export default {
|
|
|
deep: true,
|
|
|
},
|
|
|
recordPlaying: {
|
|
|
- handler(newVal, oldVal) {
|
|
|
+ handler(newVal) {
|
|
|
if (newVal) {
|
|
|
this.isBottomShow = newVal;
|
|
|
}
|
|
|
@@ -674,32 +669,30 @@ export default {
|
|
|
deep: true,
|
|
|
},
|
|
|
sentIndex: {
|
|
|
- handler(newVal, oldVal) {
|
|
|
+ handler(newVal) {
|
|
|
this.curSentIndex = newVal;
|
|
|
this.getSentence();
|
|
|
},
|
|
|
deep: true,
|
|
|
},
|
|
|
hz: {
|
|
|
- handler(val, oldVal) {
|
|
|
- let _this = this;
|
|
|
+ handler(val) {
|
|
|
if (val) {
|
|
|
- _this.handleNewWords(val);
|
|
|
+ this.handleNewWords(val);
|
|
|
}
|
|
|
},
|
|
|
// 深度观察监听
|
|
|
deep: true,
|
|
|
},
|
|
|
isShow: {
|
|
|
- handler(val, oldVal) {
|
|
|
- let _this = this;
|
|
|
+ handler(val) {
|
|
|
if (val) {
|
|
|
setTimeout(() => {
|
|
|
- _this.cardHeight = _this.$refs.wordcard.offsetHeight;
|
|
|
- if (_this.screenHeight - _this.clientY > _this.cardHeight) {
|
|
|
- _this.top = _this.clientY + 20;
|
|
|
+ this.cardHeight = this.$refs.wordcard.offsetHeight;
|
|
|
+ if (this.screenHeight - this.clientY > this.cardHeight) {
|
|
|
+ this.top = this.clientY + 20;
|
|
|
} else {
|
|
|
- _this.top = _this.clientY - _this.cardHeight - 30;
|
|
|
+ this.top = this.clientY - this.cardHeight - 30;
|
|
|
}
|
|
|
}, 50);
|
|
|
}
|
|
|
@@ -708,15 +701,14 @@ export default {
|
|
|
deep: true,
|
|
|
},
|
|
|
isNoteShow: {
|
|
|
- handler(val, oldVal) {
|
|
|
- let _this = this;
|
|
|
+ handler(val) {
|
|
|
if (val) {
|
|
|
setTimeout(() => {
|
|
|
- _this.cardHeight = _this.$refs.notecard.offsetHeight;
|
|
|
- if (_this.screenHeight - _this.clientY > _this.cardHeight) {
|
|
|
- _this.top = _this.clientY + 20;
|
|
|
+ this.cardHeight = this.$refs.notecard.offsetHeight;
|
|
|
+ if (this.screenHeight - this.clientY > this.cardHeight) {
|
|
|
+ this.top = this.clientY + 20;
|
|
|
} else {
|
|
|
- _this.top = _this.clientY - _this.cardHeight - 30;
|
|
|
+ this.top = this.clientY - this.cardHeight - 30;
|
|
|
}
|
|
|
}, 50);
|
|
|
}
|
|
|
@@ -729,34 +721,33 @@ export default {
|
|
|
created() {},
|
|
|
// 生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted() {
|
|
|
- let _this = this;
|
|
|
window.addEventListener('resize', this.getScreenHeight);
|
|
|
- _this.getScreenHeight();
|
|
|
- document.addEventListener('keyup', function (e) {
|
|
|
- if (_this.isKeyboard) {
|
|
|
- if (e.keyCode == 32) {
|
|
|
+ this.getScreenHeight();
|
|
|
+ document.addEventListener('keyup', (e) => {
|
|
|
+ if (this.isKeyboard) {
|
|
|
+ if (e.keyCode === 32) {
|
|
|
// 空格
|
|
|
- _this.$nextTick(() => {
|
|
|
- if (_this.$refs.audioLineSent) {
|
|
|
- _this.$refs.audioLineSent.PlayAudio();
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (this.$refs.audioLineSent) {
|
|
|
+ this.$refs.audioLineSent.PlayAudio();
|
|
|
}
|
|
|
});
|
|
|
- } else if (e.keyCode == 38) {
|
|
|
- _this.prevSentence();
|
|
|
- } else if (e.keyCode == 40) {
|
|
|
- _this.nextSentence();
|
|
|
- } else if (e.keyCode == 13) {
|
|
|
- _this.$nextTick(() => {
|
|
|
- _this.$refs.Soundrecorddiff.microphone();
|
|
|
+ } else if (e.keyCode === 38) {
|
|
|
+ this.prevSentence();
|
|
|
+ } else if (e.keyCode === 40) {
|
|
|
+ this.nextSentence();
|
|
|
+ } else if (e.keyCode === 13) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.Soundrecorddiff.microphone();
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- if (_this.NNPENewWordList) {
|
|
|
- _this.handleNewword();
|
|
|
+ if (this.NNPENewWordList) {
|
|
|
+ this.handleNewword();
|
|
|
}
|
|
|
- _this.curSentIndex = _this.sentIndex;
|
|
|
- _this.getSentence();
|
|
|
+ this.curSentIndex = this.sentIndex;
|
|
|
+ this.getSentence();
|
|
|
document.addEventListener('fullscreenchange', () => {
|
|
|
let isFullscreen =
|
|
|
document.fullscreenElement ||
|
|
|
@@ -767,7 +758,7 @@ export default {
|
|
|
document.webkitIsFullScreen;
|
|
|
|
|
|
if (!isFullscreen) {
|
|
|
- _this.changeFullScreen();
|
|
|
+ this.changeFullScreen();
|
|
|
}
|
|
|
});
|
|
|
document.addEventListener('mozfullscreenchange', () => {
|
|
|
@@ -780,7 +771,7 @@ export default {
|
|
|
document.webkitIsFullScreen;
|
|
|
|
|
|
if (!isFullscreen) {
|
|
|
- _this.changeFullScreen();
|
|
|
+ this.changeFullScreen();
|
|
|
}
|
|
|
});
|
|
|
document.addEventListener('webkitfullscreenchange', () => {
|
|
|
@@ -793,7 +784,7 @@ export default {
|
|
|
document.webkitIsFullScreen;
|
|
|
|
|
|
if (!isFullscreen) {
|
|
|
- _this.changeFullScreen();
|
|
|
+ this.changeFullScreen();
|
|
|
}
|
|
|
});
|
|
|
document.addEventListener('msfullscreenchange', () => {
|
|
|
@@ -806,7 +797,7 @@ export default {
|
|
|
document.webkitIsFullScreen;
|
|
|
|
|
|
if (!isFullscreen) {
|
|
|
- _this.changeFullScreen();
|
|
|
+ this.changeFullScreen();
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
@@ -833,29 +824,27 @@ export default {
|
|
|
this.recordPlaying = bool;
|
|
|
},
|
|
|
setFontSize(type) {
|
|
|
- let _this = this;
|
|
|
- if (type == '-') {
|
|
|
- if (_this.hzSize >= 34) {
|
|
|
+ if (type === '-') {
|
|
|
+ if (this.hzSize >= 34) {
|
|
|
this.hzSize -= 4;
|
|
|
}
|
|
|
}
|
|
|
- if (type == '+') {
|
|
|
- if (_this.hzSize <= 76) {
|
|
|
+ if (type === '+') {
|
|
|
+ if (this.hzSize <= 76) {
|
|
|
this.hzSize += 4;
|
|
|
}
|
|
|
}
|
|
|
- _this.pySize = parseInt(_this.hzSize / 1.5);
|
|
|
- _this.enSize = parseInt(_this.hzSize / 2);
|
|
|
+ this.pySize = parseInt(this.hzSize / 1.5);
|
|
|
+ this.enSize = parseInt(this.hzSize / 2);
|
|
|
},
|
|
|
playChange(bool) {
|
|
|
this.isPlaying = bool;
|
|
|
},
|
|
|
handleColl() {
|
|
|
- let _this = this;
|
|
|
- if (_this.isCollArr[_this.curSentIndex]) {
|
|
|
- _this.cancleColl();
|
|
|
+ if (this.isCollArr[this.curSentIndex]) {
|
|
|
+ this.cancleColl();
|
|
|
} else {
|
|
|
- _this.addColl();
|
|
|
+ this.addColl();
|
|
|
}
|
|
|
},
|
|
|
// 添加收藏
|
|
|
@@ -867,7 +856,7 @@ export default {
|
|
|
let MethodName = 'order-collection_manager-AddMyCollection';
|
|
|
let text = '';
|
|
|
this.item.forEach((item) => {
|
|
|
- if (item.chs != '#') {
|
|
|
+ if (item.chs !== '#') {
|
|
|
text += item.chs;
|
|
|
}
|
|
|
});
|
|
|
@@ -902,7 +891,7 @@ export default {
|
|
|
cancleColl() {
|
|
|
let text = '';
|
|
|
this.item.forEach((item) => {
|
|
|
- if (item.chs != '#') {
|
|
|
+ if (item.chs !== '#') {
|
|
|
text += item.chs;
|
|
|
}
|
|
|
});
|
|
|
@@ -925,7 +914,7 @@ export default {
|
|
|
checkCollStatus() {
|
|
|
let text = '';
|
|
|
this.item.forEach((item) => {
|
|
|
- if (item.chs != '#') {
|
|
|
+ if (item.chs !== '#') {
|
|
|
text += item.chs;
|
|
|
}
|
|
|
});
|
|
|
@@ -936,7 +925,7 @@ export default {
|
|
|
sentence_text: text,
|
|
|
};
|
|
|
LearnWebSI(MethodName, data).then((res) => {
|
|
|
- let collFlag = res.is_collection == 'true';
|
|
|
+ let collFlag = res.is_collection === 'true';
|
|
|
this.$set(this.isCollArr, this.curSentIndex, collFlag);
|
|
|
});
|
|
|
},
|
|
|
@@ -944,20 +933,19 @@ export default {
|
|
|
this[key] = bool;
|
|
|
},
|
|
|
prevSentence() {
|
|
|
- let _this = this;
|
|
|
- if (_this.curSentIndex == 0) {
|
|
|
- // _this.$message.warning("已经是第一个句子了");
|
|
|
+ if (this.curSentIndex === 0) {
|
|
|
+ // this.$message.warning("已经是第一个句子了");
|
|
|
return;
|
|
|
}
|
|
|
- _this.curSentIndex -= 1;
|
|
|
- _this.getSentence();
|
|
|
- if (_this.isAuto) {
|
|
|
- _this.curTime = _this.bg;
|
|
|
- _this.$refs.audioLineSent.onTimeupdateTime(_this.bg / 1000);
|
|
|
+ this.curSentIndex -= 1;
|
|
|
+ this.getSentence();
|
|
|
+ if (this.isAuto) {
|
|
|
+ this.curTime = this.bg;
|
|
|
+ this.$refs.audioLineSent.onTimeupdateTime(this.bg / 1000);
|
|
|
}
|
|
|
},
|
|
|
nextSentence() {
|
|
|
- if (this.curSentIndex == this.sentList.length - 1) {
|
|
|
+ if (this.curSentIndex === this.sentList.length - 1) {
|
|
|
// this.$message.warning("已经是最后一个句子了");
|
|
|
return;
|
|
|
}
|
|
|
@@ -965,7 +953,7 @@ export default {
|
|
|
this.getSentence();
|
|
|
},
|
|
|
rollSentence() {
|
|
|
- if (this.curSentIndex == this.sentList.length - 1) {
|
|
|
+ if (this.curSentIndex === this.sentList.length - 1) {
|
|
|
this.curSentIndex = 0;
|
|
|
} else {
|
|
|
this.curSentIndex += 1;
|
|
|
@@ -973,7 +961,7 @@ export default {
|
|
|
this.getSentence();
|
|
|
},
|
|
|
changeStatus(key) {
|
|
|
- if (key == 'config.isShowEN') {
|
|
|
+ if (key === 'config.isShowEN') {
|
|
|
if (this.enwords) {
|
|
|
this[key] = !this[key];
|
|
|
}
|
|
|
@@ -988,21 +976,20 @@ export default {
|
|
|
this.$emit('changeEN');
|
|
|
},
|
|
|
setStatus() {
|
|
|
- let _this = this;
|
|
|
- if (_this.key == 'isRepeat') {
|
|
|
- if (_this.isRepeat) {
|
|
|
- _this.isRepeat = false;
|
|
|
- _this.isAuto = true;
|
|
|
- _this.key = 'isAuto';
|
|
|
+ if (this.key === 'isRepeat') {
|
|
|
+ if (this.isRepeat) {
|
|
|
+ this.isRepeat = false;
|
|
|
+ this.isAuto = true;
|
|
|
+ this.key = 'isAuto';
|
|
|
} else {
|
|
|
- _this.isRepeat = true;
|
|
|
- _this.key = 'isRepeat';
|
|
|
+ this.isRepeat = true;
|
|
|
+ this.key = 'isRepeat';
|
|
|
}
|
|
|
- } else if (_this.key == 'isAuto') {
|
|
|
- if (_this.isAuto) {
|
|
|
- _this.isRepeat = false;
|
|
|
- _this.isAuto = false;
|
|
|
- _this.key = 'isRepeat';
|
|
|
+ } else if (this.key === 'isAuto') {
|
|
|
+ if (this.isAuto) {
|
|
|
+ this.isRepeat = false;
|
|
|
+ this.isAuto = false;
|
|
|
+ this.key = 'isRepeat';
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -1019,77 +1006,73 @@ export default {
|
|
|
this.isRecord = isRecord;
|
|
|
},
|
|
|
getCurTime(curTime) {
|
|
|
- let _this = this;
|
|
|
- if (_this.isRepeat) {
|
|
|
+ if (this.isRepeat) {
|
|
|
let time = curTime * 1000;
|
|
|
- if (time > _this.ed || time < _this.bg) {
|
|
|
- _this.curTime = _this.bg;
|
|
|
- this.$refs.audioLineSent.onTimeupdateTime(_this.bg / 1000);
|
|
|
+ if (time > this.ed || time < this.bg) {
|
|
|
+ this.curTime = this.bg;
|
|
|
+ this.$refs.audioLineSent.onTimeupdateTime(this.bg / 1000);
|
|
|
} else {
|
|
|
- _this.curTime = curTime * 1000;
|
|
|
+ this.curTime = curTime * 1000;
|
|
|
}
|
|
|
- } else if (_this.isAuto) {
|
|
|
+ } else if (this.isAuto) {
|
|
|
let time = curTime * 1000;
|
|
|
|
|
|
- if (time > _this.ed) {
|
|
|
- _this.rollSentence();
|
|
|
- _this.curTime = _this.bg;
|
|
|
- _this.$refs.audioLineSent.onTimeupdateTime(_this.bg / 1000);
|
|
|
+ if (time > this.ed) {
|
|
|
+ this.rollSentence();
|
|
|
+ this.curTime = this.bg;
|
|
|
+ this.$refs.audioLineSent.onTimeupdateTime(this.bg / 1000);
|
|
|
} else {
|
|
|
- _this.curTime = curTime * 1000;
|
|
|
+ this.curTime = curTime * 1000;
|
|
|
}
|
|
|
} else {
|
|
|
- _this.curTime = curTime * 1000;
|
|
|
+ this.curTime = curTime * 1000;
|
|
|
}
|
|
|
},
|
|
|
getCurCompareTime(curTime) {
|
|
|
- let _this = this;
|
|
|
- _this.curTime = curTime * 1000;
|
|
|
+ this.curTime = curTime * 1000;
|
|
|
},
|
|
|
getCurWordTime(curTime) {
|
|
|
- let _this = this;
|
|
|
- _this.curWordTime = curTime * 1000;
|
|
|
+ this.curWordTime = curTime * 1000;
|
|
|
},
|
|
|
changeBg(bgIndex) {
|
|
|
this.bgIndex = bgIndex;
|
|
|
},
|
|
|
getSentence() {
|
|
|
- let _this = this;
|
|
|
- _this.isShowCompare =
|
|
|
- _this.curQue.Bookanswer.practiceModel[_this.curSentIndex] &&
|
|
|
- _this.curQue.Bookanswer.practiceModel[_this.curSentIndex].recordList &&
|
|
|
- _this.curQue.Bookanswer.practiceModel[_this.curSentIndex].recordList.length > 0;
|
|
|
- _this.pauseAudio();
|
|
|
- _this.isPlaying = false;
|
|
|
- let item = JSON.parse(JSON.stringify(_this.sentList[_this.curSentIndex]));
|
|
|
+ this.isShowCompare =
|
|
|
+ this.curQue.Bookanswer.practiceModel[this.curSentIndex] &&
|
|
|
+ this.curQue.Bookanswer.practiceModel[this.curSentIndex].recordList &&
|
|
|
+ this.curQue.Bookanswer.practiceModel[this.curSentIndex].recordList.length > 0;
|
|
|
+ this.pauseAudio();
|
|
|
+ this.isPlaying = false;
|
|
|
+ let item = JSON.parse(JSON.stringify(this.sentList[this.curSentIndex]));
|
|
|
if (item.sentArr) {
|
|
|
- _this.item = item.sentArr;
|
|
|
- _this.enwords = item.enwords;
|
|
|
+ this.item = item.sentArr;
|
|
|
+ this.enwords = item.enwords;
|
|
|
} else {
|
|
|
- _this.item = item;
|
|
|
+ this.item = item;
|
|
|
}
|
|
|
- _this.sentList.forEach((item) => {
|
|
|
+ this.sentList.forEach((item) => {
|
|
|
this.isCollArr.push(false);
|
|
|
});
|
|
|
- _this.bg =
|
|
|
- _this.curQue.wordTime && _this.curQue.wordTime[_this.curSentIndex]
|
|
|
- ? _this.curQue.wordTime[_this.curSentIndex].bg
|
|
|
+ this.bg =
|
|
|
+ this.curQue.wordTime && this.curQue.wordTime[this.curSentIndex]
|
|
|
+ ? this.curQue.wordTime[this.curSentIndex].bg
|
|
|
: 0;
|
|
|
- _this.ed =
|
|
|
- _this.curQue.wordTime && _this.curQue.wordTime[_this.curSentIndex]
|
|
|
- ? _this.curQue.wordTime[_this.curSentIndex].ed
|
|
|
+ this.ed =
|
|
|
+ this.curQue.wordTime && this.curQue.wordTime[this.curSentIndex]
|
|
|
+ ? this.curQue.wordTime[this.curSentIndex].ed
|
|
|
: 0;
|
|
|
- let maxTime = (_this.ed - _this.bg) / 1000;
|
|
|
+ let maxTime = (this.ed - this.bg) / 1000;
|
|
|
if (maxTime < 1) {
|
|
|
- _this.maxTime = 1;
|
|
|
+ this.maxTime = 1;
|
|
|
} else {
|
|
|
- _this.maxTime = maxTime;
|
|
|
+ this.maxTime = maxTime;
|
|
|
}
|
|
|
- // _this.checkCollStatus();
|
|
|
+ // this.checkCollStatus();
|
|
|
},
|
|
|
pauseAudio() {
|
|
|
let audio = document.getElementsByTagName('audio');
|
|
|
- if (audio && audio.length > 0 && window.location.href.indexOf('GCLS-Learn') == -1 && audio.forEach) {
|
|
|
+ if (audio && audio.length > 0 && window.location.href.indexOf('GCLS-Learn') === -1 && audio.forEach) {
|
|
|
audio.forEach((item) => {
|
|
|
item.pause();
|
|
|
});
|
|
|
@@ -1104,8 +1087,8 @@ export default {
|
|
|
this.$emit('changeIsFull');
|
|
|
},
|
|
|
handleWav(list, tmIndex) {
|
|
|
- tmIndex = tmIndex || 0;
|
|
|
- this.$emit('handleWav', list, tmIndex);
|
|
|
+ let _tmIndex = tmIndex || 0;
|
|
|
+ this.$emit('handleWav', list, _tmIndex);
|
|
|
},
|
|
|
// 录音时暂停音频播放
|
|
|
handleParentPlay() {
|
|
|
@@ -1117,42 +1100,41 @@ export default {
|
|
|
},
|
|
|
// 播放音频
|
|
|
// playWord(item) {
|
|
|
- // let _this = this;
|
|
|
+ //
|
|
|
// if (this.newWordList.indexOf(item.chs) > -1 || item.words) {
|
|
|
- // _this.pauseAudio();
|
|
|
- // _this.isWordPlay = false;
|
|
|
- // _this.wordIndex = item.wordIndex;
|
|
|
+ // this.pauseAudio();
|
|
|
+ // this.isWordPlay = false;
|
|
|
+ // this.wordIndex = item.wordIndex;
|
|
|
// setTimeout(() => {
|
|
|
// let leg = item.timeList.length;
|
|
|
- // _this.wordbg = item.timeList[0].wordBg;
|
|
|
- // _this.worded = item.timeList[leg - 1].wordEd;
|
|
|
- // let wordMaxTime = (_this.worded - _this.wordbg) / 1000;
|
|
|
+ // this.wordbg = item.timeList[0].wordBg;
|
|
|
+ // this.worded = item.timeList[leg - 1].wordEd;
|
|
|
+ // let wordMaxTime = (this.worded - this.wordbg) / 1000;
|
|
|
// if (wordMaxTime < 1) {
|
|
|
- // _this.wordMaxTime = 1;
|
|
|
+ // this.wordMaxTime = 1;
|
|
|
// } else {
|
|
|
- // _this.wordMaxTime = wordMaxTime;
|
|
|
+ // this.wordMaxTime = wordMaxTime;
|
|
|
// }
|
|
|
- // _this.isWordPlay = true;
|
|
|
+ // this.isWordPlay = true;
|
|
|
// }, 50);
|
|
|
// }
|
|
|
// },
|
|
|
playWord(item) {
|
|
|
- let _this = this;
|
|
|
if (this.newWordList.indexOf(item.chs) > -1 || item.words) {
|
|
|
- _this.pauseAudio();
|
|
|
- _this.isNewWordPlay = false;
|
|
|
+ this.pauseAudio();
|
|
|
+ this.isNewWordPlay = false;
|
|
|
let new_word = item.words ? item.words : item.chs;
|
|
|
- _this.NNPENewWordList.forEach((itemn) => {
|
|
|
+ this.NNPENewWordList.forEach((itemn) => {
|
|
|
// items.forEach((itemn) => {
|
|
|
if (itemn.new_word === new_word) {
|
|
|
- _this.wordbg = itemn.bg;
|
|
|
- _this.worded = itemn.ed;
|
|
|
- _this.wordPlayMp3 = itemn.newWordMp3;
|
|
|
+ this.wordbg = itemn.bg;
|
|
|
+ this.worded = itemn.ed;
|
|
|
+ this.wordPlayMp3 = itemn.newWordMp3;
|
|
|
}
|
|
|
// });
|
|
|
});
|
|
|
setTimeout(() => {
|
|
|
- _this.isNewWordPlay = true;
|
|
|
+ this.isNewWordPlay = true;
|
|
|
}, 50);
|
|
|
}
|
|
|
},
|
|
|
@@ -1162,18 +1144,16 @@ export default {
|
|
|
this.wordIndex = -1;
|
|
|
},
|
|
|
showWordDetail(e, item) {
|
|
|
- let _this = this;
|
|
|
-
|
|
|
let noteIndex = '';
|
|
|
- if (_this.TaskModel == 'ANSWER') {
|
|
|
+ if (this.TaskModel === 'ANSWER') {
|
|
|
return;
|
|
|
}
|
|
|
- if (_this.chsFhList.indexOf(item.chs) > -1 || /^[a-zA-Z0-9]/.test(item.chs)) {
|
|
|
+ if (this.chsFhList.indexOf(item.chs) > -1 || /^[a-zA-Z0-9]/.test(item.chs)) {
|
|
|
return;
|
|
|
}
|
|
|
- if (_this.NumberList.indexOf(item.chs) > -1) {
|
|
|
- for (let i = 0; i < _this.NumberList.length; i++) {
|
|
|
- if (_this.NumberList[i] == item.chs) {
|
|
|
+ if (this.NumberList.indexOf(item.chs) > -1) {
|
|
|
+ for (let i = 0; i < this.NumberList.length; i++) {
|
|
|
+ if (this.NumberList[i] === item.chs) {
|
|
|
noteIndex = `${String(i)}`;
|
|
|
break;
|
|
|
}
|
|
|
@@ -1181,79 +1161,76 @@ export default {
|
|
|
|
|
|
this.showNoteDetail(e, noteIndex);
|
|
|
} else if (this.newWordList.indexOf(item.chs) > -1) {
|
|
|
- if (_this.oldHz != item.chs) {
|
|
|
+ if (this.oldHz !== item.chs) {
|
|
|
this.isShow = false;
|
|
|
|
|
|
setTimeout(() => {
|
|
|
- _this.hz = item.words ? item.words : item.chs;
|
|
|
- _this.pinyin = item.pinyin;
|
|
|
- _this.wordIndex = item.wordIndex;
|
|
|
+ this.hz = item.words ? item.words : item.chs;
|
|
|
+ this.pinyin = item.pinyin;
|
|
|
+ this.wordIndex = item.wordIndex;
|
|
|
}, 50);
|
|
|
}
|
|
|
- _this.clientY = e.clientY;
|
|
|
+ this.clientY = e.clientY;
|
|
|
let new_word = item.words ? item.words : item.chs;
|
|
|
- _this.wordPlayMp3 = '';
|
|
|
- _this.NNPENewWordList.forEach((itemn) => {
|
|
|
+ this.wordPlayMp3 = '';
|
|
|
+ this.NNPENewWordList.forEach((itemn) => {
|
|
|
// items.forEach((itemn) => {
|
|
|
if (itemn.new_word === new_word) {
|
|
|
- _this.wordbgs = itemn.bg;
|
|
|
- _this.wordeds = itemn.ed;
|
|
|
- _this.wordPlayMp3 = itemn.newWordMp3;
|
|
|
+ this.wordbgs = itemn.bg;
|
|
|
+ this.wordeds = itemn.ed;
|
|
|
+ this.wordPlayMp3 = itemn.newWordMp3;
|
|
|
}
|
|
|
// });
|
|
|
});
|
|
|
let left = e.clientX;
|
|
|
let width = 0;
|
|
|
- if (item.chs.length == 1 || item.chs.length == 2) {
|
|
|
+ if (item.chs.length === 1 || item.chs.length === 2) {
|
|
|
width = 304;
|
|
|
- } else if (item.chs.length == 3 || item.chs.length == 4) {
|
|
|
+ } else if (item.chs.length === 3 || item.chs.length === 4) {
|
|
|
width = 432;
|
|
|
} else if (item.chs.length > 3) {
|
|
|
width = 560;
|
|
|
}
|
|
|
// if (left - this.bodyLeft > this.contentWidth / 2) {
|
|
|
- // _this.left = left - width + 10;
|
|
|
+ // this.left = left - width + 10;
|
|
|
// } else {
|
|
|
- _this.left = left - width / 2;
|
|
|
+ this.left = left - width / 2;
|
|
|
// }
|
|
|
}
|
|
|
},
|
|
|
showNoteDetail(e, noteNum) {
|
|
|
- let _this = this;
|
|
|
- if (_this.oldNoteNum !== noteNum) {
|
|
|
+ if (this.oldNoteNum !== noteNum) {
|
|
|
this.isNoteShow = false;
|
|
|
setTimeout(() => {
|
|
|
- _this.noteNum = noteNum;
|
|
|
- _this.handleNote(noteNum);
|
|
|
+ this.noteNum = noteNum;
|
|
|
+ this.handleNote(noteNum);
|
|
|
}, 50);
|
|
|
}
|
|
|
- _this.clientY = e.clientY;
|
|
|
+ this.clientY = e.clientY;
|
|
|
let left = e.clientX;
|
|
|
let width = 642;
|
|
|
if (left - this.bodyLeft > this.contentWidth / 2) {
|
|
|
- _this.left = left - width + 10;
|
|
|
+ this.left = left - width + 10;
|
|
|
} else if (left - 200 > 500) {
|
|
|
- _this.left = 500;
|
|
|
+ this.left = 500;
|
|
|
} else {
|
|
|
- _this.left = left - 200;
|
|
|
+ this.left = left - 200;
|
|
|
}
|
|
|
},
|
|
|
changeWordCard(isShow) {
|
|
|
- let _this = this;
|
|
|
- _this.isShow = isShow;
|
|
|
- _this.oldHz = '';
|
|
|
- _this.hz = '';
|
|
|
- _this.wordIndex = -1;
|
|
|
+ this.isShow = isShow;
|
|
|
+ this.oldHz = '';
|
|
|
+ this.hz = '';
|
|
|
+ this.wordIndex = -1;
|
|
|
},
|
|
|
// 处理分词数据
|
|
|
handleNewWords(val) {
|
|
|
- let _this = this;
|
|
|
- _this.isShow = true;
|
|
|
- _this.word = null;
|
|
|
- if (_this.newWordList.indexOf(val) > -1) {
|
|
|
+ this.isShow = true;
|
|
|
+ this.word = null;
|
|
|
+ if (this.newWordList.indexOf(val) > -1) {
|
|
|
for (let i = 0; i < this.NNPENewWordList.length; i++) {
|
|
|
let pItem = this.NNPENewWordList[i];
|
|
|
- if (pItem.new_word.trim() == val.trim()) {
|
|
|
+ if (pItem.new_word.trim() === val.trim()) {
|
|
|
let wordlist = val.split('');
|
|
|
this.word = { list: wordlist, detail: pItem };
|
|
|
break;
|
|
|
@@ -1265,11 +1242,11 @@ export default {
|
|
|
definition_list: [],
|
|
|
mp3_list: [],
|
|
|
new_word: val,
|
|
|
- pinyin: _this.pinyin,
|
|
|
+ pinyin: this.pinyin,
|
|
|
};
|
|
|
- _this.word = { list: wordlist, detail: option };
|
|
|
+ this.word = { list: wordlist, detail: option };
|
|
|
}
|
|
|
- _this.oldHz = val;
|
|
|
+ this.oldHz = val;
|
|
|
},
|
|
|
handleNewword() {
|
|
|
let NewWordList = [];
|
|
|
@@ -1285,25 +1262,23 @@ export default {
|
|
|
},
|
|
|
// 处理注释数据
|
|
|
handleNote(val) {
|
|
|
- let _this = this;
|
|
|
- _this.isNoteShow = true;
|
|
|
- _this.oldNoteNum = val;
|
|
|
+ this.isNoteShow = true;
|
|
|
+ this.oldNoteNum = val;
|
|
|
let noteIndex = Number(val);
|
|
|
- if (_this.NNPEAnnotationList && _this.NNPEAnnotationList.length > 0) {
|
|
|
- _this.curNoteCon = _this.NNPEAnnotationList[noteIndex] ? _this.NNPEAnnotationList[noteIndex] : null;
|
|
|
+ if (this.NNPEAnnotationList && this.NNPEAnnotationList.length > 0) {
|
|
|
+ this.curNoteCon = this.NNPEAnnotationList[noteIndex] ? this.NNPEAnnotationList[noteIndex] : null;
|
|
|
}
|
|
|
},
|
|
|
changeCard(isShow) {
|
|
|
- let _this = this;
|
|
|
- _this.isNoteShow = isShow;
|
|
|
- _this.oldNoteNum = '';
|
|
|
- _this.noteNum = '';
|
|
|
+ this.isNoteShow = isShow;
|
|
|
+ this.oldNoteNum = '';
|
|
|
+ this.noteNum = '';
|
|
|
},
|
|
|
}, // 如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
};
|
|
|
</script>
|
|
|
+
|
|
|
<style lang="scss" scoped>
|
|
|
-//@import url(); 引入公共css类
|
|
|
.voicefull {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|