| | |
| | | ></chapterEight> --> |
| | | |
| | | </div> |
| | | <miniAudio |
| | | <!-- <miniAudio |
| | | :path="audioPath" |
| | | :currentTime="currentTime" |
| | | @closeMiniAudio="closeMiniAudio" |
| | | ref="audioPlayer" |
| | | > |
| | | </miniAudio> |
| | | </miniAudio> --> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | catalogLength: 9, // 总章节数 |
| | | catalogLength: 2, // 总章节数 |
| | | showCatalogList: [], // 显示的章节 |
| | | loadThreshold: 300, // 触发加载阈值 |
| | | throttleThreshold: 100, // 节流阈值 |
| | |
| | | // 默认加载章节 |
| | | this.showCatalogList = [1]; |
| | | // 滚动监听节流 |
| | | debugger |
| | | this.throttledScrollHandler = _.throttle( |
| | | this.scrollFun, |
| | | this.throttleThreshold, |
| | |
| | | // 滚动监听 |
| | | scrollFun(event) { |
| | | // 判断向上滚动还是向下滚动 |
| | | console.log(11); |
| | | |
| | | if (event.target.scrollTop > this.previousScrollTop) { |
| | | this.getAduio(); |
| | | // 向下 |
| | |
| | | currentScrollTop >= |
| | | event.target.scrollHeight - this.loadThreshold |
| | | ) { |
| | | console.log(1); |
| | | |
| | | debugger |
| | | // 到达阈值 |
| | | if ( |
| | | this.showCatalogList[this.showCatalogList.length - 1] < |