<template>
  <div class="birdview">
    <ViewOperation>
      <div class="birdcon">
        <img class="bd_bg" :src="require(`@/assets/images/resource/map/map.jpg`)" alt="" />
        <div class="tag" @click="onBack" :style="{ top: tagData.top, left: tagData.left }">
          <img :src="require(`@/assets/images/resource/map/ico_address_active.png`)" alt="" />
        </div>
      </div>
    </ViewOperation>

    <img class="close" @click="onBack" :src="require(`@/assets/images/resource/map/btn_back.png`)" alt="" />
    <div class="raside" :class="{ show: isAside }">
      <maside @close="isAside = !isAside" :isAside="isAside" />
    </div>
</div>
</template>

<script setup>


import ViewOperation from "./ViewOperation";
import { tag_position } from "@/data";
import { onMounted, watch, computed, ref, nextTick } from "vue";
import maside from "./maside.vue";
import { useRouter, useRoute } from "vue-router";

const router = useRouter();
const route = useRoute();

let isAside = ref(true)
let current = ref('')


const tagData = computed(() => tag_position[route.params.id])


let onBack = (data) => {
  router.replace({ name: 'scene',params:{id:route.params.id} })
};

</script>

<style lang="scss" scoped>
$w: 10px;

.birdview {
  width: 100%;
  height: 100%;
  z-index: 9;
  background-color: #77a3a4;


  .birdcon {
    height: 100%;
    width: 100%;
    position: relative;

    .bd_bg {
      width: auto;
      height: 100%;
    }

    .tag {
      position: absolute;
      cursor: pointer;
      display: inline-block;
      text-align: center;
      width: 30px;
      >img {
        width: 100%;
        display: inline-block;
        position: absolute;
        transform: translateX(-14px);
      }
    }
  }


  .close {
    width: 40px;
    height: 40px;
    position: absolute;
    top: 28px;
    left: 20px;
    cursor: pointer;
    z-index: 99;
  }

  .shoqi {
    width: 60px;
    height: 60px;
    position: absolute;
    top: 28px;
    right: 40px;
    cursor: pointer;
    z-index: 99;
    border-radius: 50%;
    background: rgba(229, 220, 203, 0.3);
    backdrop-filter: blur(46px);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;

    >img {
      width: 24px;
    }
  }

  .tag {
    position: absolute;
    cursor: pointer;
    display: inline-block;
    text-align: center;
    top: 50%;
    left: 50%;
    width: 40px;

    // background: #000;
    >img {
      width: 100%;
      display: inline-block;
      position: absolute;
    }

  }

  .raside {
    position: absolute;
    bottom: -74%;
    z-index: 101;
    height: 100%;
    backdrop-filter: blur(16px);
    transition: ease 0.3s all;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    width: 100%;
    max-height: 80%;
    background: linear-gradient(180deg, #B2A68F 0%, rgba(141, 127, 100, 0.6) 5%, rgba(141, 127, 100, 0.6) 80%, rgba(141, 127, 100, 0) 100%);

    &.show {
      bottom: 0;
    }
  }
}
</style>
