|
|
@@ -2,8 +2,6 @@
|
|
|
<GlobalHeader/>
|
|
|
<div id="portal-body">
|
|
|
|
|
|
- <!-- <InfoCard/>-->
|
|
|
-
|
|
|
<CarouselCard id="portal-carousel-card"/>
|
|
|
|
|
|
<div>
|
|
|
@@ -14,32 +12,24 @@
|
|
|
<el-divider class="portal-card-divider"/>
|
|
|
<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"/>
|
|
|
+ <MyCourseCard v-for="course in myCourseList" :key="course.id" :courseVO="course"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <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
|
|
|
- d="M909.016 820.828H841a30 30 0 0 1 0-60h38.016a20 20 0 0 0 20-20V145.185a20 20 0 0 0-20-20H352a20 20 0 0 0-20 20v28h370.016a50 50 0 0 1 50 50v223.36a29.989 29.989 0 1 1-59.507 5.283h-0.493V253.185a20
|
|
|
- 20 0 0 0-20-20H145a20 20 0 0 0-20 20v625.643a20 20 0 0 0 20 20h337a30 30 0 0 1 0 60H115a50 50 0 0 1-50-50V223.185a50 50 0 0 1 50-50h157v-58a50 50 0 0 1 50-50h587.016a50 50 0 0 1 50 50v655.643a50 50 0 0 1-50 50z m-663.037-484H572.74a29.979 29.979 0 1 1 0
|
|
|
- 59.957H245.979a29.979 29.979 0 1 1 0-59.957z m0 290.043h74.912a29.979 29.979 0 0 1 29.979 29.978 29.979 29.979 0 0 1-29.979
|
|
|
- 29.979h-74.912A29.979 29.979 0 0 1 216 656.849a29.979 29.979 0 0 1 29.979-29.978zM216 511.807a29.979 29.979 0 0 1 29.979-29.979h140.935a29.979 29.979 0 0 1 29.979 29.979v0.042a29.979 29.979 0 0 1-29.979 29.979H245.979A29.979 29.979 0 0 1 216 511.849v-0.042z m163 177.521c0-107.419
|
|
|
- 87.081-194.5 194.5-194.5S768 581.909 768 689.328a193.618 193.618 0 0 1-37.9 115.356l84.115 84.115a30 30 0 1 1-42.425 42.429l-84.3-84.3a193.6 193.6 0 0 1-113.99 36.9c-107.419 0-194.5-87.081-194.5-194.5z m194.5 134.5a134.5 134.5 0 1 0-134.5-134.5 134.5 134.5 0 0 0 134.5 134.5z"
|
|
|
- fill="#bfbfbf"></path>
|
|
|
- </svg>
|
|
|
- </div>
|
|
|
- <div style="cursor:pointer;" @click="this.$router.push('/auth')">登录以查看更多</div>
|
|
|
+ <div v-else :style="{height: (courseRowHeight - 63) + 'px', marginTop: (courseRowHeight / 2 - 100) + 'px'}" class="portal-card-main" style="cursor: pointer"
|
|
|
+ @click="this.$router.push('/auth')">
|
|
|
+ <el-icon color="#bfbfbf" :size="72">
|
|
|
+ <Lock/>
|
|
|
+ </el-icon>
|
|
|
+ <div style="font-size: small; font-weight: bold; color: #666666">登录以查看</div>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
</div>
|
|
|
|
|
|
<div>
|
|
|
- <el-card id="portal-course-card-main" ref="portalCourseCardBodyMain" :style="{height: courseRowHeight + 'px'}">
|
|
|
+ <el-card id="portal-course-card-main" :style="{height: courseRowHeight + 'px'}">
|
|
|
<div class="portal-card-title">
|
|
|
<div class="portal-card-title-main">精选课程</div>
|
|
|
- <ElButton round plain type="primary" @click="toCourse">查看全部课程</ElButton>
|
|
|
+ <ElButton plain round type="primary" @click="toCourse">查看全部课程</ElButton>
|
|
|
</div>
|
|
|
<el-divider class="portal-card-divider"/>
|
|
|
<el-row justify="space-around" type="flex">
|
|
|
@@ -58,23 +48,15 @@
|
|
|
<el-divider class="portal-card-divider"/>
|
|
|
<div v-if="isLogin" :style="{height: (testRowHeight - 63) + 'px'}" class="portal-card-main">
|
|
|
<div class="portal-my-card-main">
|
|
|
- <MyTestCard :testVO="test" v-for="test in myTestList" :key="test.id"/>
|
|
|
+ <MyTestCard v-for="test in myTestList" :key="test.id" :testVO="test"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <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
|
|
|
- d="M909.016 820.828H841a30 30 0 0 1 0-60h38.016a20 20 0 0 0 20-20V145.185a20 20 0 0 0-20-20H352a20 20 0 0 0-20 20v28h370.016a50 50 0 0 1 50 50v223.36a29.989 29.989 0 1 1-59.507 5.283h-0.493V253.185a20
|
|
|
- 20 0 0 0-20-20H145a20 20 0 0 0-20 20v625.643a20 20 0 0 0 20 20h337a30 30 0 0 1 0 60H115a50 50 0 0 1-50-50V223.185a50 50 0 0 1 50-50h157v-58a50 50 0 0 1 50-50h587.016a50 50 0 0 1 50 50v655.643a50 50 0 0 1-50 50z m-663.037-484H572.74a29.979 29.979 0 1 1 0
|
|
|
- 59.957H245.979a29.979 29.979 0 1 1 0-59.957z m0 290.043h74.912a29.979 29.979 0 0 1 29.979 29.978 29.979 29.979 0 0 1-29.979
|
|
|
- 29.979h-74.912A29.979 29.979 0 0 1 216 656.849a29.979 29.979 0 0 1 29.979-29.978zM216 511.807a29.979 29.979 0 0 1 29.979-29.979h140.935a29.979 29.979 0 0 1 29.979 29.979v0.042a29.979 29.979 0 0 1-29.979 29.979H245.979A29.979 29.979 0 0 1 216 511.849v-0.042z m163 177.521c0-107.419
|
|
|
- 87.081-194.5 194.5-194.5S768 581.909 768 689.328a193.618 193.618 0 0 1-37.9 115.356l84.115 84.115a30 30 0 1 1-42.425 42.429l-84.3-84.3a193.6 193.6 0 0 1-113.99 36.9c-107.419 0-194.5-87.081-194.5-194.5z m194.5 134.5a134.5 134.5 0 1 0-134.5-134.5 134.5 134.5 0 0 0 134.5 134.5z"
|
|
|
- fill="#bfbfbf"></path>
|
|
|
- </svg>
|
|
|
- </div>
|
|
|
- <div style="cursor:pointer;" @click="this.$router.push('/auth')">登录以查看更多</div>
|
|
|
+ <div v-else :style="{height: (testRowHeight - 63) + 'px', marginTop: (testRowHeight / 2 - 100) + 'px'}" class="portal-card-main" style="cursor: pointer"
|
|
|
+ @click="this.$router.push('/auth')">
|
|
|
+ <el-icon color="#bfbfbf" :size="72">
|
|
|
+ <Lock/>
|
|
|
+ </el-icon>
|
|
|
+ <div style="font-size: small; font-weight: bold; color: #666666">登录以查看</div>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
</div>
|
|
|
@@ -86,7 +68,7 @@
|
|
|
<ElButton plain round type="primary" @click="toTest">查看全部测试</ElButton>
|
|
|
</div>
|
|
|
<el-divider class="portal-card-divider"/>
|
|
|
- <el-tabs v-model="activeTestName" @tab-click="changeTestPane">
|
|
|
+ <el-tabs v-model="activeTestPaneName" @tab-click="changeTestPane">
|
|
|
<el-tab-pane label="评测题" name="eval">
|
|
|
<el-row justify="space-around">
|
|
|
<el-col v-for="item in evalExamList.slice(0, cardRowLength)" :key="item.id" :lg="7" :md="11" :sm="11"
|
|
|
@@ -114,24 +96,23 @@
|
|
|
<script>
|
|
|
import GlobalHeader from "@/components/GlobalHeader";
|
|
|
import CarouselCard from "@/views/PortalPage/components/CarouselCard";
|
|
|
-// import InfoCard from "@/views/PortalPage/components/InfoCard";
|
|
|
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";
|
|
|
import MyTestCard from "@/views/PortalPage/components/MyTestCard";
|
|
|
+import { Lock } from "@element-plus/icons-vue";
|
|
|
|
|
|
export default {
|
|
|
//属性
|
|
|
name: "PortalPage",
|
|
|
- components: {MyTestCard, CoderCard, GlobalFooter, CourseCard, CarouselCard, GlobalHeader, EvalCard, MyCourseCard},
|
|
|
+ components: { Lock, MyTestCard, CoderCard, GlobalFooter, CourseCard, CarouselCard, GlobalHeader, EvalCard, MyCourseCard },
|
|
|
data() {
|
|
|
return {
|
|
|
- isLogin: this.$store.state.user.token !== undefined,
|
|
|
extending: false,
|
|
|
cardRowLength: 3,
|
|
|
- activeTestName: "eval",
|
|
|
+ activeTestPaneName: "eval",
|
|
|
evalExamList: [],
|
|
|
courseList: [],
|
|
|
coderExamList: [],
|
|
|
@@ -139,10 +120,15 @@ export default {
|
|
|
myEvalExamList: [],
|
|
|
myCoderExamList: [],
|
|
|
myTestList: [],
|
|
|
- courseRowHeight: 0,
|
|
|
- testRowHeight: 0,
|
|
|
+ courseRowHeight: 360,
|
|
|
+ testRowHeight: 300,
|
|
|
};
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ isLogin() {
|
|
|
+ return this.$store.state.user.token !== undefined;
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
//生命周期函数
|
|
|
beforeMount() {
|
|
|
@@ -174,11 +160,13 @@ export default {
|
|
|
this.myCourseList = this.$apis.getStudentCourses({"studentId": this.$store.state.user.id}).then(res => {
|
|
|
this.myCourseList = res.data.data;
|
|
|
});
|
|
|
- const evalRes = await this.$apis.getStudentEvalExams({state: 0});
|
|
|
- this.myEvalExamList = evalRes.data.data.examVOList;
|
|
|
- const coderRes = await this.$apis.getStudentCoderExams({});
|
|
|
- this.myCoderExamList = coderRes.data.data.res;
|
|
|
- this.myTestList = [].concat(this.myEvalExamList).concat(this.myCoderExamList);
|
|
|
+ this.myTestList = [].concat(this.evalExamList).concat(this.coderExamList);
|
|
|
+
|
|
|
+ // const evalRes = await this.$apis.getStudentEvalExams({state: 0});
|
|
|
+ // this.myEvalExamList = evalRes.data.data.examVOList;
|
|
|
+ // const coderRes = await this.$apis.getStudentCoderExams({});
|
|
|
+ // this.myCoderExamList = coderRes.data.data.res;
|
|
|
+ // this.myTestList = [].concat(this.myEvalExamList).concat(this.myCoderExamList);
|
|
|
}
|
|
|
|
|
|
await this.$nextTick(() => {
|
|
|
@@ -206,16 +194,6 @@ export default {
|
|
|
this.cardRowLength = 2;
|
|
|
}
|
|
|
this.courseRowHeight = 640;
|
|
|
- } else if (scrollTop < 5) {
|
|
|
- this.extending = false;
|
|
|
- if (document.body.clientWidth >= 1200) {
|
|
|
- this.cardRowLength = 3;
|
|
|
- } else if (document.body.clientWidth >= 992 && document.body.clientWidth < 1200) {
|
|
|
- this.cardRowLength = 2;
|
|
|
- } else if (document.body.clientWidth < 992) {
|
|
|
- this.cardRowLength = 1;
|
|
|
- }
|
|
|
- this.courseRowHeight = 360;
|
|
|
}
|
|
|
this.testRowHeight = this.$refs.portalTestCardBodyMain.$el.clientHeight;
|
|
|
},
|