From 529ed071614e8060fe6e58fe77c1b148a179b18a Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Thu, 30 May 2024 15:47:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BB=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/index/index.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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];