<template>
  <div class="p-con">
    <div class="header">
      <div class="logo"></div>
    </div>
    <s-language></s-language>
    <div class="main">
      <div class="bg"></div>
      <forget-login>
        <div class="go-back" slot="go-back">
          <template v-if="query.rd">
            <router-link class="router-link-class" active-class="router-link-active-class" :to="{ path: '/login/index?rd=' + query.rd }">返回登录</router-link>
          </template>
          <template v-else>
            <router-link class="router-link-class" active-class="router-link-active-class" :to="{ name: 'login-normal' }">返回登录</router-link>
          </template>
        </div>
      </forget-login>
    </div>
  </div>
</template>

<script>
import sLanguage from '@/components/languageSwitch/index.vue'

export default {
  components: { sLanguage },
  props: {
    params: { type: Object, required: false, default () { return {} } },
    query: { type: Object, required: false, default () { return {} } }
  },
  data () {
    return {}
  },
  metaInfo () {
    return {
      title: this.$t('Login.title'),
      meta: []
    }
  },
  mounted () {},
  methods: {
    dialogMsg () {
      this.$message({
        type: 'success',
        message: this.$t('Login.findPwdStr')
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.p-con { position: relative; width: 100%; height: 100%; background: #fff; }
/* 头部 */
.header { width: 1000px; padding: 15px 0; margin: 0 auto; }
.logo { height: 40px; background: url('~@/assets/images/logo.png') no-repeat; background-size: contain; }
/* 底部 */

/* 中间部分 */
.main { position: relative; }
.main .bg { height: 360px; background: url('~@/assets/images/bg.png') no-repeat center bottom; background-size: cover; }
.main .content { max-width: 700px; min-width: 320px; position: relative; margin: -200px auto 0; }
.p-con .router-link-class { color: #999; text-decoration: none; }

.p-con .main .content .login { background-color: #fff; box-sizing: border-box; }
.p-con .main .content .text { margin-top: -16px; color: #999; font-size: 16px; line-height: 1.5; overflow: hidden; }
.p-con .main .content .text .code-login { float: left; cursor: pointer; }
.p-con .main .content .text .forget-pwd { float: right; cursor: pointer; }

.go-back { margin-top: 0.2rem; text-align: left; }

/* pc */
@media (min-width: 700px) {
  .main .logo {
    display: none;
  }
  .main .content {
    display: flex;
    box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.3);
  }
  .main .title {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 260px;
    text-align: center;
    background-color: #bb133e;
    color: #fff;
  }
  .main .title .icon {
    background: url('~@/assets/images/icon_video.png') no-repeat;
    background-size: contain;
    width: 40px;
    height: 40px;
    margin-bottom: 20px;
  }
  .main .title p {
    font-size: 20px;
    line-height: 28px;
    color: #fff;
    margin: 0;
  }
  .main .login {
    flex: 1;
    min-height: 300px;
    padding: 50px 80px 0;
  }
}

/* mobile */
@media (max-width: 699px) {
  .header {
    display: none;
  }
  .main .bg {
    height: 215px;
    background: url('~@/assets/images/bg-mobile.png') no-repeat center bottom;
    background-size: auto 100%;
  }
  .main .logo {
    height: 30px;
    margin-bottom: 15px;
  }
  .main .content {
    margin: -180px 20px 0;
  }
  .main .title {
    display: flex;
    justify-content: center;
    padding: 10px;
    box-sizing: border-box;
  }
  .main .title p {
    font-size: 20px;
    line-height: 28px;
    color: #fff;
    margin: 0;
  }
  .main .login {
    padding: 15px 20px;
    box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.3);
  }
}
</style>
