Commit 756453e9289f9ec575f2b72b51e7743f5acd967f

Authored by “张旭”
1 parent ec004ef6

看点 选择后刷新页面

metaCode/Classes/Main/HuBiLieHomePage/Controller/CNLiveTVPlayerViewController.swift
... ... @@ -254,7 +254,7 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa
254 254 let playerManager = ZFAVPlayerManager()
255 255 playerManager.shouldAutoPlay = true
256 256 // playerManager.rate = 2
257   -
  257 +
258 258 player = ZFPlayerController(playerManager: playerManager, containerView: containerView)
259 259 player.pauseWhenAppResignActive = false
260 260 player.controlView = controlView
... ... @@ -342,6 +342,7 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa
342 342 let cell = CNLiveVodTrailersCell()
343 343 return cell
344 344 }
  345 + cell.currSeleIdx = -1
345 346 cell.vodPlayBlockListModel = vodPlayBlockListModel
346 347 cell.expandBlock = { [weak self] model in
347 348 guard let self = self else { return }
... ... @@ -420,7 +421,41 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa
420 421 })
421 422 }
422 423  
423   - //更换contentId内容 play接口刷新看点和电商
  424 + //单集 更换contentId内容 play接口刷新看点和电商
  425 + func vodChangeContentApi(vodModel:CNLiveVodAlbumListModel){
  426 + //刷新url
  427 + CNLiveHomePageViewModel.shared.getVodVideoURL(contentId: vodModel.activityId) {[weak self] result, status in
  428 + guard let self = self else { return }
  429 + if status == .success
  430 + {
  431 + if let url = result as? String{
  432 + self.playWithUrlAndTitle(url: url, title: vodModel.title)
  433 + }
  434 + }else{
  435 +
  436 + }
  437 + }
  438 +
  439 +
  440 + //play接口刷新 看点和电商
  441 + CNLiveDownSlideTool.getVodPlayApi(contentId: vodModel.contentId) {[weak self] result, status in
  442 + guard let self = self else { return }
  443 + if status == .success{
  444 + if let vodPlayModel = result as? CNLiveVodPlayModel{
  445 + self.vodPlayModel = vodPlayModel
  446 + self.configDataArray()
  447 + self.tableView.reloadData()
  448 + }else{
  449 +
  450 + }
  451 + }else{
  452 +
  453 + }
  454 + }
  455 +
  456 + }
  457 +
  458 + //专辑 更换contentId内容 play接口刷新看点和电商
424 459 func changeContentApi(vodModel:CNLiveVodAlbumListModel){
425 460  
426 461 //刷新url
... ... @@ -554,7 +589,7 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa
554 589 detailLbl.snp.makeConstraints { make in
555 590 make.left.equalTo(titleLbl.snp.right).offset(15)
556 591 make.top.equalTo(20.5)
557   - make.width.equalTo(20)
  592 + make.width.equalTo(21)
558 593 make.height.equalTo(14)
559 594 }
560 595  
... ... @@ -604,12 +639,6 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa
604 639 }
605 640 }
606 641 func vodShare(vodPlayBlockListListModel:CNLiveVodPlayBlockListListModel){
607   - //vodPlayBlockListListModel.img
608   - //vodPlayBlockListListModel.title
609   - //vodPlayBlockListListModel.subTitle
610   - //
611   - //http://wjjh5.cnlive.com/cnYjzg.html?id=2&version=1.0.9&isShowTitle=true&plat=i&wjjFrom=apple&backgroundColor=%234B8AF5&wjjToken=ACGspwyhX6xbuJ27P0flZOejyKjcS70g7VegVKRgAWPUzacEKgXz2JcmlAVoc5oG&appId=769_li40lrkt53&channelName=yjzg&shareSid=352610&isApp=false&ver=1.0.9.24.03.27.14&sid=352610&wjjUUID=B849E3C36DF04D89B0C8DB9322B69B51_1711520943&voteId=AS5FFqIhAAAQAAAAAAAAAA==&isWjjReport=true
612   - //https://wjjh5.cnlive.com/apkdownloadYuanma.php
613 642 CNLiveShareManager.showShareViewWithParam(forShareTitle: vodPlayBlockListListModel.title, shareUrl: "https://wjjh5.cnlive.com/apkdownloadYuanma.php", shareDesc: vodPlayBlockListListModel.desc, shareImage: vodPlayBlockListListModel.img, screenFull: false, hiddenWjj: true, hiddenQQ: false, hiddenWB: true, hiddenLifeCircle: true, hiddenWechatCircle: false, hiddenWechat: false, hiddenSafari: false, formVC: currentViewController(), topImage: [], topTitles: [], platformType: .all) { title in
614 643  
615 644 } completerBlock: { resultType, platformType, typeString in
... ... @@ -663,7 +692,16 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa
663 692 self!.configDataArray()
664 693 self!.tableView.mj_header?.endRefreshing()
665 694 self!.tableView.reloadData()
666   - self!.playWithUrlAndTitle(url: url, title: "")
  695 + var title = ""
  696 + for (_,mdl) in vodPlayModel.blockList.enumerated(){
  697 + if mdl.type == "5" && mdl.list.count > 0 {//点播详情数据
  698 + //CNLiveVodPlayBlockListListModel
  699 + if let playMdl = mdl.list.first as? CNLiveVodPlayBlockListListModel{
  700 + title = playMdl.title
  701 + }
  702 + }
  703 + }
  704 + self!.playWithUrlAndTitle(url: url, title: title)
667 705 }else{
668 706  
669 707 }
... ...
metaCode/Classes/Main/HuBiLieHomePage/View/VodDetail/CNLiveVodCellBottomView.swift
... ... @@ -3,7 +3,7 @@
3 3 // metaCode
4 4 //
5 5 // Created by zx on 2025/3/20.
6   -//
  6 +// 看点展开View
7 7  
8 8 import Foundation
9 9  
... ... @@ -135,6 +135,7 @@ class CNLiveVodCellBottomView:UIView, UITableViewDataSource, UITableViewDelegate
135 135 //刷新点播页面 ,选中当前cell
136 136 self.selectIdx = indexPath.row
137 137 if let historyModel = self.dataArray[indexPath.row] as? CNLiveVodPlayBlockListListModel{
  138 + self.tableView.reloadData()
138 139 self.updateBlock?(self.selectIdx,historyModel)
139 140 }
140 141 }
... ...
metaCode/Classes/Main/HuBiLieHomePage/View/VodDetail/CNLiveVodTrailersCell.swift
... ... @@ -12,6 +12,7 @@ typealias CNLiveVodTrailersCellSelectBlock = (_ model:CNLiveVodPlayBlockListList
12 12  
13 13 class CNLiveVodTrailersCell:UITableViewCell, UICollectionViewDelegate, UICollectionViewDataSource{
14 14  
  15 + var currSeleIdx:Int = -1
15 16 var expandBlock:CNLiveVodTrailersCellExpandBlock?
16 17 var selectBlock:CNLiveVodTrailersCellSelectBlock?
17 18 lazy var albumListArr: NSMutableArray = {
... ... @@ -104,8 +105,9 @@ class CNLiveVodTrailersCell:UITableViewCell, UICollectionViewDelegate, UICollect
104 105 func setupNewUI(model:CNLiveVodPlayBlockListModel){
105 106 self.titleLabel.text = model.name
106 107 self.albumListArr = NSMutableArray(array: model.list)
  108 + self.realHotCollectionView.scrollToItem(at: IndexPath(item: 0, section: 0), at: .left, animated: false)
107 109 self.realHotCollectionView.reloadData()
108   -
  110 +
109 111 }
110 112  
111 113 @objc func detailBtnAction(){
... ... @@ -121,7 +123,7 @@ class CNLiveVodTrailersCell:UITableViewCell, UICollectionViewDelegate, UICollect
121 123 let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveVodTrailersCollectionCellIdentifier, for: indexPath) as! CNLiveVodTrailersCollectionCell
122 124 cell.num = indexPath.row
123 125 //获取当前选中集数
124   - if indexPath.row == 0{
  126 + if indexPath.row == self.currSeleIdx{
125 127 cell.isJiShuSelected = true
126 128 }else{
127 129 cell.isJiShuSelected = false
... ... @@ -131,8 +133,10 @@ class CNLiveVodTrailersCell:UITableViewCell, UICollectionViewDelegate, UICollect
131 133 }
132 134 func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
133 135 if let vodAlbumListModel = self.albumListArr[indexPath.row] as? CNLiveVodPlayBlockListListModel{
  136 + self.currSeleIdx = indexPath.row
134 137 //点击某集,刷新页面
135 138 self.selectBlock?(vodAlbumListModel)
  139 + self.realHotCollectionView.reloadData()
136 140 }
137 141 }
138 142  
... ...
metaCode/Classes/Main/HuBiLieHomePage/View/VodDetail/CNLiveVodTrailersCollectionCell.swift
... ... @@ -37,7 +37,8 @@ class CNLiveVodTrailersCollectionCell: UICollectionViewCell {
37 37 let iconImgView = UIView(frame: CGRect(x: 0, y: self.iconImgView.height, width: self.iconImgView.width, height: 76))
38 38 iconImgView.clipsToBounds = true
39 39 iconImgView.layer.cornerRadius = 10
40   - iconImgView.layer.maskedCorners = [.layerMinXMaxYCorner, .layerMaxXMaxYCorner]
  40 + iconImgView.layer.masksToBounds = true
  41 +// iconImgView.layer.maskedCorners = [.layerMinXMaxYCorner, .layerMaxXMaxYCorner]
41 42 iconImgView.backgroundColor = HexColor("#FAFAFA")
42 43 return iconImgView
43 44 }()
... ... @@ -60,8 +61,8 @@ class CNLiveVodTrailersCollectionCell: UICollectionViewCell {
60 61  
61 62 override init(frame: CGRect) {
62 63 super.init(frame: frame)
63   - self.contentView.addSubview(self.iconImgView)
64 64 self.contentView.addSubview(self.titleBgView)
  65 + self.titleBgView.addSubview(self.iconImgView)
65 66 self.titleBgView.addSubview(self.titleLabel)
66 67 self.titleBgView.addSubview(self.subTitleLabel)
67 68 iconImgView.snp.makeConstraints { make in
... ... @@ -72,13 +73,13 @@ class CNLiveVodTrailersCollectionCell: UICollectionViewCell {
72 73 }
73 74 titleBgView.snp.makeConstraints { make in
74 75 make.left.equalToSuperview()
75   - make.top.equalTo(self.iconImgView.snp.bottom)
  76 + make.top.equalTo(self.iconImgView.snp.top)
76 77 make.width.equalTo(self.iconImgView.snp.width)
77   - make.height.equalTo(76)
  78 + make.height.equalTo(self.iconImgView.snp.height).offset(76)
78 79 }
79 80 titleLabel.snp.makeConstraints { make in
80 81 make.left.right.equalToSuperview()
81   - make.top.equalToSuperview().offset(10)
  82 + make.top.equalTo(self.iconImgView.snp.bottom).offset(10)
82 83 }
83 84 subTitleLabel.snp.makeConstraints { make in
84 85 make.left.right.equalToSuperview()
... ... @@ -95,6 +96,19 @@ class CNLiveVodTrailersCollectionCell: UICollectionViewCell {
95 96 self.iconImgView.kf.setImage(with: URL(string: model.img))
96 97 self.titleLabel.text = model.title
97 98 self.subTitleLabel.text = model.subTitle
  99 +
  100 + if self.isJiShuSelected{
  101 + //选中
  102 + titleBgView.layer.borderColor = HexColor("#2076FF")?.cgColor
  103 + titleBgView.layer.borderWidth = 0.5
  104 + titleBgView.backgroundColor = HexColor("#EBF2FF")//nor EEEEEE,sele #EBF2FF
  105 + }else{
  106 + //未选中
  107 + titleBgView.layer.borderColor = HexColor("#EEEEEE")?.cgColor
  108 + titleBgView.layer.borderWidth = 0
  109 + titleBgView.backgroundColor = HexColor("#EEEEEE")//nor EEEEEE,sele #EBF2FF
  110 + }
  111 +
98 112 }
99 113  
100 114 }
... ...