hotList.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <div class="hotList">
  3. <div class="title">
  4. <div class="titleLL">热点列表</div>
  5. <div class="titleRR" @click="$emit('close')">
  6. <img src="../../../assets/img/close.png" alt="" />
  7. </div>
  8. </div>
  9. <div class="main">
  10. <div class="txtNone" v-if="data.length === 0">暂无热点</div>
  11. <div class="txt" v-else>
  12. <span :class="{ active: hotInd === index }" @click="openHot(item, index)" v-for="(item, index) in data"
  13. :key="index">{{ item.info.title ? item.info.title : "热点" }}</span>
  14. </div>
  15. </div>
  16. </div>
  17. </template>
  18. <script>
  19. export default {
  20. components: {},
  21. data() {
  22. return {
  23. data: [],
  24. hotInd: null,
  25. };
  26. },
  27. computed: {},
  28. watch: {},
  29. methods: {
  30. openHot(e, index) {
  31. // 停止自动导览
  32. window.player.director.stopTour();
  33. setTimeout(() => {
  34. e && e.examine(window.player, true);
  35. this.hotInd = index;
  36. }, 200);
  37. },
  38. },
  39. created() {
  40. },
  41. mounted() {
  42. let timeA = -1;
  43. timeA = window.setInterval(() => {
  44. if (window.isHot) {
  45. clearInterval(timeA);
  46. }
  47. if (window.isHot && window.myHotList && window.myHotList.length) {
  48. this.data = window.myHotList;
  49. console.log('看一看热点列表', window.myHotList, this.data)
  50. } else {
  51. this.data = []
  52. }
  53. }, 1000)
  54. },
  55. beforeCreate() { }, //生命周期 - 创建之前
  56. beforeMount() { }, //生命周期 - 挂载之前
  57. beforeUpdate() { }, //生命周期 - 更新之前
  58. updated() { }, //生命周期 - 更新之后
  59. beforeDestroy() { }, //生命周期 - 销毁之前
  60. destroyed() { }, //生命周期 - 销毁完成
  61. activated() { }, //如果页面有keep-alive缓存功能,这个函数会触发
  62. };
  63. </script>
  64. <style lang='less' scoped>
  65. .hotList {
  66. position: absolute;
  67. width: 940px;
  68. height: 640px;
  69. top: 50%;
  70. left: 50%;
  71. transform: translate(-50%, -50%);
  72. background-image: url("../../../assets/img/open/bg-list.png");
  73. background-size: 100% 100%;
  74. padding: 60px 80px;
  75. .title {
  76. height: 60px;
  77. display: flex;
  78. align-items: center;
  79. justify-content: space-between;
  80. .titleLL {
  81. font-size: 24px;
  82. color: #d6b970;
  83. }
  84. .titleRR {
  85. cursor: pointer;
  86. }
  87. }
  88. .main {
  89. margin-top: 20px;
  90. width: calc(100% - 14px);
  91. height: calc(100% - 100px);
  92. overflow-y: auto;
  93. .txtNone {
  94. height: 100%;
  95. color: #d6b970;
  96. font-size: 20px;
  97. display: flex;
  98. align-items: center;
  99. justify-content: center;
  100. }
  101. .txt {
  102. width: calc(100% - 10px);
  103. color: #fff;
  104. font-size: 16px;
  105. &>span {
  106. border-top: 1px solid #f0e2c0;
  107. padding: 15px 0;
  108. cursor: pointer;
  109. display: block;
  110. width: 100%;
  111. &:last-child {
  112. margin-bottom: 60px;
  113. border-bottom: 1px solid #f0e2c0;
  114. }
  115. &:hover {
  116. color: #d6b970;
  117. }
  118. }
  119. .active {
  120. color: #d6b970;
  121. }
  122. }
  123. &::-webkit-scrollbar-thumb {
  124. outline: 2px solid #d6b970;
  125. }
  126. &::-webkit-scrollbar {
  127. width: 2px;
  128. }
  129. }
  130. }
  131. @media screen and (max-width: 1000px) {
  132. .hotList {
  133. max-width: 500px;
  134. width: 94%;
  135. height: 90%;
  136. padding: 30px 10px 30px 30px;
  137. .title {
  138. .titleLL {
  139. font-size: 18px;
  140. }
  141. .titleRR {
  142. position: absolute;
  143. right: -5px;
  144. top: 5px;
  145. }
  146. }
  147. .main {
  148. margin-top: 10px;
  149. .txt {
  150. font-size: 14px;
  151. &>span {
  152. &:hover {
  153. color: #fff;
  154. }
  155. }
  156. .active {
  157. color: #d6b970 !important;
  158. }
  159. }
  160. }
  161. }
  162. }
  163. </style>