preview.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <popup v-if="show">
  3. <i @click="$emit('close')" class="iconfont iconbs_close closeicon"></i>
  4. <div class="ui-message ui-message-confirm">
  5. <div class="ui-message-main">
  6. <template v-if="item.hotspotType=='textarea'">
  7. <div class="v-textarea">
  8. <span>{{item.textarea}}</span>
  9. </div>
  10. </template>
  11. <video
  12. v-else
  13. id="myVideo"
  14. ref="video"
  15. webkit-playsinline='true'
  16. playsinline='true'
  17. x5-video-player-type='h5'
  18. x5-video-player-fullscreen='true'
  19. controls
  20. class="video-js"
  21. :poster="item.video.icon"
  22. >
  23. <source
  24. :src="item.video.ossPath"
  25. >
  26. </video>
  27. <!-- <video :poster="item.video.icon" controls autoplay :src="item.video.ossPath"></video> -->
  28. </div>
  29. </div>
  30. </popup>
  31. </template>
  32. <script>
  33. import Popup from "@/components/shared/popup";
  34. export default {
  35. props:['show','item'],
  36. components:{
  37. Popup
  38. },
  39. data(){
  40. let typeStr={
  41. image:'icon',
  42. pano:'previewIcon'
  43. // image:'icon',
  44. // image:'icon',
  45. }
  46. return {
  47. typeStr
  48. }
  49. },
  50. mounted(){
  51. this.$nextTick(() => {
  52. try {
  53. this.myPlayer = this.$video('myVideo', {
  54. loop: true,
  55. preload: 'auto'
  56. })
  57. } catch (error) {
  58. error
  59. }
  60. })
  61. }
  62. }
  63. </script>
  64. <style lang="less" scoped>
  65. .ui-message{
  66. width: 100%;
  67. background: none;
  68. border: none;
  69. max-width: 100%;
  70. padding: 0;
  71. }
  72. .closeicon{
  73. position: fixed;
  74. color: rgba(255, 255, 255, 0.88);
  75. top: 28px;
  76. font-size: 14px;
  77. right: 28px;
  78. }
  79. .ui-message-confirm{
  80. border-radius: 0;
  81. .icon-close{
  82. color: #909090;
  83. }
  84. .ui-message-main{
  85. width: 100%;
  86. font-size: 0;
  87. position: relative;
  88. >img{
  89. width: 100%;
  90. }
  91. video{
  92. min-height: 210px;
  93. width: 100%;
  94. }
  95. .v-textarea{
  96. width: 100%;
  97. max-height: 540px;
  98. overflow-y: auto;
  99. padding: 30px 50px;
  100. text-align: left;
  101. >span{
  102. font-size: 14px;
  103. color: #202020;
  104. word-break: break-all;
  105. }
  106. }
  107. }
  108. .ui-message-footer{
  109. width: 100%;
  110. .btn{
  111. width: 80%;
  112. display: flex;
  113. justify-content: center;
  114. margin: 0 auto;
  115. .ui-button{
  116. max-width: 104px;
  117. }
  118. }
  119. }
  120. }
  121. </style>
  122. <style lang="less" scoped>
  123. @import './preview.less';
  124. </style>