From ba9608833d8a951b0703bfb605dc5655425bf118 Mon Sep 17 00:00:00 2001 From: yanyilin Date: Wed, 22 Nov 2023 15:41:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=AD=E6=B3=95=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/template/half-screen/half-screen.uvue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/template/half-screen/half-screen.uvue b/pages/template/half-screen/half-screen.uvue index 840b8e66..7c362299 100644 --- a/pages/template/half-screen/half-screen.uvue +++ b/pages/template/half-screen/half-screen.uvue @@ -39,7 +39,7 @@ if(this.bAnimation){//容错处理 return; } - let top:number = this.scrollNode?.getAttribute('scrollTop') as number + let top:number = this.scrollNode?.scrollTop??0; let p = e.touches[0]; this.lastY2 = this.lastY; this.lastY = p.screenY; @@ -67,7 +67,7 @@ if(this.bAnimation){//容错处理 return; } - let top:number = this.scrollNode?.getAttribute('scrollTop') as number + let top:number = this.scrollNode?.scrollTop??0; let bHide = (this.halfHeight-this.halfOffset)0&&this.lastY2<=this.lastY; @@ -134,7 +134,7 @@ this.halfNode = this.$refs['halfScreen'] as Element; this.halfHeight = this.halfNode!.getBoundingClientRect().height; this.scrollNode = this.$refs['halfScroll'] as Element; - + this.totalHeight = uni.getWindowInfo().windowHeight; this.halfNode?.style?.setProperty('top', this.totalHeight.toString()); }, -- GitLab