Files
gao-customer-h5/src/pages/user/LoginIndex.vue
T
2026-10-22 17:35:22 +08:00

103 lines
2.1 KiB
Vue

<template>
<div class="login-page diselect">
<section class="login-panel">
<div class="brand">
<logo v-entrance-transition />
<h1 v-entrance-transition>糕店客户管理</h1>
</div>
<t-segmented
class="login-type"
v-model="loginType"
:options="loginTypeOptions"
v-entrance-transition
/>
<password-login v-if="loginType === 'password'" class="form card" :agreement-accepted="hasAgreed" />
<sms-login v-else class="form card" :agreement-accepted="hasAgreed" />
<user-agreement v-model="hasAgreed" />
</section>
</div>
</template>
<script setup lang="ts">
import PasswordLogin from "@/pages/user/component/PasswordLogin.vue";
import SmsLogin from "@/pages/user/component/SmsLogin.vue";
import Logo from "@/pages/user/component/Logo.vue";
import UserAgreement from "@/pages/user/component/UserAgreement.vue";
defineOptions({
name: "LoginIndex"
});
type LoginType = "password" | "sms";
const loginType = ref<LoginType>("password");
const hasAgreed = ref(false);
const loginTypeOptions = [
{ value: "password" as LoginType, label: "密码登录" },
{ value: "sms" as LoginType, label: "短信登录" }
];
</script>
<style scoped lang="less">
.login-page {
width: 100%;
padding: 4.5rem 1rem 1.5rem;
display: flex;
min-height: 100vh;
background: #F5F5F8;
align-items: flex-start;
justify-content: center;
.login-panel {
width: 100%;
padding: 1.5rem;
display: flex;
max-width: 28rem;
background: rgba(255, 255, 255, .94);
box-shadow: 0 .75rem 2rem rgba(15, 23, 42, .08);
border-radius: 1.4rem;
flex-direction: column;
.form {
margin: 0;
:deep(.t-form__label) {
width: 5.5rem;
}
}
.login-type {
width: fit-content;
margin: 1rem auto 0 auto;
}
}
.brand {
display: grid;
place-items: center;
h1 {
margin: .875rem 0 0;
color: #0f172a;
font-size: 1.5rem;
font-weight: 700;
}
}
}
:global(html.theme-dark) {
.login-page {
background: #10161f;
.login-panel {
background: rgba(15, 23, 42, .88);
box-shadow: 0 .75rem 2rem rgba(2, 6, 23, .32);
}
.brand h1 {
color: #e2e8f0;
}
}
}
</style>