<template>
  <div class="vx-container">
    <div class="general-header"></div>
    <div class="header-bg"></div>
    <div
      :class="$route.name == '巡检详情' ? 'general-view-two' : 'general-view'"
      :style="{
        height: $store.state.showBtnData.isShow ? '' : '79%',
        top: $store.state.showBtnData.isShow ? '' : '46%',
        transform: $store.state.showBtnData.isShow ? '' : 'translateY(-46%)'
      }"
    >
      <router-view />
    </div>

    <div class="general-footnote">
      <div
        class="back-home"
        v-show="$store.state.showBtnData.isShow"
        @click="backHome"
      >
        <img src="@/assets/image/vxEwm/back.png" alt="" class="back-icon" />
        <span> 返回{{ $store.state.showBtnData.text }}</span>
      </div>
      <div class="app-download-hint">查看更多信息请下载 “安全木渎APP”</div>
      <div class="download-btn" @click="handlerDownload()">
        <span>></span>
        <a>点击下载1111</a>
        <span> &lt; </span>
      </div>
    </div>
    <div class="footonte-bg"></div>
  </div>
</template>

<script>
export default {
  data() {
    return {}
  },
  created() {
    let windowBar = document.getElementById('statusBar')
    windowBar.style.height = 0 + 'px'
    this.isShow = this.$route.query.isShow
  },
  methods: {
    backHome() {
      if (this.$store.state.showBtnData.text == '工业园') {
        this.$router.replace({
          path: '/park',
          query: { id: this.$store.state.parkId }
        })
      } else if (this.$store.state.showBtnData.text == '楼栋') {
        this.$router.replace({
          path: '/build',
          query: {
            buildingId: this.$store.state.buildingId,
            parkId: this.$store.state.parkId
          }
        })
      } else {
        this.$router.replace({
          path: '/enterpriseData/info',
          query: {
            id: this.$store.state.enterpriseId,
            isShow: this.$store.state.parkId ? true : false
          }
        })
      }
    },
    handlerDownload() {
      this.$installApk()
    }
  }
}
</script>

<style lang="scss" scoped>
.vx-container {
  position: relative;
  top: 0;
  left: 0;
  min-height: 100vh;
  background: url('~@/assets/image/vxEwm/middle-bg.png');
  background-size: cover;
  overflow: hidden;

  .header-bg {
    position: absolute;
    top: 0;
    left: 0;
    height: 25vh;
    width: 100%;
    z-index: 9;

    background: url('~@/assets/image/vxEwm/bg1.png');
    background-size: 100% 100%;
  }

  .general-header {
    position: absolute;
    top: 1vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: 4.8rem;
    height: 8.3vh;
    background: url('~@/assets/image/vxEwm/logo.png') center no-repeat;
    background-size: 100% auto;
  }

  .general-view {
    position: absolute;
    top: 37%;
    transform: translateY(-37%);
    height: 73%;
    width: 100%;
    z-index: 20;
    background: #e8f3fc;
    border-radius: 30px;
    overflow: hidden;
    box-sizing: border-box;
    padding: 0.3rem 0.21rem 0 0.21rem;
  }

  .footonte-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 9;
    width: 100%;
    height: 15vh;
    background: url('~@/assets/image/vxEwm/bg2.png');
    background-size: 100% 100%;
  }

  .general-view-two {
    position: absolute;
    top: 37%;
    transform: translateY(-37%);
    z-index: 10;
    height: 73%;
    width: 100%;
    // background: #e8f3fc;
    border-radius: 30px;
    overflow: hidden;
    box-sizing: border-box;
    padding: 0 0.21rem 0 0.21rem;
  }

  .general-footnote {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 10;
    width: 100%;

    .back-home {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 1.85rem;
      height: 0.5rem;
      margin: auto;

      .back-icon {
        display: inline-block;
        height: 0.3rem;
        height: 0.25rem;
        margin-right: 0.05rem;
      }

      color: #177fd4;
      font-weight: bold;
      font-size: 0.22rem;
      border-radius: 28px;
      background-image: linear-gradient(to right, #accbee, #e7f0fd);
    }

    .app-download-hint {
      margin-top: 0.1rem;
      font-size: 0.24rem;
      font-weight: 800;
      color: #feffff;
      font-weight: bold;
      text-shadow: 0px 0px 0px #0e50b4;
    }

    .download-btn {
      margin-top: 0.1rem;
      padding-bottom: 3vh;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #feffff;

      a {
        margin: 0 0.1rem;
        text-decoration: underline;
      }
    }
  }
}
</style>
