设置页面

This commit is contained in:
2026-02-23 14:45:35 +08:00
parent 1e21e3b408
commit e6cba6f031
20 changed files with 530 additions and 63 deletions

View File

@@ -12,13 +12,38 @@
<span class="link"></span>
<span class="icon" @click="onShop"><svg-icon name="shop" size="21" /></span>
</div>
<img class="pic" src="@/assets/images/pic.jpg" />
<el-popover
placement="bottom-end"
popper-style="width:auto; min-width: 22rem; padding: 0.8rem; border-radius: 1.4rem;"
>
<template #reference>
<img class="pic" src="@/assets/images/pic.jpg" />
</template>
<div class="menu-box">
<div>
<span class="label">{{ email }}</span>
</div>
<p></p>
<div class="btn" @click="onSetting">
<span class="icon"><svg-icon name="setting" size="18" /></span>
<span class="label">Settings</span>
</div>
<div class="btn" @click="onLogout">
<span class="icon"><svg-icon name="logout" size="18" /></span>
<span class="label">Log out</span>
</div>
</div>
</el-popover>
</div>
</template>
<script setup lang="ts">
import MyEvent from '@/utils/myEvent'
import { computed, ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { useUserInfoStore } from '@/stores'
const userInfoStore = useUserInfoStore()
const email = computed(() => userInfoStore.state.userInfo.email || '------')
const route = useRoute()
const topNavStyle = computed(() => route.meta.topNavStyle)
const router = useRouter()
@@ -37,6 +62,12 @@
loading.value = false
}, 1500)
}
const onSetting = () => {
MyEvent.emit('openSettingDialog')
}
const onLogout = () => {
userInfoStore.logOut()
}
</script>
<style lang="less" scoped>
@@ -68,7 +99,7 @@
height: 4.3rem;
margin-right: 1rem;
background-color: rgba(255, 252, 244, 1);
border: 1px solid #FFCF90;
border: 1px solid #ffcf90;
border-radius: 0.8rem;
> .credits {
flex: 1;
@@ -78,7 +109,7 @@
> .link {
height: 100%;
width: 0;
border-right: 1px solid #FFCF90;
border-right: 1px solid #ffcf90;
}
> .icon {
cursor: pointer;
@@ -88,10 +119,46 @@
animation: loading 0.6s linear infinite;
}
}
> .pic {
.pic {
width: 4.65rem;
height: 4.65rem;
border-radius: 50%;
}
}
.menu-box {
user-select: none;
> * {
margin-bottom: 0.4rem;
&:last-child {
margin-bottom: 0;
}
}
> div {
height: 3.7rem;
display: flex;
align-items: center;
// justify-content: center;
&.btn {
cursor: pointer;
}
&.btn:hover {
background-color: rgba(0, 0, 0, 0.06);
}
> .label {
font-size: 1.4rem;
color: #000;
margin-left: 0.8rem;
}
> .icon {
margin-left: 1rem;
--svg-icon-color: #000;
}
}
> p {
width: 100%;
height: 0;
border-bottom: 0.1rem solid #e5e5e5;
}
}
</style>