小程序连续点击动画的实现

  css:top:-80rpx;

let timer = null;

onShow:function(){
    
    
    //总积分点击动画效果
var zjfen = wx.createAnimation()
var roll = wx.createAnimation()
this.zjfen = zjfen
this.roll = roll

}
//总积分点击动画效果
bonusTap: function(bonus= 0){
    if(lock){
lock = false

    clearTimeout(timer)
     const that = this
this.zjfen.top( 0).step({ duration: 500 })
this.roll.rotate3d( 0, 1, 0, 360).step({duration: 400})
this.roll.rotate3d( 0, 1, 0, 0).step({ duration: 0})
this.setData({
rollAnimation: that.roll.export(),
zjfenAnimation: that.zjfen.export()
})
timer = setTimeout(() => {
this.zjfen.top( '-80rpx').step({duration: 500})
this.setData({
zjfenAnimation:that.zjfen.export()
})
clearTimeout(timer)
      lock = true
}, 2000)
    }

},




你可能感兴趣的:(笔记)