|
|
@@ -3,35 +3,53 @@
|
|
|
<div id="portal-body">
|
|
|
<CarouselCard/>
|
|
|
<InfoCard/>
|
|
|
- <div id="a" :style="{height:(this.extending?'650px':'200px'), transition: 'height 0.5s'}" style="cursor: pointer;" @click="toCourse">精选课程
|
|
|
- <img alt="err" src="@/assets/allCourse.png" style="width: 100%; height: 80%">
|
|
|
+ <div id="portal-course-card-body" :style="{height:(this.extending?'650px':'350px'), transition: 'height 0.5s'}">
|
|
|
+ <div id="portal-course-card-title">
|
|
|
+ <div id="portal-course-card-title-1">精选课程</div>
|
|
|
+ <ElButton type="primary" plain @click="toCourse">查看全部课程</ElButton>
|
|
|
+ </div>
|
|
|
+ <div id="portal-course-card-main">
|
|
|
+ <div v-for="(index) in devTemp_1" :key="index" class="cItem">
|
|
|
+ <CourseItem/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div :style="{height:(this.extending?'650px':'200px'), transition: 'height 0.5s'}">我的课程
|
|
|
+ <div :style="{height:(this.extending?'650px':'350px'), transition: 'height 0.5s'}">我的课程
|
|
|
<img alt="err" src="@/assets/myCourse.png" style="width: 100%; height: 80%">
|
|
|
</div>
|
|
|
- <div :style="{height:(this.extending?'650px':'200px'), transition: 'height 0.5s'}" style="cursor: pointer" @click="toTest">智能测试
|
|
|
- <img alt="err" src="@/assets/allTest.png" style="width: 100%; height: 80%">
|
|
|
+ <div id="portal-test-card-body" :style="{height:(this.extending?'650px':'350px'), transition: 'height 0.5s'}" style="cursor: pointer" @click="toTest">
|
|
|
+ <div id="portal-test-card-title">
|
|
|
+ <div id="portal-test-card-title-1">智能测试</div>
|
|
|
+ <ElButton type="primary" plain @click="toCourse">查看全部测试</ElButton>
|
|
|
+ </div>
|
|
|
+ <div id="portal-test-card-main">
|
|
|
+ <div v-for="(index) in devTemp_1" :key="index" class="cItem">
|
|
|
+ <CourseItem/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div :style="{height:(this.extending?'650px':'200px'), transition: 'height 0.5s'}">我的测试
|
|
|
+ <div :style="{height:(this.extending?'650px':'350px'), transition: 'height 0.5s'}">我的测试
|
|
|
<img alt="err" src="@/assets/myTest.png" style="width: 100%; height: 80%">
|
|
|
</div>
|
|
|
-
|
|
|
</div>
|
|
|
-
|
|
|
+ <GlobalFooter/>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import GlobalHeader from "@/components/GlobalHeader";
|
|
|
import CarouselCard from "@/views/PortalPage/components/CarouselCard";
|
|
|
import InfoCard from "@/views/PortalPage/components/InfoCard";
|
|
|
+import CourseItem from "@/components/CourseItem";
|
|
|
+import GlobalFooter from "@/components/GlobalFooter";
|
|
|
|
|
|
export default {
|
|
|
//属性
|
|
|
name: "PortalPage",
|
|
|
- components: { InfoCard, CarouselCard, GlobalHeader },
|
|
|
+ components: { GlobalFooter, CourseItem, InfoCard, CarouselCard, GlobalHeader },
|
|
|
data() {
|
|
|
return {
|
|
|
extending: false,
|
|
|
+ devTemp_1: 3,
|
|
|
};
|
|
|
},
|
|
|
|
|
|
@@ -53,21 +71,16 @@ export default {
|
|
|
},
|
|
|
handleScroll() {
|
|
|
let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
|
|
|
- if (scrollTop > 15) {
|
|
|
+ if (scrollTop > 100) {
|
|
|
this.extending = true;
|
|
|
+ this.devTemp_1 = 6;
|
|
|
} else if (scrollTop < 5) {
|
|
|
this.extending = false;
|
|
|
+ this.devTemp_1 = 3;
|
|
|
}
|
|
|
},
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
-<style scoped>
|
|
|
-#portal-body {
|
|
|
- display: grid;
|
|
|
- grid-template-columns: 2fr 1fr;
|
|
|
- grid-gap: 10px 20px;
|
|
|
- background: #409eff;
|
|
|
-}
|
|
|
-</style>
|
|
|
+<style scoped src="./PortalPage.css"/>
|