four.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <div class="four">
  3. <div class="comTit">{{ tit }}</div>
  4. <div class="comMani">
  5. <div class="conShow">
  6. <div class="conShowfloo">
  7. <div class="icon el-icon-arrow-left" @click="arrowClick(0)"></div>
  8. <div class="icon el-icon-arrow-right" @click="arrowClick(1)"></div>
  9. <el-carousel type="card" height="300px" :autoplay='false' arrow="never" indicator-position='none' ref="cardShow" :loop='false' :initial-index='1'>
  10. <el-carousel-item v-for="item in data.images" :key="item.id">
  11. <img :src="baseURL + item.filePath" alt="" />
  12. </el-carousel-item>
  13. <el-carousel-item
  14. class="videoBox"
  15. v-for="item in data.videos"
  16. :key="item.id"
  17. >
  18. <div class="videoName">{{item.name}}</div>
  19. <video controls :src="baseURL + item.filePath"></video>
  20. </el-carousel-item>
  21. </el-carousel>
  22. </div>
  23. </div>
  24. <div class="info" v-html="data.content"></div>
  25. </div>
  26. <div class="comBs"></div>
  27. </div>
  28. </template>
  29. <script>
  30. import axios from "@/utils/request";
  31. export default {
  32. name: "four",
  33. props: {
  34. tit: {
  35. type: String,
  36. },
  37. data: {
  38. type: Object,
  39. default: () => {},
  40. },
  41. },
  42. components: {},
  43. data() {
  44. //这里存放数据
  45. return {
  46. baseURL: "",
  47. };
  48. },
  49. //监听属性 类似于data概念
  50. computed: {},
  51. //监控data中的数据变化
  52. watch: {},
  53. //方法集合
  54. methods: {
  55. arrowClick(val){
  56. if(val===0) this.$refs.cardShow.prev()
  57. else this.$refs.cardShow.next()
  58. },
  59. cutBig(src, type) {},
  60. },
  61. //生命周期 - 创建完成(可以访问当前this实例)
  62. created() {
  63. // 获取服务器前缀地址
  64. this.baseURL = axios.defaults.baseURL;
  65. },
  66. //生命周期 - 挂载完成(可以访问DOM元素)
  67. mounted() {},
  68. beforeCreate() {}, //生命周期 - 创建之前
  69. beforeMount() {}, //生命周期 - 挂载之前
  70. beforeUpdate() {}, //生命周期 - 更新之前
  71. updated() {}, //生命周期 - 更新之后
  72. beforeDestroy() {}, //生命周期 - 销毁之前
  73. destroyed() {}, //生命周期 - 销毁完成
  74. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  75. };
  76. </script>
  77. <style lang='less' scoped>
  78. .info::-webkit-scrollbar {
  79. /*滚动条整体样式*/
  80. width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
  81. height: 1px;
  82. }
  83. .info::-webkit-scrollbar-thumb {
  84. /*滚动条里面小方块*/
  85. border-radius: 10px;
  86. -webkit-box-shadow: inset 0 0 5px transparent;
  87. background: #8a7351;
  88. }
  89. .info::-webkit-scrollbar-track {
  90. /*滚动条里面轨道*/
  91. -webkit-box-shadow: inset 0 0 5px transparent;
  92. border-radius: 10px;
  93. background: transparent;
  94. }
  95. .four {
  96. /deep/.el-carousel__item img {
  97. width: 100%;
  98. height: 100%;
  99. object-fit: cover;
  100. }
  101. /deep/.el-carousel__item video {
  102. width: 100%;
  103. height: 100%;
  104. }
  105. .videoBox {
  106. background-color: rgba(0, 0, 0, 0.6);
  107. .videoName{
  108. position: absolute;
  109. top: 5px;
  110. left: 10px;
  111. color: #fff;
  112. font-size: 18px;
  113. }
  114. }
  115. position: relative;
  116. width: 100%;
  117. height: 100%;
  118. padding-top: 50px;
  119. .comMani {
  120. width: 100%;
  121. height: calc(100% - 65px);
  122. .conShow {
  123. height: 330px;
  124. width: 100%;
  125. .conShowfloo {
  126. position: relative;
  127. width: 100%;
  128. height: 300px;
  129. .icon{
  130. z-index: 9999;
  131. position: absolute;
  132. left: -18px;
  133. top: 50%;
  134. transform: translateY(-50%);
  135. width: 36px;
  136. height: 36px;
  137. background-color: rgba(0, 0, 0, 0.6);
  138. color: #fff;
  139. display: flex;
  140. justify-content: center;
  141. align-items: center;
  142. border-radius: 50%;
  143. cursor: pointer;
  144. font-size: 20px;
  145. }
  146. .el-icon-arrow-right{
  147. left: auto;
  148. right: -18px;
  149. }
  150. }
  151. }
  152. .info {
  153. width: 100%;
  154. height: 300px;
  155. color: #8a7351;
  156. font-size: 16px;
  157. line-height: 28px;
  158. overflow-y: auto;
  159. }
  160. }
  161. }
  162. </style>