vodShort.vue 1.4 KB

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