<template>
  <div class="fi-mobile" v-if="isMobile">
    <div class="fi-main">
      <img src="../assets/fi_mobile_title.png" />
      <p>在线学习系统</p>
    </div>
    <div class="fi-login">
      <router-view></router-view>
    </div>
    <div class="fi-header"><img src="../assets/fi_mobile_logo.png" /></div>
  </div>
  <div class="fi-pc" v-else>
    <div class="fi-header"><img src="../assets/fi_logo.png" /></div>
    <div class="fi-main">
      <div class="fi-left">
        <div>
          <img src="../assets/fi_icon.png" />
        </div>
        <div>
          <img src="../assets/fi_title.png" />
          <p>在线学习及考试系统</p>
        </div>
      </div>
      <div class="fi-login">
        <router-view></router-view>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'fiLayout',
  head() {
    return {
      link: [{ vmid: 'icon', rel: 'icon', href: 'https://webapp-pub.ezijing.com/website/base/images/prp.png' }]
    }
  },
  data() {
    return {
      imgUrl: 'pc'
    }
  },
  computed: {
    isMobile() {
      return /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)
    }
  }
}
</script>

<style lang="scss" scoped>
.fi-mobile {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;

  min-height: 100vh;
  background: linear-gradient(180deg, #ffffff 0%, #e9eff7 100%);
  padding: 0 40px;
  img {
    max-width: 100%;
  }
  .fi-main {
    text-align: center;
    p {
      margin-top: 45px;
      font-family: Source Han Sans CN, Source Han Sans CN;
      font-weight: 400;
      font-size: 20px;
      color: #6d7278;
      letter-spacing: 20px;
      text-align: center;
    }
  }
  .fi-login {
    min-width: 100%;
  }
}
.fi-pc {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: url('../assets/fi_bg.png') no-repeat center center;
  background-size: cover;
  .fi-header {
    padding: 60px 60px 0;
  }
  .fi-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
  }
  .fi-left {
    display: flex;
    align-items: center;
    p {
      margin-top: 45px;
      font-family: Source Han Sans CN, Source Han Sans CN;
      font-weight: 400;
      font-size: 30px;
      color: #6d7278;
      letter-spacing: 34px;
      text-align: center;
    }
  }
  .fi-login {
    margin-left: 40px;
    box-sizing: border-box;
    min-width: 520px;
    box-shadow: 0px 2px 8px 1px rgba(0, 0, 0, 0.16);
    border-radius: 18px 18px 18px 18px;
    padding: 50px;
  }
}
:deep(.el-button--primary) {
  background: #0e386b;
  border: none;
}
</style>
