|
@@ -281,6 +281,7 @@ const initMainSwiper = () => {
|
|
|
};
|
|
|
const initsencordNatSwiper = () => {
|
|
|
nextTick(() => {
|
|
|
+ console.warn("initsencordNatSwiper");
|
|
|
if (window.sencordNatSwiper) {
|
|
|
window.sencordNatSwiper.update();
|
|
|
window.sencordNatSwiper.slideReset();
|
|
@@ -317,11 +318,10 @@ const scenesSwiperFocus = () => {
|
|
|
|
|
|
const sencordNatSwiperFocus = () => {
|
|
|
nextTick(() => {
|
|
|
- console.log("currentSecondary", currentSecondary.value);
|
|
|
const current = Array.from(secondaryList.value).findIndex(
|
|
|
(item) => item.id === currentSecondary.value.id
|
|
|
);
|
|
|
- if (window.sencordNatSwiper && window.sencordNatSwiper.slides.length > 0) {
|
|
|
+ if (window.sencordNatSwiper) {
|
|
|
const index = current < 0 ? 0 : current;
|
|
|
console.warn("sencordNatSwiperFocus", index);
|
|
|
// window.sencordNatSwiper.slideTo(current);
|
|
@@ -343,7 +343,7 @@ onMounted(() => {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- watch(currentSecondary, () => {
|
|
|
+ watch([currentSecondary, secondaryList], () => {
|
|
|
if (unref(secondaryList).length > 1) {
|
|
|
initsencordNatSwiper();
|
|
|
sencordNatSwiperFocus();
|
|
@@ -359,6 +359,19 @@ onMounted(() => {
|
|
|
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();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
</script>
|
|
|
|
|
@@ -565,3 +578,8 @@ $width: 1150px;
|
|
|
}
|
|
|
}
|
|
|
</style>
|
|
|
+<style>
|
|
|
+.marquee-text-text {
|
|
|
+ padding: 0 5px;
|
|
|
+}
|
|
|
+</style>
|