<script setup lang="ts">
import { APP_WEB_CONFIG_KEY } from '@af-mobile-client-vue3/stores/mutation-type'
import { createStorage } from '@af-mobile-client-vue3/utils/Storage'

const Storage = createStorage({ storage: localStorage })
const webConfig = Storage.get(APP_WEB_CONFIG_KEY)

//  动态获取图片
function getAssetsImages(logo) {
  return new URL(`/src/assets/img/user/login/${logo}`, import.meta.url).href
}
</script>

<template>
  <div class="login_title">
    <div class="login_logo">
      <img :src="getAssetsImages(webConfig?.setting?.systemLogo ?? 'logo.png')" alt="logo">
    </div>
    <div class="title_content">
      <div class="login_title_value">
        {{ webConfig?.setting?.systemName ?? '智慧燃气' }}
      </div>
      <div class="login_description">
        欢迎使用
      </div>
    </div>
  </div>
</template>

<style scoped lang="less">
html:not(.dark) {
  .login_title {
    background-image: url('@af-mobile-client-vue3/assets/img/user/login/background-shadow-1.svg');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
  }
  .title_content {
    color: rgb(83, 88, 110);
    .login_description {
      color: var(--van-text-color-3);
    }
  }
}
.login_title {
  width: 100%;
  text-align: center;
  .login_logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    margin: 0 auto 62px auto;
    border-radius: 23.04px;
    box-shadow: 0 16px 32px 0 rgba(0, 0, 0, 0.09);
    background: var(--van-background-2);
    text-align: center;
    img {
      width: 82px;
      height: 82px;
    }
  }
  .title_content {
    font-size: 26px;
    font-weight: 600;
    line-height: 26px;
    .login_description {
      margin-top: 13px;
      font-size: 16px;
      font-weight: 400;
      line-height: 16px;
    }
  }
}
</style>
