preview.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <popup v-if="show">
  3. <div class="ui-message ui-message-confirm"
  4. :style="{width: typeW[item.hotspotType]}" :class="{'txtui-confirm':item.hotspotType=='textarea'}" >
  5. <div class="ui-message-header">
  6. <span>{{item.hotspotTitle}}</span>
  7. <span @click="$emit('close')">
  8. <i class="iconfont icon-close"></i>
  9. </span>
  10. </div>
  11. <div class="ui-message-main">
  12. <template v-if="item.hotspotType=='image'">
  13. <imgview :image="item.image" />
  14. </template>
  15. <template v-else-if="item.hotspotType=='textarea'">
  16. <div class="v-textarea">
  17. <span>{{item.textarea}}</span>
  18. </div>
  19. </template>
  20. <template v-else-if="item.hotspotType=='audio'">
  21. <div class="v-audio">
  22. <v-audio :vkey="item.id" :showTime=true :name="item.audio.name" :idleft="`_${$randomWord(true,8,8)}`" :idright="`_${$randomWord(true,8,8)}`" :myAudioUrl="item.audio.ossPath"></v-audio>
  23. </div>
  24. </template>
  25. <video :poster="item.video.icon" v-else controls autoplay :src="item.video.ossPath"></video>
  26. </div>
  27. </div>
  28. </popup>
  29. </template>
  30. <script>
  31. import Popup from "@/components/shared/popup";
  32. import imgview from "./imgview";
  33. import vAudio from '@/components/audio'
  34. export default {
  35. props:['show','item'],
  36. components:{
  37. Popup,
  38. imgview,
  39. vAudio
  40. },
  41. data(){
  42. let typeStr={
  43. image:'icon',
  44. pano:'previewIcon'
  45. // image:'icon',
  46. // image:'icon',
  47. }
  48. let typeW={
  49. image:'960px',
  50. pano:'960px',
  51. audio:'430px',
  52. video:'960px',
  53. }
  54. return {
  55. typeStr,
  56. typeW
  57. }
  58. },
  59. methods:{
  60. }
  61. }
  62. </script>
  63. <style lang="less" scoped>
  64. .ui-message-confirm{
  65. border-radius: 0;
  66. top: auto;
  67. left: auto;
  68. transform: none;
  69. padding: 0;
  70. border: none;
  71. .icon-close{
  72. color: #909090;
  73. }
  74. .ui-message-header{
  75. border-bottom: 0 solid #EBEBEB;
  76. padding-bottom: 10px;
  77. margin-bottom: 10px;
  78. padding: 14px 20px 6px;
  79. }
  80. .ui-message-main{
  81. width: 100%;
  82. font-size: 0;
  83. position: relative;
  84. >img{
  85. width: 100%;
  86. height: 540px;
  87. }
  88. >video{
  89. width: 100%;
  90. max-height: 600px;
  91. }
  92. .v-textarea{
  93. width: 100%;
  94. max-height: 540px;
  95. overflow-y: auto;
  96. padding: 30px 50px;
  97. text-align: left;
  98. >span{
  99. font-size: 14px;
  100. word-break: break-all;
  101. color: #202020;
  102. display: inline-block;
  103. line-height: 1.5;
  104. }
  105. }
  106. .v-audio{
  107. margin: 20px 50px;
  108. max-height: 540px;
  109. overflow-y: auto;
  110. padding: 20px 15px;
  111. text-align: left;
  112. border: 1px solid #909090;
  113. >span{
  114. font-size: 14px;
  115. color: #202020;
  116. }
  117. }
  118. }
  119. .ui-message-footer{
  120. width: 100%;
  121. .btn{
  122. width: 80%;
  123. display: flex;
  124. justify-content: center;
  125. margin: 0 auto;
  126. .ui-button{
  127. max-width: 104px;
  128. }
  129. }
  130. }
  131. }
  132. .txtui-confirm{
  133. width: 430px;
  134. .ui-message-header{
  135. border-bottom: 1px solid #EBEBEB;
  136. padding: 12px 20px 12px 30px;
  137. >span{
  138. margin: 0;
  139. }
  140. }
  141. .ui-message-main{
  142. width: 330px;
  143. margin: 20px auto;
  144. padding: 0;
  145. background: #fff;
  146. .v-textarea{
  147. padding: 0;
  148. }
  149. }
  150. }
  151. </style>
  152. <style lang="less" scoped>
  153. @import './preview.less';
  154. </style>