|
|
@@ -12,22 +12,12 @@
|
|
|
<div class="portal-card-title-main">我的课程</div>
|
|
|
</div>
|
|
|
<el-divider class="portal-card-divider"/>
|
|
|
- <div v-if="isLogin" class="portal-card-main" :style="{height: (courseRowHeight - 63) + 'px'}">
|
|
|
- <el-card v-for="i in 6" :key="i" class="portal-my-course-card-item" shadow="hover">
|
|
|
- <div class="portal-my-course-card-item-body">
|
|
|
- <div style="width: 50px; height: 50px;margin-right: 10px;flex-shrink: 0">
|
|
|
- <img alt="err" src="@/assets/myTest.png" style="width: 100%; height: 100%;">
|
|
|
- </div>
|
|
|
- <div class="portal-my-course-card-item-main">
|
|
|
- <div>软件工程与计算</div>
|
|
|
- <div>未开始</div>
|
|
|
- <div>开课时间:2000-1-1</div>
|
|
|
- <div>刘钦</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-card>
|
|
|
+ <div v-if="isLogin" :style="{height: (courseRowHeight - 63) + 'px'}" class="portal-card-main">
|
|
|
+ <div class="portal-my-card-main">
|
|
|
+ <MyCourseCard :courseVO="course" v-for="course in myCourseList" :key="course.id"/>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div v-else class="portal-card-main" :style="{height: (courseRowHeight - 63) + 'px'}">
|
|
|
+ <div v-else :style="{height: (courseRowHeight - 63) + 'px', marginTop: (courseRowHeight / 2 - 120) + 'px'}" class="portal-card-main">
|
|
|
<div>
|
|
|
<svg class="icon" height="128" viewBox="0 0 1024 1024" width="128" xmlns="http://www.w3.org/2000/svg">
|
|
|
<path
|
|
|
@@ -65,7 +55,7 @@
|
|
|
<div class="portal-card-title-main">我的测试</div>
|
|
|
</div>
|
|
|
<el-divider class="portal-card-divider"/>
|
|
|
- <div v-if="isLogin" class="portal-card-main" :style="{height: (testRowHeight - 63) + 'px'}">
|
|
|
+ <div v-if="isLogin" :style="{height: (testRowHeight - 63) + 'px'}" class="portal-card-main">
|
|
|
<el-card v-for="i in 6" :key="i" class="portal-my-course-card-item" shadow="hover">
|
|
|
<div class="portal-my-course-card-item-body">
|
|
|
<div style="width: 50px; height: 50px;margin-right: 10px;flex-shrink: 0">
|
|
|
@@ -80,7 +70,7 @@
|
|
|
</div>
|
|
|
</el-card>
|
|
|
</div>
|
|
|
- <div v-else class="portal-card-main" :style="{height: (testRowHeight - 63) + 'px'}">
|
|
|
+ <div v-else :style="{height: (testRowHeight - 63) + 'px', marginTop: (testRowHeight / 2 - 120) + 'px'}" class="portal-card-main">
|
|
|
<div>
|
|
|
<svg class="icon" height="128" viewBox="0 0 1024 1024" width="128" xmlns="http://www.w3.org/2000/svg">
|
|
|
<path
|
|
|
@@ -137,11 +127,12 @@ import CourseCard from "@/components/CourseCard";
|
|
|
import GlobalFooter from "@/components/GlobalFooter";
|
|
|
import EvalCard from "@/components/EvalCard";
|
|
|
import CoderCard from "@/components/CoderCard";
|
|
|
+import MyCourseCard from "@/views/PortalPage/components/MyCourseCard";
|
|
|
|
|
|
export default {
|
|
|
//属性
|
|
|
name: "PortalPage",
|
|
|
- components: {CoderCard, GlobalFooter, CourseCard, InfoCard, CarouselCard, GlobalHeader, EvalCard},
|
|
|
+ components: { CoderCard, GlobalFooter, CourseCard, InfoCard, CarouselCard, GlobalHeader, EvalCard, MyCourseCard },
|
|
|
data() {
|
|
|
return {
|
|
|
isLogin: this.$store.state.user.token !== undefined,
|
|
|
@@ -151,6 +142,8 @@ export default {
|
|
|
evalExamList: [],
|
|
|
courseList: [],
|
|
|
coderExamList: [],
|
|
|
+ myCourseList: [],
|
|
|
+ myTestList: [],
|
|
|
courseRowHeight: 0,
|
|
|
testRowHeight: 0,
|
|
|
};
|
|
|
@@ -168,8 +161,6 @@ export default {
|
|
|
})();
|
|
|
};
|
|
|
|
|
|
- console.log(this.isLogin);
|
|
|
-
|
|
|
// await this.$apis.getAllCourses().then(res => {
|
|
|
// this.courseList = res.data.data;
|
|
|
// });
|
|
|
@@ -188,6 +179,12 @@ export default {
|
|
|
// });
|
|
|
this.coderExamList = this.$apis.getAllCoderExams().data.data["res"];
|
|
|
|
|
|
+ if (this.isLogin) {
|
|
|
+ this.myCourseList = this.$apis.getStudentCourses({ "studentId": this.$store.state.user.id }).then(res => {
|
|
|
+ this.myCourseList = res.data.data;
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
await this.$nextTick(() => {
|
|
|
that.handleResize();
|
|
|
});
|
|
|
@@ -226,7 +223,10 @@ export default {
|
|
|
this.testRowHeight = this.$refs.portalTestCardBodyMain.$el.clientHeight;
|
|
|
},
|
|
|
changeTestPane(tab, event) {
|
|
|
- // console.log(tab, event);
|
|
|
+ const that = this;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ that.handleResize();
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
};
|