Commit 67ffb2cb96e42e43ad3aa08e3358ce837ed4491d

Authored by “张旭”
1 parent f80f38d8

下滑页可能数据越界问题

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