Browse Source

修改页面

master
王泽彦 10 months ago
parent
commit
60fff21f33
  1. 779
      api/apiRoute.js
  2. 253
      common/axios.js
  3. 280
      components/AQ/AQTabber.vue
  4. 1190
      pages.json
  5. 152
      pages/market/clue/edit_clues.vue
  6. 375
      pages/market/home/index.vue
  7. 614
      pages/market/index/index.vue
  8. 671
      pages/student/login/login.vue

779
api/apiRoute.js

@ -2,702 +2,321 @@ import http from '../common/axios.js'
//全部api接口 //全部api接口
export default { export default {
// getDemo(data = {}) {
// let url = '/member/member_edit'
// return http.get(url, data).then(res => {
// return res;
// })
// },
// postDemo(data = {}) {
// let url = '/member/member_edit'
// return http.post(url, data).then(res => {
// return res;
// })
// },
//↓↓↓↓↓↓↓↓↓↓↓↓-----公共接口相关-----↓↓↓↓↓↓↓↓↓↓↓↓ //↓↓↓↓↓↓↓↓↓↓↓↓-----公共接口相关-----↓↓↓↓↓↓↓↓↓↓↓↓
//教师/销售端登陆 //教师/销售端登陆
personnelLogin(data = {}) { async personnelLogin(data = {}) {
let url = '/personnelLogin' const response = await http.post('/personnelLogin', data);
return http.post(url, data).then(res => { console.log('登录响应:', response);
return res; return response;
})
}, },
//教师/销售端详情 //教师/销售端详情
getPersonnelInfo(data = {}) { async getPersonnelInfo(data = {}) {
let url = '/personnel/info' return await http.get('/personnel/info', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//教师/销售端详情 //教师/销售端详情
editPersonnelInfo(data = {}) { async editPersonnelInfo(data = {}) {
let url = '/personnel/edit' return await http.post('/personnel/edit', data);
return http.post(url, data).then(res => {
return res;
})
}, },
//教师/销售端请假/打卡/签退-编辑 //教师/销售端请假/打卡/签退-编辑
common_attendanceEdit(data = {}) { async common_attendanceEdit(data = {}) {
let url = '/attendance/edit' return await http.post('/attendance/edit', data);
return http.post(url, data).then(res => {
return res;
})
}, },
//教师/销售端请假/打卡/签退-列表 //教师/销售端请假/打卡/签退-列表
common_attendanceIndex(data = {}) { async common_attendanceIndex(data = {}) {
let url = '/attendance/index' return await http.post('/attendance/index', data);
return http.post(url, data).then(res => {
return res;
})
}, },
//获取字典数据 //获取字典数据
common_Dictionary(data = {}) { async common_Dictionary(data = {}) {
let url = '/common/getDictionary' return await http.get('/common/getDictionary', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//公共端-获取全部员工列表 //公共端-获取全部员工列表
common_getPersonnelAll(data = {}) { async common_getPersonnelAll(data = {}) {
let url = '/personnel/getPersonnelAll' return await http.get('/personnel/getPersonnelAll', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//公共端-获取全部课程列表 //公共端-获取全部课程列表
common_getCourseAll(data = {}) { async common_getCourseAll(data = {}) {
let url = '/common/getCourseAll' return await http.get('/common/getCourseAll', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//公共端-获取全部班级列表 //公共端-获取全部班级列表
common_getClassAll(data = {}) { async common_getClassAll(data = {}) {
let url = '/common/getClassAll' return await http.get('/common/getClassAll', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//公共端-教师/销售端验证旧密码是否正确 //公共端-教师/销售端验证旧密码是否正确
common_personnelCheckOldPwd(data = {}) { async common_personnelCheckOldPwd(data = {}) {
let url = '/personnel/checkOldPwd' return await http.post('/personnel/checkOldPwd', data);
return http.post(url, data).then(res => {
return res;
})
}, },
//公共端-教师/销售端验证旧密码是否正确 //公共端-教师/销售端验证旧密码是否正确
common_personnelEdidPassword(data = {}) { async common_personnelEdidPassword(data = {}) {
let url = '/personnel/edidPassword' return await http.post('/personnel/edidPassword', data);
return http.post(url, data).then(res => {
return res;
})
}, },
//公共端-教师/销售端验证旧密码是否正确 //公共端-教师/销售端验证旧密码是否正确
common_getPersonnelCampus(data = {}) { async common_getPersonnelCampus(data = {}) {
let url = '/campus/getPersonnelCampus' return await http.get('/campus/getPersonnelCampus', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//公共端-忘记密码-通过短信验证码进行密码重置(学生/员工通用) //公共端-忘记密码-通过短信验证码进行密码重置(学生/员工通用)
common_forgetPassword(data = {}) { async common_forgetPassword(data = {}) {
let url = '/common/forgetPassword' return await http.post('/common/forgetPassword', data);
return http.post(url, data).then(res => {
return res;
})
}, },
//公共端-获取配置项 //公共端-获取配置项
common_getConfig(data = {}) { async common_getConfig(data = {}) {
let url = '/common/getConfig' return await http.get('/common/getConfig', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//公共端-获取配置项 //公共端-获取配置项
common_getMiniWxOpenId(data = {}) { async common_getMiniWxOpenId(data = {}) {
let url = '/common/getMiniWxOpenId' return await http.post('/common/getMiniWxOpenId', data);
return http.post(url, data).then(res => {
return res;
})
}, },
//↑↑↑↑↑↑↑↑↑↑↑↑-----公共接口相关-----↑↑↑↑↑↑↑↑↑↑↑↑
//↓↓↓↓↓↓↓↓↓↓↓↓-----教练接口相关-----↓↓↓↓↓↓↓↓↓↓↓↓ //↓↓↓↓↓↓↓↓↓↓↓↓-----教练接口相关-----↓↓↓↓↓↓↓↓↓↓↓↓
//获取我的页面统计个数
async getStatisticsInfo(data = {}) {
return await http.get('/class/Statistics/info', data);
},
//添加作业
async jlPublishJob(data = {}) {
//获取我的页面统计个数 return await http.get('/class/jlPublishJob/add', data);
getStatisticsInfo(data = {}) { },
let url = '/class/Statistics/info' //添加作业-学员列表
return http.get(url, data).then(res => { async jlGetStudentList(data = {}) {
return res; return await http.get('/class/jlGetStudentList/list', data);
}) },
}, //添加作业-获取课程列表
//添加作业 async jlGetCoursesList(data = {}) {
jlPublishJob(data = {}) { return await http.get('/class/jlGetCoursesList/list', data);
let url = '/class/jlPublishJob/add' },
return http.get(url, data).then(res => { //添加作业-获取班级列表
return res; async jlGetClassesList(data = {}) {
}) return await http.get('/class/jlGetClasses/list', data);
}, },
//添加作业-学员列表 //体测报告-详情
jlGetStudentList(data = {}) { async physicalTestInfo(data = {}) {
let url = '/class/jlGetStudentList/list' return await http.get('/class/physicalTest/info', data);
return http.get(url, data).then(res => { },
return res; //体测报告-列表
}) async physicalTest(data = {}) {
}, return await http.get('/class/physicalTest', data);
//添加作业-获取课程列表 },
jlGetCoursesList(data = {}) { //获取学员详情
let url = '/class/jlGetCoursesList/list' async jlStudentsInfo(data = {}) {
return http.get(url, data).then(res => { return await http.get('/class/jlStudentsInfo', data);
return res; },
}) //获取添加学员列表
}, async addStudentList(data = {}) {
//添加作业-获取班级列表 return await http.get('/course/addStudentList', data);
jlGetClassesList(data = {}) { },
let url = '/class/jlGetClasses/list' async addStudent(data = {}) {
return http.get(url, data).then(res => { return await http.post('/course/addStudent', data);
return res; },
}) async delStudentCourse(data = {}) {
}, return await http.get('/course/delStudentCourse', data);
//体测报告-详情 },
physicalTestInfo(data = {}) { //获取班级列表
let url = '/class/physicalTest/info' async jlClassList(data = {}) {
return http.get(url, data).then(res => { return await http.get('/class/jlClassList', data);
return res; },
}) //获取班级详情
}, async jlClassInfo(data = {}) {
//体测报告-列表 return await http.get('/class/jlClassInfo', data);
physicalTest(data = {}) { },
let url = '/class/physicalTest' //获取课程列表
return http.get(url, data).then(res => { async courseList(data = {}) {
return res; return await http.get('/course/courseList', data);
}) },
}, //获取班级课程列表
//获取学员详情 async classCourseList(data = {}) {
jlStudentsInfo(data = {}) { return await http.get('/course/classCourseList', data);
let url = '/class/jlStudentsInfo' },
return http.get(url, data).then(res => { //获取课程详情
return res; async courseInfo(data = {}) {
}) return await http.get('/course/courseInfo', data);
}, },
//获取添加学员列表 //教研管理文章列表
addStudentList(data = {}) { async teachingResearchList(data = {}) {
let url = '/course/addStudentList' return await http.get('/teachingResearch/list', data);
return http.get(url, data).then(res => { },
return res; //教研管理文章详情
}) async teachingResearchInfo(id) {
}, return await http.get('/teachingResearch/info/' + id);
addStudent(data = {}) { },
let url = '/course/addStudent' //获取能看的教研管理类型
return http.post(url, data).then(res => { async teachingResearchLookType(data = {}) {
return res; return await http.get('/teachingResearch/lookType', data);
}) },
}, //获取试卷
delStudentCourse(data = {}) { async getTeachingTestPaper(data = {}) {
let url = '/course/delStudentCourse' return await http.get('/teachingResearch/teachingTestPaper', data);
return http.get(url, data).then(res => { },
return res; //提交试卷
}) async submitTestPaper(data = {}) {
}, return await http.get('/teachingResearch/submitTestPaper', data);
//获取班级列表 },
jlClassList(data = {}) {
let url = '/class/jlClassList'
return http.get(url, data).then(res => {
return res;
})
},
//获取班级详情
jlClassInfo(data = {}) {
let url = '/class/jlClassInfo'
return http.get(url, data).then(res => {
return res;
})
},
//获取课程列表
courseList(data = {}) {
let url = '/course/courseList'
return http.get(url, data).then(res => {
return res;
})
},
//获取班级课程列表
classCourseList(data = {}) {
let url = '/course/classCourseList'
return http.get(url, data).then(res => {
return res;
})
},
//获取课程详情
courseInfo(data = {}) {
let url = '/course/courseInfo'
return http.get(url, data).then(res => {
return res;
})
},
//教研管理文章列表
teachingResearchList(data = {}) {
let url = '/teachingResearch/list'
return http.get(url, data).then(res => {
return res;
})
},
//教研管理文章详情
teachingResearchInfo(id) {
let url = '/teachingResearch/info/' + id
return http.get(url).then(res => {
return res;
})
},
//获取能看的教研管理类型
teachingResearchLookType(data = {}) {
let url = '/teachingResearch/lookType'
return http.get(url, data).then(res => {
return res;
})
},
//获取试卷
getTeachingTestPaper(data = {}) {
let url = '/teachingResearch/teachingTestPaper'
return http.get(url, data).then(res => {
return res;
})
},
//提交试卷
submitTestPaper(data = {}) {
let url = '/teachingResearch/submitTestPaper'
return http.get(url, data).then(res => {
return res;
})
},
//↑↑↑↑↑↑↑↑↑↑↑↑-----教练接口相关-----↑↑↑↑↑↑↑↑↑↑↑↑
//↓↓↓↓↓↓↓↓↓↓↓↓-----销售接口相关-----↓↓↓↓↓↓↓↓↓↓↓↓ //↓↓↓↓↓↓↓↓↓↓↓↓-----销售接口相关-----↓↓↓↓↓↓↓↓↓↓↓↓
//修改销售端个人资料 //修改销售端个人资料
editPersonnel(data = {}) { async editPersonnel(data = {}) {
let url = '/personnel/info' return await http.get('/personnel/info', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//销售端-客户资源-添加 //销售端-客户资源-添加
xs_addCustomerResources(data = {}) { async xs_addCustomerResources(data = {}) {
let url = '/customerResources/add' return await http.post('/customerResources/add', data);
return http.post(url, data).then(res => {
return res;
})
}, },
//销售端-客户资源-编辑 //销售端-客户资源-编辑
xs_editCustomerResources(data = {}) { async xs_editCustomerResources(data = {}) {
let url = '/customerResources/edit' return await http.post('/customerResources/edit', data);
return http.post(url, data).then(res => {
return res;
})
}, },
//销售端-查询客户资源全部列表 //销售端-查询客户资源全部列表
xs_getAllCustomerResources(data = {}) { async xs_getAllCustomerResources(data = {}) {
let url = '/customerResources/getAll' return await http.get('/customerResources/getAll', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//销售端-客户资源-获取修改日志列表 //销售端-客户资源-获取修改日志列表
xs_customerResourcesGetEditLogList(data = {}) { async xs_customerResourcesGetEditLogList(data = {}) {
let url = '/customerResources/getEditLogList' return await http.get('/customerResources/getEditLogList', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//销售端-资源共享-列表 //销售端-资源共享-列表
xs_resourceSharingIndex(data = {}) { async xs_resourceSharingIndex(data = {}) {
let url = '/resourceSharing/index' return await http.get('/resourceSharing/index', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//销售端-资源共享-分配员工 //销售端-资源共享-分配员工
xs_resourceSharingAssign(data = {}) { async xs_resourceSharingAssign(data = {}) {
let url = '/resourceSharing/assign' return await http.post('/resourceSharing/assign', data);
return http.post(url, data).then(res => {
return res;
})
}, },
//销售端-资源共享-详情(客户资源详情) //销售端-资源共享-详情(客户资源详情)
xs_resourceSharingInfo(data = {}) { async xs_resourceSharingInfo(data = {}) {
let url = '/resourceSharing/info' return await http.get('/resourceSharing/info', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//销售端-沟通记录-添加 //销售端-沟通记录-添加
xs_communicationRecordsAdd(data = {}) { async xs_communicationRecordsAdd(data = {}) {
let url = '/communicationRecords/add' return await http.post('/communicationRecords/add', data);
return http.post(url, data).then(res => {
return res;
})
}, },
//销售端-获取好友关系绑定详情 //销售端-获取好友关系绑定详情
xs_chatGetChatFriendsInfo(data = {}) { async xs_chatGetChatFriendsInfo(data = {}) {
let url = '/chat/getChatFriendsInfo' return await http.get('/chat/getChatFriendsInfo', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//销售端-获取聊天消息列表 //销售端-获取聊天消息列表
xs_chatGetChatMessagesList(data = {}) { async xs_chatGetChatMessagesList(data = {}) {
let url = '/chat/getChatMessagesList' return await http.get('/chat/getChatMessagesList', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//销售端-发送聊天消息 //销售端-发送聊天消息
xs_chatSendChatMessages(data = {}) { async xs_chatSendChatMessages(data = {}) {
let url = '/chat/sendChatMessages' return await http.post('/chat/sendChatMessages', data);
return http.post(url, data).then(res => {
return res;
})
}, },
//销售端-好友关系列表 //销售端-好友关系列表
xs_chatGetChatFriendsList(data = {}) { async xs_chatGetChatFriendsList(data = {}) {
let url = '/chat/getChatFriendsList' return await http.get('/chat/getChatFriendsList', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//员工端统计(销售)-获取销售首页数据统计 //员工端统计(销售)-获取销售首页数据统计
xs_statisticsMarketHome(data = {}) { async xs_statisticsMarketHome(data = {}) {
let url = '/statistics/marketHome' return await http.get('/statistics/marketHome', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//员工端统计(销售)-获取销售数据页统计 //员工端统计(销售)-获取销售数据页统计
xs_statisticsMarketData(data = {}) { async xs_statisticsMarketData(data = {}) {
let url = '/statistics/marketData' return await http.get('/statistics/marketData', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//员工端(销售)-订单管理-列表 //员工端(销售)-订单管理-列表
xs_orderTableList(data = {}) { async xs_orderTableList(data = {}) {
let url = '/orderTable' return await http.get('/orderTable', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//员工端(销售)-订单管理-详情 //员工端(销售)-订单管理-详情
xs_orderTableInfo(data = {}) { async xs_orderTableInfo(data = {}) {
let url = '/orderTable/info' return await http.get('/orderTable/info', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//员工端(销售)-订单管理-添加 //员工端(销售)-订单管理-添加
xs_orderTableAdd(data = {}) { async xs_orderTableAdd(data = {}) {
let url = '/orderTable/add' return await http.post('/orderTable/add', data);
return http.post(url, data).then(res => {
return res;
})
}, },
//↑↑↑↑↑↑↑↑↑↑↑↑-----销售接口相关-----↑↑↑↑↑↑↑↑↑↑↑
//↓↓↓↓↓↓↓↓↓↓↓↓-----学生接口相关-----↓↓↓↓↓↓↓↓↓↓↓↓ //↓↓↓↓↓↓↓↓↓↓↓↓-----学生接口相关-----↓↓↓↓↓↓↓↓↓↓↓↓
//学生登陆接口 //学生登陆接口
xy_login(data = {}) { async xy_login(data = {}) {
let url = '/customerResourcesAuth/login' const response = await http.post('/customerResourcesAuth/login', data);
return http.post(url, data).then(res => { console.log('学生登录响应:', response);
return res; return response;
})
}, },
//学生详情 //学生详情
xy_memberInfo(data = {}) { async xy_memberInfo(data = {}) {
let url = '/customerResourcesAuth/info' return await http.get('/customerResourcesAuth/info', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//学生详情-修改 //学生详情-修改
xy_memberEdit(data = {}) { async xy_memberEdit(data = {}) {
let url = '/customerResourcesAuth/edit' return await http.post('/customerResourcesAuth/edit', data);
return http.post(url, data).then(res => {
return res;
})
}, },
//学生-意见反馈-添加 //学生-意见反馈-添加
xy_userFeedbackAdd(data = {}) { async xy_userFeedbackAdd(data = {}) {
let url = '/userFeedback/add' return await http.post('/userFeedback/add', data);
return http.post(url, data).then(res => {
return res;
})
}, },
//学生端-获取好友关系绑定详情 //学生端-获取好友关系绑定详情
xy_chatGetChatFriendsInfo(data = {}) { async xy_chatGetChatFriendsInfo(data = {}) {
let url = '/xy/chat/getChatFriendsInfo' return await http.get('/xy/chat/getChatFriendsInfo', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//学生端-获取聊天消息列表 //学生端-获取聊天消息列表
xy_chatGetChatMessagesList(data = {}) { async xy_chatGetChatMessagesList(data = {}) {
let url = '/xy/chat/getChatMessagesList' return await http.get('/xy/chat/getChatMessagesList', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//学生端-发送聊天消息 //学生端-发送聊天消息
xy_chatSendChatMessages(data = {}) { async xy_chatSendChatMessages(data = {}) {
let url = '/xy/chat/sendChatMessages' return await http.post('/xy/chat/sendChatMessages', data);
return http.post(url, data).then(res => {
return res;
})
}, },
//学生端-好友关系列表 //学生端-好友关系列表
xy_chatGetChatFriendsList(data = {}) { async xy_chatGetChatFriendsList(data = {}) {
let url = '/xy/chat/getChatFriendsList' return await http.get('/xy/chat/getChatFriendsList', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//学生端-体测报告-列表 //学生端-体测报告-列表
xy_physicalTest(data = {}) { async xy_physicalTest(data = {}) {
let url = '/xy/physicalTest' return await http.get('/xy/physicalTest', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//学生端-体测报告-详情 //学生端-体测报告-详情
xy_physicalTestInfo(data = {}) { async xy_physicalTestInfo(data = {}) {
let url = '/xy/physicalTest/info' return await http.get('/xy/physicalTest/info', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//学生端-学生课程安排-列表 //学生端-学生课程安排-列表
xy_personCourseSchedule(data = {}) { async xy_personCourseSchedule(data = {}) {
let url = '/xy/personCourseSchedule' return await http.get('/xy/personCourseSchedule', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//学生端-学生课程安排-详情 //学生端-学生课程安排-详情
xy_personCourseScheduleInfo(data = {}) { async xy_personCourseScheduleInfo(data = {}) {
let url = '/xy/personCourseSchedule/info' return await http.get('/xy/personCourseSchedule/info', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//学生端-学生课程安排-修改请假状态 //学生端-学生课程安排-修改请假状态
xy_personCourseScheduleEditStatus(data = {}) { async xy_personCourseScheduleEditStatus(data = {}) {
let url = '/xy/personCourseSchedule/editStatus' return await http.post('/xy/personCourseSchedule/editStatus', data);
return http.post(url, data).then(res => {
return res;
})
}, },
//学生端-学生课程安排-获取排课日历 //学生端-学生课程安排-获取排课日历
xy_personCourseScheduleGetCalendar(data = {}) { async xy_personCourseScheduleGetCalendar(data = {}) {
let url = '/xy/personCourseSchedule/getCalendar' return await http.get('/xy/personCourseSchedule/getCalendar', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//学生端-学生课程安排-获取学生排课的全部场地列表 //学生端-学生课程安排-获取学生排课的全部场地列表
xy_personCourseScheduleGetVenueListAll(data = {}) { async xy_personCourseScheduleGetVenueListAll(data = {}) {
let url = '/xy/personCourseSchedule/getVenueListAll' return await http.get('/xy/personCourseSchedule/getVenueListAll', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//学生端-学生课程安排-获取学生排课的全部场地列表 //学生端-学生课程安排-获取学生排课的全部场地列表
xy_personCourseScheduleGetMyCoach(data = {}) { async xy_personCourseScheduleGetMyCoach(data = {}) {
let url = '/xy/personCourseSchedule/getMyCoach' return await http.get('/xy/personCourseSchedule/getMyCoach', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//学生端-学生课程安排-获取学生课程消耗记录列表 //学生端-学生课程安排-获取学生课程消耗记录列表
xy_personCourseScheduleGetStudentCourseUsageList(data = {}) { async xy_personCourseScheduleGetStudentCourseUsageList(data = {}) {
let url = '/xy/personCourseSchedule/getStudentCourseUsageList' return await http.get('/xy/personCourseSchedule/getStudentCourseUsageList', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//学生端-获取作业列表 //学生端-获取作业列表
xy_assignment(data = {}) { async xy_assignment(data = {}) {
let url = '/xy/assignment' return await http.get('/xy/assignment', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//学生端-获取作业详情 //学生端-获取作业详情
xy_assignmentsInfo(data = {}) { async xy_assignmentsInfo(data = {}) {
let url = '/xy/assignment/info' return await http.get('/xy/assignment/info', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//学生端-提交作业 //学生端-提交作业
xy_assignmentSubmitObj(data = {}) { async xy_assignmentSubmitObj(data = {}) {
let url = '/xy/assignment/submitObj' return await http.get('/xy/assignment/submitObj', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//学生端-订单管理-列表 //学生端-订单管理-列表
xy_orderTableList(data = {}) { async xy_orderTableList(data = {}) {
let url = '/xy/orderTable' return await http.get('/xy/orderTable', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//学生端-订单管理-详情 //学生端-订单管理-详情
xy_orderTableInfo(data = {}) { async xy_orderTableInfo(data = {}) {
let url = '/xy/orderTable/info' return await http.get('/xy/orderTable/info', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//学生端-订单管理-添加 //学生端-订单管理-添加
xy_orderTableAdd(data = {}) { async xy_orderTableAdd(data = {}) {
let url = '/xy/orderTable/add' return await http.post('/xy/orderTable/add', data);
return http.post(url, data).then(res => { }
return res;
})
},
//↑↑↑↑↑↑↑↑↑↑↑↑-----学生接口相关-----↑↑↑↑↑↑↑↑↑↑↑↑
} }

253
common/axios.js

@ -4,86 +4,199 @@ import {
// import {Token} from './token.js' // import {Token} from './token.js'
// var token = new Token(); // var token = new Token();
// 防抖函数
const debounce = (fn, delay = 1000) => {
let timer = null;
return function (...args) {
if (timer) clearTimeout(timer);
timer = setTimeout(() => {
fn.apply(this, args);
}, delay);
}
}
// 请求拦截器
const requestInterceptor = (config) => {
// 在这里可以统一处理请求头、token等
const token = uni.getStorageSync("token");
if (token) {
config.header = {
...config.header,
'token': token
}
}
return config;
}
// 响应拦截器
const responseInterceptor = (response) => {
const { statusCode, data } = response;
console.log('响应数据:', response);
// 处理HTTP状态码
if (statusCode >= 200 && statusCode < 300) {
// 处理业务状态码
if (data && data.code) {
if (data.code === 1) { // 成功状态码为1
// 登录成功,保存token
if (data.data && data.data.token) {
uni.setStorageSync("token", data.data.token);
// 保存用户类型
if (data.data.user_type) {
uni.setStorageSync("userType", data.data.user_type);
}
// 保存过期时间
if (data.data.expires_time) {
uni.setStorageSync("expires_time", data.data.expires_time);
}
}
return data;
} else if (data.code === 401) {
// 未授权或token过期
uni.removeStorageSync("token");
uni.removeStorageSync("userType");
uni.removeStorageSync("expires_time");
uni.showToast({
title: data.msg || '登录已过期,请重新登录',
icon: 'none'
});
setTimeout(() => {
uni.reLaunch({
url: '/pages/student/login/login?code=401'
});
}, 1500);
return Promise.reject(data);
} else {
// 其他业务错误
uni.showToast({
title: data.msg || '请求失败',
icon: 'none'
});
return Promise.reject(data);
}
}
return data;
}
// HTTP错误处理
uni.showToast({
title: '网络请求失败',
icon: 'none'
});
return Promise.reject(response);
};
export default { export default {
async post(url, param, yanci = false) { // 存储正在进行的请求
// wx.showLoading(); pendingRequests: new Map(),
// setTimeout(() => { // 生成请求的唯一key
// wx.hideLoading(); generateRequestKey(config) {
// }, 3000) const { url, method, data } = config;
const res = await this.uni_request(url, param, 'post') return [url, method, JSON.stringify(data)].join('&');
return res;
},
async get(url, param, yanci = false) {
// wx.showLoading();
// setTimeout(() => {
// wx.hideLoading();
// }, 3000)
const res = await this.uni_request(url, param, 'get')
return res;
}, },
async put(url, param) {
// wx.showLoading(); // 取消重复请求
// setTimeout(() => { cancelRequest(config) {
// wx.hideLoading(); const requestKey = this.generateRequestKey(config);
// }, 3000) if (this.pendingRequests.has(requestKey)) {
const res = await this.uni_request(url, param, 'put') const controller = this.pendingRequests.get(requestKey);
return res; controller.abort();
this.pendingRequests.delete(requestKey);
}
}, },
uni_request(url, param, method, again_quest = false) {
const that = this // 防抖处理
uni.showLoading({ uni_request: debounce((options) => {
title:'加载中...' return new Promise((resolve, reject) => {
}) // 创建请求配置
return new Promise((cback, reject) => { const config = {
console.log('请求地址',Api_url + url) url: Api_url + options.url,
uni.request({ data: options.data,
url: Api_url + url, method: options.method || 'GET',
data: param,
method: method,
header: { header: {
'token': uni.getStorageSync("token") 'token': uni.getStorageSync("token")
}, },
}).then(data => { //data为一个数组,数组第一项为错误信息,第二项为返回数据 timeout: 10000 // 设置10秒超时
var [error, res] = data; };
uni.hideLoading()
var res_code = res.statusCode.toString(); // 应用请求拦截器
var res_codes = res.data.code.toString(); const interceptedConfig = requestInterceptor(config);
if (res_code.charAt(0) == 2) { uni.showLoading({
if (res_code == 200) { title: '加载中...'
if (res_codes == 401) { });
uni.navigateTo({
url: `/pages/student/login/login?res_codes=${res_codes}` console.log('请求配置:', interceptedConfig);
})
}else{ uni.request({
cback(res.data); ...interceptedConfig,
} success: (res) => {
} else { try {
console.log('201', url) console.log('原始响应数据:', res);
uni.showToast({ const response = responseInterceptor(res);
title: res.data.msg, console.log('处理后的响应数据:', response);
icon: 'none' resolve(response);
}) } catch (error) {
} console.error('请求处理失败:', error);
} else {
if (res_codes == 401) {
uni.navigateTo({
url: `/pages/student/login/login?res_codes=${res_codes}`
})
} else {
console.log('400/500', url, error, res)
uni.showToast({ uni.showToast({
title: res.data.msg ? res.data.msg : '请求异常', title: error.msg || '请求失败',
icon: 'none' icon: 'none'
}) });
reject(error);
} }
},
fail: (error) => {
console.error('请求失败:', error);
uni.showToast({
title: '网络请求失败',
icon: 'none'
});
reject(error);
},
complete: () => {
uni.hideLoading();
} }
}).catch(err => { });
console.log('catch:', err); });
}) }, 300),
})
// 封装请求方法
post(url, data = {}) {
return this.uni_request({
url,
data,
method: 'POST'
});
},
get(url, data = {}) {
return this.uni_request({
url,
data,
method: 'GET'
});
}, },
put(url, data = {}) {
return this.uni_request({
url,
data,
method: 'PUT'
});
},
// 统一的错误处理
handleError(error) {
if (error.statusCode === 401) {
uni.navigateTo({
url: `/pages/student/login/login?res_codes=${error.data.code}`
})
} else {
uni.showToast({
title: error.data?.msg || '请求异常',
icon: 'none'
})
}
}
} }

280
components/AQ/AQTabber.vue

@ -2,24 +2,15 @@
<template> <template>
<view class="main_box"> <view class="main_box">
<fui-tabbar :tabBar="tabBar" selectedColor="#5bdbbb" :current="tabBerIndex" @click="openView"></fui-tabbar> <fui-tabbar :tabBar="tabBar" selectedColor="#5bdbbb" :current="tabBerIndex" @click="openView"></fui-tabbar>
<fui-bottom-popup :show="show" @close="closePopup"> <fui-bottom-popup :show="show" @close="closePopup">
<view class="fui-custom__wrap"> <view class="fui-custom__wrap">
<view class="title" style="font-size: 36rpx;text-align: center;padding: 36rpx 0;">快捷新增</view> <view class="title" style="font-size: 36rpx;text-align: center;padding: 36rpx 0;">快捷新增</view>
<view class="but-style"> <view class="but-style">
<!-- <view class="but-style-top">-->
<!-- <view class="left" @click="writingFollowUp">-->
<!-- <image src="@/static/images/index/writing.png" class="drop-image-x"></image>-->
<!-- <view class="title-x">添加跟进记录</view>-->
<!-- </view>-->
<!-- <view class="right" @click="newTask">-->
<!-- <image src="@/static/images/index/task.png" class="drop-image-x"></image>-->
<!-- <view class="title-x">转交跟进任务</view>-->
<!-- </view>-->
<!-- </view>-->
<view class="but-style-below" @click="addClues"> <view class="but-style-below" @click="addClues">
<!-- <image src="@/static/images/index/addto.png" class="drop-image-x"></image>--> <!-- <image src="@/static/images/index/addto.png" class="drop-image-x"></image>-->
<image :src="$util.img('/uniapp_src/static/images/index/addto.png')" class="drop-image-x"></image> <image :src="$util.img('/uniapp_src/static/images/index/addto.png')" class="drop-image-x">
</image>
<view class="title-x">添加客户</view> <view class="title-x">添加客户</view>
</view> </view>
</view> </view>
@ -30,7 +21,7 @@
<script> <script>
import fuiTabbar from "@/components/firstui/fui-tabbar/fui-tabbar.vue" import fuiTabbar from "@/components/firstui/fui-tabbar/fui-tabbar.vue"
import util from '@/common/util.js'; import util from '@/common/util.js';
export default { export default {
name: "AQTabber", name: "AQTabber",
components: { components: {
@ -54,101 +45,137 @@
async init() { async init() {
let userType = uni.getStorageSync('userType') let userType = uni.getStorageSync('userType')
this.userType = userType this.userType = userType
let tabBerIndex = uni.getStorageSync('tabBerIndex')// tabBerIndex=0|1 let tabBerIndex = uni.getStorageSync('tabBerIndex') // tabBerIndex=0|1
if (tabBerIndex) { if (tabBerIndex) {
this.tabBerIndex = String(tabBerIndex) this.tabBerIndex = String(tabBerIndex)
} else { } else {
this.tabBerIndex = '0' this.tabBerIndex = '0'
} }
switch (String(this.userType)) { switch (String(this.userType)) {
case "1": // case "1": //
this.tabBar = [{ this.tabBar = [{
text: "首页", text: "首页",
urlPath: '/pages/coach/home/index', // urlPath: '/pages/market/home/index', //
// iconPath: "/static/images/tabbar/index.png", iconPath: util.img('/uniapp_src/static/images/tabbar/index.png'),
iconPath: util.img('/uniapp_src/static/images/tabbar/index.png'), selectedIconPath: util.img("/uniapp_src/static/images/tabbar/indexs.png")
selectedIconPath: util.img("/uniapp_src/static/images/tabbar/indexs.png") },
}, {
{ text: "线索",
text: "课表", urlPath: '/pages/market/clue/index', //
urlPath: '/pages/coach/course/list', // iconPath: util.img('/uniapp_src/static/images/tabbar/clue.png'),
iconPath: util.img('/uniapp_src/static/images/tabbar/timetable.png'), selectedIconPath: util.img("/uniapp_src/static/images/tabbar/clues.png")
selectedIconPath: util.img("/uniapp_src/static/images/tabbar/timetables.png") },
}, {
{ text: "",
text: "班级", urlPath: '/pages/market/clue/add_clues', //
urlPath: '/pages/coach/class/list', // iconPath: util.img('/uniapp_src/static/images/tabbar/plus.png'),
iconPath: util.img('/uniapp_src/static/images/tabbar/banji.png'), selectedIconPath: util.img('/uniapp_src/static/images/tabbar/plus.png'),
selectedIconPath: util.img("/uniapp_src/static/images/tabbar/banjis.png") midButton: true,
}, width: 70,
{ height: 70
text: "我的", },
urlPath: '/pages/coach/my/index', // {
iconPath: util.img('/uniapp_src/static/images/tabbar/my.png'), text: "数据",
selectedIconPath: util.img("/uniapp_src/static/images/tabbar/my.png") urlPath: '/pages/market/data/index', //
} iconPath: util.img('/uniapp_src/static/images/tabbar/timetable.png'),
] selectedIconPath: util.img('/uniapp_src/static/images/tabbar/timetables.png'),
break; },
case "2": // {
this.tabBar = [{ text: "我的",
text: "首页", urlPath: '/pages/market/my/index', //
urlPath: '/pages/market/index/index', // iconPath: util.img('/uniapp_src/static/images/tabbar/my.png'),
iconPath: util.img('/uniapp_src/static/images/tabbar/index.png'), selectedIconPath: util.img('/uniapp_src/static/images/tabbar/mys.png')
selectedIconPath: util.img("/uniapp_src/static/images/tabbar/indexs.png") }
}, ]
{ break;
text: "线索", case "2": //
urlPath: '/pages/market/clue/index', // this.tabBar = [{
iconPath: util.img('/uniapp_src/static/images/tabbar/clue.png'), text: "首页",
selectedIconPath: util.img("/uniapp_src/static/images/tabbar/clues.png") urlPath: '/pages/coach/home/index', //
}, // iconPath: "/static/images/tabbar/index.png",
{ iconPath: util.img('/uniapp_src/static/images/tabbar/index.png'),
text: "", selectedIconPath: util.img("/uniapp_src/static/images/tabbar/indexs.png")
urlPath: '/pages/market/clue/add_clues', // },
iconPath: util.img('/uniapp_src/static/images/tabbar/plus.png'), {
selectedIconPath: util.img('/uniapp_src/static/images/tabbar/plus.png'), text: "课表",
midButton: true, urlPath: '/pages/coach/course/list', //
width: 70, iconPath: util.img('/uniapp_src/static/images/tabbar/timetable.png'),
height: 70 selectedIconPath: util.img("/uniapp_src/static/images/tabbar/timetables.png")
}, },
{ {
text: "数据", text: "班级",
urlPath: '/pages/market/data/index', // urlPath: '/pages/coach/class/list', //
iconPath: util.img('/uniapp_src/static/images/tabbar/timetable.png'), iconPath: util.img('/uniapp_src/static/images/tabbar/banji.png'),
selectedIconPath: util.img('/uniapp_src/static/images/tabbar/timetables.png'), selectedIconPath: util.img("/uniapp_src/static/images/tabbar/banjis.png")
}, },
{ {
text: "我的", text: "我的",
urlPath: '/pages/market/my/index', // urlPath: '/pages/coach/my/index', //
iconPath: util.img('/uniapp_src/static/images/tabbar/my.png'), iconPath: util.img('/uniapp_src/static/images/tabbar/my.png'),
selectedIconPath: util.img('/uniapp_src/static/images/tabbar/mys.png') selectedIconPath: util.img("/uniapp_src/static/images/tabbar/my.png")
} }
] ]
break; break;
case "3": //
this.tabBar = [ case "3": //
{ this.tabBar = [{
text: "首页", text: "首页",
urlPath: '/pages/student/index/index', // urlPath: '/pages/market/index/index', //
iconPath: util.img('/uniapp_src/static/images/tabbar/index.png'), iconPath: util.img('/uniapp_src/static/images/tabbar/index.png'),
selectedIconPath: util.img('/uniapp_src/static/images/tabbar/indexs.png') selectedIconPath: util.img("/uniapp_src/static/images/tabbar/indexs.png")
}, },
{ {
text: "课表", text: "线索",
urlPath: '/pages/student/timetable/index', // urlPath: '/pages/market/clue/index', //
iconPath: util.img('/uniapp_src/static/images/tabbar/timetable.png'), iconPath: util.img('/uniapp_src/static/images/tabbar/clue.png'),
selectedIconPath: util.img('/uniapp_src/static/images/tabbar/timetables.png') selectedIconPath: util.img("/uniapp_src/static/images/tabbar/clues.png")
}, },
{ {
text: "我的", text: "",
urlPath: '/pages/student/my/my', // urlPath: '/pages/market/clue/add_clues', //
iconPath: util.img('/uniapp_src/static/images/tabbar/my.png'), iconPath: util.img('/uniapp_src/static/images/tabbar/plus.png'),
selectedIconPath: util.img('/uniapp_src/static/images/tabbar/mys.png') selectedIconPath: util.img('/uniapp_src/static/images/tabbar/plus.png'),
} midButton: true,
] width: 70,
break; height: 70
} },
{
text: "数据",
urlPath: '/pages/market/data/index', //
iconPath: util.img('/uniapp_src/static/images/tabbar/timetable.png'),
selectedIconPath: util.img('/uniapp_src/static/images/tabbar/timetables.png'),
},
{
text: "我的",
urlPath: '/pages/market/my/index', //
iconPath: util.img('/uniapp_src/static/images/tabbar/my.png'),
selectedIconPath: util.img('/uniapp_src/static/images/tabbar/mys.png')
}
]
break;
case "4": //
this.tabBar = [{
text: "首页",
urlPath: '/pages/student/index/index', //
iconPath: util.img('/uniapp_src/static/images/tabbar/index.png'),
selectedIconPath: util.img('/uniapp_src/static/images/tabbar/indexs.png')
},
{
text: "课表",
urlPath: '/pages/student/timetable/index', //
iconPath: util.img('/uniapp_src/static/images/tabbar/timetable.png'),
selectedIconPath: util.img('/uniapp_src/static/images/tabbar/timetables.png')
},
{
text: "我的",
urlPath: '/pages/student/my/my', //
iconPath: util.img('/uniapp_src/static/images/tabbar/my.png'),
selectedIconPath: util.img('/uniapp_src/static/images/tabbar/mys.png')
}
]
break;
}
// console.log(111,this.tabBar) // console.log(111,this.tabBar)
}, },
async openView(e) { async openView(e) {
@ -158,18 +185,18 @@
uni.setStorageSync('tabBerIndex', e.index) uni.setStorageSync('tabBerIndex', e.index)
console.log('qqq', e.urlPath) console.log('qqq', e.urlPath)
// //
uni.redirectTo({ uni.redirectTo({
url: e.urlPath url: e.urlPath
}) })
// //
// uni.reLaunch({ // uni.reLaunch({
// url: e.urlPath // url: e.urlPath
// }) // })
console.log('qqq2,执行完了') console.log('qqq2,执行完了')
}else{ } else {
this.show = true this.show = true
} }
}, },
@ -177,19 +204,19 @@
this.show = false this.show = false
}, },
// //
writingFollowUp(){ writingFollowUp() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/market/clue/writing_followUp' url: '/pages/market/clue/writing_followUp'
}) })
}, },
// //
newTask(){ newTask() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/market/clue/new_task' url: '/pages/market/clue/new_task'
}) })
}, },
// //
addClues(){ addClues() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/market/clue/add_clues' url: '/pages/market/clue/add_clues'
}) })
@ -206,27 +233,32 @@
padding-bottom: env(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom);
/* #endif */ /* #endif */
} }
.fui-custom__wrap { .fui-custom__wrap {
width: 100%; width: 100%;
//height: 600rpx; //height: 600rpx;
height: 450rpx; height: 450rpx;
} }
.title{
.title {
font-size: 36rpx; font-size: 36rpx;
text-align: center; text-align: center;
padding: 36rpx 0; padding: 36rpx 0;
} }
.but-style{
.but-style {
width: 92%; width: 92%;
height: 70%; height: 70%;
margin: auto; margin: auto;
} }
.but-style-top{
.but-style-top {
width: 100%; width: 100%;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
.left{
.left {
width: 45%; width: 45%;
height: 180rpx; height: 180rpx;
border-radius: 16rpx; border-radius: 16rpx;
@ -235,7 +267,8 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.right{
.right {
width: 45%; width: 45%;
height: 180rpx; height: 180rpx;
border-radius: 16rpx; border-radius: 16rpx;
@ -244,7 +277,8 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.but-style-below{
.but-style-below {
width: 100%; width: 100%;
height: 180rpx; height: 180rpx;
margin-top: 36rpx; margin-top: 36rpx;
@ -254,10 +288,12 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.drop-image-x { .drop-image-x {
width: 50rpx; width: 50rpx;
height: 50rpx; height: 50rpx;
} }
.title-x { .title-x {
font-size: 32rpx; font-size: 32rpx;
color: #fff; color: #fff;

1190
pages.json

File diff suppressed because it is too large

152
pages/market/clue/edit_clues.vue

@ -1079,157 +1079,7 @@
}, },
// //
async validatorForm(data) { async validatorForm(data) {
console.log('tijiao', data)
//
//
if (!data.source_channel.length) {
uni.showToast({
title: '请选择来源渠道',
icon: 'none'
})
this.nextStep('0')
return false
}
//
if (!data.source) {
uni.showToast({
title: '请选择来源',
icon: 'none'
})
this.nextStep('0')
return false
}
//
if (!data.name) {
uni.showToast({
title: '学生姓名必填',
icon: 'none'
})
this.nextStep('0')
return false
}
//
if (!data.age) {
uni.showToast({
title: '年龄必填',
icon: 'none'
})
this.nextStep('0')
return false
}
//
if (!data.gender) {
uni.showToast({
title: '性别必填',
icon: 'none'
})
this.nextStep('0')
return false
}
//
if (!data.phone_number) {
uni.showToast({
title: '电话必填',
icon: 'none'
})
this.nextStep('0')
return false
}
//
if (!data.demand) {
uni.showToast({
title: '需求必填',
icon: 'none'
})
this.nextStep('0')
return false
}
//
if (!data.decision_maker) {
uni.showToast({
title: '决策人必填',
icon: 'none'
})
this.nextStep('0')
return false
}
//
if (!data.initial_intent) {
uni.showToast({
title: '客户初步意向度必填',
icon: 'none'
})
this.nextStep('0')
return false
}
//
if (!data.status) {
uni.showToast({
title: '客户状态必填',
icon: 'none'
})
this.nextStep('0')
return false
}
//##### #####
//
if (!data.purchasing_power) {
uni.showToast({
title: '购买力必填',
icon: 'none'
})
this.nextStep('1')
return false
}
//
if (!data.cognitive_idea) {
uni.showToast({
title: '认知理念必填',
icon: 'none'
})
this.nextStep('1')
return false
}
//
if (!data.communication) {
uni.showToast({
title: '沟通备注必填',
icon: 'none'
})
this.nextStep('1')
return false
}
//访
if (!data.promised_visit_time) {
uni.showToast({
title: '承诺到访时间必填',
icon: 'none'
})
this.nextStep('1')
return false
}
//
if (!data.distance) {
uni.showToast({
title: '距离必填',
icon: 'none'
})
this.nextStep('1')
return false
}
//
if (!data.optional_class_time) {
uni.showToast({
title: '可选上课时间必填',
icon: 'none'
})
this.nextStep('1')
return false
}
return true return true
}, },
// //

375
pages/market/home/index.vue

@ -0,0 +1,375 @@
<template>
<view class="assemble">
<view style="height: 20rpx;"></view>
<!-- 市场人员展示-->
<view class="div-style">
<view style="height: 38vh;">
<view style="display: flex;align-items: center;padding: 20rpx 0 0 20rpx;">
<view>
<image :src="$util.img('/uniapp_src/static/images/index/danlan.png')" class="drop-image">
</image>
</view>
<view class="title">本月业绩</view>
</view>
<view class="coach-message">
<view class="left1">
<view style="padding: 20rpx 0;">
<view style="display: flex;align-items: center;">
<view style="padding: 12rpx;">
<image :src="$util.img('/uniapp_src/static/images/index/huang.png')"
class="drop-image-x"></image>
</view>
<view class="title-x">资源总数</view>
</view>
<view class="title-x1">{{infoData.month.new_total}}</view>
</view>
<view>
<view style="display: flex;align-items: center;">
<view style="padding: 12rpx;">
<image :src="$util.img('/uniapp_src/static/images/index/lvs.png')"
class="drop-image-x"></image>
</view>
<view class="title-x">已分配</view>
</view>
<view class="title-x1">{{infoData.month.new_total}}</view>
</view>
<view>
<view style="display: flex;align-items: center;">
<view style="padding: 12rpx;">
<image :src="$util.img('/uniapp_src/static/images/index/shenlan.png')"
class="drop-image-x"></image>
</view>
<view class="title-x">昨日新增</view>
</view>
<view class="title-x1">{{infoData.month.yesterday_new}}</view>
</view>
<view>
<view style="display: flex;align-items: center;">
<view style="padding: 12rpx;">
<image :src="$util.img('/uniapp_src/static/images/index/lan.png')"
class="drop-image-x"></image>
</view>
<view class="title-x">今日新增</view>
</view>
<view class="title-x1">{{infoData.month.today_new}}</view>
</view>
</view>
<!-- 统计图-->
<view class="right1">
<view style="text-align: center;">{{infoData.date_range}}</view>
<view class="statistics_box">
<view class="item">
<view class="box">
<view class="progress-bar"
:style="{ height: `${infoData.month.yesterday_new_rate}%`, background: '#f59a23' }">
</view>
<view class="ratio"
:style="{ color: infoData.month.yesterday_new_rate <= 0 ? '#333333' : '#000' }">
{{ infoData.month.yesterday_new_rate }}%
</view>
</view>
<view class="title">昨日</view>
</view>
<view class="item">
<view class="box">
<view class="progress-bar"
:style="{ height: `${infoData.month.assigned_sales_rate}%`, background: '#039f64' }">
</view>
<view class="ratio"
:style="{ color: infoData.month.assigned_sales_rate <= 0 ? '#333333' : '#000' }">
{{ infoData.month.assigned_sales_rate }}%
</view>
</view>
<view class="title">分配</view>
</view>
<view class="item">
<view class="box">
<view class="progress-bar"
:style="{ height: `${infoData.month.today_new_rate}%`, background: '#4066f2' }">
</view>
<view class="ratio"
:style="{ color: infoData.month.today_new_rate <= 0 ? '#333333' : '#000' }">
{{ infoData.month.today_new_rate }}%
</view>
</view>
<view class="title">今日</view>
</view>
</view>
</view>
</view>
</view>
<view style="width: 90%;background: #EFF3F8;height: 4rpx;margin: auto;"></view>
<view style="height: 38vh;">
<view style="display: flex;align-items: center;padding: 20rpx 0 0 20rpx;">
<view>
<image :src="$util.img('/uniapp_src/static/images/index/danlv.png')" class="drop-image"></image>
</view>
<view class="title">个人业绩</view>
</view>
<view class="coach-message">
<view class="this_month">
<view style="padding: 20rpx 0;display: flex;justify-content: space-between;">
<view style="width: 48%;">
<view style="display: flex;align-items: center;">
<view style="padding: 12rpx;">
<image :src="$util.img('/uniapp_src/static/images/index/danlv.png')"
class="drop-image-x"></image>
</view>
<view class="title-x">今日新增资源</view>
</view>
<view class="title-x1">{{infoData.last_month.xzzy}}</view>
</view>
<view style="width: 48%;">
<view style="display: flex;align-items: center;">
<view style="padding: 12rpx;">
<image :src="$util.img('/uniapp_src/static/images/index/danlv.png')"
class="drop-image-x"></image>
</view>
<view class="title-x">今日业绩收入</view>
</view>
<view class="title-x1">{{infoData.last_month.yjsr}}</view>
</view>
</view>
<view style="padding: 20rpx 0;display: flex;justify-content: space-between;">
<view style="width: 48%;">
<view style="display: flex;align-items: center;">
<view style="padding: 12rpx;">
<image :src="$util.img('/uniapp_src/static/images/index/danlv.png')"
class="drop-image-x"></image>
</view>
<view class="title-x">历史关单数量</view>
</view>
<view class="title-x1">{{infoData.last_month.gdsl}}</view>
</view>
<view style="width: 48%;">
<view style="display: flex;align-items: center;">
<view style="padding: 12rpx;">
<image :src="$util.img('/uniapp_src/static/images/index/danlv.png')"
class="drop-image-x"></image>
</view>
<view class="title-x">资源未分配数量</view>
</view>
<view class="title-x1">{{infoData.last_month.wfpsl}}</view>
</view>
</view>
</view>
</view>
</view>
</view>
<AQTabber />
</view>
</template>
<script>
import apiRoute from '@/api/apiRoute.js';
import AQTabber from "@/components/AQ/AQTabber.vue"
export default {
components: {
AQTabber,
},
data() {
return {
infoData: {}, //
userInfo: {}, //
}
},
onShow() {
this.init()
},
methods: {
async init() {
await this.getUserInfo()
await this.getXsIndex()
},
//
async getUserInfo() {
let res = await apiRoute.getPersonnelInfo({})
if (res.code != 1) {
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
this.userInfo = res.data
},
//
async getXsIndex() {
let role_key_arr = this.userInfo.role_key_arr.join(',')
let params = {
personnel_id: this.userInfo.id, //id
role_key_arr: role_key_arr, // key
}
let res = await apiRoute.xs_statisticsMarketHome(params)
if (res.code != 1) {
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
this.infoData = res.data
console.log('统计', this.infoData)
},
}
}
</script>
<style lang="less" scoped>
//
.navbar_section {
border: 1px solid #fff;
display: flex;
justify-content: center;
align-items: center;
background: #fff;
.title {
padding: 40rpx 0rpx;
/* 小程序端样式 */
// #ifdef MP-WEIXIN
padding: 80rpx 0rpx;
// #endif
font-size: 30rpx;
color: #858585;
}
}
.assemble {
width: 100%;
height: 100vh;
background: #292929;
}
.div-style {
width: 92%;
height: 85vh;
background: #fff;
border-radius: 16rpx;
margin: auto;
}
.coach-message {
width: 92%;
margin: 10rpx auto;
display: flex;
align-items: center;
padding-top: 20rpx;
}
.drop-image {
width: 50rpx;
height: 50rpx;
}
.title {
font-size: 30rpx;
color: #7F7F7F;
padding-left: 20rpx;
}
.left1 {
width: 48%;
height: 95%;
margin: auto;
}
.right1 {
width: 48%;
height: 95%;
margin: auto;
.statistics_box {
margin: auto;
margin-top: 10rpx;
display: flex;
justify-content: space-between;
.item {
width: 90rpx;
display: flex;
flex-direction: column;
align-items: center;
.box {
width: 100%;
height: 328rpx;
border: 1px solid #ddd;
border-radius: 6rpx;
background: #f5f5f5;
position: relative;
.progress-bar {
width: 100%;
height: 0;
transition: height 0.3s ease;
position: absolute;
bottom: 0;
}
.ratio {
width: 100%;
position: absolute;
bottom: -0rpx;
font-size: 26rpx;
text-align: center;
}
}
.title {
margin-top: 5rpx;
padding: 0;
font-size: 26rpx;
color: #999999;
;
text-align: center;
}
}
}
}
.this_month {
width: 100%;
height: 95%;
margin: auto;
}
.drop-image-x {
width: 20rpx;
height: 20rpx;
}
.title-x {
font-size: 28rpx;
color: #7F7F7F;
padding-left: 20rpx;
}
.title-x1 {
font-size: 28rpx;
color: #333333;
padding-left: 60rpx;
}
</style>

614
pages/market/index/index.vue

@ -1,381 +1,124 @@
<template> <template>
<view class="assemble"> <view class="assemble">
<!--自定义导航栏-->
<view class="navbar_section">
<view class="title">首页</view>
</view>
<view style="height: 20rpx;"></view> <view style="height: 20rpx;"></view>
<!-- 时间筛选 -->
<!-- 市场人员展示--> <view class="filter-section">
<view class="div-style" v-if="infoData.role_type == 'market_type'"> <picker mode="date" fields="month" :value="currentDate" @change="onDateChange">
<view style="height: 38vh;"> <view class="date-picker">
<view style="display: flex;align-items: center;padding: 20rpx 0 0 20rpx;"> <text>{{currentDate}}</text>
<view> <image class="drop-image" src="/static/images/drop.png" mode="aspectFit"></image>
<image :src="$util.img('/uniapp_src/static/images/index/danlan.png')" class="drop-image">
</image>
</view>
<view class="title">本月业绩</view>
</view> </view>
<view class="coach-message"> </picker>
<view class="left1"> </view>
<view style="padding: 20rpx 0;">
<view style="display: flex;align-items: center;"> <!-- 本月提成卡片 -->
<view style="padding: 12rpx;"> <view class="commission-card">
<image :src="$util.img('/uniapp_src/static/images/index/huang.png')" <view class="card-title">本月提成</view>
class="drop-image-x"></image> <view class="commission-amount">¥{{totalCommission}}</view>
</view> </view>
<view class="title-x">资源总数</view>
</view> <!-- 续费体测记录 -->
<view class="title-x1">{{infoData.month.new_total}}</view> <view class="record-card">
</view> <view class="card-title">续费体测记录</view>
<view class="table">
<view> <view class="table-header">
<view style="display: flex;align-items: center;"> <view class="th">时间</view>
<view style="padding: 12rpx;"> <view class="th">到期数</view>
<image :src="$util.img('/uniapp_src/static/images/index/lvs.png')" <view class="th">续费数</view>
class="drop-image-x"></image> <view class="th">续费率</view>
</view> <view class="th">提成</view>
<view class="title-x">已分配</view> </view>
</view> <view class="table-body">
<view class="title-x1">{{infoData.month.new_total}}</view> <view class="tr" v-for="(item, index) in renewalRecords" :key="index">
</view> <view class="td">{{item.time}}</view>
<view class="td">{{item.expireCount}}</view>
<view> <view class="td">{{item.renewCount}}</view>
<view style="display: flex;align-items: center;"> <view class="td">{{item.renewRate}}%</view>
<view style="padding: 12rpx;"> <view class="td">¥{{item.commission}}</view>
<image :src="$util.img('/uniapp_src/static/images/index/shenlan.png')"
class="drop-image-x"></image>
</view>
<view class="title-x">昨日新增</view>
</view>
<view class="title-x1">{{infoData.month.yesterday_new}}</view>
</view>
<view>
<view style="display: flex;align-items: center;">
<view style="padding: 12rpx;">
<image :src="$util.img('/uniapp_src/static/images/index/lan.png')"
class="drop-image-x"></image>
</view>
<view class="title-x">今日新增</view>
</view>
<view class="title-x1">{{infoData.month.today_new}}</view>
</view>
</view>
<!-- 统计图-->
<view class="right1">
<view style="text-align: center;">{{infoData.date_range}}</view>
<view class="statistics_box">
<view class="item">
<view class="box">
<view class="progress-bar"
:style="{ height: `${infoData.month.yesterday_new_rate}%`, background: '#f59a23' }">
</view>
<view class="ratio"
:style="{ color: infoData.month.yesterday_new_rate <= 0 ? '#333333' : '#000' }">
{{ infoData.month.yesterday_new_rate }}%</view>
</view>
<view class="title">昨日</view>
</view>
<view class="item">
<view class="box">
<view class="progress-bar"
:style="{ height: `${infoData.month.assigned_sales_rate}%`, background: '#039f64' }">
</view>
<view class="ratio"
:style="{ color: infoData.month.assigned_sales_rate <= 0 ? '#333333' : '#000' }">
{{ infoData.month.assigned_sales_rate }}%</view>
</view>
<view class="title">分配</view>
</view>
<view class="item">
<view class="box">
<view class="progress-bar"
:style="{ height: `${infoData.month.today_new_rate}%`, background: '#4066f2' }">
</view>
<view class="ratio"
:style="{ color: infoData.month.today_new_rate <= 0 ? '#333333' : '#000' }">
{{ infoData.month.today_new_rate }}%</view>
</view>
<view class="title">今日</view>
</view>
</view>
</view> </view>
</view> </view>
</view> </view>
</view>
<view style="width: 90%;background: #EFF3F8;height: 4rpx;margin: auto;"></view>
<!-- 新招课包 -->
<view style="height: 38vh;"> <view class="record-card">
<view style="display: flex;align-items: center;padding: 20rpx 0 0 20rpx;"> <view class="card-title">新招课包</view>
<view> <view class="table">
<image :src="$util.img('/uniapp_src/static/images/index/danlv.png')" class="drop-image"></image> <view class="table-header">
</view> <view class="th">成交数</view>
<view class="title">个人业绩</view> <view class="th">提成</view>
<view class="th">合计</view>
</view> </view>
<view class="table-body">
<view class="coach-message"> <view class="tr">
<view class="this_month"> <view class="td">{{newPackageCount}}</view>
<view style="padding: 20rpx 0;display: flex;justify-content: space-between;"> <view class="td">¥{{newPackageCommission}}</view>
<view style="width: 48%;"> <view class="td">¥{{newPackageTotal}}</view>
<view style="display: flex;align-items: center;">
<view style="padding: 12rpx;">
<image :src="$util.img('/uniapp_src/static/images/index/danlv.png')"
class="drop-image-x"></image>
</view>
<view class="title-x">今日新增资源</view>
</view>
<view class="title-x1">{{infoData.last_month.xzzy}}</view>
</view>
<view style="width: 48%;">
<view style="display: flex;align-items: center;">
<view style="padding: 12rpx;">
<image :src="$util.img('/uniapp_src/static/images/index/danlv.png')"
class="drop-image-x"></image>
</view>
<view class="title-x">今日业绩收入</view>
</view>
<view class="title-x1">{{infoData.last_month.yjsr}}</view>
</view>
</view>
<view style="padding: 20rpx 0;display: flex;justify-content: space-between;">
<view style="width: 48%;">
<view style="display: flex;align-items: center;">
<view style="padding: 12rpx;">
<image :src="$util.img('/uniapp_src/static/images/index/danlv.png')"
class="drop-image-x"></image>
</view>
<view class="title-x">历史关单数量</view>
</view>
<view class="title-x1">{{infoData.last_month.gdsl}}</view>
</view>
<view style="width: 48%;">
<view style="display: flex;align-items: center;">
<view style="padding: 12rpx;">
<image :src="$util.img('/uniapp_src/static/images/index/danlv.png')"
class="drop-image-x"></image>
</view>
<view class="title-x">资源未分配数量</view>
</view>
<view class="title-x1">{{infoData.last_month.wfpsl}}</view>
</view>
</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<!-- 销售人员展示--> <!-- 私教课包 -->
<view class="div-style" v-if="infoData.role_type == 'sale_type'"> <view class="record-card">
<view style="height: 38vh;"> <view class="card-title">私教课包</view>
<view style="display: flex;align-items: center;padding: 20rpx 0 0 20rpx;"> <view class="table">
<view> <view class="table-header">
<image :src="$util.img('/uniapp_src/static/images/index/danlan.png')" class="drop-image"> <view class="th">数量</view>
</image> <view class="th">提成</view>
</view>
<view class="title">本月业绩</view>
</view> </view>
<view class="coach-message"> <view class="table-body">
<view class="left1"> <view class="tr">
<view style="padding: 20rpx 0;"> <view class="td">{{privatePackageCount}}</view>
<view style="display: flex;align-items: center;"> <view class="td">¥{{privatePackageCommission}}</view>
<view style="padding: 12rpx;">
<image :src="$util.img('/uniapp_src/static/images/index/huang.png')"
class="drop-image-x"></image>
</view>
<view class="title-x">已分配</view>
</view>
<view class="title-x1">{{infoData.month.assigned_clients}}</view>
</view>
<view>
<view style="display: flex;align-items: center;">
<view style="padding: 12rpx;">
<image :src="$util.img('/uniapp_src/static/images/index/lvs.png')"
class="drop-image-x"></image>
</view>
<view class="title-x">已沟通</view>
</view>
<view class="title-x1">{{infoData.month.contacted_clients}}</view>
</view>
<view>
<view style="display: flex;align-items: center;">
<view style="padding: 12rpx;">
<image :src="$util.img('/uniapp_src/static/images/index/shenlan.png')"
class="drop-image-x"></image>
</view>
<view class="title-x">未成交</view>
</view>
<view class="title-x1">{{infoData.month.unconverted_clients}}</view>
</view>
<view>
<view style="display: flex;align-items: center;">
<view style="padding: 12rpx;">
<image :src="$util.img('/uniapp_src/static/images/index/lan.png')"
class="drop-image-x"></image>
</view>
<view class="title-x">待续费</view>
</view>
<view class="title-x1">{{infoData.month.renewal_clients}}</view>
</view>
<view>
<view style="display: flex;align-items: center;">
<view style="padding: 12rpx;">
<image :src="$util.img('/uniapp_src/static/images/index/lan.png')"
class="drop-image-x"></image>
</view>
<view class="title-x">已关单</view>
</view>
<view class="title-x1">{{infoData.month.closed_clients}}</view>
</view>
</view> </view>
<!--统计图-->
<view class="right1">
<view style="text-align: center;">{{infoData.date}}</view>
<view class="statistics_box">
<!--未成交-->
<view class="item">
<view class="box">
<view class="progress-bar"
:style="{ height: `${infoData.month.unconverted_rate}%`, background: '#f59a23' }">
</view>
<view class="ratio"
:style="{ color: infoData.month.unconverted_rate <= 0 ? '#333333' : '#fff' }">
{{ infoData.month.unconverted_rate }}%</view>
</view>
<view class="title">未成交</view>
</view>
<!--待续费-->
<view class="item">
<view class="box">
<view class="progress-bar"
:style="{ height: `${infoData.month.renewal_rate}%`, background: '#039f64' }">
</view>
<view class="ratio"
:style="{ color: infoData.month.renewal_rate <= 0 ? '#333333' : '#fff' }">
{{ infoData.month.renewal_rate }}%</view>
</view>
<view class="title">待续费</view>
</view>
<!--已关单-->
<view class="item">
<view class="box">
<view class="progress-bar"
:style="{ height: `${infoData.month.closed_rate}%`, background: '#4066f2' }">
</view>
<view class="ratio"
:style="{ color: infoData.month.closed_rate <= 0 ? '#333333' : '#fff' }">
{{ infoData.month.closed_rate }}%</view>
</view>
<view class="title">已关单</view>
</view>
</view>
</view>
</view> </view>
</view> </view>
</view>
<view style="width: 90%;background: #EFF3F8;height: 4rpx;margin: auto;"></view>
<!-- 时间卡 -->
<view style="height: 38vh;"> <view class="record-card">
<view style="display: flex;align-items: center;padding: 20rpx 0 0 20rpx;"> <view class="card-title">时间卡</view>
<view> <view class="table">
<image :src="$util.img('/uniapp_src/static/images/index/danlv.png')" class="drop-image"></image> <view class="table-header">
<view class="th">时间卡</view>
<view class="th">数量</view>
<view class="th">提成</view>
</view>
<view class="table-body">
<view class="tr">
<view class="td">{{timeCardCount}}</view>
<view class="td">{{timeCardAmount}}</view>
<view class="td">¥{{timeCardCommission}}</view>
</view> </view>
<view class="title">上月业绩</view>
</view> </view>
</view>
<view class="coach-message"> </view>
<view class="this_month">
<view style="padding: 20rpx 0;display: flex;justify-content: space-between;"> <!-- 其他提成 -->
<view style="width: 48%;"> <view class="record-card">
<view style="display: flex;align-items: center;"> <view class="card-title">其他提成</view>
<view style="padding: 12rpx;"> <view class="table">
<image :src="$util.img('/uniapp_src/static/images/index/danlv.png')" <view class="table-header">
class="drop-image-x"></image> <view class="th">项目</view>
</view> <view class="th">金额</view>
<view class="title-x">已分配</view> </view>
</view> <view class="table-body">
<view class="title-x1">{{infoData.last_month.assigned_clients}}</view> <view class="tr" v-for="(item, index) in otherCommissions" :key="index">
</view> <view class="td">{{item.project}}</view>
<view style="width: 48%;"> <view class="td">¥{{item.amount}}</view>
<view style="display: flex;align-items: center;">
<view style="padding: 12rpx;">
<image :src="$util.img('/uniapp_src/static/images/index/danlv.png')"
class="drop-image-x"></image>
</view>
<view class="title-x">已沟通</view>
</view>
<view class="title-x1">{{infoData.last_month.contacted_clients}}</view>
</view>
</view>
<view style="padding: 20rpx 0;display: flex;justify-content: space-between;">
<view style="width: 48%;">
<view style="display: flex;align-items: center;">
<view style="padding: 12rpx;">
<image :src="$util.img('/uniapp_src/static/images/index/danlv.png')"
class="drop-image-x"></image>
</view>
<view class="title-x">未成交</view>
</view>
<view class="title-x1">{{infoData.last_month.unconverted_clients}}</view>
</view>
<view style="width: 48%;">
<view style="display: flex;align-items: center;">
<view style="padding: 12rpx;">
<image :src="$util.img('/uniapp_src/static/images/index/danlv.png')"
class="drop-image-x"></image>
</view>
<view class="title-x">待续费</view>
</view>
<view class="title-x1">{{infoData.last_month.renewal_clients}}</view>
</view>
</view>
<view style="padding: 20rpx 0;display: flex;justify-content: space-between;">
<view style="width: 48%;">
<view style="display: flex;align-items: center;">
<view style="padding: 12rpx;">
<image :src="$util.img('/uniapp_src/static/images/index/danlv.png')"
class="drop-image-x"></image>
</view>
<view class="title-x">已关单</view>
</view>
<view class="title-x1">{{infoData.last_month.closed_clients}}</view>
</view>
</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<AQTabber /> <AQTabber />
</view> </view>
</template> </template>
<script> <script>
import apiRoute from '@/api/apiRoute.js';
import AQTabber from "@/components/AQ/AQTabber.vue" import AQTabber from "@/components/AQ/AQTabber.vue"
import apiRoute from '@/api/apiRoute.js'
export default { export default {
components: { components: {
@ -383,52 +126,60 @@
}, },
data() { data() {
return { return {
infoData: {}, // currentDate: this.formatDate(new Date()),
totalCommission: 0,
userInfo: {}, // renewalRecords: [],
newPackageCount: 0,
newPackageCommission: 0,
newPackageTotal: 0,
privatePackageCount: 0,
privatePackageCommission: 0,
timeCardCount: 0,
timeCardAmount: 0,
timeCardCommission: 0,
otherCommissions: []
} }
}, },
onShow() { onShow() {
this.init() this.getStatisticsData()
}, },
methods: { methods: {
async init() { formatDate(date) {
await this.getUserInfo() const year = date.getFullYear()
await this.getXsIndex() const month = String(date.getMonth() + 1).padStart(2, '0')
return `${year}-${month}`
}, },
onDateChange(e) {
// this.currentDate = e.detail.value
async getUserInfo() { this.getStatisticsData()
let res = await apiRoute.getPersonnelInfo({})
if (res.code != 1) {
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
this.userInfo = res.data
}, },
async getStatisticsData() {
// try {
async getXsIndex() { const res = await apiRoute.xs_statisticsMarketData({
let role_key_arr = this.userInfo.role_key_arr.join(',') date: this.currentDate
let params = { })
personnel_id: this.userInfo.id, //id if (res && res.code === 1) {
role_key_arr: role_key_arr, // key const data = res.data
} this.totalCommission = data.totalCommission || 0
let res = await apiRoute.xs_statisticsMarketHome(params) this.renewalRecords = data.renewalRecords || []
if (res.code != 1) { this.newPackageCount = data.newPackageCount || 0
this.newPackageCommission = data.newPackageCommission || 0
this.newPackageTotal = data.newPackageTotal || 0
this.privatePackageCount = data.privatePackageCount || 0
this.privatePackageCommission = data.privatePackageCommission || 0
this.timeCardCount = data.timeCardCount || 0
this.timeCardAmount = data.timeCardAmount || 0
this.timeCardCommission = data.timeCardCommission || 0
this.otherCommissions = data.otherCommissions || []
}
} catch (error) {
console.error('获取统计数据失败:', error)
uni.showToast({ uni.showToast({
title: res.msg, title: '获取数据失败',
icon: 'none' icon: 'none'
}) })
return
} }
this.infoData = res.data }
console.log('统计', this.infoData)
},
} }
} }
</script> </script>
@ -457,8 +208,9 @@
.assemble { .assemble {
width: 100%; width: 100%;
height: 100vh; min-height: 100vh;
background: #292929; background: #f5f5f5;
padding-bottom: 100rpx;
} }
.div-style { .div-style {
@ -570,4 +322,92 @@
color: #333333; color: #333333;
padding-left: 60rpx; padding-left: 60rpx;
} }
.filter-section {
padding: 20rpx 30rpx;
background: #fff;
margin-bottom: 20rpx;
.date-picker {
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
color: #333;
.drop-image {
width: 30rpx;
height: 30rpx;
margin-left: 10rpx;
}
}
}
.commission-card {
background: linear-gradient(135deg, #FF6B6B, #FF8E8E);
margin: 20rpx;
padding: 30rpx;
border-radius: 16rpx;
color: #fff;
.card-title {
font-size: 28rpx;
margin-bottom: 20rpx;
}
.commission-amount {
font-size: 48rpx;
font-weight: bold;
}
}
.record-card {
background: #fff;
margin: 20rpx;
padding: 20rpx;
border-radius: 16rpx;
.card-title {
font-size: 30rpx;
color: #333;
margin-bottom: 20rpx;
font-weight: bold;
}
.table {
width: 100%;
.table-header {
display: flex;
background: #f8f8f8;
padding: 20rpx 0;
.th {
flex: 1;
text-align: center;
font-size: 26rpx;
color: #666;
}
}
.table-body {
.tr {
display: flex;
padding: 20rpx 0;
border-bottom: 1px solid #eee;
&:last-child {
border-bottom: none;
}
.td {
flex: 1;
text-align: center;
font-size: 26rpx;
color: #333;
}
}
}
}
}
</style> </style>

671
pages/student/login/login.vue

@ -1,360 +1,327 @@
<template> <template>
<view> <view>
<view style="height: 500rpx;background-color:#fff;"> <view style="height: 500rpx;background-color:#fff;">
<view style="height: 150rpx;"></view> <view style="height: 150rpx;"></view>
<view class="image-container;"> <view class="image-container;">
<image :src="$util.img('/uniapp_src/static/images/login/login1.png')" class="base-image"></image> <image :src="$util.img('/uniapp_src/static/images/login/login1.png')" class="base-image"></image>
<image :src="$util.img('/uniapp_src/static/images/login/login2.png')" class="overlay-image"></image> <image :src="$util.img('/uniapp_src/static/images/login/login2.png')" class="overlay-image"></image>
</view> </view>
<view style="width: 100%;font-size: 60rpx;color: #ccc;text-align: center;margin-top: 60rpx;"> <view style="width: 100%;font-size: 60rpx;color: #ccc;text-align: center;margin-top: 60rpx;">
运动课堂 运动识堂
</view> </view>
</view> </view>
<view :style="{'background-color':'#fff','width':'100%','height':'100vh' }"> <view :style="{'background-color':'#fff','width':'100%','height':'100vh' }">
<view style="width: 95%;height: 30rpx;"></view> <view style="width: 95%;height: 30rpx;"></view>
<view style="width: 95%;margin:30rpx auto;"> <view style="width: 95%;margin:30rpx auto;">
<fui-input borderTop placeholder="登录账号" v-model="user" @input="input" <fui-input borderTop placeholder="登录账号" v-model="user"
backgroundColor="#f2f2f2"></fui-input> backgroundColor="#f2f2f2"></fui-input>
</view> </view>
<view style="width: 95%;margin: auto;"> <view style="width: 95%;margin: auto;">
<fui-input borderTop :padding="['20rpx','32rpx']" v-model="password1" placeholder="登录密码" <fui-input borderTop :padding="['20rpx','32rpx']" v-model="password1" placeholder="登录密码"
:password="password" @input="input" backgroundColor="#f2f2f2"> :password="password" backgroundColor="#f2f2f2">
<fui-icon :name="password?'invisible':'visible'" color="#B2B2B2" :size="50" <fui-icon :name="password?'invisible':'visible'" color="#B2B2B2" :size="50"
@click="change"></fui-icon> @click="change"></fui-icon>
</fui-input> </fui-input>
</view> </view>
<view style="width: 95%;margin:30rpx auto;"> <view style="width: 95%;margin:30rpx auto;">
<fui-input <fui-input @click="picker_show_loginType=true" v-model="loginType_str" placeholder="请选择登录类型"
@click="picker_show_loginType=true" backgroundColor="#f2f2f2">
v-model="loginType_str" <fui-icon name="arrowdown" color="#B2B2B2" :size="50" @click="change"></fui-icon>
placeholder="请选择登录类型" </fui-input>
backgroundColor="#f2f2f2" <fui-picker layer="1" :linkage="true" :options="loginType_Arr" :show="picker_show_loginType"
> @change="changePicker_loginType" @cancel="picker_show_loginType=false"></fui-picker>
<fui-icon name="arrowdown" color="#B2B2B2" :size="50" </view>
@click="change"></fui-icon>
</fui-input> <view style="width: 95%;margin:60rpx auto;">
<fui-picker <fui-button background="#00be8c" radius="5rpx" @click="login">登录</fui-button>
layer="1" </view>
:linkage="true"
:options="loginType_Arr" <view style="width: 95%;margin:60rpx auto;">
:show="picker_show_loginType" <fui-button background="#fff" radius="5rpx" @click="forgot" color="#00be8c">忘记登录密码</fui-button>
@change="changePicker_loginType" </view>
@cancel="picker_show_loginType=false"
></fui-picker> </view>
</view> </view>
<view style="width: 95%;margin:60rpx auto;">
<fui-button background="#00be8c" radius="5rpx" @click="login">登录</fui-button>
</view>
<view style="width: 95%;margin:60rpx auto;">
<fui-button background="#fff" radius="5rpx" @click="forgot" color="#00be8c">忘记登录密码</fui-button>
</view>
</view>
</view>
</template> </template>
<script> <script>
import apiRoute from '@/api/apiRoute.js'; import apiRoute from '@/api/apiRoute.js';
export default { export default {
data() { data() {
return { return {
inited: false, // init inited: false, // init
password: true, password: true,
user: '', // user: '', //
password1: '', // password1: '', //
mini_wx_openid:'',//openid mini_wx_openid: '', //openid
loginType:'',//|1=,2=,3= loginType: '', //|1=,2=,3=
loginType_str:'',// loginType_str: '', //
loginType_Arr:[ loginType_Arr: [{
{ value: '1',
value: '1', text: '市场登陆'
text: '教师登陆' },
}, {
{ value: '2',
value: '2', text: '教师登陆'
text: '销售登陆' },
}, {
{ value: '3',
value: '3', text: '销售登陆'
text: '学员登陆' },
} {
], value: '4',
picker_show_loginType:false,// text: '学员登陆'
}
],
path_arr:{ picker_show_loginType: false, //
'1':'/pages/coach/home/index',//
'2':'/pages/market/index/index',//
'3':'/pages/student/index/index',// path_arr: {
}, '1': '/pages/market/home/index', //
} '2': '/pages/coach/home/index', //
}, '3': '/pages/market/index/index', //
onLoad(options) { '4': '/pages/student/index/index', //
this.loginType = options.loginType ?? '2'//|1=,2=,3= },
const selectedItem = this.loginType_Arr.find(item => item.value === String(this.loginType)); }
this.loginType_str = selectedItem ? selectedItem.text : '未知类型'; },
// uni.hideHomeButton() onLoad(options) {
// console.log(uni.getStorageSync('um_id')) this.loginType = options.loginType ?? '1' //|1=,2=,3=4=
// onShow init const selectedItem = this.loginType_Arr.find(item => item.value === String(this.loginType));
this.loginType_str = selectedItem ? selectedItem.text : '未知类型';
let res_codes = options.res_codes || ''//axios.jscode,401,
if (!this.inited && !res_codes) { let res_codes = options.res_codes || '' //axios.jscode,401,
this.openViewHome() if (!this.inited && !res_codes) {
this.inited = true this.openViewHome()
} this.inited = true
}, }
methods: { },
async init(){ methods: {
// async init() {
//#ifdef MP-WEIXIN //
await this.getMiNiWxOpenId() //#ifdef MP-WEIXIN
//#endif await this.getMiNiWxOpenId()
}, //#endif
input(e) { },
//console.log(e) change() {
}, this.password = !this.password
change() { },
this.password = !this.password forgot() {
}, this.$navigateTo({
forgot() { url: '/pages/student/login/forgot'
this.$navigateTo({ })
url: '/pages/student/login/forgot' },
}) //
}, async login() {
// try {
async login() { //
if (!this.user) {
if (!this.user) { uni.showToast({
uni.showToast({ title: '请输入手机号',
title: '请输入用户名', icon: 'none'
icon: 'none' });
}) return;
return }
} if (!this.password1) {
if (!this.password1) { uni.showToast({
uni.showToast({ title: '请输入密码',
title: '请输入密码', icon: 'none'
icon: 'none' });
}) return;
return }
} if (!this.loginType) {
uni.showToast({
if (!this.loginType) { title: '请选择登录类型',
uni.showToast({ icon: 'none'
title: '请选择登陆类型', });
icon: 'none' return;
}) }
return
} const params = {
phone: this.user,
let item = {}; password: this.password1,
item['username'] = this.user login_type: this.loginType,
item['password'] = this.password1 mini_wx_openid: this.mini_wx_openid //openid
};
let res
//|1=,2=,3= console.log('登录参数:', params);
if(this.loginType == 1){ let res;
// if (this.loginType != 4) {
let params = { //
'phone': this.user, res = await apiRoute.personnelLogin(params);
'password': this.password1, } else {
'login_type': 1, //
'mini_wx_openid':this.mini_wx_openid,//openid res = await apiRoute.xy_login(params);
} }
res = await apiRoute.personnelLogin(params) console.log('登录响应:', res);
}else if(this.loginType == 2){
if (res && res.code === 1) { // 1
// //
let params = { if (res.data && res.data.token) {
'phone': this.user, uni.setStorageSync("token", res.data.token);
'password': this.password1, //
'login_type': 2, if (res.data.user_type) {
'mini_wx_openid':this.mini_wx_openid,//openid uni.setStorageSync("userType", res.data.user_type);
} }
res = await apiRoute.personnelLogin(params) //
console.log(123123,res) if (res.data.expires_time) {
uni.setStorageSync("expires_time", res.data.expires_time);
}else if (this.loginType == 3){ }
// }
let params = {
'phone': this.user, uni.showToast({
'password': this.password1, title:'登录成功',
'login_type': 2, icon: 'success'
'mini_wx_openid':this.mini_wx_openid,//openid });
}
res = await apiRoute.xy_login(params) } else {
} uni.showToast({
title: res || '登录失败',
if(!res.code){ icon: 'none'
uni.showToast({ });
title: res.msg, }
icon: 'none' } catch (error) {
}) console.error('登录失败:', error);
return uni.showToast({
} title: error || '登录失败,请重试',
uni.setStorageSync('expires_time', res.data.expires_time);//token icon: 'none'
uni.setStorageSync('token', res.data.token); });
let userType = res.data.user_type }
console.log('用户类型', userType) },
uni.setStorageSync('userType', userType);
uni.setStorageSync('tabBerIndex', 0); //openid
// code openid
let url_path = '' async getMiNiWxOpenId() {
switch (String(userType)) { uni.login({
case '1': // provider: 'weixin',
url_path = '/pages/coach/home/index' success: (res) => {
break; const code = res.code;
case '2': // this.fetchOpenId(code); //
url_path = '/pages/market/index/index' },
break; fail: () => {
case '3': // uni.showToast({
url_path = '/pages/student/index/index' title: '微信登录失败',
break; icon: 'none'
default: });
uni.showToast({ }
title: '用户类型错误', });
icon: 'none' },
}) // code openid
return; async fetchOpenId(code) {
} let params = {
this.$navigateTo({ code: code,
url: url_path }
}) let res = await apiRoute.common_getMiniWxOpenId(params)
}, if (res.code != 1) {
uni.showToast({
//openid title: res.msg,
// code openid icon: 'none'
async getMiNiWxOpenId() { })
uni.login({ return
provider: 'weixin', }
success: (res) => { this.mini_wx_openid = res.data.openid
const code = res.code; },
this.fetchOpenId(code); //
}, //
fail: () => { changePicker_loginType(e) {
uni.showToast({ title: '微信登录失败', icon: 'none' }); console.log('监听选择', e)
} this.loginType = e.value
}); this.loginType_str = e.text
}, this.picker_show_loginType = false
// code openid
async fetchOpenId(code){ //@todo 线
let params = { if (this.loginType == 1) {
code: code, //
} this.user = '15374889135' //
let res = await apiRoute.common_getMiniWxOpenId(params) this.password1 = '15374889135' //
if (res.code != 1){ } else if (this.loginType == 2) {
uni.showToast({ //
title: res.msg, this.user = '15148228108' //
icon: 'none' this.password1 = '123123' //
}) } else {
return //
} this.user = '13042409890' //
this.mini_wx_openid = res.data.openid this.password1 = '13042409890' //
}, }
// },
changePicker_loginType(e){
console.log('监听选择', e) //-
this.loginType = e.value async openViewHome() {
this.loginType_str = e.text const userType = String(uni.getStorageSync('userType') || '');
this.picker_show_loginType = false const token = uni.getStorageSync('token') || ''
//@todo 线 if (!userType || !token) {
if(this.loginType == 1){ return
// }
this.user= '15374889135' //
this.password1= '15374889135' // const pages = getCurrentPages();
}else if(this.loginType == 2){ const currentPage = pages[pages.length - 1];
// const thisPath = '/' + currentPage.route;
this.user= '15148228108' //
this.password1= '123123' //
}else{ const openPath = this.path_arr[userType];
//
this.user= '13042409890' // console.log('当前路径:', thisPath);
this.password1= '13042409890' // console.log('用户类型:', userType);
} console.log('应跳转路径:', openPath);
}, if (thisPath !== openPath) {
//
//- uni.setStorageSync('tabBerIndex', 0)
async openViewHome() {
const userType = String(uni.getStorageSync('userType') || ''); // 使 redirectTo navigateTo
const token = uni.getStorageSync('token') || '' uni.redirectTo({
url: openPath,
if(!userType || !token){ complete(e) {
return console.log(e)
} }
});
const pages = getCurrentPages(); return
const currentPage = pages[pages.length - 1]; }
const thisPath = '/' + currentPage.route; // onShow
},
}
const openPath = this.path_arr[userType]; }
console.log('当前路径:', thisPath);
console.log('用户类型:', userType);
console.log('应跳转路径:', openPath);
if (thisPath !== openPath) {
//
uni.setStorageSync('tabBerIndex', 0)
// 使 redirectTo navigateTo
uni.redirectTo({
url: openPath,
complete(e) {
console.log(e)
}
});
return
}
// onShow
},
}
}
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
page { page {
font-weight: normal; font-weight: normal;
} }
.fui-section__title { .fui-section__title {
margin-left: 32rpx; margin-left: 32rpx;
} }
.fui-left__icon { .fui-left__icon {
padding-right: 24rpx; padding-right: 24rpx;
} }
.image-container { .image-container {
margin: auto; margin: auto;
position: relative; position: relative;
width: 150rpx; width: 150rpx;
/* 设置与第一张图片相同的宽度 */ /* 设置与第一张图片相同的宽度 */
height: 150rpx; height: 150rpx;
/* 设置与第一张图片相同的高度 */ /* 设置与第一张图片相同的高度 */
} }
.base-image { .base-image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.overlay-image { .overlay-image {
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
width: 100rpx; width: 100rpx;
height: 100rpx; height: 100rpx;
} }
</style> </style>
Loading…
Cancel
Save