|
@@ -721,16 +721,16 @@ export default {
|
|
|
if (this.curQue) {
|
|
|
this.handleData();
|
|
|
}
|
|
|
- $(window).resize(() => {
|
|
|
- this.getScreenHeight();
|
|
|
- });
|
|
|
+ window.addEventListener('resize', this.getScreenHeight);
|
|
|
this.getScreenHeight();
|
|
|
},
|
|
|
beforeCreate() {}, // 生命周期 - 创建之前
|
|
|
beforeMount() {}, // 生命周期 - 挂载之前
|
|
|
beforeUpdate() {}, // 生命周期 - 更新之前
|
|
|
updated() {}, // 生命周期 - 更新之后
|
|
|
- beforeDestroy() {}, // 生命周期 - 销毁之前
|
|
|
+ beforeDestroy() {
|
|
|
+ window.removeEventListener('resize', this.getScreenHeight);
|
|
|
+ }, // 生命周期 - 销毁之前
|
|
|
destroyed() {}, // 生命周期 - 销毁完成
|
|
|
activated() {},
|
|
|
// 方法集合
|
|
@@ -786,12 +786,12 @@ export default {
|
|
|
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 : '';
|
|
|
- }
|
|
|
+ this.highWords = null;
|
|
|
+ this.findLightWord(wItem, wIndex, sentence, sItem);
|
|
|
+ words = this.highWords ? this.highWords.words : '';
|
|
|
+ } else {
|
|
|
+ words = this.highWords ? this.highWords.words : '';
|
|
|
+ }
|
|
|
}
|
|
|
let obj = {
|
|
|
paraIndex: dIndex, // 段落索引
|
|
@@ -834,8 +834,8 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
let resArrs = [];
|
|
|
- let sentArrTotal = [];
|
|
|
- let timeArr = [];
|
|
|
+ let sentArrTotal = [];
|
|
|
+ let timeArr = [];
|
|
|
let wordTimeList = curQue.wordTime;
|
|
|
curQue.detail.forEach((dItem, dIndex) => {
|
|
|
dItem.wordsList.forEach((sItem, sIndex) => {
|
|
@@ -902,24 +902,24 @@ export default {
|
|
|
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;
|
|
|
+ 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, endIndex };
|
|
@@ -998,7 +998,7 @@ export default {
|
|
|
}
|
|
|
let pos = time.indexOf(':');
|
|
|
let min = 0;
|
|
|
- var sec = 0;
|
|
|
+ var sec = 0;
|
|
|
if (pos > 0) {
|
|
|
min = parseInt(time.substring(0, pos));
|
|
|
sec = parseFloat(time.substring(pos + 1));
|
|
@@ -1123,37 +1123,37 @@ export default {
|
|
|
}
|
|
|
this.showNoteDetail(e, noteIndex);
|
|
|
} else if (this.newWordList.indexOf(noteNum) > -1) {
|
|
|
- if (_this.oldHz != noteNum) {
|
|
|
- this.isShow = false;
|
|
|
- _this.NNPENewWordList.forEach((items) => {
|
|
|
- // item.forEach((items) => {
|
|
|
- if (items.new_word === noteNum) {
|
|
|
- this.activeWord = items;
|
|
|
- }
|
|
|
- // });
|
|
|
- });
|
|
|
- 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;
|
|
|
- }
|
|
|
+ if (_this.oldHz != noteNum) {
|
|
|
+ this.isShow = false;
|
|
|
+ _this.NNPENewWordList.forEach((items) => {
|
|
|
+ // item.forEach((items) => {
|
|
|
+ if (items.new_word === noteNum) {
|
|
|
+ this.activeWord = items;
|
|
|
+ }
|
|
|
+ // });
|
|
|
+ });
|
|
|
+ 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;
|
|
|
}
|
|
|
+ }
|
|
|
},
|
|
|
showNoteDetail(e, noteNum) {
|
|
|
let _this = this;
|
|
@@ -1169,10 +1169,10 @@ export default {
|
|
|
if (left - this.bodyLeft > this.contentWidth / 2) {
|
|
|
_this.left = left - width + 10;
|
|
|
} else if (left - 200 > 500) {
|
|
|
- _this.left = 500;
|
|
|
- } else {
|
|
|
- _this.left = left - 200;
|
|
|
- }
|
|
|
+ _this.left = 500;
|
|
|
+ } else {
|
|
|
+ _this.left = left - 200;
|
|
|
+ }
|
|
|
},
|
|
|
// 处理注释数据
|
|
|
handleNote(val) {
|