From 3dbf1c081f7b959618935a10c81e8cca2692284b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A6=BA=E7=8B=A8?= <18119604035@163.com> Date: Thu, 29 Jun 2023 17:21:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E5=88=9D=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/course/index.module.scss | 61 +++++++++++++++++++++++++++ src/pages/course/index.tsx | 68 +++++++++++++++++++++++++++++- 2 files changed, 127 insertions(+), 2 deletions(-) diff --git a/src/pages/course/index.module.scss b/src/pages/course/index.module.scss index 6cb2518..43306cb 100644 --- a/src/pages/course/index.module.scss +++ b/src/pages/course/index.module.scss @@ -5,4 +5,65 @@ background-color: #ff4d4f; box-sizing: border-box; padding: 8px 20px 20px 20px; + .title { + width: 100%; + height: 48px; + font-size: 16px; + font-weight: 600; + color: rgba(255, 255, 255, 0.88); + line-height: 24px; + text-align: left; + text-overflow: -o-ellipsis-lastline; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + line-clamp: 2; + -webkit-box-orient: vertical; + } + .info-content { + width: 100%; + height: 80px; + display: flex; + flex-direction: row; + align-items: center; + .info { + flex: 1; + display: flex; + flex-direction: column; + text-align: left; + .record { + width: auto; + height: 20px; + font-size: 14px; + font-weight: 400; + color: rgba(255, 255, 255, 0.88); + line-height: 20px; + margin-top: 10px; + strong { + font-size: 20px; + } + } + .type { + width: auto; + height: 12px; + font-size: 12px; + font-weight: 400; + color: #ffffff; + line-height: 12px; + margin-top: 20px; + } + } + + .progress-box { + width: 80px; + height: 80px; + .num { + font-size: 16px; + font-weight: 600; + color: #ffffff; + line-height: 16px; + } + } + } } diff --git a/src/pages/course/index.tsx b/src/pages/course/index.tsx index 14053aa..0903dbc 100644 --- a/src/pages/course/index.tsx +++ b/src/pages/course/index.tsx @@ -1,5 +1,5 @@ import { useEffect, useState } from "react"; -import { Image, ProgressBar, SpinLoading } from "antd-mobile"; +import { Image, ProgressCircle, SpinLoading } from "antd-mobile"; import styles from "./index.module.scss"; import { useNavigate, useParams } from "react-router-dom"; import backIcon from "../../assets/images/commen/icon-back-n.png"; @@ -50,7 +50,71 @@ const CoursePage = () => { onClick={() => navigate(-1)} /> -
+
+
{course.title}
+
+
+
+ 已学完课时 + + {learnRecord ? learnRecord.finished_count : 0} + / {course.class_hour} +
+ {course.is_required === 1 && ( +
必修课
+ )} + {course.is_required === 0 && ( +
选修课
+ )} +
+
+ {JSON.stringify(learnRecord) === "{}" && + JSON.stringify(learnHourRecord) === "{}" && ( + + 0% + + )} + {JSON.stringify(learnRecord) === "{}" && + JSON.stringify(learnHourRecord) !== "{}" && ( + + 1% + + )} + {JSON.stringify(learnRecord) !== "{}" && + JSON.stringify(learnHourRecord) !== "{}" && ( + + + {Math.floor(learnRecord.progress / 100)}% + + + )} +
+
+
); };