flowerBox.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. Component({
  2. /**
  3. * 组件的属性列表
  4. */
  5. properties: {
  6. flowerNum: {
  7. type: "String",
  8. value: '1'
  9. }
  10. },
  11. /**
  12. * 组件的初始数据
  13. */
  14. data: {
  15. flag: true,
  16. },
  17. /**
  18. * 组件的方法列表
  19. */
  20. methods: {
  21. comeOut: function(){
  22. this.animation = wx.createAnimation({
  23. duration: 700,
  24. timingFunction: 'ease',
  25. })
  26. this.animation.bottom('350rpx').step();
  27. this.setData({
  28. animationData: this.animation.export()
  29. })
  30. setTimeout(()=>{
  31. this.close()
  32. },2000);
  33. },
  34. close: function (e) {
  35. this.animation = wx.createAnimation({
  36. duration: 400,
  37. timingFunction: 'ease',
  38. })
  39. this.animation.opacity(0).step();
  40. this.setData({
  41. animationData: this.animation.export()
  42. })
  43. },
  44. }
  45. })