vodShort.vue 1.5 KB

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