|
@@ -7,12 +7,13 @@
|
|
|
<div class="main">
|
|
|
<div class="mainBox" :class="{ curSorll: menaSon }">
|
|
|
<div class="rowAll">
|
|
|
- <div
|
|
|
- @click="cutTab(index)"
|
|
|
- class="row"
|
|
|
+ <div
|
|
|
v-for="(item, index) in tabData"
|
|
|
- :key="index"
|
|
|
- :class="{ active: idMate === index }"
|
|
|
+ :key="item.id"
|
|
|
+ class="row"
|
|
|
+ :id="`row${item.id}`"
|
|
|
+ :class="{ active: idMate === item.id }"
|
|
|
+ @click="cutTab(item.id)"
|
|
|
>
|
|
|
{{ item.name }}
|
|
|
</div>
|
|
@@ -148,14 +149,14 @@ export default {
|
|
|
//这里存放数据
|
|
|
return {
|
|
|
tabData: [
|
|
|
- { name: "Calendar", path: "/Layout/Visit/8" },
|
|
|
- { name: "Hours, Direction & Admission", path: "/Layout/Visit/1" },
|
|
|
- { name: "Reservation", path: "/Layout/Visit/2" },
|
|
|
- { name: "Floor Plans", path: "/Layout/Visit/3" },
|
|
|
- { name: "Audio Guide & Tour", path: "/Layout/Visit/4" },
|
|
|
- { name: "Accessibility", path: "/Layout/Visit/5" },
|
|
|
- { name: "Café & Shop", path: "/Layout/Visit/6" },
|
|
|
- { name: "Visitor Guidelines", path: "/Layout/Visit/7" },
|
|
|
+ { id: 7, name: "Calendar", path: "/Layout/Visit/8" },
|
|
|
+ { id: 0, name: "Hours, Direction & Admission", path: "/Layout/Visit/1" },
|
|
|
+ { id: 1, name: "Reservation", path: "/Layout/Visit/2" },
|
|
|
+ { id: 2, name: "Floor Plans", path: "/Layout/Visit/3" },
|
|
|
+ { id: 3, name: "Audio Guide & Tour", path: "/Layout/Visit/4" },
|
|
|
+ { id: 4, name: "Accessibility", path: "/Layout/Visit/5" },
|
|
|
+ { id: 5, name: "Café & Shop", path: "/Layout/Visit/6" },
|
|
|
+ { id: 6, name: "Visitor Guidelines", path: "/Layout/Visit/7" },
|
|
|
],
|
|
|
xianInd: "B1",
|
|
|
xian: ["B1", "F1", "F2", "F3", "F4", "F5", "F6"],
|
|
@@ -221,6 +222,9 @@ export default {
|
|
|
this.pageSrool(id - 1);
|
|
|
this.erjiTop(id - 1);
|
|
|
},
|
|
|
+ menaSon(v) {
|
|
|
+ this.$emit('handleNoticeTop', v ? 70 : 0)
|
|
|
+ }
|
|
|
},
|
|
|
//方法集合
|
|
|
methods: {
|
|
@@ -249,10 +253,10 @@ export default {
|
|
|
setTimeout(() => {
|
|
|
this.idMate = index;
|
|
|
// 获取二级选中元素距离左侧的距离
|
|
|
- let sonScroll = document.querySelectorAll(".rowAll .row");
|
|
|
+ let sonScroll = document.querySelector(".rowAll #row" + index);
|
|
|
let sonScrollAll = document.querySelector(".mainBox");
|
|
|
sonScrollAll.scrollTo({
|
|
|
- left: sonScroll[index].offsetLeft - 100,
|
|
|
+ left: sonScroll.offsetLeft - 100,
|
|
|
behavior: "smooth",
|
|
|
});
|
|
|
}, 100);
|
|
@@ -306,7 +310,13 @@ export default {
|
|
|
LayoutTop.style.display = "flex";
|
|
|
this.menaSon = false;
|
|
|
}
|
|
|
- if (scrollDom.scrollTop < Visit1.offsetTop + Visit1.offsetHeight - 70)
|
|
|
+
|
|
|
+ if (
|
|
|
+ scrollDom.scrollTop <
|
|
|
+ Visit8.offsetTop + Visit8.offsetHeight - 70
|
|
|
+ )
|
|
|
+ temp = 7;
|
|
|
+ else if (scrollDom.scrollTop < Visit1.offsetTop + Visit1.offsetHeight - 70)
|
|
|
temp = 0;
|
|
|
else if (
|
|
|
scrollDom.scrollTop <
|
|
@@ -333,11 +343,6 @@ export default {
|
|
|
Visit6.offsetTop + Visit6.offsetHeight - 70
|
|
|
)
|
|
|
temp = 5;
|
|
|
- else if (
|
|
|
- scrollDom.scrollTop <
|
|
|
- Visit8.offsetTop + Visit8.offsetHeight - 70
|
|
|
- )
|
|
|
- temp = 8;
|
|
|
else temp = 6;
|
|
|
this.erjiTop(temp);
|
|
|
};
|