Commit 67ffb2cb96e42e43ad3aa08e3358ce837ed4491d
1 parent
f80f38d8
下滑页可能数据越界问题
Showing
2 changed files
with
8 additions
and
8 deletions
metaCode/Classes/Main/HomePage/Controller/DownSlideController/CNUpSlideViewController.swift
| ... | ... | @@ -180,17 +180,17 @@ class CNUpSlideViewController: CNLiveBaseViewController,UITableViewDelegate,UITa |
| 180 | 180 | cell.myCurriculum = myCurriculumModel |
| 181 | 181 | return cell |
| 182 | 182 | }else{ |
| 183 | - let slideModel = self.dataArray[indexPath.row] as! CNLiveDownSlideModel | |
| 183 | + let slideModel = self.dataArray[indexPath.row] as? CNLiveDownSlideModel | |
| 184 | 184 | |
| 185 | 185 | //type=4一排两个 推荐课程&推荐活动; 74今日推荐; 12列表全部课程; 75单课程大图 |
| 186 | - if slideModel.type == SlideModelTypeRecommend4{ | |
| 186 | + if slideModel?.type == SlideModelTypeRecommend4{ | |
| 187 | 187 | guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideRecommendCellIdentifier) as? CNLiveDownSlideRecommendCell |
| 188 | 188 | else { |
| 189 | 189 | return CNLiveDownSlideRecommendCell() |
| 190 | 190 | } |
| 191 | 191 | cell.slideModel = slideModel |
| 192 | 192 | return cell |
| 193 | - }else if slideModel.type == SlideModelTypeTodayRecommend74{ | |
| 193 | + }else if slideModel?.type == SlideModelTypeTodayRecommend74{ | |
| 194 | 194 | guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideTodayRecommendCellIdentifier) as? CNLiveDownSlideTodayRecommendCell |
| 195 | 195 | else { |
| 196 | 196 | let cell = CNLiveDownSlideTodayRecommendCell() |
| ... | ... | @@ -199,7 +199,7 @@ class CNUpSlideViewController: CNLiveBaseViewController,UITableViewDelegate,UITa |
| 199 | 199 | } |
| 200 | 200 | cell.slideModel = slideModel |
| 201 | 201 | return cell |
| 202 | - }else if slideModel.type == SlideModelTypeAllCourse12{ | |
| 202 | + }else if slideModel?.type == SlideModelTypeAllCourse12{ | |
| 203 | 203 | guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideAllCourseCellIdentifier) as? CNDownSlideSingleCourseCell |
| 204 | 204 | else { |
| 205 | 205 | let cell = CNDownSlideSingleCourseCell() |
| ... | ... | @@ -208,7 +208,7 @@ class CNUpSlideViewController: CNLiveBaseViewController,UITableViewDelegate,UITa |
| 208 | 208 | } |
| 209 | 209 | cell.slideModel = slideModel |
| 210 | 210 | return cell |
| 211 | - }else if slideModel.type == SlideModelTypeOneCourse75{ | |
| 211 | + }else if slideModel?.type == SlideModelTypeOneCourse75{ | |
| 212 | 212 | guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideSingleCourseCellIdentifier) as? CNDownSlideSingleCourseCell |
| 213 | 213 | else { |
| 214 | 214 | let cell = CNDownSlideSingleCourseCell() |
| ... | ... | @@ -301,8 +301,8 @@ class CNUpSlideViewController: CNLiveBaseViewController,UITableViewDelegate,UITa |
| 301 | 301 | let cellH = DownSlideAllCourseTitleH + DownSlideAllCourseRowH * CGFloat(totalNum)+DownSlideRecommendLeftGap |
| 302 | 302 | return cellH |
| 303 | 303 | }else{ |
| 304 | - let slideModel = self.dataArray[indexPath.row] as! CNLiveDownSlideModel | |
| 305 | - return CGFloat(slideModel.cellH) | |
| 304 | + let slideModel = self.dataArray[indexPath.row] as? CNLiveDownSlideModel | |
| 305 | + return CGFloat(slideModel?.cellH ?? 0) | |
| 306 | 306 | } |
| 307 | 307 | } |
| 308 | 308 | ... | ... |
metaCode/Classes/Main/MinePage/ViewModel/CNLiveMineBaseModel.swift
| ... | ... | @@ -144,7 +144,7 @@ final class StandListModel: BaseModel {//, TableCodable { |
| 144 | 144 | var backgroundImg: String = ""//首页背景图- |
| 145 | 145 | var upGuideImg: String = ""//顶部引导图GiF url- |
| 146 | 146 | var downGuideImg: String = ""//底部引导图GiF url- |
| 147 | - var backgroundColor: String = kCNDownSlideBackgroundColorHex//企业认证按钮背景色- | |
| 147 | + var backgroundColor: String = kCNDownSlideBackgroundColorHex//企业认证按钮背景色&&认证背景颜色 | |
| 148 | 148 | var atPersonageColour: String = kCNDownSlideBackgroundColorHex//个人认证按钮背景色- |
| 149 | 149 | var backgroundColour: String = ""//- |
| 150 | 150 | var tipsColour: String = ""//-企业,机构 提醒文本颜色 | ... | ... |