diff --git a/src/api/index.ts b/src/api/index.ts index 98a85db..71d1e53 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,15 +1,15 @@ -export * from './global'; -export * from './login'; -export * from './modules/warranty'; -export * from './modules/awardManage'; -export * from './modules/taskManage'; -export * from './modules/bindDevice'; -export * from './modules/parent'; -export * from './modules/mySupervisionService'; -export * from './modules/bindDevice'; -export * from './modules/mine'; -export * from './modules/academicReport'; -export * from './modules/deviceScreenshotRecord'; -export * from './modules/inviteBind'; -export * from './modules/home'; -export * from './modules/applicationManagement'; +export * from './global' +export * from './login' +export * from './modules/warranty' +export * from './modules/awardManage' +export * from './modules/taskManage' +export * from './modules/bindDevice' +export * from './modules/parent' +export * from './modules/mySupervisionService' +export * from './modules/bindDevice' +export * from './modules/mine' +export * from './modules/academic-report' +export * from './modules/deviceScreenshotRecord' +export * from './modules/inviteBind' +export * from './modules/home' +export * from './modules/app-mgr' diff --git a/src/api/login.ts b/src/api/login.ts index 6153819..a59c675 100644 --- a/src/api/login.ts +++ b/src/api/login.ts @@ -1,3 +1,4 @@ +import router from '@/router/router' import { http } from './request/request' /** * 手机号授权 @@ -50,7 +51,14 @@ export const wxLoginApi = async data => * 获取用户信息 * @param data 请求参数 */ -export const getUserInfoApi = async () => await http.get('/sysUser/selectUser') +export const getUserInfoApi = async () => { + const data = await http.get('/sysUser/selectUser') + if (!data?.id) { + router.toLogin() + return undefined + } + return data +} /** * 更新用户信息 diff --git a/src/api/modules/academicReport.ts b/src/api/modules/academic-report.ts similarity index 80% rename from src/api/modules/academicReport.ts rename to src/api/modules/academic-report.ts index bafec2f..a0296bb 100644 --- a/src/api/modules/academicReport.ts +++ b/src/api/modules/academic-report.ts @@ -1,11 +1,17 @@ import { http } from '../request/request' +/** + * 查询学员学习数据 + */ +export async function getStudentStudyDataApi(data: any) { + return await http.get('/sysUser/queryParentBindChildInfo', data) +} + /** * 学情报告-学科目录 * @param data 请求参数 */ -export const subjectApi = async (gradeId: string) => - await http.get(`/subject/list/${gradeId}`) +export const subjectApi = async (gradeId: string) => await http.get(`/subject/list/${gradeId}`) /** * 学情报告-学习时长统计 diff --git a/src/api/modules/applicationManagement.ts b/src/api/modules/app-mgr.ts similarity index 100% rename from src/api/modules/applicationManagement.ts rename to src/api/modules/app-mgr.ts diff --git a/src/api/modules/inspector.ts b/src/api/modules/inspector.ts index eef6923..f415282 100644 --- a/src/api/modules/inspector.ts +++ b/src/api/modules/inspector.ts @@ -2,7 +2,7 @@ import { http } from '../request/request' import { storeToRefs } from 'pinia' import { getCache } from '@/utils' import db from '@/utils/db' -import { userStore } from '@/store' +import { useUserStore } from '@/store' // 课表日历 export const getScheduleList = async (data?: Record): Promise => @@ -64,7 +64,7 @@ export const getUserInfo = async (data?: Record): Promise => await http.get('/phone/inspectorTeacher/getCurrentTeacher') // 文件上传 export const uploadFile = async (file): Promise => { - const { token } = storeToRefs(userStore()) + const { token } = storeToRefs(useUserStore()) const mergerToken = token.value diff --git a/src/api/modules/mine.ts b/src/api/modules/mine.ts index 8c99e7a..ff24c36 100644 --- a/src/api/modules/mine.ts +++ b/src/api/modules/mine.ts @@ -4,15 +4,23 @@ import { http } from '../request/request' * 家长绑定的孩子 * @param params 请求参数 */ -export const getParentBindChildApi = async (params: any) => - await http.get('/parentBindChild/list', params) +export const getParentBindChildApi = async (params: any) => { + if (!params.size) { + params.size = -1 + } + return await http.get('/parentBindChild/list', params) +} /** * 家长绑定的设备 * @param params 请求参数 */ -export const getParentBindDeviceApi = async (params: any) => - await http.get('/parentBindDevice/list', params) +export const getParentBindDeviceApi = async (params: any) => { + if (!params.size) { + params.size = -1 + } + return await http.get('/parentBindDevice/list', params) +} /** * 我的孩子-绑定的家长 @@ -46,12 +54,10 @@ export const parentDeviceCurrentLoginApi = async (id: string) => * 设备管理-绑定申请列表 * @param params 请求参数 */ -export const applyBindInfoListApi = async () => - await http.get('/parentBind/applyInfoList') +export const applyBindInfoListApi = async () => await http.get('/parentBind/applyInfoList') /** * 设备管理-当前登录用户是否管理员 * @param params 请求参数 */ -export const userInfoPermitApi = async () => - await http.get('/parentBind/applyInfoPermit') +export const userInfoPermitApi = async () => await http.get('/parentBind/applyInfoPermit') diff --git a/src/api/modules/parent.ts b/src/api/modules/parent.ts index 22efd5c..66ccaed 100644 --- a/src/api/modules/parent.ts +++ b/src/api/modules/parent.ts @@ -1,9 +1,18 @@ -import { http } from '../request/request'; +import { http } from '../request/request' export const getChildList = async () => { - return await http.get('/inspectorParent/childList'); -}; + return await http.get('/inspectorParent/childList') +} export const getModelList = async () => { - return await http.get('/inspectorParent/inspectorModeList'); -}; + return await http.get('/inspectorParent/inspectorModeList') +} + +// 生成订单 +export async function createRechargeOrderApi(money: any) { + return await http.post('/orderManagement/createParentCoinOrder', { + money, + orderType: 4, + paySubType: 'JSAPI', + }) +} diff --git a/src/api/request/interceptor.ts b/src/api/request/interceptor.ts index 5a75f73..e2b15d4 100644 --- a/src/api/request/interceptor.ts +++ b/src/api/request/interceptor.ts @@ -6,7 +6,7 @@ import router from '@/router/router' import db from '@/utils/db' import toast from '@/utils/hud' import { storeToRefs } from 'pinia' -import { userStore } from '@/store' +import { useUserStore } from '@/store' // 请求拦截器 export const requestInterceptor = async (options: RequestOptions): Promise => { @@ -14,7 +14,7 @@ export const requestInterceptor = async (options: RequestOptions): Promise { text: '首页', }, { - pagePath: '/pages/academicReport/index', + pagePath: '/pages/academic-report/index', iconPath: '/static/tabBar/studyReportNo.png', selectedIconPath: '/static/tabBar/studyReport.png', text: '学情报告', }, { - pagePath: '/pages/applicationManagement/index', + pagePath: '/pages/app-mgr/index', iconPath: '/static/tabBar/applicationNo.png', selectedIconPath: '/static/tabBar/application.png', text: '应用管控', @@ -92,13 +92,13 @@ onMounted(async () => { // text: '首页', // }, // { - // pagePath: '/pages/academicReport/index', + // pagePath: '/pages/academic-report/index', // iconPath: '/static/tabBar/studyReportNo.png', // selectedIconPath: '/static/tabBar/studyReport.png', // text: '学情报告', // }, // { - // pagePath: '/pages/applicationManagement/index', + // pagePath: '/pages/app-mgr/index', // iconPath: '/static/tabBar/applicationNo.png', // selectedIconPath: '/static/tabBar/application.png', // text: '应用管控', diff --git a/src/components/mjui/mj-segment/mj-segment.vue b/src/components/mjui/mj-segment/mj-segment.vue new file mode 100644 index 0000000..5c827a2 --- /dev/null +++ b/src/components/mjui/mj-segment/mj-segment.vue @@ -0,0 +1,44 @@ + + + diff --git a/src/components/student-report/knowledge-graph-statistics.vue b/src/components/student-report/knowledge-graph-statistics.vue index 5711183..15c1ebb 100644 --- a/src/components/student-report/knowledge-graph-statistics.vue +++ b/src/components/student-report/knowledge-graph-statistics.vue @@ -18,17 +18,17 @@ diff --git a/src/pages/inspector/mine/min-base-info.vue b/src/pages/inspector/mine/min-base-info.vue index 5c6f019..deb4e1c 100644 --- a/src/pages/inspector/mine/min-base-info.vue +++ b/src/pages/inspector/mine/min-base-info.vue @@ -58,7 +58,7 @@ import type { UserInfo } from '@/types/inspector/mine' import { queryUserRoles, switchRole } from '@/api/inspector/mine' import { getAvatarUrl } from '@/utils' import { getAuthUrlApi } from '@/api/login' -import { userStore } from '@/store' +import { useUserStore } from '@/store' import db from '@/utils/db' const roleRef = ref(null) @@ -67,7 +67,7 @@ const userInfo = inject>('userInfo') const roleList = ref([]) -const { getUserInfo: getLoginUserInfo } = userStore() +const { getUserInfo: getLoginUserInfo } = useUserStore() const queryRole = async () => { const data = await queryUserRoles({ phone: userInfo.value.phone }) diff --git a/src/pages/inspector/personalData/index.vue b/src/pages/inspector/personalData/index.vue index 0685e92..aaa0154 100644 --- a/src/pages/inspector/personalData/index.vue +++ b/src/pages/inspector/personalData/index.vue @@ -181,8 +181,8 @@ diff --git a/src/pages/mine/TaskManage/patriarchSendObject.vue b/src/pages/mine/TaskManage/patriarchSendObject.vue index 66782da..fae8dda 100644 --- a/src/pages/mine/TaskManage/patriarchSendObject.vue +++ b/src/pages/mine/TaskManage/patriarchSendObject.vue @@ -73,8 +73,8 @@ import { storeToRefs } from 'pinia' import Empty from '@/components/Empty/index.vue' import CustomPopup from '@/components/CustomPopup/index.vue' import { updateTaskStatusApi, getParentBindChildApi, getFamilyTaskStuApi } from '@/api' -import { userStore } from '@/store' -const { userInfo } = storeToRefs(userStore()) +import { useUserStore } from '@/store' +const { userInfo } = storeToRefs(useUserStore()) const OSS_URL = import.meta.env.VITE_OSS_HOST const pageStatus = ref('') const taskType = ref() // 任务类型 0-系统任务 1-自定义任务 diff --git a/src/pages/mine/aboutMine.vue b/src/pages/mine/about-mine.vue similarity index 77% rename from src/pages/mine/aboutMine.vue rename to src/pages/mine/about-mine.vue index aa1e5bd..143ca39 100644 --- a/src/pages/mine/aboutMine.vue +++ b/src/pages/mine/about-mine.vue @@ -1,82 +1,11 @@ - - + + + + diff --git a/src/pages/mine/interface/mineDetail.ts b/src/pages/mine/interface/mineDetail.ts index d313754..72bcd83 100644 --- a/src/pages/mine/interface/mineDetail.ts +++ b/src/pages/mine/interface/mineDetail.ts @@ -1,27 +1,35 @@ // 我的孩子 -export interface ChildrenType { - createTime?: string - createUser?: string - updateTime?: string - updateUser?: string - id?: string - parentId?: string - childId?: string - adminFlag?: number - identityType?: null - bindFlag?: number - bindTime?: string - unBindTime?: string - childName?: string - childAvatar?: string - parentName?: string - parentAvatar?: string - parentPhone?: string - vipEndTime?: string +type ParentInfo = { + id?: any + name?: string + account?: string + avatar?: string + phone?: string +} + +type ChildInfo = { + id?: any + name?: string + diamond?: number + currency?: number + account?: string + avatar?: string + vipEndTime?: string // yyyy-MM-dd HH:mm:ss currentLevel?: number - gradeId?: string - gradeName?: string expLevel?: number + gradeId?: number + gradeName?: string +} + +export interface ChildrenType { + id?: number + bindFlag?: 0 | 1 // 0-未绑定 1-已绑定 + bindTime?: string // yyyy-MM-dd HH:mm:ss + unBindTime?: string // yyyy-MM-dd HH:mm:ss + adminFlag?: 0 | 1 // 0-否 1-是 + identityType?: 1 | 2 | 3 | 4 | 5 | 6 | 7 // 1:父亲,2:母亲,3:爷爷,4:奶奶,5:外公,6:外婆,7:其他 + child?: ChildInfo + parent?: ParentInfo } // 我的设备 export interface DeviceType { diff --git a/src/pages/mine/patriarchCard.vue b/src/pages/mine/patriarch-card.vue similarity index 67% rename from src/pages/mine/patriarchCard.vue rename to src/pages/mine/patriarch-card.vue index 700faae..ee7caa3 100644 --- a/src/pages/mine/patriarchCard.vue +++ b/src/pages/mine/patriarch-card.vue @@ -1,49 +1,18 @@ - - + +