|
|
@@ -5,25 +5,35 @@
|
|
|
<cwg-icon name="icon_my" color="#97A1C0" @click="openNotice" />
|
|
|
</view>
|
|
|
<template #btn>
|
|
|
- <view class="right-drawer">
|
|
|
- <view class="drawer-header">
|
|
|
- <image class="avatar" src="/static/images/avatars.png" mode="aspectFill" />
|
|
|
- <view class="user-info">
|
|
|
- <text class="name">{{ _displayName }}</text>
|
|
|
+ <view class="dropdown-menu dropdown-menu-end w-225px mt-1 show">
|
|
|
+ <view class="d-flex align-items-center p-2">
|
|
|
+ <view class="avatar avatar-sm rounded-circle">
|
|
|
+ <image class="avatar1" src="/static/images/vu/logo.png" mode="aspectFill" />
|
|
|
+ </view>
|
|
|
+ <view class="ms-2">
|
|
|
+ <view class="fw-bold text-dark text-ellipsis mb-2">{{ _displayName }}</view>
|
|
|
+ <view class="text-body d-block lh-sm text-ellipsis mb-2">{{ _email }}</view>
|
|
|
<text class="cid">CID: <text class="cwg-cursor" @click="copy(_displayCid)">{{ _displayCid
|
|
|
- }}</text></text>
|
|
|
+ }}</text></text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="menu-list">
|
|
|
- <view v-for="item in menuList" :key="item.id" class="menu-item"
|
|
|
- :class="{ active: _activePath === item.path }" @click="handleNavigate(item.path)">
|
|
|
- <cwg-icon :name="item.icon" :size="16" :color="isDark ? '#fff' : '#000'" />
|
|
|
+ <view>
|
|
|
+ <view class="dropdown-divider my-1"></view>
|
|
|
+ </view>
|
|
|
+ <view v-for="item in menuList" :key="item.id">
|
|
|
+ <view class="dropdown-item d-flex align-items-center gap-2 cursor-pointer"
|
|
|
+ @click="handleNavigate(item.path)">
|
|
|
+ <cwg-icon :name="item.icon" :size="16" color="#97A1C0" />
|
|
|
<text v-t="item.name"></text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="logout-wrap">
|
|
|
- <view class="logout-btn btn btn-danger" @click="handleLogout">
|
|
|
- <cwg-icon name="logout" :size="16" color="#fff" />
|
|
|
+ <view>
|
|
|
+ <view class="dropdown-divider my-1"></view>
|
|
|
+ </view>
|
|
|
+ <view>
|
|
|
+ <view class="dropdown-item d-flex align-items-center gap-2 text-danger cursor-pointer"
|
|
|
+ @click="handleLogout">
|
|
|
+ <cwg-icon name="logout" :size="16" color="#FF401C" />
|
|
|
<text v-t="'language.i6'"></text>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -56,6 +66,7 @@ const menuList = ref([])
|
|
|
const _displayName = ref('--')
|
|
|
const _displayCid = ref('--')
|
|
|
const _activePath = ref('')
|
|
|
+const _email = ref('--')
|
|
|
// 复制文本
|
|
|
const copy = (text: string) => {
|
|
|
uni.setClipboardData({
|
|
|
@@ -86,6 +97,7 @@ function syncUserInfo() {
|
|
|
const lastName = info.lastName || ''
|
|
|
_displayName.value = (firstName + ' ' + lastName).trim() || info.name || info.email || '--'
|
|
|
_displayCid.value = info.cId || info.id || '--'
|
|
|
+ _email.value = info.email || '--'
|
|
|
}
|
|
|
|
|
|
// 强制同步路径
|
|
|
@@ -136,7 +148,7 @@ async function handleLogout() {
|
|
|
await userApi.logout()
|
|
|
} catch (e) { }
|
|
|
userStore.clearUserInfo()
|
|
|
- uni.setStorageSync('logoutToSystem',1)
|
|
|
+ uni.setStorageSync('logoutToSystem', 1)
|
|
|
// uni.$emit('updateSystemList')
|
|
|
router.push('/pages/login/index')
|
|
|
close()
|
|
|
@@ -150,13 +162,18 @@ defineExpose({ openNotice, close })
|
|
|
|
|
|
.notice-container {
|
|
|
:deep(.cwg-dropdown-menu-container) {
|
|
|
- left: px2rpx(-280) !important;
|
|
|
+ left: px2rpx(-190) !important;
|
|
|
right: px2rpx(0) !important;
|
|
|
+
|
|
|
+ .menu {
|
|
|
+ border: 0;
|
|
|
+ overflow: visible;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@media screen and (max-width: 991px) {
|
|
|
:deep(.cwg-dropdown-menu-container) {
|
|
|
- left: px2rpx(-270) !important;
|
|
|
+ left: px2rpx(-190) !important;
|
|
|
max-width: px2rpx(400);
|
|
|
}
|
|
|
}
|
|
|
@@ -170,54 +187,54 @@ defineExpose({ openNotice, close })
|
|
|
background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
- padding: 20px 16px;
|
|
|
+ padding: px2rpx(20) px2rpx(16);
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
|
|
|
.drawer-header {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
- gap: 12px;
|
|
|
- padding: 20px 16px;
|
|
|
+ gap: px2rpx(12);
|
|
|
+ padding: px2rpx(20);
|
|
|
border-bottom: 1px solid #d9dde5;
|
|
|
}
|
|
|
|
|
|
- .avatar {
|
|
|
- width: 76px;
|
|
|
- height: 76px;
|
|
|
+ .avatar1 {
|
|
|
+ width: px2rpx(40);
|
|
|
+ height: px2rpx(40);
|
|
|
border-radius: 50%;
|
|
|
- background: #fff;
|
|
|
+ // background: #fff;
|
|
|
}
|
|
|
|
|
|
.user-info {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
- gap: 6px;
|
|
|
+ gap: px2rpx(6);
|
|
|
}
|
|
|
|
|
|
.name {
|
|
|
- font-size: 20px;
|
|
|
+ font-size: px2rpx(22);
|
|
|
font-weight: 600;
|
|
|
color: var(--bs-heading-color);
|
|
|
}
|
|
|
|
|
|
.cid {
|
|
|
- font-size: 14px;
|
|
|
+ font-size: px2rpx(14);
|
|
|
color: #ef4444;
|
|
|
}
|
|
|
|
|
|
.menu-list {
|
|
|
- padding: 12px 0;
|
|
|
+ padding: px2rpx(12) 0;
|
|
|
}
|
|
|
|
|
|
.menu-item {
|
|
|
- height: 48px;
|
|
|
+ height: px2rpx(48);
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
- gap: 10px;
|
|
|
- padding: 0 16px;
|
|
|
+ gap: px2rpx(10);
|
|
|
+ padding: 0 px2rpx(16);
|
|
|
color: var(--bs-heading-color);
|
|
|
- font-size: 16px;
|
|
|
+ font-size: px2rpx(16);
|
|
|
font-weight: 600;
|
|
|
|
|
|
&:hover {
|
|
|
@@ -232,20 +249,20 @@ defineExpose({ openNotice, close })
|
|
|
|
|
|
.logout-wrap {
|
|
|
margin-top: auto;
|
|
|
- padding: 20px 16px;
|
|
|
- margin-bottom: 20px;
|
|
|
+ padding: px2rpx(20);
|
|
|
+ margin-bottom: px2rpx(20);
|
|
|
}
|
|
|
|
|
|
.logout-btn {
|
|
|
- height: 44px;
|
|
|
+ height: px2rpx(44);
|
|
|
background-color: var(--bs-btn-bg);
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
- gap: 8px;
|
|
|
+ gap: px2rpx(8);
|
|
|
color: #fff;
|
|
|
font-weight: 600;
|
|
|
- font-size: 16px;
|
|
|
+ font-size: px2rpx(16);
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
}
|