course-video.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <div class="video-item-box">
  3. <i @click="playVideo" class="video-play-btn"></i>
  4. <img :src="imgUrl" :alt="title">
  5. <p><span>{{ title }}</span><span>用途:生产工艺</span></p>-->
  6. <!-- 视频播放弹窗 -->
  7. <el-dialog
  8. :title="dialogTitle"
  9. :visible.sync="videoDialogFlag"
  10. @close="closeVideoDialog"
  11. class="course-video-dialog"
  12. center>
  13. <video controls :src="curSource" class="course-video-box"></video>
  14. </el-dialog>
  15. </div>
  16. </template>
  17. <script>
  18. export default {
  19. name: "course-video",
  20. props: {
  21. source: {
  22. type: String,
  23. require: '',
  24. },
  25. title: {
  26. type: String,
  27. default: ''
  28. },
  29. dialogTitle: {
  30. type: String,
  31. default: ''
  32. },
  33. imgUrl: {
  34. type: String,
  35. default: ''
  36. }
  37. },
  38. data() {
  39. return {
  40. videoDialogFlag: false,
  41. curSource: '',
  42. }
  43. },
  44. methods: {
  45. closeVideoDialog() {
  46. this.videoDialogFlag = false;
  47. this.curSource = "";
  48. },
  49. playVideo() {
  50. this.videoDialogFlag = true;
  51. this.curSource = this.source;
  52. }
  53. }
  54. }
  55. </script>
  56. <style lang="scss" scoped>
  57. .video-item-box{
  58. width: 352px;background: rgba(18,107,255,0.12);margin: 0;
  59. border: 1px solid #ffffff;border-radius: 10px;padding: 10px;
  60. box-sizing: border-box;position: relative;
  61. display: flex;align-items: center;
  62. img{width: 100%;border-radius: 8px;z-index: 8;}
  63. p{color: #fdfdfd;font-size: 18px;display: flex;justify-content: space-between;}
  64. .video-play-btn{
  65. width: 70px;height: 70px;position: absolute;z-index: 10;background-size: cover;background-position: center;
  66. background-image: url("~static/images/client/course/animation-video-img1.png");background-repeat: no-repeat;
  67. right: -15px;bottom: 30px;transition: 0.5s;
  68. }
  69. .video-play-btn:hover{transform: scale(1.1);cursor: pointer;}
  70. }
  71. .video-item-box:before,.video-item-box:after{content: ' ';position: absolute;display: block;background-repeat: no-repeat;background-size: contain;}
  72. .video-item-box:before{width: 357px;height: 99px;background-image: url("~static/images/client/course/animation-video-img2.png");bottom: -30px;right: -44px;z-index: 9;}
  73. .video-item-box:after{width: 95px;height: 160px;background-image: url("~static/images/client/course/animation-video-img3.png");bottom: 20px;right: -30px;z-index: 7;transform: rotateY(180deg);}
  74. </style>