<template>
  <div id="userLayout" :class="['user-layout-wrapper', device]">
    <div class="backImg"></div>
    <div class="container">
      <div class="top">
        <div class="header">
          <a href="/">
            <img src="~@/assets/logo.svg" class="logo" alt="logo" />
            <span class="title">计科院ERP系统</span>
          </a>
        </div>
        <div class="desc">
          欢迎您登录
        </div>
      </div>

      <div class="border">
        <route-view></route-view>
      </div>

      <div class="footer">
        <div class="links">
          <a href="https://www.baidu.com" target="_blank">帮助</a>
          <a href="https://www.bing.com" target="_blank">隐私</a>
          <a href="https://www.baidu.com" target="_blank">条款</a>
        </div>
        <div class="copyright">
          Copyright &copy; <a href="https://www.baidu.com" target="_blank">哈尔滨师范大学人工智能大数据实验室</a> All
          right reserved
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import RouteView from '@/components/layouts/RouteView'
import { mixinDevice } from '@/utils/mixin.js'

export default {
  name: 'UserLayout',
  components: { RouteView },
  mixins: [mixinDevice],
  data() {
    return {}
  },
  mounted() {
    document.body.classList.add('userLayout')
  },
  beforeDestroy() {
    document.body.classList.remove('userLayout')
  }
}
</script>

<style lang="less" scoped>
#userLayout.user-layout-wrapper {
  height: 100%;

  .border {
    display: block;
    width: 50%;
    margin: 20px auto;
    padding: 25px;
    background: #ffffff;
    color: black;
    border-radius: 15px;
    border: 0;
  }

  .backImg {
    width: 100%;
    min-height: 100%;
    background: #f0f2f5 url(~@/assets/background.jpg) no-repeat 50%;
    background-size: 100%;
    padding: 110px 0 144px;
    position: absolute;
    background-size: cover;
    left: 0%;
  }

  &.mobile {
    .container {
      .main {
        max-width: 368px;
        width: 98%;
      }
    }
  }

  .container {
    width: 900px;
    background-size: cover;
    min-height: 100%;
    padding: 110px 0 144px;
    position: absolute;
    background-size: cover;
    right: 0%;

    a {
      text-decoration: none;
    }

    .top {
      text-align: center;

      .header {
        height: 44px;
        line-height: 44px;

        .badge {
          position: absolute;
          display: inline-block;
          line-height: 1;
          vertical-align: middle;
          margin-left: -12px;
          margin-top: -10px;
          opacity: 0.8;
        }

        .logo {
          height: 44px;
          vertical-align: top;
          margin-right: 16px;
          border-style: none;
        }

        .title {
          font-size: 33px;
          color: white;
          font-family: 'Chinese Quote', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
            'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
            'Segoe UI Symbol';
          font-weight: 600;
          position: relative;
          top: 2px;
        }
      }
      .desc {
        font-size: 30px;
        color: white;
        margin-top: 15px;
        margin-bottom: 40px;
      }
    }

    .main {
      min-width: 260px;
      width: 368px;
      margin: 0 auto;
    }

    .footer {
      position: absolute;
      width: 100%;
      bottom: 0;
      padding: 0 16px;
      margin: 48px 0 24px;
      text-align: center;

      .links {
        margin-bottom: 8px;
        font-size: 14px;
        a {
          color: white;
          transition: all 0.3s;
          &:not(:last-child) {
            margin-right: 40px;
          }
        }
      }
      .copyright {
        color: white;
        font-size: 14px;
      }
    }
  }
}
</style>
