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,7 +50,7 @@ class CNLiveShopGoodsListCell: UITableViewCell { | ||
| 50 | titleLabel.textAlignment = .left | 50 | titleLabel.textAlignment = .left |
| 51 | titleLabel.font = Font_15 | 51 | titleLabel.font = Font_15 |
| 52 | titleLabel.adjustsFontSizeToFitWidth=true | 52 | titleLabel.adjustsFontSizeToFitWidth=true |
| 53 | - titleLabel.text = "啊啊啊啊啊" | 53 | + titleLabel.text = "标题" |
| 54 | return titleLabel | 54 | return titleLabel |
| 55 | }() | 55 | }() |
| 56 | ///副标题 | 56 | ///副标题 |
| @@ -60,7 +60,7 @@ class CNLiveShopGoodsListCell: UITableViewCell { | @@ -60,7 +60,7 @@ class CNLiveShopGoodsListCell: UITableViewCell { | ||
| 60 | subTitleLabel.textAlignment = .left | 60 | subTitleLabel.textAlignment = .left |
| 61 | subTitleLabel.font = Font_13 | 61 | subTitleLabel.font = Font_13 |
| 62 | subTitleLabel.adjustsFontSizeToFitWidth=true | 62 | subTitleLabel.adjustsFontSizeToFitWidth=true |
| 63 | - subTitleLabel.text = "啊啊啊啊" | 63 | + subTitleLabel.text = "副标题" |
| 64 | return subTitleLabel | 64 | return subTitleLabel |
| 65 | }() | 65 | }() |
| 66 | ///价格 | 66 | ///价格 |
metaCode/Classes/Main/HomePages/Controller/PlayletHomePage/CNLivePlayletHomePageController.swift
| @@ -133,4 +133,12 @@ class CNLivePlayletHomePageController:CNLiveBaseViewController, UITableViewDataS | @@ -133,4 +133,12 @@ class CNLivePlayletHomePageController:CNLiveBaseViewController, UITableViewDataS | ||
| 133 | return 75+12*2 | 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,7 +48,7 @@ class CNLiveAlbumCell:UITableViewCell{ | ||
| 48 | titleLabel.textColor = HexColor("#333333") | 48 | titleLabel.textColor = HexColor("#333333") |
| 49 | titleLabel.textAlignment = .left | 49 | titleLabel.textAlignment = .left |
| 50 | titleLabel.font = Font_15 | 50 | titleLabel.font = Font_15 |
| 51 | - titleLabel.text = "啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊" | 51 | + titleLabel.text = "标题" |
| 52 | return titleLabel | 52 | return titleLabel |
| 53 | }() | 53 | }() |
| 54 | ///副标题 | 54 | ///副标题 |
| @@ -101,11 +101,6 @@ class CNLiveAlbumCell:UITableViewCell{ | @@ -101,11 +101,6 @@ class CNLiveAlbumCell:UITableViewCell{ | ||
| 101 | } | 101 | } |
| 102 | @objc func playBtnAction(){ | 102 | @objc func playBtnAction(){ |
| 103 | showLoading(message: "") | 103 | showLoading(message: "") |
| 104 | - self.getAlbumList() | ||
| 105 | - } | ||
| 106 | - | ||
| 107 | - //获取专辑详情(简介等) | ||
| 108 | - func getAlbumMsg(){ | ||
| 109 | var aid = "" | 104 | var aid = "" |
| 110 | if self.albumModel != nil{ | 105 | if self.albumModel != nil{ |
| 111 | aid = self.albumModel!.contentId | 106 | aid = self.albumModel!.contentId |
| @@ -114,42 +109,56 @@ class CNLiveAlbumCell:UITableViewCell{ | @@ -114,42 +109,56 @@ class CNLiveAlbumCell:UITableViewCell{ | ||
| 114 | }else{ | 109 | }else{ |
| 115 | aid = "" | 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,7 +41,7 @@ class CNLivePlayletHomePageCell:UITableViewCell{ | ||
| 41 | titleLabel.textAlignment = .left | 41 | titleLabel.textAlignment = .left |
| 42 | titleLabel.font = Font_13 | 42 | titleLabel.font = Font_13 |
| 43 | titleLabel.numberOfLines = 2 | 43 | titleLabel.numberOfLines = 2 |
| 44 | - titleLabel.text = "啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊" | 44 | + titleLabel.text = "视频标题" |
| 45 | let height = titleLabel.qmui_lineHeight | 45 | let height = titleLabel.qmui_lineHeight |
| 46 | titleLabel.height = height*2 | 46 | titleLabel.height = height*2 |
| 47 | return titleLabel | 47 | return titleLabel |
metaCode/Classes/Main/HomePages/View/PlayletHomePage/CNLivePlayletHomePageHeaderCell.swift
| @@ -57,7 +57,7 @@ class CNLivePlayletHomePageHeaderCell:UITableViewCell{ | @@ -57,7 +57,7 @@ class CNLivePlayletHomePageHeaderCell:UITableViewCell{ | ||
| 57 | titleLabel.textColor = HexColor("#333333") | 57 | titleLabel.textColor = HexColor("#333333") |
| 58 | titleLabel.textAlignment = .left | 58 | titleLabel.textAlignment = .left |
| 59 | titleLabel.font = BoldFont_15 | 59 | titleLabel.font = BoldFont_15 |
| 60 | - titleLabel.text = "啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊" | 60 | + titleLabel.text = "短剧标题" |
| 61 | let height = titleLabel.qmui_lineHeight | 61 | let height = titleLabel.qmui_lineHeight |
| 62 | titleLabel.height = height | 62 | titleLabel.height = height |
| 63 | return titleLabel | 63 | return titleLabel |
| @@ -68,7 +68,7 @@ class CNLivePlayletHomePageHeaderCell:UITableViewCell{ | @@ -68,7 +68,7 @@ class CNLivePlayletHomePageHeaderCell:UITableViewCell{ | ||
| 68 | titleLabel.textColor = HexColor("#999999") | 68 | titleLabel.textColor = HexColor("#999999") |
| 69 | titleLabel.textAlignment = .left | 69 | titleLabel.textAlignment = .left |
| 70 | titleLabel.font = Font_12 | 70 | titleLabel.font = Font_12 |
| 71 | - titleLabel.text = "45集" | 71 | + titleLabel.text = "1集" |
| 72 | let height = titleLabel.qmui_lineHeight | 72 | let height = titleLabel.qmui_lineHeight |
| 73 | titleLabel.height = height | 73 | titleLabel.height = height |
| 74 | return titleLabel | 74 | return titleLabel |
| @@ -325,8 +325,9 @@ class CNLivePlayletHomePageHeaderCell:UITableViewCell{ | @@ -325,8 +325,9 @@ class CNLivePlayletHomePageHeaderCell:UITableViewCell{ | ||
| 325 | //已购买 | 325 | //已购买 |
| 326 | self.paymentBtn.setTitle("已购买", for: .normal) | 326 | self.paymentBtn.setTitle("已购买", for: .normal) |
| 327 | self.paymentBtn.setTitleColor(HexColor("#619CFF"), for: .normal) | 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 | payLayer?.removeFromSuperlayer() | 331 | payLayer?.removeFromSuperlayer() |
| 331 | self.paymentBtn.backgroundColor = HexColor("#ECF3FF") | 332 | self.paymentBtn.backgroundColor = HexColor("#ECF3FF") |
| 332 | }else{ | 333 | }else{ |
| @@ -334,7 +335,8 @@ class CNLivePlayletHomePageHeaderCell:UITableViewCell{ | @@ -334,7 +335,8 @@ class CNLivePlayletHomePageHeaderCell:UITableViewCell{ | ||
| 334 | self.paymentBtn.setTitle("付费解锁全集", for: .normal) | 335 | self.paymentBtn.setTitle("付费解锁全集", for: .normal) |
| 335 | self.paymentBtn.setTitleColor(HexColor("#FFFFFF"), for: .normal) | 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 | if (payLayer != nil){ | 340 | if (payLayer != nil){ |
| 339 | //已添加layer | 341 | //已添加layer |
| 340 | }else{ | 342 | }else{ |
| @@ -357,15 +359,14 @@ class CNLivePlayletHomePageHeaderCell:UITableViewCell{ | @@ -357,15 +359,14 @@ class CNLivePlayletHomePageHeaderCell:UITableViewCell{ | ||
| 357 | //已追剧 | 359 | //已追剧 |
| 358 | self.followBtn.setTitleColor(HexColor("#F5A623"), for: .normal) | 360 | self.followBtn.setTitleColor(HexColor("#F5A623"), for: .normal) |
| 359 | self.followBtn.setTitle("已追剧", for: .normal) | 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 | follLayer?.removeFromSuperlayer() | 363 | follLayer?.removeFromSuperlayer() |
| 362 | self.followBtn.backgroundColor = HexColor("#FDF4E4") | 364 | self.followBtn.backgroundColor = HexColor("#FDF4E4") |
| 363 | }else{ | 365 | }else{ |
| 364 | //未追剧 | 366 | //未追剧 |
| 365 | self.followBtn.setTitle("追剧", for: .normal) | 367 | self.followBtn.setTitle("追剧", for: .normal) |
| 366 | self.followBtn.setTitleColor(HexColor("#FFFFFF"), for: .normal) | 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 | if (follLayer != nil){ | 370 | if (follLayer != nil){ |
| 370 | //已添加layer | 371 | //已添加layer |
| 371 | }else{ | 372 | }else{ |
| @@ -383,6 +384,16 @@ class CNLivePlayletHomePageHeaderCell:UITableViewCell{ | @@ -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 | // MARK: - 网络请求 追剧1/取消追剧2 | 398 | // MARK: - 网络请求 追剧1/取消追剧2 |
| 388 | func postAlbumCollect(type:NSInteger){ | 399 | func postAlbumCollect(type:NSInteger){ |