hotspotList.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <div class="tag-layer" @click.stop>
  3. <img @click.stop="close" :src="require('@/assets/images/js_icon/close.png')" class="close" alt="">
  4. <div class="hotlistcon">
  5. <img class="htitle" :src="require('@/assets/images/js_icon/hotlisticon.png')" alt="">
  6. <ul v-if="hotspots.length > 0">
  7. <li @click="onclickHotpost(item)" v-for="item in hotspots" :key="item.name">
  8. {{ item.hotspotTitle || '热点' }}
  9. </li>
  10. </ul>
  11. <ul v-else>
  12. <li>暂无热点数据</li>
  13. </ul>
  14. </div>
  15. </div>
  16. </template>
  17. <script setup>
  18. import { unref, defineEmits, onBeforeMount, onMounted, ref, watchEffect, computed, watch, nextTick } from "vue";
  19. import { useApp, getApp } from "@/app";
  20. import { useStore } from "vuex";
  21. import { useMusicPlayer, useSoundPlayer } from "@/utils/sound";
  22. const store = useStore();
  23. const isMobile = computed(() => browser.isMobile());
  24. //背景音乐
  25. const musicPlayer = useMusicPlayer();
  26. //解说音乐
  27. const soundPlayer = useSoundPlayer();
  28. const hotspots = computed(() => {
  29. let temp = store.getters["tags/allTags"].filter(item=>item.hotspotType != "scene")
  30. return temp
  31. })
  32. const onclickHotpost = async (hotspot) => {
  33. let app = await getApp();
  34. app.Tags.emit('clickHotspot', { sceneCode: hotspot.sceneCode, id: hotspot.name });
  35. if (hotspot.hotspotType == "scene") {
  36. close()
  37. }
  38. }
  39. const close = () => {
  40. store.commit("functions/setShowHotspotList", false);
  41. };
  42. </script>
  43. <style lang="scss" scoped>
  44. .tag-layer {
  45. width: 100vw;
  46. height: 100vh;
  47. z-index: 1000;
  48. top: 0;
  49. position: fixed;
  50. left: 0;
  51. box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.3);
  52. backdrop-filter: blur(4px);
  53. display: flex;
  54. justify-content: center;
  55. align-items: flex-end;
  56. .close {
  57. color: rgba(255, 255, 255, 0.6);
  58. z-index: 999;
  59. position: absolute;
  60. right: 18px;
  61. bottom: 67%;
  62. width: 34px;
  63. }
  64. .hotlistcon {
  65. display: flex;
  66. position: relative;
  67. align-items: flex-start;
  68. justify-content: center;
  69. height: 65%;
  70. width: 100%;
  71. background-size: 100% 100%;
  72. background-image: url(@/assets/images/js_icon/hotspot_bg.png);
  73. .htitle {
  74. position: absolute;
  75. left: 50%;
  76. top: -94px;
  77. transform: translateX(-50%);
  78. width: 90px;
  79. }
  80. >ul {
  81. width: 100%;
  82. border-radius: 10px;
  83. font-size: 14px;
  84. color: #fff;
  85. max-height: calc(100% - 60px);
  86. overflow-y: auto;
  87. margin: 40px 10px;
  88. >li {
  89. line-height: 2;
  90. padding: 8px 10px;
  91. }
  92. &::-webkit-scrollbar {
  93. width: 5px;
  94. height: 10px;
  95. }
  96. &::-webkit-scrollbar-track {
  97. background: #1b60a9;
  98. }
  99. &::-webkit-scrollbar-thumb {
  100. background: linear-gradient(#1b60a9, #30ce82);
  101. }
  102. &::-webkit-scrollbar-thumb:hover {
  103. background-color: #999;
  104. }
  105. }
  106. }
  107. }
  108. </style>