一访{{ v.customerResource.first_visit_status || '未到' }}
diff --git a/uniapp/pages/common/home/index.vue b/uniapp/pages/common/home/index.vue
index f15ad2de..dd2d0332 100644
--- a/uniapp/pages/common/home/index.vue
+++ b/uniapp/pages/common/home/index.vue
@@ -45,70 +45,29 @@
data() {
return {
userInfo: {},
- gridItems: [
- {
- title: '客户资源',
- icon: 'person-filled',
- path: '/pages-market/clue/index'
- },
- {
- title: '添加资源',
- icon: 'plus-filled',
- path: '/pages-market/clue/add_clues'
- },
- {
- title: '课程安排',
- icon: 'calendar-filled',
- path: '/pages-market/clue/class_arrangement'
- },
- {
- title: '课程查询',
- icon: 'search',
- path: '/pages-coach/coach/schedule/schedule_table'
- },
- {
- title: '学员管理',
- icon: 'contact-filled',
- path: '/pages-coach/coach/student/student_list'
- },
+ gridItems: [],
+ defaultGridItems: [
{
title: '我的数据',
icon: 'bars',
path: '/pages/common/dashboard/webview',
params: { type: 'my_data' }
},
- {
- title: '部门数据',
- icon: 'staff',
- path: '/pages/common/dashboard/webview',
- params: { type: 'dept_data' }
- },
- {
- title: '校区数据',
- icon: 'location-filled',
- path: '/pages/common/dashboard/webview',
- params: { type: 'campus_data' }
- },
{
title: '我的消息',
icon: 'chat-filled',
path: '/pages-common/my_message'
- },
- {
- title: '报销管理',
- icon: 'wallet-filled',
- path: '/pages-market/reimbursement/list'
- },
- {
- title: '资料库',
- icon: 'folder-add-filled',
- path: '/pages-coach/coach/my/teaching_management'
}
]
}
},
onLoad() {
this.loadUserInfo();
+ this.loadMenuList();
+ },
+ onShow() {
+ // 每次显示页面时重新加载,确保菜单数据最新
+ this.loadMenuList();
},
methods: {
loadUserInfo() {
@@ -118,6 +77,20 @@
this.userInfo = userInfo;
}
},
+ loadMenuList() {
+ // 从本地存储获取菜单权限数据
+ const menuList = uni.getStorageSync('menuList');
+ console.log('从本地存储获取的菜单列表:', menuList);
+
+ if (menuList && Array.isArray(menuList) && menuList.length > 0) {
+ // 使用登录时返回的动态菜单
+ this.gridItems = menuList;
+ } else {
+ // 使用默认菜单作为兜底
+ this.gridItems = this.defaultGridItems;
+ console.log('使用默认菜单');
+ }
+ },
handleGridClick(item) {
console.log('点击功能按钮:', item.title, item.path);
diff --git a/uniapp/test-edit-clues.html b/uniapp/test-edit-clues.html
deleted file mode 100644
index 8cb338f7..00000000
--- a/uniapp/test-edit-clues.html
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
- 测试编辑客户页面
-
-
-
- 测试编辑客户页面字段回显
-
- 问题描述
- 在 pages/market/clue/edit_clues 页面中,电话六要素的购买力字段和备注字段没有正确回显。
-
- 问题原因
-
- - 购买力字段名不一致:
-
- - 前端使用:
purchasing_power_name
- - 后端返回:
purchase_power_name
- - 数据库字段:
purchase_power
-
-
- - 备注字段名不一致:
-
- - 前端使用:
remark
- - 数据库字段:
consultation_remark
-
-
-
-
- 修复内容
-
- - 修复购买力字段:
-
- - 第875行:
purchasing_power: sixSpeed.purchase_power
- - 第945行:
sixSpeed.purchase_power_name
-
-
- - 修复备注字段:
-
- - 第886行:
remark: sixSpeed.consultation_remark
-
-
-
-
- 测试数据
- 已在数据库中为 resource_id=38 的记录设置测试数据:
-
- - 购买力:2(对应"中等")
- - 备注:测试备注信息
-
-
- 验证步骤
-
- - 打开页面:
pages/market/clue/edit_clues?resource_sharing_id=38
- - 检查购买力选择器是否显示"中等"
- - 检查备注输入框是否显示"测试备注信息"
-
-
- 修改的文件
-
- uniapp/pages/market/clue/edit_clues.vue - 修复字段名不一致问题
-
-
-
-
-
diff --git a/uniapp/学员端订单接口问题修复报告.md b/uniapp/学员端订单接口问题修复报告.md
deleted file mode 100644
index 45367f85..00000000
--- a/uniapp/学员端订单接口问题修复报告.md
+++ /dev/null
@@ -1,268 +0,0 @@
-# 学员端订单接口问题修复报告
-
-## 🔍 **问题描述**
-
-用户反馈学员端订单页面 `pages-student/orders/index` 不能调用 `api/xy/orderTable?student_id=31&page=1&limit=10` 这个接口。
-
-## 🔧 **问题分析**
-
-### **1. 原始问题**
-通过 Playwright 测试发现以下问题:
-
-#### **API调用失败**
-```
-[LOG] 调用get方法: {url: /xy/orderTable, data: Object}
-[LOG] 响应拦截器处理: {statusCode: 200, data: Object}
-[LOG] 业务状态码: 401
-[ERROR] 401错误 - 未授权
-[ERROR] 获取订单列表失败: Error: 请登录
-```
-
-#### **代码错误**
-```
-TypeError: _this.calculateOrderStats is not a function
-```
-
-### **2. 根本原因**
-1. **权限问题**:`/xy/orderTable` 接口需要登录验证,返回401未授权错误
-2. **方法缺失**:页面调用了不存在的 `calculateOrderStats()` 方法
-3. **接口设计问题**:学员端使用的是需要管理员权限的接口
-
-## ✅ **修复方案**
-
-### **1. 修复代码错误**
-```javascript
-// 修复前(错误)
-async initPage() {
- await this.loadStudentInfo()
- await this.loadOrders()
- this.calculateOrderStats() // ❌ 方法不存在
-}
-
-// 修复后(正确)
-async initPage() {
- await this.loadStudentInfo()
- await this.loadOrders()
- this.updateOrderDisplay() // ✅ 使用正确的方法
-}
-```
-
-### **2. 完善统计功能**
-```javascript
-updateOrderDisplay() {
- // 更新过滤列表
- if (this.activeStatus === 'all') {
- this.filteredOrders = [...this.ordersList]
- } else {
- this.filteredOrders = this.ordersList.filter(order => order.status === this.activeStatus)
- }
-
- // 更新标签页统计
- const counts = {}
- this.ordersList.forEach(order => {
- counts[order.status] = (counts[order.status] || 0) + 1
- })
-
- this.statusTabs.forEach(tab => {
- tab.count = tab.value === 'all' ? this.ordersList.length : (counts[tab.value] || 0)
- })
-
- // ✅ 新增:更新订单统计信息
- this.orderStats = {
- total_orders: this.ordersList.length,
- pending_payment: counts['pending_payment'] || 0,
- paid: counts['paid'] || 0,
- completed: counts['completed'] || 0,
- cancelled: counts['cancelled'] || 0,
- refunded: counts['refunded'] || 0
- }
-}
-```
-
-### **3. 创建学员端专用接口**
-
-#### **在 apiRoute.js 中添加新接口**
-```javascript
-//学生端-订单管理-列表(公开接口,用于学员端查看)
-async xy_getStudentOrders(data = {}) {
- return await http.get('/xy/student/orders', data);
-},
-//学生端-订单管理-详情(公开接口,用于学员端查看)
-async xy_getStudentOrderDetail(data = {}) {
- return await http.get('/xy/student/orders/detail', data);
-},
-```
-
-#### **更新页面调用**
-```javascript
-// 修复前(权限问题)
-const response = await apiRoute.xy_orderTableList({
- student_id: this.studentId,
- page: this.currentPage,
- limit: 10
-})
-
-// 修复后(使用学员端接口)
-const response = await apiRoute.xy_getStudentOrders({
- student_id: this.studentId,
- page: this.currentPage,
- limit: 10
-})
-```
-
-## 🧪 **测试验证**
-
-### **测试环境**
-- **测试页面**:http://localhost:8080/#/pages-student/orders/index?student_id=31
-- **测试工具**:Playwright 自动化测试
-
-### **测试结果**
-
-#### **修复前**
-```
-❌ API调用失败:401未授权错误
-❌ 代码错误:calculateOrderStats is not a function
-❌ 页面显示:获取订单列表失败
-❌ 用户体验:功能不可用
-```
-
-#### **修复后**
-```
-✅ 代码错误已修复:不再有 calculateOrderStats 错误
-✅ 新接口调用成功:/xy/student/orders 接口被正确调用
-✅ 网络请求正常:HTTP 200 状态码
-⚠️ 后端路由待实现:需要后端实现新的接口路由
-```
-
-### **网络请求日志**
-```
-[LOG] 调用学员端订单接口,参数: {student_id: 31, page: 1, limit: 10}
-[LOG] 调用get方法: {url: /xy/student/orders, data: Object}
-[GET] http://localhost:20080/api/xy/student/orders?student_id=31&page=1&limit=10 => [200] OK
-[LOG] 业务状态码: 0 (路由未定义)
-```
-
-## 📋 **后端实现建议**
-
-### **需要实现的接口**
-
-#### **1. 学员订单列表接口**
-```
-GET /api/xy/student/orders
-参数:
-- student_id: 学员ID
-- page: 页码
-- limit: 每页数量
-
-返回格式:
-{
- "code": 1,
- "msg": "获取成功",
- "data": {
- "data": [
- {
- "id": 1,
- "order_no": "ORD20250731001",
- "course_name": "体能训练课程",
- "total_amount": "299.00",
- "status": "paid",
- "create_time": "2025-07-31 10:00:00",
- "payment_method": "wxpay"
- }
- ],
- "current_page": 1,
- "last_page": 1,
- "total": 1
- }
-}
-```
-
-#### **2. 学员订单详情接口**
-```
-GET /api/xy/student/orders/detail
-参数:
-- id: 订单ID
-
-返回格式:
-{
- "code": 1,
- "msg": "获取成功",
- "data": {
- "id": 1,
- "order_no": "ORD20250731001",
- "course_name": "体能训练课程",
- "course_specs": "10节课",
- "quantity": 1,
- "total_amount": "299.00",
- "status": "paid",
- "create_time": "2025-07-31 10:00:00",
- "payment_method": "wxpay",
- "payment_time": "2025-07-31 10:05:00"
- }
-}
-```
-
-### **权限设计**
-- 这些接口应该允许学员查看自己的订单
-- 可以通过 `student_id` 参数限制只能查看自己的订单
-- 不需要管理员权限,但需要验证学员身份
-
-### **安全考虑**
-- 验证 `student_id` 参数的有效性
-- 确保学员只能查看自己的订单
-- 添加适当的数据脱敏(如隐藏敏感支付信息)
-
-## 🎯 **修复状态总结**
-
-### **✅ 已完成**
-1. **代码错误修复**:`calculateOrderStats` 方法调用错误已修复
-2. **统计功能完善**:`orderStats` 数据正确更新
-3. **前端接口调用**:已切换到新的学员端接口
-4. **错误处理优化**:添加了详细的调试日志
-
-### **⚠️ 待完成**
-1. **后端接口实现**:需要实现 `/xy/student/orders` 和 `/xy/student/orders/detail` 接口
-2. **权限验证**:后端需要实现适当的学员身份验证
-3. **数据格式对接**:确保后端返回的数据格式与前端期望一致
-
-### **🔄 下一步行动**
-1. **后端开发**:实现新的学员端订单接口
-2. **接口测试**:验证接口的功能和性能
-3. **数据联调**:确保前后端数据格式一致
-4. **权限测试**:验证学员只能查看自己的订单
-
-## 💡 **技术亮点**
-
-### **1. 接口分离设计**
-- 将学员端和管理端的订单接口分离
-- 学员端接口更简单,权限要求更低
-- 便于后续的权限管理和功能扩展
-
-### **2. 错误处理优化**
-- 添加了详细的调试日志
-- 改善了错误提示的用户体验
-- 便于问题排查和调试
-
-### **3. 代码健壮性提升**
-- 修复了方法调用错误
-- 完善了数据统计功能
-- 提高了代码的可维护性
-
-## 🎉 **总结**
-
-通过系统性的分析和修复,成功解决了学员端订单页面的接口调用问题:
-
-1. **✅ 问题定位准确**:识别出权限验证和代码错误问题
-2. **✅ 修复方案合理**:创建专用的学员端接口
-3. **✅ 代码质量提升**:修复了多个代码错误
-4. **✅ 用户体验改善**:优化了错误处理和调试信息
-5. **⚠️ 后端配合需要**:需要后端实现新的接口路由
-
-**前端修复已完成,等待后端实现对应的接口即可完全解决问题!**
-
----
-
-**修复完成时间**:2025-07-31
-**状态**:✅ 前端修复完成,⚠️ 待后端实现接口
-**新增接口**:`/xy/student/orders` 和 `/xy/student/orders/detail`
-**下一步**:后端实现学员端订单接口