|
@@ -1,73 +1,149 @@
|
|
|
<template>
|
|
|
- <div class="bar-list">
|
|
|
- <div class="swiper-container" id="swcatalogRoot"
|
|
|
- :style="`width:${catalogRootW > innerW ? '100%' : (catalogRootW + 'px')}`"
|
|
|
- v-if="store.metadata.catalogRoot.length > 0 && store.metadata.catalogs.length > 1">
|
|
|
+ <div class="bar-list" :class=" store.listIsShow ? '' : 'bar-list-hidden'">
|
|
|
+ <div
|
|
|
+ class="swiper-container"
|
|
|
+ id="swcatalogRoot"
|
|
|
+ v-if="
|
|
|
+ store.metadata.catalogRoot.length > 0 &&
|
|
|
+ store.metadata.catalogs.length > 1
|
|
|
+ "
|
|
|
+ >
|
|
|
<ul class="swiper-wrapper" v-if="store.metadata.catalogRoot.length > 1">
|
|
|
- <li class="swiper-slide" :class="{
|
|
|
- active: store.currentCatalogRoot.id == item.id,
|
|
|
- loopspan: item.name.length > spanlength && store.currentCatalogRoot.id == item.id,
|
|
|
- }" @click="tabRoot(item)" v-for="(item, i) in store.metadata.catalogRoot" :key="i">
|
|
|
- <span v-if="store.currentCatalogRoot.id == item.id">{{ item.name }}</span>
|
|
|
- <span v-else>{{ item.name.length > spanlength ? item.name.slice(0, spanlength) : item.name }}</span>
|
|
|
+ <li
|
|
|
+ class="swiper-slide"
|
|
|
+ :class="{
|
|
|
+ active: store.currentCatalogRoot.id == item.id,
|
|
|
+ loopspan:
|
|
|
+ item.name.length > spanlength &&
|
|
|
+ store.currentCatalogRoot.id == item.id,
|
|
|
+ }"
|
|
|
+ @click="tabRoot(item)"
|
|
|
+ v-for="(item, i) in store.metadata.catalogRoot"
|
|
|
+ :key="i"
|
|
|
+ >
|
|
|
+ <div class="area-text" v-if="store.currentCatalogRoot.id == item.id">
|
|
|
+ {{ item.name }}
|
|
|
+ <div class="active-line"></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>
|
|
|
+ <img
|
|
|
+ src="../../assets/images/resource/scene/downIcon.png"
|
|
|
+ @click="departure"
|
|
|
+ />
|
|
|
</div>
|
|
|
- <div class="bottom-con"
|
|
|
- :style="`width:${(Math.max(scenesListW, secondaryW) > 1150) ? '100%' : ((Math.max(scenesListW, secondaryW) + 120) + 'px')}`">
|
|
|
- <div class="swiper-container" :style="`width:${scenesListW > 1150 ? '100%' : (scenesListW + 'px')}`" id="swScenes"
|
|
|
- v-if="store.currentScenesList.length > 0">
|
|
|
+ <div
|
|
|
+ class="bottom-con"
|
|
|
+ :style="`width:${
|
|
|
+ Math.max(scenesListW, secondaryW) > 1150
|
|
|
+ ? '100%'
|
|
|
+ : Math.max(scenesListW, secondaryW) + 120 + 'px'
|
|
|
+ }`"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ class="swiper-container"
|
|
|
+ :style="`width:${scenesListW > 1150 ? '100%' : scenesListW + 'px'}`"
|
|
|
+ id="swScenes"
|
|
|
+ v-if="store.currentScenesList.length > 0"
|
|
|
+ >
|
|
|
<ul class="swiper-wrapper">
|
|
|
- <li @click="tabCurrentScene(item)" class="swiper-slide" :class="{
|
|
|
- active: store.currentScene.sceneCode == item.sceneCode,
|
|
|
- loopspan: item.sceneTitle.length > spanlength && store.currentScene.id == item.id,
|
|
|
- }" :style="{ backgroundImage: `url(${item.icon})` }" v-for="(item, i) in store.currentScenesList" :key="i">
|
|
|
+ <li
|
|
|
+ @click="tabCurrentScene(item)"
|
|
|
+ class="swiper-slide"
|
|
|
+ :class="{
|
|
|
+ active: store.currentScene.sceneCode == item.sceneCode,
|
|
|
+ loopspan:
|
|
|
+ item.sceneTitle.length > spanlength &&
|
|
|
+ store.currentScene.id == item.id,
|
|
|
+ }"
|
|
|
+ :style="{ backgroundImage: `url(${item.icon})` }"
|
|
|
+ v-for="(item, i) in store.currentScenesList"
|
|
|
+ :key="i"
|
|
|
+ >
|
|
|
<div>
|
|
|
- <span v-if="store.currentScene.id == item.id">{{ item.sceneTitle }}</span>
|
|
|
+ <span v-if="store.currentScene.id == item.id"
|
|
|
+ >{{ item.sceneTitle }}
|
|
|
+ </span>
|
|
|
<span v-else>{{
|
|
|
- item.sceneTitle.length > spanlength ? item.sceneTitle.slice(0, spanlength) :
|
|
|
- item.sceneTitle
|
|
|
+ item.sceneTitle.length > spanlength
|
|
|
+ ? item.sceneTitle.slice(0, spanlength)
|
|
|
+ : item.sceneTitle
|
|
|
}}</span>
|
|
|
</div>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
|
|
|
- <div class="swiper-container" id="swSecondary" :style="`width:${secondaryW}px`"
|
|
|
- v-if="store.secondaryList.length > 1">
|
|
|
+ <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
|
|
|
+ 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>
|
|
|
|
|
|
<script setup>
|
|
|
-import appStore from '@/store/index';
|
|
|
+import appStore from "@/store/index";
|
|
|
import { ref, onMounted, computed, watch, nextTick } from "vue";
|
|
|
+import { useRoute } from "vue-router";
|
|
|
+
|
|
|
+const route = useRoute();
|
|
|
|
|
|
const store = appStore();
|
|
|
const spanlength = ref(5);
|
|
|
|
|
|
const swidth = ref({
|
|
|
- "swcatalogRoot": 130,
|
|
|
- "swSecondary": 84,
|
|
|
- "swScenes": 124,
|
|
|
-})
|
|
|
-
|
|
|
-const scenesListW = computed(() => store.currentScenesList.length * (swidth.value['swScenes'] + 10) - 10)
|
|
|
-const secondaryW = computed(() => store.secondaryList.length * (swidth.value['swSecondary'] + 10) - 10)
|
|
|
-const catalogRootW = computed(() => store.metadata.catalogRoot.length * (swidth.value['swcatalogRoot'] + 10) - 10)
|
|
|
-const innerW = computed(() => 1150)
|
|
|
-
|
|
|
+ swcatalogRoot: 130,
|
|
|
+ swSecondary: 84,
|
|
|
+ swScenes: 124,
|
|
|
+});
|
|
|
+
|
|
|
+const scenesListW = computed(
|
|
|
+ () => store.currentScenesList.length * (swidth.value["swScenes"] + 10) - 10
|
|
|
+);
|
|
|
+const secondaryW = computed(
|
|
|
+ () => store.secondaryList.length * (swidth.value["swSecondary"] + 10) - 10
|
|
|
+);
|
|
|
+const catalogRootW = computed(
|
|
|
+ () =>
|
|
|
+ store.metadata.catalogRoot.length * (swidth.value["swcatalogRoot"] + 10) -
|
|
|
+ 10
|
|
|
+);
|
|
|
+const innerW = computed(() => 1150);
|
|
|
|
|
|
const loadList = () => {
|
|
|
nextTick(() => {
|
|
@@ -79,11 +155,11 @@ const loadList = () => {
|
|
|
centeredSlides: true,
|
|
|
spaceBetween: 10,
|
|
|
centerInsufficientSlides: true,
|
|
|
- mousewheel:true,
|
|
|
+ mousewheel: true,
|
|
|
centeredSlidesBounds: true,
|
|
|
freeMode: true,
|
|
|
observer: true,
|
|
|
- observeParents:true
|
|
|
+ observeParents: true,
|
|
|
});
|
|
|
});
|
|
|
}, 100);
|
|
@@ -92,6 +168,7 @@ const loadList = () => {
|
|
|
|
|
|
const tabCurrentScene = (data) => {
|
|
|
store.currentScene = data;
|
|
|
+ route.params.id = data.sceneCode;
|
|
|
};
|
|
|
|
|
|
const tabSecondary = (data) => {
|
|
@@ -100,91 +177,131 @@ const tabSecondary = (data) => {
|
|
|
|
|
|
const tabRoot = (data) => {
|
|
|
store.setCurrentCatalogRoot(data);
|
|
|
+ setTimeout(() => {
|
|
|
+ // 当前场景初始化为第一个
|
|
|
+ store.setCurrentSceneFirst();
|
|
|
+ }, 300);
|
|
|
};
|
|
|
|
|
|
-
|
|
|
+// 向下离场
|
|
|
+const departure = () => {
|
|
|
+ store.setListIsShow(false)
|
|
|
+};
|
|
|
|
|
|
onMounted(() => {
|
|
|
- loadList()
|
|
|
+ loadList();
|
|
|
store.$subscribe((mutation, state) => {
|
|
|
- loadList()
|
|
|
- })
|
|
|
-})
|
|
|
-
|
|
|
+ loadList();
|
|
|
+ });
|
|
|
+});
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
-$width: 1150px;
|
|
|
+$width: 100%;
|
|
|
|
|
|
+.bar-list-hidden {
|
|
|
+ bottom: -200px !important;
|
|
|
+}
|
|
|
.bar-list {
|
|
|
position: absolute;
|
|
|
bottom: 68px;
|
|
|
left: 50%;
|
|
|
transform: translateX(-50%);
|
|
|
text-align: center;
|
|
|
- max-width: $width;
|
|
|
+ width: $width;
|
|
|
overflow: hidden;
|
|
|
- transition: .3s all ease;
|
|
|
+ transition: 0.3s all ease;
|
|
|
z-index: 9999;
|
|
|
+ // border-top: 2px solid #e1ceaa;
|
|
|
+ // border-bottom: 2px solid #e1ceaa;
|
|
|
+ background: linear-gradient(
|
|
|
+ 89deg,
|
|
|
+ rgba(141, 127, 100, 0) 0%,
|
|
|
+ rgb(158 135 90 / 35%) 22%,
|
|
|
+ rgba(141, 127, 100, 0.56) 80%,
|
|
|
+ rgb(141 127 100 / 56%) 100%
|
|
|
+ );
|
|
|
+ backdrop-filter: blur(20px);
|
|
|
+ padding: 10px;
|
|
|
+ transition-property: bottom;
|
|
|
+ transition-duration: 0.5s;
|
|
|
+ pointer-events: all;
|
|
|
+ box-shadow: inset 0px 2px 5px 0px rgba(255, 255, 255, 0.25);
|
|
|
+ bottom: 0;
|
|
|
+
|
|
|
+ .up-icon {
|
|
|
+ position: absolute;
|
|
|
+ top: -20px;
|
|
|
+ z-index: 999;
|
|
|
+ }
|
|
|
|
|
|
.swiper-container {
|
|
|
width: 100%;
|
|
|
position: relative;
|
|
|
- margin: 0 auto;
|
|
|
+ // margin-top: 10px;
|
|
|
|
|
|
- >ul {
|
|
|
- >li {
|
|
|
+ > ul {
|
|
|
+ > li {
|
|
|
white-space: nowrap;
|
|
|
|
|
|
- >span,
|
|
|
- >div>span {
|
|
|
+ > span,
|
|
|
+ > div > span {
|
|
|
cursor: pointer;
|
|
|
display: inline-block;
|
|
|
- color: rgba(255, 255, 255, 0.6);
|
|
|
+ color: rgba(255, 255, 255);
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 14px;
|
|
|
}
|
|
|
|
|
|
&.loopspan {
|
|
|
-
|
|
|
- >span,
|
|
|
- >div>span {
|
|
|
+ > span,
|
|
|
+ > div > span {
|
|
|
animation: 5s wordsLoop linear infinite normal;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
&.active {
|
|
|
-
|
|
|
- >span,
|
|
|
- >div>span {
|
|
|
- color: rgba(255, 255, 255, 1);
|
|
|
+ .area-text {
|
|
|
+ color: rgba(255, 255, 255, 1) !important;
|
|
|
+ font-weight: bold !important;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .active-line {
|
|
|
+ width: 80%;
|
|
|
+ height: 4px;
|
|
|
+ background-color: #e1ceaaad;
|
|
|
+ position: absolute;
|
|
|
+ bottom: 5px;
|
|
|
+ left: 10px;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.bottom-con {
|
|
|
- margin: 20px auto 0;
|
|
|
+ margin: 0px auto 0;
|
|
|
padding: 10px;
|
|
|
- border-top: 2px solid #E1CEAA;
|
|
|
- border-bottom: 2px solid #E1CEAA;
|
|
|
- background: linear-gradient(89deg, rgba(141,127,100,0) 0%, rgba(141,127,100,0.8) 22%, rgba(141,127,100,0.8) 80%, rgba(141,127,100,0) 100%);
|
|
|
- backdrop-filter: blur(20px);
|
|
|
}
|
|
|
|
|
|
#swcatalogRoot {
|
|
|
- >ul {
|
|
|
- >li {
|
|
|
+ .swiper-wrapper {
|
|
|
+ transform: translate3d(0, 0px, 0px) !important;
|
|
|
+ }
|
|
|
+ > ul {
|
|
|
+ > li {
|
|
|
box-sizing: border-box;
|
|
|
overflow: hidden;
|
|
|
- width: 130px;
|
|
|
+ width: 90px;
|
|
|
line-height: 30px;
|
|
|
height: 30px;
|
|
|
- background: rgba(132,115,83,0.5);
|
|
|
- border-radius: 25px 25px 25px 25px;
|
|
|
- border: 1px solid #E1CEAA;
|
|
|
- backdrop-filter: blur(4px);
|
|
|
- >span {
|
|
|
+ .area-text {
|
|
|
width: 100%;
|
|
|
word-break: keep-all;
|
|
|
+ color: #ffffff;
|
|
|
+ font-weight: 400;
|
|
|
+ cursor: pointer;
|
|
|
+ position: relative;
|
|
|
+ font-size: 14px;
|
|
|
}
|
|
|
|
|
|
&.active {
|
|
@@ -192,19 +309,28 @@ $width: 1150px;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ img {
|
|
|
+ width: 35px;
|
|
|
+ position: absolute;
|
|
|
+ right: 20px;
|
|
|
+ z-index: 999;
|
|
|
+ top: -2px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
#swSecondary {
|
|
|
margin: 20px auto 10px;
|
|
|
|
|
|
- >ul {
|
|
|
- >li {
|
|
|
+ > ul {
|
|
|
+ > li {
|
|
|
width: 84px;
|
|
|
box-sizing: border-box;
|
|
|
overflow: hidden;
|
|
|
padding-bottom: 6px;
|
|
|
|
|
|
- >span {
|
|
|
+ > span {
|
|
|
width: 100%;
|
|
|
word-break: keep-all;
|
|
|
}
|
|
@@ -230,8 +356,8 @@ $width: 1150px;
|
|
|
}
|
|
|
|
|
|
#swScenes {
|
|
|
- >ul {
|
|
|
- >li {
|
|
|
+ > ul {
|
|
|
+ > li {
|
|
|
cursor: pointer;
|
|
|
border-radius: 6px;
|
|
|
border: 2px solid transparent;
|
|
@@ -242,7 +368,7 @@ $width: 1150px;
|
|
|
width: 124px;
|
|
|
height: 90px;
|
|
|
border-radius: 1px;
|
|
|
- &::after{
|
|
|
+ &::after {
|
|
|
position: absolute;
|
|
|
top: 0;
|
|
|
left: 0;
|
|
@@ -250,19 +376,21 @@ $width: 1150px;
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
display: inline-block;
|
|
|
- background: rgba(0,0,0,0.3);
|
|
|
- content: '';
|
|
|
+ background: rgba(0, 0, 0, 0.5);
|
|
|
+ content: "";
|
|
|
pointer-events: none;
|
|
|
}
|
|
|
- >div {
|
|
|
+ > div {
|
|
|
position: absolute;
|
|
|
- bottom: 10px;
|
|
|
- left: 0;
|
|
|
+ top: 50%;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+ left: 50%;
|
|
|
height: 20px;
|
|
|
width: 100%;
|
|
|
overflow: hidden;
|
|
|
+ z-index: 999;
|
|
|
|
|
|
- >span {
|
|
|
+ > span {
|
|
|
width: 100%;
|
|
|
line-height: 20px;
|
|
|
word-break: keep-all;
|
|
@@ -270,12 +398,30 @@ $width: 1150px;
|
|
|
}
|
|
|
|
|
|
&.active {
|
|
|
- border: 2px solid #D9C7A4;
|
|
|
- &::after{
|
|
|
- display: none;
|
|
|
+ border: 2px solid #d9c7a4;
|
|
|
+ &::after {
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ bottom: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ display: inline-block;
|
|
|
+ background: linear-gradient(
|
|
|
+ to top,
|
|
|
+ rgb(0 0 0 / 59%),
|
|
|
+ rgba(255, 0, 0, 0)
|
|
|
+ );
|
|
|
+ content: "";
|
|
|
+ pointer-events: none;
|
|
|
}
|
|
|
- >div {
|
|
|
- >span {}
|
|
|
+ > div {
|
|
|
+ top: auto;
|
|
|
+ bottom: 10px;
|
|
|
+ transform: translate(0, 0);
|
|
|
+ left: 0;
|
|
|
+ > span {
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|