Commit 833c632fb94fe485cde70c8b6ce7afc4748349b3
1 parent
c4cbe6dd
优化功能
- 优化短剧首页和短剧详情页列表大图一致 - 优化短剧详情页大图为不能点击且和首页一致 - 优化短剧+课程大图的首页和详情页隐藏标题和副标题 修复功能 - 修复短剧播放页列表付费时积分不足没有跳转的问题 - 修复短剧列表只显示10条的问题 - 修复在追短剧不显示副标题的问题 - 修复今日推荐等类型不支持跳转短剧的问题
Showing
8 changed files
with
30 additions
and
19 deletions
metaCode/Classes/Common/Util/CNLiveIntegralAlertTool.swift
| @@ -334,12 +334,11 @@ class CNLiveIntegralAlertTool:NSObject{ | @@ -334,12 +334,11 @@ class CNLiveIntegralAlertTool:NSObject{ | ||
| 334 | @objc func payBtnAction(){ | 334 | @objc func payBtnAction(){ |
| 335 | if self.currentIntegralPayStatus == .integralEnough{ | 335 | if self.currentIntegralPayStatus == .integralEnough{ |
| 336 | self.postOrderVideoByPoint() | 336 | self.postOrderVideoByPoint() |
| 337 | -// self.integralStatusChangedBlock!(self.currentIntegralPayStatus) | ||
| 338 | }else if self.currentIntegralPayStatus == .integralNotEnough{ | 337 | }else if self.currentIntegralPayStatus == .integralNotEnough{ |
| 339 | self.hiddenIntegralAlert() | 338 | self.hiddenIntegralAlert() |
| 340 | -// self.integralStatusChangedBlock!(self.currentIntegralPayStatus) | 339 | + self.integralStatusChangedBlock!(.payCancel) |
| 341 | //跳转任务中心 | 340 | //跳转任务中心 |
| 342 | - navigationViewController().pushViewController(CNLiveMineQuestViewController(checkModel: self.checkInModel!), animated: pushAnimated) | 341 | + navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveMineQuestViewController(checkModel: self.checkInModel!), animated: pushAnimated) |
| 343 | 342 | ||
| 344 | }else if self.currentIntegralPayStatus == .paying{ | 343 | }else if self.currentIntegralPayStatus == .paying{ |
| 345 | 344 | ||
| @@ -370,14 +369,12 @@ class CNLiveIntegralAlertTool:NSObject{ | @@ -370,14 +369,12 @@ class CNLiveIntegralAlertTool:NSObject{ | ||
| 370 | if self.point > Int(self.integralCount)!{ | 369 | if self.point > Int(self.integralCount)!{ |
| 371 | //可以支付积分 | 370 | //可以支付积分 |
| 372 | self.currentIntegralPayStatus = .integralEnough | 371 | self.currentIntegralPayStatus = .integralEnough |
| 373 | -// self.integralStatusChangedBlock!(.integralEnough) | ||
| 374 | - | ||
| 375 | }else{ | 372 | }else{ |
| 376 | //积分不足 | 373 | //积分不足 |
| 377 | self.currentIntegralPayStatus = .integralNotEnough | 374 | self.currentIntegralPayStatus = .integralNotEnough |
| 378 | -// self.integralStatusChangedBlock!(.integralEnough) | ||
| 379 | } | 375 | } |
| 380 | self.initUI() | 376 | self.initUI() |
| 377 | + self.integralStatusChangedBlock!(.payCancel) | ||
| 381 | let errMsg = result as! String | 378 | let errMsg = result as! String |
| 382 | showMessage(message: errMsg) | 379 | showMessage(message: errMsg) |
| 383 | } | 380 | } |
metaCode/Classes/Main/HomePage/Controller/DownSlideController/CNUpSlideDetailViewController.swift
| @@ -286,16 +286,17 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSou | @@ -286,16 +286,17 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSou | ||
| 286 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { | 286 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
| 287 | let albumModel = self.dataArray[indexPath.row] as! CNLiveAlbumModel | 287 | let albumModel = self.dataArray[indexPath.row] as! CNLiveAlbumModel |
| 288 | if indexPath.section == 0{ | 288 | if indexPath.section == 0{ |
| 289 | + //大图统一不能点击跳转 | ||
| 289 | if self.cellType == .playlet{ | 290 | if self.cellType == .playlet{ |
| 290 | //短剧大图,跳转播放页 | 291 | //短剧大图,跳转播放页 |
| 291 | - navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveShortVideoViewController(aid: albumModel.contentId), animated: pushAnimated) | 292 | +// navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveShortVideoViewController(aid: albumModel.contentId), animated: pushAnimated) |
| 292 | }else if self.cellType == .course || self.cellType == .playletToCourse{ | 293 | }else if self.cellType == .course || self.cellType == .playletToCourse{ |
| 293 | if self.slideModel?.type == SlideModelTypeAllCourse12{ | 294 | if self.slideModel?.type == SlideModelTypeAllCourse12{ |
| 294 | //全部课程,跳转h5 | 295 | //全部课程,跳转h5 |
| 295 | 296 | ||
| 296 | }else if self.slideModel?.type == SlideModelTypeOneCourse75{ | 297 | }else if self.slideModel?.type == SlideModelTypeOneCourse75{ |
| 297 | //大图课程,跳转h5 | 298 | //大图课程,跳转h5 |
| 298 | - CNLiveDownSlideTool.pushWebVCWithCNLiveAlbumMdl(albumModel: albumModel,controller: self) | 299 | +// CNLiveDownSlideTool.pushWebVCWithCNLiveAlbumMdl(albumModel: albumModel,controller: self) |
| 299 | } | 300 | } |
| 300 | } | 301 | } |
| 301 | }else{ | 302 | }else{ |
metaCode/Classes/Main/HomePage/Controller/WebController/CNWebView.swift
| @@ -123,7 +123,6 @@ class CNWebView:UIView,WKNavigationDelegate{ | @@ -123,7 +123,6 @@ class CNWebView:UIView,WKNavigationDelegate{ | ||
| 123 | let dateStr = formatter.string(from: date) | 123 | let dateStr = formatter.string(from: date) |
| 124 | let sidStr = String(format: "%@%@", UserInfoManager.shared.userInfo.uid,dateStr) | 124 | let sidStr = String(format: "%@%@", UserInfoManager.shared.userInfo.uid,dateStr) |
| 125 | let signStr = sidStr.crypt(operation: CCOperation(kCCEncrypt), key: CNLiveMCEnvironmentManager.shared.appKey) | 125 | let signStr = sidStr.crypt(operation: CCOperation(kCCEncrypt), key: CNLiveMCEnvironmentManager.shared.appKey) |
| 126 | - //看是 appKey还是appKeywjj | ||
| 127 | let sidSignStr = (signStr ?? "").isEmpty ? "" : signStr | 126 | let sidSignStr = (signStr ?? "").isEmpty ? "" : signStr |
| 128 | let sourceArray = str.components(separatedBy: "?") | 127 | let sourceArray = str.components(separatedBy: "?") |
| 129 | let buildVersion = Bundle.main.infoDictionary!["CFBundleVersion"] as! String | 128 | let buildVersion = Bundle.main.infoDictionary!["CFBundleVersion"] as! String |
metaCode/Classes/Main/HomePage/View/VerticalViews/DownSlide/CNDownSlideSingleCourseCell.swift
| @@ -190,19 +190,23 @@ class CNDownSlideSingleCourseCell: UITableViewCell { | @@ -190,19 +190,23 @@ class CNDownSlideSingleCourseCell: UITableViewCell { | ||
| 190 | bgImageView.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius | 190 | bgImageView.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius |
| 191 | bgImageView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] | 191 | bgImageView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] |
| 192 | bgImageView.layer.masksToBounds = true | 192 | bgImageView.layer.masksToBounds = true |
| 193 | - bgImageView.kf.setImage(with: URL(string: model.contents[0].poster ?? "")) | ||
| 194 | - | 193 | + if let bgImgStr = model.background{ |
| 194 | + bgImageView.kf.setImage(with: URL(string: bgImgStr)) | ||
| 195 | + }else{ | ||
| 196 | + bgImageView.kf.setImage(with: URL(string: model.contents[0].poster ?? "")) | ||
| 197 | + } | ||
| 198 | + | ||
| 195 | let titleLbl = UILabel(frame: CGRect(x: DownSlideRecommendLeftGap, y: DownSlideRecommendLeftGap, width: DownSlideSingleCourseW-DownSlideRecommendLeftGap*2, height: 30)) | 199 | let titleLbl = UILabel(frame: CGRect(x: DownSlideRecommendLeftGap, y: DownSlideRecommendLeftGap, width: DownSlideSingleCourseW-DownSlideRecommendLeftGap*2, height: 30)) |
| 196 | titleLbl.text = model.contents[0].title ?? "" | 200 | titleLbl.text = model.contents[0].title ?? "" |
| 197 | titleLbl.font = BoldFont_21 | 201 | titleLbl.font = BoldFont_21 |
| 198 | titleLbl.textColor = HexColor("#FFFFFF") | 202 | titleLbl.textColor = HexColor("#FFFFFF") |
| 199 | - bgImageView.addSubview(titleLbl) | 203 | +// bgImageView.addSubview(titleLbl) |
| 200 | 204 | ||
| 201 | let subTitleLbl = UILabel(frame: CGRect(x: DownSlideRecommendLeftGap, y:titleLbl.bottom , width: DownSlideSingleCourseW-DownSlideRecommendLeftGap*2, height: 30)) | 205 | let subTitleLbl = UILabel(frame: CGRect(x: DownSlideRecommendLeftGap, y:titleLbl.bottom , width: DownSlideSingleCourseW-DownSlideRecommendLeftGap*2, height: 30)) |
| 202 | subTitleLbl.text = model.contents[0].subTitle ?? "" | 206 | subTitleLbl.text = model.contents[0].subTitle ?? "" |
| 203 | subTitleLbl.font = Font_12 | 207 | subTitleLbl.font = Font_12 |
| 204 | subTitleLbl.textColor = HexColor("#FFFFFF") | 208 | subTitleLbl.textColor = HexColor("#FFFFFF") |
| 205 | - bgImageView.addSubview(subTitleLbl) | 209 | +// bgImageView.addSubview(subTitleLbl) |
| 206 | 210 | ||
| 207 | //单节底部视图 | 211 | //单节底部视图 |
| 208 | let singleCourseBottomView = UIView(frame: CGRect(x: 0, y: DownSlideSingleCourseImgH, width: DownSlideSingleCourseW, height: DownSlideSingleCourseMoreH)) | 212 | let singleCourseBottomView = UIView(frame: CGRect(x: 0, y: DownSlideSingleCourseImgH, width: DownSlideSingleCourseW, height: DownSlideSingleCourseMoreH)) |
metaCode/Classes/Main/HomePages/View/HomepageDetail/CNLiveAlbumCell.swift
| @@ -123,7 +123,7 @@ class CNLiveAlbumCell:UITableViewCell{ | @@ -123,7 +123,7 @@ class CNLiveAlbumCell:UITableViewCell{ | ||
| 123 | 123 | ||
| 124 | //在追短剧model | 124 | //在追短剧model |
| 125 | self.titleLabl.text = model.albumName | 125 | self.titleLabl.text = model.albumName |
| 126 | - self.subTitleLabel.text = model.subTitle | 126 | + self.subTitleLabel.text = model.desc |
| 127 | self.iconImgView.kf.setImage(with: URL(string: model.albumImg)) | 127 | self.iconImgView.kf.setImage(with: URL(string: model.albumImg)) |
| 128 | self.titleLabl.width = KSreenWidth-(self.iconImgView.right+15)-80-30 | 128 | self.titleLabl.width = KSreenWidth-(self.iconImgView.right+15)-80-30 |
| 129 | self.subTitleLabel.width = self.titleLabl.width | 129 | self.subTitleLabel.width = self.titleLabl.width |
metaCode/Classes/Main/HomePages/View/HomepageDetail/CNLiveAlbumImageCell.swift
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | // metaCode | 3 | // metaCode |
| 4 | // | 4 | // |
| 5 | // Created by zx on 2024/1/8. | 5 | // Created by zx on 2024/1/8. |
| 6 | -// | 6 | +// 短剧详情页大图cell |
| 7 | 7 | ||
| 8 | import Foundation | 8 | import Foundation |
| 9 | 9 | ||
| @@ -36,7 +36,7 @@ class CNLiveAlbumImageCell:UITableViewCell{ | @@ -36,7 +36,7 @@ class CNLiveAlbumImageCell:UITableViewCell{ | ||
| 36 | private func setupUI() { | 36 | private func setupUI() { |
| 37 | contentView.backgroundColor = HexColor(kCNDownSlideBackgroundColorHex) | 37 | contentView.backgroundColor = HexColor(kCNDownSlideBackgroundColorHex) |
| 38 | self.contentView.addSubview(self.iconImgView) | 38 | self.contentView.addSubview(self.iconImgView) |
| 39 | - self.contentView.addSubview(self.titleLabel) | 39 | +// self.contentView.addSubview(self.titleLabel) |
| 40 | self.contentView.clipsToBounds = true | 40 | self.contentView.clipsToBounds = true |
| 41 | } | 41 | } |
| 42 | 42 |
metaCode/Classes/Main/Model/CNLiveDownSlideModel.swift
| @@ -15,8 +15,10 @@ class CNLiveDownSlideModel: BaseModel { | @@ -15,8 +15,10 @@ class CNLiveDownSlideModel: BaseModel { | ||
| 15 | var blockName: String? | 15 | var blockName: String? |
| 16 | ///大块副标题 | 16 | ///大块副标题 |
| 17 | var blockSubTitle: String? | 17 | var blockSubTitle: String? |
| 18 | - ///类型 type=4一排两个 74今日推荐 12列表全部课程 75单课程大图/ | 18 | + ///类型 type=4一排两个 74今日推荐 12列表全部课程 75单课程大图 |
| 19 | var type: String? | 19 | var type: String? |
| 20 | + ///区块封面图 | ||
| 21 | + var background: String? | ||
| 20 | ///显示几行 | 22 | ///显示几行 |
| 21 | var rowNum: Int = 0 | 23 | var rowNum: Int = 0 |
| 22 | ///具体内容 title subTitle poster thirdUrl或者shareUrl | 24 | ///具体内容 title subTitle poster thirdUrl或者shareUrl |
metaCode/Classes/Main/Util/CNLiveDownSlideTool.swift
| @@ -24,7 +24,7 @@ class CNLiveDownSlideTool:NSObject{ | @@ -24,7 +24,7 @@ class CNLiveDownSlideTool:NSObject{ | ||
| 24 | let webVC = CNWebViewController() | 24 | let webVC = CNWebViewController() |
| 25 | webVC.url = URL(string: (contentMdl.thirdUrl)!) | 25 | webVC.url = URL(string: (contentMdl.thirdUrl)!) |
| 26 | navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) | 26 | navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) |
| 27 | - }else if (contentMdl.model == kCNDownSlideContentsModelModelAlbum) || (contentMdl.model == kCNDownSlideContentsModelModelAlbum_ugc) || (contentMdl.model == kCNDownSlideContentsModelModelAlbum_video){ | 27 | + }else if (contentMdl.model == kCNDownSlideContentsModelModelAlbum) || (contentMdl.model == kCNDownSlideContentsModelModelAlbum_video){ |
| 28 | 28 | ||
| 29 | let urlString = "http://wjjh5.cnlive.com/cnYmAlbumVideoList.html" | 29 | let urlString = "http://wjjh5.cnlive.com/cnYmAlbumVideoList.html" |
| 30 | let queryItem = URLQueryItem(name: "aid", value: contentMdl.contentId) | 30 | let queryItem = URLQueryItem(name: "aid", value: contentMdl.contentId) |
| @@ -35,6 +35,10 @@ class CNLiveDownSlideTool:NSObject{ | @@ -35,6 +35,10 @@ class CNLiveDownSlideTool:NSObject{ | ||
| 35 | let webVC = CNWebViewController() | 35 | let webVC = CNWebViewController() |
| 36 | webVC.url = regURL | 36 | webVC.url = regURL |
| 37 | navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) | 37 | navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) |
| 38 | + }else if (contentMdl.model == kCNDownSlideContentsModelModelAlbum_ugc){ | ||
| 39 | + | ||
| 40 | + //短剧-跳转短剧播放页 | ||
| 41 | + navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveShortVideoViewController(aid: contentMdl.contentId ?? ""), animated: pushAnimated) | ||
| 38 | }else{ | 42 | }else{ |
| 39 | return | 43 | return |
| 40 | } | 44 | } |
| @@ -55,7 +59,7 @@ class CNLiveDownSlideTool:NSObject{ | @@ -55,7 +59,7 @@ class CNLiveDownSlideTool:NSObject{ | ||
| 55 | let webVC = CNWebViewController() | 59 | let webVC = CNWebViewController() |
| 56 | webVC.url = URL(string: (albumModel.thirdUrl)) | 60 | webVC.url = URL(string: (albumModel.thirdUrl)) |
| 57 | controller.navigationController?.pushViewController(webVC, animated: pushAnimated) | 61 | controller.navigationController?.pushViewController(webVC, animated: pushAnimated) |
| 58 | - }else if (albumModel.model == kCNDownSlideContentsModelModelAlbum) || (albumModel.model == kCNDownSlideContentsModelModelAlbum_ugc) || (albumModel.model == kCNDownSlideContentsModelModelAlbum_video){ | 62 | + }else if (albumModel.model == kCNDownSlideContentsModelModelAlbum) || (albumModel.model == kCNDownSlideContentsModelModelAlbum_video){ |
| 59 | 63 | ||
| 60 | let urlString = "http://wjjh5.cnlive.com/cnYmAlbumVideoList.html" | 64 | let urlString = "http://wjjh5.cnlive.com/cnYmAlbumVideoList.html" |
| 61 | let queryItem = URLQueryItem(name: "aid", value: albumModel.contentId) | 65 | let queryItem = URLQueryItem(name: "aid", value: albumModel.contentId) |
| @@ -66,6 +70,10 @@ class CNLiveDownSlideTool:NSObject{ | @@ -66,6 +70,10 @@ class CNLiveDownSlideTool:NSObject{ | ||
| 66 | let webVC = CNWebViewController() | 70 | let webVC = CNWebViewController() |
| 67 | webVC.url = regURL | 71 | webVC.url = regURL |
| 68 | navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) | 72 | navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) |
| 73 | + }else if (albumModel.model == kCNDownSlideContentsModelModelAlbum_ugc){ | ||
| 74 | + //短剧-跳转短剧播放页 | ||
| 75 | + navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveShortVideoViewController(aid: albumModel.contentId), animated: pushAnimated) | ||
| 76 | + | ||
| 69 | }else{ | 77 | }else{ |
| 70 | return | 78 | return |
| 71 | } | 79 | } |