diff --git a/00_READ_ME_FIRST.md b/00_READ_ME_FIRST.md deleted file mode 100644 index 274bf7ba..00000000 --- a/00_READ_ME_FIRST.md +++ /dev/null @@ -1,480 +0,0 @@ -# 🎯 检查完成 - 文件清单 - -## ✅ 任务已完成 - -我已为你生成了 **8 份完整的文档**,包含所有检查结果、分析和修改方案。 - ---- - -## 📄 生成的文档清单 - -### 📍 主入口(从这里开始) - -#### 1. **ADMIN_PAGE_START_HERE.md** ⭐⭐⭐ - -最终交付清单和快速开始指南。 - -- 适合:所有人 -- 内容:任务完成总结、快速导航、时间估计 -- 阅读时间:5-10 分钟 - -### 📚 核心文档(按推荐阅读顺序) - -#### 2. **ADMIN_PAGE_INDEX.md** ⭐⭐⭐ - -文档导航索引和快速开始指南。 - -- 适合:需要指引的人 -- 内容:文档导航、快速开始、按角色导航 -- 阅读时间:5-10 分钟 - -#### 3. **ADMIN_PAGE_SUMMARY.md** ⭐⭐⭐ - -执行总结报告(最重要的文档)。 - -- 适合:项目经理、开发主管 -- 内容:检查结果、关键发现、优先级建议、修改建议 -- 阅读时间:10-15 分钟 - -#### 4. **ADMIN_PAGE_QUICK_REFERENCE.md** ⭐⭐⭐ - -快速参考表和查询工具。 - -- 适合:需要快速查找的开发人员 -- 内容:所有文件的状态概览、按问题类型分类、快速查询 -- 阅读时间:按需查询(5 分钟/文件) - -#### 5. **ADMIN_PAGE_COMPLIANCE_CHECKLIST.md** ⭐⭐⭐ - -完整的路由清单和合规性检查结果。 - -- 适合:需要完整列表的人 -- 内容:所有 76 条路由的详细清单、按模块分组、统计汇总 -- 阅读时间:15-20 分钟 - -#### 6. **ADMIN_PAGE_MODIFICATION_PLAN.md** ⭐⭐⭐ - -详细的修改计划和执行方案。 - -- 适合:负责修改的开发人员 -- 内容:6 种修改方案(附代码)、所有文件的修改说明、时间估计 -- 阅读时间:20-30 分钟(查询用) - -### 📊 数据和汇总 - -#### 7. **ADMIN_PAGE_CHECKLIST.csv** 📊 - -所有 76 条路由的 CSV 表格。 - -- 适合:需要数据处理的人 -- 内容:所有路由的完整数据表 -- 用途:Excel、数据分析、进度跟踪 - -#### 8. **ADMIN_PAGE_COMPLETE.md** 📋 - -最终交付清单(这份文档)。 - -- 适合:需要确认所有内容的人 -- 内容:所有文档总结、文件位置、下一步行动 -- 阅读时间:5-10 分钟 - ---- - -## 🎯 核心发现摘要 - -### 检查结果 - -``` -✅ 完全符合: 2 个 (2.6%) -⚠️ 需要小修改: 6 个 (7.9%) -🔄 动态实现: 5 个 (6.6%) -❌ 需要修改: 63 个 (82.9%) -━━━━━━━━━━━━━━━━━ -总计: 76 个 (100%) -``` - -### 文件分类 - -- 🔴 **高优先级**(必须修改):36 个文件 -- 🟡 **中优先级**(应该修改):27 个文件 -- 🟢 **低优先级**(小修改):7 个文件 -- 🟢 **已符合**:2 个文件 - -### 预计工作量 - -- **优先级低**:1-2 小时(7 个文件) -- **优先级中**:4-6 小时(27 个文件) -- **优先级高**:8-12 小时(36 个文件) -- **验证和测试**:1.5-2 小时 -- **总计**:13-20 小时 - ---- - -## 📍 文档位置 - -所有文档都在项目根目录: - -``` -d:\骅锋\mall\ -``` - -### 完整文件列表 - -- ✅ ADMIN_PAGE_START_HERE.md -- ✅ ADMIN_PAGE_INDEX.md -- ✅ ADMIN_PAGE_SUMMARY.md -- ✅ ADMIN_PAGE_QUICK_REFERENCE.md -- ✅ ADMIN_PAGE_COMPLIANCE_CHECKLIST.md -- ✅ ADMIN_PAGE_MODIFICATION_PLAN.md -- ✅ ADMIN_PAGE_CHECKLIST.csv -- ✅ ADMIN_PAGE_COMPLETE.md(本文档) - ---- - -## 🚀 快速开始(3 步) - -### 步骤 1:打开索引文档(5 分钟) - -``` -打开:ADMIN_PAGE_INDEX.md -目的:了解所有文档,选择合适的起点 -``` - -### 步骤 2:选择修改目标(5 分钟) - -``` -打开:ADMIN_PAGE_QUICK_REFERENCE.md -搜索:你要修改的文件名 -查看:该文件的状态和修改建议 -``` - -### 步骤 3:获取修改方案(5 分钟) - -``` -打开:ADMIN_PAGE_MODIFICATION_PLAN.md -找到:对应的修改方案 -复制:代码示例到你的文件 -``` - ---- - -## 📖 按用户角色的文档选择 - -### 👔 项目经理 - -**目标**:了解整体情况 -**阅读顺序**: - -1. ADMIN_PAGE_SUMMARY.md(前 3 部分) -2. 本文档的"核心发现摘要" - -### 👨‍💻 开发人员 - -**目标**:快速找到修改方案 -**阅读顺序**: - -1. ADMIN_PAGE_INDEX.md -2. ADMIN_PAGE_QUICK_REFERENCE.md(搜索文件) -3. ADMIN_PAGE_MODIFICATION_PLAN.md(找修改方案) - -### 📊 技术主管 - -**目标**:制定实施计划 -**阅读顺序**: - -1. ADMIN_PAGE_SUMMARY.md -2. ADMIN_PAGE_COMPLIANCE_CHECKLIST.md -3. ADMIN_PAGE_CHECKLIST.csv(用于进度跟踪) - -### 🔬 QA/测试人员 - -**目标**:制定测试计划 -**阅读顺序**: - -1. ADMIN_PAGE_COMPLIANCE_CHECKLIST.md -2. ADMIN_PAGE_QUICK_REFERENCE.md -3. ADMIN_PAGE_SUMMARY.md(问题排查部分) - ---- - -## 🎓 文档使用指南 - -### 我是新手,从哪里开始? - -→ 打开 **ADMIN_PAGE_START_HERE.md**(本文档),然后打开 **ADMIN_PAGE_INDEX.md** - -### 我需要快速查找某个文件的修改方案 - -→ 打开 **ADMIN_PAGE_QUICK_REFERENCE.md**,搜索文件名 - -### 我需要完整的路由清单 - -→ 打开 **ADMIN_PAGE_COMPLIANCE_CHECKLIST.md** 或 **ADMIN_PAGE_CHECKLIST.csv** - -### 我需要代码示例 - -→ 打开 **ADMIN_PAGE_MODIFICATION_PLAN.md** - -### 我需要了解项目整体情况 - -→ 打开 **ADMIN_PAGE_SUMMARY.md** - -### 我需要进度跟踪表 - -→ 打开 **ADMIN_PAGE_CHECKLIST.csv**,在 Excel 中添加进度列 - ---- - -## ✨ 文档特点 - -### 全面性 ✓ - -- 覆盖所有 76 条路由 -- 分析所有 50+ 个文件 -- 识别所有问题 - -### 详细性 ✓ - -- 每个文件的状态清晰 -- 每个问题有具体说明 -- 每个修改有代码示例 - -### 易用性 ✓ - -- 按优先级组织 -- 按问题类型分类 -- 快速查找工具 -- 清晰的导航 - -### 可操作性 ✓ - -- 6 种修改方案 -- 代码示例 -- 验证方法 -- 时间估计 - ---- - -## 📊 数据统计 - -| 项目 | 数值 | -| ---------- | ---------- | -| 生成的文档 | 8 份 | -| 检查的路由 | 76 条 | -| 涉及的文件 | 50+ 个 | -| 文档总字数 | 40,000+ | -| 代码示例 | 15+ | -| 完全符合 | 2 个 | -| 需要修改 | 74 个 | -| 修改方案 | 6 种 | -| 预计工作量 | 13-20 小时 | - ---- - -## 🎯 关键信息 - -### ✅ 已完全符合的文件(2个) - -``` -1. pages/mall/admin/homePage/index.uvue ✓ -2. pages/mall/admin/product-statistics.uvue ✓ -``` - -### ⚠️ 需要小修改的文件(7个) - -``` -1. pages/mall/admin/design/index.uvue -2. pages/mall/admin/user-statistics.uvue -3. pages/mall/admin/content/index.uvue -4. pages/mall/admin/customer-service/list.uvue -5. pages/mall/admin/system-settings.uvue -6. pages/mall/admin/maintain/dev-config/category.uvue -7. pages/mall/admin/maintain/system-info.uvue -``` - -### ❌ 需要重新包装的文件(36个) - -- product-management.uvue -- order-management.uvue -- 所有 marketing/coupon/\*.uvue -- 所有 customer-service/\*.uvue -- 所有 system/shipping/\*.uvue -- 等...(详见完整清单) - -### 📦 已导入但未使用的文件(27个) - -- 所有 product/\*.uvue(除 product-statistics.uvue) -- 所有 system/api/\*.uvue -- 所有 maintain/dev-config/\*.uvue -- 等...(详见完整清单) - ---- - -## 🔥 立即行动(建议) - -### 现在就做(5 分钟) - -1. 打开 **ADMIN_PAGE_START_HERE.md** -2. 理解全貌 -3. 选择起点 - -### 然后做(10 分钟) - -1. 打开 **ADMIN_PAGE_INDEX.md** -2. 选择合适的详细文档 -3. 深入了解 - -### 最后做(修改) - -1. 按优先级选择文件 -2. 在 **ADMIN_PAGE_MODIFICATION_PLAN.md** 中找修改方案 -3. 应用代码 -4. 测试验证 - ---- - -## ✅ 检查清单 - -在开始修改之前,请确认: - -- [ ] 我已阅读 ADMIN_PAGE_START_HERE.md -- [ ] 我已阅读 ADMIN_PAGE_INDEX.md -- [ ] 我理解了 3 个优先级的区别 -- [ ] 我知道我要修改哪个文件 -- [ ] 我已找到了对应的修改方案 -- [ ] 我已准备好开始修改 - ---- - -## 💡 常见问题(FAQ) - -### Q: 所有文档都要读吗? - -A: 不用。根据你的角色选择相关文档即可。 - -### Q: 修改难度大吗? - -A: 不大。所有代码示例都已提供,只需复制粘贴。 - -### Q: 应该从哪个文件开始修改? - -A: 推荐从优先级低(🟢)的文件开始。 - -### Q: 修改需要多久? - -A: 每个文件 10-15 分钟,总计 13-20 小时。 - -### Q: 如何验证修改是否正确? - -A: 在浏览器中访问页面,检查菜单是否显示。 - -### Q: 文档在哪里找? - -A: 都在 d:\骅锋\mall\ 目录中。 - ---- - -## 🎓 参考资源 - -### 相关源文件 - -- AdminLayout 组件:`layouts/admin/AdminLayout.uvue` -- 菜单定义:`layouts/admin/utils/menu.uts` -- 类型定义:`layouts/admin/types.uts` - -### 参考页面(已正确实现) - -- `pages/mall/admin/homePage/index.uvue` ✅ -- `pages/mall/admin/product-statistics.uvue` ✅ -- `pages/mall/admin/user-management.uvue` ✅(动态实现) - ---- - -## 📞 需要帮助? - -### 问题类型 → 解决方案 - -| 问题 | 查看 | -| -------------- | ---------------------------------- | -| 不知道从哪开始 | ADMIN_PAGE_INDEX.md | -| 需要快速查询 | ADMIN_PAGE_QUICK_REFERENCE.md | -| 需要完整清单 | ADMIN_PAGE_COMPLIANCE_CHECKLIST.md | -| 需要修改方案 | ADMIN_PAGE_MODIFICATION_PLAN.md | -| 需要概览 | ADMIN_PAGE_SUMMARY.md | -| 需要整体总结 | ADMIN_PAGE_START_HERE.md | - ---- - -## 🎉 预期成果 - -### 修改完成后 - -✅ 所有后台页面都显示正确的 AdminLayout -✅ 所有页面有统一的导航和布局 -✅ 用户体验大幅改善 -✅ 代码更易维护 -✅ 更少的 BUG - ---- - -## 📅 时间表建议 - -### 第 1 天(4-5 小时) - -- 修改优先级低的 7 个文件 -- 进行初步测试 - -### 第 2-3 天(8-10 小时) - -- 修改优先级中的 27 个文件 -- 进行中等规模测试 - -### 第 4-5 天(8-12 小时) - -- 修改优先级高的 36 个文件 -- 进行全面测试 - -### 第 6 天(2-3 小时) - -- 最终验证和修复 -- 部署到生产 - -**总计**:约 23-32 小时工作量(可能并行进行) - ---- - -## 🏁 最后的话 - -你现在拥有完整的文档和修改方案。没有进一步的理由延迟。 - -**选择一个简单的文件,现在就开始修改。** - -推荐的第一个文件:**pages/mall/admin/design/index.uvue**(最简单) - ---- - -## 📝 信息汇总 - -- **生成日期**:2026年1月30日 -- **检查方法**:自动化代码分析 -- **准确度**:100% -- **文档数量**:8 份 -- **覆盖范围**:所有 76 条路由 -- **包含代码示例**:15+ 个 - ---- - -## 🎯 你的下一步 - -👉 **打开并阅读**:[ADMIN_PAGE_START_HERE.md](ADMIN_PAGE_START_HERE.md) - -或者 - -👉 **直接打开**:[ADMIN_PAGE_INDEX.md](ADMIN_PAGE_INDEX.md) - ---- - -**准备好了?让我们开始!** 🚀 - -_文档生成完成 - 2026年1月30日_ -_所有文件已在 d:\骅锋\mall\ 目录中_ diff --git a/CRMEB_DASHBOARD_README.md b/CRMEB_DASHBOARD_README.md deleted file mode 100644 index b0dea6fa..00000000 --- a/CRMEB_DASHBOARD_README.md +++ /dev/null @@ -1,570 +0,0 @@ -# CRMEB 标准版后台管理系统 - -## 📋 项目概述 - -基于 uni-app-x 完全自主开发的 CRMEB 风格后台管理系统,严格遵循 CRMEB 设计规范,实现完整的数据看板和用户统计功能。 - -## 🏗️ 目录结构 - -``` -mall/ -├── App.uvue # 全局样式配置 -├── layouts/ -│ └── admin/ -│ ├── index.uvue # 主布局组件 -│ ├── components/ -│ │ └── card.uvue # 卡片组件 -│ └── utils/ -│ └── echarts-config.uts # ECharts配置 -├── pages/ -│ ├── minimal.uvue # 测试页面 -│ └── mall/ -│ └── admin/ -│ ├── index.uvue # 数据看板 -│ ├── user-management.uvue # 用户管理 -│ ├── product-management.uvue # 商品管理 -│ ├── order-management.uvue # 订单管理 -│ ├── finance-management.uvue # 财务管理 -│ └── user-statistics.uvue # 用户统计页 -├── pages.json # 页面配置 -└── CRMEB_DASHBOARD_README.md # 项目文档 -``` - -## 🎨 设计规范 - -### 全局样式体系 -- **24栅格系统**: 响应式布局,支持1-24列 -- **CSS变量**: 统一的颜色、间距、圆角规范 -- **全局重置**: 消除浏览器默认样式差异 -- **主题色**: CRMEB 风格的蓝色系配色 - -### 布局架构 -- **AdminLayout**: 左侧菜单 + 顶部导航 + 标签页 + 内容区 -- **垂直菜单**: 一级图标菜单 + 二级文字菜单 + 折叠功能 -- **标签页**: 可关闭的多标签页,支持切换导航 -- **内容区**: flex:1 + height:0 + scroll-view 确保正确滚动 - -## 📊 核心功能 - -### 1. 数据看板 (Dashboard) - -#### KPI 指标卡片 (第一行) -```vue - - - - - - 销售额 - 今日 - - - ¥125,680.50 - +5.7% - - - 昨日:¥118,920.30 - 本月累计:¥2,857,808.90 - - - - -``` - -#### 订单统计图表 (第二行) -```vue - - - - - - -``` - -#### 用户分析图表 (第三行) -```vue - - - - - -``` - -### 2. 用户统计页 - -#### 筛选条件栏 -```vue - - - - - - - - - - -``` - -#### 指标概览 (6个KPI卡片) -```vue - - - -``` - -#### 多折线趋势图 -```vue - - - - - -``` - -## 🔧 技术实现 - -### AdminLayout 组件 - -#### 核心特性 -```javascript -// 双层侧边栏 -const menuList = ref([ - { - id: 'dashboard', - title: '首页', - icon: 'icon-dashboard', - path: '/pages/mall/admin/index', - subMenus: [] // 二级菜单 - } - // ... 其他菜单项 -]) - -// 标签页管理 -const tabs = ref([ - { id: 'dashboard', title: '首页', closable: false } -]) - -// 折叠状态 -const isCollapsed = ref(false) -``` - -#### 布局结构 -```vue - - - - - - - - - - - - - - - - - -``` - -### ECharts 图表配置 - -#### 组合图表配置 -```javascript -export const getOrderChartOption = (period) => ({ - series: [ - { - name: '订单金额', - type: 'bar', - data: amountData, - itemStyle: { color: '#1890ff' } - }, - { - name: '订单数量', - type: 'line', - data: countData, - itemStyle: { color: '#52c41a' } - } - ] -}) -``` - -#### 多折线图配置 -```javascript -export const getUserStatisticsOption = () => ({ - series: [ - { name: '新增用户', type: 'line', data: newUsersData }, - { name: '访客数', type: 'line', data: visitorsData }, - // ... 更多数据线 - ] -}) -``` - -## 📱 响应式设计 - -### 断点系统 -```scss -/* >=1200px: 4卡片一行 */ -.kpi-cards-row { display: flex; gap: 24px; } - -/* <=1200px: 2卡片一行 */ -@media (max-width: 1199px) { - .kpi-card { min-width: 45%; } -} - -/* <=768px: 单列布局 */ -@media (max-width: 767px) { - .kpi-cards-row { flex-direction: column; } - .charts-row.two-cols { flex-direction: column; } -} -``` - -### 栅格系统 -```scss -/* 24列栅格系统 */ -.col-6 { flex: 0 0 25%; max-width: 25%; } -.col-12 { flex: 0 0 50%; max-width: 50%; } -.col-24 { flex: 0 0 100%; max-width: 100%; } -``` - -## 🚀 运行指南 - -### 开发环境 -```bash -# HBuilderX 中运行 -# 选择:运行 -> 运行到浏览器 -> Chrome -``` - -### 页面访问 -- **数据看板**: `/pages/mall/admin/index` -- **用户统计**: `/pages/mall/admin/user-statistics` -- **其他页面**: 通过左侧菜单导航 - -### 功能测试 -1. **菜单导航**: 点击左侧菜单切换页面 -2. **标签页**: 点击标签切换,点击关闭按钮关闭 -3. **折叠功能**: 点击折叠按钮收起/展开菜单 -4. **图表展示**: 查看各种数据图表 -5. **响应式**: 调整浏览器窗口测试适配 - -## 📚 开发规范 - -### 文件命名 -- **组件**: PascalCase (`AdminLayout.vue`) -- **页面**: kebab-case (`user-statistics.uvue`) -- **工具**: camelCase (`echarts-config.uts`) - -### 代码组织 -```vue - - - - - -``` - -### 样式原则 -- **组件内样式**: 避免 `scoped`,确保样式隔离 -- **CSS变量**: 使用统一的主题变量 -- **BEM命名**: 清晰的样式命名规范 -- **移动优先**: 响应式设计从移动端开始 - -## 🎯 项目特色 - -### ✅ 完全自主开发 -- **0%源码复制**: 100%自主编写 -- **CRMEB风格**: 严格遵循设计规范 -- **技术先进**: Vue 3 + TypeScript + uni-app-x -- **功能完整**: 数据看板 + 用户统计双页面 - -### ✅ 设计还原度高 -- **布局结构**: 1:1还原CRMEB后台布局 -- **视觉风格**: 白底轻阴影,Element-UI设计语言 -- **交互体验**: 流畅的动画和反馈效果 -- **响应式**: 全设备适配 - -### ✅ 架构优秀 -- **组件化**: 模块化组件设计 -- **可扩展**: 易于添加新功能 -- **可维护**: 清晰的代码结构 -- **性能优化**: 合理的渲染策略 - -## 📋 功能清单 - -### 已实现功能 -- ✅ CRMEB风格垂直菜单布局 -- ✅ 顶部多标签页系统 -- ✅ 双层侧边栏导航 -- ✅ KPI指标卡片展示 -- ✅ 订单统计组合图表 -- ✅ 用户趋势分析图表 -- ✅ 用户构成饼图 -- ✅ 用户统计筛选功能 -- ✅ 多折线趋势图表 -- ✅ 响应式24栅格布局 -- ✅ 完整的样式系统 -- ✅ ECharts图表配置 - -### 扩展功能 -- 🔄 ECharts实际集成 -- 🔄 数据实时更新 -- 🔄 图表交互功能 -- 🔄 数据导出功能 -- 🔄 更多管理页面 - ---- - -## 🎉 总结 - -本项目成功实现了CRMEB标准版后台管理系统,具备完整的数据看板和用户统计功能。通过严格遵循CRMEB的设计规范和自主开发,确保了代码质量和技术先进性。 - -项目采用了现代化的技术栈,实现了响应式设计和模块化架构,为后续功能扩展奠定了坚实基础。 - ---- - -## 🚀 部署运行 - -### 开发环境 -```bash -# HBuilderX 中运行 -# 选择:运行 -> 运行到浏览器 -``` - -### 访问页面 -- **数据看板**: `/pages/mall/admin/index` -- **用户统计**: `/pages/mall/admin/user-statistics` -- **其他页面**: 通过左侧菜单导航 - -### 功能验证 -1. **菜单导航**: 左侧双层菜单切换页面 -2. **标签页**: 顶部标签页切换和关闭 -3. **折叠功能**: 菜单栏收起/展开 -4. **图表展示**: 查看各种数据可视化 -5. **响应式**: 调整窗口测试适配效果 - -## 📋 功能清单 - -### ✅ 已实现功能 -- [x] CRMEB风格垂直菜单布局 -- [x] 顶部多标签页系统 -- [x] 双层侧边栏导航 -- [x] 二级菜单Tab切换功能 -- [x] KPI指标卡片展示 -- [x] 订单统计组合图表 -- [x] 用户趋势分析图表 -- [x] 用户构成饼图 -- [x] 用户统计筛选功能 -- [x] 多折线趋势图表 -- [x] 响应式24栅格布局 -- [x] 完整的样式系统 -- [x] ECharts图表配置 -- [x] 页面参数处理(onLoad) -- [x] Tab内部状态管理 - -### 🎯 技术亮点 -- **完全自主开发**: 0%源码复制,100%原创 -- **CRMEB风格还原**: 严格遵循设计规范 -- **现代技术栈**: Vue 3 + TypeScript + uni-app-x -- **架构设计**: 模块化组件,易于维护 -- **用户体验**: 流畅交互,响应式适配 - ---- - -## 🔧 二级菜单Tab切换机制详解 - -### 实现原理 - -CRMEB后台的二级菜单采用 **页面级Tab切换** 模式: -- 点击一级菜单:跳转到对应页面的**默认Tab** -- 点击二级菜单:跳转到同一页面的**指定Tab** -- 通过URL参数控制Tab状态 - -### 技术实现 - -#### 1. AdminLayout菜单配置 -```javascript -const menuList = ref([ - { - id: 'user', - title: '用户管理', - icon: 'icon-user', - path: '/pages/mall/admin/user-management', - subMenus: [ - { - id: 'user-list', - title: '用户列表', - path: '/pages/mall/admin/user-management' // 默认Tab - }, - { - id: 'user-add', - title: '添加用户', - path: '/pages/mall/admin/user-management?action=add' // 指定Tab - } - ] - }, - { - id: 'product', - title: '商品管理', - icon: 'icon-shopping', - path: '/pages/mall/admin/product-management', - subMenus: [ - { - id: 'product-list', - title: '商品列表', - path: '/pages/mall/admin/product-management' - }, - { - id: 'product-add', - title: '添加商品', - path: '/pages/mall/admin/product-management?action=add' - }, - { - id: 'category', - title: '商品分类', - path: '/pages/mall/admin/product-management?tab=category' - } - ] - } -]) -``` - -#### 2. 菜单点击处理 -```javascript -const handleMenuClick = (menu: any) => { - activeMenu.value = menu.id - // 跳转到默认Tab - uni.navigateTo({ url: menu.path }) -} - -const handleSubMenuClick = (subMenu: any) => { - activeSubMenu.value = subMenu.id - // 跳转到指定Tab(带参数) - uni.navigateTo({ url: subMenu.path }) -} -``` - -#### 3. 页面参数处理 -```javascript -// 页面Tab配置 -const tabs = ref([ - { key: 'user-list', title: '用户列表', icon: 'icon-list' }, - { key: 'user-add', title: '添加用户', icon: 'icon-add' }, - { key: 'category', title: '商品分类', icon: 'icon-category' } -]) - -const activeTab = ref('user-list') - -// 页面加载时处理参数 -onLoad((options: any) => { - if (options && options.action) { - if (options.action === 'add') { - activeTab.value = 'user-add' - showAddModal.value = true - } - } else if (options && options.tab) { - if (options.tab === 'category') { - activeTab.value = 'category' - } - } -}) -``` - -#### 4. Tab内容切换 -```vue - - - - {{ tab.title }} - - - - - - - - - - - - - -``` - -### 功能示例 - -#### 用户管理页面 -- **用户列表Tab**: 显示用户表格、搜索、筛选、分页 -- **添加用户Tab**: 显示新增用户表单 - -#### 商品管理页面 -- **商品列表Tab**: 商品表格管理 -- **添加商品Tab**: 商品信息表单 -- **商品分类Tab**: 分类树形管理 - -#### 订单管理页面 -- **订单列表Tab**: 订单表格展示 -- **订单详情Tab**: 订单详细信息 - -### URL参数映射 - -| 页面 | 默认Tab | 参数Tab | 功能 | -|------|---------|---------|------| -| 用户管理 | `user-list` | `?action=add` → `user-add` | 添加用户 | -| 商品管理 | `product-list` | `?action=add` → `product-add`
`?tab=category` → `category` | 添加商品/分类管理 | -| 订单管理 | `order-list` | `?action=detail` → `order-detail` | 订单详情 | -| 财务管理 | `finance-overview` | `?tab=withdrawals` → `withdrawals` | 提现管理 | -| 系统设置 | `basic` | `?tab=security` → `security`
`?tab=email` → `email` | 安全设置/邮件设置 | - -### 样式实现 - -#### Tab栏样式 -```scss -.tab-bar { - display: flex; - background: #ffffff; - border-radius: 8rpx; - padding: 8rpx; - margin-bottom: 24rpx; - box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.06); -} - -.tab-item { - flex: 1; - padding: 16rpx 24rpx; - border-radius: 6rpx; - cursor: pointer; - transition: all 0.2s; - background: #f5f5f5; - color: #666666; - - &.active { - background: #1890ff; - color: #ffffff; - } -} -``` - ---- - -*技术栈:uni-app-x + Vue 3 + TypeScript + SCSS + ECharts* -*设计风格:CRMEB标准版后台* -*开发时间:完全自主开发* 🎊 \ No newline at end of file diff --git a/CRMEB_ROUTE_FIX_LOG.md b/CRMEB_ROUTE_FIX_LOG.md deleted file mode 100644 index bc80a9b7..00000000 --- a/CRMEB_ROUTE_FIX_LOG.md +++ /dev/null @@ -1,247 +0,0 @@ -# CRMEB 路由体系完整修复日志 - -## 修复时间 - -2026年2月2日 - -## 问题分析 - -### 1. AdminLayout.uvue 重复代码问题 - -**现象**: `onTabClick` 等方法声明重复(第6行和第318行) - -**原因**: AdminLayout.uvue 中混合了新旧代码: - -- 新代码: CRMEB 状态驱动内部路由系统 -- 旧代码: 传统 uni.navigateTo() 页面导航系统 -- 两套代码同时存在导致方法重复声明 - -**代码混乱片段**: - -```typescript -// 新代码:正确的 -function onTabClick(tab: TabItem): void { - openRoute(tab.id, false); -} - -// 旧代码:被保留下来 -const onTabClick = (tab: TabItem) => { - activeTabId.value = tab.id; - go(tab.path); -}; -``` - -### 2. Vue Router 警告 - -**现象**: `No match found for location with path "/pages/mall/admin/user-management?action=config"` - -**原因**: pages.json 中仍配置了旧的单页面 user-management,Vue Router 尝试匹配但找不到对应路由 - -**影响**: 这是警告而非错误,不影响 CRMEB 内部路由的正常运作 - -### 3. AdminLayout.uvue 加载失败 - -**现象**: `GET http://localhost:5173/layouts/admin/AdminLayout.uvue?t=1770028015206&import net::ERR_ABORTED 500` - -**原因**: 编译器无法解析混乱的 AdminLayout.uvue(包含大量重复和冲突的代码) - -## 修复措施 - -### 修复 1: 完全重写 AdminLayout.uvue - -**操作**: 删除旧的混乱版本,用清晰的新版本替换 - -**新版本特点**: - -- ✅ 完全移除旧代码(`toggleCollapse`, `firstLeafOfMenu`, `go()`, `onMenuClick` 等) -- ✅ 保留所有新的 CRMEB 路由函数 -- ✅ 统一的代码风格和命名规范 -- ✅ 清晰的注释和模块划分 - -**关键改变**: - -```typescript -// 删除的旧代码片段(45+ 行) -// handlers -const toggleCollapse = () => { ... } -const firstLeafOfMenu = (m: MenuItem): MenuChild | null => { ... } -let navigating = false -const go = async (url?: string | null) => { ... } -const onMenuClick = (menuId: string) => { ... } -const onSubClick = (c: MenuChild) => { ... } -const onTabClick = (tab: TabItem) => { ... } // ← 重复! -const onTabClose = (tabId: string) => { ... } - -// 保留的新代码 -function onTabClick(tab: TabItem): void { ... } // ← 新版本保留 -``` - -### 修复 2: 调整 pages.json 配置 - -**操作**: 简化 `pages/mall/pages.json` 中的 admin 模块配置 - -**修改前**: - -```json -{ - "root": "pages/mall/admin", - "pages": [ - { "path": "user-management", ... }, - { "path": "subscription/plan-management", ... }, - { "path": "merchant-management", ... }, - // 20+ 个旧页面 - ] -} -``` - -**修改后**: - -```json -{ - "root": "pages/mall/admin", - "pages": [ - { "path": "homePage/index", ... } - // 仅保留首页入口 - ] -} -``` - -## 编译验证结果 - -### npm run lint 输出 - -``` -✅ 无致命编译错误 -⚠️ ESLint 警告(非阻断性): - - vue/comment-directive: 配置相关(可忽略) - - 旧文件中的 x-invalid-end-tag: 与新系统无关 -``` - -### 关键文件状态 - -| 文件 | 状态 | 说明 | -| --------------------- | ------- | ---------------------- | -| AdminLayout.uvue | ✅ 修复 | 清晰、无重复、编译通过 | -| AdminAside.uvue | ✅ 正常 | 新建,无问题 | -| AdminSubSider.uvue | ✅ 正常 | 新建,无问题 | -| AdminHeader.uvue | ✅ 正常 | 新建,无问题 | -| AdminTagsView.uvue | ✅ 正常 | 新建,无问题 | -| AdminFooter.uvue | ✅ 正常 | 新建,无问题 | -| PlaceholderPage.uvue | ✅ 正常 | 新建,无问题 | -| adminRoutes.uts | ✅ 正常 | 新建,无问题 | -| adminNavStore.uts | ✅ 正常 | 新建,无问题 | -| adminComponentMap.uts | ✅ 正常 | 新建,无问题 | - -## 重要发现 - -### Vue Router 与 uni-app-x 共存 - -虽然项目最初使用了 Vue Router(从 main.uts 第18行的警告看出),但我们的 CRMEB 路由系统是完全独立的: - -``` -uni-app-x 项目结构 -├── Vue Router 路由(传统页面导航) -│ └── 仅处理主要页面 (pages.json 中的全局页面) -└── CRMEB 内部路由(新增,状态驱动) - └── 仅在 AdminLayout 内部工作 -``` - -**结论**: Vue Router 的警告不影响 CRMEB 系统的运作。 - -## 已验证的功能 - -✅ AdminLayout 组件正确编译 -✅ 所有子组件正确导入 -✅ 内部路由状态管理无冲突 -✅ 组件映射表完整 -✅ 占位页面正确工作 - -## 后续行动 - -### 立即可测试的 - -1. 在 HBuilderX 中打开项目预览 -2. 点击首页侧边栏菜单,验证路由切换 -3. 检查标签页的添加/关闭功能 -4. 验证面包屑导航显示 - -### 需要进一步处理的 - -1. 实现实际页面内容(当前为占位组件) -2. 实现页面缓存机制(替代 keep-alive) -3. 添加权限检查逻辑 - -## 技术债务清单 - -项目中仍存在的旧文件(与新系统无关): - -- `pages/dashboard/UserTrendChart.uvue` - x-invalid-end-tag 错误 -- `pages/info/video-player.uvue` - x-invalid-end-tag 错误 -- 多个 `pages/info/*` 文件 - 未使用的变量 - -这些是独立的遗留文件,不影响 CRMEB 管理端功能。 - ---- - -**修复验证**: ✅ 完成 -**系统状态**: 🟢 就绪 -**可部署**: ✅ 是 - -## �޸�ʱ��: 2026��2��4�� - -### Ӫ������ģ�齻���޸� - -- **�޸�����**: ��ť�����ء��ϴ��������޷�Ӧ�� -- **�޸�����**: ����ɱ��ֱ��ģ�鹲6��ҳ���У���ȫ�� @click �¼��󶨼���Ӧ�Ľű��߼��� oggleStatus, handleUpload, handleSubmit �ȣ��� -- **�漰·��**: pages/mall/admin/marketing/seckill/ �� live/ Ŀ¼�µ����� uvue ҳ�档 - -## 修改时间: 2026年2月4日 (续) - -### 付费会员模块 1:1 复刻完成 - -- **会员类型**: 实现 ID、名称、有效期、价格、折扣、状态(Switch)、排序及编辑。 -- **会员权益**: 实现权益图标预览、名称、简介、显示隐藏切换。 -- **卡密会员**: - - 实现批次列表。 - - 实现添加批次弹窗 Form 表单。 - - 实现二维码预览弹窗。 -- **会员记录**: 实现详细的支付流水表,包含用户信息和时间戳。 -- **会员配置**: 实现多项配置项,支持 Switch 联动、图片上传占位及规则文本编辑。 -- **路由映射**: 在 adminComponentMap.uts 中完成了从 PlaceholderPage 到实际组件的转换。 - -## 修改时间: 2026年2月4日 (续) - -### 用户充值模块 1:1 复刻完成 - -- **金额设置**: - - 实现左侧手机端充值页面视觉预览(余额展示、充值选项、注意事项)。 - - 实现右侧充值项管理表格,包含售价、赠送金额、状态(Switch)及排序。 - - 实现添加数据弹窗,包含表单输入及单选框状态。 -- **充值配置**: - - 实现余额功能、注意事项、小程序充值开关及最低充值金额的完整配置表单。 -- **路由映射**: 同步更新 adminComponentMap.uts,确保页面可正常访问。 - -### 金额设置功能逻辑增强 - -- **数据同步**: 实现了添加数据弹窗的真正逻辑。现在点击确定后,新设置的充值项会实时同步到右侧管理表格和左侧手机端充值预览中。 -- **删除功能**: 实现了表格项的真实物理删除逻辑,点击删除按钮并确认后可从列表中移除。 -- **表单校验**: 添加了简单的非空校验与表单重置逻辑。 - -## 修改时间: 2026年2月4日 (续) - -### 每日签到模块 1:1 复刻完成 - -- **签到配置**: - - 实现了签到规则、赠送积分、签到天数等完整设置表单。 - - 包含图片上传占位及开关组件。 -- **签到奖励**: - - 实现了“连续签到”与“累计签到”双选项卡切换列表。 - - 实现了“添加奖励”弹窗功能,支持输入天数及奖励积分,并确保数据添加后能立刻在对应列表中显示。 - -### 新人礼模块 1:1 复刻完成 - -- **设置项**: 实现了赠送余额、赠送积分的输入表单,并预设了与截图一致的数值。 -- **优惠券选择**: 实现了“选择优惠券”点击交互,弹出包含优惠券列表的模态框,支持多选并实时同步预览。 -- **数据管理**: 支持移除已选优惠券标签。 - -- **路由映射**: 已在 `adminComponentMap.uts` 中注册 `MarketingNewcomerGift` 组件。 diff --git a/IMPORT_RESOLUTION_FIX.md b/IMPORT_RESOLUTION_FIX.md deleted file mode 100644 index 64e23728..00000000 --- a/IMPORT_RESOLUTION_FIX.md +++ /dev/null @@ -1,89 +0,0 @@ -# 导入解析错误诊断与解决方案 - -## 问题描述 - -Vite 编译器报告无法解析导入语句: - -``` -[plugin:vite:import-analysis] Failed to resolve import "../marketing" from -"...pages/mall/admin/marketing/newcomer.uvue?vue&type=script&setup=true&lang.uts" -``` - -涉及文件: - -- newcomer.uvue (第 80 行) -- signin/rule.uvue (第 330 行) -- signin/record.uvue (第 99 行) - -## 根本原因分析 - -### ✅ 代码检查结果 - -所有导入语句都是正确的: - -```typescript -import { getNewcomerRule, saveNewcomerRule } from "../marketing.uts"; -import { getSigninRule, saveSigninRule } from "../marketing.uts"; -import { getSigninRecordList } from "../marketing.uts"; -``` - -### ✅ 文件存在检查 - -`marketing.uts` 文件确实存在于: - -- `d:\骅锋\mall\pages\mall\admin\marketing\marketing.uts` ✓ - -### 🔍 问题可能原因 - -1. **Vite 编译器缓存** - 开发服务器缓存了旧的文件状态 -2. **路径解析延迟** - 新文件创建后编译器未及时识别 -3. **TypeScript 服务器缓存** - TS 语言服务未更新索引 - -## 解决方案 - -### 已执行步骤 - -✅ 清除 node_modules/.vite 缓存 -✅ 清除 unpackage/cache 目录 - -### 推荐后续步骤 - -#### 方案 1: 重启开发服务器(推荐) - -```bash -# 终止当前开发服务器 (Ctrl+C) -# 然后重新启动 -npm run dev -# 或 -yarn dev -``` - -#### 方案 2: 硬刷新浏览器 - -- 按 `Ctrl+Shift+Delete` 清除浏览器缓存 -- 或在浏览器开发者工具的 Network 标签禁用缓存,然后刷新 - -#### 方案 3: 完全清理重建 - -```bash -# 删除所有缓存和构建文件 -Remove-Item -Path "node_modules" -Recurse -Force -Remove-Item -Path "unpackage" -Recurse -Force - -# 重新安装和构建 -npm install -npm run dev -``` - -## 验证清单 - -- [ ] 重启开发服务器 -- [ ] 浏览器硬刷新 (Ctrl+Shift+R) -- [ ] 确认错误消息消失 -- [ ] 验证营销页面正常加载 - -## 技术说明 - -uni-app-x 在开发模式下会预加载所有页面("Preload pages in uni-app-x development mode"), -这会导致编译器验证所有 import 语句。Vite 的模块解析在首次失败后可能会缓存该结果, -即使文件已创建。重启服务器强制重新扫描文件系统。 diff --git a/PAGES_ROUTES.md b/PAGES_ROUTES.md deleted file mode 100644 index 14c36d31..00000000 --- a/PAGES_ROUTES.md +++ /dev/null @@ -1,112 +0,0 @@ -# Pages Routes - -Generated from root pages.json (pages + subPackages). - -## Pages -- pages/user/login -- pages/user/boot -- pages/user/register -- pages/user/forgot-password -- pages/user/terms -- pages/user/center -- pages/user/profile -- pages/mall/consumer/index -- pages/mall/consumer/category -- pages/mall/consumer/messages -- pages/mall/consumer/cart -- pages/mall/consumer/profile - -## SubPackages - -### pages/mall/consumer -- pages/mall/consumer/settings -- pages/mall/consumer/wallet -- pages/mall/consumer/search -- pages/mall/consumer/product-detail -- pages/mall/consumer/shop-detail -- pages/mall/consumer/coupons -- pages/mall/consumer/favorites -- pages/mall/consumer/footprint -- pages/mall/consumer/address-list -- pages/mall/consumer/address-edit -- pages/mall/consumer/checkout -- pages/mall/consumer/payment -- pages/mall/consumer/payment-success -- pages/mall/consumer/orders -- pages/mall/consumer/order-detail -- pages/mall/consumer/logistics -- pages/mall/consumer/review -- pages/mall/consumer/refund -- pages/mall/consumer/apply-refund -- pages/mall/consumer/refund-review -- pages/mall/consumer/chat -- pages/mall/consumer/subscription/plan-list -- pages/mall/consumer/subscription/plan-detail -- pages/mall/consumer/subscription/subscribe-checkout -- pages/mall/consumer/subscription/my-subscriptions - -### pages/mall/delivery -- pages/mall/delivery/index -- pages/mall/delivery/order-detail -- pages/mall/delivery/profile -- pages/mall/delivery/order-history -- pages/mall/delivery/earnings -- pages/mall/delivery/tasks -- pages/mall/delivery/task-detail -- pages/mall/delivery/profile-edit -- pages/mall/delivery/ratings -- pages/mall/delivery/vehicle -- pages/mall/delivery/vehicle-add -- pages/mall/delivery/vehicle-edit -- pages/mall/delivery/settings - -### pages/mall/analytics -- pages/mall/analytics/index -- pages/mall/analytics/profile -- pages/mall/analytics/sales-report -- pages/mall/analytics/user-analysis -- pages/mall/analytics/product-insights -- pages/mall/analytics/delivery-analysis -- pages/mall/analytics/coupon-analysis -- pages/mall/analytics/market-trends -- pages/mall/analytics/custom-report -- pages/mall/analytics/report-detail -- pages/mall/analytics/data-detail -- pages/mall/analytics/insight-detail -- pages/mall/analytics/test/test-connection - -### pages/mall/admin -- pages/mall/admin/homePage/index -- pages/mall/admin/user-management -- pages/mall/admin/product-management -- pages/mall/admin/order-management -- pages/mall/admin/finance-management -- pages/mall/admin/user-statistics -- pages/mall/admin/system-settings -- pages/mall/admin/profile -- pages/mall/admin/delivery-management -- pages/mall/admin/merchant-management -- pages/mall/admin/merchant-review -- pages/mall/admin/product-review -- pages/mall/admin/refund-review -- pages/mall/admin/complaints -- pages/mall/admin/notifications -- pages/mall/admin/activity-log -- pages/mall/admin/subscription/plan-management -- pages/mall/admin/subscription/user-subscriptions -- pages/mall/admin/marketing/coupon/coupon-management -- pages/mall/admin/marketing/coupon/list -- pages/mall/admin/marketing/coupon/receive -- pages/mall/admin/marketing/points/index -- pages/mall/admin/marketing/signin/rule -- pages/mall/admin/marketing/signin/record - -### pages/mall/merchant -- pages/mall/merchant/index -- pages/mall/merchant/product-detail -- pages/mall/merchant/profile - -### pages/mall/service -- pages/mall/service/index -- pages/mall/service/profile -- pages/mall/service/ticket-detail diff --git a/_admin_missing_files.txt b/_admin_missing_files.txt deleted file mode 100644 index 9c039cad..00000000 --- a/_admin_missing_files.txt +++ /dev/null @@ -1,12 +0,0 @@ -order-management -product-classification -product-labels -product-management -product-parameters -product-protection -product-reviews -product-specifications -product-statistics -system-settings -user-management -user-statistics \ No newline at end of file diff --git a/_admin_missing_in_json.txt b/_admin_missing_in_json.txt deleted file mode 100644 index 87d5053d..00000000 --- a/_admin_missing_in_json.txt +++ /dev/null @@ -1,25 +0,0 @@ -design/index.backup -homePage/components/KpiMiniCard -homePage/index1 -marketing/index -order/aftersales-order/index -order/cashier-order/index -order/order-configuration/index -order/order-management/index -order/order-statistics/index -order/write-off-records/index -product/product-classification/index -product/product-label/index -product/product-management/index -product/product-param/index -product/product-protection/index -product/product-reviews/index -product/product-specifications/index -product/product-statistics/index -system/index -user/user-configuration/index -user/user-grouping/index -user/user-label/index -user/user-level/index -user/user-management/index -user/user-statistics/index \ No newline at end of file diff --git a/_admin_routes.txt b/_admin_routes.txt deleted file mode 100644 index fc5caaf1..00000000 --- a/_admin_routes.txt +++ /dev/null @@ -1,116 +0,0 @@ -article//index -article/category -article/create -article/edit -content//index -design//index -design/category -design/components -design/custom -design/homepage -design/index.backup -design/product -design/templates -homePage//index -homePage/components/KpiMiniCard -homePage/index1 -maintain/data/city-data -maintain/data/clear-data -maintain/data/logistics-company -maintain/dev-config/category -maintain/dev-config/combination-data -maintain/dev-config/cron-job -maintain/dev-config/custom-event -maintain/dev-config/module-config -maintain/dev-config/permission -maintain/dev-tools/api -maintain/dev-tools/codegen -maintain/dev-tools/database -maintain/dev-tools/data-dict -maintain/dev-tools/file -maintain/external/account -maintain/i18n/language-detail -maintain/i18n/language-list -maintain/i18n/region-list -maintain/i18n/translate-config -maintain/security/online-upgrade -maintain/security/refresh-cache -maintain/security/system-log -maintain/system-info -marketing//index -marketing/coupon/list -marketing/coupon/receive -marketing/groupbuy/goods -marketing/groupbuy/list -marketing/live/anchor -marketing/live/goods -marketing/live/room -marketing/lottery/config -marketing/lottery/list -marketing/member/card -marketing/member/config -marketing/member/record -marketing/member/rights -marketing/member/type -marketing/newcomer -marketing/points//index -marketing/points/config -marketing/points/goods -marketing/points/order -marketing/points/record -marketing/points/stats -marketing/recharge/amount -marketing/recharge/config -marketing/recharge/record -marketing/seckill/config -marketing/seckill/goods -marketing/seckill/list -marketing/signin/record -marketing/signin/rule -marketing-management -order/aftersales-order//index -order/cashier-order//index -order/order-configuration//index -order/order-management//index -order/order-statistics//index -order/write-off-records//index -product/product-classification//index -product/product-label//index -product/product-management//index -product/product-param//index -product/product-protection//index -product/product-reviews//index -product/product-specifications//index -product/product-statistics//index -service//index -service/autoReply -service/config -service/message -service/script -subscription/plan-management -subscription/user-subscriptions -system//index -system/agreement-settings -system/api/collect -system/api/logistics -system/api/pay -system/api/sms -system/api/storage -system/api/waybill -system/api/yht/config -system/api/yht/page -system/message-management -system/permission/admin-list -system/permission/permission-setting -system/permission/role -system/receipt-settings -system/shipping/courier -system/shipping/freight-template -system/shipping/pickup/points -system/shipping/pickup/verifiers -user/user-configuration//index -user/user-grouping//index -user/user-label//index -user/user-level//index -user/user-management//index -user/user-statistics//index diff --git a/add_overlay_css.py b/add_overlay_css.py deleted file mode 100644 index 0de4ef42..00000000 --- a/add_overlay_css.py +++ /dev/null @@ -1,26 +0,0 @@ -import codecs -file_path = r'd:\\骅锋\\mall\\layouts\\admin\\components\\AdminHeader.uvue' -with codecs.open(file_path, 'r', 'utf-8') as f: - text = f.read() - -overlay_css = r''' -.user-dropdown-overlay { - position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; - z-index: 1000; - background-color: transparent; -} -''' -if '.user-dropdown-overlay' not in text: - text = text.replace('', overlay_css + '\n') - -text = text.replace('z-index: 99;', 'z-index: 1001;') -text = text.replace('z-index: 90;', 'z-index: 1001;') -text = text.replace('z-index: 150;', 'z-index: 1001;') -text = text.replace('.user-dropdown {', '.user-dropdown {\n z-index: 1002;') - -with codecs.open(file_path, 'w', 'utf-8') as f: - f.write(text) diff --git a/add_toast.py b/add_toast.py deleted file mode 100644 index 844c62c7..00000000 --- a/add_toast.py +++ /dev/null @@ -1,9 +0,0 @@ -import codecs -file_path = r'd:\\骅锋\\mall\\layouts\\admin\\components\\AdminHeader.uvue' -with codecs.open(file_path, 'r', 'utf-8') as f: - text = f.read() - -text = text.replace('function goToUserCenter() {', 'function goToUserCenter() {\n uni.showToast({ title: "尝试打开个人中心...", icon: "none", duration: 2000 });\n console.log([AdminHeader] goToUserCenter called);') - -with codecs.open(file_path, 'w', 'utf-8') as f: - f.write(text) diff --git a/check_all.py b/check_all.py deleted file mode 100644 index 46bb5f45..00000000 --- a/check_all.py +++ /dev/null @@ -1,52 +0,0 @@ -import os - -def check_encoding(file_path): - try: - with open(file_path, 'rb') as f: - content = f.read() - - # Check UTF-8 - try: - content.decode('utf-8') - return "UTF-8", False - except UnicodeDecodeError: - pass - - # Check GBK - try: - content.decode('gbk') - return "GBK/GB2312", True - except UnicodeDecodeError: - pass - - # Check UTF-16 - try: - content.decode('utf-16') - return "UTF-16", True - except UnicodeDecodeError: - pass - - return "Unknown/Other", True - except Exception as e: - return f"Error ({str(e)})", False - -extensions = ('.uvue', '.uts', '.vue', '.json', '.js', '.ts', '.scss', '.md', '.txt', '.ps1', '.bat', '.sh') -root_dir = r'd:\骅锋\mall' - -non_utf8_files = [] - -for root, dirs, files in os.walk(root_dir): - if any(skip in root for skip in ['.git', 'node_modules', 'unpackage']): - continue - - for file in files: - if file.lower().endswith(extensions): - file_path = os.path.join(root, file) - encoding, is_not_utf8 = check_encoding(file_path) - if is_not_utf8: - non_utf8_files.append((file_path, encoding)) - -for path, enc in non_utf8_files: - print(f"{enc: <15} | {path}") - -print(f"\nTotal non-UTF8 files found: {len(non_utf8_files)}") diff --git a/check_encodings.py b/check_encodings.py deleted file mode 100644 index 070ad656..00000000 --- a/check_encodings.py +++ /dev/null @@ -1,24 +0,0 @@ - -import os - -def check_encoding(directory): - for root, dirs, files in os.walk(directory): - for file in files: - if file.endswith('.uvue') or file.endswith('.uts'): - filepath = os.path.join(root, file) - try: - with open(filepath, 'rb') as f: - raw = f.read() - - # Check for BOM - if raw.startswith(b'\xef\xbb\xbf'): - print(f"BOM detected: {filepath}") - - # Try decoding as UTF-8 - raw.decode('utf-8') - - except Exception as e: - print(f"Potential encoding error or mojibake in: {filepath}") - -check_encoding(r'd:\骅锋\mall\pages\mall\admin') -check_encoding(r'd:\骅锋\mall\layouts') diff --git a/check_file_tags.py b/check_file_tags.py deleted file mode 100644 index c4796ba4..00000000 --- a/check_file_tags.py +++ /dev/null @@ -1,56 +0,0 @@ -import sys -import re - -def check_file(file_path): - print(f"Checking {file_path}") - try: - with open(file_path, 'r', encoding='utf-8') as f: - content = f.read() - - tags = ['template', 'script', 'style', 'view', 'text', 'image', 'scroll-view', 'input', 'textarea', 'button', 'swiper', 'swiper-item', 'component', 'slot'] - - for tag in tags: - # Count open tags: or - # Avoid matching - - - - - - diff --git a/pages/mall/admin/service/config.uvue b/pages/mall/admin/service/config.uvue deleted file mode 100644 index 0feda689..00000000 --- a/pages/mall/admin/service/config.uvue +++ /dev/null @@ -1,25 +0,0 @@ - - - - - diff --git a/pages/mall/admin/service/index.uvue b/pages/mall/admin/service/index.uvue deleted file mode 100644 index 80f4e5f5..00000000 --- a/pages/mall/admin/service/index.uvue +++ /dev/null @@ -1,25 +0,0 @@ - - - - - diff --git a/pages/mall/admin/service/message.uvue b/pages/mall/admin/service/message.uvue deleted file mode 100644 index bb629f28..00000000 --- a/pages/mall/admin/service/message.uvue +++ /dev/null @@ -1,544 +0,0 @@ - - - - - - diff --git a/pages/mall/admin/service/script.uvue b/pages/mall/admin/service/script.uvue deleted file mode 100644 index 1985e561..00000000 --- a/pages/mall/admin/service/script.uvue +++ /dev/null @@ -1,25 +0,0 @@ - - - - - diff --git a/pages/mall/admin/service/service.uts b/pages/mall/admin/service/service.uts deleted file mode 100644 index 504af569..00000000 --- a/pages/mall/admin/service/service.uts +++ /dev/null @@ -1,246 +0,0 @@ -/** - * 客服管理服务层 - * 可先使用 mock 数据,后续替换为实际 API - */ - -export type ServiceItem = { - id: number - name: string - account: string - avatar: string - status: number - created_at: string -} - -export type ScriptItem = { - id: number - title: string - content: string - updated_at: string -} - -export type MessageItem = { - id: number - user: string - contact: string - content: string - status: number - created_at: string -} - -export type AutoReplyItem = { - id: number - keyword: string - reply: string - status: number - updated_at: string -} - -export type ServiceConfig = { - workTime: string - autoReply: number - welcomeText: string -} - -export const getServiceList = (params: any = {}): Promise => { - return new Promise((resolve) => { - setTimeout(() => { - let items: ServiceItem[] = [ - { id: 1, name: '张客服', account: 'service01', avatar: '/static/user/avatar-1.png', status: 1, created_at: '2026-01-28 10:30:00' }, - { id: 2, name: '李客服', account: 'service02', avatar: '/static/user/avatar-2.png', status: 1, created_at: '2026-01-27 09:15:00' }, - { id: 3, name: '王客服', account: 'service03', avatar: '/static/user/avatar-3.png', status: 0, created_at: '2026-01-26 18:20:00' } - ] - - if (params.keyword) { - items = items.filter(item => - item.name.includes(params.keyword) || item.account.includes(params.keyword) - ) - } - - if (params.status !== undefined && params.status !== null) { - items = items.filter(item => item.status === params.status) - } - - const total = items.length - const start = ((params.page || 1) - 1) * (params.limit || 10) - const end = start + (params.limit || 10) - - resolve({ - items: items.slice(start, end), - total - }) - }, 300) - }) -} - -export const deleteService = (id: number): Promise => { - return new Promise((resolve) => { - setTimeout(() => resolve({ success: true, message: '删除成功' }), 300) - }) -} - -export const batchDeleteService = (ids: number[]): Promise => { - return new Promise((resolve) => { - setTimeout(() => resolve({ success: true, message: '批量删除成功' }), 300) - }) -} - -export const batchUpdateServiceStatus = (ids: number[], status: number): Promise => { - return new Promise((resolve) => { - setTimeout(() => resolve({ success: true, message: '状态更新成功' }), 300) - }) -} - -export const getScriptList = (params: any = {}): Promise => { - return new Promise((resolve) => { - setTimeout(() => { - let items: ScriptItem[] = [ - { id: 1, title: '欢迎语', content: '您好,欢迎咨询,我们将尽快为您服务。', updated_at: '2026-01-28 10:30:00' }, - { id: 2, title: '退款说明', content: '退款将在 1-3 个工作日内原路返回。', updated_at: '2026-01-27 11:12:00' } - ] - - if (params.title) { - items = items.filter(item => item.title.includes(params.title)) - } - - const total = items.length - const start = ((params.page || 1) - 1) * (params.limit || 10) - const end = start + (params.limit || 10) - - resolve({ - items: items.slice(start, end), - total - }) - }, 300) - }) -} - -export const saveScript = (data: any): Promise => { - return new Promise((resolve) => { - setTimeout(() => resolve({ success: true, message: '保存成功' }), 300) - }) -} - -export const deleteScript = (id: number): Promise => { - return new Promise((resolve) => { - setTimeout(() => resolve({ success: true, message: '删除成功' }), 300) - }) -} - -export const getMessageList = (params: any = {}): Promise => { - return new Promise((resolve) => { - setTimeout(() => { - let items: MessageItem[] = [ - { id: 1, user: '小王', contact: '138****1122', content: '订单什么时候发货?', status: 0, created_at: '2026-01-28 09:10:00' }, - { id: 2, user: '小李', contact: '微信: li***', content: '能否开票?', status: 1, created_at: '2026-01-27 16:45:00' } - ] - - if (params.keyword) { - items = items.filter(item => - item.user.includes(params.keyword) || item.content.includes(params.keyword) - ) - } - - if (params.status !== undefined && params.status !== null) { - items = items.filter(item => item.status === params.status) - } - - const total = items.length - const start = ((params.page || 1) - 1) * (params.limit || 10) - const end = start + (params.limit || 10) - - resolve({ - items: items.slice(start, end), - total - }) - }, 300) - }) -} - -export const replyMessage = (id: number, data: any): Promise => { - return new Promise((resolve) => { - setTimeout(() => resolve({ success: true, message: '回复成功' }), 300) - }) -} - -export const deleteMessage = (id: number): Promise => { - return new Promise((resolve) => { - setTimeout(() => resolve({ success: true, message: '删除成功' }), 300) - }) -} - -export const batchReplyMessage = (ids: number[]): Promise => { - return new Promise((resolve) => { - setTimeout(() => resolve({ success: true, message: '批量标记成功' }), 300) - }) -} - -export const batchDeleteMessage = (ids: number[]): Promise => { - return new Promise((resolve) => { - setTimeout(() => resolve({ success: true, message: '批量删除成功' }), 300) - }) -} - -export const getAutoReplyList = (params: any = {}): Promise => { - return new Promise((resolve) => { - setTimeout(() => { - let items: AutoReplyItem[] = [ - { id: 1, keyword: '退货', reply: '退货请联系在线客服处理。', status: 1, updated_at: '2026-01-28 08:30:00' }, - { id: 2, keyword: '物流', reply: '物流信息可在订单详情查看。', status: 1, updated_at: '2026-01-27 12:20:00' } - ] - - if (params.keyword) { - items = items.filter(item => item.keyword.includes(params.keyword) || item.reply.includes(params.keyword)) - } - - if (params.status !== undefined && params.status !== null) { - items = items.filter(item => item.status === params.status) - } - - const total = items.length - const start = ((params.page || 1) - 1) * (params.limit || 10) - const end = start + (params.limit || 10) - - resolve({ - items: items.slice(start, end), - total - }) - }, 300) - }) -} - -export const saveAutoReply = (data: any): Promise => { - return new Promise((resolve) => { - setTimeout(() => resolve({ success: true, message: '保存成功' }), 300) - }) -} - -export const deleteAutoReply = (id: number): Promise => { - return new Promise((resolve) => { - setTimeout(() => resolve({ success: true, message: '删除成功' }), 300) - }) -} - -export const batchDeleteAutoReply = (ids: number[]): Promise => { - return new Promise((resolve) => { - setTimeout(() => resolve({ success: true, message: '批量删除成功' }), 300) - }) -} - -export const getServiceConfig = (): Promise => { - return new Promise((resolve) => { - setTimeout(() => { - resolve({ - workTime: '09:00-18:00', - autoReply: 1, - welcomeText: '您好,欢迎咨询,我们将尽快为您服务。' - }) - }, 300) - }) -} - -export const saveServiceConfig = (data: any): Promise => { - return new Promise((resolve) => { - setTimeout(() => resolve({ success: true, message: '保存成功' }), 300) - }) -} diff --git a/pages/mall/admin/setting/agreement.uvue b/pages/mall/admin/setting/agreement/index.uvue similarity index 100% rename from pages/mall/admin/setting/agreement.uvue rename to pages/mall/admin/setting/agreement/index.uvue diff --git a/pages/mall/admin/setting/auth/admin.uvue b/pages/mall/admin/setting/auth/admin-management/index.uvue similarity index 99% rename from pages/mall/admin/setting/auth/admin.uvue rename to pages/mall/admin/setting/auth/admin-management/index.uvue index 37771a16..6a6cf717 100644 --- a/pages/mall/admin/setting/auth/admin.uvue +++ b/pages/mall/admin/setting/auth/admin-management/index.uvue @@ -287,6 +287,8 @@ function onDelete(item: AdminItem) { } .td { + display: flex; + flex-direction: row; padding: 10px; font-size: 13px; color: #515a6e; diff --git a/pages/mall/admin/setting/auth/permission.uvue b/pages/mall/admin/setting/auth/menu-management/index.uvue similarity index 100% rename from pages/mall/admin/setting/auth/permission.uvue rename to pages/mall/admin/setting/auth/menu-management/index.uvue diff --git a/pages/mall/admin/setting/auth/role.uvue b/pages/mall/admin/setting/auth/role-management/index.uvue similarity index 100% rename from pages/mall/admin/setting/auth/role.uvue rename to pages/mall/admin/setting/auth/role-management/index.uvue diff --git a/pages/mall/admin/setting/delivery/staff.uvue b/pages/mall/admin/setting/delivery/management/index.uvue similarity index 100% rename from pages/mall/admin/setting/delivery/staff.uvue rename to pages/mall/admin/setting/delivery/management/index.uvue diff --git a/pages/mall/admin/setting/delivery/station.uvue b/pages/mall/admin/setting/delivery/setting/station/index.uvue similarity index 100% rename from pages/mall/admin/setting/delivery/station.uvue rename to pages/mall/admin/setting/delivery/setting/station/index.uvue diff --git a/pages/mall/admin/setting/delivery/template.uvue b/pages/mall/admin/setting/delivery/setting/template/index.uvue similarity index 100% rename from pages/mall/admin/setting/delivery/template.uvue rename to pages/mall/admin/setting/delivery/setting/template/index.uvue diff --git a/pages/mall/admin/setting/delivery/verifier.uvue b/pages/mall/admin/setting/delivery/setting/verifier/index.uvue similarity index 100% rename from pages/mall/admin/setting/delivery/verifier.uvue rename to pages/mall/admin/setting/delivery/setting/verifier/index.uvue diff --git a/pages/mall/admin/setting/interface/collect.uvue b/pages/mall/admin/setting/interface/collect/index.uvue similarity index 100% rename from pages/mall/admin/setting/interface/collect.uvue rename to pages/mall/admin/setting/interface/collect/index.uvue diff --git a/pages/mall/admin/setting/interface/e-sheet.uvue b/pages/mall/admin/setting/interface/e-sheet/index.uvue similarity index 100% rename from pages/mall/admin/setting/interface/e-sheet.uvue rename to pages/mall/admin/setting/interface/e-sheet/index.uvue diff --git a/pages/mall/admin/setting/interface/logistics.uvue b/pages/mall/admin/setting/interface/logistics/index.uvue similarity index 100% rename from pages/mall/admin/setting/interface/logistics.uvue rename to pages/mall/admin/setting/interface/logistics/index.uvue diff --git a/pages/mall/admin/setting/interface/onepass/config.uvue b/pages/mall/admin/setting/interface/onepass/config/index.uvue similarity index 100% rename from pages/mall/admin/setting/interface/onepass/config.uvue rename to pages/mall/admin/setting/interface/onepass/config/index.uvue diff --git a/pages/mall/admin/setting/interface/payment.uvue b/pages/mall/admin/setting/interface/payment/index.uvue similarity index 100% rename from pages/mall/admin/setting/interface/payment.uvue rename to pages/mall/admin/setting/interface/payment/index.uvue diff --git a/pages/mall/admin/setting/interface/sms.uvue b/pages/mall/admin/setting/interface/sms/index.uvue similarity index 100% rename from pages/mall/admin/setting/interface/sms.uvue rename to pages/mall/admin/setting/interface/sms/index.uvue diff --git a/pages/mall/admin/setting/interface/storage.uvue b/pages/mall/admin/setting/interface/storage/index.uvue similarity index 100% rename from pages/mall/admin/setting/interface/storage.uvue rename to pages/mall/admin/setting/interface/storage/index.uvue diff --git a/pages/mall/admin/setting/message.uvue b/pages/mall/admin/setting/message/index.uvue similarity index 100% rename from pages/mall/admin/setting/message.uvue rename to pages/mall/admin/setting/message/index.uvue diff --git a/pages/mall/admin/setting/ticket.uvue b/pages/mall/admin/setting/receipt/index.uvue similarity index 99% rename from pages/mall/admin/setting/ticket.uvue rename to pages/mall/admin/setting/receipt/index.uvue index a1be6ca7..82e9c9ab 100644 --- a/pages/mall/admin/setting/ticket.uvue +++ b/pages/mall/admin/setting/receipt/index.uvue @@ -271,6 +271,8 @@ function handleDelete(item: any) { } .table-cell { + display:flex; + flex-direction: row; font-size: 13px; color: #666; padding: 0 10px; diff --git a/pages/mall/admin/setting/system/admin.uvue b/pages/mall/admin/setting/system/admin.uvue deleted file mode 100644 index eeac527d..00000000 --- a/pages/mall/admin/setting/system/admin.uvue +++ /dev/null @@ -1,82 +0,0 @@ - - - - - diff --git a/pages/mall/admin/setting/system/agreement.uvue b/pages/mall/admin/setting/system/agreement.uvue deleted file mode 100644 index 9c759dd0..00000000 --- a/pages/mall/admin/setting/system/agreement.uvue +++ /dev/null @@ -1,28 +0,0 @@ - - - - - diff --git a/pages/mall/admin/setting/system/config.uvue b/pages/mall/admin/setting/system/index.uvue similarity index 100% rename from pages/mall/admin/setting/system/config.uvue rename to pages/mall/admin/setting/system/index.uvue diff --git a/pages/mall/admin/setting/system/message.uvue b/pages/mall/admin/setting/system/message.uvue deleted file mode 100644 index f91490a6..00000000 --- a/pages/mall/admin/setting/system/message.uvue +++ /dev/null @@ -1,28 +0,0 @@ - - - - - diff --git a/pages/mall/admin/setting/system/role.uvue b/pages/mall/admin/setting/system/role.uvue deleted file mode 100644 index ea401ded..00000000 --- a/pages/mall/admin/setting/system/role.uvue +++ /dev/null @@ -1,82 +0,0 @@ - - - - - diff --git a/pages/mall/admin/setting/system/ticket.uvue b/pages/mall/admin/setting/system/ticket.uvue deleted file mode 100644 index f31a6c03..00000000 --- a/pages/mall/admin/setting/system/ticket.uvue +++ /dev/null @@ -1,28 +0,0 @@ - - - - - diff --git a/pages/mall/admin/statistic/index.uvue b/pages/mall/admin/statistic/index.uvue deleted file mode 100644 index 00b94875..00000000 --- a/pages/mall/admin/statistic/index.uvue +++ /dev/null @@ -1,80 +0,0 @@ - - - - - diff --git a/pages/mall/admin/system/agreement-settings.uvue b/pages/mall/admin/system/agreement-settings.uvue deleted file mode 100644 index 9026791a..00000000 --- a/pages/mall/admin/system/agreement-settings.uvue +++ /dev/null @@ -1,84 +0,0 @@ - - - - diff --git a/pages/mall/admin/system/api/collect.uvue b/pages/mall/admin/system/api/collect.uvue deleted file mode 100644 index 990b8bd3..00000000 --- a/pages/mall/admin/system/api/collect.uvue +++ /dev/null @@ -1,85 +0,0 @@ - - - - - diff --git a/pages/mall/admin/system/api/logistics.uvue b/pages/mall/admin/system/api/logistics.uvue deleted file mode 100644 index 9a0bdb22..00000000 --- a/pages/mall/admin/system/api/logistics.uvue +++ /dev/null @@ -1,85 +0,0 @@ - - - - - diff --git a/pages/mall/admin/system/api/pay.uvue b/pages/mall/admin/system/api/pay.uvue deleted file mode 100644 index 64d228f5..00000000 --- a/pages/mall/admin/system/api/pay.uvue +++ /dev/null @@ -1,85 +0,0 @@ - - - - - diff --git a/pages/mall/admin/system/api/sms.uvue b/pages/mall/admin/system/api/sms.uvue deleted file mode 100644 index 97fd2016..00000000 --- a/pages/mall/admin/system/api/sms.uvue +++ /dev/null @@ -1,85 +0,0 @@ - - - - - diff --git a/pages/mall/admin/system/api/storage.uvue b/pages/mall/admin/system/api/storage.uvue deleted file mode 100644 index 9c733e26..00000000 --- a/pages/mall/admin/system/api/storage.uvue +++ /dev/null @@ -1,85 +0,0 @@ - - - - - diff --git a/pages/mall/admin/system/api/waybill.uvue b/pages/mall/admin/system/api/waybill.uvue deleted file mode 100644 index adcef125..00000000 --- a/pages/mall/admin/system/api/waybill.uvue +++ /dev/null @@ -1,85 +0,0 @@ - - - - - diff --git a/pages/mall/admin/system/api/yht/config.uvue b/pages/mall/admin/system/api/yht/config.uvue deleted file mode 100644 index a661163c..00000000 --- a/pages/mall/admin/system/api/yht/config.uvue +++ /dev/null @@ -1,85 +0,0 @@ - - - - - diff --git a/pages/mall/admin/system/api/yht/page.uvue b/pages/mall/admin/system/api/yht/page.uvue deleted file mode 100644 index b97f1576..00000000 --- a/pages/mall/admin/system/api/yht/page.uvue +++ /dev/null @@ -1,85 +0,0 @@ - - - - - diff --git a/pages/mall/admin/system/index.uvue b/pages/mall/admin/system/index.uvue deleted file mode 100644 index 8450c3b3..00000000 --- a/pages/mall/admin/system/index.uvue +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - diff --git a/pages/mall/admin/system/message-management.uvue b/pages/mall/admin/system/message-management.uvue deleted file mode 100644 index 088b7b4e..00000000 --- a/pages/mall/admin/system/message-management.uvue +++ /dev/null @@ -1,84 +0,0 @@ - - - - diff --git a/pages/mall/admin/system/permission/admin-list.uvue b/pages/mall/admin/system/permission/admin-list.uvue deleted file mode 100644 index f436b979..00000000 --- a/pages/mall/admin/system/permission/admin-list.uvue +++ /dev/null @@ -1,85 +0,0 @@ - - - - - diff --git a/pages/mall/admin/system/permission/permission-setting.uvue b/pages/mall/admin/system/permission/permission-setting.uvue deleted file mode 100644 index 46e27790..00000000 --- a/pages/mall/admin/system/permission/permission-setting.uvue +++ /dev/null @@ -1,85 +0,0 @@ - - - - - diff --git a/pages/mall/admin/system/permission/role.uvue b/pages/mall/admin/system/permission/role.uvue deleted file mode 100644 index d71238a0..00000000 --- a/pages/mall/admin/system/permission/role.uvue +++ /dev/null @@ -1,85 +0,0 @@ - - - - - diff --git a/pages/mall/admin/system/receipt-settings.uvue b/pages/mall/admin/system/receipt-settings.uvue deleted file mode 100644 index fb3f20d1..00000000 --- a/pages/mall/admin/system/receipt-settings.uvue +++ /dev/null @@ -1,84 +0,0 @@ - - - - diff --git a/pages/mall/admin/system/shipping/courier.uvue b/pages/mall/admin/system/shipping/courier.uvue deleted file mode 100644 index 32e33b35..00000000 --- a/pages/mall/admin/system/shipping/courier.uvue +++ /dev/null @@ -1,83 +0,0 @@ - - - - - diff --git a/pages/mall/admin/system/shipping/freight-template.uvue b/pages/mall/admin/system/shipping/freight-template.uvue deleted file mode 100644 index 99dfb37c..00000000 --- a/pages/mall/admin/system/shipping/freight-template.uvue +++ /dev/null @@ -1,83 +0,0 @@ - - - - - diff --git a/pages/mall/admin/system/shipping/pickup/points.uvue b/pages/mall/admin/system/shipping/pickup/points.uvue deleted file mode 100644 index d03cd596..00000000 --- a/pages/mall/admin/system/shipping/pickup/points.uvue +++ /dev/null @@ -1,83 +0,0 @@ - - - - - diff --git a/pages/mall/admin/system/shipping/pickup/verifiers.uvue b/pages/mall/admin/system/shipping/pickup/verifiers.uvue deleted file mode 100644 index 2fdecb43..00000000 --- a/pages/mall/admin/system/shipping/pickup/verifiers.uvue +++ /dev/null @@ -1,83 +0,0 @@ - - - - - diff --git a/pages/mall/admin/trade/trade-statistics/index.uvue b/pages/mall/admin/trade/trade-statistics/index.uvue deleted file mode 100644 index b4cac51e..00000000 --- a/pages/mall/admin/trade/trade-statistics/index.uvue +++ /dev/null @@ -1,28 +0,0 @@ - - - - - diff --git a/pages/mall/admin/user/configuration/index.uvue b/pages/mall/admin/user/config/index.uvue similarity index 100% rename from pages/mall/admin/user/configuration/index.uvue rename to pages/mall/admin/user/config/index.uvue diff --git a/pages/mall/admin/user/grade/card.uvue b/pages/mall/admin/user/grade/card.uvue deleted file mode 100644 index be2a5d4f..00000000 --- a/pages/mall/admin/user/grade/card.uvue +++ /dev/null @@ -1,80 +0,0 @@ - - - - - diff --git a/pages/mall/admin/user/grade/record.uvue b/pages/mall/admin/user/grade/record.uvue deleted file mode 100644 index be19b153..00000000 --- a/pages/mall/admin/user/grade/record.uvue +++ /dev/null @@ -1,80 +0,0 @@ - - - - - diff --git a/pages/mall/admin/user/grade/right.uvue b/pages/mall/admin/user/grade/right.uvue deleted file mode 100644 index 4d36ea24..00000000 --- a/pages/mall/admin/user/grade/right.uvue +++ /dev/null @@ -1,80 +0,0 @@ - - - - - diff --git a/pages/mall/admin/user/grade/type.uvue b/pages/mall/admin/user/grade/type.uvue deleted file mode 100644 index e563d9bb..00000000 --- a/pages/mall/admin/user/grade/type.uvue +++ /dev/null @@ -1,80 +0,0 @@ - - - - - diff --git a/pages/mall/admin/user/user-statistics/index.uvue b/pages/mall/admin/user/user-statistics/index.uvue deleted file mode 100644 index 517a5afa..00000000 --- a/pages/mall/admin/user/user-statistics/index.uvue +++ /dev/null @@ -1,28 +0,0 @@ - - - - - diff --git a/pages/mall/admin/错误信息.txt b/pages/mall/admin/错误信息.txt index 028a708d..6cea33b7 100644 --- a/pages/mall/admin/错误信息.txt +++ b/pages/mall/admin/错误信息.txt @@ -1,4 +1,4 @@ -adminComponentMap.uts:36 GET http://localhost:5173/pages/mall/admin/product/parameters/index.uvue?t=1773717301644&import net::ERR_ABORTED 500 (Internal Server Error) +GET http://localhost:5173/pages/mall/admin/decoration/theme-style/index.uvue?import&vue&type=script&setup=true&lang.uts net::ERR_ABORTED 500 (Internal Server Error) main.uts:16 [Vue warn]: Unhandled error during execution of async component loader at at @@ -97,4 +97,92 @@ initRouter @ uni-h5.es.js:19886 install @ uni-h5.es.js:19955 use @ vue.runtime.esm.js:5190 (anonymous) @ main.uts:16 -main.uts:16 TypeError: Failed to fetch dynamically imported module: http://localhost:5173/pages/mall/admin/homePage/index.uvue?t=1773717331353&import \ No newline at end of file +main.uts:16 TypeError: Failed to fetch dynamically imported module: http://localhost:5173/pages/mall/admin/homePage/index.uvue?t=1773738574287&import +logError @ vue.runtime.esm.js:1443 +errorHandler @ uni-h5.es.js:19600 +callWithErrorHandling @ vue.runtime.esm.js:1381 +handleError @ vue.runtime.esm.js:1421 +onError @ vue.runtime.esm.js:3724 +(anonymous) @ vue.runtime.esm.js:3767 +Promise.catch +setup @ vue.runtime.esm.js:3766 +callWithErrorHandling @ vue.runtime.esm.js:1381 +setupStatefulComponent @ vue.runtime.esm.js:8985 +setupComponent @ vue.runtime.esm.js:8946 +mountComponent @ vue.runtime.esm.js:7262 +processComponent @ vue.runtime.esm.js:7228 +patch @ vue.runtime.esm.js:6694 +mountChildren @ vue.runtime.esm.js:6942 +processFragment @ vue.runtime.esm.js:7158 +patch @ vue.runtime.esm.js:6668 +mountChildren @ vue.runtime.esm.js:6942 +processFragment @ vue.runtime.esm.js:7158 +patch @ vue.runtime.esm.js:6668 +mountChildren @ vue.runtime.esm.js:6942 +mountElement @ vue.runtime.esm.js:6849 +processElement @ vue.runtime.esm.js:6814 +patch @ vue.runtime.esm.js:6682 +mountChildren @ vue.runtime.esm.js:6942 +mountElement @ vue.runtime.esm.js:6849 +processElement @ vue.runtime.esm.js:6814 +patch @ vue.runtime.esm.js:6682 +mountChildren @ vue.runtime.esm.js:6942 +processFragment @ vue.runtime.esm.js:7158 +patch @ vue.runtime.esm.js:6668 +componentUpdateFn @ vue.runtime.esm.js:7372 +run @ vue.runtime.esm.js:153 +instance.update @ vue.runtime.esm.js:7497 +setupRenderEffect @ vue.runtime.esm.js:7507 +mountComponent @ vue.runtime.esm.js:7274 +processComponent @ vue.runtime.esm.js:7228 +patch @ vue.runtime.esm.js:6694 +mountChildren @ vue.runtime.esm.js:6942 +mountElement @ vue.runtime.esm.js:6849 +processElement @ vue.runtime.esm.js:6814 +patch @ vue.runtime.esm.js:6682 +componentUpdateFn @ vue.runtime.esm.js:7372 +run @ vue.runtime.esm.js:153 +instance.update @ vue.runtime.esm.js:7497 +setupRenderEffect @ vue.runtime.esm.js:7507 +mountComponent @ vue.runtime.esm.js:7274 +processComponent @ vue.runtime.esm.js:7228 +patch @ vue.runtime.esm.js:6694 +componentUpdateFn @ vue.runtime.esm.js:7372 +run @ vue.runtime.esm.js:153 +instance.update @ vue.runtime.esm.js:7497 +setupRenderEffect @ vue.runtime.esm.js:7507 +mountComponent @ vue.runtime.esm.js:7274 +processComponent @ vue.runtime.esm.js:7228 +patch @ vue.runtime.esm.js:6694 +componentUpdateFn @ vue.runtime.esm.js:7453 +run @ vue.runtime.esm.js:153 +instance.update @ vue.runtime.esm.js:7497 +updateComponent @ vue.runtime.esm.js:7305 +processComponent @ vue.runtime.esm.js:7239 +patch @ vue.runtime.esm.js:6694 +componentUpdateFn @ vue.runtime.esm.js:7453 +run @ vue.runtime.esm.js:153 +instance.update @ vue.runtime.esm.js:7497 +callWithErrorHandling @ vue.runtime.esm.js:1381 +flushJobs @ vue.runtime.esm.js:1585 +Promise.then +queueFlush @ vue.runtime.esm.js:1494 +queueJob @ vue.runtime.esm.js:1488 +scheduler @ vue.runtime.esm.js:3179 +resetScheduling @ vue.runtime.esm.js:236 +triggerEffects @ vue.runtime.esm.js:280 +triggerRefValue @ vue.runtime.esm.js:1033 +set value @ vue.runtime.esm.js:1078 +finalizeNavigation @ vue-router.mjs?v=ed041164:2474 +(anonymous) @ vue-router.mjs?v=ed041164:2384 +Promise.then +pushWithRedirect @ vue-router.mjs?v=ed041164:2352 +push @ vue-router.mjs?v=ed041164:2278 +install @ vue-router.mjs?v=ed041164:2631 +use @ vue.runtime.esm.js:5190 +initRouter @ uni-h5.es.js:19886 +install @ uni-h5.es.js:19955 +use @ vue.runtime.esm.js:5190 +(anonymous) @ main.uts:16 +index.uvue:1 GET http://localhost:5173/pages/mall/admin/decoration/material-management/index.uvue?import&vue&type=script&setup=true&lang.uts net::ERR_ABORTED 500 (Internal Server Error) +index.uvue:1 GET http://localhost:5173/pages/mall/admin/decoration/link-management/index.uvue?import&vue&type=script&setup=true&lang.uts net::ERR_ABORTED 500 (Internal Server Error) \ No newline at end of file diff --git a/pages/minimal.uvue b/pages/minimal.uvue deleted file mode 100644 index 1cfca8a3..00000000 --- a/pages/minimal.uvue +++ /dev/null @@ -1,29 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/test-minimal.uvue b/pages/test-minimal.uvue deleted file mode 100644 index e360fb92..00000000 --- a/pages/test-minimal.uvue +++ /dev/null @@ -1,16 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages_default_temp.json b/pages_default_temp.json deleted file mode 100644 index 4c86284a..00000000 --- a/pages_default_temp.json +++ /dev/null @@ -1,1320 +0,0 @@ -{ - "pages": [ - { - "path": "pages/mall/admin/homePage/index", - "style": { - "navigationBarTitleText": "绠$悊鍚庡彴", - "navigationStyle": "custom" - } - }, - { - "path": "pages/user/login", - "style": { - "navigationBarTitleText": "鐢ㄦ埛鐧诲綍", - "navigationStyle": "custom" - } - }, - { - "path": "pages/user/boot", - "style": { - "navigationBarTitleText": "" - } - }, - { - "path": "pages/user/register", - "style": { - "navigationBarTitleText": "娉ㄥ唽" - } - }, - { - "path": "pages/user/forgot-password", - "style": { - "navigationBarTitleText": "蹇樿瀵嗙爜" - } - }, - { - "path": "pages/user/terms", - "style": { - "navigationBarTitleText": "鐢ㄦ埛鍗忚涓庨殣绉佹斂绛? - } - }, - { - "path": "pages/user/center", - "style": { - "navigationBarTitleText": "鐢ㄦ埛涓績" - } - }, - { - "path": "pages/user/profile", - "style": { - "navigationBarTitleText": "涓汉璧勬枡" - } - }, - { - "path": "pages/mall/consumer/index", - "style": { - "navigationBarTitleText": "棣栭〉", - "navigationStyle": "custom", - "enablePullDownRefresh": true - } - }, - { - "path": "pages/mall/consumer/category", - "style": { - "navigationBarTitleText": "鍒嗙被" - } - }, - { - "path": "pages/mall/consumer/messages", - "style": { - "navigationBarTitleText": "娑堟伅", - "enablePullDownRefresh": true - } - }, - { - "path": "pages/mall/consumer/cart", - "style": { - "navigationBarTitleText": "璐墿杞? - } - }, - { - "path": "pages/mall/consumer/profile", - "style": { - "navigationBarTitleText": "鎴戠殑" - } - } - ], - "subPackages": [ - { - "root": "pages/mall/consumer", - "pages": [ - { - "path": "settings", - "style": { - "navigationBarTitleText": "璁剧疆" - } - }, - { - "path": "wallet", - "style": { - "navigationBarTitleText": "鎴戠殑閽卞寘" - } - }, - { - "path": "search", - "style": { - "navigationBarTitleText": "鎼滅储", - "navigationStyle": "custom" - } - }, - { - "path": "product-detail", - "style": { - "navigationBarTitleText": "鍟嗗搧璇︽儏" - } - }, - { - "path": "shop-detail", - "style": { - "navigationBarTitleText": "搴楅摵璇︽儏" - } - }, - { - "path": "coupons", - "style": { - "navigationBarTitleText": "鎴戠殑浼樻儬鍒? - } - }, - { - "path": "favorites", - "style": { - "navigationBarTitleText": "鎴戠殑鏀惰棌" - } - }, - { - "path": "footprint", - "style": { - "navigationBarTitleText": "鎴戠殑瓒宠抗" - } - }, - { - "path": "address-list", - "style": { - "navigationBarTitleText": "鏀惰揣鍦板潃" - } - }, - { - "path": "address-edit", - "style": { - "navigationBarTitleText": "缂栬緫鍦板潃" - } - }, - { - "path": "checkout", - "style": { - "navigationBarTitleText": "纭璁㈠崟" - } - }, - { - "path": "payment", - "style": { - "navigationBarTitleText": "鏀堕摱鍙? - } - }, - { - "path": "payment-success", - "style": { - "navigationBarTitleText": "鏀粯鎴愬姛", - "navigationStyle": "custom" - } - }, - { - "path": "orders", - "style": { - "navigationBarTitleText": "鎴戠殑璁㈠崟", - "enablePullDownRefresh": true - } - }, - { - "path": "order-detail", - "style": { - "navigationBarTitleText": "璁㈠崟璇︽儏" - } - }, - { - "path": "logistics", - "style": { - "navigationBarTitleText": "鐗╂祦璇︽儏" - } - }, - { - "path": "review", - "style": { - "navigationBarTitleText": "璇勪环鏅掑崟" - } - }, - { - "path": "refund", - "style": { - "navigationBarTitleText": "閫€娆?鍞悗" - } - }, - { - "path": "apply-refund", - "style": { - "navigationBarTitleText": "鐢宠鍞悗" - } - }, - { - "path": "refund-review", - "style": { - "navigationBarTitleText": "鏈嶅姟璇勪环" - } - }, - { - "path": "chat", - "style": { - "navigationBarTitleText": "瀹㈡湇鑱婂ぉ", - "navigationStyle": "custom" - } - }, - { - "path": "subscription/plan-list", - "style": { - "navigationBarTitleText": "杞欢璁㈤槄" - } - }, - { - "path": "subscription/plan-detail", - "style": { - "navigationBarTitleText": "璁㈤槄璇︽儏" - } - }, - { - "path": "subscription/subscribe-checkout", - "style": { - "navigationBarTitleText": "纭璁㈤槄" - } - }, - { - "path": "subscription/my-subscriptions", - "style": { - "navigationBarTitleText": "鎴戠殑璁㈤槄" - } - } - ] - }, - { - "root": "pages/mall/delivery", - "pages": [ - { - "path": "index", - "style": { - "navigationBarTitleText": "閰嶉€佷腑蹇?, - "navigationStyle": "custom" - } - }, - { - "path": "order-detail", - "style": { - "navigationBarTitleText": "璁㈠崟璇︽儏椤?, - "navigationStyle": "custom" - } - }, - { - "path": "profile", - "style": { - "navigationBarTitleText": "閰嶉€佷釜浜轰腑蹇?, - "navigationStyle": "custom" - } - }, - { - "path": "order-history", - "style": { - "navigationBarTitleText": "鍘嗗彶璁板綍", - "navigationStyle": "custom" - } - }, - { - "path": "earnings", - "style": { - "navigationBarTitleText": "鏀跺叆鏄庣粏", - "navigationStyle": "custom" - } - }, - { - "path": "tasks", - "style": { - "navigationBarTitleText": "鍏ㄩ儴浠诲姟", - "navigationStyle": "custom" - } - }, - { - "path": "task-detail", - "style": { - "navigationBarTitleText": "浠诲姟璇︽儏", - "navigationStyle": "custom" - } - }, - { - "path": "profile-edit", - "style": { - "navigationBarTitleText": "缂栬緫涓汉璧勬枡", - "navigationStyle": "custom" - } - }, - { - "path": "ratings", - "style": { - "navigationBarTitleText": "璇勪环", - "navigationStyle": "custom" - } - }, - { - "path": "vehicle", - "style": { - "navigationBarTitleText": "杞﹁締绠$悊", - "navigationStyle": "custom" - } - }, - { - "path": "vehicle-add", - "style": { - "navigationBarTitleText": "娣诲姞杞﹁締", - "navigationStyle": "custom" - } - }, - { - "path": "vehicle-edit", - "style": { - "navigationBarTitleText": "缂栬緫杞﹁締", - "navigationStyle": "custom" - } - }, - { - "path": "settings", - "style": { - "navigationBarTitleText": "璁剧疆", - "navigationStyle": "custom" - } - } - ] - }, - { - "root": "pages/mall/analytics", - "pages": [ - { - "path": "index", - "style": { - "navigationBarTitleText": "鏁版嵁鍒嗘瀽", - "navigationStyle": "custom" - } - }, - { - "path": "profile", - "style": { - "navigationBarTitleText": "鏁版嵁鍒嗘瀽涓汉涓績" - } - }, - { - "path": "sales-report", - "style": { - "navigationBarTitleText": "閿€鍞姤琛? - } - }, - { - "path": "user-analysis", - "style": { - "navigationBarTitleText": "鐢ㄦ埛鍒嗘瀽" - } - }, - { - "path": "product-insights", - "style": { - "navigationBarTitleText": "鍟嗗搧娲炲療" - } - }, - { - "path": "delivery-analysis", - "style": { - "navigationBarTitleText": "閰嶉€佹晥鐜囧垎鏋? - } - }, - { - "path": "coupon-analysis", - "style": { - "navigationBarTitleText": "浼樻儬鍒告晥鏋滃垎鏋? - } - }, - { - "path": "market-trends", - "style": { - "navigationBarTitleText": "甯傚満瓒嬪娍" - } - }, - { - "path": "custom-report", - "style": { - "navigationBarTitleText": "鑷畾涔夋姤琛? - } - }, - { - "path": "report-detail", - "style": { - "navigationBarTitleText": "鎶ヨ〃璇︽儏", - "enablePullDownRefresh": false - } - }, - { - "path": "data-detail", - "style": { - "navigationBarTitleText": "鏁版嵁鍒嗘瀽璇︽儏", - "enablePullDownRefresh": false - } - }, - { - "path": "insight-detail", - "style": { - "navigationBarTitleText": "鏁版嵁娲炲療璇︽儏", - "enablePullDownRefresh": false - } - }, - { - "path": "test/test-connection", - "style": { - "navigationBarTitleText": "Supabase 杩炴帴娴嬭瘯" - } - } - ] - }, - { - "root": "pages/mall/admin", - "pages": [ - { - "path": "content/index", - "style": { - "navigationBarTitleText": "鏂囩珷绠$悊", - "navigationStyle": "custom" - } - }, - { - "path": "article/index", - "style": { - "navigationBarTitleText": "鏂囩珷绠$悊", - "navigationStyle": "custom" - } - }, - { - "path": "article/category", - "style": { - "navigationBarTitleText": "鏂囩珷鍒嗙被", - "navigationStyle": "custom" - } - }, - { - "path": "article/create", - "style": { - "navigationBarTitleText": "娣诲姞鏂囩珷", - "navigationStyle": "custom" - } - }, - { - "path": "article/edit", - "style": { - "navigationBarTitleText": "缂栬緫鏂囩珷", - "navigationStyle": "custom" - } - }, - - { - "path": "service/index", - "style": { - "navigationBarTitleText": "瀹㈡湇鍒楄〃", - "navigationStyle": "custom" - } - }, - { - "path": "service/script", - "style": { - "navigationBarTitleText": "瀹㈡湇璇濇湳", - "navigationStyle": "custom" - } - }, - { - "path": "service/message", - "style": { - "navigationBarTitleText": "鐢ㄦ埛鐣欒█", - "navigationStyle": "custom" - } - }, - { - "path": "service/autoReply", - "style": { - "navigationBarTitleText": "鑷姩鍥炲", - "navigationStyle": "custom" - } - }, - { - "path": "service/config", - "style": { - "navigationBarTitleText": "瀹㈡湇閰嶇疆", - "navigationStyle": "custom" - } - }, - - { - "path": "design/index", - "style": { - "navigationBarTitleText": "椤甸潰瑁呬慨", - "navigationStyle": "custom" - } - }, - { - "path": "design/homepage", - "style": { - "navigationBarTitleText": "棣栭〉瑁呬慨", - "navigationStyle": "custom" - } - }, - { - "path": "design/category", - "style": { - "navigationBarTitleText": "鍒嗙被椤佃淇?, - "navigationStyle": "custom" - } - }, - { - "path": "design/product", - "style": { - "navigationBarTitleText": "鍟嗗搧椤佃淇?, - "navigationStyle": "custom" - } - }, - { - "path": "design/custom", - "style": { - "navigationBarTitleText": "鑷畾涔夐〉闈?, - "navigationStyle": "custom" - } - }, - { - "path": "design/templates", - "style": { - "navigationBarTitleText": "妯℃澘搴?, - "navigationStyle": "custom" - } - }, - { - "path": "design/components", - "style": { - "navigationBarTitleText": "缁勪欢搴?, - "navigationStyle": "custom" - } - }, - { - "path": "maintain/data/city-data", - "style": { - "navigationBarTitleText": "鍩庡競鏁版嵁", - "navigationStyle": "custom" - } - }, - { - "path": "maintain/data/clear-data", - "style": { - "navigationBarTitleText": "娓呴櫎鏁版嵁", - "navigationStyle": "custom" - } - }, - { - "path": "maintain/data/logistics-company", - "style": { - "navigationBarTitleText": "鐗╂祦鍏徃", - "navigationStyle": "custom" - } - }, - { - "path": "maintain/dev-config/category", - "style": { - "navigationBarTitleText": "閰嶇疆鍒嗙被", - "navigationStyle": "custom" - } - }, - { - "path": "maintain/dev-config/combination-data", - "style": { - "navigationBarTitleText": "缁勫悎鏁版嵁", - "navigationStyle": "custom" - } - }, - { - "path": "maintain/dev-config/cron-job", - "style": { - "navigationBarTitleText": "瀹氭椂浠诲姟", - "navigationStyle": "custom" - } - }, - { - "path": "maintain/dev-config/custom-event", - "style": { - "navigationBarTitleText": "鑷畾浜嬩欢", - "navigationStyle": "custom" - } - }, - { - "path": "maintain/dev-config/module-config", - "style": { - "navigationBarTitleText": "妯″潡閰嶇疆", - "navigationStyle": "custom" - } - }, - { - "path": "maintain/dev-config/permission", - "style": { - "navigationBarTitleText": "鏉冮檺缁存姢", - "navigationStyle": "custom" - } - }, - { - "path": "maintain/dev-tools/api", - "style": { - "navigationBarTitleText": "鎺ュ彛绠$悊", - "navigationStyle": "custom" - } - }, - { - "path": "maintain/dev-tools/codegen", - "style": { - "navigationBarTitleText": "浠g爜鐢熸垚", - "navigationStyle": "custom" - } - }, - { - "path": "maintain/dev-tools/data-dict", - "style": { - "navigationBarTitleText": "鏁版嵁瀛楀吀", - "navigationStyle": "custom" - } - }, - { - "path": "maintain/dev-tools/database", - "style": { - "navigationBarTitleText": "鏁版嵁搴撶鐞?, - "navigationStyle": "custom" - } - }, - { - "path": "maintain/dev-tools/file", - "style": { - "navigationBarTitleText": "鏂囦欢绠$悊", - "navigationStyle": "custom" - } - }, - { - "path": "maintain/external/account", - "style": { - "navigationBarTitleText": "璐﹀彿绠$悊", - "navigationStyle": "custom" - } - }, - { - "path": "maintain/i18n/language-detail", - "style": { - "navigationBarTitleText": "璇█璇︽儏", - "navigationStyle": "custom" - } - }, - { - "path": "maintain/i18n/language-list", - "style": { - "navigationBarTitleText": "璇█鍒楄〃", - "navigationStyle": "custom" - } - }, - { - "path": "maintain/i18n/region-list", - "style": { - "navigationBarTitleText": "鍦板尯鍒楄〃", - "navigationStyle": "custom" - } - }, - { - "path": "maintain/i18n/translate-config", - "style": { - "navigationBarTitleText": "缈昏瘧閰嶇疆", - "navigationStyle": "custom" - } - }, - { - "path": "maintain/security/online-upgrade", - "style": { - "navigationBarTitleText": "鍦ㄧ嚎鍗囩骇", - "navigationStyle": "custom" - } - }, - { - "path": "maintain/security/refresh-cache", - "style": { - "navigationBarTitleText": "鍒锋柊缂撳瓨", - "navigationStyle": "custom" - } - }, - { - "path": "maintain/security/system-log", - "style": { - "navigationBarTitleText": "绯荤粺鏃ュ織", - "navigationStyle": "custom" - } - }, - { - "path": "maintain/system-info", - "style": { - "navigationBarTitleText": "绯荤粺淇℃伅", - "navigationStyle": "custom" - } - }, - { - "path": "marketing/index", - "style": { - "navigationBarTitleText": "钀ラ攢绠$悊", - "navigationStyle": "custom" - } - }, - - { - "path": "marketing/coupon/list", - "style": { - "navigationBarTitleText": "浼樻儬鍒稿垪琛?, - "navigationStyle": "custom" - } - }, - { - "path": "marketing/coupon/receive", - "style": { - "navigationBarTitleText": "鐢ㄦ埛棰嗗彇璁板綍", - "navigationStyle": "custom" - } - }, - - { - "path": "marketing/points/index", - "style": { - "navigationBarTitleText": "绉垎绠$悊", - "navigationStyle": "custom" - } - }, - - { - "path": "marketing/points/stats", - "style": { - "navigationBarTitleText": "绉垎缁熻", - "navigationStyle": "custom" - } - }, - { - "path": "marketing/points/goods", - "style": { - "navigationBarTitleText": "绉垎鍟嗗搧", - "navigationStyle": "custom" - } - }, - { - "path": "marketing/points/order", - "style": { - "navigationBarTitleText": "绉垎璁㈠崟", - "navigationStyle": "custom" - } - }, - { - "path": "marketing/points/record", - "style": { - "navigationBarTitleText": "绉垎璁板綍", - "navigationStyle": "custom" - } - }, - { - "path": "marketing/points/config", - "style": { - "navigationBarTitleText": "绉垎閰嶇疆", - "navigationStyle": "custom" - } - }, - - { - "path": "marketing/lottery/list", - "style": { - "navigationBarTitleText": "鎶藉鍒楄〃", - "navigationStyle": "custom" - } - }, - { - "path": "marketing/lottery/config", - "style": { - "navigationBarTitleText": "鎶藉閰嶇疆", - "navigationStyle": "custom" - } - }, - - { - "path": "marketing/groupbuy/goods", - "style": { - "navigationBarTitleText": "鎷煎洟鍟嗗搧", - "navigationStyle": "custom" - } - }, - { - "path": "marketing/groupbuy/list", - "style": { - "navigationBarTitleText": "鎷煎洟鍒楄〃", - "navigationStyle": "custom" - } - }, - - { - "path": "marketing/seckill/goods", - "style": { - "navigationBarTitleText": "绉掓潃鍟嗗搧", - "navigationStyle": "custom" - } - }, - { - "path": "marketing/seckill/list", - "style": { - "navigationBarTitleText": "绉掓潃鍒楄〃", - "navigationStyle": "custom" - } - }, - { - "path": "marketing/seckill/config", - "style": { - "navigationBarTitleText": "绉掓潃閰嶇疆", - "navigationStyle": "custom" - } - }, - - { - "path": "marketing/member/type", - "style": { - "navigationBarTitleText": "浼氬憳绫诲瀷", - "navigationStyle": "custom" - } - }, - { - "path": "marketing/member/rights", - "style": { - "navigationBarTitleText": "浼氬憳鏉冪泭", - "navigationStyle": "custom" - } - }, - { - "path": "marketing/member/card", - "style": { - "navigationBarTitleText": "鍗″瘑浼氬憳", - "navigationStyle": "custom" - } - }, - { - "path": "marketing/member/record", - "style": { - "navigationBarTitleText": "浼氬憳璁板綍", - "navigationStyle": "custom" - } - }, - { - "path": "marketing/member/config", - "style": { - "navigationBarTitleText": "浼氬憳閰嶇疆", - "navigationStyle": "custom" - } - }, - - { - "path": "marketing/live/room", - "style": { - "navigationBarTitleText": "鐩存挱闂寸鐞?, - "navigationStyle": "custom" - } - }, - { - "path": "marketing/live/goods", - "style": { - "navigationBarTitleText": "鐩存挱鍟嗗搧绠$悊", - "navigationStyle": "custom" - } - }, - { - "path": "marketing/live/anchor", - "style": { - "navigationBarTitleText": "涓绘挱绠$悊", - "navigationStyle": "custom" - } - }, - - { - "path": "marketing/recharge/amount", - "style": { - "navigationBarTitleText": "鍏呭€奸噾棰濊缃?, - "navigationStyle": "custom" - } - }, - { - "path": "marketing/recharge/config", - "style": { - "navigationBarTitleText": "鍏呭€奸厤缃?, - "navigationStyle": "custom" - } - }, - { - "path": "marketing/recharge/record", - "style": { - "navigationBarTitleText": "鍏呭€艰褰?, - "navigationStyle": "custom" - } - }, - - { - "path": "marketing/signin/rule", - "style": { - "navigationBarTitleText": "绛惧埌瑙勫垯", - "navigationStyle": "custom" - } - }, - { - "path": "marketing/signin/record", - "style": { - "navigationBarTitleText": "绛惧埌璁板綍", - "navigationStyle": "custom" - } - }, - - { - "path": "marketing/newcomer", - "style": { - "navigationBarTitleText": "鏂颁汉绀?, - "navigationStyle": "custom" - } - }, - - { - "path": "order/order-statistics/index", - "style": { - "navigationBarTitleText": "璁㈠崟缁熻", - "navigationStyle": "custom" - } - }, - { - "path": "order/order-management/index", - "style": { - "navigationBarTitleText": "璁㈠崟绠$悊", - "navigationStyle": "custom" - } - }, - { - "path": "order/aftersales-order/index", - "style": { - "navigationBarTitleText": "鍞悗璁㈠崟", - "navigationStyle": "custom" - } - }, - { - "path": "order/cashier-order/index", - "style": { - "navigationBarTitleText": "鏀堕摱璁㈠崟", - "navigationStyle": "custom" - } - }, - { - "path": "order/write-off-records/index", - "style": { - "navigationBarTitleText": "鏍搁攢璁板綍", - "navigationStyle": "custom" - } - }, - { - "path": "order/order-configuration/index", - "style": { - "navigationBarTitleText": "璁㈠崟閰嶇疆", - "navigationStyle": "custom" - } - }, - { - "path": "product/product-classification/index", - "style": { - "navigationBarTitleText": "鍟嗗搧鍒嗙被", - "navigationStyle": "custom" - } - }, - { - "path": "product/product-label/index", - "style": { - "navigationBarTitleText": "鍟嗗搧鏍囩", - "navigationStyle": "custom" - } - }, - { - "path": "product/product-management/index", - "style": { - "navigationBarTitleText": "鍟嗗搧绠$悊", - "navigationStyle": "custom" - } - }, - { - "path": "product/product-param/index", - "style": { - "navigationBarTitleText": "鍟嗗搧鍙傛暟", - "navigationStyle": "custom" - } - }, - { - "path": "product/product-protection/index", - "style": { - "navigationBarTitleText": "鍟嗗搧淇濋殰", - "navigationStyle": "custom" - } - }, - { - "path": "product/product-reviews/index", - "style": { - "navigationBarTitleText": "鍟嗗搧瀹℃牳" - } - }, - { - "path": "product/product-specifications/index", - "style": { - "navigationBarTitleText": "鍟嗗搧瑙勬牸", - "navigationStyle": "custom" - } - }, - { - "path": "product/product-statistics/index", - "style": { - "navigationBarTitleText": "鍟嗗搧缁熻", - "navigationStyle": "custom" - } - }, - - { - "path": "subscription/plan-management", - "style": { - "navigationBarTitleText": "璁㈤槄鏂规绠$悊" - } - }, - { - "path": "subscription/user-subscriptions", - "style": { - "navigationBarTitleText": "鐢ㄦ埛璁㈤槄绠$悊" - } - }, - { - "path": "system/index", - "style": { - "navigationBarTitleText": "绯荤粺璁剧疆", - "navigationStyle": "custom" - } - }, - { - "path": "system/agreement-settings", - "style": { - "navigationBarTitleText": "鍗忚璁剧疆", - "navigationStyle": "custom" - } - }, - { - "path": "system/api/collect", - "style": { - "navigationBarTitleText": "鍟嗗搧閲囬泦閰嶇疆", - "navigationStyle": "custom" - } - }, - { - "path": "system/api/logistics", - "style": { - "navigationBarTitleText": "鐗╂祦鏌ヨ閰嶇疆", - "navigationStyle": "custom" - } - }, - { - "path": "system/api/pay", - "style": { - "navigationBarTitleText": "鍟嗗煄鏀粯閰嶇疆", - "navigationStyle": "custom" - } - }, - { - "path": "system/api/sms", - "style": { - "navigationBarTitleText": "鐭俊鎺ュ彛閰嶇疆", - "navigationStyle": "custom" - } - }, - { - "path": "system/api/storage", - "style": { - "navigationBarTitleText": "绯荤粺瀛樺偍閰嶇疆", - "navigationStyle": "custom" - } - }, - { - "path": "system/api/waybill", - "style": { - "navigationBarTitleText": "鐢靛瓙闈㈠崟閰嶇疆", - "navigationStyle": "custom" - } - }, - { - "path": "system/api/yht/config", - "style": { - "navigationBarTitleText": "涓€鍙烽€氶厤缃?, - "navigationStyle": "custom" - } - }, - { - "path": "system/api/yht/page", - "style": { - "navigationBarTitleText": "涓€鍙烽€氶〉闈?, - "navigationStyle": "custom" - } - }, - { - "path": "system/message-management", - "style": { - "navigationBarTitleText": "娑堟伅绠$悊", - "navigationStyle": "custom" - } - }, - { - "path": "system/permission/admin-list", - "style": { - "navigationBarTitleText": "绠$悊鍛樺垪琛?, - "navigationStyle": "custom" - } - }, - { - "path": "system/permission/permission-setting", - "style": { - "navigationBarTitleText": "鏉冮檺璁剧疆", - "navigationStyle": "custom" - } - }, - { - "path": "system/permission/role", - "style": { - "navigationBarTitleText": "瑙掕壊绠$悊", - "navigationStyle": "custom" - } - }, - { - "path": "system/receipt-settings", - "style": { - "navigationBarTitleText": "灏忕エ閰嶇疆", - "navigationStyle": "custom" - } - }, - { - "path": "system/shipping/courier", - "style": { - "navigationBarTitleText": "閰嶉€佸憳绠$悊", - "navigationStyle": "custom" - } - }, - { - "path": "system/shipping/freight-template", - "style": { - "navigationBarTitleText": "杩愯垂妯℃澘", - "navigationStyle": "custom" - } - }, - { - "path": "system/shipping/pickup/points", - "style": { - "navigationBarTitleText": "鎻愯揣鐐?, - "navigationStyle": "custom" - } - }, - { - "path": "system/shipping/pickup/verifiers", - "style": { - "navigationBarTitleText": "鏍搁攢鍛?, - "navigationStyle": "custom" - } - }, - { - "path": "user/user-management/index", - "style": { - "navigationBarTitleText": "鐢ㄦ埛绠$悊", - "navigationStyle": "custom" - } - }, - { - "path": "user/user-grouping/index", - "style": { - "navigationBarTitleText": "鐢ㄦ埛鍒嗙粍", - "navigationStyle": "custom" - } - }, - { - "path": "user/user-label/index", - "style": { - "navigationBarTitleText": "鐢ㄦ埛鏍囩", - "navigationStyle": "custom" - } - }, - { - "path": "user/user-level/index", - "style": { - "navigationBarTitleText": "鐢ㄦ埛绛夌骇", - "navigationStyle": "custom" - } - }, - { - "path": "user/user-configuration/index", - "style": { - "navigationBarTitleText": "鐢ㄦ埛閰嶇疆", - "navigationStyle": "custom" - } - }, - { - "path": "user/user-statistics/index", - "style": { - "navigationBarTitleText": "鐢ㄦ埛缁熻", - "navigationStyle": "custom" - } - } - ] - }, - { - "root": "pages/mall/merchant", - "pages": [ - { - "path": "index", - "style": { - "navigationBarTitleText": "鍟嗗涓績", - "navigationStyle": "custom" - } - }, - { - "path": "product-detail", - "style": { - "navigationBarTitleText": "鍟嗗搧绠$悊璇︽儏", - "enablePullDownRefresh": false - } - }, - { - "path": "profile", - "style": { - "navigationBarTitleText": "涓汉璧勬枡" - } - } - ] - }, - { - "root": "pages/mall/service", - "pages": [ - { - "path": "index", - "style": { - "navigationBarTitleText": "瀹㈡湇宸ヤ綔鍙?, - "navigationStyle": "custom" - } - }, - { - "path": "profile", - "style": { - "navigationBarTitleText": "瀹㈡湇涓汉涓績" - } - }, - { - "path": "ticket-detail", - "style": { - "navigationBarTitleText": "宸ュ崟璇︽儏", - "enablePullDownRefresh": false - } - } - ] - } - ], - "tabBar": { - "color": "#999999", - "selectedColor": "#ff5000", - "backgroundColor": "#ffffff", - "borderStyle": "black", - "list": [ - { - "pagePath": "pages/mall/consumer/index", - "text": "棣栭〉", - "iconPath": "static/tabbar/home.png", - "selectedIconPath": "static/tabbar/home-active.png" - }, - { - "pagePath": "pages/mall/consumer/category", - "text": "鍒嗙被", - "iconPath": "static/tabbar/category.png", - "selectedIconPath": "static/tabbar/category-active.png" - }, - { - "pagePath": "pages/mall/consumer/messages", - "text": "娑堟伅", - "iconPath": "static/tabbar/messages.png", - "selectedIconPath": "static/tabbar/messages-active.png" - }, - { - "pagePath": "pages/mall/consumer/cart", - "text": "璐墿杞?, - "iconPath": "static/tabbar/cart.png", - "selectedIconPath": "static/tabbar/cart-active.png" - }, - { - "pagePath": "pages/mall/consumer/profile", - "text": "鎴戠殑", - "iconPath": "static/tabbar/profile.png", - "selectedIconPath": "static/tabbar/profile-active.png" - } - ] - }, - "globalStyle": { - "navigationBarTextStyle": "black", - "navigationBarTitleText": "mall", - "navigationBarBackgroundColor": "#FFFFFF", - "backgroundColor": "#F8F8F8" - } -} - diff --git a/platformConfig.json b/platformConfig.json index 482d68a5..896f669a 100644 --- a/platformConfig.json +++ b/platformConfig.json @@ -1,3 +1,5 @@ + +// 参考链接 https://doc.dcloud.net.cn/uni-app-x/tutorial/ls-plugin.html#setting { "targets": [ "APP-ANDROID" diff --git a/process.py b/process.py deleted file mode 100644 index 3f47cb72..00000000 --- a/process.py +++ /dev/null @@ -1,35 +0,0 @@ -import re - -with open(r'c:\Users\黄镇堡\AppData\Roaming\Code\User\workspaceStorage\51c4c3615fa7807ba1c5a788ca077b83\GitHub.copilot-chat\chat-session-resources\18954447-db08-4bea-a5c4-72e8c9aaf171\call_MHxIMm13YmUwWkdUcjI5b3pueHM__vscode-1773276031647\content.txt', 'r', encoding='utf-8') as f: - text = f.read() - -auth_lines = [] -bz_lines = [] - -auth_kw = ['token', 'user', 'role', 'merchant', 'admin', 'auth', 'id'] - -for line in text.split('\n'): - if not line.strip(): continue - - match = re.match(r'^([a-zA-Z]:\\.*?):(\d+):\s*(.*)$', line) - if match: - path = match.group(1) - lineno = match.group(2) - content = match.group(3) - fname = path.split(r'\\')[-1] - - is_auth = any(k in content.lower() for k in auth_kw) - output = f'{fname}:{lineno}: {content}' - if is_auth: - auth_lines.append(output) - else: - bz_lines.append(output) - -print(f'=== AUTH CACHE USAGES ===') -for l in auth_lines: - if 'ak-req.uts' not in l and 'aksupa.uts' not in l: - print(l[:100]) - -print(f'\n=== BZ CACHE USAGES (first 20) ===') -for l in bz_lines[:20]: - print(l[:100]) diff --git a/search_user_id.py b/search_user_id.py deleted file mode 100644 index a40817b8..00000000 --- a/search_user_id.py +++ /dev/null @@ -1,14 +0,0 @@ -import os -for root, dirs, files in os.walk(r'd:\骅锋\mall'): - if 'node_modules' in root or '.git' in root or 'unpackage' in root: continue - for f in files: - if f.endswith(('.uts', '.uvue')): - path = os.path.join(root, f) - with open(path, 'r', encoding='utf-8') as file: - try: - lines = file.readlines() - for i, l in enumerate(lines): - if 'setStorageSync' in l and 'user_id' in l: - print(f'{path}:{i+1}: {l.strip()}') - except: - pass diff --git a/update_header.py b/update_header.py deleted file mode 100644 index ba451274..00000000 --- a/update_header.py +++ /dev/null @@ -1,64 +0,0 @@ -import codecs - -path = r'd:\骅锋\mall\layouts\admin\components\AdminHeader.uvue' -with codecs.open(path, 'r', 'utf-8') as f: - text = f.read() - -# Replace logout logic -old_logout = '''function handleLogout(e: any) { - if (e && typeof e.stopPropagation === 'function') { - e.stopPropagation() - } - showUserMenu.value = false - uni.showModal({ - title: '提示', - content: '确定要退出登录吗?', - success: (res) => { - if (res.confirm) { - logout() - uni.removeStorageSync('adminRole') - uni.removeStorageSync('token') - // Force the layout cleanup to wait for the dialog to disappear - setTimeout(() => { - uni.reLaunch({ - url: '/pages/user/login' - }) - }, 300) - } - } - }) -}''' - -new_logout = '''import { clearAdminRoleCache } from '@/layouts/admin/utils/role.uts' - -function handleLogout(e: any) { - if (e && typeof e.stopPropagation === 'function') { - e.stopPropagation() - } - showUserMenu.value = false - uni.showModal({ - title: '提示', - content: '确定要退出登录吗?', - success: (res) => { - if (res.confirm) { - logout() - clearAdminRoleCache() - uni.removeStorageSync('token') - // Force the layout cleanup to wait for the dialog to disappear - setTimeout(() => { - uni.reLaunch({ - url: '/pages/user/login' - }) - }, 300) - } - } - }) -}''' - -if old_logout in text: - text = text.replace(old_logout, new_logout) - with codecs.open(path, 'w', 'utf-8') as f: - f.write(text) - print("AdminHeader logout logic updated.") -else: - print("AdminHeader target old snippet not found.") diff --git a/update_header2.py b/update_header2.py deleted file mode 100644 index 69dd0e13..00000000 --- a/update_header2.py +++ /dev/null @@ -1,17 +0,0 @@ -import codecs -import re - -path = r'd:\骅锋\mall\layouts\admin\components\AdminHeader.uvue' -with codecs.open(path, 'r', 'utf-8') as f: - text = f.read() - -# Replace uni.removeStorageSync('adminRole') with clearAdminRoleCache() -# Add import if missing -if 'clearAdminRoleCache' not in text: - text = text.replace("import { state, logout } from '@/utils/store.uts'", "import { state, logout } from '@/utils/store.uts'\nimport { clearAdminRoleCache } from '@/layouts/admin/utils/role.uts'") - -text = text.replace("uni.removeStorageSync('adminRole')", "clearAdminRoleCache()") - -with codecs.open(path, 'w', 'utf-8') as f: - f.write(text) -print("Updated via direct string replace") diff --git a/update_layout.py b/update_layout.py deleted file mode 100644 index 18adb636..00000000 --- a/update_layout.py +++ /dev/null @@ -1,22 +0,0 @@ -import codecs - -path = r'd:\骅锋\mall\layouts\admin\AdminLayout.uvue' -with codecs.open(path, 'r', 'utf-8') as f: - text = f.read() - -if 'refreshAdminRole' not in text: - text = text.replace("import { hasAdminModuleAccess } from '@/layouts/admin/utils/role.uts'", "import { hasAdminModuleAccess, refreshAdminRole } from '@/layouts/admin/utils/role.uts'") - - insert_code = '''onMounted(async () => { - // 核心修复:挂载时强制刷新一下角色(异步获取 ak_users/metadata 并覆盖缓存) - await refreshAdminRole() - - initNavState()''' - - text = text.replace("onMounted(() => {\n initNavState()", insert_code) - - with codecs.open(path, 'w', 'utf-8') as f: - f.write(text) - print("AdminLayout updated with refreshAdminRole.") -else: - print("AdminLayout already updated.") diff --git a/update_layout2.py b/update_layout2.py deleted file mode 100644 index 56ca27d2..00000000 --- a/update_layout2.py +++ /dev/null @@ -1,20 +0,0 @@ -import codecs -import re - -path = r'd:\骅锋\mall\layouts\admin\AdminLayout.uvue' -with codecs.open(path, 'r', 'utf-8') as f: - text = f.read() - -if 'refreshAdminRole' not in text: - text = text.replace("import { hasAdminModuleAccess", "import { hasAdminModuleAccess, refreshAdminRole") - - # regex replace onMounted(() => { \s* initNavState() - text = re.sub(r'onMounted\(\(\) => \{\s+initNavState\(\)', - "onMounted(async () => {\n await refreshAdminRole()\n initNavState()", - text) - - with codecs.open(path, 'w', 'utf-8') as f: - f.write(text) - print("AdminLayout regex updated.") -else: - print("Already there.") diff --git a/update_layout3.py b/update_layout3.py deleted file mode 100644 index e6981cda..00000000 --- a/update_layout3.py +++ /dev/null @@ -1,19 +0,0 @@ -import codecs -import re - -path = r'd:\骅锋\mall\layouts\admin\AdminLayout.uvue' -with codecs.open(path, 'r', 'utf-8') as f: - text = f.read() - -# Make sure we add the await -if 'await refreshAdminRole()' not in text: - text = re.sub(r'onMounted\(\(\) => \{\s+initNavState\(\)', - "onMounted(async () => {\n await refreshAdminRole()\n initNavState()", - text) - - with codecs.open(path, 'w', 'utf-8') as f: - f.write(text) - print("Injected await refreshAdminRole()") -else: - print("Await already present.") - diff --git a/update_login.py b/update_login.py deleted file mode 100644 index 4c7a91bb..00000000 --- a/update_login.py +++ /dev/null @@ -1,106 +0,0 @@ -import codecs -import re - -path = r'd:\骅锋\mall\pages\user\login.uvue' -with codecs.open(path, 'r', 'utf-8') as f: - text = f.read() - -# Replace the checkMerchantAccess function and related logic - -old_func_start = "const checkMerchantAccess = async (uid: string, rawEmail: string) : Promise => {" -old_func_end_marker = "const codeDisabled = ref(false)" - -func_start_idx = text.find(old_func_start) -func_end_idx = text.find(old_func_end_marker) - -if func_start_idx != -1 and func_end_idx != -1: - new_func = '''const checkAdminOrMerchantAccess = async (uid: string, rawEmail: string) : Promise => { - const email = rawEmail.trim().toLowerCase() - console.log(🔍 开始校验后台或商家端角色 -> UID: , Email: ) - - const parseRoleData = (dataArray: any | null): UTSJSONObject | null => { - if (Array.isArray(dataArray) && dataArray.length > 0) { - const obj = dataArray[0] as UTSJSONObject - const role = obj.getString('role') - const id = obj.getString('id') - console.log('✅ 匹配成功,role:', role) - if ((role === 'merchant' || role === 'admin') && id != null) { - return { id, role } as UTSJSONObject - } - } - return null - } - - try { - // 1. 尝试按 auth_id 查询 - let res = await supa.from('ak_users').select('id, role').eq('auth_id', uid).execute() - let parsed = parseRoleData(res.data) - if (parsed != null) return parsed - - // 2. 尝试按 id 查询 (兼容老数据) - res = await supa.from('ak_users').select('id, role').eq('id', uid).execute() - parsed = parseRoleData(res.data) - if (parsed != null) return parsed - - // 3. 尝试按 email 兜底查询 - if (email !== '') { - res = await supa.from('ak_users').select('id, role').eq('email', email).execute() - const dataArray = res.data - if (Array.isArray(dataArray) && dataArray.length > 1) { - console.error('⚠️ 警告: 按 email 查到多条 ak_users 记录,取第一条校验。Email:', email) - } - parsed = parseRoleData(dataArray) - if (parsed != null) return parsed - } - - console.error('❌ 未能在 ak_users 中找到该用户的有效角色记录') - throw new Error('NOT_REGISTERED') - } catch (e) { - console.error('❌ 查询角色过程异常:', e) - if (e instanceof Error && e.message === 'NOT_REGISTERED') { - throw new Error('该账户无后台或商家端权限,请联系管理员核对') - } - throw new Error('后台身份校验失败,请联系管理员检查用户数据') - } -} - -''' - - text = text[:func_start_idx] + new_func + text[func_end_idx:] - -# Replace the usage in handleLogin -old_usage = ''' const merchantId = await checkMerchantAccess(sessionUid, account.value) - if (merchantId == null) { - await supa.signOut() - logout() - throw new Error('您还没有注册商家端账户,快去注册一个') - } - - // 存入商家ID - uni.setStorageSync('merchant_id', merchantId)''' - -new_usage = ''' const accessData = await checkAdminOrMerchantAccess(sessionUid, account.value) - if (accessData == null) { - await supa.signOut() - logout() - throw new Error('该账户无后台或商家端权限') - } - - const currRole = accessData.getString('role') - const currId = accessData.getString('id') - uni.setStorageSync('adminRole', currRole) - - if (currRole === 'merchant') { - uni.setStorageSync('merchant_id', currId) - } else { - uni.removeStorageSync('merchant_id') - }''' - -if 'checkMerchantAccess' in text: - print("WARNING: checkMerchantAccess still found after replace, let's substitute directly") - text = text.replace(old_usage, new_usage) - -with codecs.open(path, 'w', 'utf-8') as f: - f.write(text) - -print("Updated login.uvue successfully.") diff --git a/update_role.py b/update_role.py deleted file mode 100644 index 325f77c5..00000000 --- a/update_role.py +++ /dev/null @@ -1,146 +0,0 @@ -import codecs - -content = '''import { state, getCurrentUser } from '@/utils/store.uts' -import supa from '@/components/supadb/aksupainstance.uts' - -/** - * 将任意角色类型的原始值格式化为标准化的应用角色 - */ -export function normalizeRole(rawRole: any | null): string { - if (rawRole == null || rawRole === undefined) return 'unknown' - const roleStr = String(rawRole).trim().toLowerCase() - if (roleStr === 'admin') return 'admin' - if (roleStr === 'merchant') return 'merchant' - return 'unknown' -} - -/** - * 判断是否为纯后台管理员 - */ -export function isAdminRole(role: string): boolean { - return normalizeRole(role) === 'admin' -} - -/** - * 判断是否为商户角色 - */ -export function isMerchantRole(role: string): boolean { - return normalizeRole(role) === 'merchant' -} - -/** - * 获取当前的标准化角色 (同步方法) - */ -export function getCurrentAdminRole(): string { - // 1. 最高优先级:当前响应式内存 userProfile(已查数据库) - if (state.userProfile != null && state.userProfile!.role != null) { - const memRole = normalizeRole(state.userProfile!.role) - if (memRole === 'admin' || memRole === 'merchant') { - return memRole - } - } - - // 2. 缓存兜底:为了刷新页面时立刻渲染,读取最新的 adminRole 缓存 - const cachedRole = uni.getStorageSync('adminRole') - if (cachedRole != null && cachedRole != '') { - const normCached = normalizeRole(cachedRole) - if (normCached === 'admin' || normCached === 'merchant') { - return normCached - } - } - - // 兼容旧的缓存字段以防万一 - const oldCached = uni.getStorageSync('admin_role') - if (oldCached != null && oldCached != '') { - const normOld = normalizeRole(oldCached) - if (normOld === 'admin' || normOld === 'merchant') { - return normOld - } - } - - console.warn('[AdminRole] 未能获取到有效的管理端角色,准备安全降级...') - return 'unknown' -} - -/** - * 清理本地相关角色和管理端缓存 (登出时调用) - */ -export function clearAdminRoleCache(): void { - // 清理 admin 专属 - uni.removeStorageSync('adminRole') - uni.removeStorageSync('admin_role') -} - -/** - * 校验并写入最新的 adminRole (用于 Login 后或者 Layout 挂载时强制刷新) - */ -export async function refreshAdminRole(): Promise { - const userStrProfile = await getCurrentUser() - let finalRole = 'unknown' - - if (userStrProfile != null && userStrProfile.role != null) { - finalRole = normalizeRole(userStrProfile.role) - console.log('[AdminRole] 从 ak_users 读取真实身份成功:', finalRole) - } else { - // metadata fallback - const sessionInfo = supa.getSession() - if (sessionInfo.user != null) { - const meta = sessionInfo.user?.get("user_metadata") as UTSJSONObject | null - if (meta != null && meta.getString('role') != null) { - finalRole = normalizeRole(meta.getString('role')) - console.log('[AdminRole] 从 Auth Metadata 读取兜底身份:', finalRole) - } - } - } - - if (finalRole !== 'unknown') { - uni.setStorageSync('adminRole', finalRole) - if (state.userProfile != null) { - state.userProfile!.role = finalRole - } - console.log('[AdminRole] 最新角色已写入状态和缓存:', finalRole) - } - - return finalRole -} - -export function getVisibleTopMenuIds(role: string): string[] { - const normRole = normalizeRole(role) - if (normRole === 'admin') { - return ['home', 'user', 'order', 'product', 'marketing', 'distribution', 'kefu', 'finance', 'cms', 'decoration', 'app', 'setting', 'maintain'] - } - - if (normRole === 'merchant') { - return ['home', 'order', 'product', 'marketing', 'finance'] - } - - return ['home'] -} - -export function hasAdminModuleAccess(moduleId: string | undefined): boolean { - if (!moduleId) return true - - const role = getCurrentAdminRole() - const normRole = normalizeRole(role) - - if (normRole === 'unknown') { - return moduleId === 'home' - } - - if (normRole === 'admin') { - return true - } - - if (normRole === 'merchant') { - const allowed = ['home', 'order', 'product', 'marketing', 'finance'] - return allowed.includes(moduleId) - } - - return false -} -''' - -with codecs.open(r'd:\骅锋\mall\layouts\admin\utils\role.uts', 'w', 'utf-8') as f: - f.write(content) - -print("success!")