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
// 把 this.data.arrowAnimation.translateY 改成 animation.translateY 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(){ console.log("dzp arrowAnimation setInterval:",animation); animation.translateY(-30).step().translateY(0).step(); this.setData({ arrowAnimation:animation.export(), }) }.bind(this),1500) },