vodShort.vue 1.4 KB

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