|
@@ -7,7 +7,7 @@
|
|
<div class="mainBox" :class="{ curSorll: menaSon }">
|
|
<div class="mainBox" :class="{ curSorll: menaSon }">
|
|
<div class="rowAll">
|
|
<div class="rowAll">
|
|
<div
|
|
<div
|
|
- @click="cutTab(item.path)"
|
|
|
|
|
|
+ @click="cutTab(item.path, index)"
|
|
class="row"
|
|
class="row"
|
|
v-for="(item, index) in tabData"
|
|
v-for="(item, index) in tabData"
|
|
:key="index"
|
|
:key="index"
|
|
@@ -46,7 +46,7 @@
|
|
<p class="dd">+86 (10) 63393339</p>
|
|
<p class="dd">+86 (10) 63393339</p>
|
|
<p class="cc">Group visitors</p>
|
|
<p class="cc">Group visitors</p>
|
|
<p class="dd">+86 (10) 63370458</p>
|
|
<p class="dd">+86 (10) 63370458</p>
|
|
- <div class="more">See More</div>
|
|
|
|
|
|
+ <div class="more" @click="$router.push('/Layout/VisitInfo')">See More</div>
|
|
</div>
|
|
</div>
|
|
<!-- 3 -->
|
|
<!-- 3 -->
|
|
<div id="Visit3">
|
|
<div id="Visit3">
|
|
@@ -208,6 +208,15 @@ export default {
|
|
$route() {
|
|
$route() {
|
|
this.routeChange();
|
|
this.routeChange();
|
|
},
|
|
},
|
|
|
|
+ idMate(val) {
|
|
|
|
+ // 获取二级选中元素距离左侧的距离
|
|
|
|
+ let sonScroll = document.querySelectorAll(".rowAll .row");
|
|
|
|
+ let sonScrollAll = document.querySelector(".mainBox");
|
|
|
|
+ sonScrollAll.scrollTo({
|
|
|
|
+ left: sonScroll[val].offsetLeft - 100,
|
|
|
|
+ behavior: "smooth",
|
|
|
|
+ });
|
|
|
|
+ },
|
|
},
|
|
},
|
|
//方法集合
|
|
//方法集合
|
|
methods: {
|
|
methods: {
|
|
@@ -231,45 +240,22 @@ export default {
|
|
// 获取地址栏参数id
|
|
// 获取地址栏参数id
|
|
let id = this.$route.params.id;
|
|
let id = this.$route.params.id;
|
|
id = Number(id);
|
|
id = Number(id);
|
|
- this.idMate = id - 1;
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
- setTimeout(() => {
|
|
|
|
- // 获取顶部元素ban的高度
|
|
|
|
- let banDom = this.$refs.ban;
|
|
|
|
- // 获取滚动的总元素
|
|
|
|
- let scrollDom = document.querySelector(".Layout");
|
|
|
|
- // 获取顶部固定栏
|
|
|
|
- let LayoutTop = document.querySelector(".Layout .top");
|
|
|
|
- scrollDom.onscroll = () => {
|
|
|
|
- if (scrollDom.scrollTop > banDom.offsetHeight) {
|
|
|
|
- LayoutTop.style.display = "none";
|
|
|
|
- this.menaSon = true;
|
|
|
|
- } else {
|
|
|
|
- LayoutTop.style.display = "flex";
|
|
|
|
- this.menaSon = false;
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
- // 获取二级选中元素距离左侧的距离
|
|
|
|
- let sonScroll = document.querySelectorAll(".rowAll .row");
|
|
|
|
- let sonScrollAll = document.querySelector(".mainBox");
|
|
|
|
- sonScrollAll.scrollTo({
|
|
|
|
- left: sonScroll[id - 1].offsetLeft - 100,
|
|
|
|
- behavior: "smooth",
|
|
|
|
- });
|
|
|
|
- }, 100);
|
|
|
|
- });
|
|
|
|
|
|
+
|
|
// 滚动
|
|
// 滚动
|
|
// 获取元素距离顶部的距离
|
|
// 获取元素距离顶部的距离
|
|
let dom = document.querySelector(`#Visit${id}`);
|
|
let dom = document.querySelector(`#Visit${id}`);
|
|
// 获取主滚动元素
|
|
// 获取主滚动元素
|
|
let domScroll = document.querySelector(".Layout");
|
|
let domScroll = document.querySelector(".Layout");
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
- if(this.menaSon) domScroll.scrollTo({ top: dom.offsetTop - 70 });
|
|
|
|
|
|
+ if (this.menaSon) domScroll.scrollTo({ top: dom.offsetTop - 70 });
|
|
else domScroll.scrollTo({ top: dom.offsetTop - 140 });
|
|
else domScroll.scrollTo({ top: dom.offsetTop - 140 });
|
|
}, 100);
|
|
}, 100);
|
|
},
|
|
},
|
|
- cutTab(path) {
|
|
|
|
|
|
+ cutTab(path, index) {
|
|
this.$router.replace(path).catch(() => {});
|
|
this.$router.replace(path).catch(() => {});
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.idMate = index;
|
|
|
|
+ }, 200);
|
|
},
|
|
},
|
|
},
|
|
},
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
@@ -277,6 +263,71 @@ export default {
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
mounted() {
|
|
mounted() {
|
|
this.routeChange();
|
|
this.routeChange();
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ // 获取地址栏参数id
|
|
|
|
+ let id = this.$route.params.id;
|
|
|
|
+ id = Number(id);
|
|
|
|
+
|
|
|
|
+ // 获取顶部元素ban的高度
|
|
|
|
+ let banDom = this.$refs.ban;
|
|
|
|
+ // 获取滚动的总元素
|
|
|
|
+ let scrollDom = document.querySelector(".Layout");
|
|
|
|
+ // 获取顶部固定栏
|
|
|
|
+ let LayoutTop = document.querySelector(".Layout .top");
|
|
|
|
+ // 动态改变idMate高亮效果
|
|
|
|
+ let Visit1 = document.querySelector("#Visit1");
|
|
|
|
+ let Visit2 = document.querySelector("#Visit2");
|
|
|
|
+ let Visit3 = document.querySelector("#Visit3");
|
|
|
|
+ let Visit4 = document.querySelector("#Visit4");
|
|
|
|
+ let Visit5 = document.querySelector("#Visit5");
|
|
|
|
+ let Visit6 = document.querySelector("#Visit6");
|
|
|
|
+ scrollDom.onscroll = () => {
|
|
|
|
+ if (scrollDom.scrollTop > banDom.offsetHeight) {
|
|
|
|
+ LayoutTop.style.display = "none";
|
|
|
|
+ this.menaSon = true;
|
|
|
|
+ } else {
|
|
|
|
+ LayoutTop.style.display = "flex";
|
|
|
|
+ this.menaSon = false;
|
|
|
|
+ }
|
|
|
|
+ if (this.idMate !== null) {
|
|
|
|
+ if (
|
|
|
|
+ scrollDom.scrollTop <
|
|
|
|
+ Visit1.offsetTop + Visit1.offsetHeight - 70
|
|
|
|
+ )
|
|
|
|
+ this.idMate = 0;
|
|
|
|
+ else if (
|
|
|
|
+ scrollDom.scrollTop <
|
|
|
|
+ Visit2.offsetTop + Visit2.offsetHeight - 70
|
|
|
|
+ )
|
|
|
|
+ this.idMate = 1;
|
|
|
|
+ else if (
|
|
|
|
+ scrollDom.scrollTop <
|
|
|
|
+ Visit3.offsetTop + Visit3.offsetHeight - 70
|
|
|
|
+ )
|
|
|
|
+ this.idMate = 2;
|
|
|
|
+ else if (
|
|
|
|
+ scrollDom.scrollTop <
|
|
|
|
+ Visit4.offsetTop + Visit4.offsetHeight - 70
|
|
|
|
+ )
|
|
|
|
+ this.idMate = 3;
|
|
|
|
+ else if (
|
|
|
|
+ scrollDom.scrollTop <
|
|
|
|
+ Visit5.offsetTop + Visit5.offsetHeight - 70
|
|
|
|
+ )
|
|
|
|
+ this.idMate = 4;
|
|
|
|
+ else if (
|
|
|
|
+ scrollDom.scrollTop <
|
|
|
|
+ Visit6.offsetTop + Visit6.offsetHeight - 70
|
|
|
|
+ )
|
|
|
|
+ this.idMate = 5;
|
|
|
|
+ else this.idMate = 6;
|
|
|
|
+ } else {
|
|
|
|
+ this.idMate = id - 1;
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ }, 100);
|
|
|
|
+ });
|
|
},
|
|
},
|
|
beforeCreate() {}, //生命周期 - 创建之前
|
|
beforeCreate() {}, //生命周期 - 创建之前
|
|
beforeMount() {}, //生命周期 - 挂载之前
|
|
beforeMount() {}, //生命周期 - 挂载之前
|