12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- Component({
- properties: {
- },
- data: {
- waiting_animation: {},
- waiting_animation_1: {},
- },
- ready: function () {
- console.log("ready waitting")
- this.waiting_animation = wx.createAnimation({
- duration: 600
- })
- this.waiting_animation_1 = wx.createAnimation({
- duration: 400
- })
- this.setWaitInterval()
- },
-
- detached: function() {
- this.clearAnimation()
- },
- methods: {
- clearAnimation: function() {
- this.endWaitAnimation()
- },
-
- endWaitAnimation: function() {
- clearInterval(this.data.waiting_interval)
- this.setData({ waiting_animation : {}})
- this.setData({ waiting_animation_1: {} })
- },
- startWaitAnimation: function () {
- this.waiting_animation.opacity(0).scale(1.2, 1.2).step()
- this.waiting_animation.opacity(1).scale(1, 1).step()
- this.setData({ waiting_animation: this.waiting_animation.export() })
- this.waiting_animation_1.opacity(0).scale(1.2, 1.2).step()
- this.waiting_animation_1.opacity(1).scale(1, 1).step()
- this.setData({ waiting_animation_1: this.waiting_animation_1.export() })
- },
-
- setWaitInterval: function() {
- this.endWaitAnimation()
- this.data.waiting_interval = setInterval( ()=>{
- this.startWaitAnimation()
- },600 )
- },
- }
- });
|