video.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <div class="images" :style="{backgroundImage:`url(${require('@/assets/images/project/video_bg.jpg')})`}">
  3. <div class="title">{{hotspot.title}}</div>
  4. <div class="img-con">
  5. <span @click="active-=1" :class="{noshow:active<=0}">上一张</span>
  6. <video controls autoplay>
  7. <source :src="hotspot.video[active].url" type="video/mp4">
  8. </video>
  9. <span @click="active+=1" :class="{noshow:active>=hotspot.video.length - 1}">下一张</span>
  10. <ul class="pagna">
  11. <li v-for="(item,i) in hotspot.video" :class="{active:i==active}" :key="i"></li>
  12. </ul>
  13. </div>
  14. <div class="desc" v-html="hotspot.content">
  15. </div>
  16. </div>
  17. </template>
  18. <script>
  19. export default {
  20. props:['hotspot'],
  21. data(){
  22. return {
  23. active:0
  24. }
  25. },
  26. methods:{
  27. }
  28. }
  29. </script>
  30. <style lang="less" scoped>
  31. .noshow{
  32. opacity: 0!important;;
  33. pointer-events: none!important;;
  34. }
  35. .images{
  36. width: 100%;
  37. height: 100%;
  38. background-repeat: no-repeat;
  39. text-align: center;
  40. .title{
  41. padding: 0 80px;
  42. display: inline-block;
  43. color: #DBA761;
  44. font-weight: bold;
  45. font-size: 36px;
  46. height: 70px;
  47. line-height: 70px;
  48. background: #BC1515;
  49. border-radius: 60px;
  50. margin: 45px auto;
  51. }
  52. .img-con{
  53. display: flex;
  54. justify-content: space-around;
  55. align-items: center;
  56. position: relative;
  57. padding-bottom: 40px;
  58. >span{
  59. display: inline-block;
  60. padding: 0 30px;
  61. box-sizing: content-box;
  62. font-size: 20px;
  63. height: 50px;
  64. line-height: 50px;
  65. background: rgba(188, 21, 21, 0.9);
  66. border: 2px solid #DBA761;
  67. border-radius: 37px;
  68. cursor: pointer;
  69. &:hover,&.active{
  70. color: #DBA761;
  71. }
  72. }
  73. >video{
  74. max-width: 1000px;
  75. // border: 10px solid #BC1515;
  76. box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
  77. max-height: 600px;
  78. object-fit: fill;
  79. }
  80. .pagna{
  81. position: absolute;
  82. bottom: 0;
  83. text-align: center;
  84. z-index: 999;
  85. >li{
  86. width: 60px;
  87. height: 6px;
  88. background: #BC1515;
  89. display: inline-block;
  90. margin: 0 4px;
  91. &.active{
  92. background: #DBA761;
  93. }
  94. }
  95. }
  96. }
  97. .desc{
  98. max-width: 1000px;
  99. margin: 20px auto 0;
  100. color: #DBA761;
  101. text-align: left;
  102. line-height: 2;
  103. max-height: 200px;
  104. overflow-y: auto;
  105. }
  106. }
  107. </style>