From a4e9967804a7754ba4ffcfbe0d7a60605440ded2 Mon Sep 17 00:00:00 2001 From: linju Date: Tue, 12 Sep 2023 15:44:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E7=A4=BA=E4=BE=8B?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=20pull-zoom-image=20=E5=90=91=E4=B8=8A?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E8=B6=85=E8=BF=87100px=E5=90=8E=E5=9B=BA?= =?UTF-8?q?=E5=AE=9A=E5=A4=B4=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pull-zoom-image/pull-zoom-image.uvue | 126 ++++++++++-------- static/template/pull-zoom-image/back.png | Bin 0 -> 8334 bytes 2 files changed, 70 insertions(+), 56 deletions(-) create mode 100644 static/template/pull-zoom-image/back.png diff --git a/pages/template/pull-zoom-image/pull-zoom-image.uvue b/pages/template/pull-zoom-image/pull-zoom-image.uvue index a8dc5d99..3ccf595d 100644 --- a/pages/template/pull-zoom-image/pull-zoom-image.uvue +++ b/pages/template/pull-zoom-image/pull-zoom-image.uvue @@ -1,34 +1,34 @@ @@ -39,10 +39,24 @@ $INodeMap: new Map() } }, - methods: { + methods: { + onScroll(e : ScrollEvent) { + const {scrollTop} = e.detail + let y : number = scrollTop - 110 + let s : number = (100 - scrollTop/3)/100 + if(y < 0){ + y = 0 + } + if(s < 0.7){ + s = 0.7 + } + let x : number = (1 - s) * -100 + this.setINodeStyle("user-info", "transform", `translate(${x},${y + (s-1)* -50}px) scale(${s})`) + this.setINodeStyle("head-img-box-2", "transform", `translateY(${y}px)`) + }, onRefresherpulling(e : RefresherEvent) { // console.log('onRefresherpulling',e.detail.dy) - let pullingDistance:number = e.detail.dy + let pullingDistance : number = e.detail.dy this.setINodeStyle("head-img-1", 'transform', `scale(${pullingDistance / 200 + 1})`) this.setINodeStyle("head-img-2", 'transform', `scale(${pullingDistance / 200 + 1})`) }, @@ -73,79 +87,80 @@