Browse Source

生词列表表头不显示问题

natasha 1 week ago
parent
commit
7ff24e8703

+ 2 - 1
src/views/book/courseware/preview/components/article/components/WordPhraseDetail.vue

@@ -300,6 +300,7 @@ export default {
     Strockplayredline,
     Audio,
   },
+  inject: ['getSelectId'],
   props: [
     'data',
     'changeDetailIndex',
@@ -475,7 +476,7 @@ export default {
       this.loading1 = true;
       this.loading2 = true;
       this.loading3 = true;
-      let currentTreeID = this.$route.params.id;
+      let currentTreeID = this.$route.params.id || this.getSelectId();
       // 获取本课的 本教材的 本套的 的例句
       getCoursewareWordExampleSentenceList({
         courseware_id: currentTreeID, // 课件id

+ 19 - 7
src/views/book/courseware/preview/components/new_word/NewWordPreview.vue

@@ -11,7 +11,15 @@
           }" -->
         <div v-if="data.title_con" class="topTitle">
           <div class="NPC-top-left">
-            <span class="NPC-topTitle-text" v-html="data.title_con"></span>
+            <span
+              class="NPC-topTitle-text"
+              v-html="data.title_con"
+              :style="{
+                color:
+                  data.unified_attrib && data.unified_attrib.topic_color ? data.unified_attrib.topic_color : '#de4444',
+                fontSize: data.unified_attrib && data.unified_attrib.font_size ? data.unified_attrib.font_size : '',
+              }"
+            ></span>
             <span v-if="showLang" class="NPC-topTitle-text">
               {{ titleTrans[getLang()] }}
             </span>
@@ -738,7 +746,6 @@ export default {
     writeTableZoom,
   },
   mixins: [PreviewMixin],
-  inject: ['bookInfo'],
   props: ['newData'],
   data() {
     return {
@@ -794,7 +801,7 @@ export default {
   },
   mounted() {
     let totalWidth = document.querySelector('.newWord-preview').offsetWidth;
-    this.width = `${totalWidth - (this.data.property.sn_display_mode === 'true' ? 15 : 0) - (this.newData ? 16 : 0)}px`;
+    this.width = `${totalWidth - (this.data.property.sn_display_mode === 'true' ? 15 : 0)}px`;
   },
   methods: {
     palyAudio(url, sIndex) {
@@ -1803,7 +1810,7 @@ export default {
     display: flex;
     justify-content: space-between;
     width: 100%;
-    height: 48px;
+    height: 40px;
     overflow: hidden;
 
     // background: #e35454;
@@ -1815,12 +1822,17 @@ export default {
       justify-content: flex-start;
 
       .NPC-topTitle-text {
-        margin-right: 8px;
-        font-family: 'sourceR';
+        // margin-right: 8px;
+        // font-family: 'sourceR';
         font-size: 16px;
         font-weight: bold;
-        color: #fff;
+
+        // color: #fff;
         white-space: pre;
+
+        p {
+          margin: 0;
+        }
       }
     }
 

+ 2 - 1
src/views/book/courseware/preview/components/new_word/components/WordPhraseDetail.vue

@@ -228,6 +228,7 @@ export default {
     Strockplayredline,
     Audio,
   },
+  inject: ['getSelectId'],
   props: [
     'data',
     'changeDetailIndex',
@@ -371,7 +372,7 @@ export default {
       this.loading1 = true;
       this.loading2 = true;
       this.loading3 = true;
-      let currentTreeID = this.$route.params.id;
+      let currentTreeID = this.$route.params.id || this.getSelectId();
       // 获取本课的 本教材的 本套的 的例句
       getCoursewareWordExampleSentenceList({
         courseware_id: currentTreeID, // 课件id