Broadcast.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <div class="wrapper">
  3. <div class="ui-broadcast" @click="close">
  4. <div class="ui-con" @click.stop>
  5. <img class="bg" :src="require('@/assets/images/collect_bg.png')">
  6. <img class="close" @click="close" :src="require('@/assets/images/icon/close.png')">
  7. <div class="img-con img-k" >
  8. <iframe v-if="item.type == 'model'" :src="$serverName+`/model-page/Model.html?m=${getLastName(item.filePath)}`" frameborder="0"></iframe>
  9. <img v-else-if="item.type == 'img'" :src="$serverName+item.filePath" alt="">
  10. <video controlslist="nodownload" disablePictureInPicture controls autoplay v-else :src="$serverName+item.filePath"></video>
  11. </div>
  12. </div>
  13. <div class="full" v-if="isFull" @click.stop>
  14. <img class="full-btn" @click="close" :src="`${$cdn}images/close-full.png`" alt="">
  15. </div>
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. export default {
  21. data(){
  22. return {
  23. isFull:false
  24. };
  25. },
  26. mounted(){
  27. console.log(this.item);
  28. },
  29. methods:{
  30. getLastName(data){
  31. return data.substring(data.lastIndexOf("/")+1)
  32. },
  33. close(){
  34. this.$hideBroadcast()
  35. this.$bus.$emit('fadeCollect',true)
  36. }
  37. }
  38. };
  39. </script>
  40. <style lang="less" scoped>
  41. @import '../../assets/style/globalVars.less';
  42. .ui-broadcast{
  43. height: 100%;
  44. position: fixed;
  45. z-index: 9999;
  46. top: 0;
  47. left: 0;
  48. width: 100%;
  49. .ui-con{
  50. top: 48%;
  51. left: 50%;
  52. transform: translate(-50%,-50%);
  53. text-align: center;
  54. width: 80%;
  55. padding: 80px 140px;
  56. position: relative;
  57. font-size: 0;
  58. border-radius: 10px;
  59. overflow: hidden;
  60. box-sizing: border-box;
  61. .bg{
  62. position: absolute;
  63. top: 0;
  64. left: 0;
  65. width: 100%;
  66. height: 100%;
  67. z-index: -1;
  68. min-height: 80vh;
  69. }
  70. .close{
  71. position: absolute;
  72. bottom: 50px;
  73. right: 50px;
  74. width: 20px;
  75. cursor: pointer;
  76. z-index: 9999;
  77. }
  78. iframe,video{
  79. width: 100%;
  80. min-height: 550px;
  81. max-height: 60vh;
  82. }
  83. img{
  84. width: 100%;
  85. max-height: 60vh;
  86. height: auto;
  87. }
  88. }
  89. .full{
  90. width: 100%;
  91. height: 100%;
  92. z-index: 999;
  93. position: absolute;
  94. left: 50%;
  95. top: 50%;
  96. transform: translate(-50%,-50%);
  97. iframe{
  98. width: 100%;
  99. height: 100%;
  100. }
  101. .full-btn{
  102. width: 50px;
  103. position: absolute;
  104. right: 12px;
  105. top: 30px;
  106. cursor: pointer;
  107. }
  108. }
  109. }
  110. @media screen and (max-width: 500px) {
  111. .ui-broadcast{
  112. .close{
  113. position: absolute;
  114. bottom: 57px;
  115. top: unset;
  116. left: 50%;
  117. right: unset;
  118. transform: translateX(-50%);
  119. width: 22px;
  120. cursor: pointer;
  121. z-index: 9999;
  122. }
  123. .ui-con{
  124. width: 100%;
  125. height: 100%;
  126. top: 0;
  127. left: 0;
  128. border-radius: 0;
  129. transform: none;
  130. .img-con{
  131. height: 100%;
  132. iframe,video{
  133. width: 100%;
  134. height: 100%;
  135. }
  136. img{
  137. width: 100%;
  138. height: auto;
  139. }
  140. }
  141. }
  142. }
  143. }
  144. </style>