Files
JayuCloud/YumiNail-Frontend/src/views/admin/AdminLayout.vue
T

1065 lines
29 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div
class="admin-layout"
:class="{
'admin-layout--mobile': isMobile,
'admin-layout--collapsed': collapsed && !isMobile
}"
>
<template v-if="!isMobile">
<a-layout>
<a-layout-sider
v-model:collapsed="collapsed"
:trigger="null"
collapsible
class="sider"
:width="240"
:collapsed-width="80"
>
<div class="logo">
<h1 v-if="!collapsed">YumiNail 管理台</h1>
<h1 v-else>YN</h1>
</div>
<a-menu
:selectedKeys="selectedKeys"
mode="inline"
theme="dark"
@click="handleMenuClick"
>
<a-menu-item
v-for="item in filteredMenuItems"
:key="item.key"
>
<template #icon>
<component :is="item.icon" />
</template>
<span>{{ item.label }}</span>
</a-menu-item>
</a-menu>
</a-layout-sider>
<a-layout>
<a-layout-header class="header">
<div class="header-shell">
<div class="header-left">
<MenuUnfoldOutlined v-if="collapsed" class="trigger" @click="toggleCollapsed" />
<MenuFoldOutlined v-else class="trigger" @click="toggleCollapsed" />
<div v-if="isBootstrapAdmin" class="shop-hint">
<span>平台总览模式:用户、店铺、权限、消息、公告和参数可管理,其它店铺业务仅查看</span>
<a-button type="link" @click="router.push('/admin/shops')">店铺管理</a-button>
</div>
<div v-else-if="shopOptions.length > 1" class="shop-switcher">
<span class="shop-switcher-label">当前门店</span>
<a-select
v-model:value="selectedShopId"
class="shop-select"
:options="shopSelectOptions"
:loading="shopSwitchLoading"
@change="handleShopChange"
/>
</div>
<div v-else class="shop-pill">
<ShopOutlined />
<span>{{ currentShopName }}</span>
</div>
</div>
<div class="header-right">
<a-dropdown>
<a class="user-dropdown" @click.prevent>
<a-avatar :size="32" :src="userInfo?.avatar || DEFAULT_AVATAR" />
<span class="username">{{ userInfo?.nickname || '管理员' }}</span>
<DownOutlined />
</a>
<template #overlay>
<a-menu>
<a-menu-item key="home" @click="router.push('/admin')">
<template #icon>
<UserOutlined />
</template>
工作台
</a-menu-item>
<a-menu-item key="profile" @click="router.push('/admin/profile')">
<template #icon>
<IdcardOutlined />
</template>
我的
</a-menu-item>
<a-menu-divider />
<a-menu-item key="logout" @click="handleLogout">
<template #icon>
<LogoutOutlined />
</template>
退出登录
</a-menu-item>
</a-menu>
</template>
</a-dropdown>
</div>
</div>
</a-layout-header>
<a-layout-content class="content">
<div class="content-shell">
<router-view />
</div>
</a-layout-content>
</a-layout>
</a-layout>
</template>
<template v-else>
<div class="mobile-shell">
<header class="mobile-topbar">
<button class="mobile-icon-btn" type="button" @click="mobileDrawerOpen = true">
<MenuOutlined />
</button>
<div class="mobile-title-block">
<span class="mobile-eyebrow">{{ currentMobileSectionLabel }}</span>
<strong class="mobile-title">{{ currentMobileTitle }}</strong>
</div>
<button class="mobile-avatar-btn" type="button" @click="router.push('/admin/profile')">
<a-avatar :size="34" :src="userInfo?.avatar || DEFAULT_AVATAR" />
</button>
</header>
<section class="mobile-context">
<div class="mobile-context__primary">{{ currentShopName }}</div>
<div class="mobile-context__secondary">{{ roleLabel }}</div>
</section>
<main class="mobile-content">
<router-view />
</main>
<nav class="mobile-tabbar">
<button
v-for="tab in mobileTabs"
:key="tab.key"
class="mobile-tabbar__item"
:class="{ 'is-active': activeMobileTab === tab.key }"
type="button"
@click="handleMobileTabClick(tab.path)"
>
<component :is="tab.icon" />
<span>{{ tab.label }}</span>
</button>
</nav>
<a-drawer
v-model:open="mobileDrawerOpen"
placement="left"
:width="320"
class="mobile-drawer"
:closable="false"
root-class-name="admin-mobile-drawer"
>
<div class="drawer-account">
<a-avatar :size="46" :src="userInfo?.avatar || DEFAULT_AVATAR" />
<div class="drawer-account__body">
<div class="drawer-account__title">{{ userInfo?.nickname || userInfo?.account || '后台账号' }}</div>
<div class="drawer-account__meta">{{ roleLabel }}</div>
</div>
</div>
<div class="drawer-shop-card">
<span class="drawer-shop-card__label">当前门店</span>
<strong class="drawer-shop-card__value">{{ currentShopName }}</strong>
<p class="drawer-shop-card__desc">{{ shopScopeText }}</p>
<a-button type="default" block @click="openProfileFromDrawer">
{{ shopOptions.length > 1 ? '切换门店' : '查看账号信息' }}
</a-button>
</div>
<div class="drawer-section">
<div class="drawer-section__title">二级模块</div>
<button
v-for="item in filteredMenuItems"
:key="item.key"
class="drawer-link"
type="button"
@click="openPathFromDrawer(item.key)"
>
<div class="drawer-link__icon">
<component :is="item.icon" />
</div>
<div class="drawer-link__body">
<div class="drawer-link__title">{{ item.label }}</div>
</div>
<RightOutlined class="drawer-link__arrow" />
</button>
</div>
<div class="drawer-section">
<div class="drawer-section__title">会话操作</div>
<a-space direction="vertical" style="width: 100%">
<a-button block @click="openPathFromDrawer('/admin/profile')">打开我的</a-button>
<a-button block danger @click="handleLogout">退出当前账号</a-button>
</a-space>
</div>
</a-drawer>
</div>
</template>
</div>
</template>
<script setup lang="ts">
/**
* AdminLayout page script.
* Call guide: the template binds the reactive state below, and the methods are triggered by button clicks, lifecycle hooks, or router events.
*/
import { computed, onMounted, ref, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import {
DashboardOutlined,
DownOutlined,
GiftOutlined,
HomeOutlined,
IdcardOutlined,
LogoutOutlined,
MessageOutlined,
MenuFoldOutlined,
MenuOutlined,
MenuUnfoldOutlined,
RightOutlined,
SafetyCertificateOutlined,
ShopOutlined,
ShoppingOutlined,
TagOutlined,
TeamOutlined,
UserOutlined
} from '@ant-design/icons-vue'
import { message, Modal } from 'ant-design-vue'
import { adminAuthApi, type UserVO } from '@/api/admin'
import { DEFAULT_AVATAR } from '@/constants'
import { usePermission } from '@/utils/permission'
import { isAllowedForShoplessPlatformAdmin } from '@/utils/platform-admin-permissions'
import { runWithGlobalLoading } from '@/utils/action-loading'
import { useAdminViewport } from '@/composables/useAdminViewport'
import {
getAdminCurrentShopName,
getAdminRoleLabel,
getAdminShopOptions,
isBootstrapAdminUser
} from './admin-helpers'
type AdminMenuItem = {
key: string
icon: any
label: string
permissionCode: string
}
const router = useRouter()
const route = useRoute()
const { isMobile } = useAdminViewport()
/** collapsed is a reactive state variable used by the template and event handlers. */
const collapsed = ref(false)
/** mobileDrawerOpen is a reactive state variable used by the template and event handlers. */
const mobileDrawerOpen = ref(false)
const userInfo = ref<UserVO | null>(null)
const selectedKeys = ref<string[]>([route.path])
const selectedShopId = ref<string>()
/** shopSwitchLoading is a reactive state variable used by the template and event handlers. */
const shopSwitchLoading = ref(false)
const { loadUserPermissions, hasPermission, clearPermissions, userPermissions } = usePermission()
const menuItems: AdminMenuItem[] = [
{ key: '/admin', icon: HomeOutlined, label: '首页', permissionCode: '' },
{ key: '/admin/dashboard', icon: DashboardOutlined, label: '仪表盘', permissionCode: 'dashboard:view' },
{ key: '/admin/users', icon: UserOutlined, label: '用户管理', permissionCode: 'user:view' },
{ key: '/admin/products', icon: ShopOutlined, label: '作品管理', permissionCode: 'product:view' },
{ key: '/admin/coupons', icon: GiftOutlined, label: '优惠券管理', permissionCode: 'coupon:view' },
{ key: '/admin/comments', icon: MessageOutlined, label: '评论管理', permissionCode: 'comment:view' },
{ key: '/admin/shops', icon: HomeOutlined, label: '店铺管理', permissionCode: 'shop:view' },
{ key: '/admin/permissions', icon: SafetyCertificateOutlined, label: '权限管理', permissionCode: 'permission:view' },
{ key: '/admin/tags', icon: TagOutlined, label: '标签管理', permissionCode: 'tag:view' },
{ key: '/admin/orders', icon: ShoppingOutlined, label: '订单管理', permissionCode: 'order:view' },
{ key: '/admin/nail-artists', icon: TeamOutlined, label: '美甲师管理', permissionCode: 'nail_artist:view' }
,
{ key: '/admin/messages', icon: MessageOutlined, label: '消息发布', permissionCode: 'message:view' },
{ key: '/admin/announcements', icon: MessageOutlined, label: '公告管理', permissionCode: 'announcement:view' },
{ key: '/admin/vip-recharge-plans', icon: GiftOutlined, label: 'VIP充值配置', permissionCode: 'user:vip:manage' },
{ key: '/admin/messagehub-push-configs', icon: MessageOutlined, label: '参数管理', permissionCode: 'messagehub:config:manage' },
{ key: '/admin/legal-agreements', icon: SafetyCertificateOutlined, label: '协议管理', permissionCode: 'legal_agreement:manage' }
]
const mobileTabs = [
{ key: 'workbench', label: '工作台', path: '/admin', icon: HomeOutlined },
{ key: 'orders', label: '订单', path: '/admin/orders', icon: ShoppingOutlined },
{ key: 'manage', label: '经营', path: '/admin/manage', icon: DashboardOutlined },
{ key: 'profile', label: '我的', path: '/admin/profile', icon: UserOutlined }
]
/** isBootstrapAdmin is a reactive state variable used by the template and event handlers. */
const isBootstrapAdmin = computed(() => isBootstrapAdminUser(userInfo.value))
/** isShopAuthorizationExpired is a reactive state variable used by the template and event handlers. */
const isShopAuthorizationExpired = computed(() => Boolean(userInfo.value?.shopAuthorizationExpired))
/** shopOptions is a reactive state variable used by the template and event handlers. */
const shopOptions = computed(() => getAdminShopOptions(userInfo.value))
/** shopSelectOptions is a reactive state variable used by the template and event handlers. */
const shopSelectOptions = computed(() => {
const options = shopOptions.value.map(shop => ({ label: shop.name, value: shop.id }))
return options
})
/** currentShopName is a reactive state variable used by the template and event handlers. */
const currentShopName = computed(() => getAdminCurrentShopName(userInfo.value))
/** roleLabel is a reactive state variable used by the template and event handlers. */
const roleLabel = computed(() => getAdminRoleLabel(userInfo.value?.type))
/** shopScopeText is a reactive state variable used by the template and event handlers. */
const shopScopeText = computed(() => {
if (!shopOptions.value.length) {
return isBootstrapAdmin.value ? '平台总览模式' : '游客模式'
}
return `可登录门店:${shopOptions.value.map(shop => shop.name).join(' / ')}`
})
/** filteredMenuItems is a reactive state variable used by the template and event handlers. */
const filteredMenuItems = computed(() => {
userPermissions.value
let visibleItems = menuItems.filter(item => {
if (!item.permissionCode) {
return true
}
if (isBootstrapAdmin.value) {
return isAllowedForShoplessPlatformAdmin(item.permissionCode)
}
return hasPermission(item.permissionCode)
})
if (isShopAuthorizationExpired.value && userInfo.value?.type !== 4) {
visibleItems = visibleItems.filter(item => item.key === '/admin')
}
return visibleItems
})
/** activeMobileTab is a reactive state variable used by the template and event handlers. */
const activeMobileTab = computed(() => {
if (route.path === '/admin' || route.path === '/admin/dashboard') {
return 'workbench'
}
if (route.path.startsWith('/admin/orders')) {
return 'orders'
}
if (
route.path === '/admin/manage' ||
route.path.startsWith('/admin/users') ||
route.path.startsWith('/admin/products') ||
route.path.startsWith('/admin/coupons') ||
route.path.startsWith('/admin/comments') ||
route.path.startsWith('/admin/shops') ||
route.path.startsWith('/admin/permissions') ||
route.path.startsWith('/admin/tags') ||
route.path.startsWith('/admin/nail-artists')
) {
return 'manage'
}
if (route.path.startsWith('/admin/profile')) {
return 'profile'
}
return 'workbench'
})
/** currentMobileSectionLabel is a reactive state variable used by the template and event handlers. */
const currentMobileSectionLabel = computed(() => {
switch (activeMobileTab.value) {
case 'orders':
return '订单'
case 'manage':
return '经营'
case 'profile':
return '我的'
default:
return '工作台'
}
})
/** currentMobileTitle is a reactive state variable used by the template and event handlers. */
const currentMobileTitle = computed(() => {
const currentMenu = menuItems.find(item => item.key === route.path)
if (currentMenu) {
return currentMenu.label
}
if (route.path === '/admin/manage') {
return '经营模块'
}
if (route.path === '/admin/profile') {
return '账号与门店'
}
return '后台管理'
})
/** persistAdminSession is a local helper used by this page script. */
const persistAdminSession = (payload: any) => {
localStorage.setItem('adminAccessToken', payload.accessToken)
localStorage.setItem('adminRefreshToken', payload.refreshToken)
localStorage.setItem('adminUserInfo', JSON.stringify(payload.userInfo))
sessionStorage.setItem('adminAccessToken', payload.accessToken)
}
/** toggleCollapsed is a local helper used by this page script. */
const toggleCollapsed = () => {
collapsed.value = !collapsed.value
}
/** handleMenuClick is a local helper used by this page script. */
const handleMenuClick = (info: any) => {
if (isShopAuthorizationExpired.value && userInfo.value?.type !== 4 && info.key !== '/admin') {
message.warning('授权已到期,请联系管理员')
return
}
router.push(info.key)
}
/** openPathFromDrawer is a local helper used by this page script. */
const openPathFromDrawer = (path: string) => {
if (isShopAuthorizationExpired.value && userInfo.value?.type !== 4 && path !== '/admin' && path !== '/admin/profile') {
message.warning('授权已到期,请联系管理员')
return
}
mobileDrawerOpen.value = false
router.push(path)
}
/** openProfileFromDrawer is a local helper used by this page script. */
const openProfileFromDrawer = () => {
openPathFromDrawer('/admin/profile')
}
/** handleMobileTabClick is a local helper used by this page script. */
const handleMobileTabClick = (path: string) => {
if (isShopAuthorizationExpired.value && userInfo.value?.type !== 4 && path !== '/admin' && path !== '/admin/profile') {
message.warning('授权已到期,请联系管理员')
return
}
if (route.path !== path) {
router.push(path)
}
}
/** handleLogout is a local helper used by this page script. */
const handleLogout = () => {
Modal.confirm({
title: '确认退出登录',
content: '退出后需要重新登录后台。',
okText: '确认',
cancelText: '取消',
onOk: async () => {
await runWithGlobalLoading(async () => {
try {
await adminAuthApi.logout()
} catch (error) {
console.error('退出失败:', error)
} finally {
localStorage.removeItem('adminAccessToken')
localStorage.removeItem('adminRefreshToken')
localStorage.removeItem('adminUserInfo')
localStorage.removeItem('accessToken')
localStorage.removeItem('refreshToken')
localStorage.removeItem('userInfo')
sessionStorage.removeItem('adminAccessToken')
sessionStorage.removeItem('accessToken')
clearPermissions()
message.success('已退出登录')
window.location.href = '/admin/login'
}
})
}
})
}
/** fetchUserInfo is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
const fetchUserInfo = async () => {
try {
const cache = localStorage.getItem('adminUserInfo')
if (cache) {
userInfo.value = JSON.parse(cache)
}
if (!userInfo.value) {
return
}
selectedShopId.value = userInfo.value.shopId ? String(userInfo.value.shopId) : undefined
} catch (error) {
console.error('获取后台用户信息失败:', error)
}
}
/** handleShopChange is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
const handleShopChange = async (shopId: unknown) => {
if (typeof shopId !== 'string' && typeof shopId !== 'number') {
return
}
const normalizedShopId = String(shopId)
if (!normalizedShopId || normalizedShopId === String(userInfo.value?.shopId || '')) {
return
}
shopSwitchLoading.value = true
try {
await runWithGlobalLoading(async () => {
const response = await adminAuthApi.switchShop(normalizedShopId)
persistAdminSession(response as any)
await fetchUserInfo()
await loadUserPermissions()
})
message.success('门店上下文已切换')
window.location.reload()
} catch (error: any) {
console.error('切换门店失败:', error)
selectedShopId.value = userInfo.value?.shopId ? String(userInfo.value.shopId) : undefined
message.error(error?.message || '切换门店失败')
} finally {
shopSwitchLoading.value = false
}
}
watch(
() => route.path,
newPath => {
selectedKeys.value = menuItems.some(item => item.key === newPath) ? [newPath] : []
mobileDrawerOpen.value = false
},
{ immediate: true }
)
onMounted(async () => {
await fetchUserInfo()
if (isBootstrapAdmin.value) {
clearPermissions()
}
await loadUserPermissions()
})
</script>
<style scoped>
.admin-layout {
min-height: 100vh;
--admin-sider-width: 240px;
}
.admin-layout--collapsed {
--admin-sider-width: 80px;
}
.sider {
background:
linear-gradient(
180deg,
var(--admin-mobile-shell-start) 0%,
var(--admin-mobile-shell-mid) 48%,
var(--admin-mobile-shell-end) 100%
);
overflow: auto;
height: 100vh;
position: fixed;
left: 0;
top: 0;
bottom: 0;
z-index: 1000;
transition: width 0.2s ease;
}
.logo {
height: 64px;
display: flex;
align-items: center;
justify-content: center;
background: rgba(255, 248, 240, 0.14);
}
.logo h1 {
margin: 0;
color: white;
font-size: 18px;
font-weight: 700;
white-space: nowrap;
}
.header {
position: sticky;
top: 0;
z-index: 100;
margin-left: var(--admin-sider-width);
height: auto;
min-height: 64px;
padding: 0 24px;
background: rgba(255, 249, 242, 0.96);
box-shadow: 0 10px 24px rgba(145, 102, 82, 0.08);
backdrop-filter: blur(14px);
line-height: normal;
transition: margin-left 0.2s ease;
}
.header-shell {
width: 100%;
max-width: var(--admin-content-max-width);
margin: 0 auto;
min-height: 64px;
display: flex;
justify-content: space-between;
align-items: center;
gap: 16px;
}
.header-left {
display: flex;
align-items: center;
gap: 16px;
flex: 1 1 auto;
min-width: 0;
}
.trigger {
flex: 0 0 auto;
font-size: 18px;
cursor: pointer;
color: var(--admin-mobile-ink);
}
.shop-hint,
.shop-switcher,
.shop-pill {
display: inline-flex;
align-items: center;
gap: 10px;
min-height: 40px;
padding: 0 14px;
border-radius: 999px;
background: var(--admin-mobile-surface-alt);
color: var(--admin-mobile-ink);
min-width: 0;
max-width: 100%;
}
.shop-hint {
flex-wrap: wrap;
border-radius: 14px;
line-height: 1.4;
}
.shop-switcher-label {
font-size: 13px;
color: var(--admin-mobile-muted);
}
.shop-select {
min-width: 180px;
width: min(260px, 28vw);
}
.shop-pill {
flex: 0 1 auto;
font-weight: 600;
line-height: 1.2;
}
.shop-pill :deep(.anticon) {
flex: 0 0 auto;
}
.shop-pill span {
display: inline-block;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.header-right {
display: flex;
align-items: center;
flex: 0 0 auto;
min-width: 0;
}
@media (max-width: 560px) {
.header {
padding: 0 10px;
}
.header-shell {
gap: 10px;
min-height: 58px;
}
.header-left {
flex: 1 1 0;
gap: 10px;
overflow: hidden;
}
.header-right {
flex: 0 0 auto;
margin-left: auto;
}
.shop-pill {
flex: 1 1 0;
max-width: none;
min-height: 36px;
padding: 0 12px;
gap: 8px;
overflow: hidden;
}
.shop-pill span {
max-width: 100%;
}
}
@media (max-width: 420px) {
.header-shell {
gap: 8px;
}
.header-left {
gap: 8px;
}
}
.user-dropdown {
display: flex;
align-items: center;
gap: 12px;
min-height: 48px;
padding: 8px 12px;
border-radius: 10px;
line-height: 1.2;
transition: background 0.2s ease;
}
.user-dropdown:hover {
background: rgba(204, 123, 95, 0.1);
}
.username {
color: var(--admin-mobile-ink);
max-width: 120px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.content {
margin-left: var(--admin-sider-width);
min-height: calc(100vh - 64px);
padding: 24px;
background:
linear-gradient(180deg, #fbf6f0 0%, #f4e8dc 100%);
transition: margin-left 0.2s;
}
.content-shell {
width: 100%;
max-width: var(--admin-content-max-width);
margin: 0 auto;
}
@media (max-width: 960px) {
.admin-layout,
.admin-layout--collapsed {
--admin-sider-width: 0px;
}
.sider {
display: none;
}
.header,
.content {
margin-left: 0;
}
}
.mobile-shell {
min-height: 100vh;
background:
linear-gradient(180deg, var(--admin-mobile-shell-mid) 0 132px, var(--admin-mobile-surface) 132px 100%);
}
.mobile-topbar {
position: sticky;
top: 0;
z-index: 120;
display: flex;
align-items: center;
gap: 12px;
padding: calc(14px + env(safe-area-inset-top)) 16px 10px;
background: var(--admin-mobile-shell-glass);
backdrop-filter: blur(16px);
}
.mobile-icon-btn,
.mobile-avatar-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
padding: 0;
border: 0;
border-radius: 14px;
background: var(--admin-mobile-shell-soft);
color: #fff8f1;
}
.mobile-title-block {
flex: 1;
min-width: 0;
display: grid;
gap: 4px;
}
.mobile-eyebrow {
font-size: 11px;
letter-spacing: 0.14em;
text-transform: uppercase;
color: rgba(247, 242, 235, 0.68);
}
.mobile-title {
color: #f7f2eb;
font-size: 18px;
line-height: 1.2;
}
.mobile-context {
padding: 0 16px 16px;
color: #fff8f1;
}
.mobile-context__primary {
font-size: 20px;
font-weight: 700;
line-height: 1.2;
}
.mobile-context__secondary {
margin-top: 4px;
color: rgba(255, 248, 241, 0.74);
font-size: 13px;
}
.mobile-content {
padding: 16px 16px calc(96px + env(safe-area-inset-bottom));
}
.mobile-tabbar {
position: fixed;
left: 12px;
right: 12px;
bottom: 12px;
z-index: 130;
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 8px;
padding: 10px;
background: rgba(150, 103, 82, 0.92);
border: 1px solid rgba(255, 248, 241, 0.16);
border-radius: 24px;
box-shadow: 0 16px 40px rgba(146, 103, 82, 0.24);
backdrop-filter: blur(18px);
}
.mobile-tabbar__item {
display: grid;
justify-items: center;
gap: 6px;
padding: 10px 4px;
border: 0;
border-radius: 18px;
background: transparent;
color: rgba(255, 248, 241, 0.68);
font-size: 12px;
}
.mobile-tabbar__item.is-active {
background: rgba(255, 248, 241, 0.16);
color: #fff7ef;
}
.mobile-tabbar__item :deep(.anticon) {
font-size: 18px;
}
.drawer-account {
display: flex;
align-items: center;
gap: 14px;
padding: 18px;
border-radius: 24px;
color: #fff8f1;
background:
radial-gradient(circle at top right, rgba(255, 244, 232, 0.2), transparent 42%),
radial-gradient(circle at left top, rgba(232, 195, 169, 0.22), transparent 44%),
linear-gradient(
160deg,
var(--admin-mobile-shell-start) 0%,
var(--admin-mobile-shell-mid) 58%,
var(--admin-mobile-shell-end) 100%
);
}
.drawer-account__body {
flex: 1;
min-width: 0;
}
.drawer-account__title {
font-size: 18px;
font-weight: 700;
}
.drawer-account__meta {
margin-top: 4px;
font-size: 13px;
color: rgba(255, 248, 241, 0.8);
}
.drawer-shop-card {
margin-top: 18px;
padding: 18px;
border-radius: 22px;
background: var(--admin-mobile-card);
border: 1px solid var(--admin-mobile-border);
box-shadow: 0 12px 24px rgba(144, 103, 84, 0.08);
}
.drawer-shop-card__label {
font-size: 12px;
color: var(--admin-mobile-muted);
}
.drawer-shop-card__value {
display: block;
margin-top: 6px;
color: var(--admin-mobile-ink);
font-size: 18px;
}
.drawer-shop-card__desc {
margin: 8px 0 14px;
color: var(--admin-mobile-muted);
line-height: 1.6;
}
.drawer-section {
margin-top: 20px;
}
.drawer-section__title {
margin-bottom: 12px;
font-size: 13px;
font-weight: 700;
color: #6f594e;
}
.drawer-link {
width: 100%;
display: flex;
align-items: center;
gap: 12px;
padding: 14px 0;
border: 0;
border-bottom: 1px solid var(--admin-mobile-border);
background: transparent;
text-align: left;
}
.drawer-link:last-child {
border-bottom: 0;
}
.drawer-link__icon {
display: inline-flex;
align-items: center;
justify-content: center;
width: 42px;
height: 42px;
border-radius: 14px;
background: var(--admin-mobile-accent-soft);
color: #9e5a44;
}
.drawer-link__body {
flex: 1;
min-width: 0;
}
.drawer-link__title {
font-size: 15px;
font-weight: 600;
color: var(--admin-mobile-ink);
}
.drawer-link__meta {
margin-top: 4px;
color: var(--admin-mobile-muted);
font-size: 12px;
line-height: 1.5;
}
.drawer-link__arrow {
color: #b39384;
}
.mobile-drawer :deep(.ant-drawer-body) {
padding: calc(18px + env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom));
background: var(--admin-mobile-surface);
}
.sider :deep(.ant-menu),
.sider :deep(.ant-menu-dark) {
background: transparent;
}
.sider :deep(.ant-menu-item) {
width: calc(100% - 24px);
margin: 6px 12px;
border-radius: 16px;
}
.sider :deep(.ant-menu-dark .ant-menu-item),
.sider :deep(.ant-menu-dark .ant-menu-submenu-title) {
color: rgba(255, 248, 241, 0.8);
}
.sider :deep(.ant-menu-dark .ant-menu-item:hover),
.sider :deep(.ant-menu-dark .ant-menu-submenu-title:hover) {
color: #fff8f1;
background: rgba(255, 248, 241, 0.12);
}
.sider :deep(.ant-menu-dark .ant-menu-item-selected) {
color: #fff8f1;
background: rgba(255, 248, 241, 0.18);
}
.admin-layout :deep(.ant-btn-primary) {
border-color: transparent;
background: linear-gradient(135deg, var(--admin-mobile-accent) 0%, var(--admin-mobile-accent-strong) 100%);
box-shadow: 0 10px 20px rgba(185, 100, 73, 0.18);
}
.admin-layout :deep(.ant-btn-primary:hover),
.admin-layout :deep(.ant-btn-primary:focus) {
border-color: transparent;
background: linear-gradient(135deg, #d4866c 0%, #c26e52 100%);
}
.admin-layout :deep(.ant-select:not(.ant-select-disabled):hover .ant-select-selector),
.admin-layout :deep(.ant-input:hover),
.admin-layout :deep(.ant-input-affix-wrapper:hover) {
border-color: rgba(204, 123, 95, 0.45);
}
.admin-layout :deep(.ant-select-focused .ant-select-selector),
.admin-layout :deep(.ant-input:focus),
.admin-layout :deep(.ant-input-affix-wrapper-focused) {
border-color: rgba(204, 123, 95, 0.6);
box-shadow: 0 0 0 2px rgba(204, 123, 95, 0.12);
}
</style>