|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="bar-list" :class=" store.listIsShow ? '' : 'bar-list-hidden'">
|
|
|
+ <div class="bar-list" :class="store.listIsShow ? '' : 'bar-list-hidden'">
|
|
|
<div
|
|
|
class="swiper-container"
|
|
|
id="swcatalogRoot"
|
|
@@ -18,20 +18,53 @@
|
|
|
store.currentCatalogRoot.id == item.id,
|
|
|
}"
|
|
|
@click="tabRoot(item)"
|
|
|
- v-for="(item, i) in store.metadata.catalogRoot"
|
|
|
+ v-for="(item, i) in store.newCatalogRoot"
|
|
|
:key="i"
|
|
|
>
|
|
|
- <div class="area-text" v-if="store.currentCatalogRoot.id == item.id">
|
|
|
- {{ item.name }}
|
|
|
- <div class="active-line"></div>
|
|
|
+ <div
|
|
|
+ class="area-text"
|
|
|
+ v-if="store.currentCatalogRoot.id == item.id"
|
|
|
+
|
|
|
+ >
|
|
|
+ <!-- {{ item.name }} -->
|
|
|
+ <div class="area-text-left">
|
|
|
+ <div>{{ item.name }}</div>
|
|
|
+ <div class="active-line"></div>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="area-text-right"
|
|
|
+ v-if="store.secondaryList.length > 1"
|
|
|
+ @click.stop=""
|
|
|
+ >
|
|
|
+ <ul>
|
|
|
+ <li
|
|
|
+ @click="tabSecondary(item)"
|
|
|
+ :class="{
|
|
|
+ active: store.currentSecondary.id == item.id,
|
|
|
+ }"
|
|
|
+ v-for="(item, i) in store.newSecondaryList"
|
|
|
+ :key="i"
|
|
|
+ v-show="i != 0"
|
|
|
+ >
|
|
|
+ <span v-if="store.currentSecondary.id == item.id">{{
|
|
|
+ item.name
|
|
|
+ }}</span>
|
|
|
+ <span v-else>{{
|
|
|
+ item.name.length > spanlength
|
|
|
+ ? item.name.slice(0, spanlength)
|
|
|
+ : item.name
|
|
|
+ }}</span>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+
|
|
|
<div class="area-text" v-else>
|
|
|
{{
|
|
|
item.name.length > spanlength
|
|
|
? item.name.slice(0, spanlength)
|
|
|
: item.name
|
|
|
}}
|
|
|
- <!-- <div class="active-line"></div> -->
|
|
|
</div>
|
|
|
</li>
|
|
|
</ul>
|
|
@@ -81,37 +114,6 @@
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
-
|
|
|
- <div
|
|
|
- class="swiper-container"
|
|
|
- id="swSecondary"
|
|
|
- :style="`width:${secondaryW}px`"
|
|
|
- v-if="store.secondaryList.length > 1"
|
|
|
- >
|
|
|
- <ul class="swiper-wrapper">
|
|
|
- <li
|
|
|
- class="swiper-slide"
|
|
|
- @click="tabSecondary(item)"
|
|
|
- :class="{
|
|
|
- active: store.currentSecondary.id == item.id,
|
|
|
- loopspan:
|
|
|
- item.name.length > spanlength &&
|
|
|
- store.currentSecondary.id == item.id,
|
|
|
- }"
|
|
|
- v-for="(item, i) in store.secondaryList"
|
|
|
- :key="i"
|
|
|
- >
|
|
|
- <span v-if="store.currentSecondary.id == item.id">{{
|
|
|
- item.name
|
|
|
- }}</span>
|
|
|
- <span v-else>{{
|
|
|
- item.name.length > spanlength
|
|
|
- ? item.name.slice(0, spanlength)
|
|
|
- : item.name
|
|
|
- }}</span>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -172,7 +174,11 @@ const tabCurrentScene = (data) => {
|
|
|
};
|
|
|
|
|
|
const tabSecondary = (data) => {
|
|
|
- store.setCurrentSecondary(data);
|
|
|
+ const cur = store.secondaryList.find((item) => {
|
|
|
+ return data.id === item.id;
|
|
|
+ });
|
|
|
+ store.setCurrentSecondary(cur);
|
|
|
+ store.currentScene = store.currentScenesList[0]
|
|
|
};
|
|
|
|
|
|
const tabRoot = (data) => {
|
|
@@ -185,9 +191,18 @@ const tabRoot = (data) => {
|
|
|
|
|
|
// 向下离场
|
|
|
const departure = () => {
|
|
|
- store.setListIsShow(false)
|
|
|
+ store.setListIsShow(false);
|
|
|
};
|
|
|
|
|
|
+// // 切换楼层
|
|
|
+// const currentSecondaryChange = (item) => {
|
|
|
+// const current = store.secondaryList.filter((sub) => {
|
|
|
+// return sub.id === item.id
|
|
|
+// })
|
|
|
+// console.log(current, item)
|
|
|
+// store.setCurrentSecondary(current)
|
|
|
+// }
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
loadList();
|
|
|
store.$subscribe((mutation, state) => {
|
|
@@ -267,12 +282,13 @@ $width: 100%;
|
|
|
}
|
|
|
|
|
|
.active-line {
|
|
|
- width: 80%;
|
|
|
+ width: 60px;
|
|
|
height: 4px;
|
|
|
background-color: #e1ceaaad;
|
|
|
position: absolute;
|
|
|
bottom: 5px;
|
|
|
- left: 10px;
|
|
|
+ left: 50%;
|
|
|
+ transform: translateX(-50%);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -290,18 +306,42 @@ $width: 100%;
|
|
|
> ul {
|
|
|
> li {
|
|
|
box-sizing: border-box;
|
|
|
- overflow: hidden;
|
|
|
+ // overflow: hidden;
|
|
|
width: 90px;
|
|
|
line-height: 30px;
|
|
|
height: 30px;
|
|
|
.area-text {
|
|
|
- width: 100%;
|
|
|
+ // width: 100%;
|
|
|
word-break: keep-all;
|
|
|
color: #ffffff;
|
|
|
font-weight: 400;
|
|
|
cursor: pointer;
|
|
|
position: relative;
|
|
|
font-size: 14px;
|
|
|
+
|
|
|
+ &-right {
|
|
|
+ margin-left: 10px;
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 80px;
|
|
|
+ ul {
|
|
|
+ display: flex;
|
|
|
+ li {
|
|
|
+ margin-left: 15px;
|
|
|
+ border: 1px solid 1px solid rgba(225, 206, 170, 0.5);
|
|
|
+ box-shadow: inset 0px 2px 5px 0px rgba(255, 255, 255, 0.25);
|
|
|
+ background: rgba(225, 196, 141, 0.3);
|
|
|
+ border-radius: 5px;
|
|
|
+ width: 50px;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 14px;
|
|
|
+ opacity: 0.5;
|
|
|
+ }
|
|
|
+ .active {
|
|
|
+ opacity: 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
&.active {
|