<template>
  <div class="select_con" :class="{ sactive: isActive }" v-clickoutside="handleoutside">
    <!-- 待完善 -->
    <div v-show="0" class="zuola" @click="isActive = true">
      <img class="jiantou" :src="require('@/assets/images/a.png')" alt="" />
    </div>
    <img
      class="close"
      @click="isActive = false"
      :src="require('@/assets/images/close.png')"
      alt=""
    />
    <div class="select_body">
      <div class="brightness"></div>
      <p class="title">请选择</p>
      <ul>
        <li :class="{active:type=='fdkk'}" @click="$bus.$emit('changeType','fdkk')">展馆漫游</li>
        <li :class="{active:type=='pano'}" @click="$bus.$emit('changeType','pano')">展区漫游</li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  props:['type'],
  data() {
    return {
      isActive: false,
    };
  },
  methods:{
    handleoutside(){
      this.isActive = false
    },
  }
};
</script>

<style lang="less" scoped>
@bx: 0 3px 6px rgba(0, 0, 0, 1);
@bc: rgba(12, 91, 246, 0.8);
@animation: 0.3s ease all;
.select_con {
  position: fixed;
  left: 0;
  z-index: 1011;
  top: 40%;
  transform: translateY(-50%);
  width: 100%;
  pointer-events: none;
  .zuola {
    position: absolute;
    box-shadow: @bx;
    top: 0;
    left: 0;
    background-color: @bc;
    border-radius: 30px;
    width: 60px;
    height: 40px;
    overflow: hidden;
    display: inline-block;
    transform: translateX(-50%);
    transition: @animation;
    pointer-events: auto;
    .jiantou {
      left: 50%;
      top: 30%;
      position: absolute;
      width: 18px;
    }
  }
  .close {
    position: absolute;
    top: 0;
    width: 40px;
    padding: 6px;
    left: 0;
    z-index: 1012;
    border-radius: 30px;
    box-shadow: @bx;
    background-color: @bc;
    opacity: 0;
    pointer-events: none;
    transition: @animation;
  }
  .select_body {
    transition: @animation;
    width: 80%;
    text-align: center;
    overflow: hidden;
    pointer-events: none;
    border-radius: 12px;
    z-index: 999;
    margin: 0 auto;
    padding: 30px 10%;
    font-size: 20px;
    font-weight: lighter;
    position: relative;
    transform: translate(-120%, 2%);
    background: rgba(0,0,0,0.4);
    .title {
      color: rgba(255, 255, 255, 0.8);
    }
    > ul {
      margin-top: 24px;
      > li {
        @h: 60px;
        border: 2px solid @color;
        line-height: @h;
        height: @h;
        border-radius: 40px;
        margin-bottom: 14px;
        &:hover,&.active{
          cursor: pointer;
          background: @color;
        }
      }
    }
  }
}
.sactive {
  pointer-events: auto;

  .zuola {
    height: 40px;
    width: 90px;
    left: 8%;
    transform: translateX(0);
    .jiantou {
      display: none;
    }
  }
  .select_body {
    pointer-events: auto;
    transform: translate(0%, 2%);
  }
  .close {
    left: 8%;
    opacity: 1;
    pointer-events: auto;
  }
}
</style>
