<template>
  <div class="login-container flx-center">
    <div class="login-box">
      <SwitchDark class="dark" />
      <div class="login-left">
        <!-- <img class="login-left-img" src="@/assets/images/login_left5.png" alt="login" /> -->
        <!-- <img class="login-left-img" src="@/assets/images/loginbg1.png" alt="login" /> -->
      </div>
      <div class="login-form">
        <!-- <div class="tab-qrcode-account" @click="changeToLogin">
          <i class="iconfont" :class="isQrcode ? 'iconmonitor-01' : 'iconqr-code-02'"></i>
        </div> -->
        <div class="login-logo">
          <!-- <div class="login-icon">
            <img src="@/assets/images/logo.png" alt="" />
          </div> -->
          <h2 class="logo-text">
            <!-- 欢迎登录 -->
            <span class="company">{{ AppCompany }}</span>
            <span>
              {{ AppName }}
            </span>
          </h2>
        </div>
        <LoginForm v-if="!isQrcode" @goto-qrcode="changeToLogin" />
      </div>
    </div>
    <div class="version">V{{ Version }}</div>
  </div>
</template>

<script setup lang="ts" name="login">
import { ref, nextTick } from "vue";
import LoginForm from "./components/LoginForm.vue";
import SwitchDark from "@/components/SwitchDark/index.vue";

const Version = import.meta.env.VITE_APP_VERSION;
const AppName = import.meta.env.VITE_GLOB_APP_TITLE;
const AppCompany = import.meta.env.VITE_GLOB_APP_COMPANY;
const isQrcode = ref(false);

// const backToLogin = () => {
//   ifERPUser.value = false;
// };

const changeToLogin = () => {
  isQrcode.value = !isQrcode.value;
};
</script>

<style scoped lang="scss">
@import "./index.scss";
</style>
