//创建闪烁动画
createBlinkAnimation(totalDuration) {
let that = this;
clearInterval(that.timer);
// 创建动画实例
let animation = uni.createAnimation({
duration: totalDuration,
timingFunction: 'step-start',
});
that.timer = setInterval(() => {
animation.opacity(0).step({
duration: 200
});
animation.opacity(1).step();
that.animationData = animation.export();
}, totalDuration);
}
运行到浏览器里是可以循环执行的,运行到开发工具中,定时器会执行,动画只有一次动作