Browse Source

前台提测通过(一)

milestone-20251107-股票知识测评
chenzhen 2 months ago
parent
commit
585dc8d098
  1. 9
      src/views/HomeView.vue
  2. 7
      src/views/ProblemView.vue
  3. 7
      src/views/ReportView.vue
  4. 77
      src/views/TextView.vue

9
src/views/HomeView.vue

@ -21,9 +21,12 @@ export default {
// jwcode:90098889,//
// jwcode:90098890,//
// jwcode:90098891,//
jwcode:90098892,//
// jwcode:90098893,//
// jwcode:90098894,//
// jwcode:90098892,//
// jwcode:90098893,//
// jwcode:90098894,//
// jwcode:90098895,//
jwcode:90098896,//
// jwcode:90098897,//
};
localStorage.setItem('submissionData', JSON.stringify(submissionData));
console.log('存储的数据:', localStorage.getItem('submissionData'));

7
src/views/ProblemView.vue

@ -172,8 +172,8 @@ export default {
</div>
</div>
<div class="button-right">
<button class="right-before-btn" @click="rightBefore">上一页</button>
<button class="right-next-btn" @click="rightNext">下一页</button>
<button class="right-before-btn" @click="rightBefore" :disabled="page === 1">上一页</button>
<button class="right-next-btn" @click="rightNext" :disabled="page === 2">下一页</button>
</div>
</div>
<div class="button-right-bottom">
@ -417,5 +417,8 @@ p{
margin-top: 362px;
border:none;
}
.right-before-btn:disabled,.right-next-btn:disabled{
background-color: #4b5563;
}
</style>

7
src/views/ReportView.vue

@ -37,8 +37,8 @@
</div>
</div>
<div class="left">
<p>最好的投资是投资自己而最好的课程是是适合你的课程</p><br>
<p>人无法赚到认知以外的钱请根据测试结果聚焦你的核心短板进行强化扩大你的认知边界</p>
<p>最好的投资是投资自己而最好的课程是是适合你的课程</p><br>
<p>人无法赚到认知以外的钱请根据测试结果聚焦你的核心短板进行强化扩大你的认知边界</p>
</div>
<div class="right-down">
<div v-show="score==100">
@ -53,7 +53,8 @@
</div>
</div>
<div class="content-button">
<button class="check-btn" @click="goCheck">查看错题</button>
<button class="check-btn" @click="goCheck" v-show="score==100">查看题目</button>
<button class="check-btn" @click="goCheck" v-show="score!=100">查看错题</button>
<button class="buy-btn" @click="goBuy">前往购买</button>
</div>
</div>

77
src/views/TextView.vue

@ -156,15 +156,17 @@
class="pagination-btn"
@click="changeNavPage(1)"
:class="{ active: page === 1 }"
:disabled="page === 1"
>
上一页
上一页
</button>
<button
class="pagination-btn"
@click="changeNavPage(2)"
:class="{ active: page === 2 }"
:disabled="page === 2"
>
下一页
下一页
</button>
</div>
</div>
@ -192,7 +194,6 @@ export default {
questions: [], //
currentPage: 1,
page: 1,
questionsPerPage: 2, // 2
answers: {},
startTime: new Date(),
countdownMinutes: 30,
@ -213,14 +214,14 @@ export default {
computed: {
//
currentQuestions() {
const startIndex = (this.currentPage - 1) * this.questionsPerPage;
const startIndex = (this.currentPage - 1) * 2;
return [
this.questions[startIndex],
this.questions[startIndex + 1]
].filter(Boolean);
];
},
totalPages() {
return Math.ceil(this.questions.length / this.questionsPerPage);
return Math.ceil(this.questions.length / 2);
},
answeredCount() {
return Object.keys(this.answers).filter(
@ -249,24 +250,24 @@ export default {
}
},
// - 50
getDefaultQuestions() {
//
const defaultQuestions = [];
// // - 50
// getDefaultQuestions() {
// //
// const defaultQuestions = [];
for (let i = 1; i <= 50; i++) {
defaultQuestions.push({
id: i,
stem: `这是第${i}个股票知识测试题目`,
A: `选项A - 第${i}`,
B: `选项B - 第${i}`,
C: `选项C - 第${i}`,
D: `选项D - 第${i}`
});
}
// for (let i = 1; i <= 50; i++) {
// defaultQuestions.push({
// id: i,
// stem: `${i}`,
// A: `A - ${i}`,
// B: `B - ${i}`,
// C: `C - ${i}`,
// D: `D - ${i}`
// });
// }
return defaultQuestions;
},
// return defaultQuestions;
// },
//
getQuestionIndex(questionId) {
@ -314,15 +315,12 @@ export default {
//
getQuestionStatusClass(questionNumber) {
const isCurrent = this.currentQuestionIds.includes(questionNumber);
const isAnswered = !!this.answers[questionNumber];
if (isCurrent) {
return 'current';
} else if (isAnswered) {
if (isAnswered) {
return 'answered';
} else {
return 'normal';
return 'unanswered';
}
},
@ -337,14 +335,14 @@ export default {
this.currentPage = newPage;
// 25
const startQuestion = (newPage - 1) * this.questionsPerPage + 1;
const startQuestion = (newPage - 1) * 2 + 1;
this.page = Math.ceil(startQuestion / 25);
}
},
//
goToPageByQuestion(questionNumber) {
const page = Math.ceil(questionNumber / this.questionsPerPage);
const page = Math.ceil(questionNumber / 2);
this.changePage(page);
//
@ -356,6 +354,9 @@ export default {
if (this.currentPage > 1) {
this.currentPage--;
}
if (this.currentPage < 13) {
this.page=1;
}
},
//
@ -363,6 +364,9 @@ export default {
if (this.currentPage < this.totalPages) {
this.currentPage++;
}
if(this.currentPage > 13){
this.page=2;
}
},
//
@ -480,7 +484,7 @@ export default {
position: relative;
}
.question-number.normal {
.question-number.unanswered {
background-color: #374151;
border: 1px solid #4b5563;
color: #e5e7eb;
@ -492,16 +496,13 @@ export default {
color: white;
}
.question-number.current {
/* .question-number.current {
background-color: #3b82f6;
border: 2px solid #2563eb;
color: white;
transform: scale(1.1);
}
} */
.question-number:hover {
transform: scale(1.05);
}
.question-text {
z-index: 1;
@ -511,6 +512,10 @@ export default {
background-color: #2563eb;
transform: scale(1.05);
}
.pagination-btn:disabled{
background-color: #4b5563;
color: #e5e7eb;
}
* {
margin: 0;
@ -671,7 +676,7 @@ body {
gap: 20px;
}
.pagination-btn {
padding: 8px 15px;
padding: 8px;
border-radius: 8px;
border: none;
background-color: #3b82f6;

Loading…
Cancel
Save