<template>
  <div class="login">
    <img
      alt=""
      class="welcome-text"
      src="@/assets/img/login/welcome-text.png"
    />
    <div class="login-box">
      <!-- <img v-if="activeName !== 'codeLogin'" class="login-change" src="@/assets/img/login/code-login.png"
     alt="" @click="activeName = 'codeLogin'">
<img v-else class="login-change" src="@/assets/img/login/password-login.png" alt=""
     @click="activeName = 'accountLogin'"> -->
      <!--   账号和手机号登录   -->
      <template v-if="activeName !== 'codeLogin'">
        <div class="login-box-header">
          <img alt="" src="@/assets/img/logo-lj-blue.png" />
          <span class="title">巡查救援</span>
        </div>
        <div class="login-box-content">
          <el-tabs v-model="activeName" @tab-click="handleClick">
            <el-tab-pane label="账号登录" name="accountLogin"
            >账号登录
            </el-tab-pane
            >
            <!-- <el-tab-pane label="短信登录" name="phoneNumberLogin"
                >短信登录</el-tab-pane
            > -->
          </el-tabs>
          <div class="tab-content">
            <!--    账号登录      -->
            <AccountLogin
              v-if="activeName === 'accountLogin'"
              :systemInformation="systemInformation"
            />
            <!--    短信登录      -->
            <!-- <PhoneNumberLogin
                v-if="activeName === 'phoneNumberLogin'"
            /> -->
            <!--    验证码登录      -->
          </div>
        </div>
        <div class="login-box-footer">
          <div class="footer-title">忘记密码请联系管理员</div>
        </div>
      </template>
      <!--   二维码登录   -->
      <template v-else>
        <CodeLogin />
      </template>
    </div>
  </div>
</template>

<script>
import AccountLogin from '@/views/Login/components/AccountLogin.vue'
import PhoneNumberLogin from '@/views/Login/components/PhoneNumberLogin.vue'
import CodeLogin from '@/views/Login/components/CodeLogin.vue'

export default {
  name: 'Login',
  props: ['tenant'],
  components: {CodeLogin, PhoneNumberLogin, AccountLogin},
  data() {
    return {
      activeName: 'accountLogin',
      systemInformation: '巡查救援'
    }
  },
  created() {
  },
  mounted() {
    let tenant = this.tenant ? this.tenant : 'platform'
    // let url = '${uc}/uc/tenantManage/v1/getTenantByCode?code=' + tenant
    // this.$http.get(url).then((resp) => {
    //     this.systemInformation = resp.data || {}
    // })
  },
  methods: {
    handleClick() {
    }
  }
}
</script>
<style lang="scss" scoped>

.login {
  width: 100%;
  height: 100%;
  background: url("~@/assets/img/login/bgImg.png") no-repeat 0 0;
  background-size: 100% 100%;
  //background-size: cover;
  position: relative;
  user-select: none;

  .welcome-text {
    position: absolute;
    left: 4%;
    top: 4.5%;
    width: 500px;
    user-select: none;
    -webkit-user-drag: none;
  }

  .login-box {
    width: 550px;
    //min-height: 500px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    right: 11%;
    top: 50%;
    transform: translateY(-50%);
    position: absolute;
    box-shadow: rgba(50, 50, 93, 0.25) 0 6px 12px -2px, rgba(0, 0, 0, 0.3) 0 3px 7px -3px;
    overflow: hidden;
    display: flex;
    flex-direction: column;

    .login-change {
      position: absolute;
      width: 70px;
      top: 5px;
      right: 5px;
      cursor: pointer;
    }

    .login-box-header {
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: PingFangSC-Medium;
      color: rgb(18, 100, 189);
      flex-direction: column;
      row-gap: 20px;
      padding: 100px 0 30px 0;

      .title {
        font-size: 30px;
        text-align: center;
        font-family: PingFang SC;
        font-weight: bold;
        color: #333;
      }

      img {
        width: 120px;
      }
    }

    .login-box-content {
      padding: 0 40px;
      display: flex;
      flex-direction: column;

      ::v-deep .el-tabs {
        height: auto;

        .el-tabs__header {
          margin-bottom: 30px;

          .el-tabs__nav-wrap {
            &::after {
              background-color: transparent;
            }
          }

          .el-tabs__active-bar {
            color: rgb(18, 100, 189);
            height: 2.5px;
          }

          .el-tabs__item {
            height: 45px;
            padding: 0 10px;
            font-size: 18px;
            transition: all 0.2s;

            &:nth-child(2) {
              padding-left: 0;
            }

            &:hover {
              color: rgb(18, 100, 189);
            }

            &.is-active {
              color: rgb(18, 100, 189);
            }
          }
        }

        .el-tabs__content {
          display: none;
        }
      }

      .tab-content {
        flex: 1;
      }
    }

    .login-box-footer {
      flex: 1;
      padding: 20px 0;

      .footer-title {
        text-align: center;
        font-family: PingFangSC-Medium;
        font-size: 15px;
        margin-bottom: 20px;
      }


    }
  }
}
</style>
