Kaynağa Gözat

目录显示隐藏

natasha 3 yıl önce
ebeveyn
işleme
ea29b2d544
1 değiştirilmiş dosya ile 16 ekleme ve 0 silme
  1. 16 0
      src/views/TextbookDetail.vue

+ 16 - 0
src/views/TextbookDetail.vue

@@ -129,6 +129,7 @@
           <div
             @click="SelectShowEvent('1')"
             :class="SelectShow == '1' ? 'select' : ''"
+            v-if="SelectFirstShow"
           >
             <!-- 目录 -->{{ $t("Key612") }}
           </div>
@@ -290,6 +291,7 @@ export default {
       enshrine: "false",
       IsPurchase: false,
       SelectShow: "1", //选择展示课程资源还是下载
+      SelectFirstShow: true,
       TextBookId: null,
       TextbookData: null,
       loading: false,
@@ -436,6 +438,7 @@ export default {
       this.handleIsBuy();
       this.handleIsEnshrine();
       this.getBookSource()
+      this.getBookStructList()
     },
     // 教材资源
     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(){
       let _this = this;