动画效果完成

master
于肖磊 2025-12-02 11:50:19 +08:00
parent a2aec994ba
commit 1c2ad02096
1 changed files with 14 additions and 10 deletions

View File

@ -168,11 +168,14 @@
icon: icon,
imageSrc: imageSrc
};
console.log(newLike, '111');
//
this.likeList.push(newLike);
console.log('Added like item:', newLike);
// #ifdef APP-NVUE
//
setTimeout(() => {
this.animateLikeItem(newLike.id);
}, 0);
//#endif
// 2
setTimeout(() => {
this.removeLike(newLike.id);
@ -183,7 +186,6 @@
},
removeLike(id) {
console.log('Removing like item:', id);
this.likeList = this.likeList.filter(item => item.id !== id);
},
@ -218,7 +220,7 @@
// 25px
this.likeCountPosition = {
x: x, //
y: y - 25 // 25px5px
y: y - 40 // 30px10px
};
this.likeCountColor = color;
@ -229,9 +231,9 @@
this.likeCountScale = 1;
//
this.$nextTick(() => {
setTimeout(() => {
this.animateLikeCount();
});
}, 0)
}
// 200ms
@ -260,7 +262,7 @@
opacity: 0,
transform: 'scale(0.5) translateY(-10px)'
},
duration: 1000,
duration: 500,
timingFunction: 'ease-out'
}, () => {
this.showLikeCount = false;
@ -279,7 +281,9 @@
// #ifdef APP-NVUE
const ref = this.$refs['likeItem' + id];
if (ref) {
const el = ref instanceof Array ? ref[0] : ref;
//
const isArray = Array.isArray(ref) || ref instanceof Array || (ref && typeof ref === 'object' && ref.length !== undefined);
const el = isArray ? ref[0] : ref;
if (el) {
//
this.likeList = this.likeList.map(item => {
@ -340,7 +344,7 @@
opacity: 0,
transform: 'scale(0.5) translateY(-10px)'
},
duration: 200,
duration: 500,
timingFunction: 'ease-out'
});
}