index.js 968 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. show: true,
  17. heng: true,
  18. shu: true
  19. },
  20. ready() {
  21. this.transverse = wx.createAnimation({
  22. duration: 1500,
  23. timingFunction: 'linear',
  24. })
  25. this.portrait = wx.createAnimation({
  26. duration: 1500,
  27. timingFunction: 'linear',
  28. })
  29. this.transverse.width("750rpx").step();
  30. this.portrait.height("100vh").step();
  31. },
  32. /**
  33. * 组件的方法列表
  34. */
  35. methods: {
  36. start() {
  37. this.setData({
  38. tra: this.transverse.export(),
  39. })
  40. },
  41. nextAnstion() {
  42. this.setData({
  43. heng: false,
  44. por: this.portrait.export(),
  45. })
  46. },
  47. end(){
  48. this.setData({
  49. shu: false,
  50. })
  51. this.triggerEvent("close")
  52. }
  53. }
  54. })