From 9f0fc8fa1279b27364d7202c5788695d7ffc462b Mon Sep 17 00:00:00 2001 From: b2894lxlx <517289602@qq.com> Date: Wed, 18 Jun 2025 14:08:57 +0800 Subject: [PATCH] =?UTF-8?q?250618=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/article.js | 2 + src/api/common.js | 1 + src/api/exam.js | 6 + src/api/signUp.js | 1 + src/components/MessageItem.vue | 135 ++++++ src/manifest.json | 4 +- src/pages.json | 24 + src/pages/exam/checkScore.vue | 201 +++++++++ src/pages/exam/exam.vue | 117 +++-- src/pages/exam/makeScore.vue | 154 +++++++ src/pages/exam/makeScoreList.vue | 77 ++++ src/pages/exam/train/randExam.vue | 121 +++-- src/pages/exam/train/sortExam.vue | 131 ++++-- .../index/components/articleListComponent.vue | 387 ++++++++-------- src/pages/index/components/tab0.vue | 59 ++- src/pages/index/components/tab3.vue | 4 +- src/pages/index/index.vue | 10 +- src/pages/index/publish.vue | 427 +++++++++--------- src/pages/promote/components/ReviewList.vue | 190 ++++++++ src/pages/promote/exam.vue | 2 +- src/pages/promote/promote.vue | 253 ++++++----- src/pages/promote/result.vue | 12 +- src/pages/signUp/info.vue | 2 +- src/pages/signUp/self.vue | 34 +- src/pages/user/message.vue | 113 +---- src/pages/user/shareList.vue | 53 +++ src/pages/user/signIn.vue | 133 ++++-- src/pages/user/signUp.vue | 149 +++--- src/pages/user/user.vue | 34 +- src/pages/user/userDetail.vue | 4 + src/static/image/activity.png | Bin 0 -> 2273 bytes src/static/image/address.png | Bin 2801 -> 4691 bytes src/static/image/archiveBox.png | Bin 2689 -> 2660 bytes src/static/image/board.png | Bin 0 -> 3889 bytes src/static/image/booking.png | Bin 0 -> 3812 bytes src/static/image/order.png | Bin 2944 -> 2406 bytes src/static/image/patent.png | Bin 0 -> 4853 bytes src/static/image/profile.png | Bin 3893 -> 2709 bytes src/static/image/score.png | Bin 0 -> 2788 bytes src/static/image/service.png | Bin 0 -> 3907 bytes src/static/image/setting.png | Bin 0 -> 3528 bytes src/static/image/share.png | Bin 2438 -> 3272 bytes src/static/image/task.png | Bin 0 -> 3225 bytes .../custom-waterfalls-flow.vue | 2 +- 44 files changed, 1948 insertions(+), 894 deletions(-) create mode 100644 src/components/MessageItem.vue create mode 100644 src/pages/exam/checkScore.vue create mode 100644 src/pages/exam/makeScore.vue create mode 100644 src/pages/exam/makeScoreList.vue create mode 100644 src/pages/promote/components/ReviewList.vue create mode 100644 src/pages/user/shareList.vue create mode 100644 src/static/image/activity.png create mode 100644 src/static/image/board.png create mode 100644 src/static/image/booking.png create mode 100644 src/static/image/patent.png create mode 100644 src/static/image/score.png create mode 100644 src/static/image/service.png create mode 100644 src/static/image/setting.png create mode 100644 src/static/image/task.png diff --git a/src/api/article.js b/src/api/article.js index 3db87b8..7be2527 100644 --- a/src/api/article.js +++ b/src/api/article.js @@ -28,7 +28,9 @@ export const articlePageByTopReq = (params) => http.get('/cms/article/page-by-to export const articleListForPolicyReq = (params) => http.get('/cms/article/list-for-policy', {params}) export const pageMatchArticleReq = (params) => http.post('/match/match-article/page-for-front', params) +export const pageMatchArticleForUserReq = (params) => http.post('/match/match-article/list-for-user', params) export const matchArticleActionReq = (params) => http.post('/match/match-article/action', params) +export const matchArticleInfoReq = (id) => http.get(`/match/match-article/${id}`) export const matchArticleLikeAction = (params) => http.post('/match/match-article-like/action', params) export const matchArticleCommentListReq = (params) => http.post('/match/match-article-comment/list-for-front', params) export const matchArticleCommentActionReq = (params) => http.post('/match/match-article-comment/action', params) diff --git a/src/api/common.js b/src/api/common.js index addabf8..aadb21b 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -29,4 +29,5 @@ export const getCodeReq = (data) => http.post('/sms/get-code', data) export const checkCodeReq = (data) => http.post('/sms/check-code', data) export const regReq = (data) => http.post('/sys/user-detail/reg', data) +export const userInfoByIdCardPhoneReq = (data) => http.post('/sys/user-detail/info-by-id-card-phone', data) diff --git a/src/api/exam.js b/src/api/exam.js index 99c1ce6..c4be027 100644 --- a/src/api/exam.js +++ b/src/api/exam.js @@ -40,6 +40,12 @@ export const addExamCorrectionReq = data => http.post('/exam/correction', data) export const addExamUpgradeReq = data => http.post('/exam/upgrade', data) export const getExamReq = id => http.get(`/exam/paper-detail/${id}`) +export const trainExamStaffListReq = () => http.get(`/train/train-exam-staff/user-list`) +export const operatePaperDetailReq = params => http.get(`/exam/operate-paper-detail`, {params}) +export const operateScoreActionReq = (data) => http.post(`/exam/operate-score`, data) +export const operateScoreListReq = (params) => http.get(`/exam/operate-score`, {params}) +export const operateScoreCheckReq = (data) => http.post(`/exam/operate-score/check-score`, data) +export const operateScoreRefuseReq = (data) => http.post(`/exam/operate-score/check-score-refuse`, data) export const TASK_TYPE_LIST = [ diff --git a/src/api/signUp.js b/src/api/signUp.js index 98adb4f..3070dee 100644 --- a/src/api/signUp.js +++ b/src/api/signUp.js @@ -4,6 +4,7 @@ export const signUpListReq = () => http.get('/train/train-sign-up') export const signUpSelfListReq = () => http.get('/train/train-sign-up-self') export const signUpInfoReq = id => http.get(`/train/train-sign-up/${id}`) export const signUpUserListReq = () => http.post(`/train/train-sign-up/user-list`) +export const signUpUserSelfListReq = () => http.post(`/train/train-sign-up-self/user-list`) export const signUpJoinReq = data => http.post(`/train/train-sign-up-people/join`, data) export const signUpPeopleListReq = params => http.get(`/train/train-sign-up-people`, {params}) export const signUpUpdateReq = data => http.put(`/train/train-sign-up-people`, data) diff --git a/src/components/MessageItem.vue b/src/components/MessageItem.vue new file mode 100644 index 0000000..8bcd8b9 --- /dev/null +++ b/src/components/MessageItem.vue @@ -0,0 +1,135 @@ + + + + + \ No newline at end of file diff --git a/src/manifest.json b/src/manifest.json index 9196bcc..79d9030 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -3,8 +3,8 @@ "appid" : "__UNI__06C03D0", //__UNI__06C03D0 "description" : "", - "versionName" : "1.35.0", - "versionCode" : "254", + "versionName" : "2.2.0", + "versionCode" : "275", "transformPx" : false, /* 5+App特有相关 */ "app-plus" : { diff --git a/src/pages.json b/src/pages.json index 3402689..241d61d 100644 --- a/src/pages.json +++ b/src/pages.json @@ -656,6 +656,30 @@ "style": { "navigationBarTitleText": "钱包" } + }, + { + "path": "pages/user/shareList", + "style": { + "navigationBarTitleText": "我的分享" + } + }, + { + "path": "pages/exam/makeScoreList", + "style": { + "navigationBarTitleText": "实操考试打分" + } + }, + { + "path": "pages/exam/makeScore", + "style": { + "navigationBarTitleText": "实操考试打分" + } + }, + { + "path": "pages/exam/checkScore", + "style": { + "navigationBarTitleText": "实操考试核分" + } } ], "tabBar": { diff --git a/src/pages/exam/checkScore.vue b/src/pages/exam/checkScore.vue new file mode 100644 index 0000000..bd38700 --- /dev/null +++ b/src/pages/exam/checkScore.vue @@ -0,0 +1,201 @@ + + + \ No newline at end of file diff --git a/src/pages/exam/exam.vue b/src/pages/exam/exam.vue index 4a32023..6aaa3a6 100644 --- a/src/pages/exam/exam.vue +++ b/src/pages/exam/exam.vue @@ -1,7 +1,10 @@ @@ -53,14 +69,34 @@ const getExamList = async (paperId) => { const res = await paperDetailListReq({ paperId, num: numVal, - id: detailIdVal + id: detailIdVal, + type: typeVal }) examList.value = [] if (res) { - examList.value = res.data + examList.value = res.data.map(item => { + if (['cal', 'answer', 'essay', 'explain'].includes(item.type)) { + const correct = JSON.parse(item.answer).find(item => item.isCorrect) + item.userAnswer = correct.content + } + return item + }) } } +const popup = ref() + +const doNext = () => { + popup.value.close() + correctContent.value = '' + if (currentIndex.value < examList.value.length - 1) { + currentIndex.value++ + selectedAnswerIndex.value = [] + } else saveResult() +} + +const correctContent = ref('') + const selectedAnswerIndex = ref([]) const selectAnswer = (index) => { const currentExam = examList.value[currentIndex.value] @@ -76,21 +112,32 @@ let correctNum = 0 let resultList = [] const next = () => { - if (!selectedAnswerIndex.value.length) return $toast('请选择答案') const currentExam = examList.value[currentIndex.value] + if (['single', 'multi', 'single'].includes(currentExam.type)) { + if (!selectedAnswerIndex.value.length) return $toast('请选择答案') + } const answerList = JSON.parse(currentExam.answer) + let toNext = true if (!['multi'].includes(currentExam.type)) { if (['single', 'judge'].includes(currentExam.type)) { hasResultNum++ const answer = answerList[selectedAnswerIndex.value[0]] if (!answer.isCorrect) { - // let correct - // for (let i = 0; i < answerList.length; i++) { - // if (answerList[i].isCorrect) { - // correct = answerList[i] - // break - // } - // } + if (isSim) { + let correct + for (let i = 0; i < answerList.length; i++) { + if (answerList[i].isCorrect) { + if (currentExam.type === 'single') + correct = `${ANSWER_CHAR[i]}、${answerList[i].content}` + else correct = answerList[i].content + break + } + } + correctContent.value = correct + popup.value.open() + toNext = false + } + examUserWrongActionReq({ courseId: examList.value[0].courseId, examDetailId: currentExam.id, @@ -106,10 +153,12 @@ const next = () => { type: currentExam.type, userAnswer: answer.content }) - if (currentIndex.value < examList.value.length - 1) { - currentIndex.value++ - selectedAnswerIndex.value = [] - } else saveResult() + if (toNext) { + if (currentIndex.value < examList.value.length - 1) { + currentIndex.value++ + selectedAnswerIndex.value = [] + } else saveResult() + } } else { resultList.push({ paperId: paperIdVal, @@ -126,15 +175,17 @@ const next = () => { resultList.push({ paperId: paperIdVal, detailId: currentExam.id, - getScore: null, + getScore: currentExam.score, examType: examTypeVal, examId: examIdVal, type: currentExam.type, - userAnswer: examList.value[currentIndex.value].content + userAnswer: currentExam.userAnswer }) - if (currentIndex.value < examList.value.length - 1) { - currentIndex.value++ - } else saveResult() + if (toNext) { + if (currentIndex.value < examList.value.length - 1) { + currentIndex.value++ + } else saveResult() + } } } else { hasResultNum++ @@ -158,6 +209,11 @@ const next = () => { }) correctNext() } else { + if (isSim) { + correctContent.value = correctList.map(i => i.content).join(', ') + popup.value.open() + toNext = false + } examUserWrongActionReq({ courseId: examList.value[0].courseId, examDetailId: currentExam.id, @@ -173,10 +229,12 @@ const next = () => { type: currentExam.type, userAnswer: JSON.stringify(answerList.filter((_, index) => selectedAnswerIndex.value.includes(index)).map(i => i.content)) }) - if (currentIndex.value < examList.value.length - 1) { - selectedAnswerIndex.value = [] - currentIndex.value++ - } else saveResult() + if (toNext) { + if (currentIndex.value < examList.value.length - 1) { + selectedAnswerIndex.value = [] + currentIndex.value++ + } else saveResult() + } } } } @@ -230,9 +288,10 @@ const countDown = () => { } } -let paperIdVal = null, examTypeVal = null, examIdVal = null, numVal = null, detailIdVal = null +let paperIdVal = null, examTypeVal = null, examIdVal = null, numVal = null, detailIdVal = null, isSim = false, + typeVal = null const timeLimitVal = ref(null) -onLoad(({title, paperId, examType, examId, num, timeLimit, detailId}) => { +onLoad(({title, paperId, examType, examId, num, timeLimit, detailId, type}) => { currentIndex.value = 0 correctNum = 0 selectedAnswerIndex.value = [] @@ -243,11 +302,13 @@ onLoad(({title, paperId, examType, examId, num, timeLimit, detailId}) => { examIdVal = examId if (num) numVal = num if (detailId) detailIdVal = detailId + if (type) typeVal = type if (timeLimit) { timeLimitVal.value = parseInt(timeLimit * 60) countDown() } getExamList(paperId) + isSim = title === '模拟考试' uni.setNavigationBarTitle({title}) }) diff --git a/src/pages/exam/makeScore.vue b/src/pages/exam/makeScore.vue new file mode 100644 index 0000000..799e9d5 --- /dev/null +++ b/src/pages/exam/makeScore.vue @@ -0,0 +1,154 @@ + + + \ No newline at end of file diff --git a/src/pages/exam/makeScoreList.vue b/src/pages/exam/makeScoreList.vue new file mode 100644 index 0000000..42291a9 --- /dev/null +++ b/src/pages/exam/makeScoreList.vue @@ -0,0 +1,77 @@ + + + \ No newline at end of file diff --git a/src/pages/exam/train/randExam.vue b/src/pages/exam/train/randExam.vue index c228854..73a4226 100644 --- a/src/pages/exam/train/randExam.vue +++ b/src/pages/exam/train/randExam.vue @@ -39,6 +39,17 @@ + + + + 正确答案: + {{ correctContent }} + + 下一题 + + + + @@ -62,6 +73,16 @@ import {$toast} from "@/utils"; const currentIndex = ref(0) const progress = ref(0) +const popup = ref() +const correctContent = ref('') +const doNext = () => { + popup.value.close() + correctContent.value = '' + if (currentIndex.value < examList.value.length - 1) { + currentIndex.value++ + selectedAnswerIndex.value = [] + } else done() +} const selectedAnswerIndex = ref([]) const selectAnswer = (index) => { @@ -94,8 +115,9 @@ const next = () => { paperId: paperIdVal, detailId: currentExam.id, getScore: currentExam.score, - examType: 3, + examType: 4, examId: examIdVal, + startTime, userAnswer: JSON.stringify(answerList.map(i => i.content)) }) correctNext() @@ -110,24 +132,32 @@ const next = () => { paperId: paperIdVal, detailId: currentExam.id, getScore: 0, - examType: 3, + examType: 4, + startTime, examId: examIdVal, userAnswer: JSON.stringify(answerList.filter((_, index) => selectedAnswerIndex.value.includes(index)).map(i => i.content)) }) - uni.showModal({ - title: '答题错误', - content: `正确答案为: ${correctList.map(i => i.content).join(', ')}`, - showCancel: false, - confirmText: '知道了', - success: async ({confirm}) => { - if (confirm) { - if (currentIndex.value < examList.value.length - 1) { - currentIndex.value++ - selectedAnswerIndex.value = [] - } else await done() - } + // uni.showModal({ + // title: '答题错误', + // content: `正确答案为: ${correctList.map(i => i.content).join(', ')}`, + // showCancel: false, + // confirmText: '知道了', + // success: async ({confirm}) => { + // if (confirm) { + // if (currentIndex.value < examList.value.length - 1) { + // currentIndex.value++ + // selectedAnswerIndex.value = [] + // } else await done() + // } + // } + // }) + for (let i = 0; i < answerList.length; i++) { + if (answerList[i].isCorrect) { + correctContent.value += `${ANSWER_CHAR[i]}、${answerList[i].content}, ` } - }) + } + correctContent.value = correctContent.value.slice(0, -2) + popup.value.open() } } else { const answer = answerList[selectedAnswerIndex.value[0]] @@ -145,36 +175,48 @@ const next = () => { courseId: examList.value[0].courseId, type: 1 }) - uni.showModal({ - title: '答题错误', - content: `正确答案为: ${correct.content}`, - showCancel: false, - confirmText: '知道了', - success: async ({confirm}) => { - if (confirm) { - if (currentIndex.value < examList.value.length - 1) { - currentIndex.value++ - selectedAnswerIndex.value = [] - } else await done() - } + // uni.showModal({ + // title: '答题错误', + // content: `正确答案为: ${correct.content}`, + // showCancel: false, + // confirmText: '知道了', + // success: async ({confirm}) => { + // if (confirm) { + // if (currentIndex.value < examList.value.length - 1) { + // currentIndex.value++ + // selectedAnswerIndex.value = [] + // } else await done() + // } + // } + // }) + for (let i = 0; i < answerList.length; i++) { + if (answerList[i].isCorrect) { + if (currentExam.type === 'single') + correct = `${ANSWER_CHAR[i]}、${answerList[i].content}` + else correct = answerList[i].content + break } - }) + } + correctContent.value = correct + popup.value.open() resultList.push({ paperId: paperIdVal, detailId: currentExam.id, getScore: 0, - examType: 3, + examType: 4, examId: examIdVal, - userAnswer: answer.content + userAnswer: answer.content, + startTime }) } else { resultList.push({ paperId: paperIdVal, detailId: currentExam.id, getScore: currentExam.score, - examType: 3, + examType: 4, examId: examIdVal, - userAnswer: answer.content + userAnswer: answer.content, + startTime }) correctNext() } @@ -192,11 +234,10 @@ const correctNext = () => { const resultList = [] const done = async () => { uni.showLoading({title: '正在提交'}) - await examResultActionReq(resultList) - await trainExamAddTimeReq({ - examId: examIdVal, - learnUseTime: dayjs().unix() - startTime - }) + await examResultActionReq(resultList.map(i => { + i.addTime = true + return i + })) uni.hideLoading() await uni.navigateTo({url: `/pages/match/result?correctNum=${correctNum}&mode=rand`}) } @@ -238,7 +279,7 @@ const getExamList = async (paperId, takeDiffNumList, takeTypeNumList) => { const back = async () => { await uni.navigateBack() } -let paperIdVal = null, examIdVal = null, startTime = null, endTime = null, takeDiffNumListVal = null, +let paperIdVal = null, examIdVal = null, startTime = dayjs().unix(), endTime = null, takeDiffNumListVal = null, takeTypeNumListVal = null onLoad(({paperId, examId, takeTypeNumList}) => { currentIndex.value = 0 @@ -247,6 +288,10 @@ onLoad(({paperId, examId, takeTypeNumList}) => { correctNum = 0 selectedAnswerIndex.value = [] takeTypeNumListVal = takeTypeNumList + // trainExamAddTimeReq({ + // examId: examIdVal, + // learnUseTime: dayjs().unix() - startTime + // }) }) onShow(() => { diff --git a/src/pages/exam/train/sortExam.vue b/src/pages/exam/train/sortExam.vue index 889e9df..0f59aa4 100644 --- a/src/pages/exam/train/sortExam.vue +++ b/src/pages/exam/train/sortExam.vue @@ -39,6 +39,17 @@ + + + + 正确答案: + {{ correctContent }} + + 下一题 + + + + @@ -75,9 +86,20 @@ const selectAnswer = (index) => { } let correctNum = 0 +const popup = ref() +const correctContent = ref('') +const doNext = () => { + popup.value.close() + correctContent.value = '' + if (currentIndex.value < examList.value.length - 1) { + currentIndex.value++ + selectedAnswerIndex.value = [] + } else saveRes() +} const next = () => { if (!selectedAnswerIndex.value.length) return $toast('请选择答案') + correctContent.value = '' const currentExam = examList.value[currentIndex.value] const answerList = JSON.parse(currentExam.answer) if (['multi'].includes(currentExam.type)) { @@ -97,6 +119,7 @@ const next = () => { getScore: currentExam.score, examType: 3, examId: examIdVal, + startTime, userAnswer: JSON.stringify(answerList.map(i => i.content)) }) correctNext() @@ -114,23 +137,31 @@ const next = () => { examType: 3, examId: examIdVal, userAnswer: JSON.stringify(answerList.filter((_, index) => selectedAnswerIndex.value.includes(index)).map(i => i.content)), - isCorrect: true + isCorrect: true, + startTime }) - uni.showModal({ - title: '答题错误', - content: `正确答案为: ${correctList.map(i => i.content).join(', ')}`, - showCancel: false, - confirmText: '知道了', - success: async ({confirm}) => { - if (confirm) { - if (currentIndex.value < examList.value.length - 1) { - currentIndex.value++ - selectedAnswerIndex.value = [] - saveRes() - } else await done() - } + for (let i = 0; i < answerList.length; i++) { + if (answerList[i].isCorrect) { + correctContent.value += `${ANSWER_CHAR[i]}、${answerList[i].content}, ` } - }) + } + correctContent.value = correctContent.value.slice(0, -2) + popup.value.open() + // uni.showModal({ + // title: '答题错误', + // content: `正确答案为: ${correctList.map(i => i.content).join(', ')}`, + // showCancel: false, + // confirmText: '知道了', + // success: async ({confirm}) => { + // if (confirm) { + // if (currentIndex.value < examList.value.length - 1) { + // currentIndex.value++ + // selectedAnswerIndex.value = [] + // saveRes() + // } else await done() + // } + // } + // }) } } else { const answer = answerList[selectedAnswerIndex.value[0]] @@ -148,28 +179,39 @@ const next = () => { courseId: examList.value[0].courseId, type: 1 }) - uni.showModal({ - title: '答题错误', - content: `正确答案为: ${correct.content}`, - showCancel: false, - confirmText: '知道了', - success: async ({confirm}) => { - if (confirm) { - if (currentIndex.value < examList.value.length - 1) { - currentIndex.value++ - selectedAnswerIndex.value = [] - saveRes() - } else await done() - } + // uni.showModal({ + // title: '答题错误', + // content: `正确答案为: ${correct.content}`, + // showCancel: false, + // confirmText: '知道了', + // success: async ({confirm}) => { + // if (confirm) { + // if (currentIndex.value < examList.value.length - 1) { + // currentIndex.value++ + // selectedAnswerIndex.value = [] + // saveRes() + // } else await done() + // } + // } + // }) + for (let i = 0; i < answerList.length; i++) { + if (answerList[i].isCorrect) { + if (currentExam.type === 'single') + correct = `${ANSWER_CHAR[i]}、${answerList[i].content}` + else correct = answerList[i].content + break } - }) + } + correctContent.value = correct + popup.value.open() resultList.push({ paperId: paperIdVal, detailId: currentExam.id, getScore: 0, examType: 3, examId: examIdVal, - userAnswer: answer.content + userAnswer: answer.content, + startTime }) } else { resultList.push({ @@ -179,7 +221,8 @@ const next = () => { examType: 3, examId: examIdVal, userAnswer: answer.content, - isCorrect: true + isCorrect: true, + startTime }) correctNext() } @@ -189,7 +232,12 @@ const next = () => { const saveRes = () => { if (resultList.length % 3 === 0) { // 每3条提交一次 - examResultActionReq(resultList.filter((_, i) => i > resultList.length - 4)) + const list = resultList.filter((_, i) => i > resultList.length - 4).map(i => { + i.addTime = false + return i + }) + examResultActionReq(list) + startTime = dayjs().unix() } } @@ -205,11 +253,10 @@ const correctNext = () => { const resultList = [] const done = async () => { uni.showLoading({title: '正在提交'}) - await examResultActionReq(resultList) - await trainExamAddTimeReq({ - examId: examIdVal, - learnUseTime: dayjs().unix() - startTime - }) + await examResultActionReq(resultList.map(i => { + i.addTime = true + return i + })) uni.hideLoading() await uni.navigateTo({url: `/pages/match/result?correctNum=${correctNum}&mode=sort`}) } @@ -217,7 +264,10 @@ const done = async () => { const examList = ref([]) const getExamList = async (paperId) => { - const res = await paperDetailListReq({paperId}) + const res = await paperDetailListReq({ + paperId, + type: typeVal ?? null + }) examList.value = [] if (res) { examList.value = res.data @@ -227,11 +277,12 @@ const getExamList = async (paperId) => { const back = async () => { await uni.navigateBack() } -let paperIdVal = null, examIdVal = null, startTime = null, endTime = null -onLoad(({paperId, index, examId}) => { +let paperIdVal = null, examIdVal = null, startTime = dayjs().unix(), endTime = null, typeVal = null +onLoad(({paperId, index, examId, type}) => { currentIndex.value = parseInt(index) paperIdVal = parseInt(paperId) examIdVal = parseInt(examId) + if (type) typeVal = type correctNum = 0 selectedAnswerIndex.value = [] getExamList(paperId) diff --git a/src/pages/index/components/articleListComponent.vue b/src/pages/index/components/articleListComponent.vue index 94e0ae8..17117bf 100644 --- a/src/pages/index/components/articleListComponent.vue +++ b/src/pages/index/components/articleListComponent.vue @@ -1,151 +1,170 @@ diff --git a/src/pages/promote/components/ReviewList.vue b/src/pages/promote/components/ReviewList.vue new file mode 100644 index 0000000..bd6dfbe --- /dev/null +++ b/src/pages/promote/components/ReviewList.vue @@ -0,0 +1,190 @@ + + + + \ No newline at end of file diff --git a/src/pages/promote/exam.vue b/src/pages/promote/exam.vue index 848fb8a..e7b9ee5 100644 --- a/src/pages/promote/exam.vue +++ b/src/pages/promote/exam.vue @@ -18,7 +18,7 @@ - + diff --git a/src/pages/promote/promote.vue b/src/pages/promote/promote.vue index cf7001f..c8a3029 100644 --- a/src/pages/promote/promote.vue +++ b/src/pages/promote/promote.vue @@ -20,7 +20,7 @@ 当前培训作业学时统计(小时) {{ (trainData.learnSec / 3600).toFixed(2) }} - + 当前培训作业完成比例 - + 通知 - + - - - - {{ item.title }} - {{ item.createTime }} - - - + + + + + + - + + + + - 培训计划 + 考试任务({{ examList.length }}) + {{ + showAllExam ? '折叠' : '展开' + }} + + + + + + + + - - - - + + + + + + + 考试类型: {{ ['线上', '线下'][item.type] }} + + + 考试科目: + {{ + item.workTypeLists[0].course.title + }}({{ + ['初级', '中级', '高级', '技师', '高级技师'][item.workTypeLists[0].course.level] + }}) + + 总分 {{ item.paper.totalPoint }} 合格分 + {{ item.paper.passPoint }} + + + + + + 专家评审结果: + + {{ ['待审核', '已通过', '未通过'][item.trainExamPeopleInfo.highLevelStatus] }} + + + - 查看 - + + - + @@ -127,106 +218,27 @@ + - + - 考试任务 - + 培训计划 - - - - - - - - + + - - - 考试类型: {{ ['线上', '线下'][item.type] }} - - - 考试科目: - {{ - item.workTypeLists[0].course.title - }}({{ - ['初级', '中级', '高级', '技师', '高级技师'][item.workTypeLists[0].course.level] - }}) - - 总分 {{ item.paper.totalPoint }} 合格分 - {{ item.paper.passPoint }} - - - - - - 专家评审结果: - - {{ ['待审核', '已通过', '未通过'][item.trainExamPeopleInfo.highLevelStatus] }} - + - + 查看 - + @@ -344,6 +356,9 @@ import isBetween from 'dayjs/plugin/isBetween' import {listCategory} from "@/api/categoty"; import {userDetailReq} from "@/api/user"; import {$toast} from "@/utils"; +import ReviewList from "@/pages/promote/components/ReviewList.vue"; +import {messageListReq} from "@/api/shop"; +import MessageItem from "@/components/MessageItem.vue"; dayjs.extend(isSameOrBefore) dayjs.extend(isBetween) @@ -363,6 +378,8 @@ export default { } }, components: { + MessageItem, + ReviewList, mprogress }, data() { @@ -387,6 +404,7 @@ export default { ], trainList: [], examList: [], + showAllExam: false, trainInfoList: [], trainTaskList: [], userTrainList: [], @@ -543,7 +561,14 @@ export default { uni.navigateTo({url}) }, async getNewsList() { - const {data} = await listArticle({categoryId: 273, page: 1, limit: 10}) + // const {data} = await listArticle({categoryId: 273, page: 1, limit: 10}) + // this.newsList = data.map(item => { + // item.createTime = dayjs(item.createTime).format('YYYY-MM-DD') + // return item + // }) + const {data} = await messageListReq({ + sendFrom: 1 + }) this.newsList = data.map(item => { item.createTime = dayjs(item.createTime).format('YYYY-MM-DD') return item diff --git a/src/pages/promote/result.vue b/src/pages/promote/result.vue index faede1a..87dc07b 100644 --- a/src/pages/promote/result.vue +++ b/src/pages/promote/result.vue @@ -80,8 +80,8 @@ import {getUserInfo} from "@/utils/user"; const user = getUserInfo() const paperInfo = ref(null) -const getPaperInfo = async (paperId) => { - const {data} = await paperInfoReq({paperId}) +const getPaperInfo = async (id) => { + const {data} = await paperInfoReq({id}) paperInfo.value = data } @@ -97,7 +97,7 @@ const getResultList = async (paperId, examType, examId) => { }) totalGetScore.value = 0 resultList.value = data.map(item => { - totalGetScore.value += parseInt(item.getScore) + totalGetScore.value += parseFloat(item.getScore) return item }) for (let i in resultList.value) { @@ -105,16 +105,16 @@ const getResultList = async (paperId, examType, examId) => { if (index === -1) { const type = resultList.value[i].paperDetail.type listByType.value.push({ - correctNum: parseInt(resultList.value[i].getScore) > 0 ? 1 : 0, + correctNum: parseFloat(resultList.value[i].getScore) > 0 ? 1 : 0, num: 1, type, title: TASK_TYPE_LIST.find(item => item.value === type).label, getScore: resultList.value[i].getScore }) } else { - if (parseInt(resultList.value[i].getScore) > 0) listByType.value[index].correctNum++ + if (parseFloat(resultList.value[i].getScore) > 0) listByType.value[index].correctNum++ listByType.value[index].num++ - listByType.value[index].getScore += parseInt(resultList.value[i].getScore) + listByType.value[index].getScore += parseFloat(resultList.value[i].getScore) } } } diff --git a/src/pages/signUp/info.vue b/src/pages/signUp/info.vue index 8c139bd..9d82a76 100644 --- a/src/pages/signUp/info.vue +++ b/src/pages/signUp/info.vue @@ -22,7 +22,7 @@ - {{ info.hasOpen === 1 ? '已开课' : '提交' }} + {{ info.hasOpen === 1 ? '已开课' : '点击填写' }} diff --git a/src/pages/signUp/self.vue b/src/pages/signUp/self.vue index 40558c2..08366c4 100644 --- a/src/pages/signUp/self.vue +++ b/src/pages/signUp/self.vue @@ -22,7 +22,7 @@ - {{ info.hasOpen === 1 ? '已开课' : '提交' }} + {{ info.hasOpen === 1 ? '已开课' : '点击填写' }} @@ -641,7 +641,9 @@ const confirmReqWorkType = ({value}) => { const jobList = ref([]) const getJobList = async () => { jobList.value = [] - const res = await workTypePositionListReq() + const res = await workTypePositionListReq({ + groupName: true + }) if (res.data) jobList.value = res.data } @@ -652,19 +654,27 @@ const openJobPicker = () => { const confirmJob = ({value}) => { if (value[0]) { form.value.job = value[0].position - const children = workTypeListOriginTmp.value.filter(item => item.id === value[0].workTypeId) + const children = workTypeListOriginTmp.value.filter(item => value[0].workTypeIdList.includes(item.id)) const parent = workTypeListOriginTmp.value.find(item => item.id === children[0].parentId) + console.log(children, parent) + // workTypeListOrigin.value = [ + // { + // title: parent.title, + // id: parent.id, + // children: [ + // { + // title: children[0].title, + // id: children[0].id, + // children: children[0].children + // } + // ] + // } + // ] workTypeListOrigin.value = [ { title: parent.title, id: parent.id, - children: [ - { - title: children[0].title, - id: children[0].id, - children: children[0].children - } - ] + children } ] } @@ -900,8 +910,8 @@ const join = async () => { if (form.value.titleType !== '无' && !form.value.titlePaper) { return $toast('请上传职称等级证书') } - if (form.value.titleType !== '无' && !form.value.paperNo) { - return $toast('请输入职称等级编号') + if (form.value.workTypeName !== '无' && !form.value.paperNo) { + return $toast('请输入工种证书编号') } if (!workExp.value.length) { return $toast('请填写工作经历') diff --git a/src/pages/user/message.vue b/src/pages/user/message.vue index e29a855..111a65d 100644 --- a/src/pages/user/message.vue +++ b/src/pages/user/message.vue @@ -1,24 +1,7 @@