|
@@ -1,159 +1,110 @@
|
|
|
<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="bar-list" v-if="metadata?.navigationTrees?.length" :class="{ barshow: isShowScenesList }">
|
|
|
+ <div class="top-con" v-show="currentScenesList.length">
|
|
|
<div
|
|
|
- class="swiper-container"
|
|
|
+ ref="scene-swiper"
|
|
|
+ class="scene-list swiper-container"
|
|
|
id="swScenes"
|
|
|
:style="`width:${Math.min(scenesListW, innerW)}px;
|
|
|
padding:${scenesListW > innerW ? '0 15px' : '0'}`"
|
|
|
v-if="currentScenesList.length > 0"
|
|
|
>
|
|
|
<ul class="swiper-wrapper">
|
|
|
- <li
|
|
|
- @click="tabCurrentScene(item)"
|
|
|
- class="swiper-slide"
|
|
|
- :class="{
|
|
|
- active: currentScene.sceneCode == item.sceneCode,
|
|
|
- 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>
|
|
|
+ <template v-for="(item, i) in currentScenesList" :key="item.id">
|
|
|
+ <li
|
|
|
+ @click="tabCurrentScene(item)"
|
|
|
+ class="swiper-slide"
|
|
|
+ :style="`background-image:url(${item.icon});`"
|
|
|
+ :class="{
|
|
|
+ active: currentScene.sceneCode == item.sceneCode,
|
|
|
+ loopspan: item.name.length > spanlength && currentScene.id == item.id,
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <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>
|
|
|
+ </li>
|
|
|
+ </template>
|
|
|
</ul>
|
|
|
</div>
|
|
|
|
|
|
<div
|
|
|
- class="swiper-container"
|
|
|
+ class="swiper-container second-group-list"
|
|
|
+ ref="second-group-swiper"
|
|
|
id="swSecondary"
|
|
|
:style="`width:${Math.min(secondaryW, innerW)}px;
|
|
|
padding:${secondaryW > innerW ? '0 15px' : '0'}`"
|
|
|
- v-if="secondaryList.length > 1"
|
|
|
+ v-if="metadata?.navigationTrees[rootTabIndex] && metadata?.navigationTrees[rootTabIndex]?.children[0]?.type == 'group' && showSecondTab"
|
|
|
>
|
|
|
<ul class="swiper-wrapper">
|
|
|
- <li
|
|
|
- class="swiper-slide"
|
|
|
- @click="tabSecondary(item)"
|
|
|
- :class="{
|
|
|
- active: currentSecondary.id == item.id,
|
|
|
- loopspan:
|
|
|
- fixTitle(item.name).length > spanlength &&
|
|
|
- currentSecondary.id == item.id,
|
|
|
- }"
|
|
|
- v-for="(item, i) in secondaryList"
|
|
|
- :key="i"
|
|
|
- >
|
|
|
- <marquee-text
|
|
|
- :duration="Math.ceil(fixTitle(item.name).length / 10) * 5"
|
|
|
+ <template v-for="(item, i) in metadata?.navigationTrees[rootTabIndex]?.children">
|
|
|
+ <li
|
|
|
+ class="swiper-slide"
|
|
|
+ @click="tabSecond(item, i)"
|
|
|
+ :class="{
|
|
|
+ active: currentSecondId == item.id,
|
|
|
+ loopspan: fixTitle(item.name).length > spanlength && currentSecondId == item.id,
|
|
|
+ }"
|
|
|
:key="item.id"
|
|
|
- :repeat="1"
|
|
|
- v-if="
|
|
|
- fixTitle(item.name).length > spanlength &&
|
|
|
- currentSecondary.id == item.id
|
|
|
- "
|
|
|
+ v-if="item.children.length"
|
|
|
>
|
|
|
- {{ fixTitle(item.name) }}
|
|
|
- </marquee-text>
|
|
|
- <span v-else>
|
|
|
- {{ fixTitle(item.name) }}
|
|
|
- </span>
|
|
|
- </li>
|
|
|
+ <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>
|
|
|
+ </li>
|
|
|
+ </template>
|
|
|
</ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div
|
|
|
- class="swiper-container"
|
|
|
+ class="swiper-container root-group-list"
|
|
|
+ ref="root-group"
|
|
|
id="swcatalogRoot"
|
|
|
:style="`width:${Math.min(catalogRootW, innerW)}px;
|
|
|
padding:${catalogRootW > innerW ? '0 15px' : '0'}`"
|
|
|
- v-if="metadata.catalogRoot.length > 0 && metadata.catalogs.length > 1"
|
|
|
+ v-if="metadata?.navigationTrees?.length > 1"
|
|
|
>
|
|
|
- <ul class="swiper-wrapper" v-show="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"
|
|
|
- >
|
|
|
- <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
|
|
|
- "
|
|
|
+ <ul class="swiper-wrapper">
|
|
|
+ <template v-for="(item, i) in metadata?.navigationTrees" :key="item.id">
|
|
|
+ <li
|
|
|
+ v-if="item.children.length"
|
|
|
+ class="swiper-slide"
|
|
|
+ :class="{
|
|
|
+ active: currentRootId == item.id,
|
|
|
+ loopspan: fixTitle(item.name).length > spanlength && currentRootId == item.id,
|
|
|
+ }"
|
|
|
+ @click="tabRoot(item, i)"
|
|
|
>
|
|
|
- {{ fixTitle(item.name) }}
|
|
|
- </marquee-text>
|
|
|
- <span v-else>
|
|
|
- {{ fixTitle(item.name) }}
|
|
|
- </span>
|
|
|
- </li>
|
|
|
+ <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>
|
|
|
+ </li>
|
|
|
+ </template>
|
|
|
</ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import {
|
|
|
- ref,
|
|
|
- unref,
|
|
|
- watch,
|
|
|
- watchEffect,
|
|
|
- computed,
|
|
|
- onMounted,
|
|
|
- nextTick,
|
|
|
-} 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";
|
|
|
import { useI18n, getLocale } from "@/i18n";
|
|
|
const { t } = useI18n({ useScope: "global" });
|
|
|
-import MarqueeText from "vue-marquee-text-component";
|
|
|
|
|
|
const store = useStore();
|
|
|
|
|
@@ -162,66 +113,81 @@ 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 currentCatalogRoot = computed(
|
|
|
- () => store.getters["scene/currentCatalogRoot"]
|
|
|
-);
|
|
|
-const currentSecondary = computed(
|
|
|
- () => store.getters["scene/currentSecondary"]
|
|
|
-);
|
|
|
+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 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);
|
|
|
const swidth = ref({
|
|
|
swcatalogRoot: 104,
|
|
|
swSecondary: 84,
|
|
|
swScenes: 72,
|
|
|
});
|
|
|
|
|
|
-const innerW = computed(() => window.innerWidth);
|
|
|
-
|
|
|
-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 SceneSwiper = ref(null);
|
|
|
+const SecondGroupSwiper = ref(null);
|
|
|
+const rootGroupSwiper = ref(null);
|
|
|
|
|
|
-const show = ref(false);
|
|
|
+const rootTabIndex = computed(() => {
|
|
|
+ let idx = 0;
|
|
|
+ if (metadata.value && metadata.value?.navigationTrees) {
|
|
|
+ idx = metadata.value?.navigationTrees.findIndex((item) => item.id == currentRootId.value);
|
|
|
+ }
|
|
|
+ return idx;
|
|
|
+});
|
|
|
|
|
|
-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 secondTabIndex = computed(() => {
|
|
|
+ let idx = 0;
|
|
|
+ if (metadata.value && metadata.value?.navigationTrees) {
|
|
|
+ idx = metadata.value.navigationTrees[rootTabIndex.value]?.children.findIndex((item) => item.id == currentSecondId.value);
|
|
|
}
|
|
|
-};
|
|
|
+ return idx;
|
|
|
+});
|
|
|
|
|
|
-const tabSecondary = (data) => {
|
|
|
- store.commit("scene/setCurrentSecondary", data);
|
|
|
-};
|
|
|
+const showSecondTab = computed(() => {
|
|
|
+ return metadata.value && metadata.value?.navigationTrees ? metadata.value?.navigationTrees[rootTabIndex.value].children.some((item) => item.id != currentSecondId.value) : false;
|
|
|
+});
|
|
|
|
|
|
-const tabRoot = (data) => {
|
|
|
- store.commit("scene/setCurrentCatalogRoot", data);
|
|
|
-};
|
|
|
+const scenesListW = computed(() => currentScenesList.value.length * (swidth.value["swScenes"] + 10) - 10);
|
|
|
+const secondaryW = computed(() => metadata.value?.navigationTrees[rootTabIndex.value].children.chilength * (swidth.value["swSecondary"] + 10) - 10);
|
|
|
+const catalogRootW = computed(() => metadata.value.navigationTrees.length * (swidth.value["swcatalogRoot"] + 10) - 10);
|
|
|
+
|
|
|
+const innerW = computed(() => window.innerWidth);
|
|
|
+
|
|
|
+watch(
|
|
|
+ () => currentScenesList.value,
|
|
|
+ () => {
|
|
|
+ nextTick(() => {
|
|
|
+ initSceneSwiper();
|
|
|
+ initRootGroupSwiper();
|
|
|
+
|
|
|
+ // if (metadata.value.navigationTrees[rootTabIndex.value]?.children[secondTabIndex.value]?.type == "group") {
|
|
|
+ // initSecondGroupSwiper();
|
|
|
+ // }
|
|
|
+ });
|
|
|
+ }
|
|
|
+);
|
|
|
+watch(
|
|
|
+ () => rootTabIndex.value,
|
|
|
+ (val) => {
|
|
|
+ console.error(val);
|
|
|
+ nextTick(() => {
|
|
|
+ if (metadata.value.navigationTrees[rootTabIndex.value]?.children[secondTabIndex.value]?.type == "group") {
|
|
|
+ initSecondGroupSwiper();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+);
|
|
|
|
|
|
const fixTitle = (name) => {
|
|
|
if (name == "默认二级分组") {
|
|
@@ -233,7 +199,6 @@ const fixTitle = (name) => {
|
|
|
}
|
|
|
return name;
|
|
|
};
|
|
|
-
|
|
|
const swiperOptions = {
|
|
|
slidesPerView: "auto",
|
|
|
centeredSlides: true,
|
|
@@ -245,96 +210,115 @@ const swiperOptions = {
|
|
|
sticky: false,
|
|
|
},
|
|
|
};
|
|
|
+const tabRoot = (item, index) => {
|
|
|
+ store.commit("scene/setData", { currentRootId: item.id });
|
|
|
+ store.commit("scene/setData", { currentSecondId: null });
|
|
|
+ changeSceneList();
|
|
|
+ setTimeout(() => {
|
|
|
+ rootGroupSwiper.value.slideTo(index);
|
|
|
+ SecondGroupSwiper.value.slideTo(rootTabIndex.value);
|
|
|
+ }, 0);
|
|
|
+};
|
|
|
+const tabSecond = (item, index) => {
|
|
|
+ store.commit("scene/setData", { currentSecondId: item.id });
|
|
|
+ let sceneList = metadata.value.navigationTrees[rootTabIndex.value].children[secondTabIndex.value].children;
|
|
|
+ store.commit("scene/setCurrentScenesList", sceneList);
|
|
|
|
|
|
-// const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
|
+ //
|
|
|
|
|
|
-const initMainSwiper = () => {
|
|
|
+ setTimeout(() => {
|
|
|
+ SecondGroupSwiper.value.slideTo(index);
|
|
|
+ }, 0);
|
|
|
+
|
|
|
+ // 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);
|
|
|
+ }
|
|
|
+
|
|
|
+ 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.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(() => {
|
|
|
- if (window.sencordNatSwiper) {
|
|
|
- window.sencordNatSwiper.update();
|
|
|
- window.sencordNatSwiper.slideReset();
|
|
|
- }
|
|
|
- window.sencordNatSwiper = new Swiper("#swSecondary", swiperOptions);
|
|
|
+ SceneSwiper.value = new Swiper(".scene-list", swiperOptions);
|
|
|
+ let index = currentScenesList.value.findIndex((item) => item.id == currentScene.value.id);
|
|
|
+ SceneSwiper.value.slideTo(index);
|
|
|
});
|
|
|
};
|
|
|
-const initScenesSwiper = () => {
|
|
|
- // console.warn("initScenesSwiper");
|
|
|
+const tabCurrentScene = (data, index) => {
|
|
|
+ store.commit("scene/setCurrentScene", data);
|
|
|
+
|
|
|
+ SceneSwiper.value.slideTo(index);
|
|
|
+};
|
|
|
+const initSecondGroupSwiper = () => {
|
|
|
+ console.error("initSecondGroupSwiper");
|
|
|
+ if (SecondGroupSwiper.value) {
|
|
|
+ SecondGroupSwiper.value.destroy();
|
|
|
+ SecondGroupSwiper.value = null;
|
|
|
+ }
|
|
|
+
|
|
|
nextTick(() => {
|
|
|
- if (window.scenesNatSwiper) {
|
|
|
- window.scenesNatSwiper.slides.length > 0 &&
|
|
|
- window.scenesNatSwiper.update();
|
|
|
- window.scenesNatSwiper.slideReset();
|
|
|
- // window.scenesNatSwiper = null;
|
|
|
- } else {
|
|
|
- window.scenesNatSwiper = new Swiper("#swScenes", {
|
|
|
- ...swiperOptions,
|
|
|
- });
|
|
|
- }
|
|
|
- scenesSwiperFocus();
|
|
|
+ SecondGroupSwiper.value = new Swiper(".second-group-list", swiperOptions);
|
|
|
+ SecondGroupSwiper.value.slideTo(secondTabIndex.value);
|
|
|
});
|
|
|
};
|
|
|
|
|
|
-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);
|
|
|
+ rootGroupSwiper.value.slideTo(rootTabIndex.value);
|
|
|
+ initSecondGroupSwiper();
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-const sencordNatSwiperFocus = () => {
|
|
|
- nextTick(() => {
|
|
|
- const current = Array.from(secondaryList.value).findIndex(
|
|
|
- (item) => item.id === currentSecondary.value.id
|
|
|
- );
|
|
|
- if (window.sencordNatSwiper && window.sencordNatSwiper.slides.length > 0) {
|
|
|
- console.warn("current-sencordNatSwiper-index", 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, () => {
|
|
|
- if (unref(secondaryList).length > 1) {
|
|
|
- initsencordNatSwiper();
|
|
|
- sencordNatSwiperFocus();
|
|
|
- } else {
|
|
|
- if (window.sencordNatSwiper) {
|
|
|
- console.warn("destroy-sencordNatSwiper");
|
|
|
- window.sencordNatSwiper.update();
|
|
|
- window.sencordNatSwiper.slideReset();
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- watch(currentScenesList, () => {
|
|
|
- initScenesSwiper();
|
|
|
+ console.error("app", show.value);
|
|
|
});
|
|
|
});
|
|
|
</script>
|