guanchunjie 3 gadi atpakaļ
vecāks
revīzija
6d523a3e0d

+ 2 - 2
src/components/Adult/Preview.vue

@@ -291,7 +291,7 @@
                   <NewWordShow
                     :cur-que="itemss.data"
                     :theme-color="themeColor"
-                    :indexStr="index+'_'+indexs+'_'+indexss"
+                    :indexStr="index + '_' + indexs + '_' + indexss"
                     v-if="refresh"
                   />
                 </template>
@@ -686,7 +686,7 @@ export default {
   width: 860px;
   margin: 0 auto;
   position: relative;
-  padding-bottom:120px;
+  padding-bottom: 120px;
   .NNPE-title {
     background: #e35454;
     border-radius: 0px 0px 16px 16px;

+ 4 - 1
src/components/Adult/preview/ArticleViewChs/NormalModelChs.vue

@@ -257,7 +257,10 @@ export default {
   },
   computed: {
     isPlaying: function () {
-      let playing = this.$refs.audioLine.audio.isPlaying;
+      let playing = false;
+      if (this.$refs.audioLine) {
+        playing = this.$refs.audioLine.audio.isPlaying;
+      }
       return playing;
     },
   },

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

@@ -166,7 +166,14 @@ import AudioLine from "../AudioLine.vue";
 import Wordcard from "../components/Wordcard.vue"; // 卡片
 export default {
   name: "PhraseModelChs",
-  props: ["curQue", "bodyLeft", "NNPENewWordList", "themeColor", "noFont","currentTreeID"],
+  props: [
+    "curQue",
+    "bodyLeft",
+    "NNPENewWordList",
+    "themeColor",
+    "noFont",
+    "currentTreeID",
+  ],
   components: {
     AudioLine,
     Wordcard,
@@ -541,6 +548,7 @@ export default {
   }
   .NNPE-wordDetail {
     position: fixed;
+    z-index: 9999;
     //   width: 260px;
     //   height: 200px;
     //   background: #cc0;

+ 4 - 1
src/components/Adult/preview/ArticleViewChs/Practicechs.vue

@@ -287,7 +287,10 @@ export default {
   },
   computed: {
     isPlaying: function () {
-      let playing = this.$refs.audioLine.audio.isPlaying;
+      let playing = false;
+      if (this.$refs.audioLine) {
+        playing = this.$refs.audioLine.audio.isPlaying;
+      }
       return playing;
     },
   },

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

@@ -145,7 +145,13 @@ import AudioLine from "../AudioLine.vue";
 import Wordcard from "../components/Wordcard.vue"; // 卡片
 export default {
   name: "WordModelChs",
-  props: ["curQue", "bodyLeft", "NNPENewWordList", "themeColor","currentTreeID"],
+  props: [
+    "curQue",
+    "bodyLeft",
+    "NNPENewWordList",
+    "themeColor",
+    "currentTreeID",
+  ],
   components: {
     AudioLine,
     Wordcard,
@@ -504,14 +510,16 @@ export default {
         clear: both;
       }
       > img {
-        width: 100%;
+        max-width: 100%;
         display: block;
+        margin: 0 auto;
       }
     }
   }
 }
 .NNPE-wordDetail {
   position: fixed;
+  z-index: 9999;
   //   width: 260px;
   //   height: 200px;
   //   background: #cc0;

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

@@ -81,6 +81,7 @@
         :NNPENewWordList="NNPENewWordList"
         :themeColor="themeColor"
         :noFont="noFont"
+        :currentTreeID="currentTreeID"
         v-if="showWord"
       />
     </div>

+ 4 - 1
src/components/Adult/preview/DialogueArticleViewChs/NormalModelChs.vue

@@ -353,7 +353,10 @@ export default {
   },
   computed: {
     isPlaying: function () {
-      let playing = this.$refs.audioLine.audio.isPlaying;
+      let playing = false;
+      if (this.$refs.audioLine) {
+        playing = this.$refs.audioLine.audio.isPlaying;
+      }
       return playing;
     },
   },

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

@@ -240,6 +240,7 @@ export default {
     "colorBox",
     "themeColor",
     "noFont",
+    "currentTreeID"
   ],
   components: {
     AudioLine,
@@ -865,6 +866,7 @@ export default {
   }
   .NNPE-wordDetail {
     position: fixed;
+    z-index: 9999;
   }
 }
 </style>

+ 4 - 1
src/components/Adult/preview/DialogueArticleViewChs/Practicechs.vue

@@ -420,7 +420,10 @@ export default {
   },
   computed: {
     isPlaying: function () {
-      let playing = this.$refs.audioLine.audio.isPlaying;
+      let playing = false;
+      if (this.$refs.audioLine) {
+        playing = this.$refs.audioLine.audio.isPlaying;
+      }
       return playing;
     },
   },

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

@@ -236,7 +236,7 @@ export default {
     "colorBox",
     "themeColor",
     "noFont",
-    "currentTreeID"
+    "currentTreeID",
   ],
   components: {
     AudioLine,
@@ -841,7 +841,7 @@ export default {
         border-radius: 8px;
       }
       > img {
-        width: 100%;
+        max-width: 100%;
         display: block;
       }
     }
@@ -861,6 +861,7 @@ export default {
 }
 .NNPE-wordDetail {
   position: fixed;
+  z-index: 9999;
   //   width: 260px;
   //   height: 200px;
   //   background: #cc0;

+ 5 - 4
src/components/Adult/preview/DialogueArticleViewChs/index.vue

@@ -175,10 +175,11 @@ export default {
   mounted() {
     console.log("我是文章预览");
     console.log(this.curQue);
-
-    this.$nextTick(() => {
-      this.bodyLeft = this.$refs.ArticleViewbody.getBoundingClientRect().left;
-    });
+    if (this.curQue) {
+      this.$nextTick(() => {
+        this.bodyLeft = this.$refs.ArticleViewbody.getBoundingClientRect().left;
+      });
+    }
     console.log(this.NNPENewWordList);
   },
   beforeCreate() {}, //生命周期 - 创建之前

+ 7 - 5
src/components/Adult/preview/WordPhrase.vue

@@ -62,11 +62,13 @@
               <template v-else>
                 <span style="width: 16px; height: 16px"></span>
               </template>
-              <b class="tabNum"
-                ><template v-if="sItem.mIndex == 0">{{
-                  index + 1
-                }}</template></b
-              >
+              <template v-if="sItem.mIndex == 0">
+                <b class="tabNum">{{ index + 1 }}</b>
+              </template>
+              <div
+                v-else
+                style="width: 16px; height: 16px; margin-left: 8px"
+              ></div>
 
               <span class="NPC-word-tab-common NPC-word-tab-pinyin">
                 {{ sItem.pinyin }}

+ 120 - 106
src/components/Adult/preview/components/WordPhraseDetail.vue

@@ -8,27 +8,29 @@
     }"
   >
     <div class="module-inner">
-      <div class="top" v-if="data && data.pinyin">
+      <div class="top" v-if="data">
         <div class="operation">
           <div>
-            <img
-              src="../../../../assets/adult/sc.png"
-              alt=""
-              v-if="!notshowNext"
-            />
-            <img
-              style="margin-right: 8px"
-              src="../../../../assets/adult/word-left.png"
-              alt=""
-              @click="lastDetail"
-              v-if="!notshowNext"
-            />
-            <img
-              src="../../../../assets/adult/word-right.png"
-              alt=""
-              @click="nextDetail"
-              v-if="!notshowNext"
-            />
+            <template v-if="optionRes && optionRes.length > 0">
+              <img
+                src="../../../../assets/adult/sc.png"
+                alt=""
+                v-if="!notshowNext"
+              />
+              <img
+                style="margin-right: 8px"
+                src="../../../../assets/adult/word-left.png"
+                alt=""
+                @click="lastDetail"
+                v-if="!notshowNext"
+              />
+              <img
+                src="../../../../assets/adult/word-right.png"
+                alt=""
+                @click="nextDetail"
+                v-if="!notshowNext"
+              />
+            </template>
             <img
               @click="closeWordShow"
               src="../../../../assets/adult/word-close.png"
@@ -46,7 +48,6 @@
                 ? 'red-border'
                 : 'brown-border',
             ]"
-            v-if="isShow"
           >
             <div
               class="strockplay"
@@ -82,97 +83,106 @@
                 <Audio :mp3="data.mp3_list[0].id" :themeColor="themeColor" />
               </template>
             </div>
-            <p class="jieshu" v-for="(fy, i) in data.definition_list" :key="i">
-              {{ fy }}
-            </p>
+            <p
+              class="jieshu"
+              v-for="(fy, i) in data.definition_list"
+              :key="i"
+              v-html="fy"
+            ></p>
           </div>
         </div>
         <div class="zhedie-white">
           <div v-if="data.list1.length > 0">
             <div class="topTitle">
-                <span>本课例句</span>
-                <span @click="handleChangeTab('wordShow')"
-                    >{{ wordShow ? "收起" : "展开" }}
-                    <img
-                    v-if="wordShow"
-                    src="../../../../assets/newImage/common/show-black.png"
-                    alt=""
-                    />
-                    <img
-                    v-else
-                    src="../../../../assets/newImage/common/hide-black.png"
-                    alt=""
-                    />
-                </span>
+              <span>本课例句</span>
+              <span @click="handleChangeTab('wordShow')"
+                >{{ wordShow ? "收起" : "展开" }}
+                <img
+                  v-if="wordShow"
+                  src="../../../../assets/newImage/common/show-black.png"
+                  alt=""
+                />
+                <img
+                  v-else
+                  src="../../../../assets/newImage/common/hide-black.png"
+                  alt=""
+                />
+              </span>
             </div>
             <el-collapse-transition>
-                <div class="liju" v-show="wordShow">
-                    <div v-for="(item, i) in data.list1" :key="i">
-                        <p v-html="item.res"></p>
-                    </div>
+              <div class="liju" v-show="wordShow">
+                <div v-for="(item, i) in data.list1" :key="i">
+                  <div>{{ i + 1 }}.</div>
+                  <div>
+                    <p v-html="item.res"></p>
+                    <p class="p2">
+                      来源:{{ item.source_courseware_name_path }}
+                    </p>
+                  </div>
                 </div>
+              </div>
             </el-collapse-transition>
           </div>
           <div v-if="data.list2.length > 0">
-                <div class="topTitle">
-                    <span>本书例句</span>
-                    <span @click="handleChangeTab('wordShow2')"
-                      >{{ wordShow2 ? "收起" : "展开" }}
-                      <img
-                        v-if="wordShow2"
-                        src="../../../../assets/newImage/common/show-black.png"
-                        alt=""
-                      />
-                      <img
-                        v-else
-                        src="../../../../assets/newImage/common/hide-black.png"
-                        alt=""
-                      />
-                    </span>
+            <div class="topTitle">
+              <span>本书例句</span>
+              <span @click="handleChangeTab('wordShow2')"
+                >{{ wordShow2 ? "收起" : "展开" }}
+                <img
+                  v-if="wordShow2"
+                  src="../../../../assets/newImage/common/show-black.png"
+                  alt=""
+                />
+                <img
+                  v-else
+                  src="../../../../assets/newImage/common/hide-black.png"
+                  alt=""
+                />
+              </span>
             </div>
             <el-collapse-transition>
-                <div class="liju" v-show="wordShow2">
-                  <div v-for="(item, i) in data.list2" :key="i">
-                    <div>{{ i + 1 }}.</div>
-                    <div>
-                      <p v-html="item.res"></p>
-                      <p class="p2">
-                        来源:{{ item.source_courseware_name_path }}
-                      </p>
-                    </div>
+              <div class="liju" v-show="wordShow2">
+                <div v-for="(item, i) in data.list2" :key="i">
+                  <div>{{ i + 1 }}.</div>
+                  <div>
+                    <p v-html="item.res"></p>
+                    <p class="p2">
+                      来源:{{ item.source_courseware_name_path }}
+                    </p>
                   </div>
                 </div>
+              </div>
             </el-collapse-transition>
           </div>
           <div v-if="data.list3.length > 0">
-                  <div class="topTitle">
-                    <span>本套教材例句</span>
-                    <span @click="handleChangeTab('wordShow3')"
-                      >{{ wordShow3 ? "收起" : "展开" }}
-                      <img
-                        v-if="wordShow3"
-                        src="../../../../assets/newImage/common/show-black.png"
-                        alt=""
-                      />
-                      <img
-                        v-else
-                        src="../../../../assets/newImage/common/hide-black.png"
-                        alt=""
-                      />
-                    </span>
-                  </div>
+            <div class="topTitle">
+              <span>本套教材例句</span>
+              <span @click="handleChangeTab('wordShow3')"
+                >{{ wordShow3 ? "收起" : "展开" }}
+                <img
+                  v-if="wordShow3"
+                  src="../../../../assets/newImage/common/show-black.png"
+                  alt=""
+                />
+                <img
+                  v-else
+                  src="../../../../assets/newImage/common/hide-black.png"
+                  alt=""
+                />
+              </span>
+            </div>
             <el-collapse-transition>
-                <div class="liju">
-                  <div v-for="(item, i) in data.list3" :key="i">
-                    <div>{{ data.list3.length + i + 1 }}.</div>
-                    <div>
-                      <p>{{ item.sentence }}</p>
-                      <p class="p2">
-                        来源:{{ item.source_courseware_name_path }}
-                      </p>
-                    </div>
+              <div class="liju">
+                <div v-for="(item, i) in data.list3" :key="i">
+                  <div>{{ data.list3.length + i + 1 }}.</div>
+                  <div>
+                    <p>{{ item.sentence }}</p>
+                    <p class="p2">
+                      来源:{{ item.source_courseware_name_path }}
+                    </p>
                   </div>
                 </div>
+              </div>
             </el-collapse-transition>
           </div>
         </div>
@@ -255,9 +265,9 @@ export default {
     return {
       height: "",
       margintop: "",
-      wordShow: false,
-      wordShow2: false,
-      wordShow3: false,
+      wordShow: true,
+      wordShow2: true,
+      wordShow3: true,
       list1: [],
       isShow: false,
       old_word: "",
@@ -322,16 +332,19 @@ export default {
       });
     },
     initData() {
-      if (this.curQue) {
-        this.isShow = true;
-        if (this.data.list1 && this.data.list1.length > 0) {
-          this.handleExample(this.data.list1);
-        }
-        if (this.data.list2 && this.data.list2.length > 0) {
-          this.handleExample(this.data.list2);
-        }
-        this.old_word = this.optionRes.new_word;
+      // if (this.curQue) {
+      //   this.isShow = true;
+      if (this.data.list1 && this.data.list1.length > 0) {
+        this.handleExample(this.data.list1);
+      }
+      if (this.data.list2 && this.data.list2.length > 0) {
+        this.handleExample(this.data.list2);
       }
+      if (this.data.list3 && this.data.list3.length > 0) {
+        this.handleExample(this.data.list3);
+      }
+      this.old_word = this.optionRes ? this.optionRes.new_word : "";
+      //}
       let Fathernode = document.getElementsByClassName(
         "NPC-Big-Book-preview"
       )[0];
@@ -341,9 +354,9 @@ export default {
         this.margintop = "-" + window.innerHeight / 2 + "px";
       }
     },
-    handleChangeTab(flag){
-        this[flag] = !this[flag]
-    }
+    handleChangeTab(flag) {
+      this[flag] = !this[flag];
+    },
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {},
@@ -484,6 +497,7 @@ export default {
             display: flex;
             align-items: center;
             margin-right: 8px;
+            word-break: normal;
           }
         }
       }
@@ -548,7 +562,7 @@ export default {
       .liju {
         padding-bottom: 16px;
         padding-right: 24px;
-        background: #F7F7F7;
+        background: #f7f7f7;
         border: 1px solid rgba(0, 0, 0, 0.1);
         border-top: none;
         border-radius: 0 0 4px 4px;

+ 18 - 33
src/components/Adult/preview/components/Wordcard.vue

@@ -80,10 +80,7 @@
       class="bwc-word-en"
       v-if="word.detail && word.detail.definition_list.length > 0"
     >
-      <span v-for="(item, index) in word.detail.definition_list" :key="index">
-        {{ item
-        }}{{ index == word.detail.definition_list.length - 1 ? "" : ";" }}
-      </span>
+      <span v-html="defStr"> </span>
     </div>
     <div class="bwc-more-intp" @click="viewIntp">更多释义</div>
     <div class="bwc-footer">
@@ -131,7 +128,7 @@
     </div>
     <div class="practiceBox" v-if="isIntpShow">
       <WordPhraseDetail
-        :closeWord ="changeIntpShow"
+        :closeWord="changeIntpShow"
         :data="word.detail"
         :themeColor="themeColor"
       />
@@ -145,6 +142,7 @@ import Strockplayredline from "./Strockplayredline.vue";
 import Practice from "./Practice.vue";
 import WordPhraseDetail from "./WordPhraseDetail.vue";
 import { getContentFile, getContent } from "@/api/ajax";
+
 export default {
   name: "Wordcard",
   components: {
@@ -159,22 +157,16 @@ export default {
       isPraShow: false,
       isIntpShow: false,
       curData: null,
+      defStr: "",
     };
   },
   computed: {},
   watch: {
     word: {
       handler: function (val, oldVal) {
-        let _this = this;
-        // this.curData = {
-        //   stem: [
-        //     {
-        //       con: val.detail && val.detail.new_word ? val.detail.new_word : "",
-        //       pinyin: val.detail && val.detail.pinyin ? val.detail.pinyin : "",
-        //       mp3_url: "",
-        //     },
-        //   ],
-        // };
+        if (val && val.detail) {
+          this.defStr = val.detail.definition_list.join(";");
+        }
       },
       // 深度观察监听
       deep: true,
@@ -206,6 +198,7 @@ export default {
       this.isPraShow = false;
     },
     viewIntp() {
+      debugger;
       this.isIntpShow = false;
       this.word.detail.list1 = [];
       this.word.detail.list2 = [];
@@ -219,14 +212,14 @@ export default {
         search_scope: 2, //检索范围0 本课件  1本教材 2本套
         is_contain_word_variants: false,
       }).then((res) => {
-        this.word.detail.list3 = res.sentence_list;
+        this.$set(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;
+          this.$set(this.word.detail, "list2", res.sentence_list);
           getContent(Mname, {
             courseware_id: this.currentTreeID, // 课件id
             word: this.word.detail.new_word, //生词
@@ -250,22 +243,14 @@ export default {
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
     let _this = this;
-    if (this.word) {
-      //   this.curData = {
-      //     stem: [
-      //       {
-      //         con:
-      //           _this.word.detail && _this.word.detail.new_word
-      //             ? _this.word.detail.new_word
-      //             : "",
-      //         pinyin:
-      //           _this.word.detail && _this.word.detail.pinyin
-      //             ? _this.word.detail.pinyin
-      //             : "",
-      //         mp3_url: "",
-      //       },
-      //     ],
-      //   };
+    console.log("this.word====");
+    console.log(this.word);
+    if (_this.word && _this.word.detail) {
+      _this.defStr =
+        _this.word.detail.definition_list &&
+        _this.word.detail.definition_list.length > 0
+          ? _this.word.detail.definition_list.join(";")
+          : "";
     }
   },
   beforeCreate() {}, //生命周期 - 创建之前

+ 0 - 3
src/views/adultInput.vue

@@ -718,8 +718,6 @@ import VideoControl from "@/components/Adult/inputModules/VideoControl.vue";
 import Table from "@/components/Adult/inputModules/Table.vue";
 import PlayRecord from "@/components/Adult/inputModules/PlayRecord.vue";
 
-
-
 import Textdes from "@/components/Adult/inputModules/Textdes.vue";
 import Record from "@/components/Adult/inputModules/Record.vue";
 import Hanzi from "@/components/Adult/inputModules/Hanzi.vue";
@@ -742,7 +740,6 @@ import SentenceSortQP from "@/components/Adult/preview/SentenceSortQP.vue";
 import TableView from "@/components/Adult/preview/TableView.vue";
 import PlayRecordView from "@/components/Adult/preview/PlayRecordView.vue";
 
-
 import DialogueAnswerViewChs from "@/components/Adult/preview/DialogueArticleViewChs/DialogueAnswerViewChs.vue";
 import Preview from "@/components/Adult/Preview.vue";
 import fn from "@/components/Adult/common/data.js";

+ 2 - 2
vue.config.js

@@ -42,8 +42,8 @@ module.exports = {
       // change xxx-api/login => mock/login
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        //target: `http://gcls.utschool.cn/`,
-        target: `http://gcls.helxsoft.cn/`,
+        target: `http://gcls.utschool.cn/`,
+        //target: `http://gcls.helxsoft.cn/`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''