Explorar o código

:bug: 解决退出登录再次登录海报banner消失bug

zhanghe %!s(int64=6) %!d(string=hai) anos
pai
achega
cc46090afe
Modificáronse 1 ficheiros con 8 adicións e 13 borrados
  1. 8 13
      src/stage/index/scene/WaterFallIndexScene.js

+ 8 - 13
src/stage/index/scene/WaterFallIndexScene.js

@@ -78,19 +78,14 @@ class WaterfallIndexScene extends scene {
         let container = document.getElementById('advert-carousel');
         container.innerHTML = swiperHTML;
         // 创建swiper对象
-        if (!this.advertSwiper) {
-            this.advertSwiper = new Swiper('.swiper-container-advert', {
-                direction: 'horizontal',
-                autoplay: true,
-                pagination: {
-                    el: '.swiper-pagination-advert',
-                    bulletElement: 'li',
-                },
-            });
-        // 更新swiper对象
-        } else {
-            this.advertSwiper.updateSlides();
-        }
+        this.advertSwiper = new Swiper('.swiper-container-advert', {
+            direction: 'horizontal',
+            autoplay: true,
+            pagination: {
+                el: '.swiper-pagination-advert',
+                bulletElement: 'li',
+            },
+        });
         this.moye.root.reRender();
     }