重构登录界面布局样式
This commit is contained in:
@@ -19,7 +19,7 @@ export const useThemeConfig = defineStore('themeConfig', {
|
|||||||
* 全局主题
|
* 全局主题
|
||||||
*/
|
*/
|
||||||
// 默认 primary 主题颜色
|
// 默认 primary 主题颜色
|
||||||
primary: '#FF2442',
|
primary: '#409eff',
|
||||||
// 是否开启深色模式
|
// 是否开启深色模式
|
||||||
isIsDark: false,
|
isIsDark: false,
|
||||||
|
|
||||||
@@ -32,21 +32,21 @@ export const useThemeConfig = defineStore('themeConfig', {
|
|||||||
// 默认顶栏导航背景颜色
|
// 默认顶栏导航背景颜色
|
||||||
topBar: '#ffffff',
|
topBar: '#ffffff',
|
||||||
// 默认顶栏导航字体颜色
|
// 默认顶栏导航字体颜色
|
||||||
topBarColor: '#1A1A1A',
|
topBarColor: '#606266',
|
||||||
// 是否开启顶栏背景颜色渐变
|
// 是否开启顶栏背景颜色渐变
|
||||||
isTopBarColorGradual: true,
|
isTopBarColorGradual: false,
|
||||||
// 默认菜单导航背景颜色
|
// 默认菜单导航背景颜色
|
||||||
menuBar: '#F0F8FF',
|
menuBar: '#354E67',
|
||||||
// 默认菜单导航字体颜色
|
// 默认菜单导航字体颜色
|
||||||
menuBarColor: '#2D3748',
|
menuBarColor: '#eaeaea',
|
||||||
// 是否开启菜单背景颜色渐变
|
// 是否开启菜单背景颜色渐变
|
||||||
isMenuBarColorGradual: true,
|
isMenuBarColorGradual: false,
|
||||||
// 默认分栏菜单背景颜色
|
// 默认分栏菜单背景颜色
|
||||||
columnsMenuBar: '#F8FAFF',
|
columnsMenuBar: '#545c64',
|
||||||
// 默认分栏菜单字体颜色
|
// 默认分栏菜单字体颜色
|
||||||
columnsMenuBarColor: '#4A5568',
|
columnsMenuBarColor: '#e6e6e6',
|
||||||
// 是否开启分栏菜单背景颜色渐变
|
// 是否开启分栏菜单背景颜色渐变
|
||||||
isColumnsMenuBarColorGradual: true,
|
isColumnsMenuBarColorGradual: false,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 界面设置
|
* 界面设置
|
||||||
|
|||||||
0
src/theme/mixins/button-text.scss
Normal file
0
src/theme/mixins/button-text.scss
Normal file
@@ -1,41 +1,53 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="login-container">
|
<div class="login-container">
|
||||||
<div class="login-content-out">
|
<div class="login-wrapper">
|
||||||
<div class="login-content">
|
<!-- 左侧品牌区域 -->
|
||||||
<div class="login-content-main">
|
<div class="login-brand-section">
|
||||||
<div class="login-icon-group">
|
<div class="brand-content">
|
||||||
<div class="login-icon-group-title">
|
<div class="brand-logo">
|
||||||
<img :src="logoMini" />
|
<img :src="logoMini" alt="logo" />
|
||||||
<div class="login-icon-group-title-text font25">{{ getThemeConfig.globalViceTitle }}</div>
|
</div>
|
||||||
</div>
|
<h1 class="brand-title">{{ getThemeConfig.globalTitle }}</h1>
|
||||||
</div>
|
<p class="brand-subtitle">{{ getThemeConfig.globalViceTitle }}</p>
|
||||||
<div v-if="!isScan">
|
<div class="brand-decoration"></div>
|
||||||
<el-tabs v-model="tabsActiveName">
|
</div>
|
||||||
<el-tab-pane :label="$t('message.label.one1')" name="account">
|
</div>
|
||||||
<Account />
|
|
||||||
</el-tab-pane>
|
<!-- 右侧表单区域 -->
|
||||||
<el-tab-pane :label="$t('message.label.two2')" name="mobile">
|
<div class="login-form-section">
|
||||||
<Mobile />
|
<div class="form-wrapper">
|
||||||
</el-tab-pane>
|
<div class="form-header">
|
||||||
</el-tabs>
|
<h2>欢迎登录</h2>
|
||||||
</div>
|
<p>请输入您的账户信息</p>
|
||||||
<Scan v-if="isScan" />
|
</div>
|
||||||
<div class="login-content-main-sacn" @click="isScan = !isScan">
|
|
||||||
<i class="iconfont" :class="isScan ? 'icon-diannao1' : 'icon-barcode-qr'"></i>
|
<div v-if="!isScan" class="form-content">
|
||||||
<div class="login-content-main-sacn-delta"></div>
|
<el-tabs v-model="tabsActiveName" class="login-tabs">
|
||||||
</div>
|
<el-tab-pane :label="$t('message.label.one1')" name="account">
|
||||||
</div>
|
<Account />
|
||||||
</div>
|
</el-tab-pane>
|
||||||
</div>
|
<el-tab-pane :label="$t('message.label.two2')" name="mobile">
|
||||||
<div class="login-footer">
|
<Mobile />
|
||||||
<div class="login-footer-content mt15">
|
</el-tab-pane>
|
||||||
<div class="login-footer-content-warp">
|
</el-tabs>
|
||||||
<div>红动未来</div>
|
</div>
|
||||||
<div class="mt5"></div>
|
|
||||||
</div>
|
<div v-if="isScan" class="form-content">
|
||||||
</div>
|
<Scan />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
<div class="scan-toggle" @click="isScan = !isScan" :title="isScan ? '切换为账户登录' : '切换为扫码登录'">
|
||||||
|
<i class="iconfont" :class="isScan ? 'icon-diannao1' : 'icon-barcode-qr'"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 页脚 -->
|
||||||
|
<div class="login-footer">
|
||||||
|
<p>© 2024 红动未来服务商平台</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@@ -51,170 +63,315 @@ import Scan from '/@/views/login/component/scan.vue';
|
|||||||
|
|
||||||
// 定义接口来定义对象的类型
|
// 定义接口来定义对象的类型
|
||||||
interface LoginState {
|
interface LoginState {
|
||||||
tabsActiveName: string;
|
tabsActiveName: string;
|
||||||
isScan: boolean;
|
isScan: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'loginIndex',
|
name: 'loginIndex',
|
||||||
components: { Account, Mobile, Scan },
|
components: { Account, Mobile, Scan },
|
||||||
setup() {
|
setup() {
|
||||||
const storesThemeConfig = useThemeConfig();
|
const storesThemeConfig = useThemeConfig();
|
||||||
const { themeConfig } = storeToRefs(storesThemeConfig);
|
const { themeConfig } = storeToRefs(storesThemeConfig);
|
||||||
const state = reactive<LoginState>({
|
const state = reactive<LoginState>({
|
||||||
tabsActiveName: 'account',
|
tabsActiveName: 'account',
|
||||||
isScan: false,
|
isScan: false,
|
||||||
});
|
});
|
||||||
// 获取布局配置信息
|
// 获取布局配置信息
|
||||||
const getThemeConfig = computed(() => {
|
const getThemeConfig = computed(() => {
|
||||||
return themeConfig.value;
|
return themeConfig.value;
|
||||||
});
|
});
|
||||||
// 页面加载时
|
// 页面加载时
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
NextLoading.done();
|
NextLoading.done();
|
||||||
});
|
});
|
||||||
return {
|
return {
|
||||||
logoMini,
|
logoMini,
|
||||||
loginIconTwo,
|
loginIconTwo,
|
||||||
getThemeConfig,
|
getThemeConfig,
|
||||||
...toRefs(state),
|
...toRefs(state),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.login-container {
|
.login-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
position: relative;
|
position: relative;
|
||||||
background-image: url("/@/assets/bg.jpg");
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
|
background-attachment: fixed;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
.login-icon-group {
|
.login-wrapper {
|
||||||
width: 100%;
|
flex: 1;
|
||||||
height: 100%;
|
display: flex;
|
||||||
position: relative;
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 40px 20px;
|
||||||
|
}
|
||||||
|
|
||||||
.login-icon-group-title {
|
/* 左侧品牌区域 */
|
||||||
display: flex;
|
.login-brand-section {
|
||||||
align-items: center;
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding-right: 60px;
|
||||||
|
|
||||||
img {
|
.brand-content {
|
||||||
width: 80px;
|
color: white;
|
||||||
height: 70px;
|
text-align: left;
|
||||||
}
|
|
||||||
|
|
||||||
&-text {
|
.brand-logo {
|
||||||
padding-left: 5px;
|
margin-bottom: 40px;
|
||||||
color: var(--el-color-primary);
|
animation: slideInLeft 0.8s ease;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&-icon {
|
img {
|
||||||
width: 60%;
|
width: 100px;
|
||||||
height: 70%;
|
height: 90px;
|
||||||
position: absolute;
|
filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
|
||||||
left: 0;
|
}
|
||||||
bottom: 0;
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-content-out {
|
.brand-title {
|
||||||
width: 100%;
|
font-size: 42px;
|
||||||
height: 100%;
|
font-weight: 700;
|
||||||
display: flex;
|
margin: 0 0 20px 0;
|
||||||
flex-direction: column;
|
letter-spacing: 1px;
|
||||||
justify-content: center;
|
animation: slideInLeft 0.8s ease 0.2s both;
|
||||||
align-items: center;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.login-content {
|
.brand-subtitle {
|
||||||
width: 500px;
|
font-size: 18px;
|
||||||
padding: 20px;
|
opacity: 0.9;
|
||||||
margin: auto;
|
margin: 0;
|
||||||
background-color: var(--el-color-white);
|
animation: slideInLeft 0.8s ease 0.4s both;
|
||||||
border: 5px solid var(--el-color-primary-light-8);
|
font-weight: 300;
|
||||||
border-radius: 5px;
|
}
|
||||||
overflow: hidden;
|
|
||||||
z-index: 1;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.login-content-main {
|
.brand-decoration {
|
||||||
margin: 0 auto;
|
width: 60px;
|
||||||
width: 80%;
|
height: 4px;
|
||||||
|
background: rgba(255, 255, 255, 0.5);
|
||||||
|
margin-top: 30px;
|
||||||
|
border-radius: 2px;
|
||||||
|
animation: slideInLeft 0.8s ease 0.6s both;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.login-content-title {
|
/* 右侧表单区域 */
|
||||||
color: var(--el-text-color-primary);
|
.login-form-section {
|
||||||
font-weight: 500;
|
flex: 1;
|
||||||
font-size: 22px;
|
display: flex;
|
||||||
text-align: center;
|
align-items: center;
|
||||||
letter-spacing: 4px;
|
justify-content: center;
|
||||||
margin: 15px 0 30px;
|
padding-left: 60px;
|
||||||
white-space: nowrap;
|
|
||||||
z-index: 5;
|
|
||||||
position: relative;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-content-main-sacn {
|
.form-wrapper {
|
||||||
position: absolute;
|
width: 100%;
|
||||||
top: 0;
|
max-width: 420px;
|
||||||
right: 0;
|
background: white;
|
||||||
width: 50px;
|
border-radius: 12px;
|
||||||
height: 50px;
|
padding: 50px 40px;
|
||||||
overflow: hidden;
|
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
|
||||||
cursor: pointer;
|
position: relative;
|
||||||
transition: all ease 0.3s;
|
animation: slideInRight 0.8s ease;
|
||||||
color: var(--el-text-color-primary);
|
|
||||||
|
|
||||||
&-delta {
|
.form-header {
|
||||||
position: absolute;
|
margin-bottom: 40px;
|
||||||
width: 35px;
|
text-align: center;
|
||||||
height: 70px;
|
|
||||||
z-index: 2;
|
|
||||||
top: 2px;
|
|
||||||
right: 21px;
|
|
||||||
background: var(--el-color-white);
|
|
||||||
transform: rotate(-45deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
h2 {
|
||||||
opacity: 1;
|
font-size: 28px;
|
||||||
transition: all ease 0.3s;
|
color: #303133;
|
||||||
color: var(--el-color-primary) !important;
|
margin: 0 0 10px 0;
|
||||||
}
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
i {
|
p {
|
||||||
width: 47px;
|
font-size: 14px;
|
||||||
height: 50px;
|
color: #909399;
|
||||||
display: inline-block;
|
margin: 0;
|
||||||
font-size: 48px;
|
}
|
||||||
position: absolute;
|
}
|
||||||
right: 2px;
|
|
||||||
top: -1px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-footer {
|
.form-content {
|
||||||
position: absolute;
|
margin-bottom: 20px;
|
||||||
bottom: 5px;
|
}
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
&-content {
|
.login-tabs {
|
||||||
width: 100%;
|
:deep(.el-tabs__header) {
|
||||||
display: flex;
|
margin-bottom: 30px;
|
||||||
|
border-bottom: none;
|
||||||
|
|
||||||
&-warp {
|
.el-tabs__nav {
|
||||||
margin: auto;
|
width: 100%;
|
||||||
color: #e0e3e9;
|
display: flex;
|
||||||
text-align: center;
|
justify-content: space-around;
|
||||||
animation: error-num 1s ease-in-out;
|
|
||||||
}
|
.el-tabs__item {
|
||||||
}
|
flex: 1;
|
||||||
}
|
text-align: center;
|
||||||
|
font-weight: 500;
|
||||||
|
padding: 0;
|
||||||
|
color: #909399;
|
||||||
|
border-bottom: 2px solid transparent;
|
||||||
|
transition: all 0.3s;
|
||||||
|
|
||||||
|
&.is-active {
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
border-bottom-color: var(--el-color-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.scan-toggle {
|
||||||
|
position: absolute;
|
||||||
|
top: 15px;
|
||||||
|
right: 15px;
|
||||||
|
width: 44px;
|
||||||
|
height: 44px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #f5f7fa;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
color: #909399;
|
||||||
|
font-size: 20px;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: var(--el-color-primary-light-9);
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
transform: scale(1.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 页脚 */
|
||||||
|
.login-footer {
|
||||||
|
text-align: center;
|
||||||
|
padding: 20px;
|
||||||
|
color: rgba(255, 255, 255, 0.6);
|
||||||
|
font-size: 12px;
|
||||||
|
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 响应式设计 */
|
||||||
|
@media (max-width: 1200px) {
|
||||||
|
.login-container {
|
||||||
|
.login-brand-section {
|
||||||
|
padding-right: 40px;
|
||||||
|
|
||||||
|
.brand-content {
|
||||||
|
.brand-title {
|
||||||
|
font-size: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.brand-subtitle {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-form-section {
|
||||||
|
padding-left: 40px;
|
||||||
|
|
||||||
|
.form-wrapper {
|
||||||
|
max-width: 380px;
|
||||||
|
padding: 40px 30px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.login-container {
|
||||||
|
.login-wrapper {
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-brand-section {
|
||||||
|
padding-right: 0;
|
||||||
|
padding-bottom: 30px;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
.brand-content {
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
.brand-logo {
|
||||||
|
img {
|
||||||
|
width: 80px;
|
||||||
|
height: 70px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.brand-title {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.brand-subtitle {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.brand-decoration {
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-form-section {
|
||||||
|
padding-left: 0;
|
||||||
|
|
||||||
|
.form-wrapper {
|
||||||
|
max-width: 100%;
|
||||||
|
padding: 30px 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 动画定义 */
|
||||||
|
@keyframes slideInLeft {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateX(-30px);
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateX(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes slideInRight {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateX(30px);
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateX(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user