|
|
|
@ -356,11 +356,26 @@ export default {
|
|
|
|
onTouchEnd() {
|
|
|
|
onTouchEnd() {
|
|
|
|
let that = this;
|
|
|
|
let that = this;
|
|
|
|
that.isTouching = false;
|
|
|
|
that.isTouching = false;
|
|
|
|
setTimeout(() => {
|
|
|
|
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.backgroundScale = 0;
|
|
|
|
that.mtScroll = 0
|
|
|
|
that.mtScroll = 0;
|
|
|
|
}, 100);
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
animate();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
goHome() {
|
|
|
|
goHome() {
|
|
|
|
|