<script setup>
import Aside from "./component/Aside.vue";
import Header from './component/Header.vue'
import Footer from './component/Footer.vue'
import AudioBox from '@/components/Audio.vue'
import LoginPop from '@/components/LoginPop.vue'


</script>

<template>
  <div class="layout-wrap">
    <el-container style="width:100%;height:100%">
      <el-header>
        <Header/>
      </el-header>
      <el-container style="padding-top:60px">
        <el-container style="display:block">
        <el-aside width="160px">
          <Aside />
        </el-aside>
        <el-main style="padding-left:180px;overflow:visible;"> <!-- 使用粘性布局 需要overflow设置为visible 否则粘性布局会失效 -->
          <div class="page-container">
          <router-view v-slot="{ Component }">
              <keep-alive>
                  <component :is="Component" :key="$route.name" v-if="$route.meta.keepAlive" />
              </keep-alive>
              <component :is="Component" :key="$route.name" v-if="!$route.meta.keepAlive" />
          </router-view>
          </div>
        </el-main>
        </el-container>
        <el-footer>
          <Footer/>
        </el-footer>
      </el-container>
    </el-container>

    <!-- 回到顶部 -->
    <el-backtop :bottom="100" :visibility-height="900" style="z-index:1000">
      <img src="@/assets/icon-back-top.png" alt="" style="width: 60px;">
    </el-backtop>

    <!-- 音频模块 -->
    <AudioBox></AudioBox>

    <!-- 登录弹窗 -->
    <LoginPop v-if="$store.state.showLogin||$store.state.showBind"></LoginPop>
  </div>
</template>

<style lang="scss" scoped>
.layout-wrap {
  width: 100%;
  height: 100%;
  background-color: #fff;
  position: relative;
}
.el-header{
  box-shadow: 0px 2px 9px 1px rgba(227, 227, 227, 0.5);
  background-color: #fff;
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 999;
}
.el-aside{
  box-shadow: 0px 2px 9px 1px rgba(227, 227, 227, 0.5);
  position: fixed;
  left: 0;
  top: 60px;
  bottom: 0;
  z-index: 998;
  background-color: #fff;
}
.el-main {
  .page-container{
    // min-width: 820px;
    max-width: 1240px;
    margin: 0 auto;
    min-height: 600px;
  }
}
.el-footer{
  position: relative;
  z-index: 999;
  background-color: #fff;
  border-top: 1px solid #f2f2f2;
  height: auto;
  padding: 0;
}

.global-audio-box{
  position: fixed;
  width: 485px;
  height: 150px;
  background: #FFFFFF;
  box-shadow: 0px 3px 12px 0px rgba(81, 88, 101, 0.16);
  border-radius: 8px;
  border: 1px solid #EBEBEB;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  z-index: 999;
  .icon{
    float: right;
    position: relative;
    right: 10px;
    top: 4px;
    cursor: pointer;
  }
  audio{
    width: 90%;
    height: 30px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-top: 9px;
  }
  .btns{
    .btn{
      display: inline-block;
      width: 30px;
      height: 30px;
      background-size: cover;
      background-image: url('@/assets/audio-before-default.png');
      cursor: pointer;
      &:hover{
        background-image: url('@/assets/audio-before-hover.png');
      }
    }
    .no-audio{
      background-image: url('@/assets/audio-before-grey.png');
      &:hover{
        background-image: url('@/assets/audio-before-grey.png');
      }
    }

  }
  
}

</style>
