Files
medical-mall/docs/admin/ORDER_MENU_HIGHLIGHT_QUICK_FIX.md
2026-02-02 20:07:37 +08:00

78 lines
1.5 KiB
Markdown
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.
# 订单菜单高亮修复 - 快速参考
## 问题
订单菜单中,无论点击哪个子项,高亮都显示为"订单管理"
## 解决方案3处修改
### 1. `layouts/admin/utils/nav.uts` - normalize() 函数
**改动:** 保留query参数
```typescript
// OLD
return q >= 0 ? s.slice(0, q) : s;
// NEW
return s; // ✅ 保留 ?tab=xxx
```
---
### 2. `layouts/admin/utils/nav.uts` - getCurrentRoutePath() 函数
**改动:** 从URL获取query参数
```typescript
// H5 环境
const qs = typeof window !== "undefined" ? window.location.search : "";
return `/${last.route}${qs}`;
```
---
### 3. `pages/mall/admin/order-management.uvue` - onLoad()
**改动:** 根据tab参数设置currentPage
```typescript
const tab = options?.tab;
const tabToMenuIdMap = {
stats: "order-stats",
list: "order-list",
aftersale: "order-aftersale",
cashier: "order-cashier",
verify: "order-verify",
config: "order-config",
};
const menuId = tabToMenuIdMap[tab];
if (menuId) currentPage.value = menuId;
```
---
## 验证
- [ ] 订单统计 - 高亮正确
- [ ] 订单管理 - 高亮正确
- [ ] 售后订单 - 高亮正确
- [ ] 收银订单 - 高亮正确
- [ ] 核销记录 - 高亮正确
- [ ] 订单配置 - 高亮正确
---
## 相同问题的其他页面
营销管理页面使用相同结构,建议采用相同方案:
- `pages/mall/admin/marketing-management.uvue`
---
## 详细文档
📄 [完整修复文档](ORDER_MENU_HIGHLIGHT_FIX.md)
📋 [完成报告](ORDER_MENU_HIGHLIGHT_COMPLETION_REPORT.md)