diff --git a/pages/template/half-screen/half-screen.uvue b/pages/template/half-screen/half-screen.uvue index 840b8e66dd7788598f6c2a54ed1a8b80c1e2f2ea..7c362299c3fba388a21522e13e76be3422412e3a 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()); },