CustomHotspotList.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <div class="custom-hotspot-list">
  3. <button
  4. class="close"
  5. @click="$router.go(-1)"
  6. >
  7. <img
  8. class=""
  9. src="@/assets/images/close.png"
  10. alt=""
  11. draggable="false"
  12. >
  13. </button>
  14. <div class="inner-wrap">
  15. <h1>热点列表</h1>
  16. <ul>
  17. <li
  18. v-for="(item, index) in hotspotList"
  19. :key="item.uuid"
  20. @click="openHot(item, index)"
  21. >
  22. {{ item.info.title ? item.info.title : "热点" }}
  23. </li>
  24. </ul>
  25. </div>
  26. </div>
  27. </template>
  28. <script>
  29. export default {
  30. data() {
  31. return {
  32. hotspotList: window.myHotList,
  33. intervalId: null,
  34. }
  35. },
  36. mounted() {
  37. if (!window.myHotList) {
  38. this.intervalId = setInterval(() => {
  39. if (window.myHotList) {
  40. this.hotspotList = window.myHotList
  41. clearInterval(this.intervalId)
  42. } else {
  43. }
  44. }, 300)
  45. }
  46. },
  47. methods: {
  48. openHot(hotspot) {
  49. // 停止自动导览
  50. window.player.director.stopTour()
  51. setTimeout(() => {
  52. hotspot && hotspot.examine(window.player, true)
  53. }, 200)
  54. },
  55. }
  56. }
  57. </script>
  58. <style lang="less" scoped>
  59. .custom-hotspot-list {
  60. position: fixed;
  61. background-color: rgba(21, 52, 115, 0.80);
  62. backdrop-filter: blur(1.8vw);
  63. z-index: 10005;
  64. top: 0;
  65. left: 0;
  66. height: 100%;
  67. width: 100%;
  68. padding: 7.5vw 1vw 7.5vw 7.5vw;
  69. > button.close {
  70. position: absolute;
  71. top: 4.4vw;
  72. right: 4.4vw;
  73. width: 9vw;
  74. height: 9vw;
  75. z-index: 10001;
  76. > img {
  77. position: absolute;
  78. left: 0;
  79. top: 0;
  80. width: 100%;
  81. height: 100%;
  82. }
  83. }
  84. .inner-wrap {
  85. height: 100%;
  86. padding-right: 6.5vw;
  87. overflow: auto;
  88. > h1 {
  89. font-size: 5vw;
  90. font-weight: bold;
  91. color: #FEC600;
  92. }
  93. > ul {
  94. > li {
  95. display: block;
  96. border-bottom: 1px solid #fff;
  97. padding-top: 1em;
  98. padding-bottom: 1em;
  99. font-size: 3.6vw;
  100. font-weight: 400;
  101. color: #FFF;
  102. overflow: hidden;
  103. white-space: pre;
  104. text-overflow: ellipsis;
  105. }
  106. }
  107. }
  108. }
  109. </style>