Commit f2d87c2b8ddcb3618fd76a272b7affbc1ec732d0
1 parent
b409e70d
竖版短剧详情页
Showing
7 changed files
with
228 additions
and
23 deletions
metaCode.xcodeproj/project.pbxproj
| ... | ... | @@ -107,6 +107,7 @@ |
| 107 | 107 | 1965FA422AFB79EA00F0F435 /* CNLiveGoodsCategoryController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1965FA412AFB79EA00F0F435 /* CNLiveGoodsCategoryController.swift */; }; |
| 108 | 108 | 197325D22BB11C18002E41A3 /* DatabaseManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 197325D12BB11C18002E41A3 /* DatabaseManager.swift */; }; |
| 109 | 109 | 19864E3F2BEF6A3300586E72 /* CNLiveDownSlideRealHotListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19864E3E2BEF6A3300586E72 /* CNLiveDownSlideRealHotListCell.swift */; }; |
| 110 | + 19864E412BF6090400586E72 /* CNLiveDuanJuDetailCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19864E402BF6090400586E72 /* CNLiveDuanJuDetailCell.swift */; }; | |
| 110 | 111 | 19AB90642BB412C700B6A79B /* CNLiveDownslideOperationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19AB90632BB412C700B6A79B /* CNLiveDownslideOperationManager.swift */; }; |
| 111 | 112 | 19AD65AA2BA041210045A444 /* CNLiveGoodsDetailsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19AD65A92BA041210045A444 /* CNLiveGoodsDetailsTableViewCell.swift */; }; |
| 112 | 113 | 19AD65AC2BA16CF20045A444 /* CNLiveShopCommentRequestShareModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19AD65AB2BA16CF20045A444 /* CNLiveShopCommentRequestShareModel.swift */; }; |
| ... | ... | @@ -390,6 +391,7 @@ |
| 390 | 391 | 1965FA412AFB79EA00F0F435 /* CNLiveGoodsCategoryController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveGoodsCategoryController.swift; sourceTree = "<group>"; }; |
| 391 | 392 | 197325D12BB11C18002E41A3 /* DatabaseManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DatabaseManager.swift; sourceTree = "<group>"; }; |
| 392 | 393 | 19864E3E2BEF6A3300586E72 /* CNLiveDownSlideRealHotListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDownSlideRealHotListCell.swift; sourceTree = "<group>"; }; |
| 394 | + 19864E402BF6090400586E72 /* CNLiveDuanJuDetailCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDuanJuDetailCell.swift; sourceTree = "<group>"; }; | |
| 393 | 395 | 19AB90632BB412C700B6A79B /* CNLiveDownslideOperationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDownslideOperationManager.swift; sourceTree = "<group>"; }; |
| 394 | 396 | 19AD65A92BA041210045A444 /* CNLiveGoodsDetailsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveGoodsDetailsTableViewCell.swift; sourceTree = "<group>"; }; |
| 395 | 397 | 19AD65AB2BA16CF20045A444 /* CNLiveShopCommentRequestShareModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopCommentRequestShareModel.swift; sourceTree = "<group>"; }; |
| ... | ... | @@ -817,6 +819,7 @@ |
| 817 | 819 | 1938BD442B4E49CA00390A34 /* CNLiveDuanjuTitleCell.swift */, |
| 818 | 820 | 1938BD372B4BDC2500390A34 /* CNLiveAlbumImageCell.swift */, |
| 819 | 821 | 1938BD3C2B4BDD4B00390A34 /* CNLiveAlbumCell.swift */, |
| 822 | + 19864E402BF6090400586E72 /* CNLiveDuanJuDetailCell.swift */, | |
| 820 | 823 | ); |
| 821 | 824 | path = HomepageDetail; |
| 822 | 825 | sourceTree = "<group>"; |
| ... | ... | @@ -1789,6 +1792,7 @@ |
| 1789 | 1792 | 1917332F2B16C7C9007BCC04 /* CNLiveTimer.swift in Sources */, |
| 1790 | 1793 | 7CD675292A270F6A008354C1 /* WJColorChange.m in Sources */, |
| 1791 | 1794 | 1938BD172B3D6C7F00390A34 /* CNLiveAuthViewController.swift in Sources */, |
| 1795 | + 19864E412BF6090400586E72 /* CNLiveDuanJuDetailCell.swift in Sources */, | |
| 1792 | 1796 | 79F4B11C2A33036E00993C03 /* CNLiveMineInfoAlertView.swift in Sources */, |
| 1793 | 1797 | 79BB96A82AF223FB00AEA4AC /* CNLiveConfigAlertManager.swift in Sources */, |
| 1794 | 1798 | 19BB1FF02AF0E5B30094D962 /* CNLiveShopDetailModel.swift in Sources */, | ... | ... |
metaCode/Classes/Main/HomePage/Controller/DownSlideController/CNUpSlideDetailViewController.swift
| ... | ... | @@ -5,6 +5,7 @@ |
| 5 | 5 | // Created by zx on 2023/10/16. |
| 6 | 6 | // 认证-下滑页原生页-课程 大图课程详情页/全部课程详情页/我的课程详情页 |
| 7 | 7 | // 首页原生页--短剧 大图详情页 |
| 8 | +// 首页原生页--1横排2个短剧-详情页 | |
| 8 | 9 | |
| 9 | 10 | import Foundation |
| 10 | 11 | import MJRefresh |
| ... | ... | @@ -20,9 +21,14 @@ enum CNLiveHomePageCellType { |
| 20 | 21 | case playletToCourse |
| 21 | 22 | ///课程控制器->我的课程 |
| 22 | 23 | case courseToMyCurriculum |
| 24 | + ///短剧控制器->短剧列表(1排2个) | |
| 25 | + case playletList | |
| 23 | 26 | } |
| 24 | 27 | |
| 25 | 28 | let allCourseCellHeight:CGFloat = 75 |
| 29 | +let DuanJuDetailImageWidth:CGFloat = ((KSreenWidth-DownSlideRecommendLeftGap*3)/2) | |
| 30 | +let DuanJuDetailImageHeight:CGFloat = 239/165*DuanJuDetailImageWidth | |
| 31 | +let DuanJuDetailCellHeight:CGFloat = DuanJuDetailImageHeight+DownSlideRecommendLeftGap+10+20+36+10 | |
| 26 | 32 | |
| 27 | 33 | class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSource, UITableViewDelegate,EmptyDataSetSource, EmptyDataSetDelegate { |
| 28 | 34 | |
| ... | ... | @@ -191,6 +197,7 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSou |
| 191 | 197 | let kCNLiveCourseTitleCellIdentifier = "kCNLiveCourseTitleCellIdentifier" |
| 192 | 198 | let kCNLiveAlbumImageCellIdentifier = "kCNLiveAlbumImageCellIdentifier" |
| 193 | 199 | let kCNLiveAlbumCellIdentifier = "kCNLiveAlbumCellIdentifier" |
| 200 | + let kCNLiveDuanJuDetailCellIdentifier = "kCNLiveDuanJuDetailCellIdentifier" | |
| 194 | 201 | |
| 195 | 202 | var pageNum: NSInteger = 1 |
| 196 | 203 | var network_type: CNLiveMineResponseType! |
| ... | ... | @@ -211,7 +218,7 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSou |
| 211 | 218 | tableView.register(CNLiveAlbumCell.self, forCellReuseIdentifier: kCNLiveAlbumCellIdentifier) |
| 212 | 219 | tableView.register(CNLiveAlbumImageCell.self, forCellReuseIdentifier: kCNLiveAlbumImageCellIdentifier) |
| 213 | 220 | tableView.register(CNLiveDuanjuTitleCell.self, forCellReuseIdentifier: kCNLiveCourseTitleCellIdentifier) |
| 214 | - | |
| 221 | + tableView.register(CNLiveDuanJuDetailCell.self, forCellReuseIdentifier: kCNLiveDuanJuDetailCellIdentifier) | |
| 215 | 222 | return tableView |
| 216 | 223 | }() |
| 217 | 224 | |
| ... | ... | @@ -223,7 +230,13 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSou |
| 223 | 230 | if section == 0{ |
| 224 | 231 | return 1 |
| 225 | 232 | }else{ |
| 226 | - return self.dataArray.count | |
| 233 | + | |
| 234 | + if self.cellType == .playletList{ | |
| 235 | + let count = (self.dataArray.count + 1) / 2 | |
| 236 | + return count | |
| 237 | + }else{ | |
| 238 | + return self.dataArray.count | |
| 239 | + } | |
| 227 | 240 | } |
| 228 | 241 | } |
| 229 | 242 | |
| ... | ... | @@ -241,14 +254,18 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSou |
| 241 | 254 | cell.blockName = "我的课程" |
| 242 | 255 | return cell |
| 243 | 256 | }else{ |
| 244 | - if self.slideModel?.type == SlideModelTypeAllCourse12{ | |
| 257 | + if self.slideModel?.type == SlideModelTypeAllCourse12 || self.slideModel?.type == SlideModelTypeTwoDuanJu5{ | |
| 245 | 258 | //全部课程 |
| 246 | 259 | guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveCourseTitleCellIdentifier) as? CNLiveDuanjuTitleCell |
| 247 | 260 | else { |
| 248 | 261 | let cell = CNLiveDuanjuTitleCell() |
| 249 | 262 | return cell |
| 250 | 263 | } |
| 251 | - cell.cellType = .course | |
| 264 | + if self.slideModel?.type == SlideModelTypeAllCourse12{ | |
| 265 | + cell.cellType = .course | |
| 266 | + }else{ | |
| 267 | + cell.cellType = .playletList | |
| 268 | + } | |
| 252 | 269 | cell.blockName = self.slideModel?.blockName |
| 253 | 270 | return cell |
| 254 | 271 | |
| ... | ... | @@ -268,17 +285,39 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSou |
| 268 | 285 | }else{ |
| 269 | 286 | //列表cell |
| 270 | 287 | let albumModel = self.dataArray[indexPath.row] as! CNLiveAlbumModel |
| 288 | + if self.cellType == .playletList{ | |
| 289 | + //1横排2个短剧列表 | |
| 290 | + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDuanJuDetailCellIdentifier) as? CNLiveDuanJuDetailCell | |
| 291 | + else { | |
| 292 | + let cell = CNLiveDuanJuDetailCell() | |
| 293 | + return cell | |
| 294 | + } | |
| 271 | 295 | |
| 272 | - guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveAlbumCellIdentifier) as? CNLiveAlbumCell | |
| 273 | - else { | |
| 274 | - let cell = CNLiveAlbumCell() | |
| 296 | + let leftIndex = indexPath.row*2 | |
| 297 | + let rightIndex = indexPath.row*2+1 | |
| 298 | + let leftAlbumModel = self.dataArray[leftIndex] as! CNLiveAlbumModel | |
| 299 | + cell.albumModel = leftAlbumModel | |
| 300 | + if rightIndex < self.dataArray.count{ | |
| 301 | + let rightAlbumModel = self.dataArray[rightIndex] as! CNLiveAlbumModel | |
| 302 | + cell.rightAlbumModel = rightAlbumModel | |
| 303 | + } | |
| 304 | +// cell.enterBlock = { albumModel in | |
| 305 | +// CNLiveDownSlideTool.pushWebVCWithContentsMdl(model: albumModel.model, contentId: albumModel.contentId, pid: albumModel.pid, shareUrl: albumModel.shareUrl, thirdUrl: albumModel.thirdUrl, title: albumModel.title, s_to: albumModel.s_to, trailerId: albumModel.trailerId, controller: self) | |
| 306 | +// } | |
| 307 | + return cell | |
| 308 | + }else{ | |
| 309 | + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveAlbumCellIdentifier) as? CNLiveAlbumCell | |
| 310 | + else { | |
| 311 | + let cell = CNLiveAlbumCell() | |
| 312 | + return cell | |
| 313 | + } | |
| 314 | + cell.albumModel = albumModel | |
| 315 | + cell.enterBlock = { albumModel in | |
| 316 | + CNLiveDownSlideTool.pushWebVCWithContentsMdl(model: albumModel.model, contentId: albumModel.contentId, pid: albumModel.pid, shareUrl: albumModel.shareUrl, thirdUrl: albumModel.thirdUrl, title: albumModel.title, s_to: albumModel.s_to, trailerId: albumModel.trailerId, controller: self) | |
| 317 | + } | |
| 275 | 318 | return cell |
| 276 | 319 | } |
| 277 | - cell.albumModel = albumModel | |
| 278 | - cell.enterBlock = { albumModel in | |
| 279 | - CNLiveDownSlideTool.pushWebVCWithContentsMdl(model: albumModel.model, contentId: albumModel.contentId, pid: albumModel.pid, shareUrl: albumModel.shareUrl, thirdUrl: albumModel.thirdUrl, title: albumModel.title, s_to: albumModel.s_to, trailerId: albumModel.trailerId, controller: self) | |
| 280 | - } | |
| 281 | - return cell | |
| 320 | + | |
| 282 | 321 | } |
| 283 | 322 | return UITableViewCell() |
| 284 | 323 | } |
| ... | ... | @@ -292,7 +331,7 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSou |
| 292 | 331 | return KSreenWidth |
| 293 | 332 | } |
| 294 | 333 | }else{ |
| 295 | - return 75 | |
| 334 | + return DuanJuDetailCellHeight | |
| 296 | 335 | } |
| 297 | 336 | return 75 |
| 298 | 337 | } | ... | ... |
metaCode/Classes/Main/HomePages/Controller/HomeController/CNLiveAuthViewController.swift
| ... | ... | @@ -244,31 +244,43 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa |
| 244 | 244 | |
| 245 | 245 | }else if slideModel.type == SlideModelTypeTodayRecommend74{ |
| 246 | 246 | |
| 247 | - }else if slideModel.type == SlideModelTypeAllCourse12{ | |
| 247 | + }else if slideModel.type == SlideModelTypeAllCourse12 || slideModel.type == SlideModelTypeOneCourse75{ | |
| 248 | 248 | guard let cell = tableView.cellForRow(at: indexPath) as? CNDownSlideSingleCourseCell else { return } |
| 249 | 249 | selectedCell = cell |
| 250 | - | |
| 251 | 250 | let detailVC = CNSlideBaseNavigationController(rootViewController: CNUpSlideDetailViewController(cell: cell,slideModel: slideModel, albumModel: nil, cellType: cellType), cellType: cellType) |
| 252 | 251 | detailVC.dismissClosure = { [weak self] in |
| 253 | 252 | guard let StrongSelf = self else { return } |
| 254 | 253 | StrongSelf.updateStatusBarAndTabbarFrame(visible: true) |
| 255 | 254 | } |
| 256 | 255 | updateStatusBarAndTabbarFrame(visible: false) |
| 257 | - | |
| 258 | 256 | present(detailVC, animated: true, completion: nil) |
| 259 | - }else if slideModel.type == SlideModelTypeOneCourse75{ | |
| 257 | + }else if slideModel.type == SlideModelTypeTwoDuanJu5{ | |
| 258 | + //竖版短剧 | |
| 259 | + cellType = .playletList | |
| 260 | 260 | guard let cell = tableView.cellForRow(at: indexPath) as? CNDownSlideSingleCourseCell else { return } |
| 261 | 261 | selectedCell = cell |
| 262 | - let detailViewC = CNUpSlideDetailViewController(cell: cell,slideModel: slideModel, albumModel: nil, cellType: cellType) | |
| 263 | - let detailVC = CNSlideBaseNavigationController(rootViewController: detailViewC, cellType: cellType) | |
| 264 | - | |
| 262 | + let detailVC = CNSlideBaseNavigationController(rootViewController: CNUpSlideDetailViewController(cell: cell,slideModel: slideModel, albumModel: nil, cellType: cellType), cellType: cellType) | |
| 265 | 263 | detailVC.dismissClosure = { [weak self] in |
| 266 | 264 | guard let StrongSelf = self else { return } |
| 267 | 265 | StrongSelf.updateStatusBarAndTabbarFrame(visible: true) |
| 268 | 266 | } |
| 269 | 267 | updateStatusBarAndTabbarFrame(visible: false) |
| 270 | 268 | present(detailVC, animated: true, completion: nil) |
| 269 | + }else if slideModel.type == SlideModelTypeRealHotList7{ | |
| 270 | + //实时热榜 | |
| 271 | 271 | } |
| 272 | +// else if slideModel.type == SlideModelTypeOneCourse75{ | |
| 273 | +// guard let cell = tableView.cellForRow(at: indexPath) as? CNDownSlideSingleCourseCell else { return } | |
| 274 | +// selectedCell = cell | |
| 275 | +// let detailViewC = CNUpSlideDetailViewController(cell: cell,slideModel: slideModel, albumModel: nil, cellType: cellType) | |
| 276 | +// let detailVC = CNSlideBaseNavigationController(rootViewController: detailViewC, cellType: cellType) | |
| 277 | +// | |
| 278 | +// detailVC.dismissClosure = { [weak self] in | |
| 279 | +// guard let StrongSelf = self else { return } | |
| 280 | +// StrongSelf.updateStatusBarAndTabbarFrame(visible: true) | |
| 281 | +// } | |
| 282 | +// updateStatusBarAndTabbarFrame(visible: false) | |
| 283 | +// present(detailVC, animated: true, completion: nil) | |
| 272 | 284 | } |
| 273 | 285 | } |
| 274 | 286 | ... | ... |
metaCode/Classes/Main/HomePages/View/HomepageDetail/CNLiveDuanJuDetailCell.swift
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveDuanJuDetailCell.swift | |
| 3 | +// metaCode | |
| 4 | +// | |
| 5 | +// Created by zx on 2024/5/16. | |
| 6 | +// 1排2个短剧列表cell | |
| 7 | + | |
| 8 | +import Foundation | |
| 9 | +import QMUIKit | |
| 10 | + | |
| 11 | +class CNLiveDuanJuDetailCell:UITableViewCell{ | |
| 12 | + | |
| 13 | + | |
| 14 | + var cellType:CNLiveHomePageCellType = .playletList | |
| 15 | + | |
| 16 | + //AlbumModel | |
| 17 | + var _albumModel : CNLiveAlbumModel? | |
| 18 | + var albumModel : CNLiveAlbumModel? { | |
| 19 | + get{ | |
| 20 | + _albumModel | |
| 21 | + } | |
| 22 | + set{ | |
| 23 | + _albumModel = newValue! | |
| 24 | + self.setupNewUI(model: _albumModel!) | |
| 25 | + } | |
| 26 | + } | |
| 27 | + | |
| 28 | + //AlbumModel | |
| 29 | + var _rightAlbumModel : CNLiveAlbumModel? | |
| 30 | + var rightAlbumModel : CNLiveAlbumModel? { | |
| 31 | + get{ | |
| 32 | + _rightAlbumModel | |
| 33 | + } | |
| 34 | + set{ | |
| 35 | + _rightAlbumModel = newValue! | |
| 36 | + self.setupRightNewUI(model: _rightAlbumModel!) | |
| 37 | + } | |
| 38 | + } | |
| 39 | + //MARK: - 懒加载 | |
| 40 | + lazy var iconImgView :UIImageView = { | |
| 41 | + let iconImgView = UIImageView(frame: CGRect(x: 15, y: 15, width: DuanJuDetailImageWidth, height: DuanJuDetailImageHeight)) | |
| 42 | + iconImgView.layer.cornerRadius = 5 | |
| 43 | + iconImgView.clipsToBounds = true | |
| 44 | + iconImgView.contentMode = .scaleAspectFill | |
| 45 | + return iconImgView | |
| 46 | + }() | |
| 47 | + ///标题 | |
| 48 | + lazy var titleLabl: UILabel = { | |
| 49 | + let titleLabel = UILabel.init(frame: CGRectMake(self.iconImgView.left+10, self.iconImgView.bottom+10, self.iconImgView.width-20, 20)) | |
| 50 | + titleLabel.textColor = HexColor("#333333") | |
| 51 | + titleLabel.textAlignment = .left | |
| 52 | + titleLabel.font = BoldFont_14 | |
| 53 | + titleLabel.text = "标题" | |
| 54 | + return titleLabel | |
| 55 | + }() | |
| 56 | + ///副标题 | |
| 57 | + lazy var subTitleLabel: UILabel = { | |
| 58 | + let titleLabel = UILabel.init(frame: CGRectMake(self.iconImgView.left+10, self.titleLabl.bottom+3, self.iconImgView.width-20, 33)) | |
| 59 | + titleLabel.textColor = HexColor("#999999") | |
| 60 | + titleLabel.textAlignment = .left | |
| 61 | + titleLabel.font = Font_12 | |
| 62 | + titleLabel.text = "副标题" | |
| 63 | + return titleLabel | |
| 64 | + }() | |
| 65 | + | |
| 66 | + lazy var rightIconImgView :UIImageView = { | |
| 67 | + let iconImgView = UIImageView(frame: CGRect(x: 15+DuanJuDetailImageWidth+15, y: 15, width: DuanJuDetailImageWidth, height: DuanJuDetailImageHeight)) | |
| 68 | + iconImgView.layer.cornerRadius = 5 | |
| 69 | + iconImgView.clipsToBounds = true | |
| 70 | + iconImgView.contentMode = .scaleAspectFill | |
| 71 | + return iconImgView | |
| 72 | + }() | |
| 73 | + ///标题 | |
| 74 | + lazy var rightTitleLabl: UILabel = { | |
| 75 | + let titleLabel = UILabel.init(frame: CGRectMake(self.rightIconImgView.left+10, self.rightIconImgView.bottom+10, self.rightIconImgView.width-20, 20)) | |
| 76 | + titleLabel.textColor = HexColor("#333333") | |
| 77 | + titleLabel.textAlignment = .left | |
| 78 | + titleLabel.font = BoldFont_14 | |
| 79 | + titleLabel.text = "" | |
| 80 | + return titleLabel | |
| 81 | + }() | |
| 82 | + ///副标题 | |
| 83 | + lazy var rightSubTitleLabel: UILabel = { | |
| 84 | + let titleLabel = UILabel.init(frame: CGRectMake(self.rightIconImgView.left+10, self.rightTitleLabl.bottom+3, self.rightIconImgView.width-20, 33)) | |
| 85 | + titleLabel.textColor = HexColor("#999999") | |
| 86 | + titleLabel.textAlignment = .left | |
| 87 | + titleLabel.font = Font_12 | |
| 88 | + titleLabel.text = "" | |
| 89 | + return titleLabel | |
| 90 | + }() | |
| 91 | + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | |
| 92 | + super.init(style: style, reuseIdentifier: reuseIdentifier) | |
| 93 | + self.selectionStyle = .none | |
| 94 | + self.contentView.addSubview(self.iconImgView) | |
| 95 | + self.contentView.addSubview(self.titleLabl) | |
| 96 | + self.contentView.addSubview(self.subTitleLabel) | |
| 97 | + self.contentView.addSubview(self.rightIconImgView) | |
| 98 | + self.contentView.addSubview(self.rightTitleLabl) | |
| 99 | + self.contentView.addSubview(self.rightSubTitleLabel) | |
| 100 | + } | |
| 101 | + | |
| 102 | + required init?(coder: NSCoder) { | |
| 103 | + fatalError("init(coder:) has not been implemented") | |
| 104 | + } | |
| 105 | + func setupNewUI(model:CNLiveAlbumModel){ | |
| 106 | + self.titleLabl.text = model.title | |
| 107 | + self.subTitleLabel.text = model.subTitle | |
| 108 | + self.iconImgView.kf.setImage(with: URL(string: model.poster)) | |
| 109 | + } | |
| 110 | + func setupRightNewUI(model:CNLiveAlbumModel){ | |
| 111 | + self.rightTitleLabl.text = model.title | |
| 112 | + self.rightSubTitleLabel.text = model.subTitle | |
| 113 | + self.rightIconImgView.kf.setImage(with: URL(string: model.poster)) | |
| 114 | + } | |
| 115 | + | |
| 116 | +// @objc func playBtnAction(){ | |
| 117 | +// var aid = "" | |
| 118 | +// if self.albumModel != nil{ | |
| 119 | +// aid = self.albumModel!.contentId | |
| 120 | +// }else if self.albumMsgModel != nil{ | |
| 121 | +// aid = self.albumMsgModel!.albumId | |
| 122 | +// }else{ | |
| 123 | +// aid = "" | |
| 124 | +// } | |
| 125 | +// if (self.albumModel != nil){ | |
| 126 | +// if (self.albumModel?.model == kCNDownSlideContentsModelModel1 || self.albumModel?.model == kCNDownSlideContentsModelModel2 || self.albumModel?.model == kCNDownSlideContentsModelModel3 || self.albumModel?.model == kCNDownSlideContentsModelModel4){ | |
| 127 | +// //课程-跳转h5网页 | |
| 128 | +// self.enterBlock!(self.albumModel!) | |
| 129 | +// }else if self.albumModel?.model == kCNDownSlideContentsModelModelAlbum_ugc{ | |
| 130 | +// //短剧-跳转短剧播放页 | |
| 131 | +// CNLiveDownSlideTool.pushShortVideoController(contentId: aid, navigationVC: navigationViewController().visibleViewController?.navigationController) | |
| 132 | +// }else if self.albumModel?.model == kCNDownSlideContentsModelModelAlbum_video{ | |
| 133 | +// //课程-跳转h5视频专辑页 | |
| 134 | +// self.enterBlock!(self.albumModel!) | |
| 135 | +// }else{ | |
| 136 | +// | |
| 137 | +// } | |
| 138 | +// }else if (self.albumMsgModel != nil){ | |
| 139 | +// //短剧-跳转短剧播放页 | |
| 140 | +// CNLiveDownSlideTool.pushShortVideoController(contentId: aid, navigationVC: navigationViewController().visibleViewController?.navigationController) | |
| 141 | +// | |
| 142 | +// } | |
| 143 | +// | |
| 144 | +// } | |
| 145 | +} | ... | ... |
metaCode/Classes/Main/HomePages/View/HomepageDetail/CNLiveDuanjuTitleCell.swift
| ... | ... | @@ -22,6 +22,9 @@ class CNLiveDuanjuTitleCell:UITableViewCell{ |
| 22 | 22 | }else if self.cellType == .playlet{ |
| 23 | 23 | self.blockTitleLabl.text = _blockName ?? "在追短剧" |
| 24 | 24 | self.blockTitleLabl.top = (45-30)/2 |
| 25 | + }else if self.cellType == .playletList{ | |
| 26 | + self.blockTitleLabl.text = _blockName ?? "" | |
| 27 | + self.blockTitleLabl.top = (allCourseCellHeight-30)/2+get_system_statusBar_height() | |
| 25 | 28 | } |
| 26 | 29 | } |
| 27 | 30 | } | ... | ... |
metaCode/Classes/Main/Util/CNUpSlideAnimationTransition.swift
| ... | ... | @@ -41,7 +41,7 @@ extension CNUpSlideAnimationTransition: UIViewControllerAnimatedTransitioning { |
| 41 | 41 | func animationForPresent(using transitionContext: UIViewControllerContextTransitioning) { |
| 42 | 42 | let containerView = transitionContext.containerView |
| 43 | 43 | |
| 44 | - if self.cellType == .playlet{ | |
| 44 | + if self.cellType == .playlet || self.cellType == .playletList{ | |
| 45 | 45 | //1.Get fromVC and toVC |
| 46 | 46 | guard let fromVCtemp = transitionContext.viewController(forKey: .from) as? CNLiveBaseTabBarViewController else { return } |
| 47 | 47 | let fromNavi = fromVCtemp.viewControllers![0] as! CNLiveBaseNavigationController |
| ... | ... | @@ -142,7 +142,7 @@ extension CNUpSlideAnimationTransition: UIViewControllerAnimatedTransitioning { |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | func animationForDismiss(using transitionContext: UIViewControllerContextTransitioning) { |
| 145 | - if self.cellType == .playlet{ | |
| 145 | + if self.cellType == .playlet || self.cellType == .playletList{ | |
| 146 | 146 | guard let fromNaviVC = transitionContext.viewController(forKey: .from) as? CNSlideBaseNavigationController else { return } |
| 147 | 147 | guard let toVCTabbar = transitionContext.viewController(forKey: .to) as? CNLiveBaseTabBarViewController else { return } |
| 148 | 148 | let toVCNav = toVCTabbar.viewControllers?.first as! CNLiveBaseNavigationController | ... | ... |
metaCode/Classes/Main/VideoPage/Controller/CNLiveShortVideoViewController.swift
| ... | ... | @@ -134,7 +134,9 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele |
| 134 | 134 | override func viewDidAppear(_ animated: Bool) { |
| 135 | 135 | super.viewDidAppear(animated) |
| 136 | 136 | self.player.currentPlayerManager.play() |
| 137 | - self.player.scrollView?.setContentOffset(CGPoint(x: 0, y:CGFloat(self.currentIndex!)*KSreenHeight), animated: true)//校正偏移量 | |
| 137 | + DispatchQueue.main.asyncAfter(deadline: .now() + 1) { | |
| 138 | + self.player.scrollView?.setContentOffset(CGPoint(x: 0, y:CGFloat(self.currentIndex!)*KSreenHeight), animated: true)//校正偏移量 | |
| 139 | + } | |
| 138 | 140 | } |
| 139 | 141 | |
| 140 | 142 | override func viewWillDisappear(_ animated: Bool) { | ... | ... |