定义重复执行动画,动画只执行一次就报错
Page({
data:{
arrowAnimation:{},
},
onReady(){
var animation = wx.createAnimation({
delay: 0,
timingFunction:"linear",
duration:1500,
success(res){
console.log("dzp arrowAnimation",res);
}
})
this.data.arrowAnimation=animation
var animationInterNum=setInterval(function(){
// this.arrowAnimation.opacity(0).step().opacity(1).step()
console.log("dzp arrowAnimation setInterval",this.data.arrowAnimation);
this.data.arrowAnimation.translateY(-30).step().translateY(0).step();
this.setData({
arrowAnimation:animation.export(),
})
}.bind(this),1500)
},
bug 描述:151VM211 WAService.js:2 TypeError: this.data.arrowAnimation.translateY is not a function