闫增涛
2024-10-18 40fb2059e31c525952e71782acecd97c178fb6e6
src/books/civilAviation/view/components/index.vue
@@ -54,13 +54,13 @@
      ></chapterEight> -->
      
    </div>
    <miniAudio
    <!-- <miniAudio
      :path="audioPath"
      :currentTime="currentTime"
      @closeMiniAudio="closeMiniAudio"
      ref="audioPlayer"
    >
    </miniAudio>
    </miniAudio> -->
  </div>
</template>
@@ -84,7 +84,7 @@
export default {
  data() {
    return {
      catalogLength: 9, // 总章节数
      catalogLength: 2, // 总章节数
      showCatalogList: [], // 显示的章节
      loadThreshold: 300, // 触发加载阈值
      throttleThreshold: 100, // 节流阈值
@@ -151,6 +151,7 @@
    // 默认加载章节
    this.showCatalogList = [1];
    // 滚动监听节流
    debugger
    this.throttledScrollHandler = _.throttle(
      this.scrollFun,
      this.throttleThreshold,
@@ -254,6 +255,8 @@
    // 滚动监听
    scrollFun(event) {
      // 判断向上滚动还是向下滚动
      console.log(11);
      if (event.target.scrollTop > this.previousScrollTop) {
        this.getAduio();
        // 向下
@@ -263,6 +266,9 @@
          currentScrollTop >=
          event.target.scrollHeight - this.loadThreshold
        ) {
          console.log(1);
          debugger
          // 到达阈值
          if (
            this.showCatalogList[this.showCatalogList.length - 1] <