Browse Source

修改页面

master
王泽彦 10 months ago
parent
commit
60fff21f33
  1. 703
      api/apiRoute.js
  2. 239
      common/axios.js
  3. 92
      components/AQ/AQTabber.vue
  4. 44
      pages.json
  5. 150
      pages/market/clue/edit_clues.vue
  6. 375
      pages/market/home/index.vue
  7. 580
      pages/market/index/index.vue
  8. 249
      pages/student/login/login.vue

703
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;
})
}, },
//↑↑↑↑↑↑↑↑↑↑↑↑-----公共接口相关-----↑↑↑↑↑↑↑↑↑↑↑↑
//↓↓↓↓↓↓↓↓↓↓↓↓-----教练接口相关-----↓↓↓↓↓↓↓↓↓↓↓↓ //↓↓↓↓↓↓↓↓↓↓↓↓-----教练接口相关-----↓↓↓↓↓↓↓↓↓↓↓↓
//获取我的页面统计个数 //获取我的页面统计个数
getStatisticsInfo(data = {}) { async getStatisticsInfo(data = {}) {
let url = '/class/Statistics/info' return await http.get('/class/Statistics/info', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//添加作业 //添加作业
jlPublishJob(data = {}) { async jlPublishJob(data = {}) {
let url = '/class/jlPublishJob/add' return await http.get('/class/jlPublishJob/add', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//添加作业-学员列表 //添加作业-学员列表
jlGetStudentList(data = {}) { async jlGetStudentList(data = {}) {
let url = '/class/jlGetStudentList/list' return await http.get('/class/jlGetStudentList/list', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//添加作业-获取课程列表 //添加作业-获取课程列表
jlGetCoursesList(data = {}) { async jlGetCoursesList(data = {}) {
let url = '/class/jlGetCoursesList/list' return await http.get('/class/jlGetCoursesList/list', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//添加作业-获取班级列表 //添加作业-获取班级列表
jlGetClassesList(data = {}) { async jlGetClassesList(data = {}) {
let url = '/class/jlGetClasses/list' return await http.get('/class/jlGetClasses/list', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//体测报告-详情 //体测报告-详情
physicalTestInfo(data = {}) { async physicalTestInfo(data = {}) {
let url = '/class/physicalTest/info' return await http.get('/class/physicalTest/info', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//体测报告-列表 //体测报告-列表
physicalTest(data = {}) { async physicalTest(data = {}) {
let url = '/class/physicalTest' return await http.get('/class/physicalTest', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//获取学员详情 //获取学员详情
jlStudentsInfo(data = {}) { async jlStudentsInfo(data = {}) {
let url = '/class/jlStudentsInfo' return await http.get('/class/jlStudentsInfo', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//获取添加学员列表 //获取添加学员列表
addStudentList(data = {}) { async addStudentList(data = {}) {
let url = '/course/addStudentList' return await http.get('/course/addStudentList', data);
return http.get(url, data).then(res => { },
return res; async addStudent(data = {}) {
}) return await http.post('/course/addStudent', data);
}, },
addStudent(data = {}) { async delStudentCourse(data = {}) {
let url = '/course/addStudent' return await http.get('/course/delStudentCourse', data);
return http.post(url, data).then(res => {
return res;
})
},
delStudentCourse(data = {}) {
let url = '/course/delStudentCourse'
return http.get(url, data).then(res => {
return res;
})
}, },
//获取班级列表 //获取班级列表
jlClassList(data = {}) { async jlClassList(data = {}) {
let url = '/class/jlClassList' return await http.get('/class/jlClassList', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//获取班级详情 //获取班级详情
jlClassInfo(data = {}) { async jlClassInfo(data = {}) {
let url = '/class/jlClassInfo' return await http.get('/class/jlClassInfo', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//获取课程列表 //获取课程列表
courseList(data = {}) { async courseList(data = {}) {
let url = '/course/courseList' return await http.get('/course/courseList', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//获取班级课程列表 //获取班级课程列表
classCourseList(data = {}) { async classCourseList(data = {}) {
let url = '/course/classCourseList' return await http.get('/course/classCourseList', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//获取课程详情 //获取课程详情
courseInfo(data = {}) { async courseInfo(data = {}) {
let url = '/course/courseInfo' return await http.get('/course/courseInfo', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//教研管理文章列表 //教研管理文章列表
teachingResearchList(data = {}) { async teachingResearchList(data = {}) {
let url = '/teachingResearch/list' return await http.get('/teachingResearch/list', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//教研管理文章详情 //教研管理文章详情
teachingResearchInfo(id) { async teachingResearchInfo(id) {
let url = '/teachingResearch/info/' + id return await http.get('/teachingResearch/info/' + id);
return http.get(url).then(res => {
return res;
})
}, },
//获取能看的教研管理类型 //获取能看的教研管理类型
teachingResearchLookType(data = {}) { async teachingResearchLookType(data = {}) {
let url = '/teachingResearch/lookType' return await http.get('/teachingResearch/lookType', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//获取试卷 //获取试卷
getTeachingTestPaper(data = {}) { async getTeachingTestPaper(data = {}) {
let url = '/teachingResearch/teachingTestPaper' return await http.get('/teachingResearch/teachingTestPaper', data);
return http.get(url, data).then(res => {
return res;
})
}, },
//提交试卷 //提交试卷
submitTestPaper(data = {}) { async submitTestPaper(data = {}) {
let url = '/teachingResearch/submitTestPaper' return await http.get('/teachingResearch/submitTestPaper', data);
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;
})
},
//↑↑↑↑↑↑↑↑↑↑↑↑-----学生接口相关-----↑↑↑↑↑↑↑↑↑↑↑↑
} }

239
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();
export default { // 防抖函数
async post(url, param, yanci = false) { const debounce = (fn, delay = 1000) => {
// wx.showLoading(); 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;
}
// setTimeout(() => { // 响应拦截器
// wx.hideLoading(); const responseInterceptor = (response) => {
// }, 3000) const { statusCode, data } = response;
const res = await this.uni_request(url, param, 'post') console.log('响应数据:', response);
return res; // 处理HTTP状态码
}, if (statusCode >= 200 && statusCode < 300) {
async get(url, param, yanci = false) { // 处理业务状态码
// wx.showLoading(); if (data && data.code) {
// setTimeout(() => { if (data.code === 1) { // 成功状态码为1
// wx.hideLoading(); // 登录成功,保存token
// }, 3000) if (data.data && data.data.token) {
const res = await this.uni_request(url, param, 'get') uni.setStorageSync("token", data.data.token);
return res; // 保存用户类型
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 {
// 存储正在进行的请求
pendingRequests: new Map(),
// 生成请求的唯一key
generateRequestKey(config) {
const { url, method, data } = config;
return [url, method, JSON.stringify(data)].join('&');
}, },
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) => {
try {
console.log('原始响应数据:', res);
const response = responseInterceptor(res);
console.log('处理后的响应数据:', response);
resolve(response);
} catch (error) {
console.error('请求处理失败:', error);
uni.showToast({
title: error.msg || '请求失败',
icon: 'none'
});
reject(error);
} }
} else { },
console.log('201', url) fail: (error) => {
console.error('请求失败:', error);
uni.showToast({ uni.showToast({
title: res.data.msg, title: '网络请求失败',
icon: 'none' icon: 'none'
}) });
reject(error);
},
complete: () => {
uni.hideLoading();
} }
} else { });
if (res_codes == 401) { });
}, 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({ uni.navigateTo({
url: `/pages/student/login/login?res_codes=${res_codes}` url: `/pages/student/login/login?res_codes=${error.data.code}`
}) })
} else { } else {
console.log('400/500', url, error, res)
uni.showToast({ uni.showToast({
title: res.data.msg ? res.data.msg : '请求异常', title: error.data?.msg || '请求异常',
icon: 'none' icon: 'none'
}) })
} }
} }
}).catch(err => {
console.log('catch:', err);
})
})
},
} }

92
components/AQ/AQTabber.vue

@ -7,19 +7,10 @@
<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>
@ -54,7 +45,7 @@
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)
@ -62,7 +53,43 @@
this.tabBerIndex = '0' this.tabBerIndex = '0'
} }
switch (String(this.userType)) { switch (String(this.userType)) {
case "1": // case "1": //
this.tabBar = [{
text: "首页",
urlPath: '/pages/market/home/index', //
iconPath: util.img('/uniapp_src/static/images/tabbar/index.png'),
selectedIconPath: util.img("/uniapp_src/static/images/tabbar/indexs.png")
},
{
text: "线索",
urlPath: '/pages/market/clue/index', //
iconPath: util.img('/uniapp_src/static/images/tabbar/clue.png'),
selectedIconPath: util.img("/uniapp_src/static/images/tabbar/clues.png")
},
{
text: "",
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'),
midButton: true,
width: 70,
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 "2": //
this.tabBar = [{ this.tabBar = [{
text: "首页", text: "首页",
urlPath: '/pages/coach/home/index', // urlPath: '/pages/coach/home/index', //
@ -90,7 +117,8 @@
} }
] ]
break; break;
case "2": //
case "3": //
this.tabBar = [{ this.tabBar = [{
text: "首页", text: "首页",
urlPath: '/pages/market/index/index', // urlPath: '/pages/market/index/index', //
@ -126,9 +154,8 @@
} }
] ]
break; break;
case "3": // case "4": //
this.tabBar = [ this.tabBar = [{
{
text: "首页", text: "首页",
urlPath: '/pages/student/index/index', // urlPath: '/pages/student/index/index', //
iconPath: util.img('/uniapp_src/static/images/tabbar/index.png'), iconPath: util.img('/uniapp_src/static/images/tabbar/index.png'),
@ -169,7 +196,7 @@
// }) // })
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;

44
pages.json

@ -1,6 +1,5 @@
{ {
"pages": [ "pages": [{
{
"path": "pages/student/login/login", "path": "pages/student/login/login",
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "",
@ -65,7 +64,7 @@
} }
}, },
{ {
"path" : "pages/student/index/physical_examination", "path": "pages/student/index/physical_examination",
"style": { "style": {
"navigationBarTitleText": "体测数据", "navigationBarTitleText": "体测数据",
"navigationStyle": "default", "navigationStyle": "default",
@ -74,7 +73,7 @@
} }
}, },
{ {
"path" : "pages/student/timetable/info", "path": "pages/student/timetable/info",
"style": { "style": {
"navigationBarTitleText": "课表详情", "navigationBarTitleText": "课表详情",
"navigationStyle": "default", "navigationStyle": "default",
@ -83,7 +82,7 @@
} }
}, },
{ {
"path" : "pages/student/timetable/list", "path": "pages/student/timetable/list",
"style": { "style": {
"navigationBarTitleText": "场馆", "navigationBarTitleText": "场馆",
"navigationStyle": "default", "navigationStyle": "default",
@ -92,7 +91,7 @@
} }
}, },
{ {
"path" : "pages/student/my/set_up", "path": "pages/student/my/set_up",
"style": { "style": {
"navigationBarTitleText": "设置", "navigationBarTitleText": "设置",
"navigationStyle": "default", "navigationStyle": "default",
@ -101,7 +100,7 @@
} }
}, },
{ {
"path" : "pages/student/my/update_pass", "path": "pages/student/my/update_pass",
"style": { "style": {
"navigationBarTitleText": "修改密码", "navigationBarTitleText": "修改密码",
"navigationStyle": "default", "navigationStyle": "default",
@ -110,7 +109,7 @@
} }
}, },
{ {
"path" : "pages/student/my/lesson_consumption", "path": "pages/student/my/lesson_consumption",
"style": { "style": {
"navigationBarTitleText": "课时消耗", "navigationBarTitleText": "课时消耗",
"navigationStyle": "default", "navigationStyle": "default",
@ -119,7 +118,7 @@
} }
}, },
{ {
"path" : "pages/student/my/my_members", "path": "pages/student/my/my_members",
"style": { "style": {
"navigationBarTitleText": "我的成员", "navigationBarTitleText": "我的成员",
"navigationStyle": "default", "navigationStyle": "default",
@ -128,7 +127,7 @@
} }
}, },
{ {
"path" : "pages/student/my/personal_data", "path": "pages/student/my/personal_data",
"style": { "style": {
"navigationBarTitleText": "个人资料", "navigationBarTitleText": "个人资料",
"navigationStyle": "default", "navigationStyle": "default",
@ -137,7 +136,7 @@
} }
}, },
{ {
"path" : "pages/student/index/job_list", "path": "pages/student/index/job_list",
"style": { "style": {
"navigationBarTitleText": "作业列表", "navigationBarTitleText": "作业列表",
"navigationStyle": "default", "navigationStyle": "default",
@ -147,11 +146,18 @@
}, },
{
"path": "pages/market/home/index",
"style": {
"navigationStyle": "default",
"navigationBarBackgroundColor": "#29d3b4",
"navigationBarTextStyle": "white"
}
},
{ {
"path" : "pages/common/privacy_agreement", "path": "pages/common/privacy_agreement",
"style": { "style": {
"navigationBarTitleText": "隐私协议", "navigationBarTitleText": "隐私协议",
"navigationStyle": "default", "navigationStyle": "default",
@ -160,7 +166,7 @@
} }
}, },
{ {
"path" : "pages/common/my_message", "path": "pages/common/my_message",
"style": { "style": {
"navigationBarTitleText": "我的消息", "navigationBarTitleText": "我的消息",
"navigationStyle": "default", "navigationStyle": "default",
@ -169,7 +175,7 @@
} }
}, },
{ {
"path" : "pages/common/im_chat_info", "path": "pages/common/im_chat_info",
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "",
"navigationStyle": "default", "navigationStyle": "default",
@ -178,7 +184,7 @@
} }
}, },
{ {
"path" : "pages/common/sys_msg_list", "path": "pages/common/sys_msg_list",
"style": { "style": {
"navigationBarTitleText": "系统消息", "navigationBarTitleText": "系统消息",
"navigationStyle": "default", "navigationStyle": "default",
@ -187,7 +193,7 @@
} }
}, },
{ {
"path" : "pages/common/article_info", "path": "pages/common/article_info",
"style": { "style": {
"navigationBarTitleText": "文章详情", "navigationBarTitleText": "文章详情",
"navigationStyle": "default", "navigationStyle": "default",
@ -196,7 +202,7 @@
} }
}, },
{ {
"path" : "pages/common/feedback", "path": "pages/common/feedback",
"style": { "style": {
"navigationBarTitleText": "意见反馈", "navigationBarTitleText": "意见反馈",
"navigationStyle": "default", "navigationStyle": "default",
@ -205,7 +211,7 @@
} }
}, },
{ {
"path" : "pages/common/contract_list", "path": "pages/common/contract_list",
"style": { "style": {
"navigationBarTitleText": "订单列表", "navigationBarTitleText": "订单列表",
"navigationStyle": "default", "navigationStyle": "default",

150
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>

580
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 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>
<view class="title-x">资源总数</view> </picker>
</view>
<view class="title-x1">{{infoData.month.new_total}}</view>
</view> </view>
<view> <!-- 本月提成卡片 -->
<view style="display: flex;align-items: center;"> <view class="commission-card">
<view style="padding: 12rpx;"> <view class="card-title">本月提成</view>
<image :src="$util.img('/uniapp_src/static/images/index/lvs.png')" <view class="commission-amount">¥{{totalCommission}}</view>
class="drop-image-x"></image>
</view>
<view class="title-x">已分配</view>
</view>
<view class="title-x1">{{infoData.month.new_total}}</view>
</view> </view>
<view> <!-- 续费体测记录 -->
<view style="display: flex;align-items: center;"> <view class="record-card">
<view style="padding: 12rpx;"> <view class="card-title">续费体测记录</view>
<image :src="$util.img('/uniapp_src/static/images/index/shenlan.png')" <view class="table">
class="drop-image-x"></image> <view class="table-header">
<view class="th">时间</view>
<view class="th">到期数</view>
<view class="th">续费数</view>
<view class="th">续费率</view>
<view class="th">提成</view>
</view> </view>
<view class="title-x">昨日新增</view> <view class="table-body">
<view class="tr" v-for="(item, index) in renewalRecords" :key="index">
<view class="td">{{item.time}}</view>
<view class="td">{{item.expireCount}}</view>
<view class="td">{{item.renewCount}}</view>
<view class="td">{{item.renewRate}}%</view>
<view class="td">¥{{item.commission}}</view>
</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>
<view class="title-x">今日新增</view>
</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>
<view class="item"> <!-- 新招课包 -->
<view class="box"> <view class="record-card">
<view class="progress-bar" <view class="card-title">新招课包</view>
:style="{ height: `${infoData.month.assigned_sales_rate}%`, background: '#039f64' }"> <view class="table">
</view> <view class="table-header">
<view class="ratio" <view class="th">成交数</view>
:style="{ color: infoData.month.assigned_sales_rate <= 0 ? '#333333' : '#000' }"> <view class="th">提成</view>
{{ infoData.month.assigned_sales_rate }}%</view> <view class="th">合计</view>
</view> </view>
<view class="title">分配</view> <view class="table-body">
<view class="tr">
<view class="td">{{newPackageCount}}</view>
<view class="td">¥{{newPackageCommission}}</view>
<view class="td">¥{{newPackageTotal}}</view>
</view> </view>
<view class="item">
<view class="box">
<view class="progress-bar"
:style="{ height: `${infoData.month.today_new_rate}%`, background: '#4066f2' }">
</view> </view>
<view class="ratio"
:style="{ color: infoData.month.today_new_rate <= 0 ? '#333333' : '#000' }">
{{ infoData.month.today_new_rate }}%</view>
</view> </view>
<view class="title">今日</view>
</view> </view>
<!-- 私教课包 -->
<view class="record-card">
<view class="card-title">私教课包</view>
<view class="table">
<view class="table-header">
<view class="th">数量</view>
<view class="th">提成</view>
</view> </view>
</view> <view class="table-body">
<view class="tr">
<view class="td">{{privatePackageCount}}</view>
<view class="td">¥{{privatePackageCommission}}</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>
<view class="title">个人业绩</view>
</view> </view>
<view class="coach-message"> <!-- 时间卡 -->
<view class="this_month"> <view class="record-card">
<view style="padding: 20rpx 0;display: flex;justify-content: space-between;"> <view class="card-title">时间卡</view>
<view style="width: 48%;"> <view class="table">
<view style="display: flex;align-items: center;"> <view class="table-header">
<view style="padding: 12rpx;"> <view class="th">时间卡</view>
<image :src="$util.img('/uniapp_src/static/images/index/danlv.png')" <view class="th">数量</view>
class="drop-image-x"></image> <view class="th">提成</view>
</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 class="table-body">
<view class="tr">
<view class="td">{{timeCardCount}}</view>
<view class="td">{{timeCardAmount}}</view>
<view class="td">¥{{timeCardCommission}}</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 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>
<view class="title-x">已分配</view> <view class="table-body">
<view class="tr" v-for="(item, index) in otherCommissions" :key="index">
<view class="td">{{item.project}}</view>
<view class="td">¥{{item.amount}}</view>
</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>
<view class="title-x">已沟通</view>
</view> </view>
<view class="title-x1">{{infoData.month.contacted_clients}}</view>
</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 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 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.assigned_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.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>
<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
this.renewalRecords = data.renewalRecords || []
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 || []
} }
let res = await apiRoute.xs_statisticsMarketHome(params) } catch (error) {
if (res.code != 1) { 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>

249
pages/student/login/login.vue

@ -7,42 +7,31 @@
<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="请选择登录类型"
backgroundColor="#f2f2f2"
>
<fui-icon name="arrowdown" color="#B2B2B2" :size="50"
@click="change"></fui-icon>
</fui-input> </fui-input>
<fui-picker <fui-picker layer="1" :linkage="true" :options="loginType_Arr" :show="picker_show_loginType"
layer="1" @change="changePicker_loginType" @cancel="picker_show_loginType=false"></fui-picker>
:linkage="true"
:options="loginType_Arr"
:show="picker_show_loginType"
@change="changePicker_loginType"
@cancel="picker_show_loginType=false"
></fui-picker>
</view> </view>
<view style="width: 95%;margin:60rpx auto;"> <view style="width: 95%;margin:60rpx auto;">
@ -58,9 +47,9 @@
</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
@ -68,58 +57,56 @@ export default {
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: '销售登陆'
},
{
value: '4',
text: '学员登陆' text: '学员登陆'
} }
], ],
picker_show_loginType:false,// picker_show_loginType: false, //
path_arr:{ path_arr: {
'1':'/pages/coach/home/index',// '1': '/pages/market/home/index', //
'2':'/pages/market/index/index',// '2': '/pages/coach/home/index', //
'3':'/pages/student/index/index',// '3': '/pages/market/index/index', //
'4': '/pages/student/index/index', //
}, },
} }
}, },
onLoad(options) { onLoad(options) {
this.loginType = options.loginType ?? '2'//|1=,2=,3= this.loginType = options.loginType ?? '1' //|1=,2=,3=4=
const selectedItem = this.loginType_Arr.find(item => item.value === String(this.loginType)); const selectedItem = this.loginType_Arr.find(item => item.value === String(this.loginType));
this.loginType_str = selectedItem ? selectedItem.text : '未知类型'; this.loginType_str = selectedItem ? selectedItem.text : '未知类型';
// uni.hideHomeButton()
// console.log(uni.getStorageSync('um_id'))
// onShow init
let res_codes = options.res_codes || ''//axios.jscode,401, let res_codes = options.res_codes || '' //axios.jscode,401,
if (!this.inited && !res_codes) { if (!this.inited && !res_codes) {
this.openViewHome() this.openViewHome()
this.inited = true this.inited = true
} }
}, },
methods: { methods: {
async init(){ async init() {
// //
//#ifdef MP-WEIXIN //#ifdef MP-WEIXIN
await this.getMiNiWxOpenId() await this.getMiNiWxOpenId()
//#endif //#endif
}, },
input(e) {
//console.log(e)
},
change() { change() {
this.password = !this.password this.password = !this.password
}, },
@ -130,103 +117,80 @@ export default {
}, },
// //
async login() { async login() {
try {
//
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) { if (!this.loginType) {
uni.showToast({ uni.showToast({
title: '请选择登陆类型', title: '请选择登录类型',
icon: 'none' icon: 'none'
}) });
return return;
} }
let item = {}; const params = {
item['username'] = this.user phone: this.user,
item['password'] = this.password1 password: this.password1,
login_type: this.loginType,
let res mini_wx_openid: this.mini_wx_openid //openid
//|1=,2=,3= };
if(this.loginType == 1){
// console.log('登录参数:', params);
let params = { let res;
'phone': this.user, if (this.loginType != 4) {
'password': this.password1, //
'login_type': 1, res = await apiRoute.personnelLogin(params);
'mini_wx_openid':this.mini_wx_openid,//openid } else {
//
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,
'password': this.password1,
'login_type': 2,
'mini_wx_openid':this.mini_wx_openid,//openid
} }
res = await apiRoute.xy_login(params)
} }
if(!res.code){
uni.showToast({ uni.showToast({
title: res.msg, title:'登录成功',
icon: 'success'
});
} else {
uni.showToast({
title: res || '登录失败',
icon: 'none' icon: 'none'
}) });
return
} }
uni.setStorageSync('expires_time', res.data.expires_time);//token } catch (error) {
uni.setStorageSync('token', res.data.token); console.error('登录失败:', error);
let userType = res.data.user_type
console.log('用户类型', userType)
uni.setStorageSync('userType', userType);
uni.setStorageSync('tabBerIndex', 0);
let url_path = ''
switch (String(userType)) {
case '1': //
url_path = '/pages/coach/home/index'
break;
case '2': //
url_path = '/pages/market/index/index'
break;
case '3': //
url_path = '/pages/student/index/index'
break;
default:
uni.showToast({ uni.showToast({
title: '用户类型错误', title: error || '登录失败,请重试',
icon: 'none' icon: 'none'
}) });
return;
} }
this.$navigateTo({
url: url_path
})
}, },
//openid //openid
@ -239,17 +203,20 @@ export default {
this.fetchOpenId(code); // this.fetchOpenId(code); //
}, },
fail: () => { fail: () => {
uni.showToast({ title: '微信登录失败', icon: 'none' }); uni.showToast({
title: '微信登录失败',
icon: 'none'
});
} }
}); });
}, },
// code openid // code openid
async fetchOpenId(code){ async fetchOpenId(code) {
let params = { let params = {
code: code, code: code,
} }
let res = await apiRoute.common_getMiniWxOpenId(params) let res = await apiRoute.common_getMiniWxOpenId(params)
if (res.code != 1){ if (res.code != 1) {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none' icon: 'none'
@ -260,25 +227,25 @@ export default {
}, },
// //
changePicker_loginType(e){ changePicker_loginType(e) {
console.log('监听选择', e) console.log('监听选择', e)
this.loginType = e.value this.loginType = e.value
this.loginType_str = e.text this.loginType_str = e.text
this.picker_show_loginType = false this.picker_show_loginType = false
//@todo 线 //@todo 线
if(this.loginType == 1){ if (this.loginType == 1) {
// //
this.user= '15374889135' // this.user = '15374889135' //
this.password1= '15374889135' // this.password1 = '15374889135' //
}else if(this.loginType == 2){ } else if (this.loginType == 2) {
// //
this.user= '15148228108' // this.user = '15148228108' //
this.password1= '123123' // this.password1 = '123123' //
}else{ } else {
// //
this.user= '13042409890' // this.user = '13042409890' //
this.password1= '13042409890' // this.password1 = '13042409890' //
} }
}, },
@ -288,7 +255,7 @@ export default {
const userType = String(uni.getStorageSync('userType') || ''); const userType = String(uni.getStorageSync('userType') || '');
const token = uni.getStorageSync('token') || '' const token = uni.getStorageSync('token') || ''
if(!userType || !token){ if (!userType || !token) {
return return
} }
@ -319,42 +286,42 @@ export default {
// onShow // 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