Component({ /** * 组件的属性列表 */ properties: { flowerNum: { type: Number, value: 1 } }, /** * 组件的初始数据 */ data: { flag: true, }, /** * 组件的方法列表 */ methods: { comeOut: function(){ this.animation = wx.createAnimation({ duration: 700, timingFunction: 'ease', }) this.animation.bottom('350rpx').step(); this.setData({ animationData: this.animation.export() }) setTimeout(()=>{ this.close() },2000); }, close: function (e) { this.animation = wx.createAnimation({ duration: 400, timingFunction: 'ease', }) this.animation.opacity(0).step(); this.setData({ animationData: this.animation.export() }) setTimeout(()=>{ this.replace(); },100) }, // 复位 replace: function(){ this.animation = wx.createAnimation({ duration: 17, timingFunction: 'linear', }) this.animation.opacity(1).step(); this.animation.bottom('-100rpx').step(); this.setData({ animationData: this.animation.export() }) } } })