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.
1090 lines
36 KiB
1090 lines
36 KiB
import http from '../common/axios.js'
|
|
|
|
//全部api接口
|
|
export default {
|
|
//↓↓↓↓↓↓↓↓↓↓↓↓-----公共接口相关-----↓↓↓↓↓↓↓↓↓↓↓↓
|
|
//统一登录接口
|
|
async unifiedLogin(data = {}) {
|
|
const response = await http.post('/login/unified', data)
|
|
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_getBatchDict(keys = []) {
|
|
// 支持传入数组或字符串
|
|
const keyParam = Array.isArray(keys) ? keys.join(',') : keys
|
|
return await http.get('/dict/batch', { keys: keyParam })
|
|
},
|
|
|
|
//↓↓↓↓↓↓↓↓↓↓↓↓-----忘记密码相关接口-----↓↓↓↓↓↓↓↓↓↓↓↓
|
|
//发送验证码
|
|
async sendVerificationCode(data = {}) {
|
|
// 将 reset_password 映射为后端支持的 find_pass
|
|
let type = data.type || 'find_pass'
|
|
if (type === 'reset_password') {
|
|
type = 'find_pass'
|
|
}
|
|
return await http.post(`/send/mobile/${type}`, { mobile: data.mobile })
|
|
},
|
|
//验证验证码
|
|
async verifyCode(data = {}) {
|
|
return await http.post('/common/verifyCode', data)
|
|
},
|
|
//重置密码
|
|
async resetPassword(data = {}) {
|
|
return await http.post('/common/resetPassword', data)
|
|
},
|
|
//公共端-获取全部员工列表
|
|
async common_getPersonnelAll(data = {}) {
|
|
return await http.get('/personnel/getPersonnelAll', data)
|
|
},
|
|
//获取销售部门员工列表(根据校区筛选)
|
|
async getSalesPersonnelByCampus(data = {}) {
|
|
return await http.get('/personnel/getSalesPersonnelByCampus', 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_personnelCheckOldPwd(data = {}) {
|
|
return await http.post('/personnel/checkOldPwd', data)
|
|
},
|
|
//公共端-教师/销售端验证旧密码是否正确
|
|
async common_personnelEdidPassword(data = {}) {
|
|
return await http.post('/personnel/edidPassword', 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_getMiniWxOpenId(data = {}) {
|
|
return await http.post('/common/getMiniWxOpenId', data)
|
|
},
|
|
|
|
//微信登录相关接口
|
|
async wechatLogin(data = {}) {
|
|
return await http.post('/auth/login/wechat', data)
|
|
},
|
|
async wechatBind(data = {}) {
|
|
return await http.post('/auth/wechat/bind', data)
|
|
},
|
|
async getWechatAuthUrl(data = {}) {
|
|
return await http.get('/auth/wechat/auth_url', data)
|
|
},
|
|
|
|
//↓↓↓↓↓↓↓↓↓↓↓↓-----微信绑定相关接口-----↓↓↓↓↓↓↓↓↓↓↓↓
|
|
// 绑定微信openid到人员
|
|
async bindWechatOpenid(data = {}) {
|
|
return await http.post('/personnel/bindWechatOpenid', data)
|
|
},
|
|
// 微信公众号授权跳转
|
|
async wechatAuthorize(data = {}) {
|
|
return await http.get('/personnel/wechatAuthorize', data)
|
|
},
|
|
// 获取微信绑定状态
|
|
async getWechatBindStatus(data = {}) {
|
|
return await http.get('/personnel/getBindStatus', data)
|
|
},
|
|
|
|
//↓↓↓↓↓↓↓↓↓↓↓↓-----教练接口相关-----↓↓↓↓↓↓↓↓↓↓↓↓
|
|
//获取服务列表
|
|
async getServiceList(data = {}) {
|
|
return await http.get('/member/service/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 addStudent(data = {}) {
|
|
return await http.post('/course/addStudent', data)
|
|
},
|
|
//获取班级详情
|
|
async jlClassInfo(data = {}) {
|
|
return await http.get('/class/jlClassInfo', data)
|
|
},
|
|
//获取课程列表
|
|
async courseList(data = {}) {
|
|
return await http.get('/course/courseList', 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 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 searchStudents(data = {}) {
|
|
return await http.get('/customerResources/searchStudents', data)
|
|
},
|
|
|
|
// 获取预设学员信息(不受状态限制)
|
|
async getPresetStudentInfo(data = {}) {
|
|
return await http.get('/customerResources/getPresetStudentInfo', data)
|
|
},
|
|
|
|
//获取客户资源详情
|
|
async getCustomerResourcesInfo(data = {}) {
|
|
return await http.get('/resourceSharing/info', data)
|
|
},
|
|
//销售端-客户资源-获取修改日志列表
|
|
async xs_customerResourcesGetEditLogList(data = {}) {
|
|
return await http.get('/customerResources/getEditLogList', data)
|
|
},
|
|
//销售端-客户资源-获取赠品记录列表
|
|
async xs_customerResourcesGetGiftRecordList(data = {}) {
|
|
return await http.get('/customerResources/getGiftRecordList', data)
|
|
},
|
|
//销售端-客户资源-获取学生标签信息
|
|
async getStudentLabel(data = {}) {
|
|
return await http.get('/customerResources/getStudentLabel', data)
|
|
},
|
|
//销售端-客户资源-获取所有学生标签列表
|
|
async getAllStudentLabels(data = {}) {
|
|
return await http.get('/customerResources/getAllStudentLabels', 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_editStudent(data = {}) {
|
|
return await http.post('/student/edit', data)
|
|
},
|
|
//销售端-学员-列表
|
|
async xs_getStudentList(data = {}) {
|
|
return await http.get('/student/list', data)
|
|
},
|
|
//教练端-我的学员列表
|
|
async coach_getMyStudents(data = {}) {
|
|
return await http.get('/coach/students/my', 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_statisticsMarketData(data = {}) {
|
|
return await http.get('/statistics/marketData', data)
|
|
},
|
|
//员工端(销售)-订单管理-列表
|
|
async xs_orderTableList(data = {}) {
|
|
return await http.get('/orderTable', 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)
|
|
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_physicalTestAdd(data = {}) {
|
|
return await http.post('/xy/physicalTest/add', data)
|
|
},
|
|
//学生端-体测报告-编辑
|
|
async xy_physicalTestEdit(data = {}) {
|
|
return await http.post('/xy/physicalTest/edit', data)
|
|
},
|
|
//学生端-学习计划-列表
|
|
async getStudyPlanList(data = {}) {
|
|
return await http.get('/xy/studyPlan', data)
|
|
},
|
|
//学生端-学习计划-添加
|
|
async addStudyPlan(data = {}) {
|
|
return await http.post('/xy/studyPlan/add', data)
|
|
},
|
|
//学生端-学习计划-编辑
|
|
async editStudyPlan(data = {}) {
|
|
return await http.post('/xy/studyPlan/edit', 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_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_getStudentOrders(data = {}) {
|
|
return await http.get('/xy/student/orders', data)
|
|
},
|
|
//学生端-订单管理-详情
|
|
async xy_orderTableInfo(data = {}) {
|
|
return await http.get('/xy/orderTable/info', data)
|
|
},
|
|
//学生端-订单管理-详情(公开接口,用于学员端查看)
|
|
async xy_getStudentOrderDetail(data = {}) {
|
|
return await http.get('/xy/student/orders/detail', data)
|
|
},
|
|
// 获取通话记录
|
|
async listCallUp(data = {}) {
|
|
return await http.get('/per_list_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 reimbursement_add_with_approval(data = {}) {
|
|
return await http.post('/personnel/reimbursement_add_with_approval', data)
|
|
},
|
|
async reimbursementApprovalConfigs(data = {}) {
|
|
return await http.get('/personnel/reimbursement/approval-configs', data)
|
|
},
|
|
async schedule_del(data = {}) {
|
|
return await http.post('/course/schedule_del', data)
|
|
},
|
|
|
|
// 升级等待位学员为正式学员
|
|
async upgradeStudentSchedule(data = {}) {
|
|
return await http.post('/course/upgradeStudentSchedule', 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 checkClassRelation(data = {}) {
|
|
return await http.get('/course/checkClassRelation', data)
|
|
},
|
|
|
|
// 获取订单支付二维码
|
|
async getOrderPayQrcode(data = {}) {
|
|
return await http.get('/getQrcode', data)
|
|
},
|
|
|
|
// 查询订单支付状态
|
|
async checkOrderPaymentStatus(data = {}) {
|
|
return await http.get('/checkOrderPaymentStatus', data)
|
|
},
|
|
|
|
async updateOrderPaymentVoucher(data = {}) {
|
|
return await http.post('/updateOrderPaymentVoucher', data)
|
|
},
|
|
|
|
// 微信在线支付 - 创建支付订单
|
|
async createWechatPayment(data = {}) {
|
|
return await http.post('/pay', data)
|
|
},
|
|
|
|
// 获取微信openid(使用code换取)
|
|
async getWechatOpenid(data = {}) {
|
|
return await http.post('/personnel/getWechatOpenid', data)
|
|
},
|
|
|
|
//↓↓↓↓↓↓↓↓↓↓↓↓-----课程预约相关接口-----↓↓↓↓↓↓↓↓↓↓↓↓
|
|
// 获取可预约课程列表
|
|
async getAvailableCourses(data = {}) {
|
|
// 过滤掉undefined、null、空字符串的参数
|
|
const params = {}
|
|
if (data.date !== undefined && data.date !== null && data.date !== '') {
|
|
params.date = data.date
|
|
}
|
|
if (data.start_date !== undefined && data.start_date !== null && data.start_date !== '') {
|
|
params.start_date = data.start_date
|
|
}
|
|
if (data.end_date !== undefined && data.end_date !== null && data.end_date !== '') {
|
|
params.end_date = data.end_date
|
|
}
|
|
if (data.coach_id !== undefined && data.coach_id !== null && data.coach_id !== '') {
|
|
params.coach_id = data.coach_id
|
|
}
|
|
if (data.venue_id !== undefined && data.venue_id !== null && data.venue_id !== '') {
|
|
params.venue_id = data.venue_id
|
|
}
|
|
if (data.course_type !== undefined && data.course_type !== null && data.course_type !== '') {
|
|
params.course_type = data.course_type
|
|
}
|
|
|
|
return await http.get('/course-booking/available/' + data.student_id, params)
|
|
},
|
|
|
|
// 创建课程预约
|
|
async createBooking(data = {}) {
|
|
return await http.post('/course-booking/create', data)
|
|
},
|
|
|
|
// 获取我的预约列表
|
|
async getMyBookingList(data = {}) {
|
|
// 过滤掉undefined值,避免传递"undefined"字符串
|
|
const params = {}
|
|
if (data.status !== undefined && data.status !== null && data.status !== '') {
|
|
params.status = data.status
|
|
}
|
|
if (data.start_date !== undefined && data.start_date !== null && data.start_date !== '') {
|
|
params.start_date = data.start_date
|
|
}
|
|
if (data.end_date !== undefined && data.end_date !== null && data.end_date !== '') {
|
|
params.end_date = data.end_date
|
|
}
|
|
|
|
return await http.get('/course-booking/my-list/' + data.student_id, params)
|
|
},
|
|
|
|
// 取消预约
|
|
async cancelBooking(data = {}) {
|
|
return await http.post('/course-booking/cancel', data)
|
|
},
|
|
|
|
// 获取学员汇总信息
|
|
async getStudentSummary(student_id) {
|
|
return await http.get(`/student/summary/${student_id}`)
|
|
},
|
|
|
|
//↓↓↓↓↓↓↓↓↓↓↓↓-----课程安排相关接口-----↓↓↓↓↓↓↓↓↓↓↓↓
|
|
// 获取课程安排列表(支持学员和教练端)
|
|
async getCourseScheduleList(data = {}) {
|
|
let response
|
|
|
|
// 如果有student_id参数,说明是学员端调用,使用学员端API
|
|
if (data.student_id) {
|
|
response = await http.get('/course-schedule/list/' + data.student_id, {
|
|
date: data.date,
|
|
status: data.status,
|
|
start_date: data.start_date,
|
|
end_date: data.end_date,
|
|
})
|
|
} else {
|
|
// 否则是教练端调用,使用教练端API
|
|
response = await http.get('/courseSchedule/list', {
|
|
start_date: data.start_date,
|
|
end_date: data.end_date,
|
|
coach_id: data.coach_id,
|
|
venue_id: data.venue_id,
|
|
class_id: data.class_id,
|
|
time_range: data.time_range,
|
|
view_type: data.view_type,
|
|
page: data.page || 1,
|
|
limit: data.limit || 9999,
|
|
})
|
|
}
|
|
|
|
return response
|
|
},
|
|
|
|
// 申请课程请假
|
|
async requestCourseLeave(data = {}) {
|
|
return await http.post('/course-schedule/leave', data)
|
|
},
|
|
|
|
// 获取课程安排详情(用于课程调整页面)
|
|
async getCourseScheduleInfo(data = {}) {
|
|
return await http.get('/courseSchedule/info', data)
|
|
},
|
|
// 创建课程安排
|
|
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 = {}) {
|
|
return await http.get('/courseSchedule/checkCoachConflict', data)
|
|
},
|
|
|
|
// 获取课程安排统计
|
|
async getCourseScheduleStatistics(data = {}) {
|
|
// 如果有student_id参数,使用学员个人统计接口
|
|
if (data.student_id) {
|
|
const response = await http.get('/course-schedule/statistics/' + data.student_id, {
|
|
start_date: data.start_date,
|
|
end_date: data.end_date,
|
|
})
|
|
return response
|
|
} else {
|
|
// 否则使用全局统计接口
|
|
return await http.get('/course-schedule/courseSchedule/statistics', data)
|
|
}
|
|
},
|
|
// 获取筛选选项
|
|
async getCourseScheduleFilterOptions(data = {}) {
|
|
return await http.get('/courseSchedule/filterOptions', data)
|
|
},
|
|
|
|
// 提交课程点名
|
|
async submitScheduleSignIn(data = {}) {
|
|
return await http.post('/courseSchedule/batchSignIn', data)
|
|
},
|
|
|
|
//↓↓↓↓↓↓↓↓↓↓↓↓-----添加课程安排页面专用接口-----↓↓↓↓↓↓↓↓↓↓↓↓
|
|
|
|
// 获取所有排课选项(统一接口-支持校区过滤)
|
|
async getAllScheduleOptions(data = {}) {
|
|
const token = uni.getStorageSync('token')
|
|
const apiPath = token ? '/schedule/options/all' : '/test/schedule/options/all'
|
|
return await http.get(apiPath, data)
|
|
},
|
|
|
|
// 获取课程列表(用于添加课程安排)
|
|
async getCourseListForSchedule(data = {}) {
|
|
// 检查是否有token,如果没有则使用测试接口
|
|
const token = uni.getStorageSync('token')
|
|
const apiPath = token ? '/schedule/options/courses' : '/test/course/list'
|
|
return await http.get(apiPath, data)
|
|
},
|
|
// 获取班级列表(用于添加课程安排)
|
|
async getClassListForSchedule(data = {}) {
|
|
const token = uni.getStorageSync('token')
|
|
const apiPath = token ? '/schedule/options/classes' : '/test/class/list'
|
|
return await http.get(apiPath, data)
|
|
},
|
|
// 获取教练列表(用于添加课程安排)
|
|
async getCoachListForSchedule(data = {}) {
|
|
const token = uni.getStorageSync('token')
|
|
const apiPath = token ? '/schedule/options/coaches' : '/test/coach/list'
|
|
return await http.get(apiPath, data)
|
|
},
|
|
// 获取场地列表(用于添加课程安排 - 新开发的通用接口)
|
|
async getVenueListForSchedule(data = {}) {
|
|
const token = uni.getStorageSync('token')
|
|
const apiPath = token ? '/schedule/options/venues' : '/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('/courseSchedule/updateStudentStatus', data)
|
|
},
|
|
|
|
|
|
// 移除学员(统一接口)
|
|
async removeStudent(data = {}) {
|
|
return await http.post('/course/removeStudentFromSchedule', data)
|
|
},
|
|
|
|
// 恢复学员(统一接口)
|
|
async restoreStudent(data = {}) {
|
|
return await http.post('/course/restoreStudent', data)
|
|
},
|
|
|
|
//↓↓↓↓↓↓↓↓↓↓↓↓-----统一课程安排详情管理接口(与admin端保持一致)-----↓↓↓↓↓↓↓↓↓↓↓↓
|
|
|
|
// 获取课程安排详情(新统一接口 - 对接admin端)
|
|
async getCourseArrangementDetail(data = {}) {
|
|
return await http.get('/course/scheduleDetail', data)
|
|
},
|
|
|
|
// 搜索学员(新统一接口 - 对接admin端)
|
|
async searchStudentsForArrangement(data = {}) {
|
|
return await http.get('/course/searchStudents', data)
|
|
},
|
|
|
|
// 添加学员到课程安排(新统一接口 - 对接admin端)
|
|
async addStudentToArrangement(data = {}) {
|
|
return await http.post('/course/addStudentToSchedule', data)
|
|
},
|
|
|
|
// 移除学员(新统一接口 - 对接admin端)
|
|
async removeStudentFromArrangement(data = {}) {
|
|
return await http.post('/course/removeStudentFromSchedule', data)
|
|
},
|
|
|
|
// 升级学员(新统一接口 - 对接admin端)
|
|
async upgradeStudentInArrangement(data = {}) {
|
|
return await http.post('/course/upgradeStudent', data)
|
|
},
|
|
|
|
// 更新学员状态(新统一接口 - 对接admin端)
|
|
async updateStudentStatusInArrangement(data = {}) {
|
|
return await http.post('/courseSchedule/updateStudentStatus', data)
|
|
},
|
|
|
|
// 删除学员所有未来课程安排
|
|
async deleteStudentFutureSchedules(data = {}) {
|
|
return await http.post('/courseSchedule/deleteStudentFutureSchedules', data)
|
|
},
|
|
|
|
// 恢复学员(新统一接口 - 对接admin端)
|
|
async restoreStudentInArrangement(data = {}) {
|
|
return await http.post('/course/restoreStudent', data)
|
|
},
|
|
|
|
//↓↓↓↓↓↓↓↓↓↓↓↓-----学员出勤管理相关接口-----↓↓↓↓↓↓↓↓↓↓↓↓
|
|
|
|
// 学员签到
|
|
async studentCheckin(data = {}) {
|
|
return await http.post('/student/attendance/checkin', data)
|
|
},
|
|
|
|
// 学员请假
|
|
async studentLeave(data = {}) {
|
|
return await http.post('/student/attendance/leave', data)
|
|
},
|
|
|
|
// 学员取消
|
|
async studentCancel(data = {}) {
|
|
return await http.post('/student/attendance/cancel', data)
|
|
},
|
|
|
|
// 将等待位学员转为正式课学员(保持接口兼容性)
|
|
async convertWaitingToFormal(data = {}) {
|
|
return await http.post('/course/convertWaitingToFormal', data)
|
|
},
|
|
|
|
//↓↓↓↓↓↓↓↓↓↓↓↓-----学员合同管理相关接口-----↓↓↓↓↓↓↓↓↓↓↓↓
|
|
|
|
// 获取学员合同列表
|
|
async getStudentContracts(data = {}) {
|
|
const params = {
|
|
student_id: data.student_id,
|
|
status: data.status,
|
|
page: data.page || 1,
|
|
limit: data.limit || 10,
|
|
}
|
|
return await http.get('/student/contracts', params)
|
|
},
|
|
|
|
// 获取合同详情
|
|
async getStudentContractDetail(data = {}) {
|
|
const params = {
|
|
student_id: data.student_id,
|
|
}
|
|
return await http.get('/student/contract/info', {
|
|
contract_id: data.contract_id,
|
|
student_id: data.student_id,
|
|
})
|
|
},
|
|
|
|
// 获取合同签署表单配置
|
|
async getStudentContractSignForm(data = {}) {
|
|
const params = {
|
|
student_id: data.student_id,
|
|
}
|
|
return await http.get('/student/contract/sign-form', {
|
|
contract_id: data.contract_id,
|
|
student_id: data.student_id,
|
|
})
|
|
},
|
|
|
|
// 根据签署记录ID获取合同签署表单配置(新方法-支持按签署关系区分字段)
|
|
async getStudentContractSignFormBySignId(data = {}) {
|
|
return await http.get('/contract/getStudentContractSignFormBySignId', {
|
|
contract_sign_id: data.contract_sign_id,
|
|
student_id: data.student_id,
|
|
})
|
|
},
|
|
|
|
// 学员提交合同签署
|
|
async signStudentContract(data = {}) {
|
|
return await http.post('/contract/signStudentContract', {
|
|
contract_id: data.contract_id,
|
|
contract_sign_id: data.contract_sign_id,
|
|
student_id: data.student_id,
|
|
form_data: data.form_data,
|
|
signature_image: data.signature_image,
|
|
})
|
|
},
|
|
|
|
// 员工端提交合同签署
|
|
async signStaffContract(data = {}) {
|
|
return await http.post('/contract/signStaffContract', {
|
|
contract_id: data.contract_id,
|
|
contract_sign_id: data.contract_sign_id,
|
|
form_data: data.form_data,
|
|
signature_image: data.signature_image,
|
|
})
|
|
},
|
|
|
|
// 确认生成合同
|
|
async confirmGenerateContract(data = {}) {
|
|
return await http.post('/contract/confirmGenerateContract', {
|
|
contract_sign_id: data.contract_sign_id,
|
|
})
|
|
},
|
|
|
|
// 下载合同文件
|
|
async downloadStudentContract(data = {}) {
|
|
const params = {
|
|
student_id: data.student_id,
|
|
}
|
|
return await http.get('/student/contract/download', {
|
|
contract_id: data.contract_id,
|
|
student_id: data.student_id,
|
|
})
|
|
},
|
|
|
|
// 获取学员基本信息
|
|
async getStudentInfo(data = {}) {
|
|
return await http.get(`/student/info/${data.student_id}`)
|
|
},
|
|
|
|
// 获取当前用户的学员列表
|
|
async getMyStudentList() {
|
|
return await http.get('/student/mychild')
|
|
},
|
|
|
|
// 获取学员基本信息(员工端)
|
|
async getStudentBasicInfo(data = {}) {
|
|
return await http.get(`/student/info/${data.student_id}`)
|
|
},
|
|
|
|
//↓↓↓↓↓↓↓↓↓↓↓↓-----员工端合同管理相关接口-----↓↓↓↓↓↓↓↓↓↓↓↓
|
|
|
|
// 获取我的合同列表
|
|
async getMyContracts(data = {}) {
|
|
return await http.get('/contract/myContracts', data)
|
|
},
|
|
|
|
// 获取合同统计数据(暂时使用合同列表接口)
|
|
async getContractStats(data = {}) {
|
|
return await http.get('/contract/myContracts', data)
|
|
},
|
|
|
|
// 获取合同详情
|
|
async getContractDetail(contractId) {
|
|
return await http.get('/contract/detail', { id: contractId })
|
|
},
|
|
|
|
// 获取合同表单字段(暂时返回空,需要后端实现)
|
|
async getContractFormFields(contractId) {
|
|
return { code: 1, data: [] }
|
|
},
|
|
|
|
// 提交合同表单数据(暂时返回成功,需要后端实现)
|
|
async submitContractFormData(contractId, data = {}) {
|
|
return { code: 1, data: {} }
|
|
},
|
|
|
|
// 提交合同签名
|
|
async submitContractSignature(contractId, data = {}) {
|
|
return await http.post('/contract/sign', {
|
|
contract_id: contractId,
|
|
sign_file: data.sign_file,
|
|
})
|
|
},
|
|
|
|
// 生成合同文档(暂时返回成功,需要后端实现)
|
|
async generateContractDocument(contractId) {
|
|
return { code: 1, data: {} }
|
|
},
|
|
|
|
// 根据订单获取合同信息
|
|
async getContractByOrder(data = {}) {
|
|
return await http.get('/contract/getByOrder', {
|
|
order_id: data.order_id,
|
|
student_id: data.student_id,
|
|
})
|
|
},
|
|
|
|
//↓↓↓↓↓↓↓↓↓↓↓↓-----知识库管理相关接口-----↓↓↓↓↓↓↓↓↓↓↓↓
|
|
|
|
// 获取知识文章列表
|
|
async getKnowledgeList(data = {}) {
|
|
const params = {
|
|
category: data.category,
|
|
page: data.page || 1,
|
|
limit: data.limit || 10,
|
|
keyword: data.keyword,
|
|
}
|
|
const response = await http.get(`/knowledge-test/list/${data.student_id}`, params)
|
|
return response
|
|
},
|
|
|
|
// 获取知识分类列表
|
|
async getKnowledgeCategories(data = {}) {
|
|
const response = await http.get('/knowledge-test/categories')
|
|
return response
|
|
},
|
|
|
|
// 获取文章详情
|
|
async getKnowledgeDetail(data = {}) {
|
|
const params = {
|
|
student_id: data.student_id,
|
|
}
|
|
const response = await http.get(`/knowledge-test/detail/${data.id}`, params)
|
|
return response
|
|
},
|
|
|
|
// 标记文章已读
|
|
async markArticleRead(data = {}) {
|
|
const response = await http.post('/knowledge-test/mark-read', {
|
|
article_id: data.article_id,
|
|
student_id: data.student_id,
|
|
})
|
|
return response
|
|
},
|
|
|
|
// 搜索知识文章
|
|
async searchKnowledgeArticles(data = {}) {
|
|
const params = {
|
|
keyword: data.keyword,
|
|
category: data.category,
|
|
page: data.page || 1,
|
|
limit: data.limit || 10,
|
|
}
|
|
const response = await http.get(`/knowledge-test/search/${data.student_id}`, params)
|
|
return response
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//↓↓↓↓↓↓↓↓↓↓↓↓-----学员端消息管理相关接口-----↓↓↓↓↓↓↓↓↓↓↓↓
|
|
|
|
// 获取学员消息列表
|
|
async getStudentMessageList(data = {}) {
|
|
const params = {
|
|
message_type: data.message_type,
|
|
page: data.page || 1,
|
|
limit: data.limit || 10,
|
|
keyword: data.keyword,
|
|
is_read: data.is_read,
|
|
}
|
|
const response = await http.get(`/message/list/${data.student_id}`, params)
|
|
return response
|
|
},
|
|
|
|
// 获取消息详情
|
|
async getStudentMessageDetail(data = {}) {
|
|
const params = {
|
|
student_id: data.student_id,
|
|
}
|
|
const response = await http.get(`/message/detail/${data.message_id}`, params)
|
|
return response
|
|
},
|
|
|
|
// 标记消息已读
|
|
async markStudentMessageRead(data = {}) {
|
|
const response = await http.post('/message/mark-read', {
|
|
message_id: data.message_id,
|
|
student_id: data.student_id,
|
|
})
|
|
return response
|
|
},
|
|
|
|
// 获取对话中的所有消息
|
|
async getConversationMessages(data = {}) {
|
|
const params = {
|
|
student_id: data.student_id,
|
|
from_type: data.from_type,
|
|
from_id: data.from_id,
|
|
page: data.page || 1,
|
|
limit: data.limit || 20,
|
|
}
|
|
const response = await http.get('/message/conversation', params)
|
|
return response
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|