From bd3e6d5fb7a15f68c23f1f96404a617e5b5c0514 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Mon, 18 Nov 2024 16:18:18 +0800 Subject: [PATCH] fix --- src/pages/myReview/theoryReview/index.vue | 12 +++++++++++- src/setting.js | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/pages/myReview/theoryReview/index.vue b/src/pages/myReview/theoryReview/index.vue index c0bbb5e..6b147c7 100644 --- a/src/pages/myReview/theoryReview/index.vue +++ b/src/pages/myReview/theoryReview/index.vue @@ -315,6 +315,7 @@ export default { const { questionTypes: types, difficults } = QuesConst const { numToLetter } = Util const paper = [] + let firstNotReview outline.map(e => { if (e.userAnswerList && e.userAnswerList.length) { e.shrink = false @@ -381,7 +382,10 @@ export default { n.isCorrect = n.notScored ? 5 : (n.userScore && n.questionScore === n.userScore ? 1 : (rightLen ? 3 : 2)) } else if (type === 'essay') { // 简答题 if (!n.userScore) n.userScore = '' - if (isNaN(n.reviewScore)) n.reviewScore = '' + if (isNaN(n.reviewScore)) { + n.reviewScore = '' + if (!firstNotReview) firstNotReview = n.id // 第一个未评阅的试题 + } this.handleIsCorrect(n) } n.originUserScore = n.notScored ? '-' : n.reviewScore @@ -398,6 +402,12 @@ export default { // } this.paper = paper + // 如果有未评阅的试题,则加载完后自动滚动到该试题的位置 + firstNotReview && this.$nextTick(() => { + const el = document.querySelector('#ques' + firstNotReview) + el && this.scrollToSmooth(el.offsetTop - document.querySelector('#middle').offsetTop, 200) + }) + this.loading = false } catch (e) { this.loading = false diff --git a/src/setting.js b/src/setting.js index f0ca3c3..c4335ad 100644 --- a/src/setting.js +++ b/src/setting.js @@ -6,7 +6,7 @@ const isPro = location.host.includes('huorantech.cn') //正式服 let host = location.origin if (isDev) { host = 'http://192.168.31.51:9000' - const ips = ['http://192.168.31.217:9000', 'http://192.168.31.51:9000', 'http://121.37.12.51'] + const ips = ['http://192.168.31.217:9000', 'http://192.168.31.51:9000', 'https://huorantech.cn'] host = ips[+localStorage.getItem('ip')] }