luguang 3 weeks ago
parent
commit
17dcbfd4ba
1 changed files with 16 additions and 7 deletions
  1. 16 7
      src/views/index.vue

+ 16 - 7
src/views/index.vue

@@ -189,15 +189,24 @@ export default {
             spaceBetween: 5
           }
         }
-        this.dayInfoList = retObj.dayList
+        if (retObj.dayList.length > 0) {
+          this.dayInfoList = retObj.dayList
+        }
         if (this.dayInfoList.length > 1) {
-          this.$set(
-            this.swiperOptionsTop,
-            'autoplay',
-            this.defSecuritiesAutoplay
-          )
+          this.swiperOptionsTop = {
+            direction: 'vertical',
+            // 循环不间断图片连在一起
+            loop: true,
+            // 循环时间(毫秒)
+            autoplay: this.defSecuritiesAutoplay,
+            speed: 1000
+          }
         } else {
-          this.$set(this.swiperOptionsTop, 'autoplay', 0)
+          this.swiperOptionsTop = {
+            direction: 'vertical',
+            // 循环时间(毫秒)
+            autoplay: 0,
+          }
         }
         this.proportionInfo = retObj.proportionInfo
         this.planList = retObj.planList