vodShort.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template name="vodShort">
  2. <view>
  3. <swiper class="swiper" autoplay="false" vertical="true" interval="990000" @change="changeVod">
  4. <swiper-item v-for="(v, k) in item" :key="k">
  5. <dever-video
  6. :src="v.video"
  7. :pic="v.pic"
  8. :index="k"
  9. :vid="v.id"
  10. :position_item="v.text"
  11. :position_save="v.is_button"
  12. :load.sync="load"
  13. ref="video"
  14. >
  15. </dever-video>
  16. </swiper-item>
  17. </swiper>
  18. </view>
  19. </template>
  20. <script>
  21. import deverVideo from '@/lib/dever/components/video.nvue';
  22. var play = true;
  23. export default {
  24. name: "vodShort",
  25. props: {
  26. control : {
  27. type : Object,
  28. value : null
  29. },
  30. item : {
  31. type : Array,
  32. value : null
  33. },
  34. index : {
  35. type : Number,
  36. value : null
  37. },
  38. },
  39. data() {
  40. return {
  41. load : false,
  42. current_index: 0,
  43. };
  44. },
  45. created() {
  46. },
  47. mounted() {
  48. this.control[this.index] = this;
  49. },
  50. methods:{
  51. start : function() {
  52. this.$refs.video[this.current_index].start();
  53. },
  54. stop : function() {
  55. this.$refs.video[this.current_index].stop(true);
  56. },
  57. changeVod : function(e) {
  58. var self = this;
  59. self.$nextTick(()=>{
  60. this.$refs.video[this.current_index].stop(false);
  61. this.current_index = e.detail.current;
  62. self.start();
  63. });
  64. },
  65. },
  66. components:{
  67. deverVideo
  68. }
  69. }
  70. </script>
  71. <style>
  72. .swiper{
  73. width: 100vw;
  74. height: 100vh;
  75. /*position: fixed;*/
  76. position: relative;
  77. top: 0;
  78. left: 0;
  79. }
  80. </style>