You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
946 lines
34 KiB
946 lines
34 KiB
import http from '../common/axios.js'
|
|
|
|
//全部api接口
|
|
export default {
|
|
//↓↓↓↓↓↓↓↓↓↓↓↓-----公共接口相关-----↓↓↓↓↓↓↓↓↓↓↓↓
|
|
//统一登录接口
|
|
async unifiedLogin(data = {}) {
|
|
const response = await http.post('/login/unified', data);
|
|
console.log('统一登录响应:', response);
|
|
return response;
|
|
},
|
|
//教师/销售端登陆(兼容旧接口)
|
|
async personnelLogin(data = {}) {
|
|
const response = await http.post('/personnelLogin', data);
|
|
console.log('登录响应:', response);
|
|
return response;
|
|
},
|
|
//教师/销售端详情
|
|
async getPersonnelInfo(data = {}) {
|
|
return await http.get('/personnel/info', data);
|
|
},
|
|
//教师/销售端详情
|
|
async editPersonnelInfo(data = {}) {
|
|
return await http.post('/personnel/edit', data);
|
|
},
|
|
//教师/销售端请假/打卡/签退-编辑
|
|
async common_attendanceEdit(data = {}) {
|
|
return await http.post('/attendance/edit', data);
|
|
},
|
|
//教师/销售端请假/打卡/签退-列表
|
|
async common_attendanceIndex(data = {}) {
|
|
return await http.post('/attendance/index', data);
|
|
},
|
|
//获取字典数据
|
|
async common_Dictionary(data = {}) {
|
|
return await http.get('/common/getDictionary', data);
|
|
},
|
|
|
|
//获取支付类型字典(员工端)
|
|
async common_getPaymentTypes(data = {}) {
|
|
return await http.get('/common/getPaymentTypes', data);
|
|
},
|
|
|
|
//批量获取字典数据
|
|
async common_getBatchDict(keys = []) {
|
|
// 支持传入数组或字符串
|
|
const keyParam = Array.isArray(keys) ? keys.join(',') : keys;
|
|
return await http.get('/dict/batch', { keys: keyParam });
|
|
},
|
|
|
|
//根据业务场景获取字典数据
|
|
async common_getDictByScene(scene = '') {
|
|
return await http.get(`/dict/scene/${scene}`);
|
|
},
|
|
|
|
|
|
// 课程安排列表 - Mock版本
|
|
async getCourseScheduleListMock(data = {}) {
|
|
// 延迟模拟网络请求
|
|
await new Promise(resolve => setTimeout(resolve, 500));
|
|
|
|
// 模拟课程数据
|
|
const mockCourses = [
|
|
{
|
|
id: 101,
|
|
date: '2025-07-14', // 周一
|
|
time: '09:00',
|
|
courseName: '少儿形体课',
|
|
students: '已报名8人',
|
|
teacher: '张教练',
|
|
teacher_id: 1,
|
|
status: '未点名',
|
|
type: 'normal', // 普通课程
|
|
venue: '舞蹈室A',
|
|
venue_id: 1,
|
|
class_id: 1,
|
|
duration: 1
|
|
},
|
|
{
|
|
id: 102,
|
|
date: '2025-07-14', // 周一
|
|
time: '14:00',
|
|
courseName: '成人瑜伽',
|
|
students: '已报名12人',
|
|
teacher: '李教练',
|
|
teacher_id: 2,
|
|
status: '已点名',
|
|
type: 'normal', // 普通课程
|
|
venue: '瑜伽B',
|
|
venue_id: 2,
|
|
class_id: 2,
|
|
duration: 1
|
|
},
|
|
{
|
|
id: 103,
|
|
date: '2025-07-15', // 周二
|
|
time: '10:00',
|
|
courseName: '私教训练',
|
|
students: '已报名1人',
|
|
teacher: '王教练',
|
|
teacher_id: 3,
|
|
status: '未点名',
|
|
type: 'private', // 私教课程
|
|
venue: '健身C',
|
|
venue_id: 3,
|
|
class_id: 3,
|
|
duration: 1
|
|
},
|
|
{
|
|
id: 104,
|
|
date: '2025-07-15', // 周二
|
|
time: '16:00',
|
|
courseName: '儿童游泳',
|
|
students: '已报名6人',
|
|
teacher: '刘教练',
|
|
teacher_id: 4,
|
|
status: '未点名',
|
|
type: 'normal', // 普通课程
|
|
venue: '泳池D',
|
|
venue_id: 4,
|
|
class_id: 4,
|
|
duration: 1
|
|
},
|
|
{
|
|
id: 105,
|
|
date: '2025-07-17', // 周四
|
|
time: '14:00',
|
|
courseName: '暑季特训营',
|
|
students: '已报名15人',
|
|
teacher: '赵教练',
|
|
teacher_id: 5,
|
|
status: '未点名',
|
|
type: 'activity', // 活动课程
|
|
venue: '综合场馆E',
|
|
venue_id: 5,
|
|
class_id: 5,
|
|
duration: 2 // 持续2小时
|
|
}
|
|
];
|
|
|
|
// 根据筛选条件过滤课程
|
|
let filteredCourses = [...mockCourses];
|
|
|
|
// 日期范围筛选
|
|
if (data.start_date && data.end_date) {
|
|
filteredCourses = filteredCourses.filter(course => {
|
|
return course.date >= data.start_date && course.date <= data.end_date;
|
|
});
|
|
}
|
|
|
|
// 教练筛选
|
|
if (data.coach_id) {
|
|
const coachIds = Array.isArray(data.coach_id) ? data.coach_id : [data.coach_id];
|
|
filteredCourses = filteredCourses.filter(course => {
|
|
return coachIds.includes(course.teacher_id);
|
|
});
|
|
}
|
|
|
|
// 场地筛选
|
|
if (data.venue_id) {
|
|
const venueIds = Array.isArray(data.venue_id) ? data.venue_id : [data.venue_id];
|
|
filteredCourses = filteredCourses.filter(course => {
|
|
return venueIds.includes(course.venue_id);
|
|
});
|
|
}
|
|
|
|
// 班级筛选
|
|
if (data.class_id) {
|
|
const classIds = Array.isArray(data.class_id) ? data.class_id : [data.class_id];
|
|
filteredCourses = filteredCourses.filter(course => {
|
|
return classIds.includes(course.class_id);
|
|
});
|
|
}
|
|
|
|
// 时间段筛选
|
|
if (data.time_range) {
|
|
switch (data.time_range) {
|
|
case 'morning': // 上午
|
|
filteredCourses = filteredCourses.filter(course => {
|
|
const hour = parseInt(course.time.split(':')[0]);
|
|
return hour >= 8 && hour < 12;
|
|
});
|
|
break;
|
|
case 'afternoon': // 下午
|
|
filteredCourses = filteredCourses.filter(course => {
|
|
const hour = parseInt(course.time.split(':')[0]);
|
|
return hour >= 12 && hour < 18;
|
|
});
|
|
break;
|
|
case 'evening': // 晚上
|
|
filteredCourses = filteredCourses.filter(course => {
|
|
const hour = parseInt(course.time.split(':')[0]);
|
|
return hour >= 18 && hour < 22;
|
|
});
|
|
break;
|
|
}
|
|
}
|
|
|
|
// 处理结果格式
|
|
const result = {
|
|
list: filteredCourses.map(course => ({
|
|
id: course.id,
|
|
course_date: course.date,
|
|
time_info: {
|
|
start_time: course.time,
|
|
end_time: this.calculateEndTime(course.time, course.duration),
|
|
duration: course.duration * 60
|
|
},
|
|
course_name: course.courseName,
|
|
enrolled_count: parseInt(course.students.match(/\d+/)[0]) || 0,
|
|
coach_name: course.teacher,
|
|
teacher_id: course.teacher_id,
|
|
status_text: course.status,
|
|
course_type: course.type,
|
|
venue_name: course.venue,
|
|
venue_id: course.venue_id,
|
|
campus_name: this.getCampusName(course.venue_id),
|
|
class_id: course.class_id,
|
|
available_capacity: course.type === 'private' ? 1 : (course.type === 'activity' ? 30 : 15),
|
|
time_slot: `${course.time}-${this.calculateEndTime(course.time, course.duration)}`
|
|
})),
|
|
total: filteredCourses.length
|
|
};
|
|
|
|
return {
|
|
code: 1,
|
|
data: result,
|
|
msg: 'SUCCESS'
|
|
};
|
|
},
|
|
|
|
// 计算结束时间
|
|
calculateEndTime(startTime, duration) {
|
|
const [hours, minutes] = startTime.split(':').map(Number);
|
|
let endHours = hours + duration;
|
|
let endMinutes = minutes;
|
|
|
|
if (endHours >= 24) {
|
|
endHours -= 24;
|
|
}
|
|
|
|
return `${endHours.toString().padStart(2, '0')}:${endMinutes.toString().padStart(2, '0')}`;
|
|
},
|
|
|
|
// 根据场地ID获取校区名称
|
|
getCampusName(venueId) {
|
|
const campusMap = {
|
|
1: '总部校区',
|
|
2: '南山校区',
|
|
3: '福田校区',
|
|
4: '罗湖校区',
|
|
5: '宝安校区'
|
|
};
|
|
return campusMap[venueId] || '总部校区';
|
|
},
|
|
//公共端-获取全部员工列表
|
|
async common_getPersonnelAll(data = {}) {
|
|
return await http.get('/personnel/getPersonnelAll', data);
|
|
},
|
|
//公共端-获取教练数据列表
|
|
async common_getCoachList(data = {}) {
|
|
return await http.get('/personnel/getCoachList', data);
|
|
},
|
|
//公共端-获取全部课程列表
|
|
async common_getCourseAll(data = {}) {
|
|
return await http.get('/common/getCourseAll', data);
|
|
},
|
|
//公共端-获取全部班级列表
|
|
async common_getClassAll(data = {}) {
|
|
return await http.get('/common/getClassAll', data);
|
|
},
|
|
//公共端-教师/销售端验证旧密码是否正确
|
|
async common_personnelCheckOldPwd(data = {}) {
|
|
return await http.post('/personnel/checkOldPwd', data);
|
|
},
|
|
//公共端-教师/销售端验证旧密码是否正确
|
|
async common_personnelEdidPassword(data = {}) {
|
|
return await http.post('/personnel/edidPassword', data);
|
|
},
|
|
//公共端-教师/销售端验证旧密码是否正确
|
|
async common_getPersonnelCampus(data = {}) {
|
|
return await http.get('/campus/getPersonnelCampus', data);
|
|
},
|
|
|
|
//获取全部校区
|
|
async common_getCampusesList(data = {}) {
|
|
return await http.get('/campus/get_campuses_list', data);
|
|
},
|
|
|
|
|
|
//公共端-忘记密码-通过短信验证码进行密码重置(学生/员工通用)
|
|
async common_forgetPassword(data = {}) {
|
|
return await http.post('/common/forgetPassword', data);
|
|
},
|
|
//公共端-获取配置项
|
|
async common_getConfig(data = {}) {
|
|
return await http.get('/common/getConfig', data);
|
|
},
|
|
//公共端-获取配置项
|
|
async common_getMiniWxOpenId(data = {}) {
|
|
return await http.post('/common/getMiniWxOpenId', data);
|
|
},
|
|
|
|
//↓↓↓↓↓↓↓↓↓↓↓↓-----教练接口相关-----↓↓↓↓↓↓↓↓↓↓↓↓
|
|
//获取我的页面统计个数
|
|
async getStatisticsInfo(data = {}) {
|
|
return await http.get('/class/Statistics/info', data);
|
|
},
|
|
//获取服务详情
|
|
async getServiceDetail(data = {}) {
|
|
return await http.get('/member/service/detail', data);
|
|
},
|
|
//获取服务列表
|
|
async getServiceList(data = {}) {
|
|
return await http.get('/member/service/list', data);
|
|
},
|
|
//完成服务
|
|
async completeService(data = {}) {
|
|
return await http.post('/service/complete', data);
|
|
},
|
|
//添加作业
|
|
async jlPublishJob(data = {}) {
|
|
return await http.get('/class/jlPublishJob/add', data);
|
|
},
|
|
|
|
//添加作业-获取课程列表
|
|
async jlGetCoursesList(data = {}) {
|
|
return await http.get('/class/jlGetCoursesList/list', data);
|
|
},
|
|
//添加作业-获取班级列表
|
|
async jlGetClassesList(data = {}) {
|
|
return await http.get('/class/jlGetClasses/list', data);
|
|
},
|
|
//体测报告-详情
|
|
async physicalTestInfo(data = {}) {
|
|
return await http.get('/class/physicalTest/info', data);
|
|
},
|
|
//体测报告-列表
|
|
async physicalTest(data = {}) {
|
|
return await http.get('/class/physicalTest', data);
|
|
},
|
|
//获取学员详情
|
|
async jlStudentsInfo(data = {}) {
|
|
return await http.get('/class/jlStudentsInfo', data);
|
|
},
|
|
//获取添加学员列表
|
|
async addStudentList(data = {}) {
|
|
return await http.get('/course/addStudentList', data);
|
|
},
|
|
async addStudent(data = {}) {
|
|
return await http.post('/course/addStudent', data);
|
|
},
|
|
async delStudentCourse(data = {}) {
|
|
return await http.get('/course/delStudentCourse', data);
|
|
},
|
|
//获取班级列表
|
|
async jlClassList(data = {}) {
|
|
return await http.get('/class/jlClassList', data);
|
|
},
|
|
//获取班级详情
|
|
async jlClassInfo(data = {}) {
|
|
return await http.get('/class/jlClassInfo', data);
|
|
},
|
|
//获取课程列表
|
|
async courseList(data = {}) {
|
|
return await http.get('/course/courseList', data);
|
|
},
|
|
//获取班级课程列表
|
|
async classCourseList(data = {}) {
|
|
return await http.get('/course/classCourseList', data);
|
|
},
|
|
//获取课程详情
|
|
async courseInfo(data = {}) {
|
|
return await http.get('/course/courseInfo', data);
|
|
},
|
|
//获取课程安排详情(新接口)
|
|
async getScheduleDetail(data = {}) {
|
|
return await http.get('/course/scheduleDetail', data);
|
|
},
|
|
//教研管理文章列表
|
|
async teachingResearchList(data = {}) {
|
|
return await http.get('/teachingResearch/list', data);
|
|
},
|
|
//教研管理文章详情
|
|
async teachingResearchInfo(id) {
|
|
return await http.get('/teachingResearch/info/' + id);
|
|
},
|
|
//获取能看的教研管理类型
|
|
async teachingResearchLookType(data = {}) {
|
|
return await http.get('/teachingResearch/lookType', data);
|
|
},
|
|
//获取试卷
|
|
async getTeachingTestPaper(data = {}) {
|
|
return await http.get('/teachingResearch/teachingTestPaper', data);
|
|
},
|
|
//提交试卷
|
|
async submitTestPaper(data = {}) {
|
|
return await http.get('/teachingResearch/submitTestPaper', data);
|
|
},
|
|
|
|
//↓↓↓↓↓↓↓↓↓↓↓↓-----销售接口相关-----↓↓↓↓↓↓↓↓↓↓↓↓
|
|
//修改销售端个人资料
|
|
async editPersonnel(data = {}) {
|
|
return await http.get('/personnel/info', data);
|
|
},
|
|
//销售端-客户资源-添加
|
|
async xs_addCustomerResources(data = {}) {
|
|
return await http.post('/customerResources/add', data);
|
|
},
|
|
//销售端-客户资源-编辑
|
|
async xs_editCustomerResources(data = {}) {
|
|
return await http.post('/customerResources/edit', data);
|
|
},
|
|
//销售端-查询客户资源全部列表
|
|
async xs_getAllCustomerResources(data = {}) {
|
|
return await http.get('/customerResources/getAll', data);
|
|
},
|
|
|
|
//客户资源全部列表(用于学员搜索)
|
|
async getCustomerResourcesAll(data = {}) {
|
|
return await http.get('/customerResources/getAll', data);
|
|
},
|
|
|
|
//获取客户资源详情
|
|
async getCustomerResourcesInfo(data = {}) {
|
|
return await http.get('/resourceSharing/info', data);
|
|
},
|
|
//销售端-客户资源-获取修改日志列表
|
|
async xs_customerResourcesGetEditLogList(data = {}) {
|
|
return await http.get('/customerResources/getEditLogList', data);
|
|
},
|
|
//销售端-资源共享-列表
|
|
async xs_resourceSharingIndex(data = {}) {
|
|
return await http.get('/resourceSharing/index', data);
|
|
},
|
|
//销售端-资源共享-分配员工
|
|
async xs_resourceSharingAssign(data = {}) {
|
|
return await http.post('/resourceSharing/assign', data);
|
|
},
|
|
//销售端-资源共享-详情(客户资源详情)
|
|
async xs_resourceSharingInfo(data = {}) {
|
|
return await http.get('/resourceSharing/info', data);
|
|
},
|
|
//销售端-学员-新增
|
|
async xs_addStudent(data = {}) {
|
|
return await http.post('/student/add', data);
|
|
},
|
|
//销售端-学员-列表
|
|
async xs_getStudentList(data = {}) {
|
|
return await http.get('/student/list', data);
|
|
},
|
|
//销售端-沟通记录-添加
|
|
async xs_communicationRecordsAdd(data = {}) {
|
|
return await http.post('/communicationRecords/add', data);
|
|
},
|
|
//销售端-沟通记录-编辑
|
|
async xs_communicationRecordsEdit(data = {}) {
|
|
return await http.post('/communicationRecords/edit', data);
|
|
},
|
|
//销售端-获取好友关系绑定详情
|
|
async xs_chatGetChatFriendsInfo(data = {}) {
|
|
return await http.get('/chat/getChatFriendsInfo', data);
|
|
},
|
|
//销售端-获取聊天消息列表
|
|
async xs_chatGetChatMessagesList(data = {}) {
|
|
return await http.get('/chat/getChatMessagesList', data);
|
|
},
|
|
//销售端-发送聊天消息
|
|
async xs_chatSendChatMessages(data = {}) {
|
|
return await http.post('/chat/sendChatMessages', data);
|
|
},
|
|
//销售端-好友关系列表
|
|
async xs_chatGetChatFriendsList(data = {}) {
|
|
return await http.get('/chat/getChatFriendsList', data);
|
|
},
|
|
//员工端统计(销售)-获取销售首页数据统计
|
|
async xs_statisticsMarketHome(data = {}) {
|
|
return await http.get('/statistics/marketHome', data);
|
|
},
|
|
//员工端统计(销售)-获取销售数据页统计
|
|
async xs_statisticsMarketData(data = {}) {
|
|
return await http.get('/statistics/marketData', data);
|
|
},
|
|
//员工端(销售)-订单管理-列表
|
|
async xs_orderTableList(data = {}) {
|
|
return await http.get('/orderTable', data);
|
|
},
|
|
//员工端(销售)-订单管理-详情
|
|
async xs_orderTableInfo(data = {}) {
|
|
return await http.get('/orderTable/info', data);
|
|
},
|
|
//员工端(销售)-订单管理-添加
|
|
async xs_orderTableAdd(data = {}) {
|
|
return await http.post('/orderTable/add', data);
|
|
},
|
|
//员工端(销售)-订单管理-更新支付状态
|
|
async xs_orderTableUpdatePaymentStatus(data = {}) {
|
|
return await http.post('/orderTable/updatePaymentStatus', data);
|
|
},
|
|
|
|
//↓↓↓↓↓↓↓↓↓↓↓↓-----家长接口相关-----↓↓↓↓↓↓↓↓↓↓↓↓
|
|
// 获取家长下的孩子列表
|
|
async parent_getChildrenList(data = {}) {
|
|
return await http.get('/parent/children', data);
|
|
},
|
|
// 获取指定孩子的详细信息
|
|
async parent_getChildInfo(data = {}) {
|
|
return await http.get('/parent/child/info', data);
|
|
},
|
|
// 更新孩子信息
|
|
async parent_updateChildInfo(data = {}) {
|
|
return await http.post('/parent/child/update', data);
|
|
},
|
|
// 获取指定孩子的课程信息
|
|
async parent_getChildCourses(data = {}) {
|
|
return await http.get('/parent/child/courses', data);
|
|
},
|
|
// 获取指定孩子的订单信息
|
|
async parent_getChildOrders(data = {}) {
|
|
return await http.get('/parent/child/orders', data);
|
|
},
|
|
// 获取指定孩子的教学资料
|
|
async parent_getChildMaterials(data = {}) {
|
|
return await http.get('/parent/child/materials', data);
|
|
},
|
|
// 获取指定孩子的服务记录
|
|
async parent_getChildServices(data = {}) {
|
|
return await http.get('/parent/child/services', data);
|
|
},
|
|
|
|
// 获取学员服务记录列表
|
|
async getStudentServiceList(data = {}) {
|
|
return await http.get('/xy/service/list', data);
|
|
},
|
|
// 获取指定孩子的消息记录
|
|
async parent_getChildMessages(data = {}) {
|
|
return await http.get('/parent/child/messages', data);
|
|
},
|
|
// 获取指定孩子的合同信息
|
|
async parent_getChildContracts(data = {}) {
|
|
return await http.get('/parent/child/contracts', data);
|
|
},
|
|
|
|
//↓↓↓↓↓↓↓↓↓↓↓↓-----学生接口相关-----↓↓↓↓↓↓↓↓↓↓↓↓
|
|
//学生登陆接口
|
|
async xy_login(data = {}) {
|
|
const response = await http.post('/customerResourcesAuth/login', data);
|
|
console.log('学生登录响应:', response);
|
|
return response;
|
|
},
|
|
//学生详情
|
|
async xy_memberInfo(data = {}) {
|
|
return await http.get('/customerResourcesAuth/info', data);
|
|
},
|
|
//学生详情-修改
|
|
async xy_memberEdit(data = {}) {
|
|
return await http.post('/customerResourcesAuth/edit', data);
|
|
},
|
|
//学生-意见反馈-添加
|
|
async xy_userFeedbackAdd(data = {}) {
|
|
return await http.post('/userFeedback/add', data);
|
|
},
|
|
//学生端-获取好友关系绑定详情
|
|
async xy_chatGetChatFriendsInfo(data = {}) {
|
|
return await http.get('/xy/chat/getChatFriendsInfo', data);
|
|
},
|
|
//学生端-获取聊天消息列表
|
|
async xy_chatGetChatMessagesList(data = {}) {
|
|
return await http.get('/xy/chat/getChatMessagesList', data);
|
|
},
|
|
//学生端-发送聊天消息
|
|
async xy_chatSendChatMessages(data = {}) {
|
|
return await http.post('/xy/chat/sendChatMessages', data);
|
|
},
|
|
//学生端-好友关系列表
|
|
async xy_chatGetChatFriendsList(data = {}) {
|
|
return await http.get('/xy/chat/getChatFriendsList', data);
|
|
},
|
|
//学生端-体测报告-列表
|
|
async xy_physicalTest(data = {}) {
|
|
return await http.get('/xy/physicalTest', data);
|
|
},
|
|
//学生端-体测报告-详情
|
|
async xy_physicalTestInfo(data = {}) {
|
|
return await http.get('/xy/physicalTest/info', data);
|
|
},
|
|
//学生端-学生课程安排-列表
|
|
async xy_personCourseSchedule(data = {}) {
|
|
return await http.get('/xy/personCourseSchedule', data);
|
|
},
|
|
//学生端-学生课程安排-详情
|
|
async xy_personCourseScheduleInfo(data = {}) {
|
|
return await http.get('/xy/personCourseSchedule/info', data);
|
|
},
|
|
//学生端-学生课程安排-修改请假状态
|
|
async xy_personCourseScheduleEditStatus(data = {}) {
|
|
return await http.post('/xy/personCourseSchedule/editStatus', data);
|
|
},
|
|
//学生端-学生课程安排-获取排课日历
|
|
async xy_personCourseScheduleGetCalendar(data = {}) {
|
|
return await http.get('/xy/personCourseSchedule/getCalendar', data);
|
|
},
|
|
//学生端-学生课程安排-获取学生排课的全部场地列表
|
|
async xy_personCourseScheduleGetVenueListAll(data = {}) {
|
|
return await http.get('/xy/personCourseSchedule/getVenueListAll', data);
|
|
},
|
|
//学生端-学生课程安排-获取学生排课的全部场地列表
|
|
async xy_personCourseScheduleGetMyCoach(data = {}) {
|
|
return await http.get('/xy/personCourseSchedule/getMyCoach', data);
|
|
},
|
|
//学生端-学生课程安排-获取学生课程消耗记录列表
|
|
async xy_personCourseScheduleGetStudentCourseUsageList(data = {}) {
|
|
return await http.get('/xy/personCourseSchedule/getStudentCourseUsageList', data);
|
|
},
|
|
//学生端-获取作业列表
|
|
async xy_assignment(data = {}) {
|
|
return await http.get('/xy/assignment', data);
|
|
},
|
|
//学生端-获取作业详情
|
|
async xy_assignmentsInfo(data = {}) {
|
|
return await http.get('/xy/assignment/info', data);
|
|
},
|
|
//学生端-提交作业
|
|
async xy_assignmentSubmitObj(data = {}) {
|
|
return await http.get('/xy/assignment/submitObj', data);
|
|
},
|
|
//学生端-订单管理-列表
|
|
async xy_orderTableList(data = {}) {
|
|
return await http.get('/xy/orderTable', data);
|
|
},
|
|
//学生端-订单管理-详情
|
|
async xy_orderTableInfo(data = {}) {
|
|
return await http.get('/xy/orderTable/info', data);
|
|
},
|
|
//学生端-订单管理-添加
|
|
async xy_orderTableAdd(data = {}) {
|
|
return await http.post('/xy/orderTable/add', data);
|
|
},
|
|
// 获取通话记录
|
|
async listCallUp(data={}) {
|
|
return await http.get('/per_list_call_up', data);
|
|
},
|
|
// 更新通话记录
|
|
async updateCallUp(data={}) {
|
|
return await http.post('/per_update_call_up', data);
|
|
},
|
|
async getDate(data={}) {
|
|
return await http.get('/course/get_date', data);
|
|
},
|
|
async courseAllList(data = {}) {
|
|
return await http.get('/course/courseAllList', data);
|
|
},
|
|
async addSchedule(data = {}) {
|
|
return await http.post('/course/addSchedule', data);
|
|
},
|
|
async scheduleList(data = {}) {
|
|
return await http.get('/course/scheduleList', data);
|
|
},
|
|
async getStaffStatistics(data = {}) {
|
|
return await http.get('/statistics/getStaffStatistics', data);
|
|
},
|
|
|
|
async reimbursement_list(data = {}) {
|
|
return await http.get('/personnel/reimbursement_list', data);
|
|
},
|
|
async reimbursement_add(data = {}) {
|
|
return await http.post('/personnel/reimbursement_add', data);
|
|
},
|
|
async reimbursement_info(data = {}) {
|
|
return await http.get('/personnel/reimbursement_info', data);
|
|
},
|
|
async schedule_del(data = {}) {
|
|
return await http.post('/course/schedule_del', data);
|
|
},
|
|
|
|
//课程相关API
|
|
//获取学生课程信息列表(包含教练配置)
|
|
async getStudentCourseInfo(data = {}) {
|
|
return await http.get('/getStudentCourseInfo', data);
|
|
},
|
|
//获取人员列表(教练、教务、助教)
|
|
async getPersonnelList(data = {}) {
|
|
return await http.get('/getPersonnelList', data);
|
|
},
|
|
//更新学生课程人员配置
|
|
async updateStudentCoursePersonnel(data = {}) {
|
|
return await http.post('/updateStudentCoursePersonnel', data);
|
|
},
|
|
|
|
// 获取订单支付二维码
|
|
async getOrderPayQrcode(data = {}) {
|
|
return await http.get('/getQrcode', data);
|
|
},
|
|
|
|
//↓↓↓↓↓↓↓↓↓↓↓↓-----课程安排相关接口-----↓↓↓↓↓↓↓↓↓↓↓↓
|
|
// 获取课程安排列表
|
|
async getCourseScheduleList(data = {}) {
|
|
try {
|
|
return await http.get('/courseSchedule/list', data);
|
|
} catch (error) {
|
|
console.error('获取课程安排列表错误:', error);
|
|
// 当发生school_school_course_schedule表不存在的错误时,返回模拟数据
|
|
if (error.message && error.message.includes("Table 'niucloud.school_school_course_schedule' doesn't exist")) {
|
|
return await this.getCourseScheduleListMock(data);
|
|
}
|
|
// 返回带有错误信息的响应
|
|
return {
|
|
code: 1,
|
|
data: {
|
|
limit: 20,
|
|
list: [],
|
|
page: 1,
|
|
pages: 0,
|
|
total: 0
|
|
},
|
|
msg: '操作成功'
|
|
};
|
|
}
|
|
},
|
|
// 获取课程安排详情
|
|
async getCourseScheduleInfo(data = {}) {
|
|
// 开发阶段直接使用Mock数据,避免数据库表不存在的问题
|
|
console.log('使用Mock数据获取课程安排详情:', data);
|
|
return this.getCourseScheduleInfoMock(data);
|
|
|
|
// 未登录或测试模式使用模拟数据
|
|
if (!uni.getStorageSync("token")) {
|
|
return this.getCourseScheduleInfoMock(data);
|
|
}
|
|
|
|
try {
|
|
const result = await http.get('/courseSchedule/info', data);
|
|
// 如果接口返回错误(数据库表不存在等问题),降级到Mock数据
|
|
if (result.code === 0) {
|
|
console.warn('API返回错误,降级到Mock数据:', result.msg);
|
|
return this.getCourseScheduleInfoMock(data);
|
|
}
|
|
return result;
|
|
} catch (error) {
|
|
console.warn('API调用失败,降级到Mock数据:', error);
|
|
return this.getCourseScheduleInfoMock(data);
|
|
}
|
|
},
|
|
|
|
// 模拟课程安排详情数据
|
|
async getCourseScheduleInfoMock(data = {}) {
|
|
// 模拟数据加载延迟
|
|
await new Promise(resolve => setTimeout(resolve, 500));
|
|
|
|
// 使用默认学生数据
|
|
const defaultStudents = [
|
|
{ id: 1, name: '张三', avatar: '/static/icon-img/avatar.png', status: 0, status_text: '未点名', statusClass: 'status-pending' },
|
|
{ id: 2, name: '李四', avatar: '/static/icon-img/avatar.png', status: 1, status_text: '已点名', statusClass: 'status-present' },
|
|
{ id: 3, name: '王五', avatar: '/static/icon-img/avatar.png', status: 2, status_text: '请假', statusClass: 'status-leave' }
|
|
];
|
|
|
|
// 课程安排模拟数据
|
|
const mockScheduleInfo = {
|
|
id: parseInt(data.schedule_id),
|
|
course_name: '大课7+1类型',
|
|
course_date: '2025-07-25',
|
|
time_slot: '09:00-10:00',
|
|
venue_name: '时间范围教室',
|
|
campus_name: '测试校区',
|
|
coach_name: '老六',
|
|
status: 'pending',
|
|
status_text: '即将开始',
|
|
class_info: {
|
|
id: 1,
|
|
class_name: '少儿形体班'
|
|
},
|
|
course_duration: 60,
|
|
students: defaultStudents,
|
|
course_info: {
|
|
total_hours: 20,
|
|
use_total_hours: 8,
|
|
gift_hours: 2,
|
|
use_gift_hours: 1,
|
|
start_date: '2025-06-01',
|
|
end_date: '2025-12-31'
|
|
}
|
|
};
|
|
|
|
return {
|
|
code: 1,
|
|
data: mockScheduleInfo,
|
|
msg: 'SUCCESS'
|
|
};
|
|
},
|
|
// 创建课程安排
|
|
async createCourseSchedule(data = {}) {
|
|
const token = uni.getStorageSync("token");
|
|
const apiPath = token ? '/courseSchedule/create' : '/test/courseSchedule/create';
|
|
return await http.post(apiPath, data);
|
|
},
|
|
// 批量创建课程安排
|
|
async batchCreateCourseSchedule(data = {}) {
|
|
return await http.post('/courseSchedule/batchCreate', data);
|
|
},
|
|
// 更新课程安排
|
|
async updateCourseSchedule(data = {}) {
|
|
return await http.post('/courseSchedule/update', data);
|
|
},
|
|
// 删除课程安排
|
|
async deleteCourseSchedule(data = {}) {
|
|
return await http.post('/courseSchedule/delete', data);
|
|
},
|
|
// 获取场地列表(课程安排模块专用)
|
|
async getCourseScheduleVenues(data = {}) {
|
|
return await http.get('/courseSchedule/venues', data);
|
|
},
|
|
// 获取场地可用时间(课程安排模块专用)
|
|
async getVenueAvailableTime(data = {}) {
|
|
return await http.get('/courseSchedule/venueAvailableTime', data);
|
|
},
|
|
// 获取场地时间选项(课程调整专用)
|
|
async getVenueTimeOptions(data = {}) {
|
|
return await http.get('/courseSchedule/venueTimeOptions', data);
|
|
},
|
|
// 检查教练时间冲突
|
|
async checkCoachConflict(data = {}) {
|
|
// 未登录或测试模式使用模拟数据
|
|
if (!uni.getStorageSync("token")) {
|
|
return this.checkCoachConflictMock(data);
|
|
}
|
|
return await http.get('/courseSchedule/checkCoachConflict', data);
|
|
},
|
|
|
|
// 模拟教练时间冲突检查
|
|
async checkCoachConflictMock(data = {}) {
|
|
// 模拟数据加载延迟
|
|
await new Promise(resolve => setTimeout(resolve, 300));
|
|
|
|
// 模拟冲突检查逻辑
|
|
const { coach_id, date, time_slot } = data;
|
|
|
|
// 日期匹配 2025-07-14 或 2025-07-15
|
|
const conflictDates = ['2025-07-14', '2025-07-15'];
|
|
|
|
// 特定教练和时间段的冲突场景
|
|
const hasConflict = (
|
|
// 张教练在特定日期的时间冲突
|
|
(coach_id == 1 && conflictDates.includes(date) && time_slot === '09:00-10:00') ||
|
|
// 李教练在特定日期的时间冲突
|
|
(coach_id == 2 && conflictDates.includes(date) && time_slot === '14:00-15:00') ||
|
|
// 随机生成一些冲突情况进行测试
|
|
(Math.random() < 0.2 && coach_id && date && time_slot)
|
|
);
|
|
|
|
return {
|
|
code: 1,
|
|
data: {
|
|
has_conflict: hasConflict,
|
|
conflict_schedules: hasConflict ? [
|
|
{
|
|
id: Math.floor(Math.random() * 1000),
|
|
course_name: hasConflict ? '冲突课程' : '',
|
|
time_slot: time_slot,
|
|
venue_name: '测试场地'
|
|
}
|
|
] : []
|
|
},
|
|
msg: 'SUCCESS'
|
|
};
|
|
},
|
|
// 获取课程安排统计
|
|
async getCourseScheduleStatistics(data = {}) {
|
|
return await http.get('/courseSchedule/statistics', data);
|
|
},
|
|
// 学员加入课程安排
|
|
async joinCourseSchedule(data = {}) {
|
|
return await http.post('/courseSchedule/joinSchedule', data);
|
|
},
|
|
// 学员退出课程安排
|
|
async leaveCourseSchedule(data = {}) {
|
|
return await http.post('/courseSchedule/leaveSchedule', data);
|
|
},
|
|
// 获取筛选选项
|
|
async getCourseScheduleFilterOptions(data = {}) {
|
|
return await http.get('/courseSchedule/filterOptions', data);
|
|
},
|
|
|
|
// 提交课程点名
|
|
async submitScheduleSignIn(data = {}) {
|
|
return await http.post('/courseSchedule/signIn', data);
|
|
},
|
|
|
|
//↓↓↓↓↓↓↓↓↓↓↓↓-----添加课程安排页面专用接口-----↓↓↓↓↓↓↓↓↓↓↓↓
|
|
// 获取课程列表(用于添加课程安排)
|
|
async getCourseListForSchedule(data = {}) {
|
|
// 检查是否有token,如果没有则使用测试接口
|
|
const token = uni.getStorageSync("token");
|
|
const apiPath = token ? '/course/list' : '/test/course/list';
|
|
return await http.get(apiPath, data);
|
|
},
|
|
// 获取班级列表(用于添加课程安排)
|
|
async getClassListForSchedule(data = {}) {
|
|
const token = uni.getStorageSync("token");
|
|
const apiPath = token ? '/class/list' : '/test/class/list';
|
|
return await http.get(apiPath, data);
|
|
},
|
|
// 获取教练列表(用于添加课程安排)
|
|
async getCoachListForSchedule(data = {}) {
|
|
const token = uni.getStorageSync("token");
|
|
const apiPath = token ? '/coach/list' : '/test/coach/list';
|
|
return await http.get(apiPath, data);
|
|
},
|
|
// 获取场地列表(用于添加课程安排 - 新开发的通用接口)
|
|
async getVenueListForSchedule(data = {}) {
|
|
const token = uni.getStorageSync("token");
|
|
const apiPath = token ? '/venue/list' : '/test/venue/list';
|
|
return await http.get(apiPath, data);
|
|
},
|
|
// 获取场地可用时间段(新开发的通用接口)
|
|
async getVenueTimeSlots(data = {}) {
|
|
const token = uni.getStorageSync("token");
|
|
const apiPath = token ? '/venue/timeSlots' : '/test/venue/timeSlots';
|
|
return await http.get(apiPath, data);
|
|
},
|
|
|
|
//↓↓↓↓↓↓↓↓↓↓↓↓-----课程安排详情页面接口-----↓↓↓↓↓↓↓↓↓↓↓↓
|
|
// 获取课程安排详情
|
|
async courseScheduleDetail(data = {}) {
|
|
return await http.get('/course/scheduleDetail', data);
|
|
},
|
|
|
|
// 搜索可添加的学员
|
|
async searchStudentsForSchedule(data = {}) {
|
|
return await http.get('/course/searchStudents', data);
|
|
},
|
|
|
|
// 添加学员到课程安排
|
|
async addStudentToSchedule(data = {}) {
|
|
return await http.post('/course/addStudentToSchedule', data);
|
|
},
|
|
|
|
// 从课程安排中移除学员
|
|
async removeStudentFromSchedule(data = {}) {
|
|
return await http.post('/course/removeStudentFromSchedule', data);
|
|
},
|
|
|
|
// 更新学员课程状态(请假等)
|
|
async updateStudentStatus(data = {}) {
|
|
return await http.post('/course/updateStudentStatus', data);
|
|
},
|
|
}
|