From 412a796ecb240ef1928adae4352ca282c119b1a6 Mon Sep 17 00:00:00 2001 From: yuk255 Date: Tue, 14 Oct 2025 22:03:55 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E4=BD=9C=E4=B8=9A=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modules/userCenter.ts | 55 +- src/components/profile/HomeworkContent.vue | 1454 ++++++++++++++++++++ src/views/Profile.vue | 638 +++------ 3 files changed, 1670 insertions(+), 477 deletions(-) create mode 100644 src/components/profile/HomeworkContent.vue diff --git a/src/api/modules/userCenter.ts b/src/api/modules/userCenter.ts index d868f0a..f954194 100644 --- a/src/api/modules/userCenter.ts +++ b/src/api/modules/userCenter.ts @@ -1,15 +1,58 @@ // 学员中心相关API接口 -import { ApiRequest } from '../request' - +import { ApiRequest } from "../request"; +// 活动相关API export class ActivityListApi { static async getActivityList(): Promise { - return ApiRequest.get('/aiol/aiolActivity/list') + return ApiRequest.get("/aiol/aiolActivity/list"); + } +} +// 用户信息相关API +export class UserInfoApi { + static async editUserInfo(data: any): Promise { + return ApiRequest.post("/aiol/aiolUser/edit_profile", data); } } -export class UserInfoApi { - static async editUserInfo(data: any): Promise { - return ApiRequest.post('/aiol/aiolUser/edit_profile', data) +// 作业相关API +export class HomeworkApi { + static async getHomeworkList(params: { type: number }): Promise { + try { + return await ApiRequest.get("/aiol/aiolHomework/myHomeworkList", params); + } catch (error) { + console.error("Error fetching homework list:", error); + throw error; + } + } + + static async submitHomework(data: any): Promise { + try { + return await ApiRequest.post("/aiol/aiolHomework/submit", data); + } catch (error) { + console.error("Error submitting homework:", error); + throw error; + } + } +} +// 考试相关API +export class ExamApi { + static async getExamList(params: { type: number }): Promise { + try { + return await ApiRequest.get("/aiol/aiolExam/myExamList", params); + } catch (error) { + console.error("Error fetching exam list:", error); + throw error; + } + } +} +// 练习相关API +export class PracticeApi { + static async getExamList(params: { type: number }): Promise { + try { + return await ApiRequest.get("/aiol/aiolExam//myPracticeList", params); + } catch (error) { + console.error("Error fetching practice list:", error); + throw error; + } } } diff --git a/src/components/profile/HomeworkContent.vue b/src/components/profile/HomeworkContent.vue new file mode 100644 index 0000000..f3dd697 --- /dev/null +++ b/src/components/profile/HomeworkContent.vue @@ -0,0 +1,1454 @@ + + + + + diff --git a/src/views/Profile.vue b/src/views/Profile.vue index 56cab2c..f365413 100644 --- a/src/views/Profile.vue +++ b/src/views/Profile.vue @@ -134,269 +134,7 @@ -
- -
- 全部作业 - 未完成 - 已完成 - - - 草稿箱 - -
- -
- - - - - -
- - -
- -
-
-
- 教师头像 -
- {{ detailAssignment.teacherName }} - {{ detailAssignment.assignTime }} -
-
- - - - - {{ detailAssignment.status === '未完成' || detailAssignment.status === '待提交' ? '未完成' : - (detailAssignment.status === '已完成' ? '已完成' : '541人已完成') }} - - -
- - -
-
- {{ detailAssignment.title }} -
- - {{ detailAssignment.description }} - -
-
- - -
-
- -
-
- -
-
- - 文件名称.PDF - -
-
- - 文件名称.PDF - -
-
- -
这里是课程名称!!! 查看详情>
- - - -
- -
-
-
- - -
-
- -
- -
- -
-
-
- 教师头像 -
- {{ draftAssignment.teacherName }} - {{ draftAssignment.assignTime }} -
-
- - - - {{ draftAssignment.status === '未完成' || draftAssignment.status === '待提交' ? '未完成' : - (draftAssignment.status === '已完成' ? '已完成' : '541人已完成') }} - - -
- - -
- {{ draftAssignment.title }} -
- - {{ draftAssignment.description }} - -
-
- - -
-
- -
-
- -
-
- - 文件名称.PDF - -
-
- - 文件名称.PDF - -
-
- -
这里是课程名称!!! 查看详情>
- - -
-
- 上传作业 -
-
- 重新编辑 -
-
-
-
- - -
-
- -
-
-
- -
- {{ assignment.teacherName }} - {{ assignment.assignTime }} -
-
- - - {{ assignment.status === '未完成' || assignment.status === '待提交' ? '未完成' : '已完成' }} - - -
- - - -
- -
- - {{ assignment.title }} -
- - {{ assignment.description }} - -
-
- - -
- - - -
- -
- -
- - 541人已完成 -
- - - -
- - -
- - - - -
- - -
-
-
+
@@ -849,58 +587,15 @@
- - -
-
- -
-
- - - -