index.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // pages/marvellous/components/videoAn/video.js
  2. Component({
  3. /**
  4. * 组件的属性列表
  5. */
  6. properties: {
  7. },
  8. transverse: undefined,
  9. portrait: undefined,
  10. /**
  11. * 组件的初始数据
  12. */
  13. data: {
  14. tra: {},
  15. por: {},
  16. step: 0,
  17. show: true,
  18. heng: true,
  19. shu: true
  20. },
  21. ready() {
  22. // this.transverse = wx.createAnimation({
  23. // duration: 1500,
  24. // timingFunction: 'linear',
  25. // })
  26. // this.portrait = wx.createAnimation({
  27. // duration: 1500,
  28. // timingFunction: 'linear',
  29. // })
  30. // this.transverse.width("750rpx").step();
  31. // this.portrait.height("100vh").step();
  32. },
  33. /**
  34. * 组件的方法列表
  35. */
  36. methods: {
  37. start() {
  38. let _this = this;
  39. this.setData({
  40. // tra: this.transverse.export(),
  41. step: 1
  42. },()=>{
  43. let time = setInterval(() => {
  44. clearInterval(time);
  45. _this.nextAnstion();
  46. }, 1450);
  47. })
  48. },
  49. nextAnstion() {
  50. let _this = this;
  51. this.setData({
  52. heng: false,
  53. // por: this.portrait.export(),
  54. step: 2
  55. },()=>{
  56. let time = setInterval(() => {
  57. clearInterval(time);
  58. _this.end();
  59. }, 1450);
  60. })
  61. },
  62. end(){
  63. this.setData({
  64. shu: false,
  65. step: 3
  66. })
  67. this.triggerEvent("close")
  68. }
  69. }
  70. })