123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- <template>
- <div class="hotspot">
- <div class="main">
- <div class="txtNone" v-if="data.length === 0">暂无热点</div>
- <div class="mainBox" v-else>
- <div
- v-for="(item, index) in data"
- :key="index"
- :class="{ active: hotInd === index }"
- @click="openHot(item, index)"
- >
- {{ item.info.title ? item.info.title : "热点" }}
- </div>
- </div>
- </div>
- <!-- 关闭按钮 -->
- <div class="close" @click="$emit('close')"></div>
- </div>
- </template>
- <script>
- export default {
- name: "hotspot",
- components: {},
- data() {
- //这里存放数据
- return {
- data: [],
- hotInd: null,
- };
- },
- //监听属性 类似于data概念
- computed: {},
- //监控data中的数据变化
- watch: {},
- //方法集合
- methods: {
- openHot(e, index) {
- // 停止自动导览
- window.player.director.stopTour();
- setTimeout(() => {
- e && e.examine(window.player, true);
- this.hotInd = index;
- }, 200);
- },
- },
- //生命周期 - 创建完成(可以访问当前this实例)
- created() {
- this.data = window.myHotList;
- },
- //生命周期 - 挂载完成(可以访问DOM元素)
- mounted() {},
- beforeCreate() {}, //生命周期 - 创建之前
- beforeMount() {}, //生命周期 - 挂载之前
- beforeUpdate() {}, //生命周期 - 更新之前
- updated() {}, //生命周期 - 更新之后
- beforeDestroy() {}, //生命周期 - 销毁之前
- destroyed() {}, //生命周期 - 销毁完成
- activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
- };
- </script>
- <style lang='less' scoped>
- .hotspot {
- position: fixed;
- width: 100vw;
- height: calc(100% - 50px);
- bottom: 0;
- left: 0;
- z-index: 9998;
- padding: 30px 20px 0;
- &::before {
- content: "";
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- background: rgba(161, 101, 59, 0.8);
- backdrop-filter: blur(4px);
- z-index: -1;
- }
- .main {
- border-radius: 8px;
- padding: 25px 0 10px 0;
- background-color: #fff6d2;
- width: 100%;
- height: calc(100% - 60px);
- .txtNone {
- color: #774926;
- width: 100%;
- height: 100%;
- font-size: 24px;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- .mainBox::-webkit-scrollbar {
- width: 4px;
- }
- .mainBox::-webkit-scrollbar-thumb {
- outline: 2px solid #cc946d;
- }
- .mainBox {
- padding: 0 15px;
- width: 100%;
- height: 100%;
- overflow-y: auto;
- & > div {
- font-size: 16px;
- color: #774926;
- text-align: center;
- width: 100%;
- margin-bottom: 15px;
- }
- .active {
- color: #d4a781;
- }
- }
- }
- .close {
- cursor: pointer;
- position: absolute;
- left: 50%;
- bottom: 15px;
- transform: translateX(-50%);
- width: 30px;
- height: 30px;
- background: url("../../../assets/img/close.png");
- background-size: 100% 100%;
- }
- }
- </style>
|