Commit de9f1649fca0d2c29f9191e7c1fa17ca79102700
1 parent
c5301e35
跳转播放器
Showing
5 changed files
with
81 additions
and
53 deletions
metaCode/Classes/Main/HomePage/View/GoodsManager/CNLiveShopGoodsListCell.swift
| ... | ... | @@ -50,7 +50,7 @@ class CNLiveShopGoodsListCell: UITableViewCell { |
| 50 | 50 | titleLabel.textAlignment = .left |
| 51 | 51 | titleLabel.font = Font_15 |
| 52 | 52 | titleLabel.adjustsFontSizeToFitWidth=true |
| 53 | - titleLabel.text = "啊啊啊啊啊" | |
| 53 | + titleLabel.text = "标题" | |
| 54 | 54 | return titleLabel |
| 55 | 55 | }() |
| 56 | 56 | ///副标题 |
| ... | ... | @@ -60,7 +60,7 @@ class CNLiveShopGoodsListCell: UITableViewCell { |
| 60 | 60 | subTitleLabel.textAlignment = .left |
| 61 | 61 | subTitleLabel.font = Font_13 |
| 62 | 62 | subTitleLabel.adjustsFontSizeToFitWidth=true |
| 63 | - subTitleLabel.text = "啊啊啊啊" | |
| 63 | + subTitleLabel.text = "副标题" | |
| 64 | 64 | return subTitleLabel |
| 65 | 65 | }() |
| 66 | 66 | ///价格 | ... | ... |
metaCode/Classes/Main/HomePages/Controller/PlayletHomePage/CNLivePlayletHomePageController.swift
| ... | ... | @@ -133,4 +133,12 @@ class CNLivePlayletHomePageController:CNLiveBaseViewController, UITableViewDataS |
| 133 | 133 | return 75+12*2 |
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { | |
| 137 | + if indexPath.section == 0{ | |
| 138 | + }else{ | |
| 139 | + let albumListModel = self.albumModelArr[indexPath.row] | |
| 140 | + let aid = albumListModel.albumMsgModel?.albumId ?? "" | |
| 141 | + navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveShortVideoViewController(aid: aid), animated: pushAnimated) | |
| 142 | + } | |
| 143 | + } | |
| 136 | 144 | } | ... | ... |
metaCode/Classes/Main/HomePages/View/HomepageDetail/CNLiveAlbumCell.swift
| ... | ... | @@ -48,7 +48,7 @@ class CNLiveAlbumCell:UITableViewCell{ |
| 48 | 48 | titleLabel.textColor = HexColor("#333333") |
| 49 | 49 | titleLabel.textAlignment = .left |
| 50 | 50 | titleLabel.font = Font_15 |
| 51 | - titleLabel.text = "啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊" | |
| 51 | + titleLabel.text = "标题" | |
| 52 | 52 | return titleLabel |
| 53 | 53 | }() |
| 54 | 54 | ///副标题 |
| ... | ... | @@ -101,11 +101,6 @@ class CNLiveAlbumCell:UITableViewCell{ |
| 101 | 101 | } |
| 102 | 102 | @objc func playBtnAction(){ |
| 103 | 103 | showLoading(message: "") |
| 104 | - self.getAlbumList() | |
| 105 | - } | |
| 106 | - | |
| 107 | - //获取专辑详情(简介等) | |
| 108 | - func getAlbumMsg(){ | |
| 109 | 104 | var aid = "" |
| 110 | 105 | if self.albumModel != nil{ |
| 111 | 106 | aid = self.albumModel!.contentId |
| ... | ... | @@ -114,42 +109,56 @@ class CNLiveAlbumCell:UITableViewCell{ |
| 114 | 109 | }else{ |
| 115 | 110 | aid = "" |
| 116 | 111 | } |
| 117 | - CNLiveHomePageViewModel.getAlbumMsg(aid: aid) { result, status in | |
| 118 | - hiddenLoading() | |
| 119 | - if status == .success{ | |
| 120 | - let model = result as! CNLiveAlbumMsgModel | |
| 121 | - for listModel in self.albumModelArr! { | |
| 122 | - listModel.albumMsgModel = model | |
| 123 | - } | |
| 124 | - navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveShortVideoViewController(), animated: pushAnimated) | |
| 125 | - | |
| 126 | - navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLivePlayletHomePageController(aid: aid), animated: true) | |
| 127 | - }else{ | |
| 128 | - | |
| 129 | - } | |
| 130 | - } | |
| 131 | - } | |
| 132 | - //获取专辑视频列表详情(播放地址 ,点赞数等信息) | |
| 133 | - func getAlbumList(){ | |
| 134 | - showLoading(message: "") | |
| 135 | - var aid = "" | |
| 136 | - if self.albumModel != nil{ | |
| 137 | - aid = self.albumModel!.contentId | |
| 138 | - }else if self.albumMsgModel != nil{ | |
| 139 | - aid = self.albumMsgModel!.albumId | |
| 140 | - }else{ | |
| 141 | - aid = "" | |
| 142 | - } | |
| 143 | - | |
| 144 | - CNLiveHomePageViewModel.getAlbumList(aid: aid){ result, status in | |
| 145 | - hiddenLoading() | |
| 146 | - if status == .success{ | |
| 147 | - let arr = result as! Array<CNLiveAlbumListModel> | |
| 148 | - self.albumModelArr = Array(arr) | |
| 149 | - self.getAlbumMsg() | |
| 150 | - }else{ | |
| 151 | - | |
| 152 | - } | |
| 153 | - } | |
| 112 | + | |
| 113 | + navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveShortVideoViewController(aid: aid), animated: pushAnimated) | |
| 114 | + | |
| 115 | +// self.getAlbumList() | |
| 154 | 116 | } |
| 117 | + | |
| 118 | +// //获取专辑详情(简介等) | |
| 119 | +// func getAlbumMsg(){ | |
| 120 | +// var aid = "" | |
| 121 | +// if self.albumModel != nil{ | |
| 122 | +// aid = self.albumModel!.contentId | |
| 123 | +// }else if self.albumMsgModel != nil{ | |
| 124 | +// aid = self.albumMsgModel!.albumId | |
| 125 | +// }else{ | |
| 126 | +// aid = "" | |
| 127 | +// } | |
| 128 | +// CNLiveHomePageViewModel.getAlbumMsg(aid: aid) { result, status in | |
| 129 | +// hiddenLoading() | |
| 130 | +// if status == .success{ | |
| 131 | +// let model = result as! CNLiveAlbumMsgModel | |
| 132 | +// for listModel in self.albumModelArr! { | |
| 133 | +// listModel.albumMsgModel = model | |
| 134 | +// } | |
| 135 | +// navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveShortVideoViewController(aid: aid), animated: pushAnimated) | |
| 136 | +// }else{ | |
| 137 | +// | |
| 138 | +// } | |
| 139 | +// } | |
| 140 | +// } | |
| 141 | +// //获取专辑视频列表详情(播放地址 ,点赞数等信息) | |
| 142 | +// func getAlbumList(){ | |
| 143 | +// showLoading(message: "") | |
| 144 | +// var aid = "" | |
| 145 | +// if self.albumModel != nil{ | |
| 146 | +// aid = self.albumModel!.contentId | |
| 147 | +// }else if self.albumMsgModel != nil{ | |
| 148 | +// aid = self.albumMsgModel!.albumId | |
| 149 | +// }else{ | |
| 150 | +// aid = "" | |
| 151 | +// } | |
| 152 | +// | |
| 153 | +// CNLiveHomePageViewModel.getAlbumList(aid: aid){ result, status in | |
| 154 | +// hiddenLoading() | |
| 155 | +// if status == .success{ | |
| 156 | +// let arr = result as! Array<CNLiveAlbumListModel> | |
| 157 | +// self.albumModelArr = Array(arr) | |
| 158 | +// self.getAlbumMsg() | |
| 159 | +// }else{ | |
| 160 | +// | |
| 161 | +// } | |
| 162 | +// } | |
| 163 | +// } | |
| 155 | 164 | } | ... | ... |
metaCode/Classes/Main/HomePages/View/PlayletHomePage/CNLivePlayletHomePageCell.swift
| ... | ... | @@ -41,7 +41,7 @@ class CNLivePlayletHomePageCell:UITableViewCell{ |
| 41 | 41 | titleLabel.textAlignment = .left |
| 42 | 42 | titleLabel.font = Font_13 |
| 43 | 43 | titleLabel.numberOfLines = 2 |
| 44 | - titleLabel.text = "啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊" | |
| 44 | + titleLabel.text = "视频标题" | |
| 45 | 45 | let height = titleLabel.qmui_lineHeight |
| 46 | 46 | titleLabel.height = height*2 |
| 47 | 47 | return titleLabel | ... | ... |
metaCode/Classes/Main/HomePages/View/PlayletHomePage/CNLivePlayletHomePageHeaderCell.swift
| ... | ... | @@ -57,7 +57,7 @@ class CNLivePlayletHomePageHeaderCell:UITableViewCell{ |
| 57 | 57 | titleLabel.textColor = HexColor("#333333") |
| 58 | 58 | titleLabel.textAlignment = .left |
| 59 | 59 | titleLabel.font = BoldFont_15 |
| 60 | - titleLabel.text = "啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊" | |
| 60 | + titleLabel.text = "短剧标题" | |
| 61 | 61 | let height = titleLabel.qmui_lineHeight |
| 62 | 62 | titleLabel.height = height |
| 63 | 63 | return titleLabel |
| ... | ... | @@ -68,7 +68,7 @@ class CNLivePlayletHomePageHeaderCell:UITableViewCell{ |
| 68 | 68 | titleLabel.textColor = HexColor("#999999") |
| 69 | 69 | titleLabel.textAlignment = .left |
| 70 | 70 | titleLabel.font = Font_12 |
| 71 | - titleLabel.text = "45集" | |
| 71 | + titleLabel.text = "1集" | |
| 72 | 72 | let height = titleLabel.qmui_lineHeight |
| 73 | 73 | titleLabel.height = height |
| 74 | 74 | return titleLabel |
| ... | ... | @@ -325,8 +325,9 @@ class CNLivePlayletHomePageHeaderCell:UITableViewCell{ |
| 325 | 325 | //已购买 |
| 326 | 326 | self.paymentBtn.setTitle("已购买", for: .normal) |
| 327 | 327 | self.paymentBtn.setTitleColor(HexColor("#619CFF"), for: .normal) |
| 328 | + | |
| 329 | + let payLayer = self.subLayer(name: payBtnSubLayer, viewLayer: self.paymentBtn.layer) | |
| 328 | 330 | |
| 329 | - let payLayer = self.paymentBtn.layer.qmui_layer(withName: payBtnSubLayer) | |
| 330 | 331 | payLayer?.removeFromSuperlayer() |
| 331 | 332 | self.paymentBtn.backgroundColor = HexColor("#ECF3FF") |
| 332 | 333 | }else{ |
| ... | ... | @@ -334,7 +335,8 @@ class CNLivePlayletHomePageHeaderCell:UITableViewCell{ |
| 334 | 335 | self.paymentBtn.setTitle("付费解锁全集", for: .normal) |
| 335 | 336 | self.paymentBtn.setTitleColor(HexColor("#FFFFFF"), for: .normal) |
| 336 | 337 | |
| 337 | - let payLayer = self.paymentBtn.layer.qmui_layer(withName: payBtnSubLayer) | |
| 338 | + let payLayer = self.subLayer(name: payBtnSubLayer, viewLayer: self.paymentBtn.layer) | |
| 339 | + | |
| 338 | 340 | if (payLayer != nil){ |
| 339 | 341 | //已添加layer |
| 340 | 342 | }else{ |
| ... | ... | @@ -357,15 +359,14 @@ class CNLivePlayletHomePageHeaderCell:UITableViewCell{ |
| 357 | 359 | //已追剧 |
| 358 | 360 | self.followBtn.setTitleColor(HexColor("#F5A623"), for: .normal) |
| 359 | 361 | self.followBtn.setTitle("已追剧", for: .normal) |
| 360 | - let follLayer = self.followBtn.layer.qmui_layer(withName: followBtnSubLayer) | |
| 362 | + let follLayer = self.subLayer(name: followBtnSubLayer, viewLayer: self.followBtn.layer) | |
| 361 | 363 | follLayer?.removeFromSuperlayer() |
| 362 | 364 | self.followBtn.backgroundColor = HexColor("#FDF4E4") |
| 363 | 365 | }else{ |
| 364 | 366 | //未追剧 |
| 365 | 367 | self.followBtn.setTitle("追剧", for: .normal) |
| 366 | 368 | self.followBtn.setTitleColor(HexColor("#FFFFFF"), for: .normal) |
| 367 | - | |
| 368 | - let follLayer = self.followBtn.layer.qmui_layer(withName: followBtnSubLayer) | |
| 369 | + let follLayer = self.subLayer(name: followBtnSubLayer, viewLayer: self.followBtn.layer) | |
| 369 | 370 | if (follLayer != nil){ |
| 370 | 371 | //已添加layer |
| 371 | 372 | }else{ |
| ... | ... | @@ -383,6 +384,16 @@ class CNLivePlayletHomePageHeaderCell:UITableViewCell{ |
| 383 | 384 | |
| 384 | 385 | } |
| 385 | 386 | } |
| 387 | + | |
| 388 | + func subLayer(name:String,viewLayer:CALayer) -> CALayer?{ | |
| 389 | + if let subLayer = viewLayer.sublayers?.first(where: { $0.name == name }) { | |
| 390 | + // 这里可以对获取到的子图层进行操作或者访问其属性等 | |
| 391 | + return subLayer | |
| 392 | + } else { | |
| 393 | + print("未找到指定名称的图层") | |
| 394 | + return nil | |
| 395 | + } | |
| 396 | + } | |
| 386 | 397 | |
| 387 | 398 | // MARK: - 网络请求 追剧1/取消追剧2 |
| 388 | 399 | func postAlbumCollect(type:NSInteger){ | ... | ... |