diff --git a/pages/YNEduApp/exam/examination.vue b/pages/YNEduApp/exam/examination.vue index c2abcbb..870abfd 100644 --- a/pages/YNEduApp/exam/examination.vue +++ b/pages/YNEduApp/exam/examination.vue @@ -208,10 +208,6 @@ export default { }, mounted() { this.getList() - this.random1 = Math.ceil(Math.random() * 100000) + 420000 // random1 在 7-13分钟之间 - // this.random1 = 10000 - this.random2 = Math.ceil(Math.random() * 100000) + 900000 // random2 在 15-19分钟之间 - console.log('🚀 ~ mounted ~ this.random1:', this.random1, this.random2) }, // onUnload() { // console.log('🚀 ~ onUnload ~ 页面关闭') @@ -224,14 +220,7 @@ export default { const params = { examId: this.examId } - // const res = await getExamQuestionList(params) - // const data = res.data - // this.questionList = data.examPaperData - // this.recordId = data.recordId - // this.examTime = data.answerTime - // this.time = Number(data.answerTime) * 60 * 1000 - // console.log('🚀 ~ getList ~ this.time:', this.time) - // console.log('🚀 ~ getList ~ res考试题:', res) + uni.request({ url: config.baseUrl + '/exam-student/studentExam/getExamQuestionList', method: 'post', @@ -250,6 +239,9 @@ export default { this.time = Number(data.answerTime) * 60 * 1000 console.log('🚀 ~ getList ~ this.time:', this.time) console.log('🚀 ~ getList ~ this.questionList:', this.questionList) + this.random1 = (data.answerTime/3) * 60 + Math.ceil(Math.random() * 20) + 20 + this.random2 = (data.answerTime/2) * 60 + Math.ceil(Math.random() * 30) + 30 + console.log('🚀 ~ getList ~ this.random1:', this.random1, this.random2) if (this.questionList.length > 0) { this.questionList.forEach((item, index) => { this.$set(item, 'isShow', index < 7) @@ -282,12 +274,12 @@ export default { this.time - (time.days * 24 * 60 * 60 + time.hours * 60 * 60 + time.minutes * 60 + time.seconds) * 1000 // console.log('🚀 ~ changeCountDown ~ this.answerTime:', this.answerTime) if (this.answerTime > this.random1 && this.answerTime < this.random2 && !this.hasScanned) { - this.openFaceScan() // Android 人脸识别 - // this.openPhotograph() // IOS 拍照识别 + // this.openFaceScan() // Android 人脸识别 + this.openPhotograph() // IOS 拍照识别 this.hasScanned = true } else if (this.answerTime > this.random2 && this.hasScanned) { - this.openFaceScan() - // this.openPhotograph() + // this.openFaceScan() + this.openPhotograph() this.hasScanned = false } if (this.answerTime == this.time) { @@ -452,18 +444,18 @@ export default { // }) }, // 人脸识别 - async openFaceScan() { - face.open(['a'], e => { - console.log('🚀 ~ e-人脸识别:', e) - face.close() - let params = { - userId: uni.getStorageSync('userId'), - img: e - } - params = JSON.stringify(params) - this.getFaceRecognition(params) - }) - }, + // async openFaceScan() { + // face.open(['a'], e => { + // console.log('🚀 ~ e-人脸识别:', e) + // face.close() + // let params = { + // userId: uni.getStorageSync('userId'), + // img: e + // } + // params = JSON.stringify(params) + // this.getFaceRecognition(params) + // }) + // }, // 拍照录入 openPhotograph() { this.isHide = true @@ -478,7 +470,7 @@ export default { this.imgToBase64(res.tempFilePaths[0]).then(base64 => { url = base64 console.log('🚀 ~ this.imgToBase64 ~ base64:', url) - this.getFaceRecognition(url) + this.getFaceRecognition({ userId: uni.getStorageSync('userId'), img: url }) }) }, fail: err => { @@ -501,6 +493,7 @@ export default { }, // 发送请求 getFaceRecognition(params) { + console.log('🚀 ~ getFaceRecognition ~ params:', params) uni.request({ url: config.baseUrl + '/exam-student/personalCenter/getFaceRecognition', method: 'POST', @@ -510,8 +503,9 @@ export default { }, data: params, success: res => { + console.log('🚀 ~ openFaceScan ~ res-人脸识别:', res) res = res.data - console.log('🚀 ~ openFaceScan ~ res-人脸识别:', res, res.code) + console.log('🚀 ~ openFaceScan ~ res-人脸识别:', res.code) if (res.code == 200) { this.$refs.uToast.show({ message: '人脸识别成功', @@ -529,6 +523,10 @@ export default { }, fail(err) { console.log('🚀 ~ openFaceScan ~ 人脸识别失败', err) + this.$refs.uToast.show({ + message: err.errMsg, + duration: 1000 + }) } }) }, diff --git a/pages/YNEduApp/learnProj/imageStudy.vue b/pages/YNEduApp/learnProj/imageStudy.vue index 1a6fa6a..cd83aeb 100644 --- a/pages/YNEduApp/learnProj/imageStudy.vue +++ b/pages/YNEduApp/learnProj/imageStudy.vue @@ -29,7 +29,7 @@ export default { console.log('🚀 ~ onLoad ~ this.params:', this.path) console.log('🚀 ~ onLoad ~ this.params:', Number(opt.studyDuration), Number(opt.allStudyDuration)) - if (Number(opt.studyDuration) <= Number(opt.allStudyDuration)) { + if (Number(opt.studyDuration) < Number(opt.allStudyDuration)) { this.isEnd = false setTimeout(() => { this.countDown() @@ -77,11 +77,10 @@ export default { // let studyDuration = Number(this.params.studyDuration) this.timer = setInterval(() => { allStudyDuration-- - // studyDuration++ this.params.studyDuration++ - // this.$set(this.params, 'studyDuration', studyDuration) console.log('🚀 ~ countDown ~ this.params.studyDuration:', this.params.studyDuration) if (allStudyDuration <= 0) { + this.params.studyDuration = this.params.allStudyDuration this.isEnd = true clearInterval(this.timer) // 提示-学习时长已满 diff --git a/pages/YNEduApp/learnProj/pdfStudy.vue b/pages/YNEduApp/learnProj/pdfStudy.vue index 05c8045..d22a8e0 100644 --- a/pages/YNEduApp/learnProj/pdfStudy.vue +++ b/pages/YNEduApp/learnProj/pdfStudy.vue @@ -34,7 +34,7 @@ export default { } console.log('🚀 ~ onLoad ~ this.params:', this.path) console.log('🚀 ~ onLoad ~ this.params:', Number(opt.studyDuration), Number(opt.allStudyDuration)) - if (Number(opt.studyDuration) <= Number(opt.allStudyDuration)) { + if (Number(opt.studyDuration) < Number(opt.allStudyDuration)) { setTimeout(() => { this.countDown() }, 1000) @@ -62,14 +62,12 @@ export default { // 根据allStudyDuration 倒计时 countDown() { let allStudyDuration = Number(this.params.allStudyDuration) - Number(this.params.studyDuration) - // let studyDuration = Number(this.params.studyDuration) this.timer = setInterval(() => { allStudyDuration-- - // studyDuration++ this.params.studyDuration++ - // this.$set(this.params, 'studyDuration', studyDuration) console.log('🚀 ~ countDown ~ this.params.studyDuration:', this.params.studyDuration) if (allStudyDuration <= 0) { + this.params.studyDuration = this.params.allStudyDuration clearInterval(this.timer) setTimeout(() => { this.updStudyDuration() diff --git a/pages/YNEduApp/prac/exercises.vue b/pages/YNEduApp/prac/exercises.vue index c7946c6..ecbd815 100644 --- a/pages/YNEduApp/prac/exercises.vue +++ b/pages/YNEduApp/prac/exercises.vue @@ -17,7 +17,7 @@
-
+
{{ nowNum }}.{{ item.paperTopic }}{{ item.examType == 1 ? '(单选题)' : '(判断题)' }}
-
{{ option.optionIdent }}.{{ option.optionContent }}
+
+
+
{{ option.optionIdent }}.
+
{{ option.optionContent }}
+
+ +
@@ -46,15 +60,15 @@
正确答案:{{ item.correctGrade }}
你的答案:{{ item.select }}
-
+
答案解析:
{{ item.answerAnaly }}
-
-
{{ index + 1 }}. {{ item.paperTopic }}(多选题)
+
+
{{ nowNum }}. {{ item.paperTopic }}(多选题)
-
+
{{ option.optionIdent }}.
{{ option.optionContent }}
@@ -80,11 +94,11 @@
@@ -224,7 +238,7 @@ export default { isNew: 1, // 是否新练习 isOutOfOrder: 1, // 是否乱序 isError: false, // 是否错题消除 - nowNum: 0, // 当前题目索引 + nowNum: '', // 当前题目索引 showModal: false, showModalSelect: false, // 正确率 @@ -273,19 +287,13 @@ export default { }, methods: { // 获取题目-上方数量 - async getPracticeItData() { + getPracticeItData() { const params = { practiceId: this.practiceId, recordId: this.recordId, isNew: this.isNew || '', isMiss: this.isError ? '1' : '' } - // const res = await getPracticeItData(params) - // this.trueNum = res.data.trueNum - // this.falseNum = res.data.falseNum - // this.allNum = res.data.allNum - // this.nowNum = res.data.nowNum - // console.log('🚀 ~ getPracticeItData ~ res:', res) uni.request({ url: config.baseUrl + '/exam-student/studentPractice/getPracticeItData', method: 'post', @@ -308,7 +316,7 @@ export default { }) }, // 获取题目 - async getPracticeQuestion() { + getPracticeQuestion() { this.questionList = [] const params = { practiceId: this.practiceId, @@ -333,8 +341,43 @@ export default { success: res => { console.log('🚀 ~ getPracticeQuestion ~ res:', res) res = res.data - this.recordId = res.data.recordId ? res.data.recordId : this.recordId this.questionList.push(res.data) + console.log('🚀 ~ getPracticeQuestion ~ :', this.questionList[0]) + this.recordId = res.data.recordId ? res.data.recordId : this.recordId + if (res.data.selectAnswer) { + console.log('执行了--') + if (this.questionList[0].examType == 2) { + this.questionList[0].select = res.data.selectAnswer.split('') + this.questionList[0].isSelect = true + // 给selectAnswer选项如果正确添加正确标记, 错误添加错误标记并给正确选项添加标记 + this.questionList[0].listOption.forEach(item => { + if (res.data.selectAnswer.includes(item.optionIdent)) { + item.isSelect = true + } + if (res.data.correctGrade.includes(item.optionIdent)) { + item.isCorrect = true + } + if (item.isSelect && !this.questionList[0].correctGrade.includes(item.optionIdent)) { + item.isError = true + } + }) + } else { + this.questionList[0].select = res.data.selectAnswer + this.questionList[0].isSelect = true + // 给selectAnswer选项如果正确添加正确标记, 错误添加错误标记并给正确选项添加标记 + this.questionList[0].listOption.forEach(item => { + if (res.data.selectAnswer === item.optionIdent) { + item.isSelect = true + } + if (item.optionIdent === this.questionList[0].correctGrade) { + item.isCorrect = true + } + if (item.isSelect && item.optionIdent !== this.questionList[0].correctGrade) { + item.isError = true + } + }) + } + } }, fail: err => { console.log(err) @@ -342,15 +385,16 @@ export default { }) }, // 跳题 - async handleJump(item, index) { + handleJump(item, index) { console.log('🚀 ~ handleJump ~ item:', item, this.recordId) if (item === 'prev') { - this.nowNum -= 1 + this.nowNum-- } else if (item === 'next') { - this.nowNum += 1 + this.nowNum++ } else if (item === 'jump') { this.nowNum = index } + console.log('🚀 ~ handleJump ~ this.nowNum:', this.nowNum) this.currentIndex = index this.questionList = [] @@ -378,7 +422,7 @@ export default { res = res.data this.questionList.push(res.data) if (res.data.selectAnswer) { - if (this.questionList[0].examType === 2) { + if (this.questionList[0].examType == 2) { this.questionList[0].select = res.data.selectAnswer.split('') this.questionList[0].isSelect = true // 给selectAnswer选项如果正确添加正确标记, 错误添加错误标记并给正确选项添加标记 @@ -386,7 +430,7 @@ export default { if (res.data.selectAnswer.includes(item.optionIdent)) { item.isSelect = true } - if (item.optionIdent === this.questionList[0].correctGrade) { + if (res.data.correctGrade.includes(item.optionIdent)) { item.isCorrect = true } if (item.isSelect && !this.questionList[0].correctGrade.includes(item.optionIdent)) { @@ -417,7 +461,7 @@ export default { }) }, // 获取题目列表-弹框 - async getPracticeQuestionList() { + getPracticeQuestionList() { const params = { recordId: this.recordId, practiceId: this.practiceId, @@ -627,7 +671,7 @@ export default { } }, // 提交 - async handleSubmit() { + handleSubmit() { // 暂停时间 clearInterval(this.intervalId) console.log('提交') @@ -750,7 +794,7 @@ export default { }, 500) }, // 打开题目选择弹框 - async openSelect() { + openSelect() { this.showModalSelect = true // const res = await this.getPracticeQuestionList() // console.log('🚀 ~ openSelect ~ res:', res) @@ -882,6 +926,8 @@ export default { } .question-wrapper { + max-height: 500px; + overflow: auto; padding: 30px; color: #08428d; @@ -901,11 +947,15 @@ export default { background: #ffffff; border-radius: 8px; overflow: auto; - .label { - display: flex; - align-items: center; - justify-content: flex-start; - text-align: left; + .label-wrapper { + max-height: 100px; + overflow: auto; + .label { + display: flex; + align-items: center; + justify-content: flex-start; + text-align: left; + } } } .active { diff --git a/pages/YNEduApp/user/faceScan.vue b/pages/YNEduApp/user/faceScan.vue index f7c17c8..97e1162 100644 --- a/pages/YNEduApp/user/faceScan.vue +++ b/pages/YNEduApp/user/faceScan.vue @@ -22,8 +22,8 @@
- - + +
@@ -36,8 +36,8 @@
收集您的信息,以实现在考试中检测是否是您本人操作,请务必录入您本人的面部信息
- - + +