فهرست منبع

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

zhanghe 6 سال پیش
والد
کامیت
cc46090afe
1فایلهای تغییر یافته به همراه8 افزوده شده و 13 حذف شده
  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();
     }