index.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. <template>
  2. <div class="hotspotconf" :class="{ mbhotspotcon: isMobile, noBg: active == 'vAudio' }" @mousemove.stop>
  3. <component :is="active" @close="$emit('close')" :hotspot="hotspot"></component>
  4. <div v-if="active != 'vAudio'" @click="$emit('close')" class="close">
  5. <img :src="require('@/assets/images/proj2022/pc/cancel_btn.png')" alt="" />
  6. </div>
  7. </div>
  8. </template>
  9. <script>
  10. import audio from "./audio.vue";
  11. import image from "./image.vue";
  12. import video from "./video.vue";
  13. import title from "./title.vue";
  14. import iframe from "./iframe.vue";
  15. import model from "./model.vue";
  16. let iconArr = [
  17. { name: "视频", key: "video", id: "vVideo", img: "video-icon", display: false },
  18. { name: "网页", key: "iframe", id: "vIframe", img: "iframe-icon", display: false },
  19. { name: "图片", key: "images", id: "vImage", img: "img-icon", display: false },
  20. { name: "模型", key: "model", id: "vModel", img: "model-icon", display: false },
  21. { name: "介绍", key: "title", id: "vTitle", img: "txt-icon", display: false },
  22. ];
  23. export default {
  24. props: ["hotspot"],
  25. components: {
  26. vAudio: audio,
  27. vImage: image,
  28. vIframe: iframe,
  29. vTitle: title,
  30. vVideo: video,
  31. vModel: model,
  32. },
  33. methods: {
  34. close() {
  35. this.$emit("close");
  36. },
  37. },
  38. mounted() {
  39. this.$bus.$on("closehotspot", (data) => {
  40. if (data) {
  41. this.close();
  42. }
  43. });
  44. // console.log(this.hotspot);
  45. iconArr.forEach((item) => {
  46. if (this.hotspot[item.key]) {
  47. this.active = !this.active ? item.id : this.active;
  48. }
  49. });
  50. console.log(this.hotspot, "111");
  51. !this.active && (this.active = "vTitle");
  52. if (this.hotspot.title.indexOf("(视频)") > -1) {
  53. let tmp = this.hotspot.title.split("(视频)");
  54. this.hotspot.title = tmp[0];
  55. this.hotspot.guid = tmp[1];
  56. this.active = "vVideo";
  57. }
  58. if (this.hotspot.backgroundMusic) {
  59. this.active = "vAudio";
  60. }
  61. console.log(this.active, "111");
  62. },
  63. data() {
  64. return {
  65. active: "",
  66. };
  67. },
  68. computed: {
  69. scene() {
  70. return this.$route.params.type;
  71. },
  72. },
  73. };
  74. </script>
  75. <style lang="less" scoped>
  76. @w: 100%;
  77. @titleH: 100px;
  78. @supports (backdrop-filter: brightness(60%)) {
  79. .hotspotconf {
  80. backdrop-filter: blur(30px) brightness(60%) !important;
  81. background-color: rgba(0, 0, 0, 0) !important;
  82. }
  83. .noBg {
  84. background-color: rgba(0, 0, 0, 0) !important;
  85. backdrop-filter: none !important;
  86. }
  87. }
  88. .hotspotconf {
  89. position: fixed;
  90. z-index: 9999;
  91. width: 100%;
  92. height: 100%;
  93. left: 0;
  94. top: 0;
  95. background-color: rgba(0, 0, 0, 0.8);
  96. background-repeat: no-repeat;
  97. background-position: bottom center;
  98. background-size: 100% auto;
  99. & /deep/ .hotspot {
  100. height: 100%;
  101. width: 100%;
  102. position: relative;
  103. display: flex;
  104. justify-content: space-around;
  105. align-items: center;
  106. .vhotspotcon {
  107. position: relative;
  108. width: @w;
  109. height: 100%;
  110. .vtitle {
  111. font-size: 30px;
  112. font-weight: bold;
  113. width: 1136px;
  114. height: @titleH;
  115. margin: 20px auto;
  116. align-items: center;
  117. color: #ffffff;
  118. max-height: 100px;
  119. height: auto!important;
  120. display: -webkit-box!important;
  121. -webkit-box-orient: vertical;
  122. -webkit-line-clamp: 2;
  123. text-overflow: ellipsis;
  124. }
  125. .hotspotcon {
  126. width: 100%;
  127. height: calc(100% - @titleH);
  128. .img-con {
  129. display: flex;
  130. align-items: center;
  131. justify-content: space-between;
  132. position: relative;
  133. height: 86%;
  134. overflow: hidden;
  135. .imgmain {
  136. width: 100%;
  137. height: 100%;
  138. overflow-x: hidden;
  139. overflow-y: auto;
  140. position: relative;
  141. margin: 0 auto;
  142. display: flex;
  143. align-items: center;
  144. justify-content: center;
  145. text-align: center;
  146. img {
  147. cursor: pointer;
  148. max-width: 100%;
  149. width: auto;
  150. max-height: 100%;
  151. height: auto;
  152. margin: 0 auto;
  153. }
  154. > iframe {
  155. width: 100%;
  156. cursor: pointer;
  157. height: 100%;
  158. }
  159. video {
  160. max-width: 100%;
  161. height: 99%;
  162. }
  163. }
  164. }
  165. @h: 100%;
  166. .bigImg {
  167. height: @h;
  168. }
  169. .pagna {
  170. text-align: center;
  171. z-index: 999;
  172. font-size: 18px;
  173. margin-top: 10px;
  174. color: rgba(255, 255, 255, 0.8);
  175. position: absolute;
  176. bottom: 0px;
  177. left: 50%;
  178. transform: translate(-50%);
  179. }
  180. .desc {
  181. width: 1136px;
  182. height: 9%;
  183. font-size: 16px;
  184. text-align: justify;
  185. line-height: 1.5;
  186. // max-height: 120px;
  187. margin: 10px auto 0;
  188. padding-right: 14px;
  189. overflow-y: auto;
  190. }
  191. }
  192. .hotconfull {
  193. height: 100%;
  194. }
  195. .fullcon {
  196. width: 100%;
  197. height: 100%;
  198. overflow: hidden;
  199. clip-path: polygon(1% 12%, 3.8% 8%, 42% 8%, 45.2% 2.7%, 99% 2.7%, 99% 89%, 92% 98%, 1% 98%);
  200. top: 50%;
  201. left: 50%;
  202. transform: translate(-50%, -50%);
  203. .img-con {
  204. margin-top: 0;
  205. height: 100%;
  206. .imgmain {
  207. width: 100%;
  208. height: 100%;
  209. text-align: center;
  210. >img{
  211. margin: 0 auto;
  212. }
  213. }
  214. }
  215. }
  216. }
  217. @pos: 50px;
  218. .aa {
  219. position: absolute;
  220. width: 50px;
  221. height: auto;
  222. cursor: pointer;
  223. top: 50%;
  224. transform: translateY(-50%);
  225. left: @pos;
  226. z-index: 999;
  227. &:last-of-type {
  228. right: @pos;
  229. left: unset;
  230. }
  231. }
  232. .vtitle {
  233. font-size: 30px;
  234. font-weight: bold;
  235. width: 100%;
  236. color: #ffffff;
  237. overflow: hidden;
  238. margin-top: 20px;
  239. }
  240. }
  241. & /deep/ .close {
  242. pointer-events: auto;
  243. }
  244. }
  245. .noBg {
  246. background-color: rgba(0, 0, 0, 0);
  247. }
  248. .close {
  249. position: absolute;
  250. top: 40px;
  251. right: 30px;
  252. width: 50px;
  253. height: 50px;
  254. padding: 15px;
  255. border-radius: 50%;
  256. cursor: pointer;
  257. z-index: 9999999;
  258. background: rgba(255, 255, 255, 0.1);
  259. > img {
  260. width: 20px;
  261. height: 20px;
  262. }
  263. }
  264. .mbhotspotcon {
  265. pointer-events: auto;
  266. @supports (backdrop-filter: brightness(60%)) {
  267. backdrop-filter: blur(10px) brightness(80%) !important;
  268. background-color: rgba(0, 0, 0, 0) !important;
  269. }
  270. .close {
  271. top: 10px;
  272. right: 10px;
  273. background: rgba(255, 255, 255, 0);
  274. }
  275. }
  276. </style>