web-学习

This commit is contained in:
2025-10-24 18:28:35 +08:00
parent 8968409b2d
commit bc84bd82cc
16 changed files with 1090 additions and 239 deletions

View File

@@ -64,6 +64,7 @@
size="large"
:icon="isCollected ? StarFilled : Star"
@click="handleCollect"
:type="isCollected ? 'success' : 'default'"
>
{{ isCollected ? '已收藏' : '收藏课程' }}
</el-button>
@@ -293,7 +294,6 @@ async function checkCollectionStatus() {
try {
const res = await userCollectionApi.isCollected(
userInfo.value.id,
CollectionType.COURSE,
props.courseId
);
@@ -310,10 +310,10 @@ async function loadLearningProgress() {
if (!userInfo.value?.id) return;
try {
const res = await learningRecordApi.getRecordList({
const res = await learningRecordApi.getCourseLearningRecord({
userID: userInfo.value.id,
resourceType: 2, // 课程类型
resourceID: props.courseId
resourceType: 2, // 课程
courseID: props.courseId
});
if (res.success && res.dataList && res.dataList.length > 0) {
@@ -440,10 +440,14 @@ function formatDuration(minutes?: number): string {
}
.back-header {
position: sticky;
top: 0;
z-index: 100;
padding: 16px 24px;
background: #fff;
border-bottom: 1px solid #e4e7ed;
margin-bottom: 0;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.loading {