Parcourir la source

目录显示隐藏

natasha il y a 3 ans
Parent
commit
ea29b2d544
1 fichiers modifiés avec 16 ajouts et 0 suppressions
  1. 16 0
      src/views/TextbookDetail.vue

+ 16 - 0
src/views/TextbookDetail.vue

@@ -129,6 +129,7 @@
           <div
           <div
             @click="SelectShowEvent('1')"
             @click="SelectShowEvent('1')"
             :class="SelectShow == '1' ? 'select' : ''"
             :class="SelectShow == '1' ? 'select' : ''"
+            v-if="SelectFirstShow"
           >
           >
             <!-- 目录 -->{{ $t("Key612") }}
             <!-- 目录 -->{{ $t("Key612") }}
           </div>
           </div>
@@ -290,6 +291,7 @@ export default {
       enshrine: "false",
       enshrine: "false",
       IsPurchase: false,
       IsPurchase: false,
       SelectShow: "1", //选择展示课程资源还是下载
       SelectShow: "1", //选择展示课程资源还是下载
+      SelectFirstShow: true,
       TextBookId: null,
       TextBookId: null,
       TextbookData: null,
       TextbookData: null,
       loading: false,
       loading: false,
@@ -436,6 +438,7 @@ export default {
       this.handleIsBuy();
       this.handleIsBuy();
       this.handleIsEnshrine();
       this.handleIsEnshrine();
       this.getBookSource()
       this.getBookSource()
+      this.getBookStructList()
     },
     },
     // 教材资源
     // 教材资源
     getBookSource(){
     getBookSource(){
@@ -464,6 +467,19 @@ export default {
                 }   
                 }   
         })
         })
     },
     },
+    // 章节树
+    getBookStructList () {
+        let MethodName = "book-book_manager-GetBookChapterStruct";
+        let data = {
+            'book_id': this.TextBookId
+        }
+        getContent(MethodName, data).then(
+            (res) => {
+                this.SelectFirstShow = res.nodes?true:false
+                this.SelectShow = res.nodes?'1':'2'
+            }
+        )
+    },
     // 打包下载全部音频
     // 打包下载全部音频
     handleDownloadAudio(){
     handleDownloadAudio(){
       let _this = this;
       let _this = this;