diff --git a/root/detail/userShare.vue b/root/detail/userShare.vue index 7e10b39..7d154d5 100644 --- a/root/detail/userShare.vue +++ b/root/detail/userShare.vue @@ -356,11 +356,26 @@ export default { onTouchEnd() { let that = this; that.isTouching = false; - setTimeout(() => { - // 恢复原始大小 - that.backgroundScale = 0; - that.mtScroll = 0 - }, 100); + const animationDuration = 300; // 动画持续时间(ms) + const frameDuration = 16; // 每帧间隔(约60fps) + const totalFrames = Math.ceil(animationDuration / frameDuration); + let currentFrame = 0; + const startScale = that.backgroundScale; + const startScroll = that.mtScroll; + const animate = () => { + currentFrame++; + const progress = Math.min(currentFrame / totalFrames, 1); + const easeOutQuart = 1 - Math.pow(1 - progress, 4); + that.backgroundScale = startScale * (1 - easeOutQuart); + that.mtScroll = startScroll * (1 - easeOutQuart); + if (progress < 1) { + setTimeout(animate, frameDuration); + } else { + that.backgroundScale = 0; + that.mtScroll = 0; + } + }; + animate(); }, goHome() {