|
@@ -2,27 +2,26 @@
|
|
|
<div class="headerSection">
|
|
|
<div class="header-container width1200">
|
|
|
<router-link :to="{ path: '/' }"
|
|
|
- class="logo">
|
|
|
+ class="logo">
|
|
|
<img src="../assets/images/logoWhile.png"
|
|
|
- width="100%"
|
|
|
- alt="">
|
|
|
+ width="100%"
|
|
|
+ alt="">
|
|
|
</router-link>
|
|
|
<div class="menu">
|
|
|
- <router-link :class="checkActive==1?'active':''"
|
|
|
- @click.native="change(1)"
|
|
|
- :to="{ path: '/' }">首页</router-link>
|
|
|
- <router-link :class="checkActive==2?'active':''"
|
|
|
- @click.native="change(2)"
|
|
|
- :to="{ path: '/project' }">产品</router-link>
|
|
|
- <router-link :class="checkActive==3?'active':''"
|
|
|
- @click.native="change(3)"
|
|
|
- :to="{ path: '/consult' }">资讯</router-link>
|
|
|
-
|
|
|
- <router-link :class="checkActive==4?'active':''"
|
|
|
- @click.native="change(4)"
|
|
|
- :to="{ path: '/aboutUs' }">关于我们</router-link>
|
|
|
+ <a :class="checkActive==1?'active':''"
|
|
|
+ @click="change(1,'banner')">平台介绍</a>
|
|
|
+ <a :class="checkActive==2?'active':''"
|
|
|
+ @click="change(2,'infos')">产品优势</a>
|
|
|
+ <a :class="checkActive==3?'active':''"
|
|
|
+ @click="change(3,'detail')">考生指引</a>
|
|
|
+ <a :class="checkActive==4?'active':''"
|
|
|
+ @click="change(4,'videoList')">操作指南</a>
|
|
|
+ <a :class="checkActive==5?'active':''"
|
|
|
+ @click="change(5,'consult')">行业咨询</a>
|
|
|
+ <a :class="checkActive==6?'active':''"
|
|
|
+ @click="change(6,'aboutUs')">关于我们</a>
|
|
|
<div class="bandBtn"
|
|
|
- @click="goKu">合作机构</div>
|
|
|
+ @click="goKu">合作机构</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -33,42 +32,67 @@ export default {
|
|
|
props: ['name'],
|
|
|
data () {
|
|
|
return {
|
|
|
- checkActive: 1
|
|
|
+ checkActive: 1,
|
|
|
+ topList: []
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|
|
|
+ scrollTo(0, 0);
|
|
|
let url = this.$route
|
|
|
- // console.log(url)
|
|
|
- if (url.path.indexOf('detile')) {
|
|
|
- this.checkActive = 3
|
|
|
- }
|
|
|
- switch (url.path) {
|
|
|
- case '/': {
|
|
|
- this.change(1)
|
|
|
- break
|
|
|
- }
|
|
|
- case '/project': {
|
|
|
- this.change(2)
|
|
|
- break
|
|
|
- }
|
|
|
- case '/consult': {
|
|
|
- this.change(3)
|
|
|
- break
|
|
|
- }
|
|
|
- case '/aboutUs': {
|
|
|
- this.change(4)
|
|
|
- break
|
|
|
- }
|
|
|
+ if (url.path.indexOf('detile') != -1) {
|
|
|
+ this.checkActive = 5
|
|
|
}
|
|
|
+ this.$nextTick(res => {
|
|
|
+ this.topList = this.getTop(['banner', 'infos', 'detail', 'videoList', 'consult', 'aboutUs'])
|
|
|
+ })
|
|
|
+
|
|
|
+ window.addEventListener('scroll', this.onContentScroll, true)
|
|
|
},
|
|
|
methods: {
|
|
|
- change (num) {
|
|
|
- this.checkActive = num;
|
|
|
- scrollTo(0, 0);
|
|
|
+ getTop (nameList) {
|
|
|
+ let arr = []
|
|
|
+ nameList.forEach(item => {
|
|
|
+ let top = document.getElementById(item).offsetTop - 78
|
|
|
+ arr.push(top)
|
|
|
+ })
|
|
|
+ arr.sort(function (a, b) { return a - b });
|
|
|
+ return arr
|
|
|
+ },
|
|
|
+ change (num, name) {
|
|
|
+ let url = this.$route.path
|
|
|
+ if (url != '/') {
|
|
|
+ this.$router.push('/')
|
|
|
+ this.checkActive = num;
|
|
|
+ let top = document.getElementById(name).offsetTop - 76
|
|
|
+ scrollTo(0, top);
|
|
|
+ } else {
|
|
|
+ this.checkActive = num;
|
|
|
+ let top = document.getElementById(name).offsetTop - 76
|
|
|
+ scrollTo(0, top);
|
|
|
+ }
|
|
|
},
|
|
|
goKu () {
|
|
|
window.open('https://kj.colexiu.com/#/login?returnUrl=%2F', '_blank');
|
|
|
- }
|
|
|
+ },
|
|
|
+
|
|
|
+ onContentScroll (e) {
|
|
|
+ // this.topList = this.getTop(['banner', 'infos', 'detail', 'videoList', 'consult', 'aboutUs'])
|
|
|
+ let target = e.target || e.srcElement
|
|
|
+ this.scrollTop = target.scrollingElement.scrollTop
|
|
|
+ if (this.scrollTop < this.topList[1]) {
|
|
|
+ this.checkActive = 1
|
|
|
+ } else if (this.scrollTop >= this.topList[1] && this.scrollTop < this.topList[2]) {
|
|
|
+ this.checkActive = 2
|
|
|
+ } else if (this.scrollTop >= this.topList[2] && this.scrollTop < this.topList[3]) {
|
|
|
+ this.checkActive = 3
|
|
|
+ } else if (this.scrollTop >= this.topList[3] && this.scrollTop < this.topList[4]) {
|
|
|
+ this.checkActive = 4
|
|
|
+ } else if (this.scrollTop >= this.topList[4] && this.scrollTop < this.topList[5]) {
|
|
|
+ this.checkActive = 5
|
|
|
+ } else if (this.scrollTop >= this.topList[5]) {
|
|
|
+ this.checkActive = 6
|
|
|
+ }
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -92,7 +116,7 @@ export default {
|
|
|
height: 82px;
|
|
|
}
|
|
|
.headerSection {
|
|
|
- background-color: rgba(0, 0, 0, .7);
|
|
|
+ background-color: rgba(0, 0, 0, 0.7);
|
|
|
position: fixed;
|
|
|
width: 100%;
|
|
|
top: 0px;
|
|
@@ -117,7 +141,8 @@ export default {
|
|
|
font-size: 16px;
|
|
|
align-items: center;
|
|
|
a {
|
|
|
- margin-left: 80px;
|
|
|
+ cursor: pointer;
|
|
|
+ margin-left: 44px;
|
|
|
color: #fff;
|
|
|
text-decoration: none;
|
|
|
position: relative;
|
|
@@ -127,12 +152,12 @@ export default {
|
|
|
transition: 0.5s;
|
|
|
&::after {
|
|
|
position: absolute;
|
|
|
- content: '';
|
|
|
+ content: "";
|
|
|
top: 140%;
|
|
|
left: 0;
|
|
|
width: 100%;
|
|
|
height: 3px;
|
|
|
- background-color: #2DC7AA;
|
|
|
+ background-color: #2dc7aa;
|
|
|
z-index: 100;
|
|
|
transform: scaleX(0);
|
|
|
transform-origin: right;
|
|
@@ -140,7 +165,7 @@ export default {
|
|
|
}
|
|
|
&:hover,
|
|
|
&.hover {
|
|
|
- color: #2DC7AA;
|
|
|
+ color: #2dc7aa;
|
|
|
font-weight: 600;
|
|
|
}
|
|
|
&:hover::after {
|
|
@@ -150,7 +175,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
a.active {
|
|
|
- color: #2DC7AA !important;
|
|
|
+ color: #2dc7aa !important;
|
|
|
font-weight: 600;
|
|
|
&::after {
|
|
|
position: absolute;
|
|
@@ -159,7 +184,7 @@ export default {
|
|
|
left: 0;
|
|
|
width: 100%;
|
|
|
height: 3px;
|
|
|
- background-color: #2DC7AA;
|
|
|
+ background-color: #2dc7aa;
|
|
|
z-index: 100;
|
|
|
transform: scaleX(1);
|
|
|
transform-origin: left;
|