|
@@ -1,171 +1,101 @@
|
|
|
<template>
|
|
|
- <div
|
|
|
- class="bar-list"
|
|
|
- v-if="
|
|
|
- show &&
|
|
|
- !(
|
|
|
- metadata.catalogRoot &&
|
|
|
- metadata.catalogRoot.length == 1 &&
|
|
|
- scenes.length == 1 &&
|
|
|
- secondaryList.length == 1
|
|
|
- )
|
|
|
- "
|
|
|
- :class="{ barshow: isShowScenesList }"
|
|
|
- >
|
|
|
- <div class="top-con">
|
|
|
- <div
|
|
|
- class="swiper-container swiper1"
|
|
|
- :style="`width:calc(100% - 20px)`"
|
|
|
- id="swScenes"
|
|
|
- v-if="currentScenesList.length > 0"
|
|
|
- >
|
|
|
- <ul class="swiper-wrapper">
|
|
|
- <li
|
|
|
- @click="tabCurrentScene(item)"
|
|
|
- class="swiper-slide"
|
|
|
+ <div class="bar-list" v-if="metadata?.navigationTrees?.length">
|
|
|
+ <div class="top-con" v-show="currentScenesList.length">
|
|
|
+ <div v-if="currentScenesList.length" class="scene-list swiper-container" ref="scene-swiper" :style="`width:${scenesListW > 1150 ? '100%' : scenesListW + 'px'}`">
|
|
|
+ <!-- <div class="scene-list swiper-container" ref="scene-swiper"> -->
|
|
|
+ <div class="swiper-wrapper scene-wrapper">
|
|
|
+ <!-- <div
|
|
|
+ class="swiper-slide scene-slide"
|
|
|
:class="{
|
|
|
- active: currentScene.sceneCode == item.sceneCode,
|
|
|
+ active: currentScene.id == item.id ||currentScene.id == item.sid ,
|
|
|
+ disabled: isLockV4Scene,
|
|
|
// loopspan:
|
|
|
// item.sceneTitle.length > spanlength &&
|
|
|
// currentScene.id == item.id,
|
|
|
}"
|
|
|
- :style="{ backgroundImage: `url(${item.icon})` }"
|
|
|
- v-for="(item, i) in currentScenesList"
|
|
|
- :key="i"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="iconfont"
|
|
|
- :class="
|
|
|
- item.type == '4dkk' ? 'icon-editor_3d' : 'icon-editor_panoramic'
|
|
|
- "
|
|
|
- ></i>
|
|
|
- <div class="marquee">
|
|
|
- <marquee-text
|
|
|
- :repeat="1"
|
|
|
- :duration="Math.ceil(item.sceneTitle.length / 10) * 5"
|
|
|
- :key="item.id"
|
|
|
- v-if="
|
|
|
- item.sceneTitle.length > spanlength &&
|
|
|
- currentScene.id == item.id
|
|
|
- "
|
|
|
- >
|
|
|
- {{ item.sceneTitle }}
|
|
|
- </marquee-text>
|
|
|
- <span v-else>
|
|
|
- {{ item.sceneTitle }}
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div
|
|
|
- class="swiper-container swiper2"
|
|
|
- id="swSecondary"
|
|
|
- :style="`width:${clamp(secondaryW, 0, 1150)}px`"
|
|
|
- v-if="secondaryList.length > 1"
|
|
|
- >
|
|
|
- <!-- {{ clamp(secondaryW, 0, 1150) }} -->
|
|
|
- <ul class="swiper-wrapper">
|
|
|
- <li
|
|
|
- class="swiper-slide"
|
|
|
- @click="tabSecondary(item, i)"
|
|
|
+ v-for="(item, index) in currentScenesList"
|
|
|
+ > -->
|
|
|
+ <div
|
|
|
+ class="swiper-slide scene-slide"
|
|
|
:class="{
|
|
|
- active: currentSecondary.id == item.id,
|
|
|
+ active: currentScene.id == item.id || (currentScene.sid && currentScene.sid == item.sid),
|
|
|
+
|
|
|
// loopspan:
|
|
|
- // fixTitle(item.name).length > spanlength &&
|
|
|
- // currentSecondary.id == item.id,
|
|
|
+ // item.sceneTitle.length > spanlength &&
|
|
|
+ // currentScene.id == item.id,
|
|
|
}"
|
|
|
- v-for="(item, i) in secondaryList"
|
|
|
- :key="i"
|
|
|
+ v-for="(item, index) in currentScenesList"
|
|
|
>
|
|
|
- <!-- {{ Math.ceil(fixTitle(item.name).length / 10) }} -->
|
|
|
-
|
|
|
- <marquee-text
|
|
|
- :duration="Math.ceil(fixTitle(item.name).length / 10) * 5"
|
|
|
- :key="item.id"
|
|
|
- :repeat="1"
|
|
|
- v-if="
|
|
|
- fixTitle(item.name).length > spanlength &&
|
|
|
- currentSecondary.id == item.id
|
|
|
- "
|
|
|
- >
|
|
|
- {{ fixTitle(item.name) }}
|
|
|
- </marquee-text>
|
|
|
- <span v-else>
|
|
|
- {{ fixTitle(item.name) }}
|
|
|
- </span>
|
|
|
- <!-- <span v-if="currentSecondary.id == item.id">{{
|
|
|
- fixTitle(item.name)
|
|
|
- }}</span>
|
|
|
- <span v-else>{{
|
|
|
- fixTitle(item.name).length > spanlength
|
|
|
- ? fixTitle(item.name).slice(0, spanlength)
|
|
|
- : fixTitle(item.name)
|
|
|
- }}</span> -->
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
+ <div @click="tabCurrentScene(item, index)" class="scene-content" :style="`background-image:url(${item.icon});`">
|
|
|
+ <!-- <img :src="i.icon" alt="" /> -->
|
|
|
+
|
|
|
+ <i class="iconfont" :class="item.type == '4dkk' ? 'icon-editor_3d' : 'icon-editor_panoramic'"></i>
|
|
|
+ <div class="marquee">
|
|
|
+ <marquee-text :repeat="1" :duration="Math.ceil(item.name.length / 10) * 5" :key="item.id" v-if="item.name.length > spanlength && currentScene.id == item.id">
|
|
|
+ {{ item.name }}
|
|
|
+ </marquee-text>
|
|
|
+ <span v-else>
|
|
|
+ {{ item.name }}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="second-group-box" v-if="metadata?.navigationTrees[rootTabIndex]">
|
|
|
+ <div v-if="metadata?.navigationTrees[rootTabIndex]?.children[0]?.type == 'group' && showSecondTab" class="second-group-list swiper-container" ref="second-group-swiper">
|
|
|
+ <div class="swiper-wrapper second-group-wrapper">
|
|
|
+ <template v-for="(item, index) in metadata?.navigationTrees[rootTabIndex]?.children">
|
|
|
+ <div
|
|
|
+ class="swiper-slide second-group-slide"
|
|
|
+ @click="tabSecond(item)"
|
|
|
+ v-if="item.children.length"
|
|
|
+ :class="{ active: currentSecondId == item.id, loopspan: fixTitle(item.name).length > spanlength && currentSecondId == item.id }"
|
|
|
+ >
|
|
|
+ <div class="second-group-content">
|
|
|
+ <marquee-text :duration="Math.ceil(fixTitle(item.name).length / 10) * 5" :key="item.id" :repeat="1" v-if="fixTitle(item.name).length > spanlength && currentSecondId == item.id">
|
|
|
+ {{ fixTitle(item.name) }}
|
|
|
+ </marquee-text>
|
|
|
+ <span v-else>
|
|
|
+ {{ fixTitle(item.name) }}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div class="bottom-com">
|
|
|
+ <div v-if="metadata?.navigationTrees?.length > 1" :style="`width:${catalogRootW}px;`" class="root-group-list swiper-container" ref="root-group">
|
|
|
+ <div class="swiper-wrapper root-group-wrapper">
|
|
|
+ <div
|
|
|
+ class="swiper-slide root-group-slide"
|
|
|
+ :class="{
|
|
|
+ active: currentRootId == item.id,
|
|
|
|
|
|
- <div
|
|
|
- class="swiper-container"
|
|
|
- id="swcatalogRoot"
|
|
|
- :style="`width:${catalogRootW > innerW ? '100%' : catalogRootW + 'px'}`"
|
|
|
- v-if="metadata.catalogRoot.length > 0 && metadata.catalogs.length > 1"
|
|
|
- >
|
|
|
- <ul class="swiper-wrapper" v-if="metadata.catalogRoot.length > 1">
|
|
|
- <li
|
|
|
- class="swiper-slide"
|
|
|
- :class="{
|
|
|
- active: currentCatalogRoot.id == item.id,
|
|
|
- // loopspan:
|
|
|
- // fixTitle(item.name).length > spanlength &&
|
|
|
- // currentCatalogRoot.id == item.id,
|
|
|
- }"
|
|
|
- @click="tabRoot(item)"
|
|
|
- v-for="(item, i) in metadata.catalogRoot"
|
|
|
- :key="i"
|
|
|
- >
|
|
|
- <!-- <span v-if="currentCatalogRoot.id == item.id">{{
|
|
|
- fixTitle(item.name)
|
|
|
- }}</span>
|
|
|
- <span v-else>{{
|
|
|
- fixTitle(item.name).length > spanlength
|
|
|
- ? fixTitle(item.name).slice(0, spanlength)
|
|
|
- : fixTitle(item.name)
|
|
|
- }}</span> -->
|
|
|
-
|
|
|
- <marquee-text
|
|
|
- :duration="Math.ceil(fixTitle(item.name).length / 10) * 5"
|
|
|
- :key="item.id"
|
|
|
- :repeat="1"
|
|
|
- v-if="
|
|
|
- fixTitle(item.name).length > spanlength &&
|
|
|
- currentCatalogRoot.id == item.id
|
|
|
- "
|
|
|
+ loopspan: fixTitle(item.name).length > spanlength && currentRootId.id == item.id,
|
|
|
+ }"
|
|
|
+ v-for="(item, index) in metadata?.navigationTrees"
|
|
|
+ @click="tabRoot(item)"
|
|
|
>
|
|
|
- {{ fixTitle(item.name) }}
|
|
|
- </marquee-text>
|
|
|
- <span v-else>
|
|
|
- {{ fixTitle(item.name) }}
|
|
|
- </span>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
+ <div class="root-group-content">
|
|
|
+ <marquee-text :duration="Math.ceil(fixTitle(item.name).length / 10) * 5" :key="item.id" :repeat="1" v-if="fixTitle(item.name).length > spanlength && currentRootId == item.id">
|
|
|
+ {{ fixTitle(item.name) }}
|
|
|
+ </marquee-text>
|
|
|
+ <span v-else>
|
|
|
+ {{ fixTitle(item.name) }}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import {
|
|
|
- ref,
|
|
|
- watch,
|
|
|
- computed,
|
|
|
- onMounted,
|
|
|
- nextTick,
|
|
|
- unref,
|
|
|
- watchEffect,
|
|
|
-} from "vue";
|
|
|
+import { ref, watch, computed, onMounted, nextTick, unref, watchEffect } from "vue";
|
|
|
import { useStore } from "vuex";
|
|
|
import { useApp } from "@/app";
|
|
|
import MarqueeText from "vue-marquee-text-component";
|
|
@@ -179,69 +109,62 @@ const spanlength = ref(5);
|
|
|
const metadata = computed(() => store.getters["scene/metadata"]);
|
|
|
const scenes = computed(() => store.getters["scene/list"]);
|
|
|
const currentScene = computed(() => store.getters["scene/currentScene"]);
|
|
|
+const currentSecondId = computed(() => store.getters["scene/currentSecondId"]);
|
|
|
+const currentRootId = computed(() => store.getters["scene/currentRootId"]);
|
|
|
|
|
|
-const clamp = computed(
|
|
|
- () => (num, min, max) => Math.min(Math.max(num, min), max)
|
|
|
-);
|
|
|
+const clamp = computed(() => (num, min, max) => Math.min(Math.max(num, min), max));
|
|
|
|
|
|
-const currentCatalogRoot = computed(
|
|
|
- () => store.getters["scene/currentCatalogRoot"]
|
|
|
-);
|
|
|
-const currentSecondary = computed(
|
|
|
- () => store.getters["scene/currentSecondary"]
|
|
|
-);
|
|
|
+const currentCatalogRoot = computed(() => store.getters["scene/currentCatalogRoot"]);
|
|
|
+const currentSecondary = computed(() => store.getters["scene/currentSecondary"]);
|
|
|
|
|
|
const secondaryList = computed(() => store.getters["scene/secondaryList"]);
|
|
|
|
|
|
-const isShowScenesList = computed(
|
|
|
- () => store.getters["functions/isShowScenesList"]
|
|
|
-);
|
|
|
+const isShowScenesList = computed(() => store.getters["functions/isShowScenesList"]);
|
|
|
|
|
|
-const currentScenesList = computed(
|
|
|
- () => store.getters["scene/currentScenesList"]
|
|
|
-);
|
|
|
+const currentScenesList = computed(() => store.getters["scene/currentScenesList"]);
|
|
|
|
|
|
const show = ref(false);
|
|
|
|
|
|
+watch(
|
|
|
+ () => currentScenesList.value,
|
|
|
+ () => {
|
|
|
+ nextTick(() => {
|
|
|
+ initSceneSwiper();
|
|
|
+ initRootGroupSwiper();
|
|
|
+ if (metadata.value.navigationTrees[currentRootId.value]?.children[currentSecondId.value]?.type == "group") {
|
|
|
+ initSecondGroupSwiper();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+);
|
|
|
const swidth = ref({
|
|
|
swcatalogRoot: 104,
|
|
|
swSecondary: 84,
|
|
|
swScenes: 72,
|
|
|
});
|
|
|
|
|
|
-const scenesListW = computed(
|
|
|
- () => currentScenesList.value.length * (swidth.value["swScenes"] + 10) - 10
|
|
|
-);
|
|
|
-const secondaryW = computed(
|
|
|
- () => secondaryList.value.length * (swidth.value["swSecondary"] + 10) - 10
|
|
|
-);
|
|
|
-const catalogRootW = computed(
|
|
|
- () =>
|
|
|
- metadata.value.catalogRoot.length * (swidth.value["swcatalogRoot"] + 10) -
|
|
|
- 10
|
|
|
-);
|
|
|
-const innerW = computed(() => 1150);
|
|
|
+const SceneSwiper = ref(null);
|
|
|
+const SecondGroupSwiper = ref(null);
|
|
|
+const rootGroupSwiper = ref(null);
|
|
|
|
|
|
-const tabCurrentScene = (data) => {
|
|
|
- console.log("tabCurrentScene", data.id, currentScene.value.id);
|
|
|
- if (data.id !== currentScene.value.id) {
|
|
|
- store.commit("scene/setCurrentScene", data);
|
|
|
- setTimeout(() => {
|
|
|
- scenesSwiperFocus();
|
|
|
- }, 300);
|
|
|
- } else {
|
|
|
- console.log("重复点击当前导航");
|
|
|
- // window.alert("alert-test-->重复点击当前导航");
|
|
|
- }
|
|
|
-};
|
|
|
+const rootTabIndex = computed(() => {
|
|
|
+ console.error(currentRootId.value);
|
|
|
+ return metadata.value && metadata.value?.navigationTrees ? metadata.value?.navigationTrees.findIndex((item) => item.id == currentRootId.value) : 0;
|
|
|
+});
|
|
|
|
|
|
-const tabSecondary = (data, index) => {
|
|
|
- store.commit("scene/setCurrentSecondary", data);
|
|
|
-};
|
|
|
+const secondTabIndex = computed(() => {
|
|
|
+ return metadata.value && metadata.value?.navigationTrees ? metadata.value.navigationTrees[rootTabIndex.value]?.children.findIndex((item) => item.id == currentSecondId.value) : 0;
|
|
|
+});
|
|
|
|
|
|
-const tabRoot = (data) => {
|
|
|
- store.commit("scene/setCurrentCatalogRoot", data);
|
|
|
-};
|
|
|
+const showSecondTab = computed(() => {
|
|
|
+ return metadata.value && metadata.value?.navigationTrees ? metadata.value?.navigationTrees[rootTabIndex.value].children.some((item) => item.id != currentSecondId.value) : false;
|
|
|
+});
|
|
|
+
|
|
|
+const scenesListW = computed(() => currentScenesList.value.length * (swidth.value["swScenes"] + 10));
|
|
|
+const secondaryW = computed(() => metadata.value.navigationTrees[secondTabIndex.value].length * (swidth.value["swSecondary"] + 10));
|
|
|
+const catalogRootW = computed(() => metadata.value.navigationTrees.length * (swidth.value["swcatalogRoot"] + 10));
|
|
|
+
|
|
|
+const innerW = computed(() => 1150);
|
|
|
|
|
|
const fixTitle = (name) => {
|
|
|
if (name == "默认二级分组") {
|
|
@@ -267,323 +190,265 @@ const swiperOptions = {
|
|
|
},
|
|
|
};
|
|
|
|
|
|
-// const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
|
+const tabRoot = (item) => {
|
|
|
+ store.commit("scene/setData", { currentRootId: item.id });
|
|
|
+ // changeSceneList();
|
|
|
+};
|
|
|
+const tabSecond = (item) => {
|
|
|
+ store.commit("scene/setData", { currentSecondId: item.id });
|
|
|
+ let sceneList = metadata.value.navigationTrees[rootTabIndex.value].children[secondTabIndex.value].children;
|
|
|
+ store.commit("scene/setCurrentScenesList", sceneList);
|
|
|
+ // this.changeSceneList();
|
|
|
+};
|
|
|
+const changeSceneList = () => {
|
|
|
+ let currentList = null;
|
|
|
+
|
|
|
+ if (metadata.value.navigationTrees[rootTabIndex.value].children.length && metadata.value.navigationTrees[rootTabIndex.value].children[0].type == "group") {
|
|
|
+ store.commit("scene/setData", { currentSecondId: metadata.value.navigationTrees[rootTabIndex.value].children[0].id });
|
|
|
+ currentList = metadata.value.navigationTrees[rootTabIndex.value].children[secondTabIndex.value].children;
|
|
|
+ store.commit("scene/setCurrentScenesList", currentList);
|
|
|
+ }
|
|
|
|
|
|
-const initMainSwiper = () => {
|
|
|
+ if (secondTabIndex.value == -1) {
|
|
|
+ console.error("没有二级目录");
|
|
|
+ let rootList = metadata.value.navigationTrees.find((item) => item.id == currentRootId.value);
|
|
|
+ store.commit("scene/setCurrentScenesList", rootList.children);
|
|
|
+ }
|
|
|
nextTick(() => {
|
|
|
- if (window.mainNatSwiper) {
|
|
|
- // window.mainNatSwiper = null;
|
|
|
- window.mainNatSwiper.update();
|
|
|
- window.sencordNatSwiper.slideReset();
|
|
|
+ initSceneSwiper();
|
|
|
+ initRootGroupSwiper();
|
|
|
+ if (metadata.value.navigationTrees[currentRootId.value]?.children[currentSecondId.value]?.type == "group") {
|
|
|
+ initSecondGroupSwiper();
|
|
|
}
|
|
|
- window.mainNatSwiper = new Swiper("#swcatalogRoot", swiperOptions);
|
|
|
});
|
|
|
};
|
|
|
-const initsencordNatSwiper = () => {
|
|
|
+const initSceneSwiper = () => {
|
|
|
+ if (SceneSwiper.value) {
|
|
|
+ SceneSwiper.value.destroy();
|
|
|
+ SceneSwiper.value = null;
|
|
|
+ }
|
|
|
+ if (!currentScenesList.value.length) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
nextTick(() => {
|
|
|
- console.warn("initsencordNatSwiper");
|
|
|
- if (window.sencordNatSwiper) {
|
|
|
- window.sencordNatSwiper.update();
|
|
|
- window.sencordNatSwiper.slideReset();
|
|
|
- }
|
|
|
- window.sencordNatSwiper = new Swiper("#swSecondary", swiperOptions);
|
|
|
+ SceneSwiper.value = new Swiper(".scene-list", swiperOptions);
|
|
|
});
|
|
|
};
|
|
|
-const initScenesSwiper = () => {
|
|
|
- // console.warn("initScenesSwiper");
|
|
|
+const tabCurrentScene = (data, index) => {
|
|
|
+ store.commit("scene/setCurrentScene", data);
|
|
|
+
|
|
|
+ SceneSwiper.value.slideTo(index);
|
|
|
+};
|
|
|
+const initSecondGroupSwiper = () => {
|
|
|
+ if (SecondGroupSwiper.value) {
|
|
|
+ SecondGroupSwiper.value.destroy();
|
|
|
+ SecondGroupSwiper.value = null;
|
|
|
+ }
|
|
|
+
|
|
|
nextTick(() => {
|
|
|
- if (window.scenesNatSwiper) {
|
|
|
- try {
|
|
|
- window.scenesNatSwiper.slides.length > 0 && window.scenesNatSwiper.update();
|
|
|
- window.scenesNatSwiper.slideReset();
|
|
|
- } catch (error) {}
|
|
|
-
|
|
|
- // window.scenesNatSwiper = null;
|
|
|
- } else {
|
|
|
- window.scenesNatSwiper = new Swiper("#swScenes", {
|
|
|
- ...swiperOptions,
|
|
|
- });
|
|
|
- }
|
|
|
- scenesSwiperFocus();
|
|
|
+ SecondGroupSwiper.value = new Swiper(".second-group-list", swiperOptions);
|
|
|
});
|
|
|
};
|
|
|
|
|
|
-const scenesSwiperFocus = () => {
|
|
|
- const sceneIndex = Array.from(currentScenesList.value).findIndex(
|
|
|
- (item) => item.id === currentScene.value.id
|
|
|
- );
|
|
|
- if (window.scenesNatSwiper && window.scenesNatSwiper.slides.length > 0) {
|
|
|
- const index = sceneIndex < 0 ? 0 : sceneIndex;
|
|
|
- const fIndex = index < 5 ? 0 : index;
|
|
|
- console.warn("scenesSwiperFocus", fIndex);
|
|
|
- window.scenesNatSwiper.slideTo(fIndex);
|
|
|
+const tabCurrentSecondGroup = (data, index) => {
|
|
|
+ // store.commit("scene/setCurrentScene", data);
|
|
|
+
|
|
|
+ SecondGroupSwiper.value.slideTo(index);
|
|
|
+};
|
|
|
+
|
|
|
+const initRootGroupSwiper = () => {
|
|
|
+ // if (rootGroupSwiper.value) {
|
|
|
+ // rootGroupSwiper.value.destroy();
|
|
|
+ // rootGroupSwiper.value = null;
|
|
|
+ // }
|
|
|
+ // nextTick(() => {
|
|
|
+ // rootGroupSwiper.value = new Swiper(".root-group-list", swiperOptions);
|
|
|
+ // });
|
|
|
+
|
|
|
+ if (!rootGroupSwiper.value) {
|
|
|
+ rootGroupSwiper.value = new Swiper(".root-group-list", swiperOptions);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-const sencordNatSwiperFocus = () => {
|
|
|
- nextTick(() => {
|
|
|
- const current = Array.from(secondaryList.value).findIndex(
|
|
|
- (item) => item.id === currentSecondary.value.id
|
|
|
- );
|
|
|
- if (window.sencordNatSwiper) {
|
|
|
- const index = current < 0 ? 0 : current;
|
|
|
- console.warn("sencordNatSwiperFocus", index);
|
|
|
- // window.sencordNatSwiper.slideTo(current);
|
|
|
- window.sencordNatSwiper.slideTo(current);
|
|
|
- }
|
|
|
- });
|
|
|
+const tabCurrentRootGroup = (data, index) => {
|
|
|
+ // store.commit("scene/setCurrentScene", data);
|
|
|
+
|
|
|
+ SecondGroupSwiper.value.slideTo(index);
|
|
|
};
|
|
|
|
|
|
onMounted(() => {
|
|
|
useApp().then(async (app) => {
|
|
|
show.value = true;
|
|
|
- });
|
|
|
- watchEffect(() => {
|
|
|
- if (
|
|
|
- metadata.value.catalogRoot &&
|
|
|
- unref(metadata.value.catalogRoot).length > 0
|
|
|
- ) {
|
|
|
- initMainSwiper();
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- watch([currentSecondary, secondaryList], () => {
|
|
|
- if (unref(secondaryList).length > 1) {
|
|
|
- initsencordNatSwiper();
|
|
|
- sencordNatSwiperFocus();
|
|
|
- } else {
|
|
|
- if (window.sencordNatSwiper) {
|
|
|
- console.warn("destroy-sencordNatSwiper");
|
|
|
- window.sencordNatSwiper.update();
|
|
|
- window.sencordNatSwiper.slideReset();
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- watch(currentScenesList, () => {
|
|
|
- initScenesSwiper();
|
|
|
- });
|
|
|
- watch(currentCatalogRoot, (val) => {
|
|
|
- if (Array.from(unref(val).children).includes(currentScene.value.category)) {
|
|
|
- //当前场景在一类的children
|
|
|
- const activeSecond = Array.from(unref(secondaryList)).find(
|
|
|
- (i) => i.id === currentScene.value.category
|
|
|
- );
|
|
|
- // console.log("activeSecond", activeSecond);
|
|
|
- store.commit("scene/setCurrentSecondary", activeSecond);
|
|
|
- if (window.sencordNatSwiper) {
|
|
|
- window.sencordNatSwiper.update();
|
|
|
- }
|
|
|
- }
|
|
|
+ console.error("app", show.value);
|
|
|
});
|
|
|
});
|
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" scoped>
|
|
|
-$width: 1150px;
|
|
|
+<style lang="less" scoped>
|
|
|
+@width: 1150px;
|
|
|
+.swiper-slide {
|
|
|
+ cursor: pointer;
|
|
|
+ &.loopspan {
|
|
|
+ > span,
|
|
|
+ > div > span {
|
|
|
+ animation: 5s wordsLoop linear infinite normal;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
.bar-list {
|
|
|
position: absolute;
|
|
|
- bottom: 68px;
|
|
|
+ bottom: 28px;
|
|
|
left: 50%;
|
|
|
transform: translateX(-50%);
|
|
|
text-align: center;
|
|
|
- max-width: $width;
|
|
|
+ max-width: @width;
|
|
|
overflow: hidden;
|
|
|
- max-height: 0;
|
|
|
transition: 0.3s all ease;
|
|
|
- z-index: 9;
|
|
|
-
|
|
|
- .swiper-container {
|
|
|
- width: 100%;
|
|
|
- position: relative;
|
|
|
- margin: 0 auto;
|
|
|
-
|
|
|
- > ul {
|
|
|
- > li {
|
|
|
- white-space: nowrap;
|
|
|
-
|
|
|
- > span,
|
|
|
- > div > span {
|
|
|
+ .top-con {
|
|
|
+ display: inline-block;
|
|
|
+ margin: 0 auto 10px;
|
|
|
+ padding: 10px 6px;
|
|
|
+ overflow: hidden;
|
|
|
+ background: linear-gradient(268deg, transparent, rgba(0, 0, 0, 0.4) 25%, rgba(0, 0, 0, 0.4) 75%, transparent);
|
|
|
+ .scene-list {
|
|
|
+ max-width: @width;
|
|
|
+ margin: 0 auto;
|
|
|
+ // display: inline-block;
|
|
|
+
|
|
|
+ .scene-wrapper {
|
|
|
+ .scene-slide {
|
|
|
+ margin: 0 5px;
|
|
|
+ // white-space: nowrap;
|
|
|
cursor: pointer;
|
|
|
- display: inline-block;
|
|
|
- color: rgba(255, 255, 255, 0.6);
|
|
|
- }
|
|
|
-
|
|
|
- &.loopspan {
|
|
|
- > span,
|
|
|
- > div > span {
|
|
|
- animation: 10s wordsLoop linear infinite normal;
|
|
|
+ width: 72px;
|
|
|
+ height: 72px;
|
|
|
+ border-radius: 6px;
|
|
|
+ border: 1px solid #fff;
|
|
|
+ background-size: cover;
|
|
|
+ position: relative;
|
|
|
+ overflow: hidden;
|
|
|
+ &.active {
|
|
|
+ border: 1px solid #0076f6;
|
|
|
+ .marquee {
|
|
|
+ color: #fff !important;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- &.active {
|
|
|
- > span,
|
|
|
- > div > span {
|
|
|
- color: rgba(255, 255, 255, 1);
|
|
|
+ .scene-content {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ background-size: cover;
|
|
|
+ position: relative;
|
|
|
+
|
|
|
+ img {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ pointer-events: none;
|
|
|
+ object-fit: cover;
|
|
|
+ }
|
|
|
+ > .iconfont {
|
|
|
+ position: absolute;
|
|
|
+ left: 4px;
|
|
|
+ top: 4px;
|
|
|
+ z-index: 99;
|
|
|
+ text-shadow: 0px 0px 4px rgb(0, 0, 0, 0.3);
|
|
|
+ }
|
|
|
+ .marquee {
|
|
|
+ position: absolute;
|
|
|
+ bottom: 0;
|
|
|
+ left: 0;
|
|
|
+ height: 20px;
|
|
|
+ background: rgba(0, 0, 0, 0.5);
|
|
|
+ width: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ color: rgba(255, 255, 255, 0.6);
|
|
|
+ > span {
|
|
|
+ width: 100%;
|
|
|
+ line-height: 20px;
|
|
|
+ word-break: keep-all;
|
|
|
+ display: inline-block;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- .top-con {
|
|
|
- margin: 0 auto 10px;
|
|
|
- padding: 10px 0;
|
|
|
- background: linear-gradient(
|
|
|
- 268deg,
|
|
|
- rgba(0, 0, 0, 0) 0%,
|
|
|
- rgba(0, 0, 0, 0.4) 25%,
|
|
|
- rgba(0, 0, 0, 0.4) 75%,
|
|
|
- rgba(0, 0, 0, 0) 100%
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- #swcatalogRoot {
|
|
|
- > ul {
|
|
|
- > li {
|
|
|
- width: 104px;
|
|
|
- background: rgba(0, 0, 0, 0.5);
|
|
|
- border-radius: 4px;
|
|
|
- padding: 4px 10px;
|
|
|
- border: 1px solid rgba(255, 255, 255, 0.5);
|
|
|
- box-sizing: border-box;
|
|
|
- overflow: hidden;
|
|
|
-
|
|
|
- > span {
|
|
|
- width: 100%;
|
|
|
- word-break: keep-all;
|
|
|
- }
|
|
|
|
|
|
- &.active {
|
|
|
- border: 1px solid rgba(255, 255, 255, 1);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- #swSecondary {
|
|
|
- margin: 20px auto 10px;
|
|
|
-
|
|
|
- > ul {
|
|
|
- > li {
|
|
|
- width: 84px;
|
|
|
- box-sizing: border-box;
|
|
|
- overflow: hidden;
|
|
|
- padding-bottom: 6px;
|
|
|
-
|
|
|
- > span {
|
|
|
- width: 100%;
|
|
|
- word-break: keep-all;
|
|
|
- }
|
|
|
-
|
|
|
- &.active {
|
|
|
- position: relative;
|
|
|
-
|
|
|
- &::before {
|
|
|
- content: "";
|
|
|
- display: inline-block;
|
|
|
- position: absolute;
|
|
|
- bottom: 0;
|
|
|
- width: 20px;
|
|
|
- height: 2px;
|
|
|
- z-index: 9999;
|
|
|
- left: 50%;
|
|
|
- transform: translateX(-50%);
|
|
|
- background: var(--colors-primary-base);
|
|
|
+ .second-group-box {
|
|
|
+ .second-group-list {
|
|
|
+ max-width: @width;
|
|
|
+ margin: 0 auto;
|
|
|
+ display: inline-block;
|
|
|
+
|
|
|
+ .second-group-wrapper {
|
|
|
+ .second-group-slide {
|
|
|
+ width: 84px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ overflow: hidden;
|
|
|
+ padding-bottom: 6px;
|
|
|
+ cursor: pointer;
|
|
|
+ margin: 0 5px;
|
|
|
+ white-space: nowrap;
|
|
|
+ color: hsla(0, 0%, 100%, 0.6);
|
|
|
+ margin: 20px auto 10px;
|
|
|
+ &.active {
|
|
|
+ color: #fff;
|
|
|
+
|
|
|
+ &::before {
|
|
|
+ content: "";
|
|
|
+ display: inline-block;
|
|
|
+ position: absolute;
|
|
|
+ bottom: 0;
|
|
|
+ width: 20px;
|
|
|
+ height: 2px;
|
|
|
+ z-index: 9999;
|
|
|
+ left: 50%;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ background: #0076f6;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .second-group-content {
|
|
|
+ // width: 100%;
|
|
|
+ // height: 100%;
|
|
|
+ // background-size: cover;
|
|
|
+ // position: relative;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- #swScenes {
|
|
|
- > ul {
|
|
|
- > li {
|
|
|
- cursor: pointer;
|
|
|
- width: 72px;
|
|
|
- height: 72px;
|
|
|
- border-radius: 6px;
|
|
|
- border: 1px solid #ffffff;
|
|
|
- background-size: cover;
|
|
|
- position: relative;
|
|
|
- overflow: hidden;
|
|
|
-
|
|
|
- .iconfont {
|
|
|
- position: absolute;
|
|
|
- left: 4px;
|
|
|
- top: 4px;
|
|
|
- z-index: 99;
|
|
|
-
|
|
|
- &::after {
|
|
|
- background: rgba(0, 0, 0, 0.3);
|
|
|
- content: "";
|
|
|
- width: 14px;
|
|
|
- height: 14px;
|
|
|
- display: inline-block;
|
|
|
- position: absolute;
|
|
|
- top: 50%;
|
|
|
- left: 50%;
|
|
|
- transform: translate(-50%, -50%);
|
|
|
- z-index: -1;
|
|
|
- filter: blur(4px);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- > div {
|
|
|
- position: absolute;
|
|
|
- bottom: 0;
|
|
|
- left: 0;
|
|
|
- height: 20px;
|
|
|
+ .bottom-com {
|
|
|
+ .root-group-list {
|
|
|
+ max-width: @width;
|
|
|
+ margin: 0 auto;
|
|
|
+ .swiper-wrapper {
|
|
|
+ }
|
|
|
+ .root-group-wrapper {
|
|
|
+ .root-group-slide {
|
|
|
+ width: 104px;
|
|
|
background: rgba(0, 0, 0, 0.5);
|
|
|
- width: 100%;
|
|
|
+ border-radius: 4px;
|
|
|
+ padding: 4px 10px;
|
|
|
+ border: 1px solid hsla(0, 0%, 100%, 0.5);
|
|
|
+ box-sizing: border-box;
|
|
|
overflow: hidden;
|
|
|
+ margin: 0 5px;
|
|
|
+ white-space: nowrap;
|
|
|
+ color: hsla(0, 0%, 100%, 0.6);
|
|
|
|
|
|
- > span,
|
|
|
- div {
|
|
|
- // width: 100%;
|
|
|
- line-height: 20px;
|
|
|
- word-break: keep-all;
|
|
|
- white-space: normal;
|
|
|
+ &.active {
|
|
|
+ border: 1px solid #fff;
|
|
|
+ color: #fff;
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- &.active {
|
|
|
- border: 1px solid var(--colors-primary-base);
|
|
|
-
|
|
|
- > div {
|
|
|
- > span {
|
|
|
- }
|
|
|
+ .root-group-content {
|
|
|
+ width: 100%;
|
|
|
+ word-break: keep-all;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-.barshow {
|
|
|
- max-height: 190px;
|
|
|
-}
|
|
|
-
|
|
|
-@keyframes wordsLoop {
|
|
|
- 0% {
|
|
|
- transform: translateX(100%);
|
|
|
- -webkit-transform: translateX(100%);
|
|
|
- }
|
|
|
- 100% {
|
|
|
- transform: translateX(-180%);
|
|
|
- -webkit-transform: translateX(-180%);
|
|
|
- }
|
|
|
-}
|
|
|
-.marquee {
|
|
|
- .marquee-text-wrap {
|
|
|
- height: 20px;
|
|
|
- line-height: 20px;
|
|
|
- }
|
|
|
-}
|
|
|
-</style>
|
|
|
-<style>
|
|
|
-.marquee-text-text {
|
|
|
- padding: 0 5px;
|
|
|
-}
|
|
|
</style>
|