Commit 155c085f160830f59b35e03bea45ee6224746b43
Merge branch 'master' of http://bj.gitlab.cnlive.com/ios-team/CNLiveMateCode
# Conflicts: # metaCode.xcodeproj/project.pbxproj
Showing
31 changed files
with
1114 additions
and
621 deletions
metaCode.xcodeproj/project.pbxproj
| ... | ... | @@ -2071,7 +2071,7 @@ |
| 2071 | 2071 | CLANG_ENABLE_MODULES = NO; |
| 2072 | 2072 | CODE_SIGN_ENTITLEMENTS = metaCode/metaCode.entitlements; |
| 2073 | 2073 | CODE_SIGN_STYLE = Automatic; |
| 2074 | - CURRENT_PROJECT_VERSION = 1.0.3.24.01.03.11; | |
| 2074 | + CURRENT_PROJECT_VERSION = 1.0.4.24.01.15.15; | |
| 2075 | 2075 | DEVELOPMENT_TEAM = 94X49GG3ZW; |
| 2076 | 2076 | ENABLE_BITCODE = YES; |
| 2077 | 2077 | ENABLE_MODULE_VERIFIER = NO; |
| ... | ... | @@ -2143,7 +2143,6 @@ |
| 2143 | 2143 | "$(inherited)", |
| 2144 | 2144 | "@executable_path/Frameworks", |
| 2145 | 2145 | ); |
| 2146 | - MARKETING_VERSION = 1.0.3; | |
| 2147 | 2146 | OTHER_LDFLAGS = ( |
| 2148 | 2147 | "$(inherited)", |
| 2149 | 2148 | "-all_load", |
| ... | ... | @@ -2308,6 +2307,7 @@ |
| 2308 | 2307 | "\"SwiftUI\"", |
| 2309 | 2308 | "-ld64", |
| 2310 | 2309 | ); |
| 2310 | + MARKETING_VERSION = 1.0.4; | |
| 2311 | 2311 | PRODUCT_BUNDLE_IDENTIFIER = com.cnlive.metaCode; |
| 2312 | 2312 | PRODUCT_NAME = "$(TARGET_NAME)"; |
| 2313 | 2313 | SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; |
| ... | ... | @@ -2331,7 +2331,7 @@ |
| 2331 | 2331 | CLANG_ENABLE_MODULES = NO; |
| 2332 | 2332 | CODE_SIGN_ENTITLEMENTS = metaCode/metaCode.entitlements; |
| 2333 | 2333 | CODE_SIGN_STYLE = Automatic; |
| 2334 | - CURRENT_PROJECT_VERSION = 1.0.3.24.01.03.11; | |
| 2334 | + CURRENT_PROJECT_VERSION = 1.0.4.24.01.15.15; | |
| 2335 | 2335 | DEVELOPMENT_TEAM = 94X49GG3ZW; |
| 2336 | 2336 | ENABLE_BITCODE = YES; |
| 2337 | 2337 | ENABLE_MODULE_VERIFIER = NO; |
| ... | ... | @@ -2403,7 +2403,6 @@ |
| 2403 | 2403 | "$(inherited)", |
| 2404 | 2404 | "@executable_path/Frameworks", |
| 2405 | 2405 | ); |
| 2406 | - MARKETING_VERSION = 1.0.3; | |
| 2407 | 2406 | OTHER_LDFLAGS = ( |
| 2408 | 2407 | "$(inherited)", |
| 2409 | 2408 | "-all_load", |
| ... | ... | @@ -2568,6 +2567,7 @@ |
| 2568 | 2567 | "\"SwiftUI\"", |
| 2569 | 2568 | "-ld64", |
| 2570 | 2569 | ); |
| 2570 | + MARKETING_VERSION = 1.0.4; | |
| 2571 | 2571 | PRODUCT_BUNDLE_IDENTIFIER = com.cnlive.metaCode; |
| 2572 | 2572 | PRODUCT_NAME = "$(TARGET_NAME)"; |
| 2573 | 2573 | SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; | ... | ... |
metaCode/Classes/Common/Base/CNLiveBaseNavigationController.swift
| ... | ... | @@ -11,21 +11,23 @@ class CNLiveBaseNavigationController : UINavigationController,UINavigationContro |
| 11 | 11 | |
| 12 | 12 | override func viewDidLoad() { |
| 13 | 13 | super.viewDidLoad() |
| 14 | - guard let targets = interactivePopGestureRecognizer?.value(forKey: "_targets") as? [NSObject] else {return} | |
| 15 | - let targetObjc = targets[0] | |
| 16 | - let target = targetObjc.value(forKey: "target") | |
| 17 | - let action = Selector(("handleNavigationTransition:")) | |
| 18 | 14 | |
| 19 | - let panges = UIPanGestureRecognizer(target: target, action: action) | |
| 20 | - view.addGestureRecognizer(panges) | |
| 15 | + //下面注释的代码会影响push ,暂时注释 | |
| 16 | +// guard let targets = interactivePopGestureRecognizer?.value(forKey: "_targets") as? [NSObject] else {return} | |
| 17 | +// let targetObjc = targets[0] | |
| 18 | +// let target = targetObjc.value(forKey: "target") | |
| 19 | +// let action = Selector(("handleNavigationTransition:")) | |
| 20 | +// | |
| 21 | +// let panges = UIPanGestureRecognizer(target: target, action: action) | |
| 22 | +// view.addGestureRecognizer(panges) | |
| 21 | 23 | |
| 22 | 24 | self.interactivePopGestureRecognizer?.delegate = self //侧滑返回 |
| 23 | 25 | self.delegate = self as UINavigationControllerDelegate |
| 24 | 26 | } |
| 25 | 27 | |
| 26 | - // MARK: - <UIGestureRecognizerDelegate> | |
| 27 | - // 什么时候调用:每次触发手势之前都会询问下代理,是否触发。 | |
| 28 | - // 作用:拦截手势触发,手势识别器对象会调用这个代理方法来决定手势是否有效 | |
| 28 | +// MARK: - <UIGestureRecognizerDelegate> | |
| 29 | +// 什么时候调用:每次触发手势之前都会询问下代理,是否触发。 | |
| 30 | +// 作用:拦截手势触发,手势识别器对象会调用这个代理方法来决定手势是否有效 | |
| 29 | 31 | override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool { |
| 30 | 32 | |
| 31 | 33 | return viewControllers.count > 1 |
| ... | ... | @@ -45,6 +47,7 @@ class CNLiveBaseNavigationController : UINavigationController,UINavigationContro |
| 45 | 47 | |
| 46 | 48 | /// 重写push方法的目的 : 拦截所有push进来的子控制器 |
| 47 | 49 | override func pushViewController(_ viewController: UIViewController, animated: Bool) { |
| 50 | + | |
| 48 | 51 | if (self.children.count > 0 ) { |
| 49 | 52 | // 隐藏底部的工具条 |
| 50 | 53 | viewController.hidesBottomBarWhenPushed = true | ... | ... |
metaCode/Classes/Common/Base/CNLiveBaseTabBarViewController.swift
| ... | ... | @@ -39,7 +39,7 @@ class CNLiveBaseTabBarViewController: UITabBarController |
| 39 | 39 | // override func viewWillAppear(_ animated: Bool) { |
| 40 | 40 | // super.viewWillAppear(animated) |
| 41 | 41 | // |
| 42 | -// self.selectedIndex = 1 | |
| 42 | +// self.selectedIndex = 0 | |
| 43 | 43 | // |
| 44 | 44 | // } |
| 45 | 45 | override func viewDidAppear(_ animated: Bool) { |
| ... | ... | @@ -63,18 +63,17 @@ class CNLiveBaseTabBarViewController: UITabBarController |
| 63 | 63 | let mineVC = CNLiveMineViewController() |
| 64 | 64 | |
| 65 | 65 | creatTabbarView(viewController: homeVC, image: "tabbar_hoem_icon_default", selectImage: "tabbar_hoem_icon_selected", title: "首页") |
| 66 | - | |
| 67 | 66 | creatTabbarView(viewController: authVC, image: "tabbar_authentication_unSelect", selectImage: "tabbar_authentication", title: "认证") |
| 68 | - | |
| 69 | 67 | creatTabbarView(viewController: mineVC, image: "tabbar_mine_icon_default", selectImage: "tabbar_mine_icon_selected", title: "我的") |
| 70 | 68 | |
| 71 | 69 | self.tabBar.tintColor = UIColor("#0066FE") |
| 72 | 70 | self.tabBar.isTranslucent = false |
| 73 | - | |
| 74 | 71 | self.viewControllers = [ |
| 75 | - CNLiveBaseNavigationController(rootViewController: homeVC),CNLiveBaseNavigationController(rootViewController: authVC), | |
| 76 | - CNLiveBaseNavigationController(rootViewController: mineVC), | |
| 77 | - ]; | |
| 72 | + CNLiveBaseNavigationController(rootViewController: homeVC), | |
| 73 | + CNLiveBaseNavigationController(rootViewController: authVC), | |
| 74 | + CNLiveBaseNavigationController(rootViewController: mineVC) | |
| 75 | + ] | |
| 76 | + | |
| 78 | 77 | } |
| 79 | 78 | |
| 80 | 79 | // MARK: - Tabar 背景图 | ... | ... |
metaCode/Classes/Common/Util/CNLiveIntegralAlertTool.swift
| ... | ... | @@ -209,7 +209,8 @@ class CNLiveIntegralAlertTool:NSObject{ |
| 209 | 209 | |
| 210 | 210 | self.bottomBgView.addSubview(self.balanceIntegralLabel) |
| 211 | 211 | |
| 212 | - self.balanceIntegralLabel.text = String(format: "余额%d积分", self.point) | |
| 212 | + let pointStr = self.integralChangeW(pointCount: self.point) | |
| 213 | + self.balanceIntegralLabel.text = String(format: "余额%@积分", pointStr) | |
| 213 | 214 | |
| 214 | 215 | self.bottomBgView.addSubview(self.payBtn) |
| 215 | 216 | self.payBtn.setTitle("确认支付", for: .normal) |
| ... | ... | @@ -241,7 +242,8 @@ class CNLiveIntegralAlertTool:NSObject{ |
| 241 | 242 | self.integralCountLabel.attributedText = priceAttri |
| 242 | 243 | |
| 243 | 244 | self.bottomBgView.addSubview(self.balanceIntegralLabel) |
| 244 | - self.balanceIntegralLabel.text = String(format: "余额%d积分 积分不足", self.point) | |
| 245 | + let pointStr = self.integralChangeW(pointCount: self.point) | |
| 246 | + self.balanceIntegralLabel.text = String(format: "余额%@积分 积分不足", pointStr) | |
| 245 | 247 | |
| 246 | 248 | self.bottomBgView.addSubview(self.payBtn) |
| 247 | 249 | self.payBtn.setTitle("去赚积分", for: .normal) |
| ... | ... | @@ -300,6 +302,17 @@ class CNLiveIntegralAlertTool:NSObject{ |
| 300 | 302 | } |
| 301 | 303 | } |
| 302 | 304 | |
| 305 | + //转换积分为xxx.W | |
| 306 | + func integralChangeW(pointCount:Int) -> String{ | |
| 307 | + var pointStr = "" | |
| 308 | + if (pointCount >= 10000) { | |
| 309 | + pointStr = String(format: "%.2fW", CGFloat(pointCount)/10000.0) | |
| 310 | + }else{ | |
| 311 | + pointStr = "\(pointCount)" | |
| 312 | + } | |
| 313 | + return pointStr | |
| 314 | + } | |
| 315 | + | |
| 303 | 316 | // MARK: - BtnAction |
| 304 | 317 | @objc func bgBtnViewAction(){ |
| 305 | 318 | self.hiddenIntegralAlert() | ... | ... |
metaCode/Classes/Config/CNLiveConfigstant.swift
metaCode/Classes/Main/HomePage/Controller/DownSlideController/CNSlideBaseNavigationController.swift
| ... | ... | @@ -10,6 +10,18 @@ import Foundation |
| 10 | 10 | class CNSlideBaseNavigationController: UINavigationController |
| 11 | 11 | ,UIViewControllerTransitioningDelegate { |
| 12 | 12 | var dismissClosure: (()->())? |
| 13 | + var cellType:CNLiveHomePageCellType = .course | |
| 14 | + | |
| 15 | + init(rootViewController: UIViewController,cellType:CNLiveHomePageCellType) { | |
| 16 | + super.init(rootViewController: rootViewController) | |
| 17 | + self.cellType = cellType | |
| 18 | + | |
| 19 | + } | |
| 20 | + | |
| 21 | + required init?(coder aDecoder: NSCoder) { | |
| 22 | + fatalError("init(coder:) has not been implemented") | |
| 23 | + } | |
| 24 | + | |
| 13 | 25 | override func viewDidLoad() { |
| 14 | 26 | super.viewDidLoad() |
| 15 | 27 | modalPresentationStyle = .custom |
| ... | ... | @@ -17,11 +29,11 @@ class CNSlideBaseNavigationController: UINavigationController |
| 17 | 29 | } |
| 18 | 30 | |
| 19 | 31 | func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { |
| 20 | - return CNUpSlideAnimationTransition(animationType: .present) | |
| 32 | + return CNUpSlideAnimationTransition(animationType: .present, cellType: self.cellType) | |
| 21 | 33 | } |
| 22 | 34 | |
| 23 | 35 | func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { |
| 24 | - return CNUpSlideAnimationTransition(animationType: .dismiss) | |
| 36 | + return CNUpSlideAnimationTransition(animationType: .dismiss, cellType: self.cellType) | |
| 25 | 37 | } |
| 26 | 38 | |
| 27 | 39 | func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? { | ... | ... |
metaCode/Classes/Main/HomePage/Controller/DownSlideController/CNUpSlideDetailViewController.swift
| ... | ... | @@ -3,11 +3,24 @@ |
| 3 | 3 | // metaCode |
| 4 | 4 | // |
| 5 | 5 | // Created by zx on 2023/10/16. |
| 6 | -// 下滑页原生页--大图点击详情页 | |
| 6 | +// 认证-下滑页原生页--课程 大图课程详情页/全部课程详情页 | |
| 7 | +// 首页原生页--短剧 大图详情页 | |
| 7 | 8 | |
| 8 | 9 | import Foundation |
| 10 | +import MJRefresh | |
| 11 | +import EmptyDataSet_Swift | |
| 9 | 12 | |
| 10 | -class CNUpSlideDetailViewController: CNLiveBaseViewController { | |
| 13 | +///首页课程或短剧类型 | |
| 14 | +enum CNLiveHomePageCellType { | |
| 15 | + ///课程控制器->课程 | |
| 16 | + case course | |
| 17 | + ///短剧控制器->短剧 | |
| 18 | + case playlet | |
| 19 | + ///短剧控制器->课程 | |
| 20 | + case playletToCourse | |
| 21 | +} | |
| 22 | + | |
| 23 | +class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSource, UITableViewDelegate,EmptyDataSetSource, EmptyDataSetDelegate { | |
| 11 | 24 | |
| 12 | 25 | //slideModel |
| 13 | 26 | var _slideModel : CNLiveDownSlideModel? |
| ... | ... | @@ -20,6 +33,8 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController { |
| 20 | 33 | } |
| 21 | 34 | } |
| 22 | 35 | |
| 36 | + var cellType: CNLiveHomePageCellType = .course | |
| 37 | + | |
| 23 | 38 | var dismissClosure: (()->())? |
| 24 | 39 | //the point when start to interactive |
| 25 | 40 | var interactiveStartingPoint: CGPoint? = nil |
| ... | ... | @@ -54,7 +69,9 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController { |
| 54 | 69 | return btn |
| 55 | 70 | }() |
| 56 | 71 | |
| 57 | - init(cell: CNDownSlideSingleCourseCell,slideModel:CNLiveDownSlideModel) { | |
| 72 | + init(cell: CNDownSlideSingleCourseCell,slideModel:CNLiveDownSlideModel,cellType:CNLiveHomePageCellType) { | |
| 73 | + self.cellType = cellType | |
| 74 | + self.pageNum = 1 | |
| 58 | 75 | self.cell = cell |
| 59 | 76 | super.init(nibName: nil, bundle: nil) |
| 60 | 77 | self.slideModel = slideModel |
| ... | ... | @@ -74,27 +91,38 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController { |
| 74 | 91 | override func viewDidLoad() { |
| 75 | 92 | super.viewDidLoad() |
| 76 | 93 | setupUI() |
| 77 | - getImageFromCell() | |
| 94 | +// getImageFromCell() | |
| 95 | +// if self.cellType == .playlet{ | |
| 96 | + self.getBlockContents(page: 1) | |
| 97 | +// } | |
| 78 | 98 | } |
| 79 | 99 | |
| 80 | 100 | private func setupUI() { |
| 81 | 101 | self.view.layer.masksToBounds = true |
| 82 | - view.addSubview(scrollView) | |
| 83 | - scrollView.slideModel = _slideModel | |
| 84 | - view.addSubview(closeBtn) | |
| 85 | - view.addGestureRecognizer(dismissPanGesture) | |
| 102 | + self.view.addSubview(self.tableView) | |
| 103 | + self.tableView.frame = CGRect(x: 0, y: 0, width: KSreenWidth, height: KSreenHeight) | |
| 86 | 104 | |
| 87 | - if #available(iOS 11.0, *) { | |
| 88 | - scrollView.contentInsetAdjustmentBehavior = .never | |
| 89 | - } else { | |
| 90 | - automaticallyAdjustsScrollViewInsets = false | |
| 105 | + if self.cellType == .playlet{//短剧 大图 | |
| 106 | +// self.view.addSubview(self.tableView) | |
| 107 | +// self.tableView.frame = CGRect(x: 0, y: 0, width: KSreenWidth, height: KSreenHeight) | |
| 108 | + }else if self.cellType == .course{//课程 大图 | |
| 109 | + if self.slideModel!.type == SlideModelTypeAllCourse12{ | |
| 110 | + //全部课程 | |
| 111 | + | |
| 112 | + }else if self.slideModel!.type == SlideModelTypeOneCourse75{ | |
| 113 | + //大图课程 | |
| 114 | + | |
| 115 | + } | |
| 116 | +// view.addSubview(scrollView) | |
| 117 | +// scrollView.slideModel = _slideModel | |
| 118 | + }else if self.cellType == .playletToCourse{ | |
| 119 | + //首页->课程 | |
| 120 | + | |
| 91 | 121 | } |
| 122 | + view.addSubview(closeBtn) | |
| 123 | + view.addGestureRecognizer(dismissPanGesture) | |
| 92 | 124 | } |
| 93 | - | |
| 94 | - private func getImageFromCell() { | |
| 95 | - scrollView.imageView.image = cell.bgImageView.image | |
| 96 | - } | |
| 97 | - | |
| 125 | + | |
| 98 | 126 | @objc private func closeAction() { |
| 99 | 127 | dismiss(animated: true, completion: nil) |
| 100 | 128 | let nav = self.navigationController as! CNSlideBaseNavigationController |
| ... | ... | @@ -128,7 +156,6 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController { |
| 128 | 156 | dismiss(animated: true, completion: nil) |
| 129 | 157 | let nav = self.navigationController as! CNSlideBaseNavigationController |
| 130 | 158 | nav.dismissClosure?() |
| 131 | -// dismissClosure?() | |
| 132 | 159 | stopDismissPanGesture(gesture) |
| 133 | 160 | return |
| 134 | 161 | } |
| ... | ... | @@ -138,12 +165,9 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController { |
| 138 | 165 | |
| 139 | 166 | switch gesture.state { |
| 140 | 167 | case .began,.changed: |
| 141 | - scrollView.isScrollEnabled = false | |
| 142 | 168 | gesture.view?.transform = CGAffineTransform(scaleX: currentScale, y: currentScale) |
| 143 | 169 | gesture.view?.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius * (progress) |
| 144 | - scrollView.showsVerticalScrollIndicator = false | |
| 145 | 170 | case .cancelled,.ended: |
| 146 | - scrollView.isScrollEnabled = true | |
| 147 | 171 | stopDismissPanGesture(gesture) |
| 148 | 172 | default: |
| 149 | 173 | break |
| ... | ... | @@ -154,23 +178,187 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController { |
| 154 | 178 | private func stopDismissPanGesture(_ gesture: UIPanGestureRecognizer) { |
| 155 | 179 | draggingDownToDismiss = false |
| 156 | 180 | interactiveStartingPoint = nil |
| 157 | - scrollView.showsVerticalScrollIndicator = true | |
| 158 | 181 | |
| 159 | 182 | UIView.animate(withDuration: 0.2) { |
| 160 | 183 | gesture.view?.transform = CGAffineTransform.identity |
| 161 | 184 | } |
| 162 | 185 | } |
| 186 | + | |
| 187 | + // MARK: - 列表详情页 | |
| 188 | + let kCNLiveCourseTitleCellIdentifier = "kCNLiveCourseTitleCellIdentifier" | |
| 189 | + let kCNLiveAlbumImageCellIdentifier = "kCNLiveAlbumImageCellIdentifier" | |
| 190 | + let kCNLiveAlbumCellIdentifier = "kCNLiveAlbumCellIdentifier" | |
| 191 | + | |
| 192 | + var pageNum: NSInteger = 1 | |
| 193 | + var network_type: CNLiveMineResponseType! | |
| 194 | + // MARK: - 懒加载 | |
| 195 | + ///数据源 | |
| 196 | + lazy var dataArray: NSMutableArray = { | |
| 197 | + var dataArray = NSMutableArray() | |
| 198 | + return dataArray | |
| 199 | + }() | |
| 200 | + lazy var tableView : UITableView = { | |
| 201 | + let tableView = UITableView(frame: .zero, style: .plain) | |
| 202 | + tableView.dataSource = self | |
| 203 | + tableView.delegate = self | |
| 204 | + tableView.emptyDataSetSource = self | |
| 205 | + tableView.emptyDataSetDelegate = self | |
| 206 | + tableView.separatorStyle = .none | |
| 207 | + tableView.tableFooterView = UIView.init() | |
| 208 | + tableView.register(CNLiveAlbumCell.self, forCellReuseIdentifier: kCNLiveAlbumCellIdentifier) | |
| 209 | + tableView.register(CNLiveAlbumImageCell.self, forCellReuseIdentifier: kCNLiveAlbumImageCellIdentifier) | |
| 210 | + tableView.register(CNLiveDuanjuTitleCell.self, forCellReuseIdentifier: kCNLiveCourseTitleCellIdentifier) | |
| 211 | + | |
| 212 | + return tableView | |
| 213 | + }() | |
| 214 | + | |
| 215 | + | |
| 216 | + func numberOfSections(in tableView: UITableView) -> Int { | |
| 217 | + 2 | |
| 218 | + } | |
| 219 | + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | |
| 220 | + if section == 0{ | |
| 221 | + return 1 | |
| 222 | + }else{ | |
| 223 | + return self.dataArray.count | |
| 224 | + } | |
| 225 | + } | |
| 226 | + | |
| 227 | + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
| 228 | + | |
| 229 | + if indexPath.section == 0{ | |
| 230 | + if self.cellType == .playlet{ | |
| 231 | + //短剧大图 | |
| 232 | + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveAlbumImageCellIdentifier) as? CNLiveAlbumImageCell | |
| 233 | + else { | |
| 234 | + let cell = CNLiveAlbumImageCell() | |
| 235 | + return cell | |
| 236 | + } | |
| 237 | + cell.iconImgView.image = self.cell.bgImageView.image | |
| 238 | + return cell | |
| 239 | + }else if self.cellType == .course || self.cellType == .playletToCourse{ | |
| 240 | + | |
| 241 | + if self.slideModel?.type == SlideModelTypeAllCourse12{ | |
| 242 | + //全部课程 | |
| 243 | + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveCourseTitleCellIdentifier) as? CNLiveDuanjuTitleCell | |
| 244 | + else { | |
| 245 | + let cell = CNLiveDuanjuTitleCell() | |
| 246 | + return cell | |
| 247 | + } | |
| 248 | + cell.cellType = .course | |
| 249 | + cell.blockName = self.slideModel?.blockName | |
| 250 | + return cell | |
| 251 | + | |
| 252 | + }else if self.slideModel?.type == SlideModelTypeOneCourse75{ | |
| 253 | + //大图课程 | |
| 254 | + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveAlbumImageCellIdentifier) as? CNLiveAlbumImageCell | |
| 255 | + else { | |
| 256 | + let cell = CNLiveAlbumImageCell() | |
| 257 | + return cell | |
| 258 | + } | |
| 259 | + cell.iconImgView.image = self.cell.bgImageView.image | |
| 260 | + return cell | |
| 261 | + | |
| 262 | + } | |
| 263 | + } | |
| 264 | + | |
| 265 | + }else{ | |
| 266 | + //列表cell | |
| 267 | + let albumModel = self.dataArray[indexPath.row] as! CNLiveAlbumModel | |
| 268 | + | |
| 269 | + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveAlbumCellIdentifier) as? CNLiveAlbumCell | |
| 270 | + else { | |
| 271 | + let cell = CNLiveAlbumCell() | |
| 272 | + return cell | |
| 273 | + } | |
| 274 | + cell.albumModel = albumModel | |
| 275 | + cell.enterBlock = { albumModel in | |
| 276 | + CNLiveDownSlideTool.pushWebVCWithCNLiveAlbumMdl(albumModel: albumModel,controller: self) | |
| 277 | + } | |
| 278 | + return cell | |
| 279 | + } | |
| 280 | + return UITableViewCell() | |
| 281 | + } | |
| 282 | + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { | |
| 283 | + if indexPath.section == 0{ | |
| 284 | + if self.cellType == .playlet{ | |
| 285 | + //短剧大图 | |
| 286 | + return KSreenWidth | |
| 287 | + }else if self.cellType == .course || self.cellType == .playletToCourse{ | |
| 288 | + if self.slideModel?.type == SlideModelTypeAllCourse12{ | |
| 289 | + //全部课程 | |
| 290 | + return 75 | |
| 291 | + }else if self.slideModel?.type == SlideModelTypeOneCourse75{ | |
| 292 | + //大图课程 | |
| 293 | + return KSreenWidth | |
| 294 | + } | |
| 295 | + } | |
| 296 | + }else{ | |
| 297 | + return 75 | |
| 298 | + } | |
| 299 | + return 75 | |
| 300 | + } | |
| 301 | + | |
| 302 | + // MARK: - 在追短剧--获取全部专辑列表 | |
| 303 | + func getBlockContents(page:NSInteger){ | |
| 304 | + showLoading(message: "") | |
| 305 | + CNLiveHomePageViewModel.getBlockContents(blockId: self.slideModel!.blockId ?? "", page: page) {[weak self] result, status in | |
| 306 | + hiddenLoading() | |
| 307 | + if status == .success{ | |
| 308 | + let albumBaseModel = result as! CNLiveAlbumBaseModel | |
| 309 | + if self!.pageNum > 1 && albumBaseModel.list.count > 0 { | |
| 310 | + self!.dataArray.addObjects(from: albumBaseModel.list) | |
| 311 | + } | |
| 312 | + if self!.pageNum == 1 { | |
| 313 | + self!.dataArray.removeAllObjects() | |
| 314 | + self!.dataArray.addObjects(from: albumBaseModel.list) | |
| 315 | + if self!.dataArray.count > 0 && self!.tableView.mj_header == nil && self!.tableView.mj_footer == nil { | |
| 316 | + self!.addRefreshView() | |
| 317 | +// self!.pageNum = self!.pageNum + 1 | |
| 318 | +// self!.getBlockContents(page: self!.pageNum) | |
| 319 | + } | |
| 320 | + } | |
| 321 | + | |
| 322 | + self!.tableView.mj_header?.endRefreshing() | |
| 323 | + | |
| 324 | + self!.tableView.reloadData() | |
| 325 | + if albumBaseModel.hasNextPage{ | |
| 326 | + self!.tableView.mj_footer?.endRefreshing() | |
| 327 | + }else{ | |
| 328 | + self!.tableView.mj_footer?.endRefreshingWithNoMoreData() | |
| 329 | + } | |
| 330 | + | |
| 331 | + }else if (status == .noNetwork) { | |
| 332 | + self!.network_type = .noNetwork | |
| 333 | + self!.tableView.reloadEmptyDataSet() | |
| 334 | + } else { | |
| 335 | + self!.network_type = .failed | |
| 336 | + self!.tableView.reloadEmptyDataSet() | |
| 337 | + } | |
| 338 | + } | |
| 339 | + } | |
| 340 | + func addRefreshView() { | |
| 341 | + tableView.mj_header = MJRefreshNormalHeader.init(refreshingBlock: {[weak self] in | |
| 342 | + self!.pageNum = 1 | |
| 343 | + self!.getBlockContents(page: 1) | |
| 344 | + }) | |
| 345 | + | |
| 346 | + tableView.mj_footer = MJRefreshAutoNormalFooter.init(refreshingBlock: {[weak self] in | |
| 347 | + self!.pageNum = self!.pageNum + 1 | |
| 348 | + self!.getBlockContents(page: self!.pageNum) | |
| 349 | + }) | |
| 350 | + } | |
| 163 | 351 | |
| 164 | 352 | } |
| 165 | 353 | |
| 166 | 354 | extension CNUpSlideDetailViewController: UIViewControllerTransitioningDelegate { |
| 167 | 355 | |
| 168 | 356 | func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { |
| 169 | - return CNUpSlideAnimationTransition(animationType: .present) | |
| 357 | + return CNUpSlideAnimationTransition(animationType: .present, cellType: self.cellType) | |
| 170 | 358 | } |
| 171 | 359 | |
| 172 | 360 | func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { |
| 173 | - return CNUpSlideAnimationTransition(animationType: .dismiss) | |
| 361 | + return CNUpSlideAnimationTransition(animationType: .dismiss, cellType: self.cellType) | |
| 174 | 362 | } |
| 175 | 363 | |
| 176 | 364 | func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? { |
| ... | ... | @@ -193,3 +381,48 @@ extension CNUpSlideDetailViewController: UIGestureRecognizerDelegate { |
| 193 | 381 | return true |
| 194 | 382 | } |
| 195 | 383 | } |
| 384 | + | |
| 385 | +extension CNUpSlideDetailViewController { | |
| 386 | + | |
| 387 | + func image(forEmptyDataSet scrollView: UIScrollView) -> UIImage? { | |
| 388 | + if network_type == .failed || network_type == .unkonw { | |
| 389 | + return UIImage(named: "mine_list_source_unusual_failed") | |
| 390 | + } | |
| 391 | + if dataArray.count == 0 { | |
| 392 | + return UIImage(named: "mine_list_source_unusual_empty") | |
| 393 | + } | |
| 394 | + if network_type == .noNetwork { | |
| 395 | + return UIImage(named: "mine_list_source_unusual_noNet") | |
| 396 | + } | |
| 397 | + return UIImage(named: "mine_list_source_unusual_empty") | |
| 398 | + } | |
| 399 | + | |
| 400 | + func title(forEmptyDataSet scrollView: UIScrollView) -> NSAttributedString? { | |
| 401 | + var defult_string = "" | |
| 402 | + if network_type == .failed || network_type == .unkonw { | |
| 403 | + defult_string = "接口请求错误,刷新试试~" | |
| 404 | + } | |
| 405 | + if network_type == .noNetwork { | |
| 406 | + defult_string = "网络开小差了,刷新试试~" | |
| 407 | + } | |
| 408 | + if dataArray.count == 0 { | |
| 409 | + defult_string = "暂时没有数据~" | |
| 410 | + } | |
| 411 | + return NSAttributedString(string: defult_string, attributes: [.font: Font_17,.foregroundColor: HexColor("#666666")!]) | |
| 412 | + } | |
| 413 | + | |
| 414 | + func buttonTitle(forEmptyDataSet scrollView: UIScrollView, for state: UIControl.State) -> NSAttributedString? { | |
| 415 | + if network_type == .failed || network_type == .noNetwork { | |
| 416 | + let attributes = [NSAttributedString.Key.font:Font_16_Fit, | |
| 417 | + NSAttributedString.Key.foregroundColor: HexColor("#609BFF")] | |
| 418 | + return NSAttributedString(string: "刷一刷", attributes: attributes as [NSAttributedString.Key : Any]) | |
| 419 | + } | |
| 420 | + return nil | |
| 421 | + } | |
| 422 | + | |
| 423 | + func emptyDataSet(_ scrollView: UIScrollView, didTapView view: UIView) { | |
| 424 | + if network_type == .failed || network_type == .noNetwork { | |
| 425 | + getBlockContents(page: 1) | |
| 426 | + } | |
| 427 | + } | |
| 428 | +} | ... | ... |
metaCode/Classes/Main/HomePage/Controller/DownSlideController/CNUpSlideViewController.swift
| ... | ... | @@ -160,6 +160,19 @@ class CNUpSlideViewController: CNLiveBaseViewController,UITableViewDelegate,UITa |
| 160 | 160 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
| 161 | 161 | |
| 162 | 162 | let slideModel = self.dataArray[indexPath.row] as! CNLiveDownSlideModel |
| 163 | + var cellType:CNLiveHomePageCellType = .course | |
| 164 | + ///model | |
| 165 | + ///(1) 1,2时跳转:sharelUrl后面拼接 ?contentId=contentId&videoId=pid | |
| 166 | + ///(2) 3,4时跳转:thirdUrl | |
| 167 | + ///(3)“album”,“album_video”,“album_ugc” -> http://wjjh5.cnlive.com/cnYmAlbumVideoList.html?aid=contentId&title=titlle | |
| 168 | + if slideModel.contents.first?.model ?? "0" == "1" || slideModel.contents.first?.model ?? "0" == "2" || slideModel.contents.first?.model ?? "0" == "3" || slideModel.contents.first?.model ?? "0" == "4"{ | |
| 169 | + cellType = .course | |
| 170 | + }else if slideModel.contents.first?.model ?? "0" == "album_ugc"{ | |
| 171 | + cellType = .playlet | |
| 172 | + }else{ | |
| 173 | + //新类型 | |
| 174 | + } | |
| 175 | + | |
| 163 | 176 | //type=4一排两个 推荐课程&推荐活动; 74今日推荐; 12列表全部课程; 75单课程大图 |
| 164 | 177 | if slideModel.type == SlideModelTypeRecommend4{ |
| 165 | 178 | |
| ... | ... | @@ -168,19 +181,18 @@ class CNUpSlideViewController: CNLiveBaseViewController,UITableViewDelegate,UITa |
| 168 | 181 | }else if slideModel.type == SlideModelTypeAllCourse12{ |
| 169 | 182 | guard let cell = tableView.cellForRow(at: indexPath) as? CNDownSlideSingleCourseCell else { return } |
| 170 | 183 | selectedCell = cell |
| 171 | - let detailVC = CNSlideBaseNavigationController(rootViewController: CNUpSlideDetailViewController(cell: cell,slideModel: slideModel)) | |
| 184 | + let detailVC = CNSlideBaseNavigationController(rootViewController: CNUpSlideDetailViewController(cell: cell,slideModel: slideModel, cellType: cellType), cellType: cellType) | |
| 172 | 185 | detailVC.dismissClosure = { [weak self] in |
| 173 | 186 | guard let StrongSelf = self else { return } |
| 174 | 187 | StrongSelf.updateStatusBarAndTabbarFrame(visible: true) |
| 175 | 188 | } |
| 176 | 189 | updateStatusBarAndTabbarFrame(visible: false) |
| 177 | - | |
| 178 | 190 | present(detailVC, animated: true, completion: nil) |
| 179 | 191 | }else if slideModel.type == SlideModelTypeOneCourse75{ |
| 180 | 192 | guard let cell = tableView.cellForRow(at: indexPath) as? CNDownSlideSingleCourseCell else { return } |
| 181 | 193 | selectedCell = cell |
| 182 | 194 | |
| 183 | - let detailVC = CNSlideBaseNavigationController(rootViewController: CNUpSlideDetailViewController(cell: cell,slideModel: slideModel)) | |
| 195 | + let detailVC = CNSlideBaseNavigationController(rootViewController: CNUpSlideDetailViewController(cell: cell,slideModel: slideModel, cellType: cellType), cellType: cellType) | |
| 184 | 196 | |
| 185 | 197 | detailVC.dismissClosure = { [weak self] in |
| 186 | 198 | guard let StrongSelf = self else { return } | ... | ... |
metaCode/Classes/Main/HomePage/Controller/ShopUpConsole/CNLiveShopConsoleController.swift
| ... | ... | @@ -102,6 +102,7 @@ class CNLiveShopConsoleController: CNLiveBaseViewController, UICollectionViewDel |
| 102 | 102 | }else if itemModel.type == CNLiveShopConsoleType.GLYHQ.rawValue{ |
| 103 | 103 | //优惠券管理 |
| 104 | 104 | let vc = CNLiveShopCouponsManagerViewController() |
| 105 | + | |
| 105 | 106 | navigationViewController().pushViewController(vc, animated: pushAnimated) |
| 106 | 107 | // currentViewController()?.navigationController?.pushViewController(vc, animated: pushAnimated) |
| 107 | 108 | }else if itemModel.type == CNLiveShopConsoleType.CreateShopClassify.rawValue{ | ... | ... |
metaCode/Classes/Main/HomePage/View/VerticalViews/CNCustomIndexView.swift
| ... | ... | @@ -97,7 +97,7 @@ class CNCustomIndexView:PGIndexBannerSubiew, UIScrollViewDelegate, WJColorChange |
| 97 | 97 | |
| 98 | 98 | willSet |
| 99 | 99 | { |
| 100 | - print("Will set an new value \(String(describing: newValue)) to age") | |
| 100 | +// print("Will set an new value \(String(describing: newValue)) to age") | |
| 101 | 101 | } |
| 102 | 102 | //我们需要在age属性发生变化后,更新一下nickName这个属性 |
| 103 | 103 | didSet |
| ... | ... | @@ -277,7 +277,7 @@ class CNCustomIndexView:PGIndexBannerSubiew, UIScrollViewDelegate, WJColorChange |
| 277 | 277 | // MARK: - 设置颜色值跟随ScrollView滑动变化 |
| 278 | 278 | func addColorManager() |
| 279 | 279 | { |
| 280 | - print(self.colorDataArr) | |
| 280 | +// print(self.colorDataArr) | |
| 281 | 281 | let colorChange:WJColorChange = WJColorChange.init(type:SingleColor) |
| 282 | 282 | colorChange.delegate = self |
| 283 | 283 | colorChange.offset = 100 | ... | ... |
metaCode/Classes/Main/HomePage/View/VerticalViews/DownSlide/CNDownSlideSingleCourseCell.swift
| ... | ... | @@ -79,18 +79,33 @@ class CNDownSlideSingleCourseCell: UITableViewCell { |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | func setupNewUI(model:CNLiveDownSlideModel){ |
| 82 | + contentView.subviews.forEach { view in | |
| 83 | + view.removeFromSuperview() | |
| 84 | + } | |
| 85 | + bgBackView.subviews.forEach { view in | |
| 86 | + view.removeFromSuperview() | |
| 87 | + } | |
| 88 | + bgImageView.subviews.forEach { view in | |
| 89 | + view.removeFromSuperview() | |
| 90 | + } | |
| 91 | + | |
| 82 | 92 | if model.type == SlideModelTypeAllCourse12 { |
| 83 | 93 | //全部课程列表 |
| 84 | 94 | contentView.addSubview(bgBackView) |
| 85 | 95 | |
| 86 | 96 | bgBackView.frame = CGRect(x: DownSlideRecommendLeftGap, y: 0,width:DownSlideSingleCourseW , height:model.cellH-DownSlideRecommendLeftGap) |
| 87 | - bgBackView.layer.shadowColor = HexColor("#000000")?.cgColor | |
| 88 | - bgBackView.layer.shadowRadius = 12 | |
| 97 | + // 设置阴影效果 | |
| 98 | + bgBackView.layer.masksToBounds = false | |
| 99 | + //定义view的阴影颜色 | |
| 100 | + bgBackView.layer.shadowColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.1).cgColor | |
| 101 | + //定义view的阴影透明度,注意:如果view没有设置背景色阴影也是不会显示的 | |
| 89 | 102 | bgBackView.layer.shadowOpacity = 1 |
| 103 | + //定义view的阴影宽度,模糊计算的半径 | |
| 104 | + bgBackView.layer.shadowRadius = 10.0 | |
| 105 | + //阴影偏移量 | |
| 90 | 106 | bgBackView.layer.shadowOffset = CGSize(width: 0, height: 0) |
| 91 | 107 | bgBackView.layer.cornerRadius = 12 |
| 92 | - bgBackView.clipsToBounds = true | |
| 93 | - bgBackView.backgroundColor = HexColor("#FFFFFF") | |
| 108 | + bgBackView.backgroundColor = .white | |
| 94 | 109 | |
| 95 | 110 | let titleLbl = UILabel(frame: CGRect(x: DownSlideRecommendLeftGap, y: DownSlideRecommendLeftGap, width: DownSlideSingleCourseW-DownSlideRecommendLeftGap*2, height: 30)) |
| 96 | 111 | titleLbl.text = model.blockName ?? "全部课程" |
| ... | ... | @@ -144,9 +159,19 @@ class CNDownSlideSingleCourseCell: UITableViewCell { |
| 144 | 159 | bgBackView.addSubview(bgImageView) |
| 145 | 160 | |
| 146 | 161 | bgBackView.frame = CGRect(x: DownSlideRecommendLeftGap, y: 0,width:DownSlideSingleCourseW , height:DownSlideSingleCourseMoreH+DownSlideSingleCourseImgH) |
| 147 | - bgBackView.layer.shadowColor = UIColor.black.cgColor | |
| 148 | - bgBackView.layer.shadowOpacity = 0.4 | |
| 149 | - bgBackView.layer.shadowOffset = CGSize(width: 0, height: 1) | |
| 162 | + | |
| 163 | + // 设置阴影效果 | |
| 164 | + bgBackView.layer.masksToBounds = false | |
| 165 | + //定义view的阴影颜色 | |
| 166 | + bgBackView.layer.shadowColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.1).cgColor | |
| 167 | + //定义view的阴影透明度,注意:如果view没有设置背景色阴影也是不会显示的 | |
| 168 | + bgBackView.layer.shadowOpacity = 1 | |
| 169 | + //定义view的阴影宽度,模糊计算的半径 | |
| 170 | + bgBackView.layer.shadowRadius = 10.0 | |
| 171 | + //阴影偏移量 | |
| 172 | + bgBackView.layer.shadowOffset = CGSize(width: 0, height: 0) | |
| 173 | + bgBackView.layer.cornerRadius = 12 | |
| 174 | + bgBackView.backgroundColor = .white | |
| 150 | 175 | |
| 151 | 176 | bgImageView.frame = CGRect(x: 0, y: 0,width:DownSlideSingleCourseW , height:DownSlideSingleCourseImgH) |
| 152 | 177 | bgImageView.contentMode = .scaleAspectFill | ... | ... |
metaCode/Classes/Main/HomePage/View/VerticalViews/DownSlide/CNDownSlideView.swift
| ... | ... | @@ -22,7 +22,7 @@ class CNDownSlideView:UIView{ |
| 22 | 22 | |
| 23 | 23 | let contentView = UIView.init(frame: CGRect(x: 0, y: 0, width: self.width, height: self.height)) |
| 24 | 24 | contentView.backgroundColor = UIColor.clear |
| 25 | - | |
| 25 | + contentView.isUserInteractionEnabled = true | |
| 26 | 26 | // let path:UIBezierPath = UIBezierPath.init(roundedRect: contentView.bounds, byRoundingCorners: [.bottomLeft, .bottomRight], cornerRadii: CGSize.init(width: 20, height: 20)) |
| 27 | 27 | // |
| 28 | 28 | // let maskLayer:CAShapeLayer = CAShapeLayer() |
| ... | ... | @@ -48,14 +48,14 @@ class CNDownSlideView:UIView{ |
| 48 | 48 | return webView |
| 49 | 49 | }() |
| 50 | 50 | |
| 51 | - var upSlideVC:CNUpSlideViewController = { | |
| 51 | + lazy var upSlideVC:CNUpSlideViewController = { | |
| 52 | 52 | let upSlideVC = CNUpSlideViewController.init() |
| 53 | 53 | upSlideVC.view.width = KSreenWidth |
| 54 | 54 | upSlideVC.view.height = KSreenHeight-DownSlideBottomViewHeight |
| 55 | 55 | return upSlideVC |
| 56 | 56 | }() |
| 57 | 57 | |
| 58 | - var shopConsoleVC:CNLiveShopConsoleController = { | |
| 58 | + lazy var shopConsoleVC:CNLiveShopConsoleController = { | |
| 59 | 59 | let shopConsoleVC = CNLiveShopConsoleController.init() |
| 60 | 60 | shopConsoleVC.view.width = KSreenWidth |
| 61 | 61 | shopConsoleVC.view.height = KSreenHeight-DownSlideBottomViewHeight |
| ... | ... | @@ -107,15 +107,30 @@ class CNDownSlideView:UIView{ |
| 107 | 107 | bottomView.backgroundColor = HexColor("#FFFFFF") |
| 108 | 108 | bottomView.isHidden = true |
| 109 | 109 | |
| 110 | - let path:UIBezierPath = UIBezierPath.init(roundedRect: bottomView.bounds, byRoundingCorners: [.topLeft, .topRight], cornerRadii: CGSize.init(width: 50, height: 50)) | |
| 111 | - let maskLayer:CAShapeLayer = CAShapeLayer() | |
| 112 | - maskLayer.frame = bottomView.bounds | |
| 113 | - maskLayer.path = path.cgPath | |
| 114 | - bottomView.layer.mask = maskLayer | |
| 115 | - bottomView.clipsToBounds = true | |
| 110 | +// let path:UIBezierPath = UIBezierPath.init(roundedRect: bottomView.bounds, byRoundingCorners: [.topLeft, .topRight], cornerRadii: CGSize.init(width: 50, height: 50)) | |
| 111 | +// let maskLayer:CAShapeLayer = CAShapeLayer() | |
| 112 | +// maskLayer.frame = bottomView.bounds | |
| 113 | +// maskLayer.path = path.cgPath | |
| 114 | +// bottomView.layer.mask = maskLayer | |
| 115 | +// bottomView.clipsToBounds = true | |
| 116 | + | |
| 116 | 117 | // bottomView.layer.cornerRadius = 50 |
| 117 | 118 | // bottomView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] |
| 118 | 119 | |
| 120 | + | |
| 121 | + // 设置阴影效果 | |
| 122 | + bottomView.layer.masksToBounds = false | |
| 123 | + //定义view的阴影颜色 | |
| 124 | + bottomView.layer.shadowColor = UIColor(red: 0.55, green: 0.68, blue: 0.86, alpha: 0.1).cgColor | |
| 125 | + //定义view的阴影透明度,注意:如果view没有设置背景色阴影也是不会显示的 | |
| 126 | + bottomView.layer.shadowOpacity = 1 | |
| 127 | + //定义view的阴影宽度,模糊计算的半径 | |
| 128 | + bottomView.layer.shadowRadius = 15.0 | |
| 129 | + //阴影偏移量 | |
| 130 | + bottomView.layer.shadowOffset = CGSize(width: 0, height: -3) | |
| 131 | + bottomView.layer.cornerRadius = 50 | |
| 132 | + bottomView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] | |
| 133 | + | |
| 119 | 134 | let backBtn: UIButton = UIButton(type: .custom) |
| 120 | 135 | backBtn.frame = CGRectMake(0, 0, 100, DownSlideBottomViewHeight) |
| 121 | 136 | backBtn.centerX = bottomView.width/2 | ... | ... |
metaCode/Classes/Main/HomePages/Controller/AuthController/CNLiveAuthViewController.swift
| ... | ... | @@ -113,6 +113,7 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa |
| 113 | 113 | else { |
| 114 | 114 | return CNLiveHomePageDuanJuCell() |
| 115 | 115 | } |
| 116 | + | |
| 116 | 117 | cell.setModelArr(modelArr: self.duanjuDataArray) |
| 117 | 118 | cell.DuanJUCellSelectedCallBack = { |
| 118 | 119 | duanJuCell in |
| ... | ... | @@ -135,8 +136,6 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa |
| 135 | 136 | if slideModel.type == SlideModelTypeRecommend4{ |
| 136 | 137 | guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideRecommendCellIdentifier) as? CNLiveDownSlideRecommendCell |
| 137 | 138 | else { |
| 138 | - // let cell = CNLiveDownSlideRecommendCell() | |
| 139 | - // cell.slideModel = slideModel | |
| 140 | 139 | return CNLiveDownSlideRecommendCell() |
| 141 | 140 | } |
| 142 | 141 | cell.slideModel = slideModel |
| ... | ... | @@ -145,7 +144,6 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa |
| 145 | 144 | guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideTodayRecommendCellIdentifier) as? CNLiveDownSlideTodayRecommendCell |
| 146 | 145 | else { |
| 147 | 146 | let cell = CNLiveDownSlideTodayRecommendCell() |
| 148 | - cell.slideModel = slideModel | |
| 149 | 147 | return cell |
| 150 | 148 | } |
| 151 | 149 | cell.slideModel = slideModel |
| ... | ... | @@ -154,7 +152,6 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa |
| 154 | 152 | guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideAllCourseCellIdentifier) as? CNDownSlideSingleCourseCell |
| 155 | 153 | else { |
| 156 | 154 | let cell = CNDownSlideSingleCourseCell() |
| 157 | - cell.slideModel = slideModel | |
| 158 | 155 | return cell |
| 159 | 156 | } |
| 160 | 157 | cell.slideModel = slideModel |
| ... | ... | @@ -163,7 +160,6 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa |
| 163 | 160 | guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideSingleCourseCellIdentifier) as? CNDownSlideSingleCourseCell |
| 164 | 161 | else { |
| 165 | 162 | let cell = CNDownSlideSingleCourseCell() |
| 166 | - cell.slideModel = slideModel | |
| 167 | 163 | return cell |
| 168 | 164 | } |
| 169 | 165 | cell.slideModel = slideModel |
| ... | ... | @@ -217,6 +213,19 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa |
| 217 | 213 | }else{ |
| 218 | 214 | |
| 219 | 215 | let slideModel = self.dataArray[indexPath.row] as! CNLiveDownSlideModel |
| 216 | + var cellType:CNLiveHomePageCellType = .course | |
| 217 | + ///model | |
| 218 | + ///(1) 1,2时跳转:sharelUrl后面拼接 ?contentId=contentId&videoId=pid | |
| 219 | + ///(2) 3,4时跳转:thirdUrl | |
| 220 | + ///(3)“album”,“album_video”,“album_ugc” -> http://wjjh5.cnlive.com/cnYmAlbumVideoList.html?aid=contentId&title=titlle | |
| 221 | + if slideModel.contents.first?.model ?? "0" == "1" || slideModel.contents.first?.model ?? "0" == "2" || slideModel.contents.first?.model ?? "0" == "3" || slideModel.contents.first?.model ?? "0" == "4"{ | |
| 222 | + cellType = .playletToCourse | |
| 223 | + }else if slideModel.contents.first?.model ?? "0" == "album_ugc"{ | |
| 224 | + cellType = .playlet | |
| 225 | + }else{ | |
| 226 | + //新类型 | |
| 227 | + } | |
| 228 | + | |
| 220 | 229 | //type=4一排两个 推荐课程&推荐活动; 74今日推荐; 12列表全部课程; 75单课程大图 |
| 221 | 230 | if slideModel.type == SlideModelTypeRecommend4{ |
| 222 | 231 | |
| ... | ... | @@ -225,7 +234,8 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa |
| 225 | 234 | }else if slideModel.type == SlideModelTypeAllCourse12{ |
| 226 | 235 | guard let cell = tableView.cellForRow(at: indexPath) as? CNDownSlideSingleCourseCell else { return } |
| 227 | 236 | selectedCell = cell |
| 228 | - let detailVC = CNHomePageBaseNavigationController(rootViewController: CNHomepageDetailViewController(cell: cell,slideModel: slideModel)) | |
| 237 | + | |
| 238 | + let detailVC = CNSlideBaseNavigationController(rootViewController: CNUpSlideDetailViewController(cell: cell,slideModel: slideModel, cellType: cellType), cellType: cellType) | |
| 229 | 239 | detailVC.dismissClosure = { [weak self] in |
| 230 | 240 | guard let StrongSelf = self else { return } |
| 231 | 241 | StrongSelf.updateStatusBarAndTabbarFrame(visible: true) |
| ... | ... | @@ -236,8 +246,7 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa |
| 236 | 246 | }else if slideModel.type == SlideModelTypeOneCourse75{ |
| 237 | 247 | guard let cell = tableView.cellForRow(at: indexPath) as? CNDownSlideSingleCourseCell else { return } |
| 238 | 248 | selectedCell = cell |
| 239 | - | |
| 240 | - let detailVC = CNHomePageBaseNavigationController(rootViewController:CNHomepageDetailViewController(cell: cell,slideModel: slideModel)) | |
| 249 | + let detailVC = CNSlideBaseNavigationController(rootViewController: CNUpSlideDetailViewController(cell: cell,slideModel: slideModel, cellType: cellType), cellType: cellType) | |
| 241 | 250 | |
| 242 | 251 | detailVC.dismissClosure = { [weak self] in |
| 243 | 252 | guard let StrongSelf = self else { return } |
| ... | ... | @@ -251,8 +260,15 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa |
| 251 | 260 | |
| 252 | 261 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { |
| 253 | 262 | if self.isHaveDuanJU && indexPath.section == 0{ |
| 254 | - //标题55+n个cell*(45+15*2)+首尾15 | |
| 255 | - return CGFloat(self.duanjuDataArray.count)*(45+15*2)+CGFloat(55)+15+15 | |
| 263 | + if self.duanjuDataArray.count > 4{ | |
| 264 | + //标题55+4个cell*(45+15*2)+首尾15+12圆角 | |
| 265 | + return CGFloat(4)*(45+15*2)+CGFloat(55)+15+15+12 | |
| 266 | + | |
| 267 | + }else{ | |
| 268 | + //标题55+n个cell*(45+15*2)+首尾15+12圆角 | |
| 269 | + return CGFloat(self.duanjuDataArray.count)*(45+15*2)+CGFloat(55)+15+15+12 | |
| 270 | + | |
| 271 | + } | |
| 256 | 272 | }else{ |
| 257 | 273 | let slideModel = self.dataArray[indexPath.row] as! CNLiveDownSlideModel |
| 258 | 274 | return CGFloat(slideModel.cellH) |
| ... | ... | @@ -295,6 +311,7 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa |
| 295 | 311 | if arr.count>0{ |
| 296 | 312 | //显示在追短剧cell |
| 297 | 313 | self.isHaveDuanJU = true |
| 314 | + | |
| 298 | 315 | self.duanjuDataArray = NSMutableArray(array: arr) |
| 299 | 316 | }else{ |
| 300 | 317 | //隐藏在追短剧cell |
| ... | ... | @@ -314,7 +331,6 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa |
| 314 | 331 | // showLoading(message: "") |
| 315 | 332 | CNLiveDownSlideViewModel.requestGetPage(pageId: pageID as NSString) { result, status in |
| 316 | 333 | hiddenLoading() |
| 317 | - | |
| 318 | 334 | if status == .success{ |
| 319 | 335 | self.dataArray.removeAllObjects() |
| 320 | 336 | let array = result as! [Any] | ... | ... |
metaCode/Classes/Main/HomePages/Controller/AuthController/push相关/CNHomePageAnimationTransition.swift
| ... | ... | @@ -39,28 +39,7 @@ extension CNHomePageAnimationTransition: UIViewControllerAnimatedTransitioning { |
| 39 | 39 | let fromNavi = fromVCtemp.viewControllers![0] as! CNLiveBaseNavigationController |
| 40 | 40 | let fromVC = fromNavi.viewControllers.first as! CNLiveAuthViewController |
| 41 | 41 | guard let toNaviVC = transitionContext.viewController(forKey: .to) as? CNHomePageBaseNavigationController else { return } |
| 42 | - if toNaviVC.topViewController is CNHomepageDetailViewController{ | |
| 43 | - guard let selectedCell = fromVC.selectedCell else { return } | |
| 44 | - let toVC = toNaviVC.topViewController as! CNHomepageDetailViewController | |
| 45 | - let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: fromVC.view) | |
| 46 | - //2.Set presentation original size. | |
| 47 | - toVC.view.frame = frame | |
| 48 | - toVC.scrollView.imageView.frame.size.width = GlobalConstants.todayCardSize.width | |
| 49 | - toVC.scrollView.imageView.frame.size.height = GlobalConstants.todayCardSize.height | |
| 50 | - | |
| 51 | - containerView.addSubview(toNaviVC.view) | |
| 52 | - | |
| 53 | - //3.Change original size to final size with animation. | |
| 54 | - UIView.animate(withDuration: transitonDuration, delay: 0, usingSpringWithDamping: 0.5, initialSpringVelocity: 0, options: [], animations: { | |
| 55 | - toVC.view.frame = UIScreen.main.bounds | |
| 56 | - toVC.scrollView.imageView.frame.size.width = KSreenWidth | |
| 57 | - toVC.scrollView.imageView.frame.size.height = KSreenWidth*DownSlideSingleCourseImgH/DownSlideSingleCourseW | |
| 58 | - toVC.closeBtn.alpha = 1 | |
| 59 | - | |
| 60 | - }) { (completed) in | |
| 61 | - transitionContext.completeTransition(completed) | |
| 62 | - } | |
| 63 | - }else if toNaviVC.topViewController is CNHomepageDuanJuDetailViewController{ | |
| 42 | + if toNaviVC.topViewController is CNHomepageDuanJuDetailViewController{ | |
| 64 | 43 | guard let selectedCell = fromVC.selectedDuanjuCell else { return } |
| 65 | 44 | let toVC = toNaviVC.topViewController as! CNHomepageDuanJuDetailViewController |
| 66 | 45 | let frame = selectedCell.convert(selectedCell.totalView.frame, to: fromVC.view) |
| ... | ... | @@ -87,22 +66,7 @@ extension CNHomePageAnimationTransition: UIViewControllerAnimatedTransitioning { |
| 87 | 66 | guard let toVCTabbar = transitionContext.viewController(forKey: .to) as? CNLiveBaseTabBarViewController else { return } |
| 88 | 67 | let toVCNav = toVCTabbar.viewControllers?.first as! CNLiveBaseNavigationController |
| 89 | 68 | let toVC = toVCNav.viewControllers.first as! CNLiveAuthViewController |
| 90 | - if fromNaviVC.topViewController is CNHomepageDetailViewController{ | |
| 91 | - guard let selectedCell = toVC.selectedCell else { return } | |
| 92 | - let fromVC = fromNaviVC.topViewController as! CNHomepageDetailViewController | |
| 93 | - | |
| 94 | - UIView.animate(withDuration: transitonDuration - 0.3, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { | |
| 95 | - let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: toVC.view) | |
| 96 | - fromVC.view.frame = frame | |
| 97 | - fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius | |
| 98 | - fromVC.scrollView.imageView.frame.size.width = GlobalConstants.todayCardSize.width | |
| 99 | - fromVC.scrollView.imageView.frame.size.height = GlobalConstants.todayCardSize.height | |
| 100 | - fromVC.closeBtn.alpha = 0 | |
| 101 | - | |
| 102 | - }) { (completed) in | |
| 103 | - transitionContext.completeTransition(completed) | |
| 104 | - } | |
| 105 | - }else if fromNaviVC.topViewController is CNHomepageDuanJuDetailViewController{ | |
| 69 | + if fromNaviVC.topViewController is CNHomepageDuanJuDetailViewController{ | |
| 106 | 70 | guard let selectedCell = toVC.selectedDuanjuCell else { return } |
| 107 | 71 | let fromVC = fromNaviVC.topViewController as! CNHomepageDuanJuDetailViewController |
| 108 | 72 | UIView.animate(withDuration: transitonDuration - 0.3, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { | ... | ... |
metaCode/Classes/Main/HomePages/Controller/AuthController/push相关/CNHomepageDetailViewController.swift
| 1 | +//// | |
| 2 | +//// CNHomepageDetailViewController.swift | |
| 3 | +//// metaCode | |
| 4 | +//// | |
| 5 | +//// Created by zx on 2024/1/5. | |
| 6 | +//// 首页--短剧大图点击详情页(废弃) -> CNUpSlideDetailViewController | |
| 1 | 7 | // |
| 2 | -// CNHomepageDetailViewController.swift | |
| 3 | -// metaCode | |
| 8 | +//import Foundation | |
| 9 | +//import MJRefresh | |
| 10 | +//import EmptyDataSet_Swift | |
| 4 | 11 | // |
| 5 | -// Created by zx on 2024/1/5. | |
| 6 | -// 首页短剧--大图点击详情页 | |
| 7 | - | |
| 8 | -import Foundation | |
| 9 | -import MJRefresh | |
| 10 | -import EmptyDataSet_Swift | |
| 11 | - | |
| 12 | -class CNHomepageDetailViewController: CNLiveBaseViewController ,UITableViewDataSource, UITableViewDelegate,EmptyDataSetSource, EmptyDataSetDelegate{ | |
| 13 | - | |
| 14 | - let kCNLiveAlbumImageCellIdentifier = "kCNLiveAlbumImageCellIdentifier" | |
| 15 | - let kCNLiveAlbumCellIdentifier = "kCNLiveAlbumCellIdentifier" | |
| 16 | - | |
| 17 | - var pageNum: NSInteger | |
| 18 | - var network_type: CNLiveMineResponseType! | |
| 19 | - // MARK: - 懒加载 | |
| 20 | - ///数据源 | |
| 21 | - lazy var dataArray: NSMutableArray = { | |
| 22 | - var dataArray = NSMutableArray() | |
| 23 | - return dataArray | |
| 24 | - }() | |
| 25 | - lazy var tableView : UITableView = { | |
| 26 | - let tableView = UITableView(frame: .zero, style: .plain) | |
| 27 | - tableView.dataSource = self | |
| 28 | - tableView.delegate = self | |
| 29 | - tableView.emptyDataSetSource = self | |
| 30 | - tableView.emptyDataSetDelegate = self | |
| 31 | - tableView.separatorStyle = .none | |
| 32 | - tableView.tableFooterView = UIView.init() | |
| 33 | - tableView.register(CNLiveAlbumCell.self, forCellReuseIdentifier: kCNLiveAlbumCellIdentifier) | |
| 34 | - tableView.register(CNLiveAlbumImageCell.self, forCellReuseIdentifier: kCNLiveAlbumImageCellIdentifier) | |
| 35 | - return tableView | |
| 36 | - }() | |
| 37 | - | |
| 38 | - //slideModel | |
| 39 | - var _slideModel : CNLiveDownSlideModel? | |
| 40 | - var slideModel : CNLiveDownSlideModel? { | |
| 41 | - get{ | |
| 42 | - _slideModel | |
| 43 | - } | |
| 44 | - set{ | |
| 45 | - _slideModel = newValue! | |
| 46 | - } | |
| 47 | - } | |
| 48 | - | |
| 49 | - var dismissClosure: (()->())? | |
| 50 | - //the point when start to interactive | |
| 51 | - var interactiveStartingPoint: CGPoint? = nil | |
| 52 | - | |
| 53 | - var draggingDownToDismiss = false | |
| 54 | - | |
| 55 | - let cell: CNDownSlideSingleCourseCell! | |
| 56 | - | |
| 57 | - private lazy var dismissPanGesture: UIPanGestureRecognizer = { | |
| 58 | - let ges = UIPanGestureRecognizer() | |
| 59 | - ges.maximumNumberOfTouches = 1 | |
| 60 | - ges.addTarget(self, action: #selector(handleDismissPan(gesture:))) | |
| 61 | - ges.delegate = self | |
| 62 | - return ges | |
| 63 | - }() | |
| 64 | - | |
| 65 | - lazy var scrollView: CNUpSlideDetailScrollView = { | |
| 66 | - let frame = self.view.bounds | |
| 67 | - let view = CNUpSlideDetailScrollView(frame: frame) | |
| 68 | - view.callBack = {(contentMdl:CNLiveDownSlideContentsModel)->Void in | |
| 69 | - CNLiveDownSlideTool.detailPushWebVCWithContentsMdl(contentMdl: contentMdl, viewController: self) | |
| 70 | - } | |
| 71 | - view.delegate = self | |
| 72 | - return view | |
| 73 | - }() | |
| 74 | - | |
| 75 | - lazy var closeBtn: UIButton = { | |
| 76 | - let btn = UIButton() | |
| 77 | - btn.frame = CGRect(x: KSreenWidth - 20 - 30, y: KStatusBarHeight+20, width: 30, height: 30) | |
| 78 | - btn.setImage(#imageLiteral(resourceName: "close_button"), for: .normal) | |
| 79 | - btn.addTarget(self, action: #selector(closeAction), for: .touchUpInside) | |
| 80 | - return btn | |
| 81 | - }() | |
| 82 | - | |
| 83 | - init(cell: CNDownSlideSingleCourseCell,slideModel:CNLiveDownSlideModel) { | |
| 84 | - self.pageNum = 1 | |
| 85 | - self.cell = cell | |
| 86 | - super.init(nibName: nil, bundle: nil) | |
| 87 | - self.slideModel = slideModel | |
| 88 | - self.setupTranstion() | |
| 89 | - setNeedsStatusBarAppearanceUpdate() | |
| 90 | - | |
| 91 | - } | |
| 92 | - | |
| 93 | - private func setupTranstion() { | |
| 94 | - modalPresentationStyle = .custom | |
| 95 | - transitioningDelegate = self | |
| 96 | - } | |
| 97 | - | |
| 98 | - required init?(coder aDecoder: NSCoder) { | |
| 99 | - fatalError("init(coder:) has not been implemented") | |
| 100 | - } | |
| 101 | - | |
| 102 | - override func viewDidLoad() { | |
| 103 | - super.viewDidLoad() | |
| 104 | - setupUI() | |
| 105 | - getImageFromCell() | |
| 106 | - self.getBlockContents(page: 1) | |
| 107 | - } | |
| 108 | - | |
| 109 | - private func setupUI() { | |
| 110 | - self.view.layer.masksToBounds = true | |
| 111 | -// view.addSubview(scrollView) | |
| 112 | -// scrollView.slideModel = _slideModel | |
| 113 | - self.view.addSubview(self.tableView) | |
| 114 | - self.tableView.frame = CGRect(x: 0, y: 0, width: KSreenWidth, height: KSreenHeight) | |
| 115 | - view.addSubview(closeBtn) | |
| 116 | - view.addGestureRecognizer(dismissPanGesture) | |
| 117 | - | |
| 118 | - if #available(iOS 11.0, *) { | |
| 119 | - scrollView.contentInsetAdjustmentBehavior = .never | |
| 120 | - } else { | |
| 121 | - automaticallyAdjustsScrollViewInsets = false | |
| 122 | - } | |
| 123 | - } | |
| 124 | - | |
| 125 | - private func getImageFromCell() { | |
| 126 | - scrollView.imageView.image = cell.bgImageView.image | |
| 127 | - } | |
| 128 | - | |
| 129 | - @objc private func closeAction() { | |
| 130 | - dismiss(animated: true, completion: nil) | |
| 131 | - let nav = self.navigationController as! CNHomePageBaseNavigationController | |
| 132 | - nav.dismissClosure?() | |
| 133 | - } | |
| 134 | - | |
| 135 | - func numberOfSections(in tableView: UITableView) -> Int { | |
| 136 | - 2 | |
| 137 | - } | |
| 138 | - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | |
| 139 | - if section == 0{ | |
| 140 | - return 1 | |
| 141 | - }else{ | |
| 142 | - return self.dataArray.count | |
| 143 | - } | |
| 144 | - } | |
| 145 | - | |
| 146 | - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
| 147 | - | |
| 148 | - if indexPath.section == 0{ | |
| 149 | - guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveAlbumImageCellIdentifier) as? CNLiveAlbumImageCell | |
| 150 | - else { | |
| 151 | - let cell = CNLiveAlbumImageCell() | |
| 152 | - return cell | |
| 153 | - } | |
| 154 | - cell.iconImgView.image = self.cell.bgImageView.image | |
| 155 | - return cell | |
| 156 | - }else{ | |
| 157 | - let albumModel = self.dataArray[indexPath.row] as! CNLiveAlbumModel | |
| 158 | - | |
| 159 | - guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveAlbumCellIdentifier) as? CNLiveAlbumCell | |
| 160 | - else { | |
| 161 | - let cell = CNLiveAlbumCell() | |
| 162 | - return cell | |
| 163 | - } | |
| 164 | - cell.albumModel = albumModel | |
| 165 | - return cell | |
| 166 | - } | |
| 167 | - } | |
| 168 | - func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { | |
| 169 | - if indexPath.section == 0{ | |
| 170 | - return KSreenWidth | |
| 171 | - }else{ | |
| 172 | - return 75 | |
| 173 | - } | |
| 174 | - } | |
| 175 | - | |
| 176 | - // MARK: - 获取全部专辑列表 | |
| 177 | - func getBlockContents(page:NSInteger){ | |
| 178 | - showLoading(message: "") | |
| 179 | - CNLiveHomePageViewModel.getBlockContents(blockId: self.slideModel!.blockId ?? "", page: page) {[weak self] result, status in | |
| 180 | - hiddenLoading() | |
| 181 | - if status == .success{ | |
| 182 | - if self!.pageNum > 1 { | |
| 183 | - self!.dataArray.addObjects(from: result as! [CNLiveAlbumModel]) | |
| 184 | - } | |
| 185 | - if self!.pageNum == 1 { | |
| 186 | - self!.dataArray.removeAllObjects() | |
| 187 | - self!.dataArray.addObjects(from: result as! [CNLiveAlbumModel]) | |
| 188 | - if self!.dataArray.count > 0 && self!.tableView.mj_header == nil && self!.tableView.mj_footer == nil { | |
| 189 | - self!.addRefreshView() | |
| 190 | - self!.pageNum = self!.pageNum + 1 | |
| 191 | - self!.getBlockContents(page: self!.pageNum) | |
| 192 | - } | |
| 193 | - } | |
| 194 | - | |
| 195 | - self!.tableView.mj_header?.endRefreshing() | |
| 196 | - self!.tableView.mj_footer?.endRefreshing() | |
| 197 | - self!.tableView.reloadData() | |
| 198 | - if (result as! Array<Any>).count == 0 { | |
| 199 | - self!.tableView.mj_footer?.endRefreshingWithNoMoreData() | |
| 200 | - self!.tableView.reloadData() | |
| 201 | - } | |
| 202 | - | |
| 203 | - }else if (status == .noNetwork) { | |
| 204 | - self!.network_type = .noNetwork | |
| 205 | - self!.tableView.reloadEmptyDataSet() | |
| 206 | - } else { | |
| 207 | - self!.network_type = .failed | |
| 208 | - self!.tableView.reloadEmptyDataSet() | |
| 209 | - } | |
| 210 | - } | |
| 211 | - } | |
| 212 | - func addRefreshView() { | |
| 213 | - tableView.mj_header = MJRefreshNormalHeader.init(refreshingBlock: {[weak self] in | |
| 214 | - self!.pageNum = 1 | |
| 215 | - self!.getBlockContents(page: 1) | |
| 216 | - }) | |
| 217 | - | |
| 218 | - tableView.mj_footer = MJRefreshAutoNormalFooter.init(refreshingBlock: {[weak self] in | |
| 219 | - self!.pageNum = self!.pageNum + 1 | |
| 220 | - self!.getBlockContents(page: self!.pageNum) | |
| 221 | - }) | |
| 222 | - } | |
| 223 | - | |
| 224 | - @objc private func handleDismissPan(gesture: UIPanGestureRecognizer) { | |
| 225 | - if !draggingDownToDismiss { | |
| 226 | - return | |
| 227 | - } | |
| 228 | - | |
| 229 | - let startingPoint: CGPoint | |
| 230 | - | |
| 231 | - if let p = interactiveStartingPoint { | |
| 232 | - startingPoint = p | |
| 233 | - } else { | |
| 234 | - startingPoint = gesture.location(in: nil) | |
| 235 | - interactiveStartingPoint = startingPoint | |
| 236 | - } | |
| 237 | - | |
| 238 | - let currentLocation = gesture.location(in: nil) | |
| 239 | - | |
| 240 | - var progress = (currentLocation.y - startingPoint.y) / 100 | |
| 241 | - | |
| 242 | - //prevent viewController bigger when scrolling up | |
| 243 | - if currentLocation.y <= startingPoint.y { | |
| 244 | - progress = 0 | |
| 245 | - } | |
| 246 | - | |
| 247 | - if progress >= 1.0 { | |
| 248 | - dismiss(animated: true, completion: nil) | |
| 249 | - let nav = self.navigationController as! CNHomePageBaseNavigationController | |
| 250 | - nav.dismissClosure?() | |
| 251 | -// dismissClosure?() | |
| 252 | - stopDismissPanGesture(gesture) | |
| 253 | - return | |
| 254 | - } | |
| 255 | - | |
| 256 | - let targetShrinkScale: CGFloat = 0.86 | |
| 257 | - let currentScale: CGFloat = 1 - (1 - targetShrinkScale) * progress | |
| 258 | - | |
| 259 | - switch gesture.state { | |
| 260 | - case .began,.changed: | |
| 261 | - scrollView.isScrollEnabled = false | |
| 262 | - gesture.view?.transform = CGAffineTransform(scaleX: currentScale, y: currentScale) | |
| 263 | - gesture.view?.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius * (progress) | |
| 264 | - scrollView.showsVerticalScrollIndicator = false | |
| 265 | - case .cancelled,.ended: | |
| 266 | - scrollView.isScrollEnabled = true | |
| 267 | - stopDismissPanGesture(gesture) | |
| 268 | - default: | |
| 269 | - break | |
| 270 | - } | |
| 271 | - } | |
| 272 | - | |
| 273 | - //当下拉Offset超过100或取消下拉手势时,执行此方法 | |
| 274 | - private func stopDismissPanGesture(_ gesture: UIPanGestureRecognizer) { | |
| 275 | - draggingDownToDismiss = false | |
| 276 | - interactiveStartingPoint = nil | |
| 277 | - scrollView.showsVerticalScrollIndicator = true | |
| 278 | - | |
| 279 | - UIView.animate(withDuration: 0.2) { | |
| 280 | - gesture.view?.transform = CGAffineTransform.identity | |
| 281 | - } | |
| 282 | - } | |
| 283 | - | |
| 284 | -} | |
| 285 | - | |
| 286 | -extension CNHomepageDetailViewController: UIViewControllerTransitioningDelegate { | |
| 287 | - | |
| 288 | - func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { | |
| 289 | - return CNHomePageAnimationTransition(animationType: .present) | |
| 290 | - } | |
| 291 | - | |
| 292 | - func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { | |
| 293 | - return CNHomePageAnimationTransition(animationType: .dismiss) | |
| 294 | - } | |
| 295 | - | |
| 296 | - func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? { | |
| 297 | - return CNUpSlideCardPresentationController(presentedViewController: presented, presenting: presenting) | |
| 298 | - } | |
| 299 | -} | |
| 300 | - | |
| 301 | -extension CNHomepageDetailViewController: UIScrollViewDelegate { | |
| 302 | - func scrollViewDidScroll(_ scrollView: UIScrollView) { | |
| 303 | - | |
| 304 | - if scrollView.contentOffset.y < 0 { | |
| 305 | - scrollView.contentOffset = .zero | |
| 306 | - draggingDownToDismiss = true | |
| 307 | - } | |
| 308 | - } | |
| 309 | -} | |
| 310 | - | |
| 311 | -extension CNHomepageDetailViewController: UIGestureRecognizerDelegate { | |
| 312 | - func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool { | |
| 313 | - return true | |
| 314 | - } | |
| 315 | -} | |
| 316 | - | |
| 317 | -extension CNHomepageDetailViewController { | |
| 318 | - | |
| 319 | - func image(forEmptyDataSet scrollView: UIScrollView) -> UIImage? { | |
| 320 | - if network_type == .failed || network_type == .unkonw { | |
| 321 | - return UIImage(named: "mine_list_source_unusual_failed") | |
| 322 | - } | |
| 323 | - if dataArray.count == 0 { | |
| 324 | - return UIImage(named: "mine_list_source_unusual_empty") | |
| 325 | - } | |
| 326 | - if network_type == .noNetwork { | |
| 327 | - return UIImage(named: "mine_list_source_unusual_noNet") | |
| 328 | - } | |
| 329 | - return UIImage(named: "mine_list_source_unusual_empty") | |
| 330 | - } | |
| 331 | - | |
| 332 | - func title(forEmptyDataSet scrollView: UIScrollView) -> NSAttributedString? { | |
| 333 | - var defult_string = "" | |
| 334 | - if network_type == .failed || network_type == .unkonw { | |
| 335 | - defult_string = "接口请求错误,刷新试试~" | |
| 336 | - } | |
| 337 | - if network_type == .noNetwork { | |
| 338 | - defult_string = "网络开小差了,刷新试试~" | |
| 339 | - } | |
| 340 | - if dataArray.count == 0 { | |
| 341 | - defult_string = "暂时没有数据~" | |
| 342 | - } | |
| 343 | - return NSAttributedString(string: defult_string, attributes: [.font: Font_17,.foregroundColor: HexColor("#666666")!]) | |
| 344 | - } | |
| 345 | - | |
| 346 | - func buttonTitle(forEmptyDataSet scrollView: UIScrollView, for state: UIControl.State) -> NSAttributedString? { | |
| 347 | - if network_type == .failed || network_type == .noNetwork { | |
| 348 | - let attributes = [NSAttributedString.Key.font:Font_16_Fit, | |
| 349 | - NSAttributedString.Key.foregroundColor: HexColor("#609BFF")] | |
| 350 | - return NSAttributedString(string: "刷一刷", attributes: attributes as [NSAttributedString.Key : Any]) | |
| 351 | - } | |
| 352 | - return nil | |
| 353 | - } | |
| 354 | - | |
| 355 | - func emptyDataSet(_ scrollView: UIScrollView, didTapView view: UIView) { | |
| 356 | - if network_type == .failed || network_type == .noNetwork { | |
| 357 | - getBlockContents(page: 1) | |
| 358 | - } | |
| 359 | - } | |
| 360 | -} | |
| 12 | +//class CNHomepageDetailViewController: CNLiveBaseViewController ,UITableViewDataSource, UITableViewDelegate,EmptyDataSetSource, EmptyDataSetDelegate{ | |
| 13 | +// | |
| 14 | +// //slideModel | |
| 15 | +// var _slideModel : CNLiveDownSlideModel? | |
| 16 | +// var slideModel : CNLiveDownSlideModel? { | |
| 17 | +// get{ | |
| 18 | +// _slideModel | |
| 19 | +// } | |
| 20 | +// set{ | |
| 21 | +// _slideModel = newValue! | |
| 22 | +// } | |
| 23 | +// } | |
| 24 | +// | |
| 25 | +// var dismissClosure: (()->())? | |
| 26 | +// //the point when start to interactive | |
| 27 | +// var interactiveStartingPoint: CGPoint? = nil | |
| 28 | +// var draggingDownToDismiss = false | |
| 29 | +// let cell: CNDownSlideSingleCourseCell! | |
| 30 | +// | |
| 31 | +// private lazy var dismissPanGesture: UIPanGestureRecognizer = { | |
| 32 | +// let ges = UIPanGestureRecognizer() | |
| 33 | +// ges.maximumNumberOfTouches = 1 | |
| 34 | +// ges.addTarget(self, action: #selector(handleDismissPan(gesture:))) | |
| 35 | +// ges.delegate = self | |
| 36 | +// return ges | |
| 37 | +// }() | |
| 38 | +// | |
| 39 | +// lazy var scrollView: CNUpSlideDetailScrollView = { | |
| 40 | +// let frame = self.view.bounds | |
| 41 | +// let view = CNUpSlideDetailScrollView(frame: frame) | |
| 42 | +// view.callBack = {(contentMdl:CNLiveDownSlideContentsModel)->Void in | |
| 43 | +// CNLiveDownSlideTool.detailPushWebVCWithContentsMdl(contentMdl: contentMdl, viewController: self) | |
| 44 | +// } | |
| 45 | +// view.delegate = self | |
| 46 | +// return view | |
| 47 | +// }() | |
| 48 | +// | |
| 49 | +// lazy var closeBtn: UIButton = { | |
| 50 | +// let btn = UIButton() | |
| 51 | +// btn.frame = CGRect(x: KSreenWidth - 20 - 30, y: KStatusBarHeight+20, width: 30, height: 30) | |
| 52 | +// btn.setImage(#imageLiteral(resourceName: "close_button"), for: .normal) | |
| 53 | +// btn.addTarget(self, action: #selector(closeAction), for: .touchUpInside) | |
| 54 | +// return btn | |
| 55 | +// }() | |
| 56 | +// init(cell: CNDownSlideSingleCourseCell,slideModel:CNLiveDownSlideModel) { | |
| 57 | +// self.pageNum = 1 | |
| 58 | +// self.cell = cell | |
| 59 | +// super.init(nibName: nil, bundle: nil) | |
| 60 | +// self.slideModel = slideModel | |
| 61 | +// self.setupTranstion() | |
| 62 | +// setNeedsStatusBarAppearanceUpdate() | |
| 63 | +// | |
| 64 | +// } | |
| 65 | +// | |
| 66 | +// private func setupTranstion() { | |
| 67 | +// modalPresentationStyle = .custom | |
| 68 | +// transitioningDelegate = self | |
| 69 | +// } | |
| 70 | +// | |
| 71 | +// required init?(coder aDecoder: NSCoder) { | |
| 72 | +// fatalError("init(coder:) has not been implemented") | |
| 73 | +// } | |
| 74 | +// override func viewDidLoad() { | |
| 75 | +// super.viewDidLoad() | |
| 76 | +// setupUI() | |
| 77 | +// getImageFromCell() | |
| 78 | +// self.getBlockContents(page: 1) | |
| 79 | +// } | |
| 80 | +// | |
| 81 | +// private func setupUI() { | |
| 82 | +// self.view.layer.masksToBounds = true | |
| 83 | +//// view.addSubview(scrollView) | |
| 84 | +//// scrollView.slideModel = _slideModel | |
| 85 | +// self.view.addSubview(self.tableView) | |
| 86 | +// self.tableView.frame = CGRect(x: 0, y: 0, width: KSreenWidth, height: KSreenHeight) | |
| 87 | +// view.addSubview(closeBtn) | |
| 88 | +// view.addGestureRecognizer(dismissPanGesture) | |
| 89 | +// | |
| 90 | +// if #available(iOS 11.0, *) { | |
| 91 | +// scrollView.contentInsetAdjustmentBehavior = .never | |
| 92 | +// } else { | |
| 93 | +// automaticallyAdjustsScrollViewInsets = false | |
| 94 | +// } | |
| 95 | +// } | |
| 96 | +// | |
| 97 | +// private func getImageFromCell() { | |
| 98 | +// scrollView.imageView.image = cell.bgImageView.image | |
| 99 | +// } | |
| 100 | +// @objc private func closeAction() { | |
| 101 | +// dismiss(animated: true, completion: nil) | |
| 102 | +// let nav = self.navigationController as! CNHomePageBaseNavigationController | |
| 103 | +// nav.dismissClosure?() | |
| 104 | +// } | |
| 105 | +// @objc private func handleDismissPan(gesture: UIPanGestureRecognizer) { | |
| 106 | +// if !draggingDownToDismiss { | |
| 107 | +// return | |
| 108 | +// } | |
| 109 | +// | |
| 110 | +// let startingPoint: CGPoint | |
| 111 | +// | |
| 112 | +// if let p = interactiveStartingPoint { | |
| 113 | +// startingPoint = p | |
| 114 | +// } else { | |
| 115 | +// startingPoint = gesture.location(in: nil) | |
| 116 | +// interactiveStartingPoint = startingPoint | |
| 117 | +// } | |
| 118 | +// | |
| 119 | +// let currentLocation = gesture.location(in: nil) | |
| 120 | +// | |
| 121 | +// var progress = (currentLocation.y - startingPoint.y) / 100 | |
| 122 | +// | |
| 123 | +// //prevent viewController bigger when scrolling up | |
| 124 | +// if currentLocation.y <= startingPoint.y { | |
| 125 | +// progress = 0 | |
| 126 | +// } | |
| 127 | +// | |
| 128 | +// if progress >= 1.0 { | |
| 129 | +// dismiss(animated: true, completion: nil) | |
| 130 | +// let nav = self.navigationController as! CNHomePageBaseNavigationController | |
| 131 | +// nav.dismissClosure?() | |
| 132 | +//// dismissClosure?() | |
| 133 | +// stopDismissPanGesture(gesture) | |
| 134 | +// return | |
| 135 | +// } | |
| 136 | +// | |
| 137 | +// let targetShrinkScale: CGFloat = 0.86 | |
| 138 | +// let currentScale: CGFloat = 1 - (1 - targetShrinkScale) * progress | |
| 139 | +// | |
| 140 | +// switch gesture.state { | |
| 141 | +// case .began,.changed: | |
| 142 | +// scrollView.isScrollEnabled = false | |
| 143 | +// gesture.view?.transform = CGAffineTransform(scaleX: currentScale, y: currentScale) | |
| 144 | +// gesture.view?.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius * (progress) | |
| 145 | +// scrollView.showsVerticalScrollIndicator = false | |
| 146 | +// case .cancelled,.ended: | |
| 147 | +// scrollView.isScrollEnabled = true | |
| 148 | +// stopDismissPanGesture(gesture) | |
| 149 | +// default: | |
| 150 | +// break | |
| 151 | +// } | |
| 152 | +// } | |
| 153 | +// | |
| 154 | +// //当下拉Offset超过100或取消下拉手势时,执行此方法 | |
| 155 | +// private func stopDismissPanGesture(_ gesture: UIPanGestureRecognizer) { | |
| 156 | +// draggingDownToDismiss = false | |
| 157 | +// interactiveStartingPoint = nil | |
| 158 | +// scrollView.showsVerticalScrollIndicator = true | |
| 159 | +// | |
| 160 | +// UIView.animate(withDuration: 0.2) { | |
| 161 | +// gesture.view?.transform = CGAffineTransform.identity | |
| 162 | +// } | |
| 163 | +// } | |
| 164 | +// | |
| 165 | +// | |
| 166 | +// | |
| 167 | +// | |
| 168 | +// let kCNLiveAlbumImageCellIdentifier = "kCNLiveAlbumImageCellIdentifier" | |
| 169 | +// let kCNLiveAlbumCellIdentifier = "kCNLiveAlbumCellIdentifier" | |
| 170 | +// | |
| 171 | +// var pageNum: NSInteger | |
| 172 | +// var network_type: CNLiveMineResponseType! | |
| 173 | +// // MARK: - 懒加载 | |
| 174 | +// ///数据源 | |
| 175 | +// lazy var dataArray: NSMutableArray = { | |
| 176 | +// var dataArray = NSMutableArray() | |
| 177 | +// return dataArray | |
| 178 | +// }() | |
| 179 | +// lazy var tableView : UITableView = { | |
| 180 | +// let tableView = UITableView(frame: .zero, style: .plain) | |
| 181 | +// tableView.dataSource = self | |
| 182 | +// tableView.delegate = self | |
| 183 | +// tableView.emptyDataSetSource = self | |
| 184 | +// tableView.emptyDataSetDelegate = self | |
| 185 | +// tableView.separatorStyle = .none | |
| 186 | +// tableView.tableFooterView = UIView.init() | |
| 187 | +// tableView.register(CNLiveAlbumCell.self, forCellReuseIdentifier: kCNLiveAlbumCellIdentifier) | |
| 188 | +// tableView.register(CNLiveAlbumImageCell.self, forCellReuseIdentifier: kCNLiveAlbumImageCellIdentifier) | |
| 189 | +// return tableView | |
| 190 | +// }() | |
| 191 | +// | |
| 192 | +// | |
| 193 | +// func numberOfSections(in tableView: UITableView) -> Int { | |
| 194 | +// 2 | |
| 195 | +// } | |
| 196 | +// func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | |
| 197 | +// if section == 0{ | |
| 198 | +// return 1 | |
| 199 | +// }else{ | |
| 200 | +// return self.dataArray.count | |
| 201 | +// } | |
| 202 | +// } | |
| 203 | +// | |
| 204 | +// func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
| 205 | +// | |
| 206 | +// if indexPath.section == 0{ | |
| 207 | +// guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveAlbumImageCellIdentifier) as? CNLiveAlbumImageCell | |
| 208 | +// else { | |
| 209 | +// let cell = CNLiveAlbumImageCell() | |
| 210 | +// return cell | |
| 211 | +// } | |
| 212 | +// cell.iconImgView.image = self.cell.bgImageView.image | |
| 213 | +// return cell | |
| 214 | +// }else{ | |
| 215 | +// let albumModel = self.dataArray[indexPath.row] as! CNLiveAlbumModel | |
| 216 | +// | |
| 217 | +// guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveAlbumCellIdentifier) as? CNLiveAlbumCell | |
| 218 | +// else { | |
| 219 | +// let cell = CNLiveAlbumCell() | |
| 220 | +// return cell | |
| 221 | +// } | |
| 222 | +// cell.albumModel = albumModel | |
| 223 | +// return cell | |
| 224 | +// } | |
| 225 | +// } | |
| 226 | +// func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { | |
| 227 | +// if indexPath.section == 0{ | |
| 228 | +// return KSreenWidth | |
| 229 | +// }else{ | |
| 230 | +// return 75 | |
| 231 | +// } | |
| 232 | +// } | |
| 233 | +// | |
| 234 | +// // MARK: - 获取全部专辑列表 | |
| 235 | +// func getBlockContents(page:NSInteger){ | |
| 236 | +// showLoading(message: "") | |
| 237 | +// CNLiveHomePageViewModel.getBlockContents(blockId: self.slideModel!.blockId ?? "", page: page) {[weak self] result, status in | |
| 238 | +// hiddenLoading() | |
| 239 | +// if status == .success{ | |
| 240 | +// if self!.pageNum > 1 { | |
| 241 | +// self!.dataArray.addObjects(from: result as! [CNLiveAlbumModel]) | |
| 242 | +// } | |
| 243 | +// if self!.pageNum == 1 { | |
| 244 | +// self!.dataArray.removeAllObjects() | |
| 245 | +// self!.dataArray.addObjects(from: result as! [CNLiveAlbumModel]) | |
| 246 | +// if self!.dataArray.count > 0 && self!.tableView.mj_header == nil && self!.tableView.mj_footer == nil { | |
| 247 | +// self!.addRefreshView() | |
| 248 | +// self!.pageNum = self!.pageNum + 1 | |
| 249 | +// self!.getBlockContents(page: self!.pageNum) | |
| 250 | +// } | |
| 251 | +// } | |
| 252 | +// | |
| 253 | +// self!.tableView.mj_header?.endRefreshing() | |
| 254 | +// self!.tableView.mj_footer?.endRefreshing() | |
| 255 | +// self!.tableView.reloadData() | |
| 256 | +// if (result as! Array<Any>).count == 0 { | |
| 257 | +// self!.tableView.mj_footer?.endRefreshingWithNoMoreData() | |
| 258 | +// self!.tableView.reloadData() | |
| 259 | +// } | |
| 260 | +// | |
| 261 | +// }else if (status == .noNetwork) { | |
| 262 | +// self!.network_type = .noNetwork | |
| 263 | +// self!.tableView.reloadEmptyDataSet() | |
| 264 | +// } else { | |
| 265 | +// self!.network_type = .failed | |
| 266 | +// self!.tableView.reloadEmptyDataSet() | |
| 267 | +// } | |
| 268 | +// } | |
| 269 | +// } | |
| 270 | +// func addRefreshView() { | |
| 271 | +// tableView.mj_header = MJRefreshNormalHeader.init(refreshingBlock: {[weak self] in | |
| 272 | +// self!.pageNum = 1 | |
| 273 | +// self!.getBlockContents(page: 1) | |
| 274 | +// }) | |
| 275 | +// | |
| 276 | +// tableView.mj_footer = MJRefreshAutoNormalFooter.init(refreshingBlock: {[weak self] in | |
| 277 | +// self!.pageNum = self!.pageNum + 1 | |
| 278 | +// self!.getBlockContents(page: self!.pageNum) | |
| 279 | +// }) | |
| 280 | +// } | |
| 281 | +//} | |
| 282 | +// | |
| 283 | +//extension CNHomepageDetailViewController: UIViewControllerTransitioningDelegate { | |
| 284 | +// | |
| 285 | +// func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { | |
| 286 | +// return CNHomePageAnimationTransition(animationType: .present) | |
| 287 | +// } | |
| 288 | +// | |
| 289 | +// func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { | |
| 290 | +// return CNHomePageAnimationTransition(animationType: .dismiss) | |
| 291 | +// } | |
| 292 | +// | |
| 293 | +// func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? { | |
| 294 | +// return CNUpSlideCardPresentationController(presentedViewController: presented, presenting: presenting) | |
| 295 | +// } | |
| 296 | +//} | |
| 297 | +// | |
| 298 | +//extension CNHomepageDetailViewController: UIScrollViewDelegate { | |
| 299 | +// func scrollViewDidScroll(_ scrollView: UIScrollView) { | |
| 300 | +// | |
| 301 | +// if scrollView.contentOffset.y < 0 { | |
| 302 | +// scrollView.contentOffset = .zero | |
| 303 | +// draggingDownToDismiss = true | |
| 304 | +// } | |
| 305 | +// } | |
| 306 | +//} | |
| 307 | +// | |
| 308 | +//extension CNHomepageDetailViewController: UIGestureRecognizerDelegate { | |
| 309 | +// func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool { | |
| 310 | +// return true | |
| 311 | +// } | |
| 312 | +//} | |
| 313 | +// | |
| 314 | +//extension CNHomepageDetailViewController { | |
| 315 | +// | |
| 316 | +// func image(forEmptyDataSet scrollView: UIScrollView) -> UIImage? { | |
| 317 | +// if network_type == .failed || network_type == .unkonw { | |
| 318 | +// return UIImage(named: "mine_list_source_unusual_failed") | |
| 319 | +// } | |
| 320 | +// if dataArray.count == 0 { | |
| 321 | +// return UIImage(named: "mine_list_source_unusual_empty") | |
| 322 | +// } | |
| 323 | +// if network_type == .noNetwork { | |
| 324 | +// return UIImage(named: "mine_list_source_unusual_noNet") | |
| 325 | +// } | |
| 326 | +// return UIImage(named: "mine_list_source_unusual_empty") | |
| 327 | +// } | |
| 328 | +// | |
| 329 | +// func title(forEmptyDataSet scrollView: UIScrollView) -> NSAttributedString? { | |
| 330 | +// var defult_string = "" | |
| 331 | +// if network_type == .failed || network_type == .unkonw { | |
| 332 | +// defult_string = "接口请求错误,刷新试试~" | |
| 333 | +// } | |
| 334 | +// if network_type == .noNetwork { | |
| 335 | +// defult_string = "网络开小差了,刷新试试~" | |
| 336 | +// } | |
| 337 | +// if dataArray.count == 0 { | |
| 338 | +// defult_string = "暂时没有数据~" | |
| 339 | +// } | |
| 340 | +// return NSAttributedString(string: defult_string, attributes: [.font: Font_17,.foregroundColor: HexColor("#666666")!]) | |
| 341 | +// } | |
| 342 | +// | |
| 343 | +// func buttonTitle(forEmptyDataSet scrollView: UIScrollView, for state: UIControl.State) -> NSAttributedString? { | |
| 344 | +// if network_type == .failed || network_type == .noNetwork { | |
| 345 | +// let attributes = [NSAttributedString.Key.font:Font_16_Fit, | |
| 346 | +// NSAttributedString.Key.foregroundColor: HexColor("#609BFF")] | |
| 347 | +// return NSAttributedString(string: "刷一刷", attributes: attributes as [NSAttributedString.Key : Any]) | |
| 348 | +// } | |
| 349 | +// return nil | |
| 350 | +// } | |
| 351 | +// | |
| 352 | +// func emptyDataSet(_ scrollView: UIScrollView, didTapView view: UIView) { | |
| 353 | +// if network_type == .failed || network_type == .noNetwork { | |
| 354 | +// getBlockContents(page: 1) | |
| 355 | +// } | |
| 356 | +// } | |
| 357 | +//} | ... | ... |
metaCode/Classes/Main/HomePages/Controller/AuthController/push相关/CNHomepageDuanJuDetailViewController.swift
| ... | ... | @@ -121,6 +121,8 @@ class CNHomepageDuanJuDetailViewController: CNLiveBaseViewController ,UITableVi |
| 121 | 121 | let cell = CNLiveDuanjuTitleCell() |
| 122 | 122 | return cell |
| 123 | 123 | } |
| 124 | + cell.cellType = .playlet | |
| 125 | + cell.blockName = "在追短剧" | |
| 124 | 126 | return cell |
| 125 | 127 | }else{ |
| 126 | 128 | let albumModel = self.dataArray[indexPath.row] as! CNLiveAlbumMsgModel |
| ... | ... | @@ -130,6 +132,7 @@ class CNHomepageDuanJuDetailViewController: CNLiveBaseViewController ,UITableVi |
| 130 | 132 | let cell = CNLiveAlbumCell() |
| 131 | 133 | return cell |
| 132 | 134 | } |
| 135 | + cell.isDetail = true | |
| 133 | 136 | cell.albumMsgModel = albumModel |
| 134 | 137 | return cell |
| 135 | 138 | } | ... | ... |
metaCode/Classes/Main/HomePages/Controller/PlayletHomePage/CNLivePlayletHomePageController.swift
| ... | ... | @@ -108,7 +108,9 @@ class CNLivePlayletHomePageController:CNLiveBaseViewController, UITableViewDataS |
| 108 | 108 | self.tableView.reloadData() |
| 109 | 109 | } |
| 110 | 110 | cell.homePageNeedReloadActionBlock = { |
| 111 | - self.getAlbumList(aid: self.albumId) | |
| 111 | + DispatchQueue.main.asyncAfter(deadline: .now()+0.5) { [self] in | |
| 112 | + self.getAlbumList(aid: self.albumId) | |
| 113 | + } | |
| 112 | 114 | } |
| 113 | 115 | if self.albumModelArr.count > 0{ |
| 114 | 116 | let albumListModel = self.albumModelArr[0] |
| ... | ... | @@ -138,6 +140,7 @@ class CNLivePlayletHomePageController:CNLiveBaseViewController, UITableViewDataS |
| 138 | 140 | }else{ |
| 139 | 141 | let albumListModel = self.albumModelArr[indexPath.row] |
| 140 | 142 | let aid = albumListModel.albumMsgModel?.albumId ?? "" |
| 143 | + //跳转播放页 | |
| 141 | 144 | navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveShortVideoViewController(aid: aid), animated: pushAnimated) |
| 142 | 145 | } |
| 143 | 146 | } | ... | ... |
metaCode/Classes/Main/HomePages/Model/CNLiveAlbumModel.swift
| ... | ... | @@ -7,6 +7,28 @@ |
| 7 | 7 | |
| 8 | 8 | import Foundation |
| 9 | 9 | |
| 10 | +class CNLiveAlbumBaseModel:BaseModel{ | |
| 11 | + var endRow = 0 | |
| 12 | + var firstPage = 0 | |
| 13 | + var hasNextPage = false | |
| 14 | + var nextPage = 0 | |
| 15 | + var hasPreviousPage = false | |
| 16 | + var isFirstPage = true | |
| 17 | + var isLastPage = true | |
| 18 | + var lastPage = 0 | |
| 19 | + var list = [CNLiveAlbumModel]() | |
| 20 | + var navigateFirstPage = 0 | |
| 21 | + var navigateLastPage = 0 | |
| 22 | + var navigatePages = 0 | |
| 23 | + var navigatepageNums:Array<Any> = [] | |
| 24 | + var pageNum = 0 | |
| 25 | + var pageSize = 0 | |
| 26 | + var pages = 0 | |
| 27 | + var prePage = 0 | |
| 28 | + var size = 0 | |
| 29 | + var startRow = 0 | |
| 30 | + var total = 0 | |
| 31 | +} | |
| 10 | 32 | class CNLiveAlbumModel:BaseModel{ |
| 11 | 33 | var title = "" |
| 12 | 34 | var subTitle = "" | ... | ... |
metaCode/Classes/Main/HomePages/Model/CNLiveHomePageModel.swift
| ... | ... | @@ -11,6 +11,7 @@ class CNLiveHomePageModel:BaseModel{ |
| 11 | 11 | var endRow = 0 |
| 12 | 12 | var firstPage = 0 |
| 13 | 13 | var hasNextPage = false |
| 14 | + var nextPage = 0 | |
| 14 | 15 | var hasPreviousPage = false |
| 15 | 16 | var isFirstPage = true |
| 16 | 17 | var isLastPage = true |
| ... | ... | @@ -20,7 +21,6 @@ class CNLiveHomePageModel:BaseModel{ |
| 20 | 21 | var navigateLastPage = 0 |
| 21 | 22 | var navigatePages = 0 |
| 22 | 23 | var navigatepageNums:Array<Any> = [] |
| 23 | - var nextPage = 0 | |
| 24 | 24 | var pageNum = 0 |
| 25 | 25 | var pageSize = 0 |
| 26 | 26 | var pages = 0 | ... | ... |
metaCode/Classes/Main/HomePages/View/HomePage/CNLiveHomePageDuanJuCell.swift
| ... | ... | @@ -12,7 +12,6 @@ typealias DuanJUCellSelectedCallBackBlock = (_ cell: CNLiveHomePageDuanJuCell) - |
| 12 | 12 | |
| 13 | 13 | class CNLiveHomePageDuanJuCell:UITableViewCell,UITableViewDelegate,UITableViewDataSource{ |
| 14 | 14 | let kCNLiveAlbumCellIdentifier = "kCNLiveAlbumCellIdentifier" |
| 15 | -// let bgBackView = UIView() | |
| 16 | 15 | |
| 17 | 16 | var DuanJUCellSelectedCallBack:DuanJUCellSelectedCallBackBlock? |
| 18 | 17 | lazy var modelArr: NSMutableArray = { |
| ... | ... | @@ -22,19 +21,15 @@ class CNLiveHomePageDuanJuCell:UITableViewCell,UITableViewDelegate,UITableViewDa |
| 22 | 21 | func setModelArr(modelArr:NSMutableArray){ |
| 23 | 22 | self.modelArr = NSMutableArray(array: modelArr) |
| 24 | 23 | |
| 25 | - self.tableView.height = CGFloat(self.modelArr.count)*(45+15*2) | |
| 26 | - self.totalView.height = CGFloat(self.modelArr.count)*(45+15*2) + 55 | |
| 24 | + var numCell = 0 | |
| 25 | + if self.modelArr.count > 4{ | |
| 26 | + numCell = 4 | |
| 27 | + }else{ | |
| 28 | + numCell = self.modelArr.count | |
| 29 | + } | |
| 30 | + self.tableView.height = CGFloat(numCell)*(45+15*2) | |
| 31 | + self.totalView.height = CGFloat(numCell)*(45+15*2) + 55 + 12 | |
| 27 | 32 | self.tableView.reloadData() |
| 28 | - | |
| 29 | -// //定义view的阴影颜色 | |
| 30 | -// self.totalView.layer.shadowColor = UIColor.black.cgColor | |
| 31 | -// //阴影偏移量 | |
| 32 | -// self.totalView.layer.shadowOffset=CGSize(width:1, height:1) | |
| 33 | -// //定义view的阴影宽度,模糊计算的半径 | |
| 34 | -// self.totalView.layer.shadowRadius = 12 | |
| 35 | -// //定义view的阴影透明度,注意:如果view没有设置背景色阴影也是不会显示的 | |
| 36 | -// self.totalView.layer.shadowOpacity = 0.4 | |
| 37 | - | |
| 38 | 33 | } |
| 39 | 34 | //MARK: - 懒加载 |
| 40 | 35 | ///区块标题 |
| ... | ... | @@ -66,22 +61,23 @@ class CNLiveHomePageDuanJuCell:UITableViewCell,UITableViewDelegate,UITableViewDa |
| 66 | 61 | self.selectionStyle = .none |
| 67 | 62 | |
| 68 | 63 | self.contentView.addSubview(self.totalView) |
| 69 | - | |
| 70 | - self.totalView.addSubview(self.blockTitleLabl) | |
| 71 | - self.totalView.addSubview(self.tableView) | |
| 72 | - self.tableView.backgroundColor = .white | |
| 64 | + | |
| 65 | + // 设置阴影效果 | |
| 66 | + self.totalView.layer.masksToBounds = false | |
| 67 | + //定义view的阴影颜色 | |
| 68 | + self.totalView.layer.shadowColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.1).cgColor | |
| 69 | + //定义view的阴影透明度,注意:如果view没有设置背景色阴影也是不会显示的 | |
| 70 | + self.totalView.layer.shadowOpacity = 1 | |
| 71 | + //定义view的阴影宽度,模糊计算的半径 | |
| 72 | + self.totalView.layer.shadowRadius = 10.0 | |
| 73 | + //阴影偏移量 | |
| 74 | + self.totalView.layer.shadowOffset = CGSize(width: 0, height: 0) | |
| 75 | + | |
| 73 | 76 | self.totalView.layer.cornerRadius = 12 |
| 74 | - self.totalView.clipsToBounds = true | |
| 75 | 77 | self.totalView.backgroundColor = .white |
| 76 | 78 | |
| 77 | - //定义view的阴影颜色 | |
| 78 | - self.totalView.layer.shadowColor = UIColor.black.cgColor | |
| 79 | - //阴影偏移量 | |
| 80 | - self.totalView.layer.shadowOffset=CGSize(width:1, height:1) | |
| 81 | - //定义view的阴影宽度,模糊计算的半径 | |
| 82 | - self.totalView.layer.shadowRadius = 12 | |
| 83 | - //定义view的阴影透明度,注意:如果view没有设置背景色阴影也是不会显示的 | |
| 84 | - self.totalView.layer.shadowOpacity = 0.4 | |
| 79 | + self.totalView.addSubview(self.blockTitleLabl) | |
| 80 | + self.totalView.addSubview(self.tableView) | |
| 85 | 81 | |
| 86 | 82 | setupUI() |
| 87 | 83 | } |
| ... | ... | @@ -91,11 +87,15 @@ class CNLiveHomePageDuanJuCell:UITableViewCell,UITableViewDelegate,UITableViewDa |
| 91 | 87 | } |
| 92 | 88 | |
| 93 | 89 | private func setupUI() { |
| 94 | - contentView.backgroundColor = HexColor(kCNDownSlideBackgroundColorHex) | |
| 90 | + contentView.backgroundColor = HexColor(kCNDownSlideBackgroundColorHex) | |
| 95 | 91 | } |
| 96 | 92 | |
| 97 | 93 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { |
| 98 | - self.modelArr.count | |
| 94 | + if self.modelArr.count > 4{ | |
| 95 | + return 4 | |
| 96 | + }else{ | |
| 97 | + return self.modelArr.count | |
| 98 | + } | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { |
| ... | ... | @@ -105,8 +105,8 @@ class CNLiveHomePageDuanJuCell:UITableViewCell,UITableViewDelegate,UITableViewDa |
| 105 | 105 | let cell = CNLiveAlbumCell() |
| 106 | 106 | return cell |
| 107 | 107 | } |
| 108 | + cell.isDetail = false | |
| 108 | 109 | cell.albumMsgModel = model |
| 109 | - | |
| 110 | 110 | return cell |
| 111 | 111 | } |
| 112 | 112 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
| ... | ... | @@ -115,9 +115,4 @@ class CNLiveHomePageDuanJuCell:UITableViewCell,UITableViewDelegate,UITableViewDa |
| 115 | 115 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { |
| 116 | 116 | return 45+15*2 |
| 117 | 117 | } |
| 118 | - //MARK: - 事件 | |
| 119 | - @objc func playBtnAction(){ | |
| 120 | - showLoading(message: "") | |
| 121 | -// self.getAlbumList() | |
| 122 | - } | |
| 123 | 118 | } | ... | ... |
metaCode/Classes/Main/HomePages/View/HomepageDetail/CNLiveAlbumCell.swift
| ... | ... | @@ -7,10 +7,17 @@ |
| 7 | 7 | |
| 8 | 8 | import Foundation |
| 9 | 9 | import QMUIKit |
| 10 | + | |
| 11 | +typealias CNLiveAlbumCellEnterBlock = (_ albumModel:CNLiveAlbumModel)->Void; | |
| 12 | + | |
| 10 | 13 | class CNLiveAlbumCell:UITableViewCell{ |
| 11 | 14 | |
| 15 | + var enterBlock:CNLiveAlbumCellEnterBlock? | |
| 12 | 16 | var albumModelArr:Array<CNLiveAlbumListModel>? |
| 13 | 17 | |
| 18 | + var isDetail:Bool = false | |
| 19 | + var cellType:CNLiveHomePageCellType = .course | |
| 20 | + | |
| 14 | 21 | var _albumMsgModel : CNLiveAlbumMsgModel? |
| 15 | 22 | var albumMsgModel : CNLiveAlbumMsgModel? { |
| 16 | 23 | get{ |
| ... | ... | @@ -19,7 +26,7 @@ class CNLiveAlbumCell:UITableViewCell{ |
| 19 | 26 | set{ |
| 20 | 27 | _albumMsgModel = newValue! |
| 21 | 28 | |
| 22 | - self.setupNewUIMsgModel(model: _albumMsgModel!) | |
| 29 | + self.setupNewUIMsgModel(model: _albumMsgModel!, isDetail: self.isDetail) | |
| 23 | 30 | } |
| 24 | 31 | } |
| 25 | 32 | |
| ... | ... | @@ -86,21 +93,35 @@ class CNLiveAlbumCell:UITableViewCell{ |
| 86 | 93 | fatalError("init(coder:) has not been implemented") |
| 87 | 94 | } |
| 88 | 95 | func setupNewUI(model:CNLiveAlbumModel){ |
| 96 | + if model.model == "1" || model.model == "2" || model.model == "3" || model.model == "4"{ | |
| 97 | + //课程-跳转h5网页 | |
| 98 | + self.cellType = .course | |
| 99 | + self.playBtn.setTitle("进入", for: .normal) | |
| 100 | + }else if model.model == "album_ugc"{ | |
| 101 | + //短剧-跳转短剧播放页 | |
| 102 | + self.cellType = .playlet | |
| 103 | + self.playBtn.setTitle("播放", for: .normal) | |
| 104 | + } | |
| 89 | 105 | self.titleLabl.text = model.title |
| 90 | 106 | self.subTitleLabel.text = model.subTitle |
| 91 | 107 | self.iconImgView.kf.setImage(with: URL(string: model.poster)) |
| 92 | 108 | self.titleLabl.width = KSreenWidth-(self.iconImgView.right+15)-80 |
| 93 | 109 | self.playBtn.left = KSreenWidth-80 |
| 94 | 110 | } |
| 95 | - func setupNewUIMsgModel(model:CNLiveAlbumMsgModel){ | |
| 111 | + func setupNewUIMsgModel(model:CNLiveAlbumMsgModel,isDetail:Bool){ | |
| 112 | + | |
| 113 | + //在追短剧model | |
| 96 | 114 | self.titleLabl.text = model.albumName |
| 97 | 115 | self.subTitleLabel.text = model.subTitle |
| 98 | 116 | self.iconImgView.kf.setImage(with: URL(string: model.albumImg)) |
| 99 | 117 | self.titleLabl.width = KSreenWidth-(self.iconImgView.right+15)-80-30 |
| 100 | - self.playBtn.left = KSreenWidth-80-30 | |
| 118 | + if self.isDetail{ | |
| 119 | + self.playBtn.left = KSreenWidth-80 | |
| 120 | + }else{ | |
| 121 | + self.playBtn.left = KSreenWidth-80-30 | |
| 122 | + } | |
| 101 | 123 | } |
| 102 | 124 | @objc func playBtnAction(){ |
| 103 | - showLoading(message: "") | |
| 104 | 125 | var aid = "" |
| 105 | 126 | if self.albumModel != nil{ |
| 106 | 127 | aid = self.albumModel!.contentId |
| ... | ... | @@ -109,56 +130,19 @@ class CNLiveAlbumCell:UITableViewCell{ |
| 109 | 130 | }else{ |
| 110 | 131 | aid = "" |
| 111 | 132 | } |
| 133 | + if (self.albumModel != nil){ | |
| 134 | + if (self.albumModel?.model == "1" || self.albumModel?.model == "2" || self.albumModel?.model == "3" || self.albumModel?.model == "4"){ | |
| 135 | + //课程-跳转h5网页 | |
| 136 | + self.enterBlock!(self.albumModel!) | |
| 137 | + }else if self.albumModel?.model == "album_ugc"{ | |
| 138 | + //短剧-跳转短剧播放页 | |
| 139 | + navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveShortVideoViewController(aid: aid), animated: pushAnimated) | |
| 140 | + } | |
| 141 | + }else if (self.albumMsgModel != nil){ | |
| 142 | + //短剧-跳转短剧播放页 | |
| 143 | + navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveShortVideoViewController(aid: aid), animated: pushAnimated) | |
| 112 | 144 | |
| 113 | - navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveShortVideoViewController(aid: aid), animated: pushAnimated) | |
| 114 | - | |
| 115 | -// self.getAlbumList() | |
| 145 | + } | |
| 146 | + | |
| 116 | 147 | } |
| 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 | -// } | |
| 164 | 148 | } | ... | ... |
metaCode/Classes/Main/HomePages/View/HomepageDetail/CNLiveDuanjuTitleCell.swift
| ... | ... | @@ -3,12 +3,31 @@ |
| 3 | 3 | // metaCode |
| 4 | 4 | // |
| 5 | 5 | // Created by zx on 2024/1/10. |
| 6 | -// 在追短剧详情页-title cell | |
| 6 | +// 在追短剧详情页/全部课程详情页 --title cell | |
| 7 | 7 | |
| 8 | 8 | import Foundation |
| 9 | 9 | |
| 10 | 10 | class CNLiveDuanjuTitleCell:UITableViewCell{ |
| 11 | - | |
| 11 | + var _blockName:String? | |
| 12 | + var blockName:String?{ | |
| 13 | + get{ | |
| 14 | + _blockName | |
| 15 | + } | |
| 16 | + set{ | |
| 17 | + _blockName = newValue! | |
| 18 | + | |
| 19 | + if self.cellType == .course || self.cellType == .playletToCourse{ | |
| 20 | + self.blockTitleLabl.text = _blockName ?? "全部课程" | |
| 21 | + self.blockTitleLabl.top = KStatusBarHeight+10 | |
| 22 | + }else if self.cellType == .playlet{ | |
| 23 | + self.blockTitleLabl.text = _blockName ?? "在追短剧" | |
| 24 | + self.blockTitleLabl.top = 10 | |
| 25 | + | |
| 26 | + } | |
| 27 | + } | |
| 28 | + } | |
| 29 | + var cellType:CNLiveHomePageCellType = .course | |
| 30 | + | |
| 12 | 31 | //MARK: - 懒加载 |
| 13 | 32 | ///区块标题 |
| 14 | 33 | lazy var blockTitleLabl: UILabel = { | ... | ... |
metaCode/Classes/Main/HomePages/ViewModel/CNLiveHomePageViewModel.swift
| ... | ... | @@ -90,7 +90,7 @@ class CNLiveHomePageViewModel:NSObject{ |
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | - /// 获取首页-全部专辑列表 | |
| 93 | + /// 获取首页-全部专辑列表,区块内容分页 | |
| 94 | 94 | static func getBlockContents(blockId:String,page:NSInteger,resultBlock: @escaping downSlideResultBlock) { |
| 95 | 95 | let param = NSMutableDictionary() |
| 96 | 96 | param.setValue(blockId, forKey: "blockId") |
| ... | ... | @@ -105,14 +105,8 @@ class CNLiveHomePageViewModel:NSObject{ |
| 105 | 105 | let errorCode = "\(resp["errorCode"] ?? "0")" |
| 106 | 106 | if (errorCode == "0") { |
| 107 | 107 | let dataDic = resp["data"] as! Dictionary<String, Any> |
| 108 | - let dataList = dataDic["list"] as! Array<Any> | |
| 109 | - var listArr = Array<Any>() | |
| 110 | - for listDic in dataList{ | |
| 111 | - let dataMdl = newDictionaryToModel(listDic as! [String : Any], CNLiveAlbumModel.self) | |
| 112 | - listArr.append(dataMdl) | |
| 113 | - } | |
| 114 | - | |
| 115 | - resultBlock(listArr,.success) | |
| 108 | + let dataMdl = newDictionaryToModel(dataDic , CNLiveAlbumBaseModel.self) | |
| 109 | + resultBlock(dataMdl,.success) | |
| 116 | 110 | } |
| 117 | 111 | else{ |
| 118 | 112 | resultBlock(NSNull(),.failed) | ... | ... |
metaCode/Classes/Main/Util/CNLiveDownSlideTool.swift
| ... | ... | @@ -19,14 +19,11 @@ class CNLiveDownSlideTool:NSObject{ |
| 19 | 19 | let regURL = urlComponents.url |
| 20 | 20 | let webVC = CNWebViewController() |
| 21 | 21 | webVC.url = regURL |
| 22 | - navigationViewController().pushViewController(webVC, animated: pushAnimated) | |
| 23 | -// currentViewController()?.navigationController?.pushViewController(webVC, animated: pushAnimated) | |
| 24 | - | |
| 22 | + navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) | |
| 25 | 23 | }else if (contentMdl.model == kCNDownSlideContentsModelModel3) || (contentMdl.model == kCNDownSlideContentsModelModel4){ |
| 26 | 24 | let webVC = CNWebViewController() |
| 27 | 25 | webVC.url = URL(string: (contentMdl.thirdUrl)!) |
| 28 | - navigationViewController().pushViewController(webVC, animated: pushAnimated) | |
| 29 | -// currentViewController()?.navigationController?.pushViewController(webVC, animated: pushAnimated) | |
| 26 | + navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) | |
| 30 | 27 | }else if (contentMdl.model == kCNDownSlideContentsModelModelAlbum) || (contentMdl.model == kCNDownSlideContentsModelModelAlbum_ugc) || (contentMdl.model == kCNDownSlideContentsModelModelAlbum_video){ |
| 31 | 28 | |
| 32 | 29 | let urlString = "http://wjjh5.cnlive.com/cnYmAlbumVideoList.html" |
| ... | ... | @@ -37,8 +34,38 @@ class CNLiveDownSlideTool:NSObject{ |
| 37 | 34 | let regURL = urlComponents?.url |
| 38 | 35 | let webVC = CNWebViewController() |
| 39 | 36 | webVC.url = regURL |
| 40 | - navigationViewController().pushViewController(webVC, animated: pushAnimated) | |
| 41 | -// currentViewController()?.navigationController?.pushViewController(webVC, animated: pushAnimated) | |
| 37 | + navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) | |
| 38 | + }else{ | |
| 39 | + return | |
| 40 | + } | |
| 41 | + } | |
| 42 | + class func pushWebVCWithCNLiveAlbumMdl(albumModel:CNLiveAlbumModel,controller:UIViewController){ | |
| 43 | + | |
| 44 | + if (albumModel.model == kCNDownSlideContentsModelModel1) || (albumModel.model == kCNDownSlideContentsModelModel2){ | |
| 45 | + | |
| 46 | + let queryItem = URLQueryItem(name: "contentId", value: albumModel.contentId) | |
| 47 | + let queryItem1 = URLQueryItem(name: "videoId", value: albumModel.pid) | |
| 48 | + let urlComponents = NSURLComponents(string: (albumModel.shareUrl))! | |
| 49 | + urlComponents.queryItems = [queryItem, queryItem1] | |
| 50 | + let regURL = urlComponents.url | |
| 51 | + let webVC = CNWebViewController() | |
| 52 | + webVC.url = regURL | |
| 53 | + controller.navigationController?.pushViewController(webVC, animated: pushAnimated) | |
| 54 | + }else if (albumModel.model == kCNDownSlideContentsModelModel3) || (albumModel.model == kCNDownSlideContentsModelModel4){ | |
| 55 | + let webVC = CNWebViewController() | |
| 56 | + webVC.url = URL(string: (albumModel.thirdUrl)) | |
| 57 | + controller.navigationController?.pushViewController(webVC, animated: pushAnimated) | |
| 58 | + }else if (albumModel.model == kCNDownSlideContentsModelModelAlbum) || (albumModel.model == kCNDownSlideContentsModelModelAlbum_ugc) || (albumModel.model == kCNDownSlideContentsModelModelAlbum_video){ | |
| 59 | + | |
| 60 | + let urlString = "http://wjjh5.cnlive.com/cnYmAlbumVideoList.html" | |
| 61 | + let queryItem = URLQueryItem(name: "aid", value: albumModel.contentId) | |
| 62 | + let queryItem1 = URLQueryItem(name: "title", value: albumModel.title) | |
| 63 | + let urlComponents = NSURLComponents(string: urlString) | |
| 64 | + urlComponents!.queryItems = [queryItem, queryItem1] | |
| 65 | + let regURL = urlComponents?.url | |
| 66 | + let webVC = CNWebViewController() | |
| 67 | + webVC.url = regURL | |
| 68 | + navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) | |
| 42 | 69 | }else{ |
| 43 | 70 | return |
| 44 | 71 | } | ... | ... |
metaCode/Classes/Main/Util/CNUpSlideAnimationTransition.swift
| ... | ... | @@ -17,8 +17,9 @@ enum AnimationType { |
| 17 | 17 | |
| 18 | 18 | class CNUpSlideAnimationTransition: NSObject { |
| 19 | 19 | let animationType: AnimationType! |
| 20 | - | |
| 21 | - init(animationType: AnimationType) { | |
| 20 | + var cellType:CNLiveHomePageCellType = .course | |
| 21 | + init(animationType: AnimationType,cellType:CNLiveHomePageCellType) { | |
| 22 | + self.cellType = cellType | |
| 22 | 23 | self.animationType = animationType |
| 23 | 24 | super.init() |
| 24 | 25 | } |
| ... | ... | @@ -39,48 +40,185 @@ extension CNUpSlideAnimationTransition: UIViewControllerAnimatedTransitioning { |
| 39 | 40 | |
| 40 | 41 | func animationForPresent(using transitionContext: UIViewControllerContextTransitioning) { |
| 41 | 42 | let containerView = transitionContext.containerView |
| 42 | - //1.Get fromVC and toVC | |
| 43 | - guard let fromVC = transitionContext.viewController(forKey: .from) as? CNUpSlideViewController else { return } | |
| 44 | - guard let toNaviVC = transitionContext.viewController(forKey: .to) as? CNSlideBaseNavigationController else { return } | |
| 45 | - guard let selectedCell = fromVC.selectedCell else { return } | |
| 46 | - let toVC = toNaviVC.topViewController as! CNUpSlideDetailViewController | |
| 47 | - let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: fromVC.view) | |
| 48 | - //2.Set presentation original size. | |
| 49 | - toVC.view.frame = frame | |
| 50 | - toVC.scrollView.imageView.frame.size.width = GlobalConstants.todayCardSize.width | |
| 51 | - toVC.scrollView.imageView.frame.size.height = GlobalConstants.todayCardSize.height | |
| 52 | - | |
| 53 | - containerView.addSubview(toNaviVC.view) | |
| 54 | 43 | |
| 55 | - //3.Change original size to final size with animation. | |
| 56 | - UIView.animate(withDuration: transitonDuration, delay: 0, usingSpringWithDamping: 0.5, initialSpringVelocity: 0, options: [], animations: { | |
| 57 | - toVC.view.frame = UIScreen.main.bounds | |
| 58 | - toVC.scrollView.imageView.frame.size.width = KSreenWidth | |
| 59 | - toVC.scrollView.imageView.frame.size.height = KSreenWidth*DownSlideSingleCourseImgH/DownSlideSingleCourseW | |
| 60 | - toVC.closeBtn.alpha = 1 | |
| 44 | + if self.cellType == .playlet{ | |
| 45 | + //1.Get fromVC and toVC | |
| 46 | + guard let fromVCtemp = transitionContext.viewController(forKey: .from) as? CNLiveBaseTabBarViewController else { return } | |
| 47 | + let fromNavi = fromVCtemp.viewControllers![0] as! CNLiveBaseNavigationController | |
| 48 | + let fromVC = fromNavi.viewControllers.first as! CNLiveAuthViewController | |
| 49 | + guard let toNaviVC = transitionContext.viewController(forKey: .to) as? CNSlideBaseNavigationController else { return } | |
| 50 | + if toNaviVC.topViewController is CNUpSlideDetailViewController{ | |
| 51 | + guard let selectedCell = fromVC.selectedCell else { return } | |
| 52 | + let toVC = toNaviVC.topViewController as! CNUpSlideDetailViewController | |
| 53 | + let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: fromVC.view) | |
| 54 | + //2.Set presentation original size. | |
| 55 | + toVC.view.frame = frame | |
| 56 | + toVC.scrollView.imageView.frame.size.width = GlobalConstants.todayCardSize.width | |
| 57 | + toVC.scrollView.imageView.frame.size.height = GlobalConstants.todayCardSize.height | |
| 58 | + | |
| 59 | + containerView.addSubview(toNaviVC.view) | |
| 60 | + | |
| 61 | + //3.Change original size to final size with animation. | |
| 62 | + UIView.animate(withDuration: transitonDuration, delay: 0, usingSpringWithDamping: 0.5, initialSpringVelocity: 0, options: [], animations: { | |
| 63 | + toVC.view.frame = UIScreen.main.bounds | |
| 64 | + toVC.scrollView.imageView.frame.size.width = KSreenWidth | |
| 65 | + toVC.scrollView.imageView.frame.size.height = KSreenWidth*DownSlideSingleCourseImgH/DownSlideSingleCourseW | |
| 66 | + toVC.closeBtn.alpha = 1 | |
| 67 | + | |
| 68 | + }) { (completed) in | |
| 69 | + transitionContext.completeTransition(completed) | |
| 70 | + } | |
| 71 | + }else if toNaviVC.topViewController is CNHomepageDuanJuDetailViewController{ | |
| 72 | + guard let selectedCell = fromVC.selectedDuanjuCell else { return } | |
| 73 | + let toVC = toNaviVC.topViewController as! CNHomepageDuanJuDetailViewController | |
| 74 | + let frame = selectedCell.convert(selectedCell.totalView.frame, to: fromVC.view) | |
| 75 | + //2.Set presentation original size. | |
| 76 | + toVC.view.frame = frame | |
| 77 | + containerView.addSubview(toNaviVC.view) | |
| 78 | + | |
| 79 | + //3.Change original size to final size with animation. | |
| 80 | + UIView.animate(withDuration: transitonDuration, delay: 0, usingSpringWithDamping: 0.5, initialSpringVelocity: 0, options: [], animations: { | |
| 81 | + toVC.view.frame = UIScreen.main.bounds | |
| 82 | + toVC.closeBtn.alpha = 1 | |
| 83 | + | |
| 84 | + }) { (completed) in | |
| 85 | + transitionContext.completeTransition(completed) | |
| 86 | + } | |
| 87 | + }else{ | |
| 88 | + return | |
| 89 | + } | |
| 90 | + }else if self.cellType == .course{ | |
| 91 | + //1.Get fromVC and toVC | |
| 92 | + guard let fromVC = transitionContext.viewController(forKey: .from) as? CNUpSlideViewController else { return } | |
| 93 | + guard let toNaviVC = transitionContext.viewController(forKey: .to) as? CNSlideBaseNavigationController else { return } | |
| 94 | + guard let selectedCell = fromVC.selectedCell else { return } | |
| 95 | + let toVC = toNaviVC.topViewController as! CNUpSlideDetailViewController | |
| 96 | + let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: fromVC.view) | |
| 97 | + //2.Set presentation original size. | |
| 98 | + toVC.view.frame = frame | |
| 99 | + toVC.scrollView.imageView.frame.size.width = GlobalConstants.todayCardSize.width | |
| 100 | + toVC.scrollView.imageView.frame.size.height = GlobalConstants.todayCardSize.height | |
| 101 | + | |
| 102 | + containerView.addSubview(toNaviVC.view) | |
| 61 | 103 | |
| 62 | - }) { (completed) in | |
| 63 | - transitionContext.completeTransition(completed) | |
| 104 | + //3.Change original size to final size with animation. | |
| 105 | + UIView.animate(withDuration: transitonDuration, delay: 0, usingSpringWithDamping: 0.5, initialSpringVelocity: 0, options: [], animations: { | |
| 106 | + toVC.view.frame = UIScreen.main.bounds | |
| 107 | + toVC.scrollView.imageView.frame.size.width = KSreenWidth | |
| 108 | + toVC.scrollView.imageView.frame.size.height = KSreenWidth*DownSlideSingleCourseImgH/DownSlideSingleCourseW | |
| 109 | + toVC.closeBtn.alpha = 1 | |
| 110 | + | |
| 111 | + }) { (completed) in | |
| 112 | + transitionContext.completeTransition(completed) | |
| 113 | + } | |
| 114 | + }else if self.cellType == .playletToCourse{ | |
| 115 | + //1.Get fromVC and toVC | |
| 116 | + guard let fromVCtemp = transitionContext.viewController(forKey: .from) as? CNLiveBaseTabBarViewController else { return } | |
| 117 | + let fromNavi = fromVCtemp.viewControllers![0] as! CNLiveBaseNavigationController | |
| 118 | + let fromVC = fromNavi.viewControllers.first as! CNLiveAuthViewController | |
| 119 | +// guard let fromVC = transitionContext.viewController(forKey: .from) as? CNUpSlideViewController else { return } | |
| 120 | + guard let toNaviVC = transitionContext.viewController(forKey: .to) as? CNSlideBaseNavigationController else { return } | |
| 121 | + guard let selectedCell = fromVC.selectedCell else { return } | |
| 122 | + let toVC = toNaviVC.topViewController as! CNUpSlideDetailViewController | |
| 123 | + let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: fromVC.view) | |
| 124 | + //2.Set presentation original size. | |
| 125 | + toVC.view.frame = frame | |
| 126 | + toVC.scrollView.imageView.frame.size.width = GlobalConstants.todayCardSize.width | |
| 127 | + toVC.scrollView.imageView.frame.size.height = GlobalConstants.todayCardSize.height | |
| 128 | + | |
| 129 | + containerView.addSubview(toNaviVC.view) | |
| 130 | + | |
| 131 | + //3.Change original size to final size with animation. | |
| 132 | + UIView.animate(withDuration: transitonDuration, delay: 0, usingSpringWithDamping: 0.5, initialSpringVelocity: 0, options: [], animations: { | |
| 133 | + toVC.view.frame = UIScreen.main.bounds | |
| 134 | + toVC.scrollView.imageView.frame.size.width = KSreenWidth | |
| 135 | + toVC.scrollView.imageView.frame.size.height = KSreenWidth*DownSlideSingleCourseImgH/DownSlideSingleCourseW | |
| 136 | + toVC.closeBtn.alpha = 1 | |
| 137 | + | |
| 138 | + }) { (completed) in | |
| 139 | + transitionContext.completeTransition(completed) | |
| 140 | + } | |
| 64 | 141 | } |
| 65 | 142 | } |
| 66 | 143 | |
| 67 | 144 | func animationForDismiss(using transitionContext: UIViewControllerContextTransitioning) { |
| 68 | - guard let fromNaviVC = transitionContext.viewController(forKey: .from) as? CNSlideBaseNavigationController else { return } | |
| 69 | - guard let toVC = transitionContext.viewController(forKey: .to) as? CNUpSlideViewController else { return } | |
| 70 | - guard let selectedCell = toVC.selectedCell else { return } | |
| 71 | - let fromVC = fromNaviVC.topViewController as! CNUpSlideDetailViewController | |
| 72 | - | |
| 73 | - UIView.animate(withDuration: transitonDuration - 0.3, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { | |
| 74 | - let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: toVC.view) | |
| 75 | - fromVC.view.frame = frame | |
| 76 | - fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius | |
| 77 | - fromVC.scrollView.imageView.frame.size.width = GlobalConstants.todayCardSize.width | |
| 78 | - fromVC.scrollView.imageView.frame.size.height = GlobalConstants.todayCardSize.height | |
| 79 | - fromVC.closeBtn.alpha = 0 | |
| 145 | + if self.cellType == .playlet{ | |
| 146 | + guard let fromNaviVC = transitionContext.viewController(forKey: .from) as? CNSlideBaseNavigationController else { return } | |
| 147 | + guard let toVCTabbar = transitionContext.viewController(forKey: .to) as? CNLiveBaseTabBarViewController else { return } | |
| 148 | + let toVCNav = toVCTabbar.viewControllers?.first as! CNLiveBaseNavigationController | |
| 149 | + let toVC = toVCNav.viewControllers.first as! CNLiveAuthViewController | |
| 150 | + if fromNaviVC.topViewController is CNUpSlideDetailViewController{ | |
| 151 | + guard let selectedCell = toVC.selectedCell else { return } | |
| 152 | + let fromVC = fromNaviVC.topViewController as! CNUpSlideDetailViewController | |
| 153 | + | |
| 154 | + UIView.animate(withDuration: transitonDuration - 0.3, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { | |
| 155 | + let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: toVC.view) | |
| 156 | + fromVC.view.frame = frame | |
| 157 | + fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius | |
| 158 | + fromVC.scrollView.imageView.frame.size.width = GlobalConstants.todayCardSize.width | |
| 159 | + fromVC.scrollView.imageView.frame.size.height = GlobalConstants.todayCardSize.height | |
| 160 | + fromVC.closeBtn.alpha = 0 | |
| 161 | + | |
| 162 | + }) { (completed) in | |
| 163 | + transitionContext.completeTransition(completed) | |
| 164 | + } | |
| 165 | + }else if fromNaviVC.topViewController is CNHomepageDuanJuDetailViewController{ | |
| 166 | + guard let selectedCell = toVC.selectedDuanjuCell else { return } | |
| 167 | + let fromVC = fromNaviVC.topViewController as! CNHomepageDuanJuDetailViewController | |
| 168 | + UIView.animate(withDuration: transitonDuration - 0.3, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { | |
| 169 | + let frame = selectedCell.convert(selectedCell.totalView.frame, to: toVC.view) | |
| 170 | + fromVC.view.frame = frame | |
| 171 | + fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius | |
| 172 | + fromVC.closeBtn.alpha = 0 | |
| 173 | + | |
| 174 | + }) { (completed) in | |
| 175 | + transitionContext.completeTransition(completed) | |
| 176 | + } | |
| 177 | + | |
| 178 | + }else{ | |
| 179 | + return | |
| 180 | + } | |
| 181 | + | |
| 182 | + }else if self.cellType == .course{ | |
| 183 | + guard let fromNaviVC = transitionContext.viewController(forKey: .from) as? CNSlideBaseNavigationController else { return } | |
| 184 | + guard let toVC = transitionContext.viewController(forKey: .to) as? CNUpSlideViewController else { return } | |
| 185 | + guard let selectedCell = toVC.selectedCell else { return } | |
| 186 | + let fromVC = fromNaviVC.topViewController as! CNUpSlideDetailViewController | |
| 187 | + | |
| 188 | + UIView.animate(withDuration: transitonDuration - 0.3, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { | |
| 189 | + let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: toVC.view) | |
| 190 | + fromVC.view.frame = frame | |
| 191 | + fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius | |
| 192 | + fromVC.scrollView.imageView.frame.size.width = GlobalConstants.todayCardSize.width | |
| 193 | + fromVC.scrollView.imageView.frame.size.height = GlobalConstants.todayCardSize.height | |
| 194 | + fromVC.closeBtn.alpha = 0 | |
| 195 | + | |
| 196 | + }) { (completed) in | |
| 197 | + transitionContext.completeTransition(completed) | |
| 198 | + } | |
| 199 | + | |
| 200 | + }else if self.cellType == .playletToCourse{ | |
| 201 | + guard let fromNaviVC = transitionContext.viewController(forKey: .from) as? CNSlideBaseNavigationController else { return } | |
| 202 | + guard let toVCTabbar = transitionContext.viewController(forKey: .to) as? CNLiveBaseTabBarViewController else { return } | |
| 203 | + let toVCNav = toVCTabbar.viewControllers?.first as! CNLiveBaseNavigationController | |
| 204 | + let toVC = toVCNav.viewControllers.first as! CNLiveAuthViewController | |
| 205 | + guard let selectedCell = toVC.selectedCell else { return } | |
| 206 | + let fromVC = fromNaviVC.topViewController as! CNUpSlideDetailViewController | |
| 80 | 207 | |
| 81 | - }) { (completed) in | |
| 82 | - transitionContext.completeTransition(completed) | |
| 208 | + UIView.animate(withDuration: transitonDuration - 0.3, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { | |
| 209 | + let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: toVC.view) | |
| 210 | + fromVC.view.frame = frame | |
| 211 | + fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius | |
| 212 | + fromVC.scrollView.imageView.frame.size.width = GlobalConstants.todayCardSize.width | |
| 213 | + fromVC.scrollView.imageView.frame.size.height = GlobalConstants.todayCardSize.height | |
| 214 | + fromVC.closeBtn.alpha = 0 | |
| 215 | + | |
| 216 | + }) { (completed) in | |
| 217 | + transitionContext.completeTransition(completed) | |
| 218 | + } | |
| 219 | + | |
| 83 | 220 | } |
| 221 | + | |
| 84 | 222 | } |
| 85 | 223 | |
| 86 | 224 | } | ... | ... |
metaCode/Supporting Files/Assets.xcassets/TabBar/tabbar_authentication.imageset/Contents.json
metaCode/Supporting Files/Assets.xcassets/TabBar/tabbar_authentication_unSelect.imageset/Contents.json
metaCode/Supporting Files/Assets.xcassets/TabBar/tabbar_hoem_icon_default.imageset/Contents.json
metaCode/Supporting Files/Assets.xcassets/TabBar/tabbar_hoem_icon_selected.imageset/Contents.json
metaCode/Supporting Files/Assets.xcassets/TabBar/tabbar_mine_icon_default.imageset/Contents.json
metaCode/Supporting Files/Assets.xcassets/TabBar/tabbar_mine_icon_selected.imageset/Contents.json