index.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <div id="index_login_container" class="animation-slide-right">
  3. <img src="https://img.shuimuai.com/web/none_page.png" alt="" class="cover">
  4. <div class="video_container">
  5. <div class="video_item" v-for="(video,index) in videos" :key="index">
  6. <!-- 说明-->
  7. <view class="padding-tb">
  8. <text>{{video.title}}</text>
  9. </view>
  10. <video :src="video.src" :id="'video_'+index" :data-index="index"
  11. @play="vPlay"></video>
  12. </div>
  13. </div>
  14. </div>
  15. </template>
  16. <script>
  17. var $this;
  18. export default {
  19. name: 'scan_container',
  20. data() {
  21. return {
  22. videos: [
  23. {
  24. id:1,
  25. title:"水母星球宣传片",
  26. src:"https://img.shuimuai.com/mg.mp4"
  27. },
  28. {
  29. id: 2,
  30. title: "水母星球产品使用说明",
  31. src: "https://img.shuimuai.com/desc_1.mp4"
  32. },
  33. {
  34. id: 3,
  35. title: "水母星球IP故事",
  36. src: "https://img.shuimuai.com/story_1.mp4"
  37. }
  38. ]
  39. }
  40. },
  41. methods: {
  42. vPlay(e) {
  43. let $current_index = e.currentTarget.dataset.index
  44. $this.videos.forEach(($val, $index) => {
  45. if ($index != $current_index) {
  46. let $play_box = wx.createVideoContext('video_' + $index)
  47. $play_box.pause()
  48. $play_box.seek(0)
  49. }
  50. })
  51. }
  52. },
  53. created() {
  54. $this = this;
  55. }
  56. }
  57. </script>
  58. <style scoped>
  59. #index_login_container {
  60. background-color: #31295B;
  61. }
  62. .cover {
  63. width: 100%;
  64. height: 667px;
  65. }
  66. .video_container {
  67. color: #ffffff;
  68. padding: 10px 0px;
  69. }
  70. .video_item {
  71. text-align: center;
  72. margin: 10px 0px;
  73. }
  74. video {
  75. width: 100%;
  76. }
  77. </style>