Commit c315248fb37a44a007d921835cd49fc65caaa638
1 parent
518398eb
实时热榜详情页
Showing
7 changed files
with
350 additions
and
14 deletions
metaCode.xcodeproj/project.pbxproj
| ... | ... | @@ -135,6 +135,9 @@ |
| 135 | 135 | 19C0F76F2BDB4CE10097CC8F /* CNBindingManageModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19C0F76E2BDB4CE10097CC8F /* CNBindingManageModel.swift */; }; |
| 136 | 136 | 19C0F7712BDE1A3B0097CC8F /* CNLiveMineChangePhoneController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19C0F7702BDE1A3B0097CC8F /* CNLiveMineChangePhoneController.swift */; }; |
| 137 | 137 | 19C0F7742BDF71CA0097CC8F /* CNLiveDigitalAuthController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19C0F7732BDF71CA0097CC8F /* CNLiveDigitalAuthController.swift */; }; |
| 138 | + 19C735C12BFDCEE900CACF4E /* CNLiveTotalHotListController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19C735C02BFDCEE900CACF4E /* CNLiveTotalHotListController.swift */; }; | |
| 139 | + 19C735C32BFED49700CACF4E /* CNLiveRealHotListDetailCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19C735C22BFED49700CACF4E /* CNLiveRealHotListDetailCell.swift */; }; | |
| 140 | + 19C735C52BFF09BA00CACF4E /* CNLiveRealHotListDetailImageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19C735C42BFF09BA00CACF4E /* CNLiveRealHotListDetailImageCell.swift */; }; | |
| 138 | 141 | 19CC4D472ADD006600308E2A /* CNDownSlideSingleCourseCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19CC4D462ADD006600308E2A /* CNDownSlideSingleCourseCell.swift */; }; |
| 139 | 142 | 19CC4D492ADD06C500308E2A /* UITableView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19CC4D482ADD06C500308E2A /* UITableView+Extension.swift */; }; |
| 140 | 143 | 19CC4D4B2ADD086F00308E2A /* CNUpSlideDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19CC4D4A2ADD086F00308E2A /* CNUpSlideDetailViewController.swift */; }; |
| ... | ... | @@ -419,6 +422,9 @@ |
| 419 | 422 | 19C0F76E2BDB4CE10097CC8F /* CNBindingManageModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNBindingManageModel.swift; sourceTree = "<group>"; }; |
| 420 | 423 | 19C0F7702BDE1A3B0097CC8F /* CNLiveMineChangePhoneController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveMineChangePhoneController.swift; sourceTree = "<group>"; }; |
| 421 | 424 | 19C0F7732BDF71CA0097CC8F /* CNLiveDigitalAuthController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDigitalAuthController.swift; sourceTree = "<group>"; }; |
| 425 | + 19C735C02BFDCEE900CACF4E /* CNLiveTotalHotListController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveTotalHotListController.swift; sourceTree = "<group>"; }; | |
| 426 | + 19C735C22BFED49700CACF4E /* CNLiveRealHotListDetailCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveRealHotListDetailCell.swift; sourceTree = "<group>"; }; | |
| 427 | + 19C735C42BFF09BA00CACF4E /* CNLiveRealHotListDetailImageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveRealHotListDetailImageCell.swift; sourceTree = "<group>"; }; | |
| 422 | 428 | 19CC4D462ADD006600308E2A /* CNDownSlideSingleCourseCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNDownSlideSingleCourseCell.swift; sourceTree = "<group>"; }; |
| 423 | 429 | 19CC4D482ADD06C500308E2A /* UITableView+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITableView+Extension.swift"; sourceTree = "<group>"; }; |
| 424 | 430 | 19CC4D4A2ADD086F00308E2A /* CNUpSlideDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNUpSlideDetailViewController.swift; sourceTree = "<group>"; }; |
| ... | ... | @@ -735,6 +741,7 @@ |
| 735 | 741 | 1938BD152B3D6C6000390A34 /* Controller */ = { |
| 736 | 742 | isa = PBXGroup; |
| 737 | 743 | children = ( |
| 744 | + 19C735BF2BFDCECD00CACF4E /* CNLiveTotalHotListController */, | |
| 738 | 745 | 1938BD272B48009600390A34 /* HomeController */, |
| 739 | 746 | 1938BD1D2B46791400390A34 /* PlayletHomePage */, |
| 740 | 747 | ); |
| ... | ... | @@ -852,6 +859,8 @@ |
| 852 | 859 | 19CC4D462ADD006600308E2A /* CNDownSlideSingleCourseCell.swift */, |
| 853 | 860 | 19CC4D4E2ADD0FC200308E2A /* CNUpSlideDetailScrollView.swift */, |
| 854 | 861 | 19864E3E2BEF6A3300586E72 /* CNLiveDownSlideRealHotListCell.swift */, |
| 862 | + 19C735C22BFED49700CACF4E /* CNLiveRealHotListDetailCell.swift */, | |
| 863 | + 19C735C42BFF09BA00CACF4E /* CNLiveRealHotListDetailImageCell.swift */, | |
| 855 | 864 | ); |
| 856 | 865 | path = DownSlide; |
| 857 | 866 | sourceTree = "<group>"; |
| ... | ... | @@ -1044,6 +1053,14 @@ |
| 1044 | 1053 | path = DigitalAuth; |
| 1045 | 1054 | sourceTree = "<group>"; |
| 1046 | 1055 | }; |
| 1056 | + 19C735BF2BFDCECD00CACF4E /* CNLiveTotalHotListController */ = { | |
| 1057 | + isa = PBXGroup; | |
| 1058 | + children = ( | |
| 1059 | + 19C735C02BFDCEE900CACF4E /* CNLiveTotalHotListController.swift */, | |
| 1060 | + ); | |
| 1061 | + path = CNLiveTotalHotListController; | |
| 1062 | + sourceTree = "<group>"; | |
| 1063 | + }; | |
| 1047 | 1064 | 19CC4D502ADD126D00308E2A /* Util */ = { |
| 1048 | 1065 | isa = PBXGroup; |
| 1049 | 1066 | children = ( |
| ... | ... | @@ -1851,6 +1868,7 @@ |
| 1851 | 1868 | 191733642B392011007BCC04 /* CNLiveShopGoodsSearchViewController.swift in Sources */, |
| 1852 | 1869 | 79EABB892AB4497700F3A4E2 /* CNLiveSaveStandDB.swift in Sources */, |
| 1853 | 1870 | 790B1FB62A41938F0074CF00 /* UIImage+CNLiveExtensions.swift in Sources */, |
| 1871 | + 19C735C12BFDCEE900CACF4E /* CNLiveTotalHotListController.swift in Sources */, | |
| 1854 | 1872 | 7939B0732B47F12F005AE981 /* CNLiveShortVideoViewController.swift in Sources */, |
| 1855 | 1873 | 19BB1FEA2AEF7B4A0094D962 /* CNLiveShopConsoleCell.swift in Sources */, |
| 1856 | 1874 | 191733132B109F7B007BCC04 /* CNLivePlayerGestureView.swift in Sources */, |
| ... | ... | @@ -1920,6 +1938,7 @@ |
| 1920 | 1938 | 19C0F76D2BDB48750097CC8F /* CNBindingManageCell.swift in Sources */, |
| 1921 | 1939 | 1917331D2B10A15A007BCC04 /* CNLivePlayerFailureView.swift in Sources */, |
| 1922 | 1940 | 7CD6754F2A2840B9008354C1 /* CNMetaCodeHomePageController.swift in Sources */, |
| 1941 | + 19C735C32BFED49700CACF4E /* CNLiveRealHotListDetailCell.swift in Sources */, | |
| 1923 | 1942 | 79D094DC2B0765DD008CB1F3 /* CNLiveShopBodyCouponGoodsListView.swift in Sources */, |
| 1924 | 1943 | 798916EF2B048EC800D08302 /* CNLiveShopTransListViewController.swift in Sources */, |
| 1925 | 1944 | 7989B5C52A4BDC6000A19B10 /* CNLiveMineEarnViewController.swift in Sources */, |
| ... | ... | @@ -1995,6 +2014,7 @@ |
| 1995 | 2014 | 790D01912A2DAC5E00C5978D /* CNLiveConfigFontMacro.swift in Sources */, |
| 1996 | 2015 | 790D01852A2D89E100C5978D /* UIColor+CNLiveExtensions.swift in Sources */, |
| 1997 | 2016 | 19FA20192AE22D98001F7186 /* CNLiveDownSlideTodayRecommendCell.swift in Sources */, |
| 2017 | + 19C735C52BFF09BA00CACF4E /* CNLiveRealHotListDetailImageCell.swift in Sources */, | |
| 1998 | 2018 | 790B1FB42A4153E90074CF00 /* CNLiveMineBaseModel.swift in Sources */, |
| 1999 | 2019 | 794294AA2B4D4381008AAFA0 /* CNLiveShortVideoCommentListView.swift in Sources */, |
| 2000 | 2020 | 7978A8432A396632007C86B8 /* CNLiveMineViewModel.swift in Sources */, | ... | ... |
metaCode/Classes/Main/HomePage/View/VerticalViews/DownSlide/CNLiveDownSlideRealHotListCell.swift
| ... | ... | @@ -46,12 +46,22 @@ class CNLiveDownSlideRealHotListCell: UICollectionViewCell { |
| 46 | 46 | layerView.frame = CGRect(x: 5, y: 0, width: 20, height: 17) |
| 47 | 47 | return layerView |
| 48 | 48 | }() |
| 49 | + lazy var numTitleLabel: UILabel = { | |
| 50 | + let titleLabel = UILabel(frame: self.firstIconView.bounds) | |
| 51 | + titleLabel.textAlignment = .center | |
| 52 | + titleLabel.text = "1" | |
| 53 | + titleLabel.font = Font_12 | |
| 54 | + return titleLabel | |
| 55 | + }() | |
| 56 | + | |
| 49 | 57 | |
| 50 | 58 | override init(frame: CGRect) { |
| 51 | 59 | super.init(frame: frame) |
| 52 | 60 | self.contentView.addSubview(self.iconImgView) |
| 53 | 61 | self.contentView.addSubview(self.titleLabel) |
| 54 | 62 | self.contentView.addSubview(self.firstIconView) |
| 63 | + self.firstIconView.addSubview(self.numTitleLabel) | |
| 64 | + | |
| 55 | 65 | self.firstIconView.isHidden = true |
| 56 | 66 | } |
| 57 | 67 | |
| ... | ... | @@ -64,15 +74,22 @@ class CNLiveDownSlideRealHotListCell: UICollectionViewCell { |
| 64 | 74 | self.titleLabel.text = model.title |
| 65 | 75 | if self.num == 1{ |
| 66 | 76 | self.firstIconView.isHidden = false |
| 67 | - self.firstIconView.image = UIImage(named: "") | |
| 77 | + self.firstIconView.backgroundColor = HexColor("#F23A87") | |
| 78 | + self.numTitleLabel.text = "1" | |
| 79 | +// self.firstIconView.image = UIImage(named: "") | |
| 68 | 80 | }else if self.num == 2{ |
| 69 | 81 | self.firstIconView.isHidden = false |
| 70 | - self.firstIconView.image = UIImage(named: "") | |
| 82 | + self.firstIconView.backgroundColor = HexColor("#FB723F") | |
| 83 | + self.numTitleLabel.text = "2" | |
| 84 | +// self.firstIconView.image = UIImage(named: "") | |
| 71 | 85 | }else if self.num == 3{ |
| 72 | 86 | self.firstIconView.isHidden = false |
| 73 | - self.firstIconView.image = UIImage(named: "") | |
| 87 | + self.firstIconView.backgroundColor = HexColor("#FFB03D") | |
| 88 | + self.numTitleLabel.text = "3" | |
| 89 | +// self.firstIconView.image = UIImage(named: "") | |
| 74 | 90 | }else{ |
| 75 | 91 | self.firstIconView.isHidden = true |
| 92 | + self.numTitleLabel.text = "" | |
| 76 | 93 | } |
| 77 | 94 | } |
| 78 | 95 | } | ... | ... |
metaCode/Classes/Main/HomePage/View/VerticalViews/DownSlide/CNLiveRealHotListDetailCell.swift
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveRealHotListDetailCell.swift | |
| 3 | +// metaCode | |
| 4 | +// | |
| 5 | +// Created by zx on 2024/5/11. | |
| 6 | +// 实时热榜详情页列表cell | |
| 7 | + | |
| 8 | +import Foundation | |
| 9 | +import Kingfisher | |
| 10 | + | |
| 11 | +class CNLiveRealHotListDetailCell: UICollectionViewCell { | |
| 12 | + | |
| 13 | + //是前三 | |
| 14 | + var num = 0//第几 | |
| 15 | + | |
| 16 | + //contentsModel | |
| 17 | + var _contentsModel : CNLiveDownSlideContentsModel? | |
| 18 | + var contentsModel : CNLiveDownSlideContentsModel? { | |
| 19 | + get{ | |
| 20 | + _contentsModel | |
| 21 | + } | |
| 22 | + set{ | |
| 23 | + _contentsModel = newValue! | |
| 24 | + setupNewUI(model: _contentsModel!) | |
| 25 | + } | |
| 26 | + } | |
| 27 | + | |
| 28 | + lazy var iconImgView :UIImageView = { | |
| 29 | + let iconImgView = UIImageView(frame: CGRect(x: 15, y: 0, width: 95, height: 138)) | |
| 30 | + iconImgView.contentMode = .scaleAspectFill | |
| 31 | + iconImgView.clipsToBounds = true | |
| 32 | + return iconImgView | |
| 33 | + }() | |
| 34 | + | |
| 35 | + lazy var titleLabel: UILabel = { | |
| 36 | + let titleLabel = UILabel.init(frame: CGRectMake(self.iconImgView.right+15, self.iconImgView.top, KSreenWidth-(self.iconImgView.right+15)-15, 23)) | |
| 37 | + titleLabel.textColor = HexColor("#333333") | |
| 38 | + titleLabel.textAlignment = .left | |
| 39 | + titleLabel.font = BoldFont_16 | |
| 40 | + return titleLabel | |
| 41 | + }() | |
| 42 | + lazy var subTitleLabel: UILabel = { | |
| 43 | + let titleLabel = UILabel.init(frame: CGRectMake(self.titleLabel.left, self.titleLabel.bottom+5, self.titleLabel.width, 50)) | |
| 44 | + titleLabel.textColor = HexColor("#999999") | |
| 45 | + titleLabel.textAlignment = .left | |
| 46 | + titleLabel.numberOfLines = 3 | |
| 47 | + titleLabel.font = BoldFont_12 | |
| 48 | + return titleLabel | |
| 49 | + }() | |
| 50 | + | |
| 51 | + //第一第二第三角标 | |
| 52 | + lazy var firstIconView :UIImageView = { | |
| 53 | + let layerView = UIImageView() | |
| 54 | + layerView.frame = CGRect(x: 15+5, y: 0, width: 20, height: 17) | |
| 55 | + return layerView | |
| 56 | + }() | |
| 57 | + lazy var numTitleLabel: UILabel = { | |
| 58 | + let titleLabel = UILabel(frame: self.firstIconView.bounds) | |
| 59 | + titleLabel.textAlignment = .center | |
| 60 | + titleLabel.text = "1" | |
| 61 | + titleLabel.font = Font_12 | |
| 62 | + return titleLabel | |
| 63 | + }() | |
| 64 | + | |
| 65 | + | |
| 66 | + override init(frame: CGRect) { | |
| 67 | + super.init(frame: frame) | |
| 68 | + self.contentView.addSubview(self.iconImgView) | |
| 69 | + self.contentView.addSubview(self.titleLabel) | |
| 70 | + self.contentView.addSubview(self.subTitleLabel) | |
| 71 | + self.contentView.addSubview(self.firstIconView) | |
| 72 | + self.firstIconView.addSubview(self.numTitleLabel) | |
| 73 | + self.firstIconView.isHidden = true | |
| 74 | + } | |
| 75 | + | |
| 76 | + required init?(coder: NSCoder) { | |
| 77 | + fatalError("init(coder:) has not been implemented") | |
| 78 | + } | |
| 79 | + | |
| 80 | + func setupNewUI(model:CNLiveDownSlideContentsModel){ | |
| 81 | + self.iconImgView.kf.setImage(with: URL(string:model.poster)) | |
| 82 | + self.titleLabel.text = model.title | |
| 83 | + self.subTitleLabel.text = model.subTitle | |
| 84 | + if self.num == 1{ | |
| 85 | + self.firstIconView.isHidden = false | |
| 86 | + self.firstIconView.backgroundColor = HexColor("#F23A87") | |
| 87 | + self.numTitleLabel.text = "1" | |
| 88 | +// self.firstIconView.image = UIImage(named: "") | |
| 89 | + }else if self.num == 2{ | |
| 90 | + self.firstIconView.isHidden = false | |
| 91 | + self.firstIconView.backgroundColor = HexColor("#FB723F") | |
| 92 | + self.numTitleLabel.text = "2" | |
| 93 | +// self.firstIconView.image = UIImage(named: "") | |
| 94 | + }else if self.num == 3{ | |
| 95 | + self.firstIconView.isHidden = false | |
| 96 | + self.firstIconView.backgroundColor = HexColor("#FFB03D") | |
| 97 | + self.numTitleLabel.text = "3" | |
| 98 | +// self.firstIconView.image = UIImage(named: "") | |
| 99 | + }else{ | |
| 100 | + self.firstIconView.isHidden = true | |
| 101 | + self.numTitleLabel.text = "" | |
| 102 | + } | |
| 103 | + } | |
| 104 | +} | |
| 105 | + | ... | ... |
metaCode/Classes/Main/HomePage/View/VerticalViews/DownSlide/CNLiveRealHotListDetailImageCell.swift
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveRealHotListDetailImageCell.swift | |
| 3 | +// metaCode | |
| 4 | +// | |
| 5 | +// Created by zx on 2024/5/23. | |
| 6 | +// 实时热榜详情页 顶部image cell | |
| 7 | + | |
| 8 | +import Foundation | |
| 9 | +import Kingfisher | |
| 10 | + | |
| 11 | +class CNLiveRealHotListDetailImageCell: UICollectionViewCell { | |
| 12 | + | |
| 13 | + lazy var iconImgView :UIImageView = { | |
| 14 | + let iconImgView = UIImageView(frame: CGRect(x: 0, y: 0, width: KSreenWidth, height: 174.0*375/KSreenWidth)) | |
| 15 | + iconImgView.contentMode = .scaleAspectFill | |
| 16 | + iconImgView.clipsToBounds = true | |
| 17 | + iconImgView.backgroundColor = .red | |
| 18 | + return iconImgView | |
| 19 | + }() | |
| 20 | + | |
| 21 | + override init(frame: CGRect) { | |
| 22 | + super.init(frame: frame) | |
| 23 | + self.contentView.addSubview(self.iconImgView) | |
| 24 | + } | |
| 25 | + | |
| 26 | + required init?(coder: NSCoder) { | |
| 27 | + fatalError("init(coder:) has not been implemented") | |
| 28 | + } | |
| 29 | +} | |
| 30 | + | ... | ... |
metaCode/Classes/Main/HomePages/Controller/CNLiveTotalHotListController/CNLiveTotalHotListController.swift
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveTotalHotListController.swift | |
| 3 | +// metaCode | |
| 4 | +// | |
| 5 | +// Created by zx on 2024/5/22. | |
| 6 | +// 实时热榜详情页 | |
| 7 | + | |
| 8 | +import Foundation | |
| 9 | + | |
| 10 | +class CNLiveTotalHotListController:CNLiveBaseViewController, UICollectionViewDelegate, UICollectionViewDataSource{ | |
| 11 | + var slideModel:CNLiveDownSlideModel? | |
| 12 | + | |
| 13 | + //实时热榜的列表 | |
| 14 | + lazy var realHotArr: NSMutableArray = { | |
| 15 | + var realHotArr = NSMutableArray() | |
| 16 | + return realHotArr | |
| 17 | + }() | |
| 18 | + let kRealHotListCollectionViewCellIdentifier = "kRealHotListCollectionViewCellIdentifier" | |
| 19 | + let kRealHotListCollectionViewImageCellIdentifier = "kRealHotListCollectionViewImageCellIdentifier" | |
| 20 | + | |
| 21 | + lazy var realHotCollectionView: UICollectionView = { | |
| 22 | + let layout = UICollectionViewFlowLayout() | |
| 23 | + layout.scrollDirection = .vertical | |
| 24 | + layout.itemSize = CGSizeMake(KSreenWidth, 138+15) | |
| 25 | + layout.sectionInset = .init(top: 0, left: 0, bottom: 0, right: 0) | |
| 26 | + layout.minimumLineSpacing = 15 | |
| 27 | + let cv = UICollectionView(frame: .zero, collectionViewLayout: layout) | |
| 28 | + cv.delegate = self | |
| 29 | + cv.dataSource = self | |
| 30 | + cv.backgroundColor = .white | |
| 31 | + cv.register(CNLiveRealHotListDetailCell.self, forCellWithReuseIdentifier: kRealHotListCollectionViewCellIdentifier) | |
| 32 | + cv.register(CNLiveRealHotListDetailImageCell.self, forCellWithReuseIdentifier: kRealHotListCollectionViewImageCellIdentifier) | |
| 33 | + return cv | |
| 34 | + }() | |
| 35 | + | |
| 36 | + lazy var closeBtn: UIButton = { | |
| 37 | + let closeBtn = UIButton(type: .custom) | |
| 38 | + closeBtn.frame = CGRect(x: 15, y: KStatusBarHeight, width: 20, height: 20) | |
| 39 | + closeBtn.centerY = self.titleLabel.centerY | |
| 40 | + closeBtn.setImage(UIImage(named: "mine_header_icon_white_back"), for: .normal) | |
| 41 | + closeBtn.addTarget(self, action: #selector(changeCancelAction), for: .touchUpInside) | |
| 42 | + return closeBtn | |
| 43 | + }() | |
| 44 | + | |
| 45 | + /// 初始化播放器,第多少集 | |
| 46 | + init(slideModel:CNLiveDownSlideModel?) { | |
| 47 | + super.init(nibName:nil, bundle:nil) | |
| 48 | + self.slideModel = slideModel | |
| 49 | + | |
| 50 | + } | |
| 51 | + | |
| 52 | + required init?(coder: NSCoder) { | |
| 53 | + fatalError("init(coder:) has not been implemented") | |
| 54 | + } | |
| 55 | + | |
| 56 | + override func viewDidLoad() { | |
| 57 | + super.viewDidLoad() | |
| 58 | + self.view.backgroundColor = .white | |
| 59 | + | |
| 60 | + self.view.addSubview(self.realHotCollectionView) | |
| 61 | + self.realHotCollectionView.frame = CGRect(x: 0, y: 0, width: KSreenWidth, height: KSreenHeight) | |
| 62 | + self.realHotArr = NSMutableArray(array: self.slideModel!.contents) | |
| 63 | + self.realHotCollectionView.reloadData() | |
| 64 | + | |
| 65 | + self.view.addSubview(self.closeBtn) | |
| 66 | + } | |
| 67 | + | |
| 68 | + func initUI(){ | |
| 69 | + self.view.addSubview(self.realHotCollectionView) | |
| 70 | + } | |
| 71 | + | |
| 72 | + | |
| 73 | + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { | |
| 74 | + | |
| 75 | + self.realHotArr.count+1 | |
| 76 | + } | |
| 77 | + | |
| 78 | + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { | |
| 79 | + if indexPath.row == 0{ | |
| 80 | + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kRealHotListCollectionViewImageCellIdentifier, for: indexPath) as! CNLiveRealHotListDetailImageCell | |
| 81 | + // 加载和设置图片到 cell.imageView | |
| 82 | + cell.iconImgView.kf.setImage(with: URL(string: self.slideModel?.background ?? "")) | |
| 83 | + return cell | |
| 84 | + }else{ | |
| 85 | + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kRealHotListCollectionViewCellIdentifier, for: indexPath) as! CNLiveRealHotListDetailCell | |
| 86 | + cell.num = indexPath.row | |
| 87 | + // 加载和设置图片到 cell.imageView | |
| 88 | + cell.contentsModel = self.realHotArr[indexPath.row-1] as? CNLiveDownSlideContentsModel | |
| 89 | + return cell | |
| 90 | + } | |
| 91 | + } | |
| 92 | + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { | |
| 93 | + if indexPath.row == 0{ | |
| 94 | + }else{ | |
| 95 | + if let contentMdl = self.realHotArr[indexPath.row-1] as? CNLiveDownSlideContentsModel{ | |
| 96 | + //实时热榜点击短剧 | |
| 97 | + CNLiveDownSlideTool.pushWebVCWithContentsMdl(model: contentMdl.model , contentId: contentMdl.contentId , pid: contentMdl.pid , shareUrl: contentMdl.shareUrl , thirdUrl: contentMdl.thirdUrl , title: contentMdl.title , s_to: contentMdl.s_to ,trailerId: contentMdl.trailerId , controller: nil, slideModel: self.slideModel) | |
| 98 | + } | |
| 99 | + } | |
| 100 | + } | |
| 101 | + | |
| 102 | + | |
| 103 | + @objc func changeCancelAction() { | |
| 104 | + self.navigationController?.popViewController(animated: true) | |
| 105 | + } | |
| 106 | + | |
| 107 | + deinit { | |
| 108 | + | |
| 109 | + } | |
| 110 | +} | ... | ... |
metaCode/Classes/Main/HomePages/Controller/HomeController/CNLiveAuthViewController.swift
| ... | ... | @@ -268,6 +268,18 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa |
| 268 | 268 | present(detailVC, animated: true, completion: nil) |
| 269 | 269 | }else if slideModel.type == SlideModelTypeRealHotList7{ |
| 270 | 270 | //实时热榜 |
| 271 | + //在当前堆栈里遍历删除 播放控制器CNLiveShortVideoViewController | |
| 272 | + let tempArray = NSMutableArray.init() | |
| 273 | + self.navigationController?.viewControllers.forEach({ item in | |
| 274 | + if (item.isKind(of: CNLiveTotalHotListController.self)) { | |
| 275 | + tempArray.remove(item) | |
| 276 | + }else{ | |
| 277 | + tempArray.add(item) | |
| 278 | + } | |
| 279 | + }) | |
| 280 | + self.navigationController?.viewControllers = tempArray as! [CNLiveBaseViewController] | |
| 281 | + | |
| 282 | + self.navigationController?.pushViewController(CNLiveTotalHotListController(slideModel: slideModel), animated: true) | |
| 271 | 283 | } |
| 272 | 284 | // else if slideModel.type == SlideModelTypeOneCourse75{ |
| 273 | 285 | // guard let cell = tableView.cellForRow(at: indexPath) as? CNDownSlideSingleCourseCell else { return } | ... | ... |
metaCode/Classes/Main/VideoPage/Controller/CNLiveShortVideoViewController.swift
| ... | ... | @@ -27,6 +27,17 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele |
| 27 | 27 | hotListImgView.clipsToBounds = true |
| 28 | 28 | return hotListImgView |
| 29 | 29 | }() |
| 30 | + lazy var totalHotListBtn: UIButton = { | |
| 31 | + let totalHotListBtn = UIButton(type: .custom) | |
| 32 | + totalHotListBtn.frame = CGRect(x: KSreenWidth-110, y: 0, width: 100, height: 50) | |
| 33 | + totalHotListBtn.bottom = self.realHotCollectionView.top - 5 | |
| 34 | + totalHotListBtn.setTitle("完整榜单", for: .normal) | |
| 35 | + totalHotListBtn.setTitleColor(.white, for: .normal) | |
| 36 | + totalHotListBtn.isHidden = true | |
| 37 | + totalHotListBtn.addTarget(self, action: #selector(totalHotListBtnAction), for: .touchUpInside) | |
| 38 | + return totalHotListBtn | |
| 39 | + }() | |
| 40 | + | |
| 30 | 41 | //实时热榜的列表 |
| 31 | 42 | lazy var realHotArr: NSMutableArray = { |
| 32 | 43 | var realHotArr = NSMutableArray() |
| ... | ... | @@ -201,18 +212,22 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele |
| 201 | 212 | super.viewDidLoad() |
| 202 | 213 | view.backgroundColor = .black |
| 203 | 214 | view.addSubview(tableView) |
| 204 | - view.addSubview(hotListView) | |
| 205 | - hotListView.addSubview(self.hotListImgView) | |
| 206 | - self.hotListImgView.kf.setImage(with: URL(string: self.slideModel!.background)) | |
| 207 | - hotListView.addSubview(self.realHotCollectionView) | |
| 208 | - view.addSubview(backBtn) | |
| 209 | - view.addSubview(hotListBtn) | |
| 210 | - self.realHotCollectionView.frame = CGRect(x: 0, y: DownSlideRealHotListDetaiH-DownSlideRealHotListDetaiCollectCellH, width: KSreenWidth, height: DownSlideRealHotListDetaiCollectCellH) | |
| 211 | - self.realHotArr = NSMutableArray(array: self.slideModel!.contents) | |
| 212 | - self.realHotCollectionView.reloadData() | |
| 213 | - | |
| 214 | - self.updateHotListView(isShow: self.slideModel == nil ? false : true) | |
| 215 | + | |
| 216 | + if self.slideModel != nil{ | |
| 217 | + view.addSubview(hotListView) | |
| 218 | + hotListView.addSubview(self.hotListImgView) | |
| 219 | + self.hotListImgView.kf.setImage(with: URL(string: self.slideModel!.background)) | |
| 220 | + hotListView.addSubview(self.realHotCollectionView) | |
| 221 | + view.addSubview(hotListBtn) | |
| 222 | + self.realHotCollectionView.frame = CGRect(x: 0, y: DownSlideRealHotListDetaiH-DownSlideRealHotListDetaiCollectCellH, width: KSreenWidth, height: DownSlideRealHotListDetaiCollectCellH) | |
| 223 | + self.realHotArr = NSMutableArray(array: self.slideModel!.contents) | |
| 224 | + self.realHotCollectionView.reloadData() | |
| 225 | + self.updateHotListView(isShow: self.slideModel == nil ? false : true) | |
| 226 | + view.addSubview(self.totalHotListBtn) | |
| 227 | + self.totalHotListBtn.isHidden = false | |
| 228 | + } | |
| 215 | 229 | |
| 230 | + view.addSubview(backBtn) | |
| 216 | 231 | if self.dataArray.count == 0 { |
| 217 | 232 | requestData {noMore in } |
| 218 | 233 | } |
| ... | ... | @@ -278,6 +293,7 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele |
| 278 | 293 | self.tableView.top = self.hotListView.bottom |
| 279 | 294 | } |
| 280 | 295 | self.hotListBtn.isSelected = false |
| 296 | + self.totalHotListBtn.isHidden = false | |
| 281 | 297 | }else{ |
| 282 | 298 | //隐藏热榜 |
| 283 | 299 | UIView.animate(withDuration: 0.25) { |
| ... | ... | @@ -285,6 +301,7 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele |
| 285 | 301 | self.tableView.top = self.hotListView.bottom |
| 286 | 302 | } |
| 287 | 303 | self.hotListBtn.isSelected = true |
| 304 | + self.totalHotListBtn.isHidden = true | |
| 288 | 305 | } |
| 289 | 306 | }else{ |
| 290 | 307 | //隐藏热榜 |
| ... | ... | @@ -293,6 +310,7 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele |
| 293 | 310 | self.tableView.top = self.hotListView.bottom |
| 294 | 311 | } |
| 295 | 312 | self.hotListBtn.isSelected = true |
| 313 | + self.totalHotListBtn.isHidden = true | |
| 296 | 314 | } |
| 297 | 315 | } |
| 298 | 316 | |
| ... | ... | @@ -311,6 +329,16 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele |
| 311 | 329 | } |
| 312 | 330 | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { |
| 313 | 331 | if let contentMdl = self.realHotArr[indexPath.row] as? CNLiveDownSlideContentsModel{ |
| 332 | + //在当前堆栈里遍历删除 播放控制器CNLiveShortVideoViewController | |
| 333 | + let tempArray = NSMutableArray.init() | |
| 334 | + self.navigationController?.viewControllers.forEach({ item in | |
| 335 | + if (item.isKind(of: CNLiveShortVideoViewController.self)) { | |
| 336 | + tempArray.remove(item) | |
| 337 | + }else{ | |
| 338 | + tempArray.add(item) | |
| 339 | + } | |
| 340 | + }) | |
| 341 | + self.navigationController?.viewControllers = tempArray as! [CNLiveBaseViewController] | |
| 314 | 342 | //实时热榜点击短剧 |
| 315 | 343 | CNLiveDownSlideTool.pushWebVCWithContentsMdl(model: contentMdl.model , contentId: contentMdl.contentId , pid: contentMdl.pid , shareUrl: contentMdl.shareUrl , thirdUrl: contentMdl.thirdUrl , title: contentMdl.title , s_to: contentMdl.s_to ,trailerId: contentMdl.trailerId , controller: nil, slideModel: self.slideModel) |
| 316 | 344 | } |
| ... | ... | @@ -452,6 +480,20 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele |
| 452 | 480 | self.updateHotListView(isShow: true) |
| 453 | 481 | } |
| 454 | 482 | } |
| 483 | + @objc func totalHotListBtnAction(_ sender: UIButton) { | |
| 484 | + //在当前堆栈里遍历删除 播放控制器CNLiveShortVideoViewController | |
| 485 | + let tempArray = NSMutableArray.init() | |
| 486 | + self.navigationController?.viewControllers.forEach({ item in | |
| 487 | + if (item.isKind(of: CNLiveTotalHotListController.self)) { | |
| 488 | + tempArray.remove(item) | |
| 489 | + }else{ | |
| 490 | + tempArray.add(item) | |
| 491 | + } | |
| 492 | + }) | |
| 493 | + self.navigationController?.viewControllers = tempArray as! [CNLiveBaseViewController] | |
| 494 | + self.navigationController?.pushViewController(CNLiveTotalHotListController(slideModel: self.slideModel), animated: true) | |
| 495 | + } | |
| 496 | + | |
| 455 | 497 | |
| 456 | 498 | func playVideo(at indexPath: IndexPath) { |
| 457 | 499 | let data: CNLiveAlbumListModel = dataArray[indexPath.row] as! CNLiveAlbumListModel | ... | ... |