natasha 9 kuukautta sitten
vanhempi
commit
feac211356

+ 9 - 8
src/components/Adult/preview/components/WordPhraseDetail.vue

@@ -633,7 +633,7 @@ export default {
           }
           getContent(Mname, {
             courseware_id: this.currentTreeID, // 课件id
-            word: this.data.new_word, //生词
+            word: this.data.new_word_str, //生词
             search_scope: 1, //检索范围0 本课件  1本教材 2本套
             is_contain_word_variants: false,
             is_filter_repetitive_sentence: "true",
@@ -681,7 +681,7 @@ export default {
 
               getContent(Mname, {
                 courseware_id: this.currentTreeID, // 课件id
-                word: this.data.new_word, //生词
+                word: this.data.new_word_str, //生词
                 search_scope: 2, //检索范围0 本课件  1本教材 2本套
                 is_contain_word_variants: false,
                 is_filter_repetitive_sentence: "true",
@@ -1015,12 +1015,13 @@ export default {
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
     // 去掉生词里的标点
-    let new_word_str = this.data.new_word.replace(/\(.*?\)/g, "");
-    // for (let i = 0; i < this.data.new_word.length; i++) {
-    //   if (/[\u4E00-\u9FA5\uF900-\uFA2D]/.test(this.data.new_word[i])) {
-    //     new_word_str += JSON.parse(JSON.stringify(this.data.new_word[i]));
-    //   }
-    // }
+    let new_word = this.data.new_word.replace(/\(.*?\)/g, "");
+    let new_word_str = "";
+    for (let i = 0; i < new_word.length; i++) {
+      if (/[\u4E00-\u9FA5\uF900-\uFA2D]/.test(new_word[i])) {
+        new_word_str += JSON.parse(JSON.stringify(new_word[i]));
+      }
+    }
     this.data.new_word_str = new_word_str;
   },
   //生命周期 - 挂载完成(可以访问DOM元素)

+ 7 - 8
src/components/Adult/preview/components/Wordcard.vue

@@ -463,14 +463,13 @@ export default {
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
-    let new_word_str = this.word.detail.new_word.replace(/\(.*?\)/g, "");
-    // for (let i = 0; i < this.word.detail.new_word.length; i++) {
-    //   if (/[\u4E00-\u9FA5\uF900-\uFA2D]/.test(this.word.detail.new_word[i])) {
-    //     new_word_str += JSON.parse(
-    //       JSON.stringify(this.word.detail.new_word[i])
-    //     );
-    //   }
-    // }
+    let new_word = this.word.detail.new_word.replace(/\(.*?\)/g, "");
+    let new_word_str = "";
+    for (let i = 0; i < new_word.length; i++) {
+      if (/[\u4E00-\u9FA5\uF900-\uFA2D]/.test(new_word[i])) {
+        new_word_str += JSON.parse(JSON.stringify(new_word[i]));
+      }
+    }
     this.word.detail.new_word = new_word_str;
   },
   //生命周期 - 挂载完成(可以访问DOM元素)