Jelajahi Sumber

Merge branch 'master' into gcj

guanchunjie 3 tahun lalu
induk
melakukan
2b2b27ba29

+ 1 - 0
src/components/Adult/Preview.vue

@@ -204,6 +204,7 @@
                     :n-n-p-e-annotation-list="NNPEAnnotationList"
                     :color-box="colorBox"
                     :theme-color="themeColor"
+                    :currentTreeID="currentTreeID"
                     v-if="refresh"
                   />
                 </template>

+ 2 - 1
src/components/Adult/preview/ArticleViewChs/PhraseModelChs.vue

@@ -153,6 +153,7 @@
           :word="word"
           :changeWordCard="changeWordCard"
           :themeColor="themeColor"
+          :currentTreeID="currentTreeID"
         />
       </div>
     </template>
@@ -165,7 +166,7 @@ import AudioLine from "../AudioLine.vue";
 import Wordcard from "../components/Wordcard.vue"; // 卡片
 export default {
   name: "PhraseModelChs",
-  props: ["curQue", "bodyLeft", "NNPENewWordList", "themeColor", "noFont"],
+  props: ["curQue", "bodyLeft", "NNPENewWordList", "themeColor", "noFont","currentTreeID"],
   components: {
     AudioLine,
     Wordcard,

+ 2 - 1
src/components/Adult/preview/ArticleViewChs/WordModelChs.vue

@@ -132,6 +132,7 @@
           :word="word"
           :changeWordCard="changeWordCard"
           :themeColor="themeColor"
+          :currentTreeID="currentTreeID"
         />
       </div>
     </template>
@@ -144,7 +145,7 @@ import AudioLine from "../AudioLine.vue";
 import Wordcard from "../components/Wordcard.vue"; // 卡片
 export default {
   name: "WordModelChs",
-  props: ["curQue", "bodyLeft", "NNPENewWordList", "themeColor"],
+  props: ["curQue", "bodyLeft", "NNPENewWordList", "themeColor","currentTreeID"],
   components: {
     AudioLine,
     Wordcard,

+ 3 - 1
src/components/Adult/preview/ArticleViewChs/index.vue

@@ -52,6 +52,7 @@
         :themeColor="themeColor"
         :noFont="noFont"
         v-if="!showPhrases && !showPractice && !showWord"
+        :currentTreeID="currentTreeID"
       />
       <PhraseModel
         :curQue="curQue"
@@ -60,6 +61,7 @@
         :NNPENewWordList="NNPENewWordList"
         :themeColor="themeColor"
         :noFont="noFont"
+        :currentTreeID="currentTreeID"
         v-if="showPhrases"
       />
       <Practice
@@ -93,7 +95,7 @@ import WordModel from "./WordModelChs.vue"; // 语音练习模式
 
 export default {
   name: "ArticleViewChs",
-  props: ["curQue", "NNPENewWordList", "themeColor"],
+  props: ["curQue", "NNPENewWordList", "themeColor", "currentTreeID"],
   components: { NormalModelChs, Practice, WordModel, PhraseModel },
   data() {
     return {

+ 1 - 0
src/components/Adult/preview/DialogueArticleViewChs/PhraseModelChs.vue

@@ -206,6 +206,7 @@
           :word="word"
           :changeWordCard="changeWordCard"
           :themeColor="themeColor"
+          :currentTreeID="currentTreeID"
         />
       </div>
     </template>

+ 2 - 0
src/components/Adult/preview/DialogueArticleViewChs/WordModelChs.vue

@@ -203,6 +203,7 @@
           :word="word"
           :changeWordCard="changeWordCard"
           :themeColor="themeColor"
+          :currentTreeID="currentTreeID"
         />
       </div>
     </template>
@@ -235,6 +236,7 @@ export default {
     "colorBox",
     "themeColor",
     "noFont",
+    "currentTreeID"
   ],
   components: {
     AudioLine,

+ 3 - 0
src/components/Adult/preview/DialogueArticleViewChs/index.vue

@@ -70,6 +70,7 @@
         :colorBox="colorBox"
         :themeColor="themeColor"
         :noFont="noFont"
+        :currentTreeID="currentTreeID"
         v-if="showPhrases"
       />
       <Practice
@@ -91,6 +92,7 @@
         :colorBox="colorBox"
         :themeColor="themeColor"
         :noFont="noFont"
+        :currentTreeID="currentTreeID"
         v-if="showWord"
       />
     </div>
@@ -111,6 +113,7 @@ export default {
     "NNPEAnnotationList",
     "colorBox",
     "themeColor",
+    "currentTreeID",
   ],
   components: { NormalModelChs, Practice, WordModel, PhraseModel },
   data() {

+ 54 - 23
src/components/Adult/preview/components/Wordcard.vue

@@ -21,18 +21,18 @@
         :themeColor="themeColor"
       />
       <img
-          :src="
-            themeColor
-              ? themeColor == 'green'
-                ? require('../../../../assets/NPC/play-green.png')
-                : themeColor == 'brown'
-                ? require('../../../../assets/NPC/play-brown.png')
-                : require('../../../../assets/NPC/play-red.png')
+        :src="
+          themeColor
+            ? themeColor == 'green'
+              ? require('../../../../assets/NPC/play-green.png')
+              : themeColor == 'brown'
+              ? require('../../../../assets/NPC/play-brown.png')
               : require('../../../../assets/NPC/play-red.png')
-          "
-          v-if="word.detail.mp3_list.length == 0"
-          style="width: 16px;"
-        />
+            : require('../../../../assets/NPC/play-red.png')
+        "
+        v-if="word.detail.mp3_list.length == 0"
+        style="width: 16px"
+      />
     </div>
     <div
       class="bwc-Strockplay"
@@ -130,9 +130,9 @@
       />
     </div>
     <div class="practiceBox" v-if="isIntpShow">
-      <Wordintp
-        :changeIntpShow="changeIntpShow"
-        :word="word"
+      <WordPhraseDetail
+        :closeWord ="changeIntpShow"
+        :data="word.detail"
         :themeColor="themeColor"
       />
     </div>
@@ -143,17 +143,17 @@
 import Audio from "./AudioRed.vue";
 import Strockplayredline from "./Strockplayredline.vue";
 import Practice from "./Practice.vue";
-import Wordintp from "./Wordintp.vue";
-import { getContentFile } from "@/api/ajax";
+import WordPhraseDetail from "./WordPhraseDetail.vue";
+import { getContentFile, getContent } from "@/api/ajax";
 export default {
   name: "Wordcard",
   components: {
     Strockplayredline,
     Audio,
     Practice,
-    Wordintp,
+    WordPhraseDetail,
   },
-  props: ["word", "changeWordCard", "themeColor"],
+  props: ["word", "changeWordCard", "themeColor", "currentTreeID"],
   data() {
     return {
       isPraShow: false,
@@ -182,21 +182,21 @@ export default {
   },
   //方法集合
   methods: {
-   async writeWord(words, pinyin) {
+    async writeWord(words, pinyin) {
       let _this = this;
       const MethodName = "tool-ChineseSCConvert";
       const data = {
         text: words,
-        swap_mode: 'S-C'
+        swap_mode: "S-C",
       };
-      let TChinese = await getContentFile(MethodName,data)
+      let TChinese = await getContentFile(MethodName, data);
       this.curData = {
         stem: [
           {
             con: words ? words : "",
             pinyin: pinyin && pinyin ? pinyin : "",
             mp3_url: "",
-            TChinese: TChinese.text
+            TChinese: TChinese.text,
           },
         ],
       };
@@ -206,7 +206,38 @@ export default {
       this.isPraShow = false;
     },
     viewIntp() {
-      this.isIntpShow = true;
+      this.isIntpShow = false;
+      this.word.detail.list1 = [];
+      this.word.detail.list2 = [];
+      this.word.detail.list3 = [];
+      let Mname =
+        "book-courseware_manager-GetCoursewareWordExampleSentenceList";
+      // 获取本课的 本教材的 本套的 的例句
+      getContent(Mname, {
+        courseware_id: this.currentTreeID, // 课件id
+        word: this.word.detail.new_word, //生词
+        search_scope: 2, //检索范围0 本课件  1本教材 2本套
+        is_contain_word_variants: false,
+      }).then((res) => {
+        this.word.detail.list3 = res.sentence_list;
+        getContent(Mname, {
+          courseware_id: this.currentTreeID, // 课件id
+          word: this.word.detail.new_word, //生词
+          search_scope: 1, //检索范围0 本课件  1本教材 2本套
+          is_contain_word_variants: false,
+        }).then((res) => {
+          this.word.detail.list2 = res.sentence_list;
+          getContent(Mname, {
+            courseware_id: this.currentTreeID, // 课件id
+            word: this.word.detail.new_word, //生词
+            search_scope: 0, //检索范围0 本课件  1本教材 2本套
+            is_contain_word_variants: false,
+          }).then((res) => {
+            this.$set(this.word.detail, "list1", res.sentence_list);
+            this.isIntpShow = true;
+          });
+        });
+      });
     },
     changeIntpShow() {
       this.isIntpShow = false;