瀏覽代碼

美博会楼层内容为空时bug修复

yuwenjun 4 年之前
父節點
當前提交
294fffa8ed
共有 1 個文件被更改,包括 82 次插入78 次删除
  1. 82 78
      src/main/resources/static/js/activity/activityTopic.js

+ 82 - 78
src/main/resources/static/js/activity/activityTopic.js

@@ -109,40 +109,42 @@ var activity = new Vue({
         initFloorListPc: function (floorList) {
             var _that = this
             floorList.forEach(function (list) {
-                var tempType = list.floorContent.templateType
-                switch (tempType) {
-                    case '1':
-                        list.floorImageList = _that.swiperDataFormat(
-                            list.floorImageList,
-                            12
-                        )
-                        break
-                    case '2':
-                    case '6':
-                        list.floorImageList = _that.swiperDataFormat(list.floorImageList, 6)
-                        break
-                    case '3':
-                    case '9':
-                        list.floorImageList = _that.swiperDataFormat(list.floorImageList, 4)
-                        break
-                    case '11':
-                    case '12':
-                    case '13':
-                    case '15':
-                    case '17':
-                    case '19':
-                    case '20':
-                        list.floorImageList.length > 5 && (list.isPageMore = true)
-                        break
-                    case '14':
-                        list.floorImageList.length > 10 && (list.isPageMore = true)
-                        break
-                    case '16':
-                    case '18':
-                        list.floorImageList.length > 7 && (list.isPageMore = true)
-                        break
-                    default:
-                        break
+                if (list.floorContent) {
+                    var tempType = list.floorContent.templateType
+                    switch (tempType) {
+                        case '1':
+                            list.floorImageList = _that.swiperDataFormat(
+                                list.floorImageList,
+                                12
+                            )
+                            break
+                        case '2':
+                        case '6':
+                            list.floorImageList = _that.swiperDataFormat(list.floorImageList, 6)
+                            break
+                        case '3':
+                        case '9':
+                            list.floorImageList = _that.swiperDataFormat(list.floorImageList, 4)
+                            break
+                        case '11':
+                        case '12':
+                        case '13':
+                        case '15':
+                        case '17':
+                        case '19':
+                        case '20':
+                            list.floorImageList.length > 5 && (list.isPageMore = true)
+                            break
+                        case '14':
+                            list.floorImageList.length > 10 && (list.isPageMore = true)
+                            break
+                        case '16':
+                        case '18':
+                            list.floorImageList.length > 7 && (list.isPageMore = true)
+                            break
+                        default:
+                            break
+                    }
                 }
             })
         },
@@ -150,50 +152,52 @@ var activity = new Vue({
         initFloorListMobile: function (floorList) {
             var _that = this
             floorList.forEach(function (list) {
-                var tempType = list.floorContent.templateType
-                switch (tempType) {
-                    case '1':
-                        list.floorImageList = _that.swiperDataFormat(list.floorImageList, 8)
-                        break
-                    case '2':
-                        list.floorImageList = _that.swiperDataFormat(list.floorImageList, 6)
-                        break
-                    case '9':
-                        list.floorImageList.length > 2 && (list.isPageMore = true)
-                        list.floorImageList = _that.swiperDataFormat(list.floorImageList, 4)
-                        break
-                    case '21':
-                        list.floorImageList = _that.swiperDataFormat(list.floorImageList, 4)
-                        break
-                    case '3':
-                    case '6':
-                        list.floorImageList.length > 4 && (list.isPageMore = true)
-                        break
-                    case '4':
-                    case '8':
-                        list.floorImageList.length > 2 && (list.isPageMore = true)
-                        break
-                    case '10':
-                        list.floorImageList.length > 1 && (list.isPageMore = true)
-                        break
-                    case '11':
-                    case '12':
-                    case '13':
-                    case '15':
-                        list.floorImageList.length > 2 && (list.isPageMore = true)
-                        break
-                    case '14':
-                    case '19':
-                    case '20':
-                        list.floorImageList.length > 4 && (list.isPageMore = true)
-                        break
-                    case '16':
-                    case '17':
-                    case '18':
-                        list.floorImageList.length > 3 && (list.isPageMore = true)
-                        break
-                    default:
-                        break
+                if (list.floorContent) {
+                    var tempType = list.floorContent.templateType
+                    switch (tempType) {
+                        case '1':
+                            list.floorImageList = _that.swiperDataFormat(list.floorImageList, 8)
+                            break
+                        case '2':
+                            list.floorImageList = _that.swiperDataFormat(list.floorImageList, 6)
+                            break
+                        case '9':
+                            list.floorImageList.length > 2 && (list.isPageMore = true)
+                            list.floorImageList = _that.swiperDataFormat(list.floorImageList, 4)
+                            break
+                        case '21':
+                            list.floorImageList = _that.swiperDataFormat(list.floorImageList, 4)
+                            break
+                        case '3':
+                        case '6':
+                            list.floorImageList.length > 4 && (list.isPageMore = true)
+                            break
+                        case '4':
+                        case '8':
+                            list.floorImageList.length > 2 && (list.isPageMore = true)
+                            break
+                        case '10':
+                            list.floorImageList.length > 1 && (list.isPageMore = true)
+                            break
+                        case '11':
+                        case '12':
+                        case '13':
+                        case '15':
+                            list.floorImageList.length > 2 && (list.isPageMore = true)
+                            break
+                        case '14':
+                        case '19':
+                        case '20':
+                            list.floorImageList.length > 4 && (list.isPageMore = true)
+                            break
+                        case '16':
+                        case '17':
+                        case '18':
+                            list.floorImageList.length > 3 && (list.isPageMore = true)
+                            break
+                        default:
+                            break
+                    }
                 }
             })
         },