fix:重构完毕

This commit is contained in:
MJ 2025-08-02 13:57:00 +08:00
parent e7104a1ae9
commit 82bae4c441
78 changed files with 1193 additions and 1616 deletions

View File

@ -1,56 +1,37 @@
import $req from './request'
import { http } from './request/request'
// 获取用户信息
export const getUserInfo = () =>
$req({
url: '/sysUser/selectUser',
})
export const getUserInfo = async () =>
await http.get<any>('/sysUser/selectUser')
// 获取客服信息
export const getCsInfo = (id: string) =>
$req({
url: `/customerService/getInfoByUserId/${id}`,
})
export const getCsInfo = async (id: string) =>
await http.get<any>(`/customerService/getInfoByUserId/${id}`)
// 更新用户信息
export const updateUserInfo = (data: any) =>
$req({
url: '/sysUser/editPerfectMessage',
method: 'post',
data,
})
export const updateUserInfo = async (data: any) =>
await http.post<any>('/sysUser/editPerfectMessage', data)
// 获取协议
export const getAgreeInfo = (id: string, isChat = false) =>
$req({
url: '/agreement/' + id,
headers: {
export const getAgreeInfo = async (id: string, isChat = false) =>
await http.get<any>('/agreement/' + id, undefined, {
header: {
Authorization: '',
},
})
// 获取字典
export const getDict = () =>
$req({
url: '/sysDictType/tree',
})
export const getDict = async () =>
await http.get<any>('/sysDictType/tree')
// 设备通知注册
export const bindRegId = (data: any) =>
$req({
url: '/sysUser/dealRegistrationId',
method: 'post',
data,
})
export const bindRegId = async (data: any) =>
await http.post<any>('/sysUser/dealRegistrationId', data)
// 获取未读消息数量
export const getUnreadNum = () => $req({ url: '/customerService/getUnreadNum' })
export const getUnreadNum = async () => await http.get<any>('/customerService/getUnreadNum')
// 支付创建订单
export const createInspectorPrepayOrder = (data: any) => {
return $req({
method: 'post',
url: '/orderManagement/createInspectorPrepayOrder',
data,
})
export const createInspectorPrepayOrder = async (data: any) => {
return await http.post<any>('/orderManagement/createInspectorPrepayOrder', data)
}

View File

@ -1,36 +1,24 @@
import $req from '../request';
import { http } from '../request/request';
/**
*
* @param data
*/
export const getUserInfo = (data = {}) => {
return $req({
method: 'post',
url: '/phone/inspectorTeacher/myInfo',
data,
});
export const getUserInfo = async (data = {}): Promise<any> => {
return await http.post<any>('/phone/inspectorTeacher/myInfo', data);
};
/**
*
* @param params
*/
export const queryUserRoles = (params = {}) => {
return $req({
method: 'get',
url: '/sysUser/getAdminTypeByPhone',
params,
});
export const queryUserRoles = async (params = {}): Promise<any> => {
return await http.get<any>('/sysUser/getAdminTypeByPhone', params);
};
/**
*
*/
export const switchRole = (adminType: number) => {
return $req({
method: 'get',
url: '/sysUser/changeAdminType',
params: {
adminType,
},
export const switchRole = async (adminType: number): Promise<any> => {
return await http.get<any>('/sysUser/changeAdminType', {
adminType,
});
};

View File

@ -1,111 +1,73 @@
import $req from '../request';
import { http } from '../request/request';
/**
*
* @param params
*/
export const getStudentDetail = (params = {}) => {
return $req({
method: 'get',
url: '/phone/inspectorTeacher/getStuVoByOrderIdAndCourseDate',
params,
});
export const getStudentDetail = async (params = {}): Promise<any> => {
return await http.get<any>('/phone/inspectorTeacher/getStuVoByOrderIdAndCourseDate', params);
};
/**
*
* @param data
*/
export const getUserReportPage = (data = {}) => {
return $req({
method: 'post',
url: '/phone/inspectorTeacher/getUserReportPage',
data,
});
export const getUserReportPage = async (data = {}): Promise<any> => {
return await http.post<any>('/phone/inspectorTeacher/getUserReportPage', data);
};
/**
*
* @param params
*/
export const getUserInspectorCourseReportInfo = (params = {}) => {
return $req({
method: 'get',
url: '/phone/inspectorTeacher/userInspectorCourseReportInfo',
params,
});
export const getUserInspectorCourseReportInfo = async (params = {}): Promise<any> => {
return await http.get<any>('/phone/inspectorTeacher/userInspectorCourseReportInfo', params);
};
/**
*
* @param data
*/
export const queryStudyPlanList = (data = {}) => {
return $req({
method: 'post',
url: '/phone/inspectorTeacher/queryStuPlanPage',
data,
});
export const queryStudyPlanList = async (data = {}): Promise<any> => {
return await http.post<any>('/phone/inspectorTeacher/queryStuPlanPage', data);
};
/**
*
* @param planId id
*/
export const deletePlanRequest = (planId: string) => {
return $req({
method: 'post',
url: `/phone/inspectorTeacher/deletePlanById?planId=${planId}`,
});
export const deletePlanRequest = async (planId: string): Promise<any> => {
return await http.post<any>(`/phone/inspectorTeacher/deletePlanById?planId=${planId}`);
};
/**
*
* @param gradeId id
*/
export const getSubjectListByGrade = (gradeId: string) => {
return $req({
method: 'get',
url: `/subject/list/${gradeId}`,
});
export const getSubjectListByGrade = async (gradeId: string): Promise<any> => {
return await http.get<any>(`/subject/list/${gradeId}`);
};
/**
*
* @param params
*/
export const queryStudyDuration = (params = {}) => {
return $req({
method: 'get',
url: '/userSubjectReport/study/duration',
params,
});
export const queryStudyDuration = async (params = {}): Promise<any> => {
return await http.get<any>('/userSubjectReport/study/duration', params);
};
/**
*
* @param params
*/
export const queryVideoStudy = (params = {}) => {
return $req({
method: 'get',
url: '/userSubjectReport/study/video',
params,
});
export const queryVideoStudy = async (params = {}): Promise<any> => {
return await http.get<any>('/userSubjectReport/study/video', params);
};
/**
*
* @param params
*/
export const queryStudyKnowledge = (params = {}) => {
return $req({
method: 'get',
url: '/userSubjectReport/study/knowledge',
params,
});
export const queryStudyKnowledge = async (params = {}): Promise<any> => {
return await http.get<any>('/userSubjectReport/study/knowledge', params);
};
/**
*
* @param params
*/
export const queryStudentWrongQuestion = (params = {}) => {
return $req({
method: 'get',
url: '/userSubjectReport/study/error',
params,
});
export const queryStudentWrongQuestion = async (params = {}): Promise<any> => {
return await http.get<any>('/userSubjectReport/study/error', params);
};

View File

@ -1,27 +1,19 @@
import $req from '../request';
import { http } from '../request/request';
/**
*
* @param data
*/
export const getCourseTable = (data={}) => {
return $req({
method: 'get',
url: '/phone/inspectorTeacher/getCourseTableById',
data,
});
export const getCourseTable = async (data = {}): Promise<any> => {
return await http.get<any>('/phone/inspectorTeacher/getCourseTableById', data);
};
/**
*
* @param data
* @param params
*/
export const queryStudentList = (params={}) => {
return $req({
method:'get',
url:'/phone/inspectorTeacher/getMyStudent',
params,
});
}
export const queryStudentList = async (params = {}): Promise<any> => {
return await http.get<any>('/phone/inspectorTeacher/getMyStudent', params);
};

View File

@ -1,91 +1,63 @@
import $req from './request'
import { http } from './request/request'
/**
*
* @param data
*/
export const getBindPhoneTypeApi = data => {
$req({
method: 'post',
url: '/xcx/login/getBindRelationList',
data,
})
export const getBindPhoneTypeApi = async data => {
return await http.post<any>('/xcx/login/getBindRelationList', data)
}
/**
*
* @param data
*/
export const getAdminTypeByPhoneApi = (params: any) =>
$req({
method: 'get',
url: '/sysUser/getAdminTypeByPhone',
params,
})
export const getAdminTypeByPhoneApi = async (params: any) =>
await http.get<any>('/sysUser/getAdminTypeByPhone', params)
/**
*
* @param data
*/
export const sendCodeMessageApi = data =>
$req({
method: 'post',
url: `/sms/sendMessage?phoneNumbers=${data}`,
})
export const sendCodeMessageApi = async data =>
await http.post<any>(`/sms/sendMessage?phoneNumbers=${data}`)
/**
*
* @param data
*/
export const smsLoginApi = data =>
$req({
method: 'post',
url: '/smsLogin',
data: {
...data,
clientType: 'MOBILE',
},
export const smsLoginApi = async data =>
await http.post<any>('/smsLogin', {
...data,
clientType: 'MOBILE',
})
/**
*
* @param data
*/
export const getUserInfoApi = () =>
$req({
method: 'get',
url: '/sysUser/selectUser',
})
export const getUserInfoApi = async () =>
await http.get<any>('/sysUser/selectUser')
/**
*
* @param data
*/
export const updateUserInfoApi = (data: any) =>
$req({
method: 'post',
url: '/sysUser/updateInfo',
data,
})
export const updateUserInfoApi = async (data: any) =>
await http.post<any>('/sysUser/updateInfo', data)
/**
*
* @param data
*/
export const bindAuthInfoApi = data =>
$req({
method: 'post',
url: '/wechatPublic/bindAuthInfo',
data,
})
export const bindAuthInfoApi = async data =>
await http.post<any>('/wechatPublic/bindAuthInfo', data)
/**
*
* @param data
*/
export const getAuthUrlApi = () =>
$req({
method: 'get',
url: '/wechatPublic/getAuthUrl',
})
export const getAuthUrlApi = async () =>
await http.get<any>('/wechatPublic/getAuthUrl')
// 退出登录
export const logout = () =>
$req({
url: '/logout',
})
export const logout = async () =>
await http.get<any>('/logout')

View File

@ -1,60 +1,43 @@
import $req from '../request'
import { http } from '../request/request'
/**
* -
* @param data
*/
export const subjectApi = (gradeId: string) =>
$req({
method: 'get',
url: `/subject/list/${gradeId}`,
})
export const subjectApi = async (gradeId: string) =>
await http.get<any>(`/subject/list/${gradeId}`)
/**
* -
* @param data
*/
export const studyTimeStatApi = (params: any) =>
$req({
method: 'get',
url: '/userSubjectReport/study/duration',
params,
})
export const studyTimeStatApi = async (params: any) =>
await http.get<any>('/userSubjectReport/study/duration', params)
/**
* -
* @param data
*/
export const videoStudyStatApi = (params: any) =>
$req({
method: 'get',
url: '/userSubjectReport/study/video',
params,
})
export const videoStudyStatApi = async (params: any) =>
await http.get<any>('/userSubjectReport/study/video', params)
/**
* -
* @param data
*/
export const knowledgeStudyStatApi = (params: any) =>
$req({
method: 'get',
url: '/userSubjectReport/study/knowledge',
params,
})
export const knowledgeStudyStatApi = async (params: any) =>
await http.get<any>('/userSubjectReport/study/knowledge', params)
/**
* -
* @param data
*/
export const studyErrorStatApi = (params: any) =>
$req({
method: 'get',
url: '/userSubjectReport/study/error',
params,
})
export const studyErrorStatApi = async (params: any) =>
await http.get<any>('/userSubjectReport/study/error', params)
/**
* -
* @param data
*/
export const englishLanguageStatApi = (data: any) =>
$req({
method: 'post',
url: '/userSentenceLearn/queryStatListByTimeType',
data,
})
export const englishLanguageStatApi = async (data: any) =>
await http.post<any>('/userSentenceLearn/queryStatListByTimeType', data)

View File

@ -1,10 +1,8 @@
import $req from '../request';
import { http } from '../request/request';
/**
*
* @param data
*/
export const queryAppRecordApi = (serialNum: string) =>
$req({
method: 'get',
url: `/userAppRecord/queryAppRecord/${serialNum}`,
});
export const queryAppRecordApi = async (serialNum: string) =>
await http.get<any>(`/userAppRecord/queryAppRecord/${serialNum}`);

View File

@ -1,49 +1,36 @@
import $req from '../request';
import { http } from '../request/request';
/**
* -
* @param data
*/
export const getRewardListApi = params =>
$req({
method: 'get',
url: '/userRewardMapping/list',
params,
});
export const getRewardListApi = async (params: any) =>
await http.get<any>('/userRewardMapping/list', params);
/**
* -
* @param data
*/
export const addRewardApi = data =>
$req({
method: 'post',
url: '/userRewardMapping',
data,
});
export const addRewardApi = async (data: any) =>
await http.post<any>('/userRewardMapping', data);
/**
* -
* @param data
*/
export const updateRewardApi = data =>
$req({
method: 'put',
url: '/userRewardMapping',
data,
});
export const updateRewardApi = async (data: any) =>
await http.put<any>('/userRewardMapping', data);
/**
* -
* @param data
*/
export const deleteRewardApi = ids =>
$req({
method: 'delete',
url: `/userRewardMapping/${ids}`,
});
export const deleteRewardApi = async (ids: string) =>
await http.del<any>(`/userRewardMapping/${ids}`);
/**
* -
* @param data
*/
export const getRewardDetailApi = id =>
$req({
method: 'get',
url: `/userRewardMapping/${id}`,
});
export const getRewardDetailApi = async (id: string) =>
await http.get<any>(`/userRewardMapping/${id}`);

View File

@ -1,78 +1,50 @@
import $req from '../request';
import { http } from '../request/request';
/**
*
* @param params
*/
export const getCurInfo = params =>
$req({
method: 'get',
url: '/parentBind/curInfo',
params,
});
export const getCurInfo = async (params: any) =>
await http.get<any>('/parentBind/curInfo', params);
/**
*
* @param data
*/
export const parentBindAdmin = data =>
$req({
method: 'post',
url: '/parentBind/admin',
data,
});
export const parentBindAdmin = async (data: any) =>
await http.post<any>('/parentBind/admin', data);
/**
*
* @param data
*/
export const parentBindApply = data =>
$req({
method: 'post',
url: '/parentBind/apply',
data,
});
export const parentBindApply = async (data: any) =>
await http.post<any>('/parentBind/apply', data);
/**
* -
* @param params
*/
export const adminInfo = params =>
$req({
method: 'get',
url: '/parentBind/adminInfo',
params,
});
export const adminInfo = async (params: any) =>
await http.get<any>('/parentBind/adminInfo', params);
/**
* -
* @param params
*/
export const applyInfo = params =>
$req({
method: 'get',
url: '/parentBind/apply/info',
params,
});
export const applyInfo = async (params: any) =>
await http.get<any>('/parentBind/apply/info', params);
/**
*
* @param data
*/
export const adminApproval = data =>
$req({
method: 'post',
url: '/parentBind/admin/approval',
data,
});
export const adminApproval = async (data: any) =>
await http.post<any>('/parentBind/admin/approval', data);
/**
*
* @param data
*/
export const deviceTimeControl = data =>
$req({
method: 'post',
url: '/deviceTimeControl',
data,
});
export const deviceTimeControl = async (data: any) =>
await http.post<any>('/deviceTimeControl', data);

View File

@ -1,12 +1,8 @@
import $req from '../request';
import { http } from '../request/request';
/**
* -
* @param params
*/
export const deviceScreenshotRecordList = params =>
$req({
method: 'get',
url: '/deviceScreenshotRecord/list',
params,
});
export const deviceScreenshotRecordList = async (params: any) =>
await http.get<any>('/deviceScreenshotRecord/list', params);

View File

@ -1,22 +1,17 @@
import $req from '../request';
import { http } from '../request/request';
/**
*
*
* @param params
*/
export const getDeviceScreenControlApi = (simSerialNumber: string) =>
$req({
method: 'get',
url: `/deviceTimeControl/${simSerialNumber}`,
});
export const getDeviceScreenControlApi = async (simSerialNumber: string) =>
await http.get<any>(`/deviceTimeControl/${simSerialNumber}`);
/**
*
*
* @param params
*/
export const lockDeviceScreenApi = (simSerialNumber: string) =>
$req({
method: 'post',
url: `/deviceTimeControl/update/lock/${simSerialNumber}`,
});
export const lockDeviceScreenApi = async (simSerialNumber: string) =>
await http.post<any>(`/deviceTimeControl/update/lock/${simSerialNumber}`);

View File

@ -1,101 +1,67 @@
import $req from '../request'
import { http } from '../request/request'
import { storeToRefs } from 'pinia'
import { user } from '@/store'
import { getCache } from '@/utils'
import db from '@/utils/db'
// 课表日历
export const getScheduleList = (data?: Record<string, any>): Promise<any> =>
$req({
method: 'get',
url: '/phone/inspectorTeacher/getCourseTableById',
data,
})
export const getScheduleList = async (data?: Record<string, any>): Promise<any> =>
await http.get<any>('/phone/inspectorTeacher/getCourseTableById', data)
// 查询指定日期学生数据
export const getCourseDate = (data?: Record<string, any>): Promise<any> =>
$req({
method: 'get',
url:
`/phone/inspectorTeacher/getCourseTabletStudentVoByTime` +
export const getCourseDate = async (data?: Record<string, any>): Promise<any> =>
await http.get<any>(
`/phone/inspectorTeacher/getCourseTabletStudentVoByTime` +
`${data.date ? `?courseDate=${data.date}` : ''}`,
// data,
})
)
// 开始督学
export const startInpector = (data?: Record<string, any>): Promise<any> =>
$req({
method: 'post',
url: `/phone/inspectorTeacher/startInspector?courseDate=${data.courseDate}`,
})
export const startInpector = async (data?: Record<string, any>): Promise<any> =>
await http.post<any>(`/phone/inspectorTeacher/startInspector?courseDate=${data.courseDate}`)
// 结束督学
export const endInpector = (data?: Record<string, any>): Promise<any> =>
$req({
method: 'post',
url: `/phone/inspectorTeacher/endInspector?courseDate=${data.courseDate}`,
})
export const endInpector = async (data?: Record<string, any>): Promise<any> =>
await http.post<any>(`/phone/inspectorTeacher/endInspector?courseDate=${data.courseDate}`)
// 督学实况
export const condition = (data?: Record<string, any>): Promise<any> =>
$req({
method: 'post',
url: `/phone/inspectorTeacher/inspector_real?courseDate=${data.courseDate}`,
})
export const condition = async (data?: Record<string, any>): Promise<any> =>
await http.post<any>(`/phone/inspectorTeacher/inspector_real?courseDate=${data.courseDate}`)
// 获取学员课表日历
export const getCourseData = (data?: Record<string, any>): Promise<any> =>
$req({
method: 'get',
url: `/phone/inspectorTeacher/getStuCourseTable?userId=${data.id}`,
// data,
})
export const getCourseData = async (data?: Record<string, any>): Promise<any> =>
await http.get<any>(`/phone/inspectorTeacher/getStuCourseTable?userId=${data.id}`)
// 获取学科
export const getSubject = (data?: Record<string, any>): Promise<any> =>
$req({
method: 'get',
url: `/subject/list/${data.gradeId}`,
})
export const getSubject = async (data?: Record<string, any>): Promise<any> =>
await http.get<any>(`/subject/list/${data.gradeId}`)
// 获取学科教材
export const getBooks = (data?: Record<string, any>): Promise<any> =>
$req({
method: 'get',
url: `/userTextBook/list?gradeId=${data.gradeId}&subjectId=${data.subjectId}&userId=${data.userId}&current=${data.current}`,
})
export const getBooks = async (data?: Record<string, any>): Promise<any> =>
await http.get<any>(
`/userTextBook/list?gradeId=${data.gradeId}&subjectId=${data.subjectId}&userId=${data.userId}&current=${data.current}`,
)
// 获取教材章节
export const getChaper = (data?: Record<string, any>): Promise<any> =>
$req({
method: 'get',
url: `/subjectChapter/tree?textBookId=${data.textBookId}`,
})
export const getChaper = async (data?: Record<string, any>): Promise<any> =>
await http.get<any>(`/subjectChapter/tree?textBookId=${data.textBookId}`)
// 获取教材章节知识点
export const getKnowledge = (data?: Record<string, any>): Promise<any> =>
$req({
method: 'get',
url: `/subjectKnowledge/tree?chapterId=${data.chapterId}`,
})
export const getKnowledge = async (data?: Record<string, any>): Promise<any> =>
await http.get<any>(`/subjectKnowledge/tree?chapterId=${data.chapterId}`)
// 发布计划
export const publishPlan = (data?: Record<string, any>): Promise<any> =>
$req({
method: 'post',
url: `/phone/inspectorTeacher/publishPlan`,
data,
})
export const publishPlan = async (data?: Record<string, any>): Promise<any> =>
await http.post<any>('/phone/inspectorTeacher/publishPlan', data)
// 获取学员计划
export const getStuPlan = (data?: Record<string, any>): Promise<any> =>
$req({
method: 'get',
url: `/phone/inspectorTeacher/getStuPlanByDate?userId=${data.userId}&courseDate=${data.courseDate}`,
})
export const getStuPlan = async (data?: Record<string, any>): Promise<any> =>
await http.get<any>(
`/phone/inspectorTeacher/getStuPlanByDate?userId=${data.userId}&courseDate=${data.courseDate}`,
)
// 获取督学师信息
export const getUserInfo = (data?: Record<string, any>): Promise<any> =>
$req({
method: 'get',
url: `/phone/inspectorTeacher/getCurrentTeacher`,
})
export const getUserInfo = async (data?: Record<string, any>): Promise<any> =>
await http.get<any>('/phone/inspectorTeacher/getCurrentTeacher')
// 文件上传
export const uploadFile = async (file): Promise<any> => {
const { token } = storeToRefs(user())
@ -115,84 +81,51 @@ export const uploadFile = async (file): Promise<any> => {
}
// 完善督学师资料 /phone/inspectorTeacher/updateTeacherInfo
export const updateTeacherInfo = (data?: Record<string, any>): Promise<any> =>
$req({
method: 'post',
url: `/phone/inspectorTeacher/updateTeacherInfo`,
data,
})
export const updateTeacherInfo = async (data?: Record<string, any>): Promise<any> =>
await http.post<any>('/phone/inspectorTeacher/updateTeacherInfo', data)
// 沟通列表
export const getTalkList = (data?: Record<string, any>): Promise<any> =>
$req({
method: 'get',
url: `/phone/inspectorTeacher/inspectorTalkListPage?current=${data.current}`,
})
export const getTalkList = async (data?: Record<string, any>): Promise<any> =>
await http.get<any>(`/phone/inspectorTeacher/inspectorTalkListPage?current=${data.current}`)
// 沟通详情
export const getTalkDetails = (data?: Record<string, any>): Promise<any> => {
export const getTalkDetails = async (data?: Record<string, any>): Promise<any> => {
const param = data.inspectorTalkRecordId
? `?inspectorTalkRecordId=${data.inspectorTalkRecordId}&userId=${data.userId}`
: `?userId=${data.userId}`
return $req({
method: 'get',
url: `/phone/inspectorTeacher/studentInspectorTalkPage${param}`,
})
return await http.get<any>(`/phone/inspectorTeacher/studentInspectorTalkPage${param}`)
}
// 消息存储
export const saveTalk = (data?: Record<string, any>): Promise<any> =>
$req({
method: 'post',
url: `/inspectorStudent/sendInspectorTalkRecord`,
data,
})
export const saveTalk = async (data?: Record<string, any>): Promise<any> =>
await http.post<any>('/inspectorStudent/sendInspectorTalkRecord', data)
// 验证码校验
export const validCode = (data?: Record<string, any>): Promise<any> =>
$req({
method: 'post',
url: `/sms/validateMessage?phoneNumbers=${data.phone}&code=${data.code}`,
data,
})
export const validCode = async (data?: Record<string, any>): Promise<any> =>
await http.post<any>(`/sms/validateMessage?phoneNumbers=${data.phone}&code=${data.code}`, data)
// 获取我的未读信息
export const getUnreadCount = (data?: Record<string, any>): Promise<any> =>
$req({
method: 'get',
url: `/phone/inspectorTeacher/myUnreadCount`,
})
export const getUnreadCount = async (data?: Record<string, any>): Promise<any> =>
await http.get<any>('/phone/inspectorTeacher/myUnreadCount')
// 消息标记为已读
export const readMsg = (data?: Record<string, any>): Promise<any> =>
$req({
method: 'post',
url: `/inspectorStudent/readTalkRecord`,
data,
})
export const readMsg = async (data?: Record<string, any>): Promise<any> =>
await http.post<any>('/inspectorStudent/readTalkRecord', data)
// 督学师是否已完善资料
export const needPerfectInfo = (data?: Record<string, any>): Promise<any> =>
$req({
method: 'get',
url: `/phone/inspectorTeacher/is_perfect`,
})
export const needPerfectInfo = async (data?: Record<string, any>): Promise<any> =>
await http.get<any>('/phone/inspectorTeacher/is_perfect')
// 学生是否可以进行精准学判断
export const getPrecisionFlag = (data?: Record<string, any>): Promise<any> =>
$req({
method: 'get',
url: `/userTrainTitle/airPrecisionFlag?subjectId=${data.subjectId}&userId=${data.userId}`,
})
export const getPrecisionFlag = async (data?: Record<string, any>): Promise<any> =>
await http.get<any>(
`/userTrainTitle/airPrecisionFlag?subjectId=${data.subjectId}&userId=${data.userId}`,
)
export const getKnowledgeFlag = (knowledgeId: string): Promise<boolean> => {
return $req({
method: 'get',
url: `/subjectKnowledge/titleFlag?id=${knowledgeId}`,
})
export const getKnowledgeFlag = async (knowledgeId: string): Promise<boolean> => {
return await http.get<any>(`/subjectKnowledge/titleFlag?id=${knowledgeId}`)
}
export const getKnowledgeVideo = (chapterId: string | number): Promise<any> => {
return $req({
method: 'get',
url: `/subjectChapterVideo/list?chapterId=${chapterId}`,
})
export const getKnowledgeVideo = async (chapterId: string | number): Promise<any> => {
return await http.get<any>(`/subjectChapterVideo/list?chapterId=${chapterId}`)
}

View File

@ -1,4 +1,3 @@
import $req from '../request'
import { http } from '../request/request'
/**
*

View File

@ -1,51 +1,40 @@
import $req from '../request'
import { http } from '../request/request'
/**
*
* @param params
*/
export const getParentBindChildApi = (params: any) =>
$req({
method: 'get',
url: '/parentBindChild/list',
params,
})
export const getParentBindChildApi = async (params: any) =>
await http.get<any>('/parentBindChild/list', params)
/**
*
* @param params
*/
export const getParentBindDeviceApi = async (params: any) =>
await http.get<any>('/parentBindDevice/list', params)
/**
* -
* @param params
*/
export const parentBindChildApi = (id: string) =>
$req({
method: 'get',
url: `/parentBindChild/${id}`,
})
export const parentBindChildApi = async (id: string) =>
await http.get<any>(`/parentBindChild/${id}`)
/**
* -
* @param params
*/
export const childUnBoundParentApi = (data: any) =>
$req({
method: 'post',
url: '/parentBindChild/unBound',
data,
})
export const childUnBoundParentApi = async (data: any) =>
await http.post<any>('/parentBindChild/unBound', data)
/**
* -
* @param params
*/
export const parentUnBoundDeviceApi = (data: any) =>
$req({
method: 'post',
url: '/parentBindDevice/unBound',
data,
})
export const parentUnBoundDeviceApi = async (data: any) =>
await http.post<any>('/parentBindDevice/unBound', data)
/**
* -
* @param params
@ -57,17 +46,12 @@ export const parentDeviceCurrentLoginApi = async (id: string) =>
* -
* @param params
*/
export const applyBindInfoListApi = () =>
$req({
method: 'get',
url: '/parentBind/applyInfoList',
})
export const applyBindInfoListApi = async () =>
await http.get<any>('/parentBind/applyInfoList')
/**
* -
* @param params
*/
export const userInfoPermitApi = () =>
$req({
method: 'get',
url: '/parentBind/applyInfoPermit',
})
export const userInfoPermitApi = async () =>
await http.get<any>('/parentBind/applyInfoPermit')

View File

@ -1,54 +1,30 @@
import $req from '../request';
import { http } from '../request/request';
export const getInspectorCourseList = (params: {userId: string | number}) => {
return $req({
method: 'get',
url: '/inspectorParent/userInspectorCourseList',
params
});
export const getInspectorCourseList = async (params: {userId: string | number}) => {
return await http.get<any>('/inspectorParent/userInspectorCourseList', params);
}
export const getInspectorModeList = () => {
return $req({
method: 'get',
url: '/inspectorParent/inspectorModeList',
});
export const getInspectorModeList = async () => {
return await http.get<any>('/inspectorParent/inspectorModeList');
}
// 最近或最后一次课时督学师和同学信息
export const getInspectorTeacherStudentInfo = (params: {orderId: string}) => {
return $req({
method: 'get',
url: '/inspectorParent/inspectorTeacherStudentInfo',
params
});
export const getInspectorTeacherStudentInfo = async (params: {orderId: string}) => {
return await http.get<any>('/inspectorParent/inspectorTeacherStudentInfo', params);
}
// 督学订单列表
export const getInspectorOrderList = (params: {userId: string | number}) => {
return $req({
method: 'get',
url: '/inspectorParent/userInspectorOrderList',
params
});
export const getInspectorOrderList = async (params: {userId: string | number}) => {
return await http.get<any>('/inspectorParent/userInspectorOrderList', params);
}
// 查询督学计划
export const getInspectorPlan = (params: {inspectorPlanId: string}) => {
return $req({
method: 'get',
url: '/inspectorParent/inspectorPlanInfo',
params
});
export const getInspectorPlan = async (params: {inspectorPlanId: string}) => {
return await http.get<any>('/inspectorParent/inspectorPlanInfo', params);
}
// 督学计划报告
export const getInspectorPlanReport = (params: {userId: string}) => {
return $req({
method: 'get',
url: '/inspectorParent/userInspectorCourseReportList',
params
});
export const getInspectorPlanReport = async (params: {userId: string}) => {
return await http.get<any>('/inspectorParent/userInspectorCourseReportList', params);
}

View File

@ -1,12 +1,9 @@
import $req from '../request';
import { http } from '../request/request';
export const getChildList = () => {
return $req({
url: '/inspectorParent/childList',
});
export const getChildList = async () => {
return await http.get<any>('/inspectorParent/childList');
};
export const getModelList = () => {
return $req({
url: '/inspectorParent/inspectorModeList',
});
export const getModelList = async () => {
return await http.get<any>('/inspectorParent/inspectorModeList');
};

View File

@ -1,72 +1,47 @@
import $req from '../request';
/**
import { http } from '../request/request'
/**
* -
* @param data
*/
export const getTaskListApi = params =>
$req({
method: 'get',
url: '/scTask/list',
params,
});
export const getTaskListApi = async (params: any) => await http.get<any>('/scTask/list', params)
/**
* -
* @param data
*/
export const addTaskApi = data =>
$req({
method: 'post',
url: '/scTask',
data,
});
export const addTaskApi = async (data: any) => await http.post<any>('/scTask', data)
/**
* -
* @param data
*/
export const getFamilyTaskStuApi = params =>
$req({
method: 'get',
url: '/scTask/getFamilyTaskStuList',
params,
});
export const getFamilyTaskStuApi = async (params: any) =>
await http.get<any>('/scTask/getFamilyTaskStuList', params)
/**
* -
* @param data
*/
export const taskConfigListApi = params =>
$req({
method: 'get',
url: '/scTaskConfig/list',
params,
});
export const taskConfigListApi = async (params?: any) =>
await http.get<any>('/scTaskConfig/list', params)
/**
* -
* @param data
*/
export const addTaskConfigApi = data =>
$req({
method: 'post',
url: '/scTaskConfig',
data,
});
export const addTaskConfigApi = async (data: any) => await http.post<any>('/scTaskConfig', data)
/**
* -
* @param data
*/
export const deleteTaskConfigApi = ids =>
$req({
method: 'delete',
url: `/scTaskConfig/${ids}`,
});
export const deleteTaskConfigApi = async (ids: string) =>
await http.del<any>(`/scTaskConfig/${ids}`)
/**
* -
* @param data
*/
export const updateTaskStatusApi = data =>
$req({
method: 'post',
url: '/scTask/updateTaskStatus',
data,
});
export const updateTaskStatusApi = async (data: any) =>
await http.post<any>('/scTask/updateTaskStatus', data)

View File

@ -1,31 +1,22 @@
import $req from '../request'
import { http } from '../request/request'
/**
* -
* @param data
*/
export const getWarrantyCardMsgApi = () =>
$req({
method: 'get',
url: '/parentBind/getBindDeviceList',
})
export const getWarrantyCardMsgApi = async () =>
await http.get<any>('/parentBind/getBindDeviceList')
/**
* -
* @param data
*/
export const applyServiceApi = (data: any) =>
$req({
method: 'post',
url: '/deviceWarrantyRecord',
data,
})
export const applyServiceApi = async (data: any) =>
await http.post<any>('/deviceWarrantyRecord', data)
/**
* -
* @param data
*/
export const getServiceHistoryApi = (params: any) =>
$req({
method: 'get',
url: '/deviceWarrantyRecord/list',
params,
})
export const getServiceHistoryApi = async (params: any) =>
await http.get<any>('/deviceWarrantyRecord/list', params)

View File

@ -1,92 +0,0 @@
import { user } from '@/store'
import { storeToRefs } from 'pinia'
import { getCache } from '@/utils'
import router from '@/router/router'
import db from '@/utils/db'
const CONFIG = {
baseURL: `${import.meta.env.VITE_HOST}/api/main`,
// baseURL: '/api/main',
timeout: 60000,
method: 'GET',
}
export class HttpError extends Error {
data: any
constructor(message: string, data: Record<string, any>) {
super(message)
this.data = data
}
}
const request = async (config: Record<string, any>): Promise<any> => {
const networkType = await uni.getNetworkType()
if (networkType.networkType === 'none') {
uni.showModal({
content: '暂无网络,请恢复网络后使用',
confirmText: '知道了',
showCancel: false,
confirmColor: '#ffe60f',
})
return Promise.reject(
new HttpError('暂无网络,请恢复网络后使用', {
code: '-1',
}),
)
}
return new Promise((resolve, reject) => {
const { clear } = user()
const { token } = storeToRefs(user())
const mergerToken = token.value || db.get('token')
const method = (config.method || CONFIG.method).toUpperCase()
uni.request({
method,
// url: (config.host || CONFIG.host) + (config.baseURL || CONFIG.baseURL) + config.url,
url: (config.baseURL || CONFIG.baseURL) + config.url,
data: method === 'GET' ? config.params : config.data,
timeout: config.timeout || CONFIG.timeout,
header: {
Authorization: mergerToken ? `Bearer ${mergerToken}` : '',
...config.headers,
},
complete(res: any) {
if (res.statusCode === 200) {
if (res.data.code === 200) {
return resolve(res.data)
} else {
if (!config.showToast) {
uni.showToast({
title: res.data?.message,
icon: 'none',
duration: 3000,
})
}
return reject(new HttpError(res.data?.message, res.data))
}
} else {
res.href = (config.baseURL || CONFIG.baseURL) + config.url
if (res.statusCode === 401) {
clear()
router.reLaunch('/pages/login/index')
} else {
uni.showToast({
icon: 'none',
title:
res.statusCode === 500 ? '服务异常' : res?.data?.message || '服务异常,请稍后重试',
})
}
return reject(
new HttpError(res.data?.message, {
code: res.statusCode,
data: res.data,
}),
)
}
},
})
})
}
export default request

View File

@ -1,4 +1,5 @@
import { type RequestOptions, type ResponseData, type ErrorResponse } from './types'
/* eslint-disable prefer-promise-reject-errors */
import type { RequestOptions, ResponseData, ErrorResponse } from './types'
import { HTTP_STATUS, ERROR_MSG } from './config'
import router from '@/router/router'
import db from '@/utils/db'
@ -33,7 +34,7 @@ export const responseInterceptor = async <T>(
// 处理成功响应
if (statusCode === HTTP_STATUS.SUCCESS) {
if (data.code === 200) return response
if (data.statusCode === 200 || data.code === 200) return response
throw {
statusCode,
errMsg: data.data,

View File

@ -207,7 +207,7 @@ async function fetchChartData() {
empty.value = false;
try {
loading.value = true;
const { data } = await studyErrorStatApi({
const data = await studyErrorStatApi({
dateType: dateType.value,
subjectId: props.subjectId,
userId: props.userId,

View File

@ -106,7 +106,7 @@ async function fetchChartData() {
empty.value = false;
try {
loading.value = true;
const { data } = await knowledgeStudyStatApi({
const data = await knowledgeStudyStatApi({
dateType: dateType.value,
subjectId: props.subjectId,
userId: props.userId,

View File

@ -163,7 +163,7 @@ const languageStatistics = ref({
async function fetchChartData() {
try {
loading.value = true;
const { data } = await englishLanguageStatApi({
const data = await englishLanguageStatApi({
dateType: dateType.value,
userId: props.userId,
});

View File

@ -30,29 +30,29 @@
</view>
</template>
<script lang="ts" setup>
import { ref, watch } from 'vue';
import DateFilter from './dateFilter.vue';
import BarChart from './Echart/BarChart.vue';
import { ref, watch } from 'vue'
import DateFilter from './dateFilter.vue'
import BarChart from './Echart/BarChart.vue'
import type { SubjectType, StudyTimeType } from '../interface';
import '../index.scss';
import { studyTimeStatApi } from '@/api';
import type { SubjectType, StudyTimeType } from '../interface'
import '../index.scss'
import { studyTimeStatApi } from '@/api'
const props = withDefaults(
defineProps<{
subjectId: number | string;
userId: string;
subjectId: number | string
userId: string
}>(),
{
subjectId: 0,
userId: '',
},
);
const emits = defineEmits(['change']);
const _subjectId = ref();
const loading = ref(true);
const dateType = ref(0);
const empty = ref(false);
)
const emits = defineEmits(['change'])
const _subjectId = ref()
const loading = ref(true)
const dateType = ref(0)
const empty = ref(false)
const showData = ref<StudyTimeType>({
continuousDuration: 0,
cumulativeTimeDuration: 0,
@ -63,7 +63,7 @@ const showData = ref<StudyTimeType>({
totalTimeFree: 0,
},
],
});
})
const englishLearningTime = ref({
categories: ['自由学', 'AI精准学', '错题本', '单词闯关', '单词测试', '语感训练'],
series: [
@ -72,7 +72,7 @@ const englishLearningTime = ref({
format: 'hoursUnit',
},
],
});
})
const learningTime = ref({
categories: ['自由学', 'AI精准学', '错题本'],
series: [
@ -81,30 +81,30 @@ const learningTime = ref({
format: 'hoursUnit',
},
],
});
})
function timeTool(second: string | number) {
const seconds = Number(second);
let h: number | string = (seconds / 3600).toFixed(1);
return Number(h);
const seconds = Number(second)
let h: number | string = (seconds / 3600).toFixed(1)
return Number(h)
}
async function fecthStudyTimeStat() {
if (props.subjectId === 0) {
empty.value = true;
return;
empty.value = true
return
}
empty.value = false;
empty.value = false
try {
loading.value = true;
const { data } = await studyTimeStatApi({
loading.value = true
const data = await studyTimeStatApi({
dateType: dateType.value,
subjectId: props.subjectId,
userId: props.userId,
});
showData.value.continuousDuration = data.continuousDuration;
showData.value.cumulativeTimeDuration = data.cumulativeTimeDuration;
let stat = data.studyDurationVoList[0];
})
showData.value.continuousDuration = data.continuousDuration
showData.value.cumulativeTimeDuration = data.cumulativeTimeDuration
let stat = data.studyDurationVoList[0]
englishLearningTime.value.series[0].data = [
{ color: '#83C400', value: timeTool(stat.totalTimeFree), text: stat.totalTimeFree },
{ color: '#767fff', value: timeTool(stat.totalTimeAi) },
@ -112,26 +112,26 @@ async function fecthStudyTimeStat() {
{ color: '#E9605D', value: timeTool(stat.totalTimeWordRecord) },
{ color: '#F2B058', value: timeTool(stat.totalTimeWordTest) },
{ color: '#A6E3FC', value: timeTool(stat.totalTimeSentenceRecord) },
];
]
learningTime.value.series[0].data = [
{ color: '#83C400', value: timeTool(stat.totalTimeFree), text: stat.totalTimeFree },
{ color: '#767fff', value: timeTool(stat.totalTimeAi) },
{ color: '#F59DF5', value: timeTool(stat.totalTimeError) },
];
]
} finally {
loading.value = false;
loading.value = false
}
}
async function handleFilterDate(i) {
dateType.value = i.value;
fecthStudyTimeStat();
dateType.value = i.value
fecthStudyTimeStat()
}
watch(
() => props.subjectId,
val => {
_subjectId.value = val;
dateType.value = 0;
fecthStudyTimeStat();
_subjectId.value = val
dateType.value = 0
fecthStudyTimeStat()
},
);
)
</script>

View File

@ -70,28 +70,28 @@
</view>
</template>
<script lang="ts" setup>
import { ref, reactive, onMounted, watch } from 'vue';
import DateFilter from './dateFilter.vue';
import { ref, reactive, onMounted, watch } from 'vue'
import DateFilter from './dateFilter.vue'
import '../index.scss';
import { videoStudyStatApi } from '@/api';
import dayjs from 'dayjs';
import '../index.scss'
import { videoStudyStatApi } from '@/api'
import dayjs from 'dayjs'
const props = withDefaults(
defineProps<{
subjectId: number | string;
userId: string;
subjectId: number | string
userId: string
}>(),
{
subjectId: 0,
userId: '',
},
);
const emits = defineEmits(['change']);
const OSS_URL = import.meta.env.VITE_OSS_HOST;
const empty = ref(false);
const dateType = ref(0);
const loading = ref(false);
)
const emits = defineEmits(['change'])
const OSS_URL = import.meta.env.VITE_OSS_HOST
const empty = ref(false)
const dateType = ref(0)
const loading = ref(false)
const opts = ref({
padding: [15, 20, 0, 15],
enableScroll: false,
@ -125,7 +125,7 @@ const opts = ref({
labelBgOpacity: 1,
},
},
});
})
const showData = ref({
videoCount: '',
videoCountRatio: '',
@ -138,7 +138,7 @@ const showData = ref({
videoTime: '0',
},
],
});
})
const videoLearning = ref({
categories: [],
@ -149,57 +149,57 @@ const videoLearning = ref({
color: '#9789ff',
},
],
});
})
async function fetchChartData() {
if (props.subjectId === 0) {
empty.value = true;
return;
empty.value = true
return
}
empty.value = false;
empty.value = false
try {
loading.value = true;
const { data } = await videoStudyStatApi({
loading.value = true
const data = await videoStudyStatApi({
dateType: dateType.value,
subjectId: props.subjectId,
userId: props.userId,
});
showData.value = data;
videoLearning.value.categories = [];
let chartData = [];
})
showData.value = data
videoLearning.value.categories = []
let chartData = []
for (let i in data.videoRecordVoList) {
videoLearning.value.categories[i] = dayjs(data.videoRecordVoList[i].studyDate).format(
'YYYY/MM/DD',
);
)
chartData[i] = data.videoRecordVoList[i].videoTime;
chartData[i] = data.videoRecordVoList[i].videoTime
}
videoLearning.value.series[0].data = chartData;
videoLearning.value.series[0].data = chartData
} finally {
loading.value = false;
loading.value = false
}
}
async function handleFilterDate(i) {
dateType.value = i.value;
fetchChartData();
dateType.value = i.value
fetchChartData()
}
function timeTool(second: string | number, isminute = false) {
const seconds = Number(second);
let h: number | string = Math.floor(seconds / 3600);
let m: number | string = Math.floor((seconds % 3600) / 60);
const seconds = Number(second)
let h: number | string = Math.floor(seconds / 3600)
let m: number | string = Math.floor((seconds % 3600) / 60)
//
h = h < 10 ? '0' + h : h;
m = m < 10 ? '0' + m : m;
h = h < 10 ? '0' + h : h
m = m < 10 ? '0' + m : m
return isminute ? m : h;
return isminute ? m : h
}
watch(
() => props.subjectId,
val => {
dateType.value = 0;
fetchChartData();
dateType.value = 0
fetchChartData()
},
);
)
</script>
<style lang="scss" scoped>
.title2 {

View File

@ -82,10 +82,10 @@ function tapFilterSubject(i: SubjectType) {
//
async function getParentBindChild() {
const { data } = await getParentBindChildApi({ parentId: userInfo.value.id, size: -1 })
empty.value = data.rows.length === 0 ? true : false
const data = await getParentBindChildApi({ parentId: userInfo.value.id, size: -1 })
empty.value = data.rows?.length ? true : false
childrenList.value = data.rows
showChildrenInfo.value = data.rows[0]
showChildrenInfo.value = data.rows?.[0]
}
//
async function getSubject() {
@ -94,7 +94,7 @@ async function getSubject() {
subjectList.value = []
return
}
const { data } = await subjectApi(showChildrenInfo.value.gradeId)
const data = await subjectApi(showChildrenInfo.value.gradeId)
subjectList.value = data
chooseSubject.value = data[0]
}

View File

@ -248,7 +248,7 @@ async function getParentBindDevice() {
uni.showLoading({
title: '加载中...',
})
const { data } = await getParentBindDeviceApi({ parentId: userInfo.value.id, size: -1 })
const data = await getParentBindDeviceApi({ parentId: userInfo.value.id, size: -1 })
equipEmpty.value = data.rows.length === 0
for (let i in data.rows) {
const _r = await deviceCurrentLogin(data.rows[i].id)
@ -267,7 +267,7 @@ async function getParentBindDevice() {
}
//
async function deviceCurrentLogin(id: string) {
const { data } = await parentDeviceCurrentLoginApi(id)
const data = await parentDeviceCurrentLoginApi(id)
return data
}
//
@ -278,7 +278,7 @@ async function fetchAppRecord() {
uni.showLoading({
title: '加载中...',
})
const { data } = await queryAppRecordApi(showEquipment.value.simSerialNumber)
const data = await queryAppRecordApi(showEquipment.value.simSerialNumber)
const res = data.filter(i => i.systemApp === 0)
equipAppList.value = res
appEmpty.value = res.length === 0

View File

@ -35,7 +35,7 @@ function queryList(pageNo: number, pageSize: number) {
current: pageNo,
simSerialNumber: simSerialNumber.value,
}).then(res => {
paging.value.complete(res.data.rows);
paging.value.complete(res.rows);
});
}

View File

@ -31,7 +31,7 @@ async function handleMachineScreen() {
uni.showLoading({
title: `${screenControlInfo?.value.lockFlag === 1}` ? '解屏中...' : '锁屏中...',
});
const { data } = await lockDeviceScreenApi(simSerialNumber.value);
const data = await lockDeviceScreenApi(simSerialNumber.value);
fetchDeviceScreen();
} finally {
uni.hideLoading();
@ -42,7 +42,7 @@ async function fetchDeviceScreen() {
uni.showLoading({
title: '加载中...',
});
const { data } = await getDeviceScreenControlApi(simSerialNumber.value);
const data = await getDeviceScreenControlApi(simSerialNumber.value);
screenControlInfo.value = data ? data : {};
} finally {
uni.hideLoading();

View File

@ -509,7 +509,7 @@ async function fetchDeviceScreen() {
uni.showLoading({
title: '加载中...',
})
const { data } = await getDeviceScreenControlApi(simSerialNumber.value)
const data = await getDeviceScreenControlApi(simSerialNumber.value)
if (!data) return
cellData[0].show = data.usageFlag === 1 ? true : false
cellData[1].show = data.eyeFlag === 1 ? true : false

View File

@ -140,30 +140,30 @@ async function getAdminInfoFun() {
await adminInfo({
simSerialNumber: parameterData.simSerialNumber,
}).then(res => {
deviceManager.value.adminUserAvatar = res.data.adminUserAvatar
deviceManager.value.adminUserName = res.data.adminUserName
deviceManager.value.adminUserAvatar = res.adminUserAvatar
deviceManager.value.adminUserName = res.adminUserName
})
} else if (parameterData.type === 2) {
//
await adminInfo({
childUserId: parameterData.childUserId,
}).then(res => {
parentManager.value.adminUserAvatar = res.data.adminUserAvatar
parentManager.value.adminUserName = res.data.adminUserName
parentManager.value.adminUserAvatar = res.adminUserAvatar
parentManager.value.adminUserName = res.adminUserName
})
} else {
//
await adminInfo({
childUserId: parameterData.childUserId,
}).then(res => {
parentManager.value.adminUserAvatar = res.data.adminUserAvatar
parentManager.value.adminUserName = res.data.adminUserName
parentManager.value.adminUserAvatar = res.adminUserAvatar
parentManager.value.adminUserName = res.adminUserName
})
await adminInfo({
simSerialNumber: parameterData.simSerialNumber,
}).then(res => {
deviceManager.value.adminUserAvatar = res.data.adminUserAvatar
deviceManager.value.adminUserName = res.data.adminUserName
deviceManager.value.adminUserAvatar = res.adminUserAvatar
deviceManager.value.adminUserName = res.adminUserName
})
}
}

View File

@ -68,7 +68,7 @@ function getApplyInfo(e) {
applyInfo({
id: e,
}).then(res => {
infoData.value = res.data;
infoData.value = res;
});
} finally {
uni.hideLoading();

View File

@ -220,7 +220,7 @@ async function subFun() {
//
async function handleParentBindAmin(obj, isTwo?: boolean) {
const res = await parentBindAdmin(obj);
type.value = res.data;
type.value = res;
showSuccessPopup.value = true;
switch (type.value) {
case 0: //

View File

@ -254,8 +254,8 @@ async function determine() {
}
const res = await parentBindAdmin(_obj)
showSuccessPopup.value = true
successPopupText.value = res.data === 6 ? '您已成为设备管理员' : '请稍后再进行尝试~'
bindType.value = res.data === 6 ? 'success' : 'fail'
successPopupText.value = res === 6 ? '您已成为设备管理员' : '请稍后再进行尝试~'
bindType.value = res === 6 ? 'success' : 'fail'
}
} else {
router.navigateTo({
@ -293,7 +293,7 @@ async function fetchCurBindInfo() {
title: '加载中...',
mask: true,
})
const { data } = await getCurInfo({
const data = await getCurInfo({
parentUerId: userInfo.value.id,
simSerialNumber: QRCode.value, //
childUserId: childUserIds.value, //

View File

@ -84,7 +84,7 @@ const inputFouse = async () => {
}
async function send() {
const { code, data } = await saveTalk({
const data = await saveTalk({
senderId: userInfo.value.userId,
// inspectorPlanId: stuData.value.inspectorPlanId,
receiverId: stuData.value.sender === 2 ? stuData.value.senderId : stuData.value.receiverId,
@ -92,43 +92,41 @@ async function send() {
sender: 1,
messageContent: content.value,
})
if (code === 200) {
const msg = {
id: data.id,
senderId: userInfo.value.userId,
receiverId: stuData.value.sender === 2 ? stuData.value.senderId : stuData.value.receiverId,
messageType: 1,
sender: 1,
// inspectorPlanId: stuData.value.inspectorPlanId,
messageContent: content.value,
avatarUrl: userInfo.value.avatarUrl,
senderName: userInfo.value.nickName,
senderAvatarUrl: userInfo.value.avatarUrl,
}
const newMessage = {
sender: 1,
messageContent: content.value,
avatar: '',
avatarUrl: userInfo.value.avatarUrl,
createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
}
chatList.value = [
...chatList.value,
lastMessageTs.value === 0 ||
dayjs(newMessage.createTime).valueOf() - lastMessageTs.value > FIVE_MINUTES
? { timeDate: formatDate(newMessage.createTime), type: 'divider' }
: null,
newMessage,
].filter(Boolean) as any[]
sendMsg({ type: 'inspectorTalkMessage', msg })
content.value = ''
nextTick(() => {
setTimeout(() => {
row.value = 'item-' + (chatList.value.length - 1)
}, 500)
})
const msg = {
id: data.id,
senderId: userInfo.value.userId,
receiverId: stuData.value.sender === 2 ? stuData.value.senderId : stuData.value.receiverId,
messageType: 1,
sender: 1,
// inspectorPlanId: stuData.value.inspectorPlanId,
messageContent: content.value,
avatarUrl: userInfo.value.avatarUrl,
senderName: userInfo.value.nickName,
senderAvatarUrl: userInfo.value.avatarUrl,
}
const newMessage = {
sender: 1,
messageContent: content.value,
avatar: '',
avatarUrl: userInfo.value.avatarUrl,
createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
}
chatList.value = [
...chatList.value,
lastMessageTs.value === 0 ||
dayjs(newMessage.createTime).valueOf() - lastMessageTs.value > FIVE_MINUTES
? { timeDate: formatDate(newMessage.createTime), type: 'divider' }
: null,
newMessage,
].filter(Boolean) as any[]
sendMsg({ type: 'inspectorTalkMessage', msg })
content.value = ''
nextTick(() => {
setTimeout(() => {
row.value = 'item-' + (chatList.value.length - 1)
}, 500)
})
}
//
@ -153,30 +151,26 @@ async function getDetails() {
uni.showLoading({
title: '加载中...',
})
const { code, data } = await getTalkDetails({
const data = await getTalkDetails({
inspectorTalkRecordId: chatList.value[0]?.id ?? (chatList.value[1]?.id || undefined),
userId: stuData.value.sender === 2 ? stuData.value.senderId : stuData.value.receiverId,
})
uni.hideLoading()
uni.stopPullDownRefresh()
if (code === 200) {
const ids = chatList.value.filter(item => item.status === 1).map(item => item.id)
if (ids.length) {
readMsg({
receiverId: userInfo.value.userId,
senderId: stuData.value.sender === 2 ? stuData.value.senderId : stuData.value.receiverId,
})
}
const newChat = insertDividers(data)
chatList.value = [...newChat, ...chatList.value]
chatList.value = chatList.value.map((v: any) => {
if (v.sender === 1) {
return { ...v, avatarUrl: userInfo.value.avatarUrl }
}
return { ...v }
const ids = chatList.value.filter(item => item.status === 1).map(item => item.id)
if (ids.length) {
readMsg({
receiverId: userInfo.value.userId,
senderId: stuData.value.sender === 2 ? stuData.value.senderId : stuData.value.receiverId,
})
}
} catch (error) {
const newChat = insertDividers(data)
chatList.value = [...newChat, ...chatList.value]
chatList.value = chatList.value.map((v: any) => {
if (v.sender === 1) {
return { ...v, avatarUrl: userInfo.value.avatarUrl }
}
return { ...v }
})
} finally {
uni.hideLoading()
uni.stopPullDownRefresh()
}

View File

@ -49,15 +49,14 @@ async function getTalkData() {
uni.showLoading({
title: '加载中...',
})
const { code, data } = await getTalkList({ current: current.value })
uni.hideLoading()
if (code === 200) {
list.value = data.rows
if (data.rows.length < 10) {
state.value = 'finished'
}
const data = await getTalkList({ current: current.value })
list.value = data.rows
if (data.rows.length < 10) {
state.value = 'finished'
}
} catch (error) {}
} finally {
uni.hideLoading()
}
}
//
function toDetails(row: any) {

View File

@ -37,7 +37,7 @@ provide('userInfo', userInfo);
const queryData = async () => {
try {
loading.value = true;
const { data } = await getUserInfo();
const data = await getUserInfo();
userInfo.value = Object.assign(data, { role: '督学师' });
} finally {
loading.value = false;

View File

@ -70,7 +70,7 @@ const roleList = ref<any[]>([])
const { getUserInfo: getLoginUserInfo } = user()
const queryRole = async () => {
const { data } = await queryUserRoles({ phone: userInfo.value.phone })
const data = await queryUserRoles({ phone: userInfo.value.phone })
roleList.value = (data ?? []).map(item => {
return {
text: '家长', // item.adminType === 16 ? '' : '',
@ -126,13 +126,13 @@ const showRole = () => {
const selectRole = async item => {
userInfo.value.role = item.text
const res = await switchRole(item.value)
db.set('token', res.data)
db.set('token', res)
const data = await getLoginUserInfo()
if (!data.openid) {
//
const authRes = await getAuthUrlApi()
// #ifdef H5
window.location.href = authRes.data
window.location.href = authRes
// #endif
// if (data.adminType === 16) {
// const authRes = await getAuthUrlApi();
@ -145,7 +145,7 @@ const selectRole = async item => {
// });
// }
} else {
let adminType = db.get('userInfo').adminType
let adminType = db.get<any>('userInfo').adminType
uni.reLaunch({
url: '/pages/home/index',
})

View File

@ -96,15 +96,8 @@ function chooseUploadMethod(i: any) {
uni.showLoading({
title: '上传中...',
})
const { code, data } = await uploadFile(res.tempFiles[0])
uni.hideLoading()
if (code === 200) {
rowData.value.url = data.filePath
} else {
uni.showToast({
title: '上传失败,请重试',
})
}
const data = await uploadFile(res.tempFiles[0])
rowData.value.url = data.filePath
},
fail: err => {
//

View File

@ -13,38 +13,37 @@
</template>
<script setup>
import { ref } from 'vue';
import { uploadFile } from '@/api/modules/inspector';
import { onLoad } from '@dcloudio/uni-app';
import { usepersonalStoreHook } from '@/store/inspector';
import QfImageCropper from '@/uni_modules/qf-image-cropper/components/qf-image-cropper/qf-image-cropper.vue';
const cropImg = ref('');
import { ref } from 'vue'
import { uploadFile } from '@/api/modules/inspector'
import { onLoad } from '@dcloudio/uni-app'
import { usepersonalStoreHook } from '@/store/inspector'
import QfImageCropper from '@/uni_modules/qf-image-cropper/components/qf-image-cropper/qf-image-cropper.vue'
import router from '@/router/router'
const cropImg = ref('')
function dataURLtoFile(dataurl, filename) {
let arr = dataurl.split(',');
let mime = arr[0].match(/:(.*?);/)[1];
let bstr = atob(arr[1]);
let n = bstr.length;
let u8arr = new Uint8Array(n);
let arr = dataurl.split(',')
let mime = arr[0].match(/:(.*?);/)[1]
let bstr = atob(arr[1])
let n = bstr.length
let u8arr = new Uint8Array(n)
while (n--) {
u8arr[n] = bstr.charCodeAt(n);
u8arr[n] = bstr.charCodeAt(n)
}
return new File([u8arr], filename, { type: mime });
return new File([u8arr], filename, { type: mime })
}
async function handleCrop(e) {
const file = dataURLtoFile(e.tempFilePath, String(Date.now()));
const { code, data } = await uploadFile(file);
if (code === 200) {
usepersonalStoreHook().SET_AVATAR(data.filePath);
uni.navigateBack({
delta: 1,
});
}
const file = dataURLtoFile(e.tempFilePath, String(Date.now()))
const data = await uploadFile(file)
usepersonalStoreHook().SET_AVATAR(data.filePath)
router.navigateBack({
delta: 1,
})
}
onLoad(option => {
cropImg.value = option.file;
cropImg.value = option.file
uni.setNavigationBarColor({
frontColor: '#ffffff', //
backgroundColor: '#2d2d2d', //
});
});
})
})
</script>

View File

@ -181,35 +181,35 @@
</view>
</template>
<script setup lang="ts">
import { user } from '@/store';
const { logout } = user();
import { onLaunch, onShow, onHide, onLoad } from '@dcloudio/uni-app';
import { usepersonalStoreHook } from '@/store/inspector';
import Picker from '../releasePlan/components/picker.vue';
import { getUserInfo, updateTeacherInfo } from '@/api/modules/inspector';
import { ref, reactive, nextTick, onMounted } from 'vue';
import router from '@/router/router';
import { removeCache } from '@/utils';
const OSS_URL = import.meta.env.VITE_OSS_HOST;
const defaultAvatar = `${OSS_URL}/urm/default_avatar.png`;
const arrow = `${OSS_URL}/iconfont/down_arrow.png`;
const form = ref<any>({});
const popupRef = ref();
const pikerIndex = ref(0);
const popupTitle = ref('');
const currentIndex = ref();
const selectionPopupRef = ref();
const qualification = ref<any[]>([]);
const formStore = usepersonalStoreHook();
const showPopup = ref(false);
const hasQuery = ref(false);
import { user } from '@/store'
const { logout } = user()
import { onLaunch, onShow, onHide, onLoad } from '@dcloudio/uni-app'
import { usepersonalStoreHook } from '@/store/inspector'
import Picker from '../releasePlan/components/picker.vue'
import { getUserInfo, updateTeacherInfo } from '@/api/modules/inspector'
import { ref, reactive, nextTick, onMounted } from 'vue'
import router from '@/router/router'
import { removeCache } from '@/utils'
const OSS_URL = import.meta.env.VITE_OSS_HOST
const defaultAvatar = `${OSS_URL}/urm/default_avatar.png`
const arrow = `${OSS_URL}/iconfont/down_arrow.png`
const form = ref<any>({})
const popupRef = ref()
const pikerIndex = ref(0)
const popupTitle = ref('')
const currentIndex = ref()
const selectionPopupRef = ref()
const qualification = ref<any[]>([])
const formStore = usepersonalStoreHook()
const showPopup = ref(false)
const hasQuery = ref(false)
const columns = [
{ name: '大专', value: '大专' },
{ name: '本科', value: '本科' },
{ name: '研究生', value: '研究生' },
{ name: '博士', value: '博士' },
{ name: '其他', value: '其他' },
];
]
const pickList = ref([
{
name: '从相册选择',
@ -221,49 +221,49 @@ const pickList = ref([
type: 2,
sourceType: 'camera',
},
]);
])
//
const subjectList = ref([{ name: '数学' }, { name: '语文' }]);
const subjectList = ref([{ name: '数学' }, { name: '语文' }])
const handSelect = (type: string) => {
switch (type) {
case 'subject':
popupTitle.value = '请选择擅长科目';
break;
popupTitle.value = '请选择擅长科目'
break
}
selectionPopupRef.value.open();
};
selectionPopupRef.value.open()
}
function confirmSelect(val: any) {
form.value.degree = val.value;
showPopup.value = false;
form.value.degree = val.value
showPopup.value = false
}
const bindPickerChange = (e: any) => {
currentIndex.value = e.detail.value;
};
currentIndex.value = e.detail.value
}
function handlePreview() {
if (!form.value.personalPhoto) return;
if (!form.value.personalPhoto) return
uni.previewImage({
urls: [form.value.personalPhoto],
current: 0,
});
})
}
function addQualification() {
router.navigateTo('/pages/inspector/personalData/certificateAdd');
router.navigateTo('/pages/inspector/personalData/certificateAdd')
}
function chooseUploadMethod(i: any) {
popupRef.value.close();
popupRef.value.close()
uni.chooseImage({
count: 1, //
sizeType: ['compressed', 'original'], // original compressed
sourceType: [i.sourceType], // album camera 使
success: res => {
jumpPage(`/pages/inspector/personalData/cropper?file=${res.tempFilePaths[0]}`);
jumpPage(`/pages/inspector/personalData/cropper?file=${res.tempFilePaths[0]}`)
},
fail: err => {
//
console.log('chooseImage fail', err);
console.log('chooseImage fail', err)
},
});
})
}
//
function uploadImage() {
@ -272,27 +272,27 @@ function uploadImage() {
sourceType: ['album', 'camera'],
// album camera 使使
success: (res: any) => {
console.log(res, '图片');
console.log(res, '图片')
//
res.tempFilePaths.map((item: any) => form.value.qualification.push(item));
res.tempFilePaths.map((item: any) => form.value.qualification.push(item))
},
fail: err => {
//
console.log('chooseImage fail', err);
console.log('chooseImage fail', err)
},
});
})
}
//
function previewImg(idx: number) {
uni.previewImage({
current: idx,
urls: form.value.qualification,
});
})
}
//
function deleteImg(i: number) {
form.value.qualification.splice(i, 1);
form.value.qualification.splice(i, 1)
}
//
function loadUploadIcon(e: any) {
@ -303,13 +303,13 @@ function errorUploadIcon() {
// wx.hideLoading();
}
function back() {
router.navigateBack();
router.navigateBack()
}
const clsoePopup = () => {
popupRef.value.close();
};
popupRef.value.close()
}
function checkedForm() {
let valid = true;
let valid = true
const fields = [
'personalPhoto',
'phone',
@ -318,13 +318,13 @@ function checkedForm() {
'personalInformation',
'degree',
'gradSchool',
];
]
fields.forEach(item => {
if (!form.value[item]) {
valid = false;
valid = false
}
});
return valid;
})
return valid
}
//
async function submitSave() {
@ -332,62 +332,61 @@ async function submitSave() {
uni.showToast({
title: '请完善资料后再保存',
icon: 'none',
});
return;
})
return
}
try {
uni.showLoading({
title: '保存中...',
mask: true,
});
const { code } = await updateTeacherInfo(form.value);
uni.hideLoading();
})
const { code } = await updateTeacherInfo(form.value)
uni.hideLoading()
if (code === 200) {
uni.showToast({
title: '保存成功',
mask: true,
});
})
setTimeout(() => {
router.navigateTo('/pages/inspector/mine/index');
}, 1500);
router.navigateTo('/pages/inspector/mine/index')
}, 1500)
}
} catch (error) {
uni.hideLoading();
uni.hideLoading()
}
}
//
const jumpPage = (path: string) => {
formStore.SET_FORM(form.value);
formStore.SET_FORM(form.value)
router.navigateTo({
path: path,
});
};
})
}
//
async function getData() {
try {
uni.showLoading({ title: '加载中...' });
const { code, data } = await getUserInfo();
if (code === 200) {
hasQuery.value = true;
form.value = { ...data };
formStore.SET_FORM(form.value);
pikerIndex.value = columns.findIndex(e => e.value === data.degree);
}
uni.hideLoading();
} catch (error) {}
uni.showLoading({ title: '加载中...' })
const data = await getUserInfo()
hasQuery.value = true
form.value = { ...data }
formStore.SET_FORM(form.value)
pikerIndex.value = columns.findIndex(e => e.value === data.degree)
} finally {
uni.hideLoading()
}
}
async function handLogout() {
logout();
logout()
}
onMounted(() => {
if (!hasQuery.value) getData();
});
if (!hasQuery.value) getData()
})
onShow(() => {
const personalData = formStore.form;
const personalData = formStore.form
if (personalData) {
form.value = personalData;
form.value = personalData
}
});
})
</script>
<style lang="scss" scoped>
.page {

View File

@ -100,7 +100,7 @@ const selectedItem = async (item) => {
try {
if ((knowledgeFlag.value[item.value] ?? "") === "") {
await uni.showLoading()
const {data} = await getKnowledgeFlag(item.value)
const data = await getKnowledgeFlag(item.value)
knowledgeFlag.value[item.value] = data
uni.hideLoading()
}

View File

@ -307,63 +307,56 @@ function removeConfirm() {
}
//
async function getDate() {
const { code, data } = await getCourseData({ id: user.value.userId })
if (code === 200) {
canlenderList.value = data || []
}
const data = await getCourseData({ id: user.value.userId })
canlenderList.value = data || []
}
//
async function getSubjectList() {
const { code, data } = await getSubject({ gradeId: user.value.gradeId })
if (code === 200) {
subjectData.value = data.map((item: any) => {
return {
name: item.subject,
value: item.subjectId,
}
})
}
const data = await getSubject({ gradeId: user.value.gradeId })
subjectData.value = data.map((item: any) => {
return {
name: item.subject,
value: item.subjectId,
}
})
}
//
async function getStuPlanData() {
try {
uni.showLoading({ title: '加载中...' })
const { code, data } = await getStuPlan({
const data = await getStuPlan({
userId: user.value.userId,
courseDate: user.value.courseDate ?? '',
})
uni.hideLoading()
if (code === 200) {
form.value.courseId = data.courseId ? data.courseId : plan.value.courseId
form.value.date = data.courseDate
? dayjs(data.courseDate).format('YYYY-MM-DD')
: plan.value.date
form.value.courseId = data.courseId ? data.courseId : plan.value.courseId
form.value.date = data.courseDate
? dayjs(data.courseDate).format('YYYY-MM-DD')
: plan.value.date
if (data.tasks && Object.keys(plan.value).length === 0) {
planList.value = data.tasks.map(item => {
const taskInfo = JSON.parse(item.taskInfoJson)
return {
...taskInfo,
...item,
id: item.id,
inspectorTimeStart: dayjs(item.inspectorTimeStart).format('HH:mm'),
inspectorTimeEnd: dayjs(item.inspectorTimeEnd).format('HH:mm'),
}
})
const storegePlan = {
index: 0,
date: form.value.date,
courseId: form.value.courseId,
planList: planList.value,
row: planList.value[0],
if (data.tasks && Object.keys(plan.value).length === 0) {
planList.value = data.tasks.map(item => {
const taskInfo = JSON.parse(item.taskInfoJson)
return {
...taskInfo,
...item,
id: item.id,
inspectorTimeStart: dayjs(item.inspectorTimeStart).format('HH:mm'),
inspectorTimeEnd: dayjs(item.inspectorTimeEnd).format('HH:mm'),
}
plan.value = storegePlan
uni.setStorageSync('plan', storegePlan)
} else {
uni.removeStorageSync('plan')
})
const storegePlan = {
index: 0,
date: form.value.date,
courseId: form.value.courseId,
planList: planList.value,
row: planList.value[0],
}
plan.value = storegePlan
uni.setStorageSync('plan', storegePlan)
} else {
uni.removeStorageSync('plan')
}
} catch (error) {
} finally {
uni.hideLoading()
}
}

View File

@ -90,17 +90,13 @@ async function getBooksData(params: any) {
title: '加载中...',
})
state.value = 'loading'
const { code, data } = await getBooks(params)
const data = await getBooks(params)
uni.hideLoading()
if (code === 200) {
books.value = [...books.value, ...data.rows]
state.value = data.rows.length < 10 ? 'finished' : 'loading'
} else {
state.value = 'error'
}
books.value = [...books.value, ...data.rows]
state.value = data.rows.length < 10 ? 'finished' : 'loading'
} catch (error) {
state.value = 'error'
} finally {
uni.hideLoading()
}
}

View File

@ -35,36 +35,36 @@
</view>
</template>
<script setup lang="ts">
import radio from '@/static/svg/radio.svg';
import { getChaper, getKnowledge, getKnowledgeVideo } from '@/api/modules/inspector';
import { onMounted, ref } from 'vue';
import MultiplePicker from './components/MultiplePicker.vue';
import radio from '@/static/svg/radio.svg'
import { getChaper, getKnowledge, getKnowledgeVideo } from '@/api/modules/inspector'
import { onMounted, ref } from 'vue'
import MultiplePicker from './components/MultiplePicker.vue'
const selectId = ref<number>(-1);
const selection = ref<any>({});
const plan = ref<any>({});
const chaperTree = ref<any[]>([]);
const knowledgeList = ref<any[]>([{ value: 0, name: '知识点1' }]);
const showPicker = ref(false);
const selectId = ref<number>(-1)
const selection = ref<any>({})
const plan = ref<any>({})
const chaperTree = ref<any[]>([])
const knowledgeList = ref<any[]>([{ value: 0, name: '知识点1' }])
const showPicker = ref(false)
function select(row: any) {
selectId.value = row.id;
selection.value = row;
selectId.value = row.id
selection.value = row
}
const taskType = ref<number>(0);
const taskType = ref<number>(0)
function clickNext() {
if (selectId.value === -1) {
uni.showToast({
title: '请先选择章节再进行下一步',
icon: 'none',
duration: 3000,
});
return;
})
return
}
if (taskType.value === 0) {
getVideoList();
getVideoList()
} else {
getKnowledgeList();
getKnowledgeList()
}
}
//
@ -72,14 +72,11 @@ async function getChaperList() {
try {
uni.showLoading({
title: '加载中...',
});
const { code, data } = await getChaper({ textBookId: plan.value.row.bookId });
if (code === 200) {
chaperTree.value = data || [];
}
uni.hideLoading();
} catch (error) {
uni.hideLoading();
})
const data = await getChaper({ textBookId: plan.value.row.bookId })
chaperTree.value = data || []
} finally {
uni.hideLoading()
}
}
//
@ -87,30 +84,30 @@ async function getVideoList() {
try {
uni.showLoading({
title: '加载中...',
});
const { data } = await getKnowledgeVideo(selectId.value);
console.log(data.rows);
})
const data = await getKnowledgeVideo(selectId.value)
console.log(data.rows)
if (data.rows.length) {
uni.setStorageSync('videoList', data.rows);
uni.setStorageSync('videoList', data.rows)
plan.value.planList[plan.value.index] = {
...plan.value.planList[plan.value.index],
chapterId: selectId.value,
chapterName: selection.value.chapterName || selection.value.name,
};
uni.setStorageSync('plan', plan.value);
}
uni.setStorageSync('plan', plan.value)
await uni.navigateTo({
url: '/pages/inspector/releasePlan/selectVideo',
});
})
} else {
uni.showToast({
title: '该章节暂无视频',
icon: 'none',
duration: 3000,
});
})
}
uni.hideLoading();
uni.hideLoading()
} catch (error) {
uni.hideLoading();
uni.hideLoading()
}
}
//
@ -119,22 +116,21 @@ async function getKnowledgeList() {
uni.showLoading({
title: '加载中...',
mask: true,
});
const { code, data } = await getKnowledge({ chapterId: selectId.value });
uni.hideLoading();
})
const data = await getKnowledge({ chapterId: selectId.value })
knowledgeList.value = data.map((item: any) => {
return {
name: item.name,
value: item.id,
};
});
}
})
if (knowledgeList.value.length === 0) {
uni.showToast({ title: '该章节没有知识点', icon: 'none' });
return;
uni.showToast({ title: '该章节没有知识点', icon: 'none' })
return
}
showPicker.value = true;
} catch (error) {
uni.hideLoading();
showPicker.value = true
} finally {
uni.hideLoading()
}
}
function confirmSelect(val: any) {
@ -144,15 +140,15 @@ function confirmSelect(val: any) {
chapterName: selection.value.name,
courseTimeId: item.value,
courseTimeName: item.name,
};
});
}
})
plan.value.planList[plan.value.index] = {
...plan.value.planList[plan.value.index],
chapterId: data[0].chapterId,
chapterName: data[0].chapterName,
courseTimeId: data[0].courseTimeId,
courseTimeName: data[0].courseTimeName,
};
}
data.slice(1).forEach(item => {
plan.value.planList.push({
...plan.value.planList[plan.value.index],
@ -160,20 +156,20 @@ function confirmSelect(val: any) {
chapterName: item.chapterName,
courseTimeId: item.courseTimeId,
courseTimeName: item.courseTimeName,
});
});
plan.value.row = plan.value.planList[plan.value.index];
console.log(plan.value.planList);
})
})
plan.value.row = plan.value.planList[plan.value.index]
console.log(plan.value.planList)
uni.setStorageSync('plan', plan.value);
uni.navigateTo({ url: '/pages/inspector/releasePlan/index' });
uni.setStorageSync('plan', plan.value)
uni.navigateTo({ url: '/pages/inspector/releasePlan/index' })
}
onMounted(() => {
plan.value = uni.getStorageSync('plan');
taskType.value = plan.value?.row?.taskType ?? 0;
getChaperList();
});
plan.value = uni.getStorageSync('plan')
taskType.value = plan.value?.row?.taskType ?? 0
getChaperList()
})
</script>
<style lang="scss" scoped>
.page {

View File

@ -19,29 +19,29 @@
</view>
</template>
<script setup lang="ts">
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app';
import { getPrecisionFlag } from '@/api/modules/inspector';
import video from '@/static/svg/video.svg';
import radio from '@/static/svg/radio.svg';
import exercise from '@/static/svg/exercise.svg';
import study from '@/static/svg/study.svg';
import sense from '@/static/svg/sense.svg';
import { onMounted, reactive, ref } from 'vue';
import Popup from './components/popup.vue';
const showPopup = ref(false);
const count = ref(1);
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
import { getPrecisionFlag } from '@/api/modules/inspector'
import video from '@/static/svg/video.svg'
import radio from '@/static/svg/radio.svg'
import exercise from '@/static/svg/exercise.svg'
import study from '@/static/svg/study.svg'
import sense from '@/static/svg/sense.svg'
import { onMounted, reactive, ref } from 'vue'
import Popup from './components/popup.vue'
const showPopup = ref(false)
const count = ref(1)
const list = ref<any[]>([
{ id: 0, imgUrl: video, width: '260rpx', height: '82rpx' },
{ id: 1, imgUrl: exercise, width: '260rpx', height: '82rpx' },
{ id: 2, imgUrl: study, width: '197rpx', height: '82rpx' },
// { id: 3, imgUrl: sense, width: '197rpx', height: '82rpx' },
]);
const plan = ref<any>({});
const labelText = ref('次数');
const planIndex = ref();
const selectId = ref<number>(-1);
])
const plan = ref<any>({})
const labelText = ref('次数')
const planIndex = ref()
const selectId = ref<number>(-1)
function selcetPlan(id: number) {
selectId.value = id;
selectId.value = id
}
async function clickNext() {
switch (selectId.value) {
@ -50,61 +50,61 @@ async function clickNext() {
title: '请选择任务再进行下一步',
icon: 'none',
duration: 3000,
});
break;
})
break
case 0:
setplanRow();
uni.navigateTo({ url: '/pages/inspector/releasePlan/selectBook' });
break;
setplanRow()
uni.navigateTo({ url: '/pages/inspector/releasePlan/selectBook' })
break
case 1:
setplanRow();
uni.navigateTo({ url: '/pages/inspector/releasePlan/selectBook' });
break;
setplanRow()
uni.navigateTo({ url: '/pages/inspector/releasePlan/selectBook' })
break
case 2:
PrecisionFlag();
PrecisionFlag()
break;
break
case 3:
labelText.value = '次数';
showPopup.value = true;
break;
labelText.value = '次数'
showPopup.value = true
break
}
}
async function PrecisionFlag() {
const { code, data } = await getPrecisionFlag({
const data = await getPrecisionFlag({
subjectId: plan.value.row.subjectId,
userId: plan.value.userId,
});
if (code === 200 && data) {
labelText.value = '次数';
showPopup.value = true;
})
if (data) {
labelText.value = '次数'
showPopup.value = true
} else {
uni.showToast({
title: '该学科所选教材没有练习题无法发布AI精准学任务',
icon: 'none',
duration: 3000,
});
})
}
}
function setplanRow(num?: string | number) {
let row = plan.value.planList[plan.value.index];
row = { ...row, taskType: selectId.value, num };
plan.value.row = row;
plan.value.planList[plan.value.index] = row;
uni.setStorageSync('plan', plan.value);
let row = plan.value.planList[plan.value.index]
row = { ...row, taskType: selectId.value, num }
plan.value.row = row
plan.value.planList[plan.value.index] = row
uni.setStorageSync('plan', plan.value)
}
function handleConfirm() {
//
const num = count.value;
setplanRow(num);
uni.navigateBack({ delta: 1 });
const num = count.value
setplanRow(num)
uni.navigateBack({ delta: 1 })
}
onShow(() => {
plan.value = uni.getStorageSync('plan');
planIndex.value = plan.value.index;
selectId.value = plan.value.row?.taskType;
count.value = plan.value.row.num;
});
plan.value = uni.getStorageSync('plan')
planIndex.value = plan.value.index
selectId.value = plan.value.row?.taskType
count.value = plan.value.row.num
})
</script>
<style lang="scss" scoped>
.page {

View File

@ -118,59 +118,56 @@
</view>
</template>
<script setup lang="ts">
import dayjs from 'dayjs';
import { onShow, onPullDownRefresh } from '@dcloudio/uni-app';
import { onMounted, ref, watch } from 'vue';
import selectIcon from '/src/static/svg/select.svg';
import { condition, getUnreadCount } from '@/api/modules/inspector';
import { useSocket } from '@/hooks/useSocket';
const { init: socketInit, inspectorMessage, sendMsg, inspectorDesktopMessage } = useSocket();
const selectionIcon = selectIcon;
const list = ref<any[]>([{ id: 0, fold: true, list: [{ id: 0 }, { id: 1 }] }]);
import dayjs from 'dayjs'
import { onShow, onPullDownRefresh } from '@dcloudio/uni-app'
import { onMounted, ref, watch } from 'vue'
import selectIcon from '/src/static/svg/select.svg'
import { condition, getUnreadCount } from '@/api/modules/inspector'
import { useSocket } from '@/hooks/useSocket'
const { init: socketInit, inspectorMessage, sendMsg, inspectorDesktopMessage } = useSocket()
const selectionIcon = selectIcon
const list = ref<any[]>([{ id: 0, fold: true, list: [{ id: 0 }, { id: 1 }] }])
const tagName = {
0: '自由学',
1: '自由学',
2: '精准学',
3: '语感训练',
};
}
const tagClass = {
0: 'yellow',
1: 'yellow',
2: 'blue',
3: 'red',
};
const unreadCount = ref(0);
}
const unreadCount = ref(0)
function padZero(value) {
return value < 10 ? `0${value}` : `${value}`;
return value < 10 ? `0${value}` : `${value}`
}
function timeFormat(time: string) {
return dayjs(time).format('HH:mm');
return dayjs(time).format('HH:mm')
}
function jumpPage(path: string) {
uni.navigateTo({
url: path,
});
})
}
const deskUserId = ref('');
const deskShotArr = ref([]);
const deskUserId = ref('')
const deskShotArr = ref([])
async function getData() {
try {
uni.showLoading({ title: '加载中...' });
const courseDate = uni.getStorageSync('courseDate');
const { code, data } = await condition({ courseDate });
uni.hideLoading();
if (code === 200) {
deskUserId.value = data.map(item => item.userId).join();
sendMsg({ type: 'inspectorDesktopPreview', msg: deskUserId.value });
list.value = (data || []).map(item => {
return {
...item,
fold: true,
};
});
}
} catch (error) {
uni.hideLoading();
uni.showLoading({ title: '加载中...' })
const courseDate = uni.getStorageSync('courseDate')
const data = await condition({ courseDate })
deskUserId.value = data.map(item => item.userId).join()
sendMsg({ type: 'inspectorDesktopPreview', msg: deskUserId.value })
list.value = (data || []).map(item => {
return {
...item,
fold: true,
}
})
} finally {
uni.hideLoading()
}
}
function chat(row: any) {
@ -179,53 +176,50 @@ function chat(row: any) {
receiverId: row.userId,
avatarUrl: row.avatarUrl,
nickName: row.username,
});
uni.setStorageSync('user', { userName: row.userName, userId: row.userId });
})
uni.setStorageSync('user', { userName: row.userName, userId: row.userId })
uni.navigateTo({
url: '/pages/inspector/chat/chatDetails',
});
})
}
//
async function getMyUnreadCount() {
const { code, data } = await getUnreadCount();
if (code === 200) {
unreadCount.value = data;
}
unreadCount.value = await getUnreadCount()
}
watch(inspectorMessage, msg => {
if (!msg) return;
unreadCount.value++;
});
if (!msg) return
unreadCount.value++
})
watch(inspectorDesktopMessage, (info: any) => {
if (!info.type) return;
if (!info.type) return
if (!info.msg) {
deskShotArr.value.push({ ...info.data });
deskShotArr.value.push({ ...info.data })
} else {
deskShotArr.value.push({ ...info.msg });
deskShotArr.value.push({ ...info.msg })
}
list.value = list.value.map((i: any) => {
let v: any = deskShotArr.value.filter((i2: any) => i2.userId === i.userId);
let v: any = deskShotArr.value.filter((i2: any) => i2.userId === i.userId)
if (v.length > 0) {
return {
...i,
deskUrl: v[0].imageUrl ? v[0].imageUrl : '',
};
}
}
return i;
});
});
return i
})
})
onPullDownRefresh(() => {
sendMsg({ type: 'inspectorDesktopPreview', msg: deskUserId.value });
uni.stopPullDownRefresh();
});
sendMsg({ type: 'inspectorDesktopPreview', msg: deskUserId.value })
uni.stopPullDownRefresh()
})
onMounted(() => {
socketInit();
getData();
});
socketInit()
getData()
})
onShow(() => {
deskShotArr.value = [];
getMyUnreadCount();
});
deskShotArr.value = []
getMyUnreadCount()
})
</script>
<style lang="scss" scoped>
.page {

View File

@ -345,19 +345,15 @@ function changeDay(type: string) {
async function getDate(date?: string) {
uni.showLoading({ title: '加载中...' })
try {
const { code, data, message } = await getCourseDate({ date })
if (code === 200) {
currentDate.value =
dayjs(data.courseDate).format('YYYY-MM-DD') || dayjs().format('YYYY-MM-DD')
courseData.value = data || {}
currentDateIndex.value = calendarData.value.findIndex(e => e.courseDate === currentDate.value)
inspectorTimeStart.value = data.inspectorTimeStart ? data.inspectorTimeStart : ''
studentList.value = data.studentDetails || []
if (data.planState === 1) {
canEnd()
}
const data = await getCourseDate({ date })
currentDate.value = dayjs(data.courseDate).format('YYYY-MM-DD') || dayjs().format('YYYY-MM-DD')
courseData.value = data || {}
currentDateIndex.value = calendarData.value.findIndex(e => e.courseDate === currentDate.value)
inspectorTimeStart.value = data.inspectorTimeStart ? data.inspectorTimeStart : ''
studentList.value = data.studentDetails || []
if (data.planState === 1) {
canEnd()
}
} catch (e) {
} finally {
uni.hideLoading()
}
@ -366,7 +362,8 @@ async function getDate(date?: string) {
async function getList() {
try {
uni.showLoading({ title: '加载中...' })
const { code, data, message } = await getScheduleList()
const result2 = await getScheduleList()
const { code, data, message } = result2
if (code === 200) {
calendarData.value = data || []
} else {
@ -379,10 +376,7 @@ async function getList() {
}
//
async function getMyUnreadCount() {
const { code, data } = await getUnreadCount()
if (code === 200) {
unreadCount.value = data
}
unreadCount.value = await getUnreadCount()
}
watch(inspectorMessage, msg => {
if (!msg) return

View File

@ -63,7 +63,7 @@ const loadMore = () => {
const queryList = async () => {
loading.value = true
try {
const { data } = await queryStudyPlanList({
const data = await queryStudyPlanList({
current: page.value.current,
userId: studentInfo.value.userId,
})

View File

@ -39,81 +39,78 @@
</template>
<script setup lang="ts">
import { inject, type Ref, ref, watch, watchEffect } from 'vue';
import dayjs from 'dayjs';
import {
getUserInspectorCourseReportInfo,
getUserReportPage,
} from '@/api/inspector/student-detail';
import IspDataLoad from '@/components/inspector/isp-data-load.vue';
import IspLoadMore from '@/components/inspector/isp-load-more.vue';
import { inject, type Ref, ref, watch, watchEffect } from 'vue'
import dayjs from 'dayjs'
import { getUserInspectorCourseReportInfo, getUserReportPage } from '@/api/inspector/student-detail'
import IspDataLoad from '@/components/inspector/isp-data-load.vue'
import IspLoadMore from '@/components/inspector/isp-load-more.vue'
const collapseValue = ref();
const studentInfo = inject<Ref<any>>('studentInfo');
const collapseValue = ref()
const studentInfo = inject<Ref<any>>('studentInfo')
const queryResult = ref({});
const reportList = ref([]);
const reportDetail = ref<any>({});
const listLoading = ref(false);
const loading = ref(false);
const queryResult = ref({})
const reportList = ref([])
const reportDetail = ref<any>({})
const listLoading = ref(false)
const loading = ref(false)
const page = ref({
current: 1,
total: 0,
});
})
const loadMore = () => {
if (Number(page.value.total) > reportList.value.length) {
page.value.current++;
initData();
page.value.current++
initData()
}
};
}
//
const getWeekDay = (date: string) => {
const weekDay = new Date(date).getDay();
const weekDayMap = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
return weekDayMap[weekDay];
};
const weekDay = new Date(date).getDay()
const weekDayMap = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
return weekDayMap[weekDay]
}
const initData = async () => {
listLoading.value = true;
listLoading.value = true
try {
const { data } = await getUserReportPage({
const data = await getUserReportPage({
userId: studentInfo.value.userId,
current: page.value.current,
});
page.value.total = data.total;
queryResult.value = data;
reportList.value.push(...(data?.records ?? []));
})
page.value.total = data.total
queryResult.value = data
reportList.value.push(...(data?.records ?? []))
} finally {
listLoading.value = false;
listLoading.value = false
}
};
}
const getReportDetail = async (_name: string) => {
const item = reportList.value.find(item => {
return String(item.id) === _name;
});
return String(item.id) === _name
})
if (reportDetail.value && reportDetail.value.id === item.id) {
return;
return
}
loading.value = true;
loading.value = true
return new Promise((resolve, reject) => {
getUserInspectorCourseReportInfo({
inspectorCourseId: item.inspectorCourseId,
})
.then(({ data }) => {
reportDetail.value = data;
resolve(true);
.then(data => {
reportDetail.value = data
resolve(true)
})
.finally(() => {
loading.value = false;
});
});
};
loading.value = false
})
})
}
watchEffect(() => {
if (studentInfo.value.userId) {
initData();
initData()
}
});
})
// watch(
// () => studentInfo.value,

View File

@ -55,7 +55,7 @@ const queryData = async () => {
if (!(currentDuration.value >= 0)) {
return;
}
const { data } = await queryStudyDuration({
const data = await queryStudyDuration({
...studySituationParam.value,
dateType: currentDuration.value,
});

View File

@ -62,7 +62,7 @@ provide('studySituationParam', {
const querySubjectList = async () => {
loading.value = true;
try {
const { data } = await getSubjectListByGrade(studentInfo.value.gradeId);
const data = await getSubjectListByGrade(studentInfo.value.gradeId);
subjectList.value = data.map((item: any) => ({
name: item.name,
value: item.subjectId,

View File

@ -90,7 +90,7 @@ const queryData = async () => {
if (!(currentDuration.value >= 0)) {
return;
}
const { data } = await queryStudyKnowledge({
const data = await queryStudyKnowledge({
...studySituationParam.value,
dateType: currentDuration.value,
});

View File

@ -132,7 +132,7 @@ const queryData = async () => {
if (!(currentDuration.value >= 0)) {
return;
}
const { data } = await queryStudentWrongQuestion({
const data = await queryStudentWrongQuestion({
...studySituationParam.value,
dateType: currentDuration.value,
});

View File

@ -80,7 +80,7 @@ const queryData = async () => {
if (!(currentDuration.value >= 0)) {
return;
}
const { data } = await queryVideoStudy({
const data = await queryVideoStudy({
...studySituationParam.value,
dateType: currentDuration.value,
});

View File

@ -36,7 +36,7 @@ provide('routeData', routeData)
const queryData = async _params => {
loadingData.value = true
try {
const { data } = await getStudentDetail(_params)
const data = await getStudentDetail(_params)
studentInfo.value = data
} finally {
loadingData.value = false

View File

@ -40,7 +40,7 @@ const calendarValue = ref(dayjs().format('YYYY-MM-DD'));
const dateList = ref([]);
const initData = async () => {
const { data } = await getCourseTable();
const data = await getCourseTable();
dateList.value = (data ?? []).map(item => {
return {
...item,

View File

@ -58,7 +58,7 @@ const stateObj = {
const queryList = async (courseDate: string) => {
queryLoading.value = true
try {
const { data } = await queryStudentList({ courseDate })
const data = await queryStudentList({ courseDate })
queryResult.value = data ?? {}
studentList.value = data?.studentDetails ?? []
} finally {

View File

@ -124,7 +124,7 @@ function phoneDivision() {
}
//
async function fetchDXUserInfo() {
const { data } = await dx_getUserInfoApi()
const data = await dx_getUserInfoApi()
db.set('dxs_userInfo', data)
}
//
@ -171,7 +171,7 @@ async function getAdminTypeByPhone() {
const res = await getAdminTypeByPhoneApi({
phone: loginForm.value.phone,
})
userAdmin.value = res.data
userAdmin.value = res
if (userAdmin.value.length <= 1) {
//
loginForm.value.adminType = userAdmin.value[0].adminType
@ -189,14 +189,14 @@ async function smsLogin() {
title: '登录中...',
})
const res = await smsLoginApi(loginForm.value)
setToken(res.data)
setToken(res)
const data = await getUserInfo()
if (!data.openid) {
//
const authRes = await getAuthUrlApi()
// #ifdef H5
window.location.href = authRes.data
window.location.href = authRes
// #endif
// if (data.adminType === 16) {
// const authRes = await getAuthUrlApi();

View File

@ -186,7 +186,7 @@ async function submit() {
onLoad(async options => {
formData.value.id = options.id;
if (formData.value.id) {
const { data } = await getRewardDetailApi(formData.value.id);
const data = await getRewardDetailApi(formData.value.id);
formData.value = data;
tempImageUrl.value[0] = data.iconUrl;
fontNum.value = data.note.length;

View File

@ -42,125 +42,123 @@
</template>
<script setup>
import { nextTick, reactive, ref } from 'vue';
import { onLoad, onShow, onUnload } from '@dcloudio/uni-app';
import { getRewardListApi, deleteRewardApi } from '@/api';
import router from '@/router/router';
import Empty from '@/components/Empty/index.vue';
import CustomPopup from '@/components/CustomPopup/index.vue';
import SwipeAction from './swipeAction.vue';
const OSS_URL = import.meta.env.VITE_OSS_HOST;
const swipeRef = ref(null);
const showCustomPopup = ref(false);
const id = ref(); // id
const pageStatus = ref('');
import { nextTick, reactive, ref } from 'vue'
import { onLoad, onShow, onUnload } from '@dcloudio/uni-app'
import { getRewardListApi, deleteRewardApi } from '@/api'
import router from '@/router/router'
import Empty from '@/components/Empty/index.vue'
import CustomPopup from '@/components/CustomPopup/index.vue'
import SwipeAction from './swipeAction.vue'
const OSS_URL = import.meta.env.VITE_OSS_HOST
const swipeRef = ref(null)
const showCustomPopup = ref(false)
const id = ref() // id
const pageStatus = ref('')
const scrollView = ref({
oldScrollTop: 0,
scrollTop: 0,
});
const isScroll = ref(false);
const timer = ref(null);
})
const isScroll = ref(false)
const timer = ref(null)
const pageInfo = ref({
size: 10,
current: 1,
total: 0,
});
const list = ref([]);
})
const list = ref([])
const back = () => {
router.navigateTo('/pages/mine/index');
};
router.navigateTo('/pages/mine/index')
}
//
function handleAddItem() {
router.navigateTo('/pages/mine/awardManage/awardItem');
router.navigateTo('/pages/mine/awardManage/awardItem')
}
//
function handleBackTop() {
if (timer.value) {
clearTimeout(timer.value);
clearTimeout(timer.value)
}
timer.value = setTimeout(() => {
scrollView.value.scrollTop = scrollView.value.oldScrollTop;
scrollView.value.scrollTop = scrollView.value.oldScrollTop
nextTick(() => {
scrollView.value.scrollTop = 0;
});
}, 300);
scrollView.value.scrollTop = 0
})
}, 300)
}
function handleSrcoll(val) {
isScroll.value = val;
isScroll.value = val
}
function handleEditBtn(val) {
router.navigateTo({
path: `/pages/mine/awardManage/awardItem`,
query: { id: val.id }
});
query: { id: val.id },
})
}
function handleDeleteBtn(val) {
console.log('删除', val);
id.value = val.id;
showCustomPopup.value = true;
console.log('删除', val)
id.value = val.id
showCustomPopup.value = true
}
//
function handleConfirmPopup() {
deleteRewardApi(id.value).then(res => {
if (res.code === 200) {
let index = list.value.findIndex(item => item.id === id.value);
list.value.splice(index, 1);
pageInfo.value.total = -1;
showCustomPopup.value = false;
let index = list.value.findIndex(item => item.id === id.value)
list.value.splice(index, 1)
pageInfo.value.total = -1
showCustomPopup.value = false
uni.showToast({
title: '删除成功',
icon: 'none',
});
})
}
});
})
}
//
function fetchAwardList() {
uni.showLoading({
title: '加载中',
});
})
getRewardListApi({
...pageInfo.value,
})
.then(res => {
if (res.code === 200) {
const { data } = res;
pageStatus.value = data.totalRows === 0 ? 'empty' : '';
pageInfo.value.total = data.totalRows;
for (let i in data.rows) {
list.value.push({
...data.rows[i],
right: 0,
});
}
wx.hideLoading();
const data = res
pageStatus.value = data.totalRows === 0 ? 'empty' : ''
pageInfo.value.total = data.totalRows
for (let i in data.rows) {
list.value.push({
...data.rows[i],
right: 0,
})
}
wx.hideLoading()
})
.catch(err => {
uni.hideLoading();
});
uni.hideLoading()
})
}
function handleScroll(e) {
scrollView.value.oldScrollTop = e.detail.scrollTop;
scrollView.value.oldScrollTop = e.detail.scrollTop
}
//
function loadData() {
if (list.value.length < pageInfo.value.total) {
pageInfo.value.current++;
fetchAwardList();
pageInfo.value.current++
fetchAwardList()
}
}
onLoad(() => {
pageInfo.value.current = 1;
list.value = [];
fetchAwardList();
});
pageInfo.value.current = 1
list.value = []
fetchAwardList()
})
</script>
<style lang="scss" scoped>

View File

@ -92,7 +92,7 @@ async function fetchTaskList() {
uni.showLoading({
title: '加载中...',
});
const { data } = await getTaskListApi({
const data = await getTaskListApi({
...pageInfo.value,
});
pageInfo.value.total = data.totalRows;

View File

@ -161,7 +161,7 @@ async function fetchChildrenInfo() {
uni.showLoading({
title: '加载中...',
});
const { data } = await getParentBindChildApi({
const data = await getParentBindChildApi({
parentId: userInfo.value.id,
...page.value,
});
@ -184,7 +184,7 @@ async function fetchStudentTaskStatus() {
uni.showLoading({
title: '加载中...',
});
const { data } = await getFamilyTaskStuApi({
const data = await getFamilyTaskStuApi({
...taskStatusInfo.value,
});
childrenList.value = data;

View File

@ -136,7 +136,7 @@ async function fetchRewardList() {
uni.showLoading({
title: '加载中',
});
let { data } = await getRewardListApi({ size: -1 });
let data = await getRewardListApi({ size: -1 });
total.value = data.totalRows;
if (data.totalRows > 0) {
data.rows.map((item, idx) =>

View File

@ -192,7 +192,7 @@ async function fetchTaskList() {
uni.showLoading({
title: '加载中...',
});
let { data } = await taskConfigListApi();
let data = await taskConfigListApi();
systemTaskList.value = data.filter(item => item.taskType === 0);
customTaskList.value = data.filter(item => item.taskType === 1);
uni.hideLoading();

View File

@ -69,7 +69,7 @@ function getWarrantyList() {
});
getWarrantyCardMsgApi()
.then(res => {
warrantyList.value = res.data;
warrantyList.value = res;
uni.hideLoading();
})
.catch(err => {

View File

@ -43,84 +43,82 @@
</template>
<script setup>
import { computed, nextTick, ref, watch } from 'vue';
import dayjs from 'dayjs';
import { computed, nextTick, ref, watch } from 'vue'
import dayjs from 'dayjs'
import Empty from '@/components/Empty/index.vue';
import { onLoad } from '@dcloudio/uni-app';
import { getServiceHistoryApi } from '@/api';
const OSS_URL = import.meta.env.VITE_OSS_HOST;
const familyId = ref(''); // id
const pageStatus = ref('');
const serviceHistortList = ref([]);
import Empty from '@/components/Empty/index.vue'
import { onLoad } from '@dcloudio/uni-app'
import { getServiceHistoryApi } from '@/api'
const OSS_URL = import.meta.env.VITE_OSS_HOST
const familyId = ref('') // id
const pageStatus = ref('')
const serviceHistortList = ref([])
const page = ref({
current: 1,
size: 10,
total: 0,
});
const timer = ref(null);
})
const timer = ref(null)
const scrollView = ref({
oldScrollTop: 0,
scrollTop: 0,
});
})
function handleScroll(e) {
scrollView.value.oldScrollTop = e.detail.scrollTop;
scrollView.value.oldScrollTop = e.detail.scrollTop
}
//
function handleBackTop() {
if (timer.value) {
clearTimeout(timer.value);
clearTimeout(timer.value)
}
timer.value = setTimeout(() => {
scrollView.value.scrollTop = scrollView.value.oldScrollTop;
scrollView.value.scrollTop = scrollView.value.oldScrollTop
nextTick(() => {
scrollView.value.scrollTop = 0;
});
}, 300);
scrollView.value.scrollTop = 0
})
}, 300)
}
//
function loadData() {
if (serviceHistortList.value.length < page.value.total) {
page.value.current++;
fetchServiceHistoryList();
page.value.current++
fetchServiceHistoryList()
}
}
//
function lookServiceDetails(i) {
let details = encodeURIComponent(JSON.stringify(i));
let details = encodeURIComponent(JSON.stringify(i))
uni.navigateTo({
url: `/pages/mine/warranty/serviceHistoryDetails?details=${details}`,
});
})
}
//
function fetchServiceHistoryList() {
uni.showLoading({
title: '加载中',
});
})
getServiceHistoryApi(page.value)
.then(res => {
if (res.code === 200) {
let { data } = res;
page.value.total = data.totalRows;
if (data.rows.length === 0) {
pageStatus.value = 'empty';
} else {
pageStatus.value = '';
serviceHistortList.value.push(...data.rows);
}
wx.hideLoading();
let data = res
page.value.total = data.totalRows
if (data.rows.length === 0) {
pageStatus.value = 'empty'
} else {
pageStatus.value = ''
serviceHistortList.value.push(...data.rows)
}
wx.hideLoading()
})
.catch(err => {
wx.hideLoading();
});
wx.hideLoading()
})
}
onLoad(() => {
serviceHistortList.value = [];
fetchServiceHistoryList();
});
serviceHistortList.value = []
fetchServiceHistoryList()
})
</script>
<style lang="scss" scoped>

View File

@ -123,7 +123,7 @@ const queryList = (pageNo: number, pageSize: number) => {
if (activeNav.value.type === 1) {
getParentBindChildApi({ parentId: userInfo.value.id, current: pageNo, size: pageSize })
.then(res => {
paging.value.complete(res.data.rows)
paging.value.complete(res.rows)
})
.catch(res => {
paging.value.complete(false)
@ -131,7 +131,7 @@ const queryList = (pageNo: number, pageSize: number) => {
} else {
getParentBindDeviceApi({ parentId: userInfo.value.id, current: pageNo, size: pageSize })
.then(res => {
paging.value.complete(res.data.rows)
paging.value.complete(res.rows)
})
.catch(res => {
paging.value.complete(false)
@ -145,13 +145,13 @@ function handleDetialPage(type: number, obj: any) {
case 1:
router.navigateTo({
path: `/pages/mine/details/childrenDetails`,
query: { details }
query: { details },
})
break
case 2:
router.navigateTo({
path: `/pages/mine/details/deviceDetails`,
query: { details }
query: { details },
})
break
}
@ -164,7 +164,7 @@ function handleBindDevice() {
const toMySupervisionService = child => {
router.navigateTo({
path: `/pages/parents/mySupervisionService/index`,
query: { id: child.childId }
query: { id: child.childId },
})
}

View File

@ -85,7 +85,7 @@ const queryList = (pageNo: number, pageSize: number) => {
if (props.type === 1) {
getParentBindChildApi({ childId: detailInfo.value.childId, current: pageNo, size: pageSize })
.then(res => {
paging.value.complete(res.data.rows)
paging.value.complete(res.rows)
})
.catch(res => {
paging.value.complete(false)
@ -97,7 +97,7 @@ const queryList = (pageNo: number, pageSize: number) => {
size: pageSize,
})
.then(res => {
paging.value.complete(res.data.rows)
paging.value.complete(res.rows)
})
.catch(res => {
paging.value.complete(false)

View File

@ -66,7 +66,7 @@ const OSS_URL = import.meta.env.VITE_OSS_HOST
const defaultAvatar = `${OSS_URL}/urm/default_avatar.png`
//
async function deviceCurrentLogin() {
const { data } = await parentDeviceCurrentLoginApi(detailInfo.value.id)
const data = await parentDeviceCurrentLoginApi(detailInfo.value.id)
currentLogin.value = data
}
async function share() {

View File

@ -1,96 +1,98 @@
<template>
<view class="course-table">
<wd-skeleton animation="gradient" theme="paragraph" v-if="isLoading" />
<wd-skeleton v-if="isLoading" animation="gradient" theme="paragraph" />
<template v-else>
<time-cycle :list="timeCycleList" @change="timeCycleChange" />
<supervisor-teacher :teacher="teacher"/>
<supervisor-teacher :teacher="teacher" />
<classmates :classmates="classmateList" v-if="classmateList.length"/>
<classmates v-if="classmateList.length" :classmates="classmateList" />
<custom-calender ref="customCalenderRef" @selected-day="selectedDay">
<template #header="{date}">
<template #header="{ date }">
<view class="header">
<wd-icon name="arrow-left" size="22px" @click="prevTime"></wd-icon>
<view>{{date.monthDate}}</view>
<wd-icon name="arrow-right" size="22px" v-if="show(date)" @click="nextTime"></wd-icon>
<view>{{ date.monthDate }}</view>
<wd-icon v-if="show(date)" name="arrow-right" size="22px" @click="nextTime"></wd-icon>
</view>
</template>
<template #cell="{date}">
<course-table-cell :list="list" :date="{value: date?.date, disable: date?.disable}"/>
<template #cell="{ date }">
<course-table-cell :list="list" :date="{ value: date?.date, disable: date?.disable }" />
</template>
</custom-calender>
</template>
</view>
</template>
<script setup lang=ts>
import TimeCycle from "./TimeCycle.vue";
import SupervisorTeacher from "@/components/SupervisorTeacher/SupervisorTeacher.vue";
import Classmates from "./Classmates.vue";
import CustomCalender from "@/components/customCalender/index.vue"
import {ref} from "vue";
import dayjs from "dayjs";
import {onLoad, onUnload} from "@dcloudio/uni-app";
import {getInspectorCourseList, getInspectorTeacherStudentInfo} from "@/api";
import CourseTableCell from "./CourseTableCell.vue";
<script setup lang="ts">
import TimeCycle from './TimeCycle.vue'
import SupervisorTeacher from '@/components/SupervisorTeacher/SupervisorTeacher.vue'
import Classmates from './Classmates.vue'
import CustomCalender from '@/components/customCalender/index.vue'
import { ref } from 'vue'
import dayjs from 'dayjs'
import { onLoad, onUnload } from '@dcloudio/uni-app'
import { getInspectorCourseList, getInspectorTeacherStudentInfo } from '@/api'
import CourseTableCell from './CourseTableCell.vue'
const OSS_URL = import.meta.env.VITE_OSS_HOST;
const currentTime = ref(null);
const OSS_URL = import.meta.env.VITE_OSS_HOST
const currentTime = ref(null)
const customCalenderRef = ref(null)
const teacher = ref<{
name: string;
school: string;
edu: string;
avatar: string;
name: string
school: string
edu: string
avatar: string
labelList: {
name: string;
color: string;
bgColor: string;
}[];
titleLabel: string[];
desc: string;
}|null>(null)
name: string
color: string
bgColor: string
}[]
titleLabel: string[]
desc: string
} | null>(null)
const classmateList = ref([])
const colorList = [
{color: '#FF8624', bgColor: "#fff7f0"},
{color: '#0CC25C', bgColor: "#F1FFF7"},
{color: '#FF3C58', bgColor: "#FFF3F5"}
{ color: '#FF8624', bgColor: '#fff7f0' },
{ color: '#0CC25C', bgColor: '#F1FFF7' },
{ color: '#FF3C58', bgColor: '#FFF3F5' },
]
const loadTeacherAndClassmate = (id: string) => {
getInspectorTeacherStudentInfo({orderId: id}).then(({data}) => {
getInspectorTeacherStudentInfo({ orderId: id }).then(data => {
const teacherData = data.inspectorTeacher
teacher.value = teacherData ? {
name: teacherData.nickName,
school: teacherData.gradSchool,
edu: teacherData.degree,
avatar: teacherData.personalPhoto,
labelList: teacherData.label.split(",").map((item, index) => {
let color = colorList[index % 3]
return {
name: item,
color: color.color,
bgColor: color.bgColor
teacher.value = teacherData
? {
name: teacherData.nickName,
school: teacherData.gradSchool,
edu: teacherData.degree,
avatar: teacherData.personalPhoto,
labelList: teacherData.label.split(',').map((item, index) => {
let color = colorList[index % 3]
return {
name: item,
color: color.color,
bgColor: color.bgColor,
}
}),
titleLabel: teacherData.propagandaSlogan?.split(','),
desc: teacherData.personalInformation,
}
}),
titleLabel: teacherData.propagandaSlogan?.split(","),
desc: teacherData.personalInformation
} : null
: null
classmateList.value = (data.studentList || []).map(item => {
return {
name: item.name,
avatar: item.avatarUrl
avatar: item.avatarUrl,
}
})
})
}
const timeCycleChange = (time: {start: string, end: string}) => {
currentTime.value = time;
const timeCycleChange = (time: { start: string; end: string }) => {
currentTime.value = time
if (time && timeCycleMap.value[`${time.start}-${time.end}`]) {
loadTeacherAndClassmate(timeCycleMap.value[`${time.start}-${time.end}`].orderId)
}
@ -98,10 +100,7 @@ const timeCycleChange = (time: {start: string, end: string}) => {
const list = ref([])
const show = (date: {
date: string,
monthDate: string
}) => {
const show = (date: { date: string; monthDate: string }) => {
return true
// return dayjs(date.date).month() < dayjs().month()
}
@ -114,7 +113,7 @@ const nextTime = () => {
}
const planMap = ref([])
const selectedDay = (date: {date: string}) => {
const selectedDay = (date: { date: string }) => {
let dayData = planMap.value.find(item => item.date === date.date)
if (dayData && dayData.id) {
uni.navigateTo({
@ -129,41 +128,45 @@ const timeCycleMap = ref({})
const isLoading = ref(true)
onLoad((options) => {
getInspectorCourseList({userId: options.id}).then(({data}) => {
let planList = []
data.forEach(item => {
timeCycleList.value.push({
start: item.inspectorTimeStart,
end: item.inspectorTimeEnd,
onLoad(options => {
getInspectorCourseList({ userId: options.id })
.then(data => {
let planList = []
data.forEach(item => {
timeCycleList.value.push({
start: item.inspectorTimeStart,
end: item.inspectorTimeEnd,
})
timeCycleMap.value[`${item.inspectorTimeStart}-${item.inspectorTimeEnd}`] = item
planList.push(
item.inspectorCourseList.map(i => {
let date = dayjs(i.courseDate).format('YYYY-MM-DD')
if (i.inspectorPlanId) {
planMap.value.push({
date: date,
id: i.inspectorPlanId,
})
}
return {
date: date,
info: {
taskCount: i.taskCount,
state: i.planStatus,
mode: i.mode,
},
}
}),
)
})
timeCycleMap.value[`${item.inspectorTimeStart}-${item.inspectorTimeEnd}`] = item
planList.push(item.inspectorCourseList.map(i => {
let date = dayjs(i.courseDate).format("YYYY-MM-DD")
if (i.inspectorPlanId) {
planMap.value.push({
date: date,
id: i.inspectorPlanId
})
}
return {
date: date,
info: {
taskCount: i.taskCount,
state: i.planStatus,
mode: i.mode,
}
}
}))
list.value = planList.flat(1)
uni.setStorageSync('plan', planMap.value)
})
.catch(() => {
uni.removeStorageSync('plan')
})
.finally(() => {
isLoading.value = false
})
list.value = planList.flat(1)
uni.setStorageSync('plan', planMap.value)
}).catch(() => {
uni.removeStorageSync('plan')
}).finally(() => {
isLoading.value = false
})
})
onUnload(() => {
@ -181,7 +184,6 @@ onUnload(() => {
padding: 10rpx 0 30rpx 0;
}
.cell-date {
}
}
</style>

View File

@ -1,75 +1,83 @@
<template>
<view class="order">
<wd-skeleton animation="gradient" theme="paragraph" v-if="isLoading" />
<view class="order-list" v-else-if="orderList.length">
<view class="order-item" v-for="(item, index) in orderList" :key="index">
<wd-skeleton v-if="isLoading" animation="gradient" theme="paragraph" />
<view v-else-if="orderList.length" class="order-list">
<view v-for="(item, index) in orderList" :key="index" class="order-item">
<view class="title-state">
<view class="title">{{item.title}}</view>
<view class="state" :style="{color: item.status === 1 ? '#615DFF' : '#A9AAB5'}">{{item.status === 1 ? '服务中' : '已过期'}}</view>
<view class="title">{{ item.title }}</view>
<view class="state" :style="{ color: item.status === 1 ? '#615DFF' : '#A9AAB5' }">{{
item.status === 1 ? '服务中' : '已过期'
}}</view>
</view>
<view class="order-info">
<view class="info-item">
<view class="label"><text></text></view>
<view class="value">{{item.money}}</view>
<view class="value">{{ item.money }}</view>
</view>
<view class="info-item">
<view class="label">实际支付</view>
<view class="value">{{item.payAmount}}</view>
<view class="value">{{ item.payAmount }}</view>
</view>
<view class="info-item">
<view class="label">开通时间</view>
<view class="value">{{dayjs(item.paymentTime).format("YYYY.MM.DD HH:mm:ss")}}</view>
<view class="value">{{ dayjs(item.paymentTime).format('YYYY.MM.DD HH:mm:ss') }}</view>
</view>
<view class="info-item">
<view class="label">服务周期</view>
<view class="value">{{dayjs(item.startTime).format("YYYY.MM.DD")}} ~ {{dayjs(item.endTime).format("YYYY.MM.DD")}}</view>
<view class="value"
>{{ dayjs(item.startTime).format('YYYY.MM.DD') }} ~
{{ dayjs(item.endTime).format('YYYY.MM.DD') }}</view
>
</view>
</view>
</view>
</view>
<empty content="还没有订单"/>
<empty content="还没有订单" />
</view>
</template>
<script setup lang=ts>
import {ref} from "vue";
import dayjs from "dayjs";
import {onLoad} from "@dcloudio/uni-app";
import {getInspectorOrderList} from "@/api";
import Empty from "@/components/Empty";
<script setup lang="ts">
import { ref } from 'vue'
import dayjs from 'dayjs'
import { onLoad } from '@dcloudio/uni-app'
import { getInspectorOrderList } from '@/api'
import Empty from '@/components/Empty'
const orderList = ref<{
title: string,
paymentTime: string,
startTime: string,
endTime: string,
payAmount: string,
money: string,
status: number
}[]>([])
const orderList = ref<
{
title: string
paymentTime: string
startTime: string
endTime: string
payAmount: string
money: string
status: number
}[]
>([])
const modeType = {1: '1v1', 2: '1vN'}
const modeType = { 1: '1v1', 2: '1vN' }
const isLoading = ref(true)
onLoad((options) => {
getInspectorOrderList({userId: options.id}).then(({data}) => {
orderList.value = data.map(item => {
return {
title: modeType[item.mode] + '督学模式',
paymentTime: item.paymentTime,
startTime: item.inspectorTimeStart,
endTime: item.inspectorTimeEnd,
payAmount: item.payAmount,
money: item.money,
status: item.inspectorServiceStatus
}
onLoad(options => {
getInspectorOrderList({ userId: options.id })
.then(data => {
orderList.value = data.map(item => {
return {
title: modeType[item.mode] + '督学模式',
paymentTime: item.paymentTime,
startTime: item.inspectorTimeStart,
endTime: item.inspectorTimeEnd,
payAmount: item.payAmount,
money: item.money,
status: item.inspectorServiceStatus,
}
})
})
.finally(() => {
isLoading.value = false
})
}).finally(() => {
isLoading.value = false
})
})
</script>
<style scoped lang="scss">
@ -89,7 +97,7 @@ onLoad((options) => {
.title {
font-size: 30rpx;
font-weight: 500;
color: #0A1F13;
color: #0a1f13;
}
.state {
font-size: 26rpx;
@ -105,7 +113,7 @@ onLoad((options) => {
width: 140rpx;
font-size: 28rpx;
flex-shrink: 0;
color: #A9AAB5;
color: #a9aab5;
}
.value {
font-size: 28rpx;
@ -116,7 +124,7 @@ onLoad((options) => {
&:not(:first-child) {
.label {
&::after {
content: "";
content: '';
}
}
}
@ -126,7 +134,7 @@ onLoad((options) => {
justify-content: space-between;
> text {
&::after {
content: "";
content: '';
}
}
}

View File

@ -12,23 +12,23 @@
</template>
<script setup lang="ts">
import ReportTimeChange from './ReportTimeChange.vue';
import { computed, ref } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { getInspectorPlanReport } from '@/api';
import StudentReport from '@/components/student-report';
import dayjs from 'dayjs';
import Empty from '@/components/Empty';
import ReportTimeChange from './ReportTimeChange.vue'
import { computed, ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { getInspectorPlanReport } from '@/api'
import StudentReport from '@/components/student-report'
import dayjs from 'dayjs'
import Empty from '@/components/Empty'
const currentDate = ref(dayjs());
const currentDate = ref(dayjs())
const result = ref([]);
const result = ref([])
const isLoading = ref(true);
const isLoading = ref(true)
onLoad(options => {
getInspectorPlanReport({ userId: options.id })
.then(({ data }) => {
.then(data => {
result.value = data.map(item => {
return {
...item,
@ -37,20 +37,20 @@ onLoad(options => {
practiceQuestionStatistics: JSON.parse(item.practiceQuestionStatistics),
watchVideoStatistics: JSON.parse(item.watchVideoStatistics),
tasks: (item.tasks || []).map(task => JSON.parse(task.taskInfoJson)),
};
});
currentDate.value = dayjs(data[0].courseDate);
}
})
currentDate.value = dayjs(data[0].courseDate)
})
.finally(() => {
isLoading.value = false;
});
});
isLoading.value = false
})
})
const reportData = computed(() => {
return result.value.find(
item => dayjs(item.courseDate).format('YYYY-MM-DD') === currentDate.value.format('YYYY-MM-DD'),
);
});
)
})
</script>
<style scoped lang="scss">

View File

@ -2,32 +2,53 @@
<view class="study-plan">
<view class="study-plan-content">
<view class="change-time">
<wd-icon name="arrow-left" size="30rpx" :color="isCanPrev ? '#666' : '#ddd'" @click="prevTime"></wd-icon>
<wd-icon
name="arrow-left"
size="30rpx"
:color="isCanPrev ? '#666' : '#ddd'"
@click="prevTime"
></wd-icon>
<view class="time-text">{{ currentDate.format('MM月DD日') }}</view>
<wd-icon name="arrow-right" size="30rpx" :color="isCanNext ? '#666' : '#ddd'" @click="nextTime"></wd-icon>
<wd-icon
name="arrow-right"
size="30rpx"
:color="isCanNext ? '#666' : '#ddd'"
@click="nextTime"
></wd-icon>
</view>
<wd-skeleton v-if="isLoading" animation="gradient" theme="paragraph" style="padding-bottom: 30rpx"></wd-skeleton>
<wd-skeleton
v-if="isLoading"
animation="gradient"
theme="paragraph"
style="padding-bottom: 30rpx"
></wd-skeleton>
<view class="plan-list" v-else>
<view v-else class="plan-list">
<view v-for="(item, index) in planList" :key="index" class="plan-item">
<view class="serial-number">
<view v-if="item.progress === 100" class="finished-icon">
<wd-icon name="check-bold" size="30rpx"></wd-icon>
</view>
<template v-else>{{ (++index).toString().padStart(2, '0') }}</template></view>
<template v-else>{{ (++index).toString().padStart(2, '0') }}</template></view
>
<view class="plan-item-info">
<view class="plan-item-title">
<view class="title-type">
<view class="title">{{ item.subjectName }}</view>
<view class="type" :style="{backgroundColor: type[item.taskType].color}">{{ type[item.taskType].text }}</view>
<view class="type" :style="{ backgroundColor: type[item.taskType].color }">{{
type[item.taskType].text
}}</view>
</view>
<view class="plan-item-time">
<view class="total-progress">
<text class="success" v-if="item.progress > 0">{{item.progress}}%</text>
<text class="progress" v-else>{{item.finishedNum}}/{{item.num}}</text>
<text v-if="item.progress > 0" class="success">{{ item.progress }}%</text>
<text v-else class="progress">{{ item.finishedNum }}/{{ item.num }}</text>
</view>
<view class="time">{{ dayjs(item.startTime).format("HH:mm") }} - {{ dayjs(item.endTime).format("HH:mm") }}</view>
<view class="time"
>{{ dayjs(item.startTime).format('HH:mm') }} -
{{ dayjs(item.endTime).format('HH:mm') }}</view
>
</view>
</view>
<view class="plan-desc">{{ item.plan }}</view>
@ -39,30 +60,32 @@
</template>
<script setup lang="ts">
import {computed, ref} from 'vue';
import dayjs from 'dayjs';
import {onLoad} from "@dcloudio/uni-app";
import {getInspectorPlan} from "@/api";
import { computed, ref } from 'vue'
import dayjs from 'dayjs'
import { onLoad } from '@dcloudio/uni-app'
import { getInspectorPlan } from '@/api'
const type = {
0: {text: "自由学", color: '#FFA65D',},
1: {text: "自由学", color: '#FFA65D',},
2: {text: "精准学", color: '#4fd6ee',},
3: {text: "语感训练", color: '#ff91a1',},
4: {text: "错题本", color: '#ff91a1',}
0: { text: '自由学', color: '#FFA65D' },
1: { text: '自由学', color: '#FFA65D' },
2: { text: '精准学', color: '#4fd6ee' },
3: { text: '语感训练', color: '#ff91a1' },
4: { text: '错题本', color: '#ff91a1' },
}
const currentDate = ref(dayjs());
const planList = ref<{
subjectName: string,
taskType: number | string,
startTime: string,
endTime: string,
num: number,
finishedNum: number,
plan: string,
progress: number,
}[]>([]);
const currentDate = ref(dayjs())
const planList = ref<
{
subjectName: string
taskType: number | string
startTime: string
endTime: string
num: number
finishedNum: number
plan: string
progress: number
}[]
>([])
const allPlan = ref([])
@ -70,48 +93,53 @@ const isLoading = ref(true)
const loadData = async () => {
let plan = allPlan.value.find(item => item.date === currentDate.value.format('YYYY-MM-DD'))
isLoading.value = true
getInspectorPlan({inspectorPlanId: plan.id}).then(({data}) => {
planList.value = data.taskList.map(item => {
let data = JSON.parse(item.taskInfoJson)
let plan = {
startTime: data.inspectorTimeStart,
endTime: data.inspectorTimeEnd,
subjectName: data.subjectName,
taskType: data.taskType,
num: data.num,
finishedNum: data.finishedNum,
progress: data.progress,
plan: ""
}
switch (plan.taskType) {
case "0":
plan.plan = `观看学习视频:《${data.chapterName}》章节《${data.courseTimeName}》视频`
break
case "1":
plan.plan = `完成章节练习:《${data.chapterName}`
break
case "2":
plan.plan = `AI精准学习${plan.num}`
break
case "3":
plan.plan = `语感训练${plan.num}`
break
case "4":
plan.plan = ` 订正错题本${plan.num}`
break
}
return plan
getInspectorPlan({ inspectorPlanId: plan.id })
.then(data => {
planList.value = data.taskList.map(item => {
let data = JSON.parse(item.taskInfoJson)
let plan = {
startTime: data.inspectorTimeStart,
endTime: data.inspectorTimeEnd,
subjectName: data.subjectName,
taskType: data.taskType,
num: data.num,
finishedNum: data.finishedNum,
progress: data.progress,
plan: '',
}
switch (plan.taskType) {
case '0':
plan.plan = `观看学习视频:《${data.chapterName}》章节《${data.courseTimeName}》视频`
break
case '1':
plan.plan = `完成章节练习:《${data.chapterName}`
break
case '2':
plan.plan = `AI精准学习${plan.num}`
break
case '3':
plan.plan = `语感训练${plan.num}`
break
case '4':
plan.plan = ` 订正错题本${plan.num}`
break
}
return plan
})
})
.finally(() => {
isLoading.value = false
})
}).finally(() => {
isLoading.value = false
})
}
const isCanPrev = computed(() => {
return allPlan.value.findIndex(item => item.date === currentDate.value.format('YYYY-MM-DD')) > 0
})
const isCanNext = computed(() => {
return allPlan.value.findIndex(item => item.date === currentDate.value.format('YYYY-MM-DD')) < allPlan.value.length - 1
return (
allPlan.value.findIndex(item => item.date === currentDate.value.format('YYYY-MM-DD')) <
allPlan.value.length - 1
)
})
const prevTime = () => {
let index = allPlan.value.findIndex(item => item.date === currentDate.value.format('YYYY-MM-DD'))
@ -119,19 +147,18 @@ const prevTime = () => {
currentDate.value = dayjs(allPlan.value[index - 1].date)
loadData()
}
};
}
const nextTime = () => {
let index = allPlan.value.findIndex(item => item.date === currentDate.value.format('YYYY-MM-DD'))
if (isCanNext.value) {
currentDate.value = dayjs(allPlan.value[index + 1].date)
loadData()
}
};
}
onLoad((option) => {
allPlan.value = uni.getStorageSync("plan")
currentDate.value = dayjs(option.d);
onLoad(option => {
allPlan.value = uni.getStorageSync('plan')
currentDate.value = dayjs(option.d)
loadData()
})
</script>
@ -217,14 +244,14 @@ onLoad((option) => {
border-right: 1px solid #f2f2f2;
margin-right: 10rpx;
.success {
color: #21D17A;
color: #21d17a;
}
.progress {
color: #FF2828;
color: #ff2828;
}
}
.time {
color: #A9AAB5;
color: #a9aab5;
}
}
}

View File

@ -299,7 +299,7 @@ const onCloseSelectOrder = () => {
};
const getBaseInfo = async () => {
const { data } = await getChildList();
const data = await getChildList();
// console.log('data', data);
childrenList.value = data.map(child => {
return {
@ -368,7 +368,7 @@ const onConfirmSelectOrder = async () => {
userId: curSelectChildren[0].id,
};
const { data } = await createInspectorPrepayOrder(params);
const data = await createInspectorPrepayOrder(params);
const order = {
appId: data.prepayResponse.appId,

View File

@ -9,7 +9,7 @@ export const bindApplyStore = defineStore('bindApplyStore', () => {
// 未处理的绑定申请列表
const getApplyBindInfoList = async () => {
try {
const { data } = await applyBindInfoListApi()
const data = await applyBindInfoListApi()
bindApplyList.value = data
if (bindApplyList.value.length === 0) {
db.set('applyBindMsg', false)

View File

@ -10,8 +10,8 @@ export const global = defineStore('global', () => {
// 获取字典列表
const getDicts = async () => {
const res = await getDictApi()
dictData.value = res.data
db.set('dict', res.data)
dictData.value = res
db.set('dict', res)
}
// 获取字典

View File

@ -44,21 +44,21 @@ export const user = defineStore('user', () => {
const getUserInfo = async () => {
const res = await getUserInfoApi()
userInfo.value = res.data
db.set('userInfo', res.data)
userInfo.value = res
db.set('userInfo', res)
getUserInfoPermit()
return res.data
return res
}
// 当前登录用户是否管理员身份
async function getUserInfoPermit() {
const { data } = await userInfoPermitApi()
const data = await userInfoPermitApi()
db.set('userAdmin', data)
}
const getCsInfo = async () => {
const res = await getCsInfoApi(userInfo.value.id)
csInfo.value = res.data
db.set('csInfo', res.data)
return res.data
csInfo.value = res
db.set('csInfo', res)
return res
}
const clear = async () => {