Преглед на файлове

生词模式下切换文章未刷新数据

natasha преди 1 седмица
родител
ревизия
68d0ed290f

+ 5 - 1
src/views/book/courseware/preview/components/article/index.vue

@@ -348,6 +348,9 @@ export default {
     'data.content': {
       handler(val) {
         if (val) {
+          this.showPhrases = false;
+          this.showPractice = false;
+          this.showWord = false;
           this.handleData();
           let _this = this;
           if (!this.isJudgingRightWrong) {
@@ -629,6 +632,7 @@ export default {
             : [],
         );
       this.NNPEAnnotationList = this.data.notes_list && this.data.notes_list.option ? this.data.notes_list.option : [];
+      this.handleNewword();
       let resArr = [];
       let sentArrTotal = [];
       let timeArr = [];
@@ -739,7 +743,7 @@ export default {
             words = wItem.chs;
             endIndex = startIndex + 1;
           }
-        } else if (item[0] === wItem.chs && sentence.indexOf(item) > -1) {
+        } else if (item.substring(0, wItem.chs.length) === wItem.chs && sentence.indexOf(item) > -1) {
           let index = null;
           let chsStr = '';
           for (let i = startIndex; i < sItem.length + 1; i++) {

+ 5 - 1
src/views/book/courseware/preview/components/dialogue_article/index.vue

@@ -343,6 +343,9 @@ export default {
     'data.detail.length': {
       handler(val) {
         if (val) {
+          this.showPhrases = false;
+          this.showPractice = false;
+          this.showWord = false;
           this.handleData();
           let _this = this;
           _this.$nextTick(() => {
@@ -628,6 +631,7 @@ export default {
             : [],
         );
       this.NNPEAnnotationList = this.data.notes_list && this.data.notes_list.option ? this.data.notes_list.option : [];
+      this.handleNewword();
       let resArr = [];
       let sentArrTotal = [];
       let timeArr = [];
@@ -737,7 +741,7 @@ export default {
             words = wItem.chs;
             endIndex = startIndex + 1;
           }
-        } else if (item[0] === wItem.chs && sentence.indexOf(item) > -1) {
+        } else if (item.substring(0, wItem.chs.length) === wItem.chs && sentence.indexOf(item) > -1) {
           let index = null;
           let chsStr = '';
           for (let i = startIndex; i < sItem.length + 1; i++) {