diff --git a/src/api/CONST.js b/src/api/CONST.js new file mode 100644 index 0000000..5f4c2a7 --- /dev/null +++ b/src/api/CONST.js @@ -0,0 +1,11 @@ +/* + * @Author: lixg lixg@dongwu-inc.com + * @Date: 2023-01-16 13:59:11 + * @LastEditors: lixg lixg@dongwu-inc.com + * @LastEditTime: 2023-01-16 13:59:17 + * @FilePath: /stu_h5/src/api/CONST.js + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ +export const PROJECT = 1; +export const ROUTER = 2; +export const COURSE = 3; \ No newline at end of file diff --git a/src/api/api.js b/src/api/api.js index eba606e..0773371 100644 --- a/src/api/api.js +++ b/src/api/api.js @@ -2,7 +2,7 @@ * @Author: lixg lixg@dongwu-inc.com * @Date: 2023-01-13 11:42:48 * @LastEditors: lixg lixg@dongwu-inc.com - * @LastEditTime: 2023-01-13 18:09:17 + * @LastEditTime: 2023-01-17 17:06:24 * @FilePath: /stu_h5/src/api/api.js * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ @@ -16,15 +16,25 @@ export const ROUTER_UNCOMPLETE_LIST = '/stu/router/unCompleteTaskList' export const TAS_ACTIVITY_DETAIL = '/stu/task/activity/detail' export const TASK_ACTIVITY_SIGN = '/stu/task/activity/sign post' export const TASK_BROADCAST_COMMIT = '/stu/task/broadcast/commit' -export const TASK_BROADCAST_DETAIL = '/stu/task/broadcast/detail' -export const TASK_BROADCAST_SIGN = '/stu/task/broadcast/sign' +export const TASK_BROADCAST_DETAIL = '/liveBroadcast' +export const TASK_BROADCAST_SIGN = '/stu/task/broadcast/sign post' export const TASK_VOTE_COMMIT = '/stu/task/vote/commit' export const TASK_VOTE_DETAIL = '/stu/task/vote/detail' -export const TASK_WORK_COMMIT = '/stu/task/work/commit' -export const TASK_WORK_DETAIL = '/stu/task/work/detail' -export const STU_OFFCOURSE_DETAIL = '/stu/offcourse/detail' +export const TASK_WORK_COMMIT = '/workSubmit/submitStudentWorkDetail post' +export const TASK_WORK_DETAIL = '/workSubmit/getWorkDetailByTaskId' +export const STU_OFFCOURSE_DETAIL = '/stu/offcourse/detail post' export const WORK_QUERYWORKDETAILBYID = '/work/queryWorkDetailById' export const EXAMINATION_QUERYEXAMINATIONDETAILBYID = '/examination/queryExaminationDetailById' export const DISCUSS_COLLECTION = '/discussSubmit/clickDiscussCollectionCountOr POST' export const DISCUSS_LIKE = '/discussSubmit/clickDiscussLikeCountOr POST' -export const ACTIVITY = '/activity' \ No newline at end of file +export const ACTIVITY = '/activity' +export const EXAMINATION_QUERY = examinationId => `/examination/queryExaminationDetailById?examinationId=${examinationId} post` +export const TASK_OFFCOURSE_NOTASK_SIGN = '/stu/task/offcourse/notask/sign post' +export const TASK_OFFCOURSE_SIGN = '/stu/task/offcourse/sign post' +export const LINK_DETAILS = linkId => `/link/getOne?linkId=${linkId} post` +export const STUDY_RECORD = '/stu/task/thirdTask/submit post' +export const TASK_WORK_SUBMIT_LIST = '/workSubmit/queryWorkSubmitDetailById' +export const WORK_HISTROY = '/workSubmit/queryWorkDetailListByStuId' +export const ASSESSMENT_QUERY = assessmentId => `/stu/task/queryAssessmentDetailById` +export const ASSESSMENT_SUBMIT = '/stu/task/evaluate/commit post' + diff --git a/src/api/request.js b/src/api/request.js index 22b984e..5ff003c 100644 --- a/src/api/request.js +++ b/src/api/request.js @@ -1,11 +1,42 @@ import router from "@/router"; -import {ref, watch} from "vue"; +import { reactive, ref, toRefs, watch } from "vue"; import axios from 'axios'; import { getCookie } from "@/api/utils"; - import JSONBigInt from 'json-bigint'; const JSONBigIntStr = JSONBigInt({ storeAsString: true }); +export function usePage(_url, param) { + const state = reactive({ + data: {}, + loading: false, + total: 0, + size: 10, + current: 1, + params: { pageNo: 1, pageSize: 10, ...param } + }) + + watch(param, () => { + state.params = { ...state.params, ...param } + fetchData() + }) + + function fetchData() { + state.loading = true + request(_url, state.params).then(r => { + state.params.pageNo === 1 ? (state.data = (r.data.records || r.data.rows)) : (state.data = [...state.data, ...(r.data.records || r.data.rows)]) + state.size = r.data.size + state.total = r.data.total + state.current = r.data.current + state.loading = false + }) + } + + fetchData() + return { + ...toRefs(state), + fetchData, + }; +} export function useRequest(_url, params = {}) { const data = ref({}) @@ -34,7 +65,7 @@ export function useRequest(_url, params = {}) { export async function request(_url, params) { const s = _url.split(' ') let url = s[0] - const method = s[1] || 'get' + const method = s[1]?.toLowerCase() || 'get' if (method === 'get') { let paramsArray = []; //拼接参数 @@ -52,25 +83,34 @@ export async function request(_url, params) { url, method, headers: { - 'X-Token': localStorage.getItem('token'), - ...method !== 'get' ? {'Content-Type': 'application/json'} : {} + 'token': getCookie('token'), + ...method !== 'get' ? { 'Content-Type': 'application/json' } : {} }, baseURL: import.meta.env.VITE_BASE_API, - ...method !== 'get' ? {data: JSON.stringify(body)} : {} + ...method !== 'get' ? { data: JSON.stringify(body) } : {} }).then(resp => resp.data).then(response => { if (response.code !== 200 && response.code !== 0) { if (response.code === 1000) { - (import.meta.env.MODE === 'development' || import.meta.env.MODE === 'test') ? router.push({path: '/login'}) : window.open(import.meta.env.VITE_BASE_LOGIN_URL + window.location.url, '_top') + (import.meta.env.MODE === 'development' || import.meta.env.MODE === 'test') ? router.push({ path: '/login' }) : window.open(import.meta.env.VITE_BASE_LOGIN_URL, '_top') } + // if (import.meta.env.DEV && response.code === 1000) { + // router.push({path: '/login'}) + // } else { + // window.open() + // response.showMsg && notification.open({ + // message: response.showMsg, + // duration: 2, + // }); + // } throw new Error('接口异常') } return response }).catch(e => { - console.log(2222) - console.log(e) + console.log('eeeee', e) // router.push({path: '/login'}) }) } + export async function boeRequest(_url, params) { const s = _url.split(' ') let url = s[0] @@ -88,21 +128,21 @@ export async function boeRequest(_url, params) { } } const body = method !== 'get' ? params || {} : {} - return fetch(url,{ + return fetch(url, { method, - headers:{ + headers: { token: getCookie('token'), - ...method !== 'get' ? {'Content-Type': 'application/json'} : {} + ...method !== 'get' ? { 'Content-Type': 'application/json' } : {} }, - ...method !== 'get' ? {body: JSON.stringify(body)} : {} - }).then(res=>{ + ...method !== 'get' ? { body: JSON.stringify(body) } : {} + }).then(res => { return res.text() - }).then(res=>{ + }).then(res => { return JSONBigIntStr.parse(res) - }).then(res=>{ + }).then(res => { console.log(res) - if(res.status === 500){ - import.meta.env.MODE === 'development' ? router.push({path: '/login',query:{returnUrl:router.currentRoute.value.fullPath}}) : window.open(import.meta.env.VITE_BASE_LOGIN_URL + window.location.url, '_top') + if (res.status === 500) { + import.meta.env.MODE === 'development' ? router.push({ path: '/login', query: { returnUrl: router.currentRoute.value.fullPath } }) : window.open(import.meta.env.VITE_BASE_LOGIN_URL + window.location.url, '_top') } return res }) diff --git a/src/assets/image/file/book.png b/src/assets/image/file/book.png new file mode 100644 index 0000000..925572e Binary files /dev/null and b/src/assets/image/file/book.png differ diff --git a/src/assets/image/file/rar.png b/src/assets/image/file/rar.png new file mode 100644 index 0000000..9b7bc33 Binary files /dev/null and b/src/assets/image/file/rar.png differ diff --git a/src/assets/image/publish.png b/src/assets/image/publish.png new file mode 100644 index 0000000..8e17b14 Binary files /dev/null and b/src/assets/image/publish.png differ diff --git a/src/assets/image/return.png b/src/assets/image/return.png new file mode 100644 index 0000000..0b0dd52 Binary files /dev/null and b/src/assets/image/return.png differ diff --git a/src/components/FileTypeImg.vue b/src/components/FileTypeImg.vue new file mode 100644 index 0000000..67630df --- /dev/null +++ b/src/components/FileTypeImg.vue @@ -0,0 +1,57 @@ + + + + \ No newline at end of file diff --git a/src/components/ReturnHead.vue b/src/components/ReturnHead.vue new file mode 100644 index 0000000..eea9944 --- /dev/null +++ b/src/components/ReturnHead.vue @@ -0,0 +1,83 @@ + + + + diff --git a/src/views/activities/ActivitiesPage.vue b/src/views/activities/ActivitiesPage.vue index d98d9ec..82dbdca 100644 --- a/src/views/activities/ActivitiesPage.vue +++ b/src/views/activities/ActivitiesPage.vue @@ -1,5 +1,6 @@ + + + diff --git a/src/views/examination/Examination.vue b/src/views/examination/Examination.vue index 05b97a9..4e30c9e 100644 --- a/src/views/examination/Examination.vue +++ b/src/views/examination/Examination.vue @@ -3,7 +3,6 @@
-
管理者进阶腾飞班 - 第一次考试
@@ -35,23 +34,17 @@ 状态 - - 2022-7-20 00:00 - + 2022-7-20 00:00 10分 已完成 - - 2022-7-20 00:00 - + 2022-7-20 00:00 10分 已完成 - - 2022-7-20 00:00 - + 2022-7-20 00:00 10分 已完成 @@ -59,7 +52,6 @@
-
@@ -78,7 +70,7 @@ export default { diff --git a/src/views/faceteach/FaceTeach.vue b/src/views/faceteach/FaceTeach.vue index 9543b37..bb0ee61 100644 --- a/src/views/faceteach/FaceTeach.vue +++ b/src/views/faceteach/FaceTeach.vue @@ -1,6 +1,7 @@ - diff --git a/src/views/homeworkpage/HomeworkPage.vue b/src/views/homeworkpage/HomeworkPage.vue index e5a6df8..c272ac0 100644 --- a/src/views/homeworkpage/HomeworkPage.vue +++ b/src/views/homeworkpage/HomeworkPage.vue @@ -1,123 +1,206 @@ - @@ -136,7 +219,7 @@ export default { display: flex; justify-content: center; // margin-top: -17.5px; - margin-top: 20px; + margin-top: 10px; .noticebox { width: 100%; background: #fff; @@ -144,60 +227,60 @@ export default { position: relative; display: flex; justify-content: center; - .line{ - width: 100%; - height: 0; - border-top: 1px solid #F1F2F3; - margin-top: 17px; - position:absolute; - left:0; - } + .line { + width: 100%; + height: 0; + border-top: 1px solid #f1f2f3; + margin-top: 17px; + position: absolute; + left: 0; + } .mani { width: 90%; margin-top: 20px; // position:relative; - .joininfo{ - color:#0D233A; + .joininfo { + color: #0d233a; font-size: 16px; font-weight: bold; } - - .contenttitle{ - width:100%; + + .contenttitle { + width: 100%; // height:10px; margin-top: 15px; // background-color: #bfa; - display:flex; - .timeimg{ + display: flex; + .timeimg { width: 12.8px; height: 13px; } - .timee{ - color:#6E7B84; + .timee { + color: #6e7b84; font-size: 14px; line-height: 13px; margin-left: 6px; } } - .timebox{ - display:flex; + .timebox { + display: flex; width: 100%; - height:49px; - background-color:#F2F5F7; + height: 49px; + background-color: #f2f5f7; margin-top: 17.5px; margin-bottom: 27.5px; border-radius: 10px; - .samez{ - color:#0060FF; + .samez { + color: #0060ff; font-size: 18px; line-height: 49px; margin-left: 13px; } - .samey{ - color:#6E7B84; + .samey { + color: #6e7b84; font-size: 14px; line-height: 49px; - + margin-left: 13px; } } @@ -208,49 +291,52 @@ export default { width: 100%; margin-bottom: 20px; // height: 200px; - - .ballotdetail{ - color:#6E7B84; + + .ballotdetail { + color: #6e7b84; line-height: 30px; font-size: 13px; } - .hiscon{ + .hiscon { width: 100%; - .historyitem{ + .historyitem { // margin-left: 21px; width: 100%; border-radius: 4px; - .itemtime{ - color:#6E7B84; + .itemtime { + color: #6e7b84; margin-left: 21px; font-size: 12px; margin-top: 11px; } - .itemtitle{ + .itemtitle { line-height: 22px; font-size: 13px; - color:#333330; - margin:10.5px 0 10.5px 21px; + color: #333330; + margin: 10.5px 0 10.5px 21px; + width: 90%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } } } - } - .btnc{ - width:100%; - display: flex; - justify-content: center; - .btncc{ - margin-bottom: 19px; - height:33px; - width:88%; - border:0; - background-color: #2478FF; - border-radius: 6px; - color:#fff; - font-size: 14px; - } + .btnc { + width: 100%; + display: flex; + justify-content: center; + .btncc { + margin-bottom: 19px; + height: 33px; + width: 88%; + border: 0; + background-color: #2478ff; + border-radius: 6px; + color: #fff; + font-size: 14px; } + } } } } diff --git a/src/views/homeworkpage/UploadWork.vue b/src/views/homeworkpage/UploadWork.vue index 7fdcb37..375d4cb 100644 --- a/src/views/homeworkpage/UploadWork.vue +++ b/src/views/homeworkpage/UploadWork.vue @@ -1,4 +1,9 @@ - +