diff --git a/web/src/components/QuestionProgress.tsx b/web/src/components/QuestionProgress.tsx index 165b7b3..2ea9232 100644 --- a/web/src/components/QuestionProgress.tsx +++ b/web/src/components/QuestionProgress.tsx @@ -1,8 +1,5 @@ import React from 'react' -import { Progress, Space, Typography } from 'antd' -import { CheckOutlined, CloseOutlined } from '@ant-design/icons' - -const { Text } = Typography +import { Progress, Card } from 'antd' interface QuestionProgressProps { currentIndex: number @@ -14,33 +11,40 @@ interface QuestionProgressProps { const QuestionProgress: React.FC = ({ currentIndex, totalQuestions, - correctCount, - wrongCount, }) => { if (totalQuestions === 0) return null + const percent = Math.round(((currentIndex + 1) / totalQuestions) * 100) + return ( -
+ `${currentIndex + 1} / ${totalQuestions}`} + style={{ + fontSize: '14px', + fontWeight: 600, + }} /> -
- - - 正确:{correctCount} - - - 错误:{wrongCount} - - -
-
+ ) } diff --git a/web/src/pages/Question.module.less b/web/src/pages/Question.module.less index 71cf997..2a51c58 100644 --- a/web/src/pages/Question.module.less +++ b/web/src/pages/Question.module.less @@ -14,12 +14,63 @@ display: flex; justify-content: space-between; align-items: center; - margin-bottom: 24px; + margin-bottom: 20px; + background: rgba(255, 255, 255, 0.9); + backdrop-filter: blur(30px) saturate(180%); + -webkit-backdrop-filter: blur(30px) saturate(180%); + padding: 16px 20px; + border-radius: 16px; + box-shadow: + 0 2px 12px rgba(0, 0, 0, 0.05), + 0 1px 4px rgba(0, 0, 0, 0.03), + 0 0 0 1px rgba(0, 0, 0, 0.03); + border: 0.5px solid rgba(0, 0, 0, 0.04); + + .backButton { + color: #007aff; + font-weight: 500; + padding: 4px 12px; + + &:hover { + color: #0051d5; + background: rgba(0, 122, 255, 0.08); + } + } .title { color: #1d1d1f !important; margin: 0 !important; font-weight: 700; + font-size: 18px !important; + flex: 1; + text-align: center; + } + + .statsGroup { + display: flex; + gap: 16px; + align-items: center; + } + + .statItem { + display: flex; + flex-direction: column; + align-items: center; + gap: 2px; + } + + .statLabel { + font-size: 11px; + color: #86868b; + font-weight: 500; + text-transform: uppercase; + letter-spacing: 0.5px; + } + + .statValue { + font-size: 20px; + font-weight: 700; + line-height: 1; } } @@ -75,12 +126,41 @@ } .header { - flex-direction: column; + flex-wrap: wrap; gap: 12px; - align-items: flex-start; + padding: 12px 16px; + border-radius: 12px; + + .backButton { + order: 1; + flex: 0 0 auto; + } .title { - font-size: 20px !important; + order: 2; + flex: 1 1 100%; + text-align: center; + font-size: 16px !important; + } + + .statsGroup { + order: 3; + flex: 1 1 100%; + justify-content: center; + gap: 24px; + } + + .statItem { + flex-direction: row; + gap: 6px; + } + + .statLabel { + font-size: 12px; + } + + .statValue { + font-size: 18px; } } @@ -101,13 +181,35 @@ } } +// 响应式设计 - 平板 +@media (min-width: 769px) and (max-width: 1024px) { + .container { + padding: 24px; + } + + .header { + .title { + font-size: 20px !important; + } + } +} + // 响应式设计 - PC端 -@media (min-width: 769px) { +@media (min-width: 1025px) { .container { padding: 32px; } .header { - margin-bottom: 32px; + margin-bottom: 24px; + padding: 18px 24px; + + .title { + font-size: 22px !important; + } + + .statValue { + font-size: 24px; + } } } diff --git a/web/src/pages/Question.tsx b/web/src/pages/Question.tsx index 1846a74..ff99473 100644 --- a/web/src/pages/Question.tsx +++ b/web/src/pages/Question.tsx @@ -253,12 +253,27 @@ const QuestionPage: React.FC = () => {
{/* 头部 */}
- AnKao 刷题 +
+
+ 正确 + {correctCount} +
+
+ 错误 + {wrongCount} +
+
{/* 进度条 */}