From 0c9424bae87bbc6b578fb8c78f4f638e283ff919 Mon Sep 17 00:00:00 2001 From: daihh Date: Tue, 18 Oct 2022 14:44:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=88=97=E8=A1=A8=E6=97=A0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=97=B6=EF=BC=8C=E4=B8=8B=E6=8B=89=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E6=9C=89=E9=97=AE=E9=A2=98=EF=BC=8C=E4=BC=9A=E9=97=AA?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/portal/course/Index.vue | 39 +++++++++++++++++-------------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/src/views/portal/course/Index.vue b/src/views/portal/course/Index.vue index 5e2244a9..c88ef2bc 100644 --- a/src/views/portal/course/Index.vue +++ b/src/views/portal/course/Index.vue @@ -111,7 +111,7 @@
加载更多 数据加载中 - +
暂无课程,请优先学习其它课程吧~
@@ -465,26 +465,29 @@ export default { this.searchData(); }, handleScroll() { + if(this.courseList.length>6){ - let innerHeight = document.querySelector("#couser-list-content").clientHeight; - let outerHeight = document.documentElement.clientHeight; - let scrollTop = document.documentElement.scrollTop; - let outerWidth = document.querySelector(".xcontent2-minor").clientWidth; - if (outerHeight + scrollTop + 350 >= innerHeight) { - if (this.moreState == 1 && this.course.pageIndex < 4) { - this.loadMore(); + let innerHeight = document.querySelector("#couser-list-content").clientHeight; + let outerHeight = document.documentElement.clientHeight; + let scrollTop = document.documentElement.scrollTop; + let outerWidth = document.querySelector(".xcontent2-minor").clientWidth; + if (outerHeight + scrollTop + 350 >= innerHeight) { + if (this.moreState == 1 && this.course.pageIndex < 4) { + this.loadMore(); + } } + //console.log(this.course.pageIndex,'this.course.pageIndex'); + //加此判断,是为了没有数据时的闪动问题 + //if(this.course.pageIndex >1){ + if (scrollTop > 830) { + document.querySelector("#fixd-box").style.cssText = + "position: fixed;top: -914px;width:"+outerWidth+"px"; + } else { + document.querySelector("#fixd-box").style.cssText = "position: static"; + } + //} + } - //console.log(this.course.pageIndex,'this.course.pageIndex'); - //加此判断,是为了没有数据时的闪动问题 - //if(this.course.pageIndex >1){ - if (scrollTop > 830) { - document.querySelector("#fixd-box").style.cssText = - "position: fixed;top: -914px;width:"+outerWidth+"px"; - } else { - document.querySelector("#fixd-box").style.cssText = "position: static"; - } - //} }, toNeedCourse() {