feat(ui): redesign all admin console pages
- 新增 AdminLayout 侧边栏布局组件(深色#001529侧边栏+粉色#E6508C高亮)
- 登录页:深蓝渐变背景+🌸标识+粉色登录按钮
- 仪表盘:4个统计卡片+实时护理数据表+快捷操作
- 设备管理:搜索栏+设备列表表格+状态标签+分页
- 设备详情:返回链接+信息网格+护理记录表
- 用户管理:用户列表+头像+订阅状态标签+分页
- 用户详情:用户卡片+统计数据+基本信息+护理记录
- 订阅管理:统计行+标签页筛选+订阅列表表格
- 护理记录:日期范围+搜索+模式标签+记录表格
- 操作日志:时间线列表+彩色操作者+类型标签
- 系统设置:基础配置+订阅配置+功能开关+保存按钮
这个提交包含在:
@@ -0,0 +1,161 @@
|
||||
<template>
|
||||
<view class="admin-layout">
|
||||
<view class="sidebar">
|
||||
<view class="sidebar-logo">🌸 光子美容仪</view>
|
||||
<view class="sidebar-sub">管理后台</view>
|
||||
<view class="sidebar-menu">
|
||||
<view
|
||||
v-for="item in menuItems"
|
||||
:key="item.path"
|
||||
class="sidebar-item"
|
||||
:class="{ active: currentPage === item.path }"
|
||||
@click="navigate(item.path)"
|
||||
>
|
||||
<text class="sidebar-icon">{{ item.icon }}</text>
|
||||
<text>{{ item.label }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="main-content">
|
||||
<view class="top-header">
|
||||
<text class="header-title">{{ pageTitle }}</text>
|
||||
<view class="header-right">
|
||||
<text class="header-user">👤 管理员</text>
|
||||
<text class="header-logout" @click="onLogout">退出</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content-body">
|
||||
<slot></slot>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
currentPage: { type: String, default: '' }
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menuItems: [
|
||||
{ icon: '📊', label: '仪表盘', path: '/pages/dashboard/index' },
|
||||
{ icon: '📱', label: '设备管理', path: '/pages/device/index' },
|
||||
{ icon: '👥', label: '用户管理', path: '/pages/user/index' },
|
||||
{ icon: '💳', label: '订阅管理', path: '/pages/subscription/index' },
|
||||
{ icon: '📋', label: '护理记录', path: '/pages/record/index' },
|
||||
{ icon: '📝', label: '操作日志', path: '/pages/log/index' },
|
||||
{ icon: '⚙️', label: '系统设置', path: '/pages/settings/index' }
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
pageTitle() {
|
||||
const item = this.menuItems.find(m => m.path === this.currentPage)
|
||||
return item ? `${item.icon} ${item.label}` : '光子美容仪管理后台'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
navigate(path) {
|
||||
uni.redirectTo({ url: path })
|
||||
},
|
||||
onLogout() {
|
||||
const { useUserStore } = require('../store/user')
|
||||
const store = useUserStore()
|
||||
store.logout()
|
||||
uni.reLaunch({ url: '/pages/login/index' })
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.admin-layout {
|
||||
display: flex;
|
||||
min-height: 100vh;
|
||||
}
|
||||
.sidebar {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 220px;
|
||||
background: #001529;
|
||||
padding: 20px 0;
|
||||
z-index: 100;
|
||||
}
|
||||
.sidebar-logo {
|
||||
color: #fff;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
padding: 0 20px 6px;
|
||||
text-align: center;
|
||||
}
|
||||
.sidebar-sub {
|
||||
color: rgba(255,255,255,0.35);
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
padding-bottom: 20px;
|
||||
border-bottom: 1px solid rgba(255,255,255,0.1);
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.sidebar-menu {
|
||||
list-style: none;
|
||||
}
|
||||
.sidebar-item {
|
||||
padding: 12px 20px;
|
||||
color: rgba(255,255,255,0.65);
|
||||
font-size: 14px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.sidebar-item:hover {
|
||||
color: #fff;
|
||||
background: rgba(255,255,255,0.08);
|
||||
}
|
||||
.sidebar-item.active {
|
||||
color: #fff;
|
||||
background: #E6508C;
|
||||
}
|
||||
.sidebar-icon {
|
||||
font-size: 16px;
|
||||
}
|
||||
.main-content {
|
||||
margin-left: 220px;
|
||||
flex: 1;
|
||||
min-height: 100vh;
|
||||
background: #f0f2f5;
|
||||
}
|
||||
.top-header {
|
||||
background: #fff;
|
||||
padding: 16px 24px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
}
|
||||
.header-title {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
.header-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
}
|
||||
.header-user {
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
}
|
||||
.header-logout {
|
||||
color: #E6508C;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
}
|
||||
.content-body {
|
||||
padding: 20px;
|
||||
}
|
||||
</style>
|
||||
在新工单中引用
屏蔽一个用户