index.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. },
  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. let _this = this;
  38. this.setData({
  39. // tra: this.transverse.export(),
  40. step: 1
  41. },()=>{
  42. let time = setInterval(() => {
  43. clearInterval(time);
  44. _this.nextAnstion();
  45. }, 1450);
  46. })
  47. },
  48. nextAnstion() {
  49. let _this = this;
  50. this.setData({
  51. heng: false,
  52. // por: this.portrait.export(),
  53. step: 2
  54. },()=>{
  55. _this.end();
  56. })
  57. },
  58. end(){
  59. this.setData({
  60. step: 3
  61. })
  62. this.triggerEvent("close")
  63. }
  64. }
  65. })