diff --git a/pages/video/video.nvue b/pages/video/video.nvue index ee04b44..ce5a78b 100644 --- a/pages/video/video.nvue +++ b/pages/video/video.nvue @@ -187,7 +187,6 @@ }) this.page = 1 this.randomNum = Math.floor(Math.random() * 33); - console.log("getDataList1") if(this.scrollTimer != null){ clearTimeout(this.scrollTimer); } diff --git a/pages/video/video.vue b/pages/video/video.vue index fe752dc..3a95047 100644 --- a/pages/video/video.vue +++ b/pages/video/video.vue @@ -204,7 +204,8 @@ timerCon: null, randomNum: 0, playFlag: false, - + // 延时器对象 + scrollTimer : null, }; }, computed: { @@ -264,7 +265,12 @@ } this.page = 1 this.randomNum = Math.floor(Math.random() * 33); - this.getDataList() + if(this.scrollTimer != null){ + clearTimeout(this.scrollTimer); + } + this.scrollTimer = setTimeout(()=>{ + this.getDataList() + }, 1000) }, onHide() {