From e34f9f697d56d5dd35e2764f5bbbf8b1e29cc803 Mon Sep 17 00:00:00 2001 From: chenzhen <19553350107@163.com> Date: Thu, 13 Nov 2025 09:46:36 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E5=86=99=E4=BA=86=E9=94=99=E9=A2=98?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E7=9A=84=E9=A1=B5=E9=9D=A2=E8=AE=BE=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/HomeView.vue | 6 +- src/views/ProblemView.vue | 181 ++++++++++++++++++++++++++++++++++++---------- src/views/TextView.vue | 56 +++++++------- 3 files changed, 171 insertions(+), 72 deletions(-) diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 62ea300..42f22ec 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -18,8 +18,8 @@ export default { methods:{ async jumpPage(){ const submissionData={ - // jwcode:90098890, - jwcode:90098888 + // jwcode:90098889,//有成绩的 + jwcode:90098892,//没有成绩的 }; localStorage.setItem('submissionData', JSON.stringify(submissionData)); console.log('存储的数据:', localStorage.getItem('submissionData')); @@ -40,7 +40,7 @@ export default { }, async mounted(){ localStorage.removeItem('submissionData'); - } + }, } diff --git a/src/views/ProblemView.vue b/src/views/ProblemView.vue index d96e63b..afab833 100644 --- a/src/views/ProblemView.vue +++ b/src/views/ProblemView.vue @@ -1,3 +1,67 @@ + - + \ No newline at end of file diff --git a/src/views/TextView.vue b/src/views/TextView.vue index 20199b8..e8d79cb 100644 --- a/src/views/TextView.vue +++ b/src/views/TextView.vue @@ -29,7 +29,6 @@
-
{{ question.id }}、 {{ question.stem }} @@ -160,14 +159,14 @@ @click="changeNavPage(1)" :class="{ active: page === 1 }" > - 第一页 + 上一页
@@ -208,6 +207,11 @@ export default { showTeam: false, }; }, + created() { + for (let i = 1; i <= this.totalQuestions; i++) { + this.$set(this.answers, i, 0) + } + }, computed: { // 当前页显示的两个题目 currentQuestions() { @@ -221,7 +225,9 @@ export default { return Math.ceil(this.questions.length / this.questionsPerPage); }, answeredCount() { - return Object.keys(this.answers).length; + return Object.keys(this.answers).filter( + key => this.answers[key] !== 0 + ).length }, completionRate() { return (this.answeredCount / this.totalQuestions) * 100; @@ -242,8 +248,6 @@ export default { this.questions = response.data.data.list; } catch (error) { console.error('获取题目失败:', error); - // 如果接口失败,使用默认题目 - this.questions = this.getDefaultQuestions(); } }, @@ -371,14 +375,9 @@ export default { // 如果倒计时结束,自动提交试卷 if (remainingMinutes <= 0 && !this.isSubmitted) { this.isSubmitted = true; - this.autoSubmitTest(); + this.submitAnswers(); } }, - // 自动提交试卷 - async autoSubmitTest() { - alert('考试时间已结束,系统将自动提交试卷!'); - await this.submitAnswers(); - }, // 提交答案到后端 async submitAnswers() { try { @@ -462,7 +461,7 @@ export default { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; - margin: auto; + margin: auto 30px; } .question-number { @@ -474,7 +473,6 @@ export default { justify-content: center; font-weight: bold; cursor: pointer; - transition: all 0.3s ease; position: relative; } @@ -631,22 +629,22 @@ body { } .time-module { border: #274779 solid 2px; - border-radius: 50px; + border-radius: 30px; padding: 15px; margin-bottom: 20px; background-color: #2f374d; } .question-nav { border: #274779 solid 2px; - border-radius: 50px; - padding: 15px; + border-radius: 30px; + padding: 15px 0 15px 19px ; margin-bottom: 20px; background-color: #2f374d; } .statistics { height: 150px; border: #274779 solid 2px; - border-radius: 50px; + border-radius: 30px; padding: 15px; margin-bottom: 20px; background-color: #2f374d; @@ -655,7 +653,7 @@ body { margin-bottom: 15px; color: #f1f5f9; font-size: 1.2em; - border-bottom: 1px solid #374151; + border-bottom: 2px solid #274779; padding-bottom: 10px; } .countdown { @@ -665,9 +663,9 @@ body { } .pagination { display: flex; - justify-content: center; - margin-top: 20px; - gap: 10px; + /* justify-content: center; */ + margin: 30px 148px 5px; + gap: 20px; } .pagination-btn { padding: 8px 15px; @@ -678,6 +676,7 @@ body { font-weight: bold; cursor: pointer; transition: all 0.3s ease; + margin: auto 20px; } .pagination-btn:hover { background-color: #2563eb; @@ -699,8 +698,6 @@ body { background-color: #3b82f6; color: white; font-weight: bold; - cursor: pointer; - transition: all 0.3s ease; display: flex; align-items: center; gap: 5px; @@ -720,13 +717,12 @@ body { } .statistics-item { display: flex; + font-size: larger; justify-content: space-between; - margin-bottom: 10px; - padding-bottom: 10px; - border-bottom: 1px solid #374151; -} -.statistics-item:last-child { - border-bottom: none; + margin-top: 30px; + padding-top: 10px; + padding-bottom: 2px; + border-bottom: 2px solid #274779; } .statistics-label { color: #e5e7eb;