Commit 1d9667a250df877802e0d1d69aa19a4d68a61f56

Authored by 张旭
1 parent 515d428c

全部课程cell复用 , 没有register全部cell导致; 修改detail X位置

metaCode/Classes/Main/HomePage/Controller/CNUpSlideDetailViewController.swift
... ... @@ -48,7 +48,7 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController {
48 48  
49 49 lazy var closeBtn: UIButton = {
50 50 let btn = UIButton()
51   - btn.frame = CGRect(x: KSreenWidth - 20 - 30, y: 20, width: 30, height: 30)
  51 + btn.frame = CGRect(x: KSreenWidth - 20 - 30, y: KStatusBarHeight+20, width: 30, height: 30)
52 52 btn.setImage(#imageLiteral(resourceName: "close_button"), for: .normal)
53 53 btn.addTarget(self, action: #selector(closeAction), for: .touchUpInside)
54 54 return btn
... ...
metaCode/Classes/Main/HomePage/Controller/CNUpSlideViewController.swift
... ... @@ -19,9 +19,10 @@ let SlideModelTypeOneCourse75: String = "75"//75单课程大图
19 19  
20 20 class CNUpSlideViewController: CNLiveBaseViewController,UITableViewDelegate,UITableViewDataSource{
21 21  
22   - let kCNLiveDownSlideCellIdentifier = "kCNLiveDownSlideCellIdentifier"
  22 + let kCNLiveDownSlideAllCourseCellIdentifier = "kCNLiveDownSlideAllCourseCellIdentifier"
23 23 let kCNLiveDownSlideRecommendCellIdentifier = "kCNLiveDownSlideRecommendCellIdentifier"
24 24 let kCNLiveDownSlideTodayRecommendCellIdentifier = "kCNLiveDownSlideTodayRecommendCellIdentifier"
  25 + let kCNLiveDownSlideSingleCourseCellIdentifier = "kCNLiveDownSlideSingleCourseCellIdentifier"
25 26  
26 27 var totolNum = 0//一共显示多少行cell
27 28  
... ... @@ -73,7 +74,11 @@ class CNUpSlideViewController: CNLiveBaseViewController,UITableViewDelegate,UITa
73 74 tableView.dataSource = self
74 75 tableView.delegate = self
75 76 tableView.separatorStyle = .none
76   - tableView.register(CNDownSlideSingleCourseCell.self, forCellReuseIdentifier: kCNLiveDownSlideCellIdentifier)
  77 +// tableView.register(CNDownSlideSingleCourseCell.self, forCellReuseIdentifier: kCNLiveDownSlideCellIdentifier)
  78 + tableView.register(CNLiveDownSlideRecommendCell.self, forCellReuseIdentifier: kCNLiveDownSlideRecommendCellIdentifier)
  79 + tableView.register(CNLiveDownSlideTodayRecommendCell.self, forCellReuseIdentifier: kCNLiveDownSlideTodayRecommendCellIdentifier)
  80 + tableView.register(CNDownSlideSingleCourseCell.self, forCellReuseIdentifier: kCNLiveDownSlideAllCourseCellIdentifier)
  81 + tableView.register(CNDownSlideSingleCourseCell.self, forCellReuseIdentifier:kCNLiveDownSlideSingleCourseCellIdentifier)
77 82 tableView.backgroundColor = HexColor(kCNDownSlideBackgroundColorHex)
78 83 return tableView
79 84 }()
... ... @@ -115,7 +120,7 @@ class CNUpSlideViewController: CNLiveBaseViewController,UITableViewDelegate,UITa
115 120 cell.slideModel = slideModel
116 121 return cell
117 122 }else if slideModel.type == SlideModelTypeAllCourse12{
118   - guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideCellIdentifier) as? CNDownSlideSingleCourseCell
  123 + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideAllCourseCellIdentifier) as? CNDownSlideSingleCourseCell
119 124 else {
120 125 let cell = CNDownSlideSingleCourseCell()
121 126 cell.slideModel = slideModel
... ... @@ -124,7 +129,7 @@ class CNUpSlideViewController: CNLiveBaseViewController,UITableViewDelegate,UITa
124 129 cell.slideModel = slideModel
125 130 return cell
126 131 }else if slideModel.type == SlideModelTypeOneCourse75{
127   - guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideCellIdentifier) as? CNDownSlideSingleCourseCell
  132 + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideSingleCourseCellIdentifier) as? CNDownSlideSingleCourseCell
128 133 else {
129 134 let cell = CNDownSlideSingleCourseCell()
130 135 cell.slideModel = slideModel
... ...