diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 61d8d748..867d449d 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -94,6 +94,7 @@ arr: [], scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度 timer: null, // 定时器 + timerHome: null, // 定时器 forcedLogin: false, count: 1, position: [-10, -10], @@ -315,14 +316,14 @@ if (this.arr.length == 0) { await this.getMenuItemTop(); } - if (this.timer) return; + if (this.timerHome) return; if (!this.menuHeight) { await this.getElRect('menu-scroll-view', 'menuHeight'); } setTimeout(() => { // 节流 - this.timer = null; + this.timerHome = null; // scrollHeight为右边菜单垂直中点位置 - let scrollHeight = e.detail.scrollTop + this.menuHeight / 2; + let scrollHeight = e.detail.scrollTop + this.menuHeight / 5; for (let i = 0; i < this.arr.length; i++) { let height1 = this.arr[i]; let height2 = this.arr[i + 1];