diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 42f22ec..05cbfc3 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -18,8 +18,14 @@ export default { methods:{ async jumpPage(){ const submissionData={ + // jwcode:91000001,//有成绩的 + // jwcode:90098888,//有成绩的 // jwcode:90098889,//有成绩的 - jwcode:90098892,//没有成绩的 + // jwcode:90098890,//有成绩的 + jwcode:90098891,//没有成绩的 + // jwcode:90098892,//没有成绩的 + // jwcode:90098893,//没有成绩的 + // jwcode:90098894,//没有成绩的 }; localStorage.setItem('submissionData', JSON.stringify(submissionData)); console.log('存储的数据:', localStorage.getItem('submissionData')); @@ -73,14 +79,7 @@ div { } .center:hover .image { - transform: scale(1.2); /* 鼠标悬停时放大 */ + transform: scale(1.2); filter: brightness(1.1); } -/* -.text { - position: relative; - display: flex; - justify-content: center; - align-items: center; -} */ \ No newline at end of file diff --git a/src/views/ProblemView.vue b/src/views/ProblemView.vue index afab833..35bf8ae 100644 --- a/src/views/ProblemView.vue +++ b/src/views/ProblemView.vue @@ -7,10 +7,14 @@ export default { showDialog: false, currentPage: 1, answers:{}, + page:1, } }, computed:{ currentProblem() { + if (!this.problems || !this.problems.slice) { + return null; + } const startIndex = (this.currentPage - 1) * 2; return this.problems.slice(startIndex, startIndex + 2); }, @@ -56,6 +60,39 @@ export default { getAnswer(id) { return this.answers[id]; }, + rightBefore(){ + this.page=1; + }, + rightNext(){ + this.page=2; + }, + toQuestion(index){ + this.currentPage = Math.ceil(index/2); + }, + getOption(problem,option) { + const userAnswer = problem.userAnswer; + const correctAnswer = problem.correctAnswer; + if(userAnswer === option){ + if(correctAnswer !== option){ + return 'red'; + } + } + if (correctAnswer === option) { + return 'green'; + } + }, + getNumber(problem) { + if (!problem) return; + const userAnswer = problem.userAnswer; + const correctAnswer = problem.correctAnswer; + + if (correctAnswer !== userAnswer) { + return 'red'; + } + if (correctAnswer === userAnswer) { + return 'answered'; + } + } }, async mounted(){ await this.problemAnswers(); @@ -73,8 +110,7 @@ export default {

全方面评估您的股票投资知识水平,获取个性化学习建议

- @@ -297,7 +295,13 @@ export default { closeTeamPrompt() { this.showTeam = true; }, - + closeSubmit() { + this.showTeam = false; + }, + // submitAnswers() { + // this.showTeam = false; + // }, + // 获取题目的答案 getAnswer(questionId) { return this.answers[questionId] || ''; @@ -611,7 +615,6 @@ body { margin-right: 15px; width: 18px; height: 18px; - accent-color: #3b82f6; } .option .label { font-size: 1.1em; @@ -683,7 +686,6 @@ body { } .pagination-btn:disabled { background-color: #4b5563; - cursor: not-allowed; } .nav-buttons { display: flex; @@ -706,10 +708,10 @@ body { background-color: #2563eb; } .nav-btn.prev { - background-color: #4b5563; + background-color: #3b82f6;; } .nav-btn.prev:hover { - background-color: #374151; + background-color: #2563eb; } .nav-btn:disabled { background-color: #4b5563; @@ -777,16 +779,6 @@ body { z-index: 1000; } -.dialog-overlay { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: rgba(0, 0, 0, 0.5); - backdrop-filter: blur(5px); -} - .dialog-content { position: relative; background: white; @@ -798,16 +790,14 @@ body { text-align: center; z-index: 1001; } -.team-prompt { - position: fixed; +.dialog-overlay { + position: absolute; top: 0; left: 0; width: 100%; height: 100%; - display: flex; - justify-content: center; - align-items: center; - z-index: 1000; + background: rgba(0, 0, 0, 0.5); + backdrop-filter: blur(5px); } .dialog-content h3 {