完善页面

This commit is contained in:
2026-01-29 17:54:35 +08:00
parent 9f3c2803e3
commit fcc976680d
95 changed files with 4595 additions and 10542 deletions

View File

@@ -6,7 +6,7 @@ export const menuList: MenuItem[] = [
title: '首页',
icon: '/static/homepage.svg',
path: '/pages/mall/admin/homePage/index',
groups: [],
groups: []
},
{
id: 'user',
@@ -15,46 +15,217 @@ export const menuList: MenuItem[] = [
path: '/pages/mall/admin/user-management',
groups: [
{
id:'user-management',
id: 'user-management',
title: '用户管理',
children: [
{ id: 'user-list', title: '用户列表', path: '/pages/mall/admin/user-management' },
{ id: 'user-add', title: '添加用户', path: '/pages/mall/admin/user-management?action=add' },
{ id: 'user-statistics', title: '用户统计', path: '/pages/mall/admin/user-statistics' },
],
},
],
{
id: 'user-statistics',
title: '用户统计',
path: '/pages/mall/admin/user-statistics'
},
{
id: 'user-list',
title: '用户管理',
path: '/pages/mall/admin/user-management'
},
{
id: 'user-group',
title: '用户分组',
path: '/pages/mall/admin/user-management?action=group'
},
{
id: 'user-tag',
title: '用户标签',
path: '/pages/mall/admin/user-management?action=tag'
},
{
id: 'user-level',
title: '用户等级',
path: '/pages/mall/admin/user-management?action=level'
},
{
id: 'user-config',
title: '用户配置',
path: '/pages/mall/admin/user-management?action=config'
}
]
}
]
},
{
id: 'order',
title: '订单',
icon: '/static/order.svg',
path: '/pages/mall/admin/order-management',
path: '/pages/mall/admin/order-management?tab=list',
groups: [
{
id:'order-management',
id: 'order-management',
title: '订单管理',
children: [
{ id: 'order-list', title: '订单列表', path: '/pages/mall/admin/order-management' },
],
},
],
{
id: 'order-stats',
title: '订单统计',
path: '/pages/mall/admin/order-management?tab=stats'
},
{
id: 'order-list',
title: '订单管理',
path: '/pages/mall/admin/order-management?tab=list'
},
{
id: 'order-aftersale',
title: '售后订单',
path: '/pages/mall/admin/order-management?tab=aftersale'
},
{
id: 'order-cashier',
title: '收银订单',
path: '/pages/mall/admin/order-management?tab=cashier'
},
{
id: 'order-verify',
title: '核销记录',
path: '/pages/mall/admin/order-management?tab=verify'
},
{
id: 'order-config',
title: '订单配置',
path: '/pages/mall/admin/order-management?tab=config'
}
]
}
]
},
{
id: 'product',
title: '商品',
icon: '/static/shopping.svg',
icon: '/static/product.svg',
path: '/pages/mall/admin/product-management',
groups: [
{
id:'product-management',
id: 'product-management',
title: '商品管理',
children: [
{ id: 'product-list', title: '商品列表', path: '/pages/mall/admin/product-management' },
{ id: 'product-add', title: '添加商品', path: '/pages/mall/admin/product-management?action=add' },
],
},
],
{
id: 'product-list',
title: '商品管理',
path: '/pages/mall/admin/product-management'
},
{
id: 'product-statistics',
title: '商品统计',
path: '/pages/mall/admin/product-statistics'
},
{
id: 'product-classification',
title: '商品分类',
path: '/pages/mall/admin/product-classification'
},
{
id: 'product-specifications',
title: '商品规格',
path: '/pages/mall/admin/product-specifications'
},
{
id: 'product-parameters',
title: '商品参数',
path: '/pages/mall/admin/product-parameters'
},
{
id: 'product-labels',
title: '商品标签',
path: '/pages/mall/admin/product-labels'
},
{
id: 'product-protection',
title: '商品保障',
path: '/pages/mall/admin/product-protection'
},
{
id: 'product-reviews',
title: '商品评论',
path: '/pages/mall/admin/product-reviews'
}
]
}
]
},
{
id: 'design',
title: '设计',
icon: '/static/design.svg',
path: '/pages/mall/admin/design/index',
groups: [
{
id: 'design-management',
title: '设计',
children: [
{
id: 'design-home',
title: '页面装修',
path: '/pages/mall/admin/design/index'
}
]
}
]
},
{
id: 'content',
title: '文章',
icon: '/static/content.svg',
path: '/pages/mall/admin/content/index',
groups: [
{
id: 'content-management',
title: '文章',
children: [
{
id: 'content-list',
title: '文章管理',
path: '/pages/mall/admin/content/index'
}
]
}
]
},
{
id: 'customer-service',
title: '客服',
icon: '/static/customerService.svg',
path: '/pages/mall/admin/customer-service/index',
groups: [
{
id: 'customer-service',
title: '客服',
children: [
{
id: 'cs-list',
title: '客服列表',
path: '/pages/mall/admin/customer-service/list'
},
{
id: 'cs-script',
title: '客服话术',
path: '/pages/mall/admin/customer-service/script'
},
{
id: 'cs-message',
title: '用户留言',
path: '/pages/mall/admin/customer-service/messages'
},
{
id: 'cs-auto-reply',
title: '自动回复',
path: '/pages/mall/admin/customer-service/auto-reply'
},
{
id: 'cs-config',
title: '客服配置',
path: '/pages/mall/admin/customer-service/config'
}
]
}
]
},
{
id: 'marketing',
@@ -63,29 +234,206 @@ export const menuList: MenuItem[] = [
path: '/pages/mall/admin/marketing-management',
groups: [
{
id:'coupon',
id: 'coupon',
title: '优惠券活动',
children: [
{ id: 'coupon-list', title: '优惠券列表', path: '/pages/mall/admin/marketing/coupon/list' },
{ id: 'coupon-receive', title: '领取情况', path: '/pages/mall/admin/marketing/coupon/receive' },
],
{
id: 'coupon-list',
title: '优惠券列表',
path: '/pages/mall/admin/marketing/coupon/list'
},
{
id: 'coupon-receive',
title: '领取情况',
path: '/pages/mall/admin/marketing/coupon/receive'
}
]
},
{
id:'points',
title: '积分',
id: 'points',
title: '积分管理',
children: [
{ id: 'points-management', title: '积分管理', path: '/pages/mall/admin/marketing/points/index' },
],
{
id: 'points-stats',
title: '积分统计',
path: '/pages/mall/admin/marketing/points/index?tab=stats'
},
{
id: 'points-goods',
title: '积分商品',
path: '/pages/mall/admin/marketing/points/index?tab=goods'
},
{
id: 'points-order',
title: '积分订单',
path: '/pages/mall/admin/marketing/points/index?tab=order'
},
{
id: 'points-record',
title: '积分记录',
path: '/pages/mall/admin/marketing/points/index?tab=record'
},
{
id: 'points-config',
title: '积分配置',
path: '/pages/mall/admin/marketing/points/index?tab=config'
}
]
},
{
id:'signin',
title: '签到',
id: 'lottery',
title: '抽奖管理',
children: [
{ id: 'rule', title: '签到规则', path: '/pages/mall/admin/marketing/signin/rule' },
{ id: 'record', title: '记录', path: '/pages/mall/admin/marketing/signin/record' },
],
{
id: 'lottery-list',
title: '抽奖列表',
path: '/pages/mall/admin/marketing/points/index?tab=lottery-list'
},
{
id: 'lottery-config',
title: '抽奖配置',
path: '/pages/mall/admin/marketing/points/index?tab=lottery-config'
}
]
},
],
{
id: 'groupbuy',
title: '拼团管理',
children: [
{
id: 'groupbuy-goods',
title: '拼团商品',
path: '/pages/mall/admin/marketing/points/index?tab=groupbuy-goods'
},
{
id: 'groupbuy-list',
title: '拼团列表',
path: '/pages/mall/admin/marketing/points/index?tab=groupbuy-list'
}
]
},
{
id: 'seckill',
title: '秒杀管理',
children: [
{
id: 'seckill-goods',
title: '秒杀商品',
path: '/pages/mall/admin/marketing/points/index?tab=seckill-goods'
},
{
id: 'seckill-list',
title: '秒杀列表',
path: '/pages/mall/admin/marketing/points/index?tab=seckill-list'
},
{
id: 'seckill-config',
title: '秒杀配置',
path: '/pages/mall/admin/marketing/points/index?tab=seckill-config'
}
]
},
{
id: 'member',
title: '会员管理',
children: [
{
id: 'member-type',
title: '会员类型',
path: '/pages/mall/admin/marketing/points/index?tab=member-type'
},
{
id: 'member-rights',
title: '会员权益',
path: '/pages/mall/admin/marketing/points/index?tab=member-rights'
},
{
id: 'member-card',
title: '卡密会员',
path: '/pages/mall/admin/marketing/points/index?tab=member-card'
},
{
id: 'member-record',
title: '会员记录',
path: '/pages/mall/admin/marketing/points/index?tab=member-record'
},
{
id: 'member-config',
title: '会员配置',
path: '/pages/mall/admin/marketing/points/index?tab=member-config'
}
]
},
{
id: 'live',
title: '直播管理',
children: [
{
id: 'live-room',
title: '直播间管理',
path: '/pages/mall/admin/marketing/points/index?tab=live-room'
},
{
id: 'live-goods',
title: '直播商品管理',
path: '/pages/mall/admin/marketing/points/index?tab=live-goods'
},
{
id: 'live-anchor',
title: '主播管理',
path: '/pages/mall/admin/marketing/points/index?tab=live-anchor'
}
]
},
{
id: 'recharge',
title: '用户充值',
children: [
{
id: 'recharge-amount',
title: '金额设置',
path: '/pages/mall/admin/marketing/points/index?tab=recharge-amount'
},
{
id: 'recharge-config',
title: '充值配置',
path: '/pages/mall/admin/marketing/points/index?tab=recharge-config'
},
{
id: 'recharge-record',
title: '充值记录',
path: '/pages/mall/admin/marketing/points/index?tab=recharge-record'
}
]
},
{
id: 'signin',
title: '每日签到',
children: [
{
id: 'signin-rule',
title: '签到配置',
path: '/pages/mall/admin/marketing/signin/rule'
},
{
id: 'signin-record',
title: '签到奖励',
path: '/pages/mall/admin/marketing/signin/record'
}
]
},
{
id: 'newcomer',
title: '新人礼',
children: [
{
id: 'newcomer',
title: '新人礼',
path: '/pages/mall/admin/marketing/points/index?tab=newcomer'
}
]
}
]
},
{
id: 'system',
@@ -94,17 +442,296 @@ export const menuList: MenuItem[] = [
path: '/pages/mall/admin/system-settings',
groups: [
{
id:'system-settings',
id: 'sys-basic',
title: '系统设置',
children: [
{ id: 'basic', title: '基本设置', path: '/pages/mall/admin/system-settings' },
{ id: 'security', title: '安全设置', path: '/pages/mall/admin/system-settings?tab=security' },
{ id: 'email', title: '邮件设置', path: '/pages/mall/admin/system-settings?tab=security' },
{ id: 'payment', title: '支付设置', path: '/pages/mall/admin/system-settings?tab=security' },
{ id: 'other', title: '其他设置', path: '/pages/mall/admin/system-settings?tab=security' },
],
path: '/pages/mall/admin/system-settings',
children: []
},
],
{
id: 'sys-message',
title: '消息管理',
path: '/pages/mall/admin/system/message-management',
children: []
},
{
id: 'sys-agreement',
title: '协议设置',
path: '/pages/mall/admin/system/agreement-settings',
children: []
},
{
id: 'sys-receipt',
title: '小票配置',
path: '/pages/mall/admin/system/receipt-settings',
children: []
},
{
id: 'sys-permission',
title: '管理权限',
children: [
{
id: 'sys-role',
title: '角色管理',
path: '/pages/mall/admin/system/permission/role'
},
{
id: 'sys-admin',
title: '管理员列表',
path: '/pages/mall/admin/system/permission/admin-list'
},
{
id: 'sys-perm-setting',
title: '权限设置',
path: '/pages/mall/admin/system/permission/permission-setting'
}
]
},
{
id: 'sys-shipping',
title: '发货设置',
children: [
{
id: 'ship-courier',
title: '配送员管理',
path: '/pages/mall/admin/system/shipping/courier'
},
{
id: 'ship-pickup',
title: '提货点设置',
path: '/pages/mall/admin/system/shipping/pickup/points',
children: [
{
id: 'pickup-points',
title: '提货点',
path: '/pages/mall/admin/system/shipping/pickup/points'
},
{
id: 'pickup-verifier',
title: '核销员',
path: '/pages/mall/admin/system/shipping/pickup/verifiers'
}
]
},
{
id: 'ship-freight',
title: '运费模板',
path: '/pages/mall/admin/system/shipping/freight-template'
}
]
},
{
id: 'sys-api',
title: '接口配置',
children: [
{
id: 'api-yht',
title: '一号通',
path: '/pages/mall/admin/system/api/yht/page',
children: [
{
id: 'api-yht-page',
title: '一号通页面',
path: '/pages/mall/admin/system/api/yht/page'
},
{
id: 'api-yht-config',
title: '一号通配置',
path: '/pages/mall/admin/system/api/yht/config'
}
]
},
{
id: 'api-storage',
title: '系统存储配置',
path: '/pages/mall/admin/system/api/storage'
},
{
id: 'api-collect',
title: '商品采集配置',
path: '/pages/mall/admin/system/api/collect'
},
{
id: 'api-logistics',
title: '物流查询配置',
path: '/pages/mall/admin/system/api/logistics'
},
{
id: 'api-waybill',
title: '电子面单配置',
path: '/pages/mall/admin/system/api/waybill'
},
{
id: 'api-sms',
title: '短信接口配置',
path: '/pages/mall/admin/system/api/sms'
},
{
id: 'api-pay',
title: '商城支付配置',
path: '/pages/mall/admin/system/api/pay'
}
]
}
]
},
{
id: 'maintain',
title: '维护',
icon: '/static/maintain.svg',
path: '/pages/mall/admin/maintain/dev-config/category',
groups: [
{
id: 'dev-config',
title: '开发配置',
children: [
{
id: 'dev-config-category',
title: '配置分类',
path: '/pages/mall/admin/maintain/dev-config/category'
},
{
id: 'dev-config-combo',
title: '组合数据',
path: '/pages/mall/admin/maintain/dev-config/combination-data'
},
{
id: 'dev-config-cron',
title: '定时任务',
path: '/pages/mall/admin/maintain/dev-config/cron-job'
},
{
id: 'dev-config-permission',
title: '权限维护',
path: '/pages/mall/admin/maintain/dev-config/permission'
},
{
id: 'dev-config-module',
title: '模块配置',
path: '/pages/mall/admin/maintain/dev-config/module-config'
},
{
id: 'dev-config-event',
title: '自定事件',
path: '/pages/mall/admin/maintain/dev-config/custom-event'
}
]
},
{
id: 'security-maintain',
title: '安全维护',
children: [
{
id: 'security-refresh-cache',
title: '刷新缓存',
path: '/pages/mall/admin/maintain/security/refresh-cache'
},
{
id: 'security-system-log',
title: '系统日志',
path: '/pages/mall/admin/maintain/security/system-log'
},
{
id: 'security-online-upgrade',
title: '在线升级',
path: '/pages/mall/admin/maintain/security/online-upgrade'
}
]
},
{
id: 'data-maintain',
title: '数据维护',
children: [
{
id: 'data-logistics-company',
title: '物流公司',
path: '/pages/mall/admin/maintain/data/logistics-company'
},
{
id: 'data-city-data',
title: '城市数据',
path: '/pages/mall/admin/maintain/data/city-data'
},
{
id: 'data-clear-data',
title: '清除数据',
path: '/pages/mall/admin/maintain/data/clear-data'
}
]
},
{
id: 'external-api',
title: '对外接口',
children: [
{
id: 'external-account',
title: '账号管理',
path: '/pages/mall/admin/maintain/external/account'
}
]
},
{
id: 'i18n-setting',
title: '语言设置',
children: [
{
id: 'i18n-language-list',
title: '语言列表',
path: '/pages/mall/admin/maintain/i18n/language-list'
},
{
id: 'i18n-language-detail',
title: '语言详情',
path: '/pages/mall/admin/maintain/i18n/language-detail'
},
{
id: 'i18n-region-list',
title: '地区列表',
path: '/pages/mall/admin/maintain/i18n/region-list'
},
{
id: 'i18n-translate-config',
title: '翻译配置',
path: '/pages/mall/admin/maintain/i18n/translate-config'
}
]
},
{
id: 'dev-tools',
title: '开发工具',
children: [
{
id: 'dev-tools-db',
title: '数据库管理',
path: '/pages/mall/admin/maintain/dev-tools/database'
},
{
id: 'dev-tools-file',
title: '文件管理',
path: '/pages/mall/admin/maintain/dev-tools/file'
},
{
id: 'dev-tools-api',
title: '接口管理',
path: '/pages/mall/admin/maintain/dev-tools/api'
},
{
id: 'dev-tools-codegen',
title: '代码生成',
path: '/pages/mall/admin/maintain/dev-tools/codegen'
},
{
id: 'dev-tools-dict',
title: '数据字典',
path: '/pages/mall/admin/maintain/dev-tools/data-dict'
}
]
},
{
id: 'system-info',
title: '系统信息',
path: '/pages/mall/admin/maintain/system-info',
children: []
}
]
}
]

View File

@@ -1,24 +1,85 @@
import type { MenuItem } from '../types.uts'
// utils/nav.uts
import type { MenuItem, MenuGroup, MenuChild } from '../types.uts'
export function findActiveByCurrentPage(
menuList: MenuItem[],
currentPage: string
): { activeMenuId: string, activeSubId: string } {
const page = currentPage || ''
// 1) currentPage 直接是一级 menu id
const mById = menuList.find(m => m.id === page)
if (mById) {
const leaf = firstLeafOfMenu(mById)
return { activeMenuId: mById.id, activeSubId: leaf?.id ?? '' }
}
// 2) currentPage 是 path/pages/xxx 或 pages/xxx
const pageNorm = normalize(page)
export function findActiveByCurrentPage(menuList: MenuItem[], currentPage: string) {
// currentPage 既可能是顶级菜单 id也可能是子页面 id如 user-list
// 返回activeMenuId / activeSubId / activeGroupTitle
for (const m of menuList) {
if (m.id === currentPage) {
return { activeMenuId: m.id, activeSubId: '', activeGroupTitle: '' }
}
const groups = m.groups || []
const groups = m.groups ?? []
// group / child / 四级 全部扫描
for (const g of groups) {
for (const c of g.children) {
if (c.id === currentPage) {
return { activeMenuId: m.id, activeSubId: c.id, activeGroupTitle: g.title }
}
// group 叶子(可选)
if (g.path && normalize(g.path) === pageNorm) {
return { activeMenuId: m.id, activeSubId: '' }
}
const cs = g.children ?? []
for (const c of cs) {
// 用 id 命中
if (c.id === page) return { activeMenuId: m.id, activeSubId: c.id }
// 用 path 命中
if (c.path && normalize(c.path) === pageNorm) return { activeMenuId: m.id, activeSubId: c.id }
// 四级
const ds = c.children ?? []
const hit = findInChildren(ds, page, pageNorm)
if (hit) return { activeMenuId: m.id, activeSubId: hit.id }
}
}
}
return { activeMenuId: menuList[0]?.id || 'home', activeSubId: '', activeGroupTitle: '' }
// 3) 找不到:兜底 home
return { activeMenuId: 'home', activeSubId: '' }
}
function findInChildren(list: MenuChild[], targetId: string, targetPathNorm: string): MenuChild | null {
for (const n of list) {
if (n.id === targetId) return n
if (n.path && normalize(n.path) === targetPathNorm) return n
const deep = n.children ?? []
if (deep.length > 0) {
const hit = findInChildren(deep, targetId, targetPathNorm)
if (hit) return hit
}
}
return null
}
function normalize(p: string): string {
if (!p) return ''
const s = p.startsWith('/') ? p.slice(1) : p
const q = s.indexOf('?')
return q >= 0 ? s.slice(0, q) : s
}
// 你可以把 index.uvue 里的 firstLeafOfMenu 移到这里复用(保持逻辑一致)
function firstLeafOfMenu(m: MenuItem): MenuChild | null {
const gs = m.groups ?? []
if (gs.length === 0) return null
const g0 = gs[0]
const cs = g0.children ?? []
if (cs.length === 0) return null
let n = cs[0]
while (n.children && n.children.length > 0) n = n.children[0]
return n
}
export function getCurrentRoutePath(): string {
// 使用页面栈获取当前路由uni-app标准能力
// getCurrentPages 用于获取当前页面栈实例 :contentReference[oaicite:2]{index=2}