Commit dd03df68a44f5d212a2a50443e0a712dc90f360b
Merge branch 'master' of http://bj.gitlab.cnlive.com/ios-team/CNLiveMateCode
Showing
25 changed files
with
457 additions
and
163 deletions
metaCode.xcodeproj/project.pbxproj
| @@ -92,6 +92,7 @@ | @@ -92,6 +92,7 @@ | ||
| 92 | 1938BD432B4E34B200390A34 /* CNHomepageDuanJuDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1938BD422B4E34B200390A34 /* CNHomepageDuanJuDetailViewController.swift */; }; | 92 | 1938BD432B4E34B200390A34 /* CNHomepageDuanJuDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1938BD422B4E34B200390A34 /* CNHomepageDuanJuDetailViewController.swift */; }; |
| 93 | 1938BD452B4E49CA00390A34 /* CNLiveDuanjuTitleCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1938BD442B4E49CA00390A34 /* CNLiveDuanjuTitleCell.swift */; }; | 93 | 1938BD452B4E49CA00390A34 /* CNLiveDuanjuTitleCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1938BD442B4E49CA00390A34 /* CNLiveDuanjuTitleCell.swift */; }; |
| 94 | 1938BD472B4FD5A500390A34 /* CNLiveIntegralAlertTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1938BD462B4FD5A500390A34 /* CNLiveIntegralAlertTool.swift */; }; | 94 | 1938BD472B4FD5A500390A34 /* CNLiveIntegralAlertTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1938BD462B4FD5A500390A34 /* CNLiveIntegralAlertTool.swift */; }; |
| 95 | + 194455A12B6B3310006C5A2A /* CNWebView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 194455A02B6B3310006C5A2A /* CNWebView.swift */; }; | ||
| 95 | 19565EC02AF4DE0E007D6727 /* CNLiveShopDetailBtnsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19565EBF2AF4DE0E007D6727 /* CNLiveShopDetailBtnsCell.swift */; }; | 96 | 19565EC02AF4DE0E007D6727 /* CNLiveShopDetailBtnsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19565EBF2AF4DE0E007D6727 /* CNLiveShopDetailBtnsCell.swift */; }; |
| 96 | 19565EC22AF616CA007D6727 /* CNLiveShopDetailOrderAssetCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19565EC12AF616CA007D6727 /* CNLiveShopDetailOrderAssetCell.swift */; }; | 97 | 19565EC22AF616CA007D6727 /* CNLiveShopDetailOrderAssetCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19565EC12AF616CA007D6727 /* CNLiveShopDetailOrderAssetCell.swift */; }; |
| 97 | 19565EC52AF8AD1F007D6727 /* CNLiveShopProductManagerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19565EC42AF8AD1F007D6727 /* CNLiveShopProductManagerController.swift */; }; | 98 | 19565EC52AF8AD1F007D6727 /* CNLiveShopProductManagerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19565EC42AF8AD1F007D6727 /* CNLiveShopProductManagerController.swift */; }; |
| @@ -355,6 +356,7 @@ | @@ -355,6 +356,7 @@ | ||
| 355 | 1938BD422B4E34B200390A34 /* CNHomepageDuanJuDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNHomepageDuanJuDetailViewController.swift; sourceTree = "<group>"; }; | 356 | 1938BD422B4E34B200390A34 /* CNHomepageDuanJuDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNHomepageDuanJuDetailViewController.swift; sourceTree = "<group>"; }; |
| 356 | 1938BD442B4E49CA00390A34 /* CNLiveDuanjuTitleCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDuanjuTitleCell.swift; sourceTree = "<group>"; }; | 357 | 1938BD442B4E49CA00390A34 /* CNLiveDuanjuTitleCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDuanjuTitleCell.swift; sourceTree = "<group>"; }; |
| 357 | 1938BD462B4FD5A500390A34 /* CNLiveIntegralAlertTool.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveIntegralAlertTool.swift; sourceTree = "<group>"; }; | 358 | 1938BD462B4FD5A500390A34 /* CNLiveIntegralAlertTool.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveIntegralAlertTool.swift; sourceTree = "<group>"; }; |
| 359 | + 194455A02B6B3310006C5A2A /* CNWebView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNWebView.swift; sourceTree = "<group>"; }; | ||
| 358 | 19565EBF2AF4DE0E007D6727 /* CNLiveShopDetailBtnsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopDetailBtnsCell.swift; sourceTree = "<group>"; }; | 360 | 19565EBF2AF4DE0E007D6727 /* CNLiveShopDetailBtnsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopDetailBtnsCell.swift; sourceTree = "<group>"; }; |
| 359 | 19565EC12AF616CA007D6727 /* CNLiveShopDetailOrderAssetCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopDetailOrderAssetCell.swift; sourceTree = "<group>"; }; | 361 | 19565EC12AF616CA007D6727 /* CNLiveShopDetailOrderAssetCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopDetailOrderAssetCell.swift; sourceTree = "<group>"; }; |
| 360 | 19565EC42AF8AD1F007D6727 /* CNLiveShopProductManagerController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopProductManagerController.swift; sourceTree = "<group>"; }; | 362 | 19565EC42AF8AD1F007D6727 /* CNLiveShopProductManagerController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopProductManagerController.swift; sourceTree = "<group>"; }; |
| @@ -738,6 +740,7 @@ | @@ -738,6 +740,7 @@ | ||
| 738 | isa = PBXGroup; | 740 | isa = PBXGroup; |
| 739 | children = ( | 741 | children = ( |
| 740 | 19123FC02ABC11170075C883 /* CNWebViewController.swift */, | 742 | 19123FC02ABC11170075C883 /* CNWebViewController.swift */, |
| 743 | + 194455A02B6B3310006C5A2A /* CNWebView.swift */, | ||
| 741 | ); | 744 | ); |
| 742 | path = WebController; | 745 | path = WebController; |
| 743 | sourceTree = "<group>"; | 746 | sourceTree = "<group>"; |
| @@ -1808,6 +1811,7 @@ | @@ -1808,6 +1811,7 @@ | ||
| 1808 | 798A44FF2A30A0A800815935 /* CNLiveInputFeedBackViewController.swift in Sources */, | 1811 | 798A44FF2A30A0A800815935 /* CNLiveInputFeedBackViewController.swift in Sources */, |
| 1809 | 79282A442A2F1C1E00B5F8CF /* CNLiveLoginAuthView.swift in Sources */, | 1812 | 79282A442A2F1C1E00B5F8CF /* CNLiveLoginAuthView.swift in Sources */, |
| 1810 | 79BB96A62AF21E2800AEA4AC /* CNLiveShopOrderDetailViewController.swift in Sources */, | 1813 | 79BB96A62AF21E2800AEA4AC /* CNLiveShopOrderDetailViewController.swift in Sources */, |
| 1814 | + 194455A12B6B3310006C5A2A /* CNWebView.swift in Sources */, | ||
| 1811 | 1938BD2C2B4801A700390A34 /* CNHomePageAnimationTransition.swift in Sources */, | 1815 | 1938BD2C2B4801A700390A34 /* CNHomePageAnimationTransition.swift in Sources */, |
| 1812 | 191733452B284DCD007BCC04 /* CNLiveShopCouponListModel.swift in Sources */, | 1816 | 191733452B284DCD007BCC04 /* CNLiveShopCouponListModel.swift in Sources */, |
| 1813 | 7C2703302A36CBE30061EC50 /* CNCertificationView.swift in Sources */, | 1817 | 7C2703302A36CBE30061EC50 /* CNCertificationView.swift in Sources */, |
| @@ -2074,7 +2078,7 @@ | @@ -2074,7 +2078,7 @@ | ||
| 2074 | CODE_SIGN_ENTITLEMENTS = metaCode/metaCode.entitlements; | 2078 | CODE_SIGN_ENTITLEMENTS = metaCode/metaCode.entitlements; |
| 2075 | CODE_SIGN_IDENTITY = "Apple Development"; | 2079 | CODE_SIGN_IDENTITY = "Apple Development"; |
| 2076 | CODE_SIGN_STYLE = Automatic; | 2080 | CODE_SIGN_STYLE = Automatic; |
| 2077 | - CURRENT_PROJECT_VERSION = 1.0.5.24.01.30.17; | 2081 | + CURRENT_PROJECT_VERSION = 1.0.6.24.02.04.18; |
| 2078 | DEVELOPMENT_TEAM = 94X49GG3ZW; | 2082 | DEVELOPMENT_TEAM = 94X49GG3ZW; |
| 2079 | ENABLE_BITCODE = NO; | 2083 | ENABLE_BITCODE = NO; |
| 2080 | ENABLE_MODULE_VERIFIER = NO; | 2084 | ENABLE_MODULE_VERIFIER = NO; |
| @@ -2128,7 +2132,7 @@ | @@ -2128,7 +2132,7 @@ | ||
| 2128 | ); | 2132 | ); |
| 2129 | GENERATE_INFOPLIST_FILE = YES; | 2133 | GENERATE_INFOPLIST_FILE = YES; |
| 2130 | INFOPLIST_FILE = metaCode/Info.plist; | 2134 | INFOPLIST_FILE = metaCode/Info.plist; |
| 2131 | - INFOPLIST_KEY_CFBundleDisplayName = "元码"; | 2135 | + INFOPLIST_KEY_CFBundleDisplayName = "中国网元码"; |
| 2132 | INFOPLIST_KEY_NSCameraUsageDescription = "需要允许开启相机才能使用上传头像、意见反馈、资质审核等功能"; | 2136 | INFOPLIST_KEY_NSCameraUsageDescription = "需要允许开启相机才能使用上传头像、意见反馈、资质审核等功能"; |
| 2133 | INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "需要允许使用您的位置信息才能获取您所在城市"; | 2137 | INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "需要允许使用您的位置信息才能获取您所在城市"; |
| 2134 | INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "需要允许使用您的位置信息才能获取您所在城市"; | 2138 | INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "需要允许使用您的位置信息才能获取您所在城市"; |
| @@ -2146,7 +2150,7 @@ | @@ -2146,7 +2150,7 @@ | ||
| 2146 | "$(inherited)", | 2150 | "$(inherited)", |
| 2147 | "@executable_path/Frameworks", | 2151 | "@executable_path/Frameworks", |
| 2148 | ); | 2152 | ); |
| 2149 | - MARKETING_VERSION = 1.0.5; | 2153 | + MARKETING_VERSION = 1.0.6; |
| 2150 | OTHER_LDFLAGS = ( | 2154 | OTHER_LDFLAGS = ( |
| 2151 | "$(inherited)", | 2155 | "$(inherited)", |
| 2152 | "-all_load", | 2156 | "-all_load", |
| @@ -2328,7 +2332,7 @@ | @@ -2328,7 +2332,7 @@ | ||
| 2328 | CODE_SIGN_ENTITLEMENTS = metaCode/metaCode.entitlements; | 2332 | CODE_SIGN_ENTITLEMENTS = metaCode/metaCode.entitlements; |
| 2329 | CODE_SIGN_IDENTITY = "Apple Development"; | 2333 | CODE_SIGN_IDENTITY = "Apple Development"; |
| 2330 | CODE_SIGN_STYLE = Automatic; | 2334 | CODE_SIGN_STYLE = Automatic; |
| 2331 | - CURRENT_PROJECT_VERSION = 1.0.5.24.01.30.17; | 2335 | + CURRENT_PROJECT_VERSION = 1.0.6.24.02.04.18; |
| 2332 | DEVELOPMENT_TEAM = 94X49GG3ZW; | 2336 | DEVELOPMENT_TEAM = 94X49GG3ZW; |
| 2333 | ENABLE_BITCODE = NO; | 2337 | ENABLE_BITCODE = NO; |
| 2334 | ENABLE_MODULE_VERIFIER = NO; | 2338 | ENABLE_MODULE_VERIFIER = NO; |
| @@ -2382,7 +2386,7 @@ | @@ -2382,7 +2386,7 @@ | ||
| 2382 | ); | 2386 | ); |
| 2383 | GENERATE_INFOPLIST_FILE = YES; | 2387 | GENERATE_INFOPLIST_FILE = YES; |
| 2384 | INFOPLIST_FILE = metaCode/Info.plist; | 2388 | INFOPLIST_FILE = metaCode/Info.plist; |
| 2385 | - INFOPLIST_KEY_CFBundleDisplayName = "元码"; | 2389 | + INFOPLIST_KEY_CFBundleDisplayName = "中国网元码"; |
| 2386 | INFOPLIST_KEY_NSCameraUsageDescription = "需要允许开启相机才能使用上传头像、意见反馈、资质审核等功能"; | 2390 | INFOPLIST_KEY_NSCameraUsageDescription = "需要允许开启相机才能使用上传头像、意见反馈、资质审核等功能"; |
| 2387 | INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "需要允许使用您的位置信息才能获取您所在城市"; | 2391 | INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "需要允许使用您的位置信息才能获取您所在城市"; |
| 2388 | INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "需要允许使用您的位置信息才能获取您所在城市"; | 2392 | INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "需要允许使用您的位置信息才能获取您所在城市"; |
| @@ -2400,7 +2404,7 @@ | @@ -2400,7 +2404,7 @@ | ||
| 2400 | "$(inherited)", | 2404 | "$(inherited)", |
| 2401 | "@executable_path/Frameworks", | 2405 | "@executable_path/Frameworks", |
| 2402 | ); | 2406 | ); |
| 2403 | - MARKETING_VERSION = 1.0.5; | 2407 | + MARKETING_VERSION = 1.0.6; |
| 2404 | OTHER_LDFLAGS = ( | 2408 | OTHER_LDFLAGS = ( |
| 2405 | "$(inherited)", | 2409 | "$(inherited)", |
| 2406 | "-all_load", | 2410 | "-all_load", |
metaCode/Classes/Common/Util/CNLiveIntegralAlertTool.swift
| @@ -27,6 +27,8 @@ enum CNLiveIntegralPayStatus { | @@ -27,6 +27,8 @@ enum CNLiveIntegralPayStatus { | ||
| 27 | } | 27 | } |
| 28 | typealias integralStatusChangeBlock = (_ integralPayStatus:CNLiveIntegralPayStatus) -> Void | 28 | typealias integralStatusChangeBlock = (_ integralPayStatus:CNLiveIntegralPayStatus) -> Void |
| 29 | 29 | ||
| 30 | +let integralAlertToolTag = 10000 | ||
| 31 | + | ||
| 30 | class CNLiveIntegralAlertTool:NSObject{ | 32 | class CNLiveIntegralAlertTool:NSObject{ |
| 31 | static let shared = CNLiveIntegralAlertTool() | 33 | static let shared = CNLiveIntegralAlertTool() |
| 32 | 34 | ||
| @@ -61,7 +63,7 @@ class CNLiveIntegralAlertTool:NSObject{ | @@ -61,7 +63,7 @@ class CNLiveIntegralAlertTool:NSObject{ | ||
| 61 | bottomBgView.backgroundColor = HexColor("#FFFFFF") | 63 | bottomBgView.backgroundColor = HexColor("#FFFFFF") |
| 62 | bottomBgView.layer.cornerRadius = 9 | 64 | bottomBgView.layer.cornerRadius = 9 |
| 63 | bottomBgView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] | 65 | bottomBgView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] |
| 64 | - bottomBgView.tag = 10000 | 66 | + bottomBgView.tag = integralAlertToolTag |
| 65 | return bottomBgView | 67 | return bottomBgView |
| 66 | }() | 68 | }() |
| 67 | 69 | ||
| @@ -181,7 +183,7 @@ class CNLiveIntegralAlertTool:NSObject{ | @@ -181,7 +183,7 @@ class CNLiveIntegralAlertTool:NSObject{ | ||
| 181 | //隐藏积分购买弹窗 | 183 | //隐藏积分购买弹窗 |
| 182 | func hiddenIntegralAlert(){ | 184 | func hiddenIntegralAlert(){ |
| 183 | delegate.window?.subviews.forEach({ view in | 185 | delegate.window?.subviews.forEach({ view in |
| 184 | - if view.tag == 10000{ | 186 | + if view.tag == integralAlertToolTag{ |
| 185 | UIView.animate(withDuration: 0.25) { | 187 | UIView.animate(withDuration: 0.25) { |
| 186 | view.removeFromSuperview() | 188 | view.removeFromSuperview() |
| 187 | self.bgBtnView.removeFromSuperview() | 189 | self.bgBtnView.removeFromSuperview() |
metaCode/Classes/Config/CNLiveConfigManager.swift
| @@ -91,4 +91,8 @@ extension Notification.Name { | @@ -91,4 +91,8 @@ extension Notification.Name { | ||
| 91 | //销毁播放器通知 | 91 | //销毁播放器通知 |
| 92 | public static let kPlayerDestroyNotification = Notification.Name("kPlayerDestroyNotification") | 92 | public static let kPlayerDestroyNotification = Notification.Name("kPlayerDestroyNotification") |
| 93 | } | 93 | } |
| 94 | + struct AuthVNumPageManage { | ||
| 95 | + //认证页垂直方向是哪个页面的通知 1上面页 2中间页 3下面页 | ||
| 96 | + public static let kAuthVNumPageChangedNotification = Notification.Name("kAuthVNumPageChangedNotification") | ||
| 97 | + } | ||
| 94 | } | 98 | } |
metaCode/Classes/Main/HomePage/Controller/AuthMainController/CNMetaCodeHomePageController.swift
| @@ -223,11 +223,22 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | @@ -223,11 +223,22 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | ||
| 223 | //我的身份排序后刷新 | 223 | //我的身份排序后刷新 |
| 224 | NotificationCenter.default.addObserver(self, selector: #selector(StandAuthNotificationSuccessAction), name: Notification.Name.StandAuth.StandAuthSortNotificationResult, object: nil) | 224 | NotificationCenter.default.addObserver(self, selector: #selector(StandAuthNotificationSuccessAction), name: Notification.Name.StandAuth.StandAuthSortNotificationResult, object: nil) |
| 225 | 225 | ||
| 226 | + //认证页垂直方向是哪个页面的通知 | ||
| 227 | + NotificationCenter.default.addObserver(self, selector: #selector(kAuthVNumPageChangedNotificationAction), name: Notification.Name.AuthVNumPageManage.kAuthVNumPageChangedNotification, object: nil) | ||
| 228 | + | ||
| 226 | // self.tabBarController?.tabBar.top = self.tabBarY + KSreenHeight | 229 | // self.tabBarController?.tabBar.top = self.tabBarY + KSreenHeight |
| 227 | 230 | ||
| 228 | } | 231 | } |
| 229 | override func viewWillAppear(_ animated: Bool) { | 232 | override func viewWillAppear(_ animated: Bool) { |
| 230 | super.viewWillAppear(animated) | 233 | super.viewWillAppear(animated) |
| 234 | +// print("uid = ",UserInfoManager.shared.userInfo.uid) | ||
| 235 | + | ||
| 236 | + } | ||
| 237 | + override func viewDidAppear(_ animated: Bool) { | ||
| 238 | + super.viewDidAppear(animated) | ||
| 239 | + self.view.height = KSreenHeight | ||
| 240 | + self.topNavView.isHidden = true | ||
| 241 | + | ||
| 231 | switch vNumPage { | 242 | switch vNumPage { |
| 232 | case .VNumPageMain://中间主页 | 243 | case .VNumPageMain://中间主页 |
| 233 | self.tabBarController?.tabBar.isHidden = false | 244 | self.tabBarController?.tabBar.isHidden = false |
| @@ -236,16 +247,6 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | @@ -236,16 +247,6 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | ||
| 236 | case .VNumPageDown://下滑页 | 247 | case .VNumPageDown://下滑页 |
| 237 | self.tabBarController?.tabBar.isHidden = true | 248 | self.tabBarController?.tabBar.isHidden = true |
| 238 | } | 249 | } |
| 239 | - | ||
| 240 | - | ||
| 241 | - print("uid = ",UserInfoManager.shared.userInfo.uid) | ||
| 242 | - | ||
| 243 | - } | ||
| 244 | - override func viewDidAppear(_ animated: Bool) { | ||
| 245 | - super.viewDidAppear(animated) | ||
| 246 | - self.view.height = KSreenHeight | ||
| 247 | - | ||
| 248 | - self.topNavView.isHidden = true | ||
| 249 | } | 250 | } |
| 250 | 251 | ||
| 251 | deinit { | 252 | deinit { |
| @@ -309,6 +310,18 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | @@ -309,6 +310,18 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | ||
| 309 | self.getApplyShopInfo() | 310 | self.getApplyShopInfo() |
| 310 | print("DSShopDarenAuthResultNotificationAction") | 311 | print("DSShopDarenAuthResultNotificationAction") |
| 311 | } | 312 | } |
| 313 | + // MARK: - 刷新当前垂直是哪个页面 | ||
| 314 | + @objc func kAuthVNumPageChangedNotificationAction(noti:Notification){ | ||
| 315 | + let dict = (noti.userInfo ?? ["":""]) as! [String :Any] | ||
| 316 | + let num = dict["AuthVNumPage"] as! Int | ||
| 317 | + if num == 1{ | ||
| 318 | + self.vNumPage = .VNumPageDown | ||
| 319 | + }else if num == 2{ | ||
| 320 | + self.vNumPage = .VNumPageMain | ||
| 321 | + }else if num == 3{ | ||
| 322 | + self.vNumPage = .VNumPageUp | ||
| 323 | + } | ||
| 324 | + } | ||
| 312 | 325 | ||
| 313 | 326 | ||
| 314 | 327 | ||
| @@ -418,8 +431,6 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | @@ -418,8 +431,6 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | ||
| 418 | bannerView?.superScrollView = flowView.scrollView | 431 | bannerView?.superScrollView = flowView.scrollView |
| 419 | bannerView?.associatedVCView = self.view | 432 | bannerView?.associatedVCView = self.view |
| 420 | bannerView?.delegate = self | 433 | bannerView?.delegate = self |
| 421 | - bannerView?.upSlideView.webView.navigationDelegate = self | ||
| 422 | - bannerView?.downSlideView.webView.navigationDelegate = self | ||
| 423 | return bannerView | 434 | return bannerView |
| 424 | } | 435 | } |
| 425 | 436 | ||
| @@ -523,10 +534,13 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | @@ -523,10 +534,13 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | ||
| 523 | //慢拖动时处理 | 534 | //慢拖动时处理 |
| 524 | if scrollView.contentOffset.y > 0 && scrollView.contentOffset.y < KSreenHeight/2{ | 535 | if scrollView.contentOffset.y > 0 && scrollView.contentOffset.y < KSreenHeight/2{ |
| 525 | scrollView.setContentOffset(CGPoint(x: scrollView.contentOffset.x, y: 0), animated: true) | 536 | scrollView.setContentOffset(CGPoint(x: scrollView.contentOffset.x, y: 0), animated: true) |
| 537 | + self.vNumPage = .VNumPageDown | ||
| 526 | }else if scrollView.contentOffset.y >= KSreenHeight/2 && scrollView.contentOffset.y < KSreenHeight+KSreenHeight/2{ | 538 | }else if scrollView.contentOffset.y >= KSreenHeight/2 && scrollView.contentOffset.y < KSreenHeight+KSreenHeight/2{ |
| 527 | scrollView.setContentOffset(CGPoint(x: scrollView.contentOffset.x, y: KSreenHeight), animated: true) | 539 | scrollView.setContentOffset(CGPoint(x: scrollView.contentOffset.x, y: KSreenHeight), animated: true) |
| 540 | + self.vNumPage = .VNumPageMain | ||
| 528 | }else if scrollView.contentOffset.y >= KSreenHeight+KSreenHeight/2 && scrollView.contentOffset.y < KSreenHeight*2+KSreenHeight/2{ | 541 | }else if scrollView.contentOffset.y >= KSreenHeight+KSreenHeight/2 && scrollView.contentOffset.y < KSreenHeight*2+KSreenHeight/2{ |
| 529 | scrollView.setContentOffset(CGPoint(x: scrollView.contentOffset.x, y: KSreenHeight*2), animated: true) | 542 | scrollView.setContentOffset(CGPoint(x: scrollView.contentOffset.x, y: KSreenHeight*2), animated: true) |
| 543 | + self.vNumPage = .VNumPageUp | ||
| 530 | }else{ | 544 | }else{ |
| 531 | 545 | ||
| 532 | } | 546 | } |
| @@ -537,7 +551,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | @@ -537,7 +551,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | ||
| 537 | } | 551 | } |
| 538 | func customIndexViewDidEndScroll(scrollView: UIScrollView) { | 552 | func customIndexViewDidEndScroll(scrollView: UIScrollView) { |
| 539 | print("EndScroll\(scrollView.contentOffset.y)") | 553 | print("EndScroll\(scrollView.contentOffset.y)") |
| 540 | - | 554 | + |
| 541 | if scrollView.contentOffset.y == 0{//下滑页 | 555 | if scrollView.contentOffset.y == 0{//下滑页 |
| 542 | self.tabBarController?.tabBar.isHidden = true | 556 | self.tabBarController?.tabBar.isHidden = true |
| 543 | vNumPage = .VNumPageDown | 557 | vNumPage = .VNumPageDown |
| @@ -564,64 +578,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | @@ -564,64 +578,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | ||
| 564 | } | 578 | } |
| 565 | } | 579 | } |
| 566 | } | 580 | } |
| 567 | - | ||
| 568 | - // MARK: - WKWebViewDelegate | ||
| 569 | - // 页面开始加载时调用 | ||
| 570 | - func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) { | ||
| 571 | - print("didStartProvisionalNavigation") | ||
| 572 | - } | ||
| 573 | - // 当内容开始返回时调用 | ||
| 574 | - func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) { | ||
| 575 | - print("didCommit") | ||
| 576 | - } | ||
| 577 | - // 页面加载完成之后调用 | ||
| 578 | - func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { | ||
| 579 | - print("didFinish") | ||
| 580 | - } | ||
| 581 | - // 页面加载失败时调用 | ||
| 582 | - func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) { | ||
| 583 | - print("didFailProvisionalNavigation") | ||
| 584 | - } | ||
| 585 | - // 接收到服务器跳转请求之后调用 | ||
| 586 | - func webView(_ webView: WKWebView, didReceiveServerRedirectForProvisionalNavigation navigation: WKNavigation!) { | ||
| 587 | - print("didReceiveServerRedirectForProvisionalNavigation") | ||
| 588 | - } | ||
| 589 | - // 在收到响应后,决定是否跳转 -> 默认允许 | ||
| 590 | - func webView(_ webView: WKWebView, decidePolicyFor navigationResponse: WKNavigationResponse, decisionHandler: @escaping (WKNavigationResponsePolicy) -> Void) { | ||
| 591 | - print("decidePolicyFor") | ||
| 592 | - //允许跳转 | ||
| 593 | - decisionHandler(.allow) | ||
| 594 | - //不允许跳转 | ||
| 595 | -// decisionHandler(.cancel) | ||
| 596 | - } | ||
| 597 | - // 在发送请求之前,决定是否跳转 -> 默认允许 | ||
| 598 | - @available(iOS 13.0, *) | ||
| 599 | - func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, preferences: WKWebpagePreferences, decisionHandler: @escaping (WKNavigationActionPolicy, WKWebpagePreferences) -> Void) { | ||
| 600 | - print("decidePolicyFor") | ||
| 601 | - let url:String = navigationAction.request.url!.absoluteString | ||
| 602 | - print("navigationAction:\(navigationAction.navigationType.rawValue)") | ||
| 603 | - print(url) | ||
| 604 | - if(navigationAction.navigationType == .linkActivated){ | ||
| 605 | - let webVC = CNWebViewController() | ||
| 606 | - webVC.url = URL(string: url) | ||
| 607 | - navigationViewController().pushViewController(webVC, animated: pushAnimated) | ||
| 608 | -// currentViewController()?.navigationController?.pushViewController(webVC, animated: pushAnimated) | ||
| 609 | - decisionHandler(.cancel, preferences) | ||
| 610 | - return | ||
| 611 | - }else if(navigationAction.navigationType == .other){ | ||
| 612 | - if(url.contains("wjjh5.cnlive.com")){ | ||
| 613 | - | ||
| 614 | - decisionHandler(.allow, preferences) | ||
| 615 | - return | ||
| 616 | - }else | ||
| 617 | - { | ||
| 618 | - decisionHandler(.cancel, preferences) | ||
| 619 | - return | ||
| 620 | - } | ||
| 621 | - } | ||
| 622 | - decisionHandler(.allow, preferences) | ||
| 623 | - } | ||
| 624 | - | 581 | + |
| 625 | //MARK: - 网络请求获取身份列表 | 582 | //MARK: - 网络请求获取身份列表 |
| 626 | func getUserIdentityApi() | 583 | func getUserIdentityApi() |
| 627 | { | 584 | { |
metaCode/Classes/Main/HomePage/Controller/DownSlideController/CNUpSlideDetailViewController.swift
| @@ -100,7 +100,7 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSou | @@ -100,7 +100,7 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSou | ||
| 100 | self.view.layer.masksToBounds = true | 100 | self.view.layer.masksToBounds = true |
| 101 | self.view.backgroundColor = .white | 101 | self.view.backgroundColor = .white |
| 102 | self.view.addSubview(self.tableView) | 102 | self.view.addSubview(self.tableView) |
| 103 | - self.tableView.frame = CGRect(x: 0, y: KStatusBarHeight, width: KSreenWidth, height: KSreenHeight-KStatusBarHeight) | 103 | + self.tableView.frame = CGRect(x: 0, y: 0, width: KSreenWidth, height: KSreenHeight) |
| 104 | view.addSubview(closeBtn) | 104 | view.addSubview(closeBtn) |
| 105 | view.addGestureRecognizer(dismissPanGesture) | 105 | view.addGestureRecognizer(dismissPanGesture) |
| 106 | } | 106 | } |
| @@ -217,6 +217,7 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSou | @@ -217,6 +217,7 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSou | ||
| 217 | return cell | 217 | return cell |
| 218 | } | 218 | } |
| 219 | cell.iconImgView.image = self.cell.bgImageView.image | 219 | cell.iconImgView.image = self.cell.bgImageView.image |
| 220 | + cell.titleLabel.text = self.cell.slideModel?.contents[0].title ?? "" | ||
| 220 | return cell | 221 | return cell |
| 221 | }else if self.cellType == .course || self.cellType == .playletToCourse{ | 222 | }else if self.cellType == .course || self.cellType == .playletToCourse{ |
| 222 | 223 | ||
| @@ -239,6 +240,7 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSou | @@ -239,6 +240,7 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSou | ||
| 239 | return cell | 240 | return cell |
| 240 | } | 241 | } |
| 241 | cell.iconImgView.image = self.cell.bgImageView.image | 242 | cell.iconImgView.image = self.cell.bgImageView.image |
| 243 | + cell.titleLabel.text = self.cell.slideModel?.contents[0].title ?? "" | ||
| 242 | return cell | 244 | return cell |
| 243 | 245 | ||
| 244 | } | 246 | } |
| @@ -269,10 +271,10 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSou | @@ -269,10 +271,10 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSou | ||
| 269 | }else if self.cellType == .course || self.cellType == .playletToCourse{ | 271 | }else if self.cellType == .course || self.cellType == .playletToCourse{ |
| 270 | if self.slideModel?.type == SlideModelTypeAllCourse12{ | 272 | if self.slideModel?.type == SlideModelTypeAllCourse12{ |
| 271 | //全部课程 | 273 | //全部课程 |
| 272 | - return allCourseCellHeight | 274 | + return allCourseCellHeight+get_system_statusBar_height() |
| 273 | }else if self.slideModel?.type == SlideModelTypeOneCourse75{ | 275 | }else if self.slideModel?.type == SlideModelTypeOneCourse75{ |
| 274 | //大图课程 | 276 | //大图课程 |
| 275 | - return KSreenWidth*(KSreenWidth/DownSlideSingleCourseW) | 277 | + return KSreenWidth |
| 276 | } | 278 | } |
| 277 | } | 279 | } |
| 278 | }else{ | 280 | }else{ |
| @@ -281,6 +283,37 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSou | @@ -281,6 +283,37 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSou | ||
| 281 | return 75 | 283 | return 75 |
| 282 | } | 284 | } |
| 283 | 285 | ||
| 286 | + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { | ||
| 287 | + let albumModel = self.dataArray[indexPath.row] as! CNLiveAlbumModel | ||
| 288 | + if indexPath.section == 0{ | ||
| 289 | + if self.cellType == .playlet{ | ||
| 290 | + //短剧大图,跳转播放页 | ||
| 291 | + navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveShortVideoViewController(aid: albumModel.contentId), animated: pushAnimated) | ||
| 292 | + }else if self.cellType == .course || self.cellType == .playletToCourse{ | ||
| 293 | + if self.slideModel?.type == SlideModelTypeAllCourse12{ | ||
| 294 | + //全部课程,跳转h5 | ||
| 295 | + | ||
| 296 | + }else if self.slideModel?.type == SlideModelTypeOneCourse75{ | ||
| 297 | + //大图课程,跳转h5 | ||
| 298 | + CNLiveDownSlideTool.pushWebVCWithCNLiveAlbumMdl(albumModel: albumModel,controller: self) | ||
| 299 | + } | ||
| 300 | + } | ||
| 301 | + }else{ | ||
| 302 | + //视频跳转播放页;课程跳转h5 | ||
| 303 | + if albumModel.model == kCNDownSlideContentsModelModelAlbum_ugc{ | ||
| 304 | + //视频 | ||
| 305 | + //短剧-跳转短剧播放页 | ||
| 306 | + navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveShortVideoViewController(aid: albumModel.contentId), animated: pushAnimated) | ||
| 307 | + | ||
| 308 | + }else if albumModel.model == "1" || albumModel.model == "2" || albumModel.model == "3" || albumModel.model == "4"{ | ||
| 309 | + //课程 | ||
| 310 | + CNLiveDownSlideTool.pushWebVCWithCNLiveAlbumMdl(albumModel: albumModel,controller: self) | ||
| 311 | + }else{ | ||
| 312 | + | ||
| 313 | + } | ||
| 314 | + } | ||
| 315 | + } | ||
| 316 | + | ||
| 284 | // MARK: - 在追短剧--获取全部专辑列表 | 317 | // MARK: - 在追短剧--获取全部专辑列表 |
| 285 | func getBlockContents(page:NSInteger){ | 318 | func getBlockContents(page:NSInteger){ |
| 286 | showLoading(message: "") | 319 | showLoading(message: "") |
metaCode/Classes/Main/HomePage/Controller/DownSlideController/CNUpSlideViewController.swift
| @@ -165,7 +165,7 @@ class CNUpSlideViewController: CNLiveBaseViewController,UITableViewDelegate,UITa | @@ -165,7 +165,7 @@ class CNUpSlideViewController: CNLiveBaseViewController,UITableViewDelegate,UITa | ||
| 165 | ///(3)“album”,“album_video”,“album_ugc” -> http://wjjh5.cnlive.com/cnYmAlbumVideoList.html?aid=contentId&title=titlle | 165 | ///(3)“album”,“album_video”,“album_ugc” -> http://wjjh5.cnlive.com/cnYmAlbumVideoList.html?aid=contentId&title=titlle |
| 166 | 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"{ | 166 | 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"{ |
| 167 | cellType = .course | 167 | cellType = .course |
| 168 | - }else if slideModel.contents.first?.model ?? "0" == "album_ugc"{ | 168 | + }else if slideModel.contents.first?.model ?? "0" == kCNDownSlideContentsModelModelAlbum_ugc{ |
| 169 | cellType = .playlet | 169 | cellType = .playlet |
| 170 | }else{ | 170 | }else{ |
| 171 | //新类型 | 171 | //新类型 |
metaCode/Classes/Main/HomePage/Controller/ShopDownDetail/CNLiveDownShopDetailController.swift
| @@ -26,6 +26,10 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD | @@ -26,6 +26,10 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD | ||
| 26 | let upSlideView = self.view.superview as! CNUpSlideView | 26 | let upSlideView = self.view.superview as! CNUpSlideView |
| 27 | let scrollView = upSlideView.superview as! UIScrollView | 27 | let scrollView = upSlideView.superview as! UIScrollView |
| 28 | scrollView.setContentOffset(CGPoint(x: 0, y: scrollView.height), animated: true) | 28 | scrollView.setContentOffset(CGPoint(x: 0, y: scrollView.height), animated: true) |
| 29 | + | ||
| 30 | + let result:Dictionary = ["AuthVNumPage":2] | ||
| 31 | + NotificationCenter.default.post(name: Notification.Name.AuthVNumPageManage.kAuthVNumPageChangedNotification, object: nil, userInfo: result) | ||
| 32 | + | ||
| 29 | currentViewController()?.tabBarController?.tabBar.isHidden = false | 33 | currentViewController()?.tabBarController?.tabBar.isHidden = false |
| 30 | 34 | ||
| 31 | let metaVC = currentViewController() as! CNMetaCodeHomePageController | 35 | let metaVC = currentViewController() as! CNMetaCodeHomePageController |
| @@ -91,6 +95,9 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD | @@ -91,6 +95,9 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD | ||
| 91 | scrollView.setContentOffset(CGPoint(x: 0, y: scrollView.height), animated: true) | 95 | scrollView.setContentOffset(CGPoint(x: 0, y: scrollView.height), animated: true) |
| 92 | currentViewController()?.tabBarController?.tabBar.isHidden = false | 96 | currentViewController()?.tabBarController?.tabBar.isHidden = false |
| 93 | 97 | ||
| 98 | + let result:Dictionary = ["AuthVNumPage":2] | ||
| 99 | + NotificationCenter.default.post(name: Notification.Name.AuthVNumPageManage.kAuthVNumPageChangedNotification, object: nil, userInfo: result) | ||
| 100 | + | ||
| 94 | let metaVC = currentViewController() as! CNMetaCodeHomePageController | 101 | let metaVC = currentViewController() as! CNMetaCodeHomePageController |
| 95 | let index = metaVC.pageFlowView.currentPageIndex | 102 | let index = metaVC.pageFlowView.currentPageIndex |
| 96 | let customIndexView = metaVC.pageFlowView.viewWithTag(100+index) as! CNCustomIndexView | 103 | let customIndexView = metaVC.pageFlowView.viewWithTag(100+index) as! CNCustomIndexView |
metaCode/Classes/Main/HomePage/Controller/WebController/CNWebView.swift
0 → 100644
| 1 | +// | ||
| 2 | +// CNWebView.swift | ||
| 3 | +// metaCode | ||
| 4 | +// | ||
| 5 | +// Created by zx on 2024/2/1. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +import Foundation | ||
| 9 | +import WebKit | ||
| 10 | +import WebViewJavascriptBridge | ||
| 11 | +import CNLiveShareToolKit | ||
| 12 | +import CommonCrypto | ||
| 13 | +import CNLiveBusinessTools | ||
| 14 | + | ||
| 15 | +class CNWebView:UIView,WKNavigationDelegate{ | ||
| 16 | + | ||
| 17 | + var configuration:WKWebViewConfiguration? | ||
| 18 | + | ||
| 19 | + lazy var cnWebView :WKWebView = { | ||
| 20 | + let cnWebView = WKWebView(frame: self.bounds, configuration: self.configuration!) | ||
| 21 | + return cnWebView | ||
| 22 | + }() | ||
| 23 | + | ||
| 24 | + | ||
| 25 | + var webUrl:URL?//初始URL | ||
| 26 | + var currentUrl:String = ""//当前网页的url | ||
| 27 | + var bridge:WKWebViewJavascriptBridge? | ||
| 28 | + | ||
| 29 | + init(frame: CGRect, configuration: WKWebViewConfiguration ,url:URL?) { | ||
| 30 | + super.init(frame: frame) | ||
| 31 | + self.configuration = configuration | ||
| 32 | + self.addSubview(self.cnWebView) | ||
| 33 | + self.webUrl = url | ||
| 34 | + self.cnWebView.evaluateJavaScript("navigator.userAgent") { [self] result, error in | ||
| 35 | + let userAgent = result as! String | ||
| 36 | + if error == nil && userAgent.count > 0 { | ||
| 37 | + if !userAgent.contains(CNLiveMCEnvironmentManager.shared.base_web_UA) { | ||
| 38 | + let newUserAgent = userAgent + CNLiveMCEnvironmentManager.shared.base_web_UA | ||
| 39 | + self.cnWebView.customUserAgent = newUserAgent | ||
| 40 | + | ||
| 41 | + if (self.webUrl != nil){ | ||
| 42 | + let urlStr = self.checkURLWithStr(urlStr: self.webUrl!.absoluteString) | ||
| 43 | + self.currentUrl = urlStr | ||
| 44 | + | ||
| 45 | + self.cnWebView.load(URLRequest.init(url:URL(string: urlStr)!)) | ||
| 46 | + } | ||
| 47 | + self.configBridge() | ||
| 48 | + self.configBridgeRegister() | ||
| 49 | + } | ||
| 50 | + } | ||
| 51 | + } | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + func configBridge(){ | ||
| 55 | + WKWebViewJavascriptBridge.enableLogging() | ||
| 56 | + self.bridge = WKWebViewJavascriptBridge(for: self.cnWebView) | ||
| 57 | + self.bridge?.setWebViewDelegate(self) | ||
| 58 | + } | ||
| 59 | + //h5拉起原生分享 js call oc | ||
| 60 | + func configBridgeRegister() -> Void { | ||
| 61 | + self.bridge?.registerHandler("wjjylzgVideoShare", handler: { data, responseCallback in | ||
| 62 | +// print("js call oc\(data)") | ||
| 63 | + let dic = data as! Dictionary<String, String> | ||
| 64 | + CNLiveShareManager.showShareViewWithParam(forShareTitle: dic["title"], shareUrl: dic["shareUrl"], shareDesc: dic["subTitle"], shareImage: dic["cover"], screenFull: false, hiddenWjj: true, hiddenQQ: false, hiddenWB: true, hiddenLifeCircle: true, hiddenWechatCircle: false, hiddenWechat: false, hiddenSafari: true, formVC: currentViewController(), topImage: [], topTitles: [], platformType: .all) { title in | ||
| 65 | + | ||
| 66 | + } completerBlock: { resultType, platformType, typeString in | ||
| 67 | + if resultType == .succ{ | ||
| 68 | + | ||
| 69 | + } | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + }) | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + required init?(coder: NSCoder) { | ||
| 76 | + fatalError("init(coder:) has not been implemented") | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + func checkURLWithStr(urlStr:String) -> String{ | ||
| 80 | + if URL(string: urlStr)?.host != WjjH5 { | ||
| 81 | + return urlStr//不是wjjh5不作处理 | ||
| 82 | + } | ||
| 83 | + var str = urlStr | ||
| 84 | + let date = Date() | ||
| 85 | + let formatter = DateFormatter() | ||
| 86 | + formatter.dateFormat = "yyyyMMdd" | ||
| 87 | + let dateStr = formatter.string(from: date) | ||
| 88 | + let sidStr = String(format: "%@%@", UserInfoManager.shared.userInfo.uid,dateStr) | ||
| 89 | + let signStr = sidStr.crypt(operation: CCOperation(kCCEncrypt), key: CNLiveMCEnvironmentManager.shared.appKey) | ||
| 90 | + //看是 appKey还是appKeywjj | ||
| 91 | + let sidSignStr = (signStr ?? "").isEmpty ? "" : signStr | ||
| 92 | + let sourceArray = str.components(separatedBy: "?") | ||
| 93 | + let buildVersion = Bundle.main.infoDictionary!["CFBundleVersion"] as! String | ||
| 94 | + let appVersion = Bundle.main.infoDictionary!["CFBundleShortVersionString"] as! String | ||
| 95 | + let uuid = CNLiveBusinessTools.getUidForStat(Date()) | ||
| 96 | + if sourceArray.count == 1{ | ||
| 97 | + //是wjjh5且无参数 | ||
| 98 | + str = String(format: "%@?shareSid=%@&sid=%@&plat=i&ver=%@&version=%@&wjjFrom=apple&wjjUUID=%@&appId=%@&voteId=%@&wjjToken=%@", str,UserInfoManager.shared.userInfo.uid,UserInfoManager.shared.userInfo.uid,buildVersion,appVersion,uuid,CNLiveMCEnvironmentManager.shared.appId,sidSignStr!,UserInfoManager.shared.userInfo.token) | ||
| 99 | + return str | ||
| 100 | + } | ||
| 101 | + //是wjjh5且有参数 | ||
| 102 | + let paraArr = NSMutableArray(array: ["shareSid=","sid=","plat=","ver=","version=","wjjFrom=","wjjUUID=","appId=","voteId=","wjjToken="]) | ||
| 103 | + let valueArr = NSMutableArray(array:[UserInfoManager.shared.userInfo.uid,UserInfoManager.shared.userInfo.uid,"i",buildVersion,appVersion,"apple",uuid,CNLiveMCEnvironmentManager.shared.appId,sidSignStr!,UserInfoManager.shared.userInfo.token]) | ||
| 104 | + var i = 0 | ||
| 105 | + for paraStr in paraArr{ | ||
| 106 | + let tempStr = paraStr as! String | ||
| 107 | + let paramStr = "&".appending(tempStr) | ||
| 108 | + let paramStr2 = "?".appending(tempStr) | ||
| 109 | + | ||
| 110 | + if str.contains(paramStr){ | ||
| 111 | + //包含则替换 &sid= | ||
| 112 | + let lastStr = str.components(separatedBy: tempStr).last | ||
| 113 | + let lastSeparatedStr = (lastStr?.components(separatedBy: "&").first)! | ||
| 114 | + let oldStr = tempStr.appending(lastSeparatedStr) | ||
| 115 | + let tempValueStr = tempStr.appending(valueArr[i] as! String) | ||
| 116 | + str = str.replacingOccurrences(of: oldStr, with: tempValueStr) | ||
| 117 | + }else if str.contains(paramStr2){ | ||
| 118 | + //包含则替换 &sid= | ||
| 119 | + let lastStr = str.components(separatedBy: tempStr).last | ||
| 120 | + let lastSeparatedStr = (lastStr?.components(separatedBy: "&").first)! | ||
| 121 | + let oldStr = tempStr.appending(lastSeparatedStr) | ||
| 122 | + let tempValueStr = tempStr.appending(valueArr[i] as! String) | ||
| 123 | + str = str.replacingOccurrences(of: oldStr, with: tempValueStr) | ||
| 124 | + }else{ | ||
| 125 | + //不包含则拼接 | ||
| 126 | + str = String(format: "%@&%@%@", str,tempStr,valueArr[i] as! String) | ||
| 127 | + } | ||
| 128 | + i = i + 1 | ||
| 129 | + } | ||
| 130 | + return str | ||
| 131 | + } | ||
| 132 | + | ||
| 133 | + // MARK: - WKWebViewDelegate | ||
| 134 | + // 页面开始加载时调用 | ||
| 135 | + func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) { | ||
| 136 | + print("didStartProvisionalNavigation") | ||
| 137 | + } | ||
| 138 | + // 当内容开始返回时调用 | ||
| 139 | + func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) { | ||
| 140 | + print("didCommit") | ||
| 141 | + } | ||
| 142 | + | ||
| 143 | + // 页面加载完成之后调用 | ||
| 144 | + func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { | ||
| 145 | + print("didFinish") | ||
| 146 | +// titleName = webView.title! | ||
| 147 | + } | ||
| 148 | + // 页面加载失败时调用 | ||
| 149 | + func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) { | ||
| 150 | + print("didFailProvisionalNavigation") | ||
| 151 | + } | ||
| 152 | + // 接收到服务器跳转请求之后调用 | ||
| 153 | + func webView(_ webView: WKWebView, didReceiveServerRedirectForProvisionalNavigation navigation: WKNavigation!) { | ||
| 154 | + print("didReceiveServerRedirectForProvisionalNavigation") | ||
| 155 | + } | ||
| 156 | + // 在收到响应后,决定是否跳转 -> 默认允许 | ||
| 157 | + func webView(_ webView: WKWebView, decidePolicyFor navigationResponse: WKNavigationResponse, decisionHandler: @escaping (WKNavigationResponsePolicy) -> Void) { | ||
| 158 | + | ||
| 159 | + print("decidePolicyFornavigationResponse") | ||
| 160 | + | ||
| 161 | + //允许跳转 | ||
| 162 | + decisionHandler(.allow) | ||
| 163 | + //不允许跳转 | ||
| 164 | + // decisionHandler(.cancel) | ||
| 165 | + } | ||
| 166 | + // 在发送请求之前,决定是否跳转 -> 默认允许 | ||
| 167 | + func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) { | ||
| 168 | + print("decidePolicyFornavigationAction") | ||
| 169 | + | ||
| 170 | + var urlStr = (navigationAction.request.url?.absoluteString)! | ||
| 171 | + | ||
| 172 | + if navigationAction.request.url?.host == WjjH5 { | ||
| 173 | + | ||
| 174 | +// if urlStr.contains("&isWjjReport=true") || urlStr.contains("?isWjjReport=true"){ | ||
| 175 | +// self.rightNavBtns = [self.moreNavBtn] | ||
| 176 | +// self.moreNavBtn.isHidden = false | ||
| 177 | +// }else{ | ||
| 178 | +// self.moreNavBtn.isHidden = true | ||
| 179 | +// } | ||
| 180 | + | ||
| 181 | + urlStr = self.checkURLWithStr(urlStr: urlStr) | ||
| 182 | + self.currentUrl = urlStr | ||
| 183 | + } | ||
| 184 | + | ||
| 185 | + if navigationAction.navigationType == .other{ | ||
| 186 | + //跳转Appstore | ||
| 187 | + let url = URL(string: "https://apps.apple.com/cn/app/%E7%BD%91%E5%AE%B6%E5%AE%B6%E5%95%86%E5%AE%B6%E7%89%88/id1337575497") | ||
| 188 | + if url == navigationAction.request.url { | ||
| 189 | + if UIApplication.shared.canOpenURL(url!) { UIApplication.shared.open(url!, options: [:], completionHandler: nil) | ||
| 190 | + } | ||
| 191 | + } | ||
| 192 | + }else if navigationAction.navigationType == .linkActivated{ | ||
| 193 | + let webVC = CNWebViewController() | ||
| 194 | + webVC.url = URL(string: urlStr) | ||
| 195 | + navigationViewController().pushViewController(webVC, animated: true) | ||
| 196 | + decisionHandler(.cancel) | ||
| 197 | + return | ||
| 198 | + } | ||
| 199 | + | ||
| 200 | + decisionHandler(.allow) | ||
| 201 | + } | ||
| 202 | +} |
metaCode/Classes/Main/HomePage/Controller/WebController/CNWebViewController.swift
| @@ -14,6 +14,7 @@ import CNLiveBusinessTools | @@ -14,6 +14,7 @@ import CNLiveBusinessTools | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | let WjjH5 = "wjjh5.cnlive.com" | 16 | let WjjH5 = "wjjh5.cnlive.com" |
| 17 | +let ManageshopH5 = "manageshop.cnlive.com" | ||
| 17 | 18 | ||
| 18 | class CNWebViewController:CNLiveBaseViewController ,WKNavigationDelegate{ | 19 | class CNWebViewController:CNLiveBaseViewController ,WKNavigationDelegate{ |
| 19 | 20 | ||
| @@ -265,7 +266,14 @@ class CNWebViewController:CNLiveBaseViewController ,WKNavigationDelegate{ | @@ -265,7 +266,14 @@ class CNWebViewController:CNLiveBaseViewController ,WKNavigationDelegate{ | ||
| 265 | } | 266 | } |
| 266 | } | 267 | } |
| 267 | }else if navigationAction.navigationType == .linkActivated{ | 268 | }else if navigationAction.navigationType == .linkActivated{ |
| 268 | - | 269 | + |
| 270 | + //以后可判断h5地址 ,可跳转原生页面或网页 | ||
| 271 | + //暂时只跳h5 | ||
| 272 | + let webVC = CNWebViewController() | ||
| 273 | + webVC.url = URL(string: urlStr) | ||
| 274 | + navigationViewController().pushViewController(webVC, animated: pushAnimated) | ||
| 275 | + decisionHandler(.cancel) | ||
| 276 | + return | ||
| 269 | 277 | ||
| 270 | } | 278 | } |
| 271 | decisionHandler(.allow) | 279 | decisionHandler(.allow) |
metaCode/Classes/Main/HomePage/View/VerticalViews/CNCustomIndexView.swift
| @@ -121,8 +121,8 @@ class CNCustomIndexView:PGIndexBannerSubiew, UIScrollViewDelegate, WJColorChange | @@ -121,8 +121,8 @@ class CNCustomIndexView:PGIndexBannerSubiew, UIScrollViewDelegate, WJColorChange | ||
| 121 | self.upSlideView.type = _idModel?.downType | 121 | self.upSlideView.type = _idModel?.downType |
| 122 | self.upSlideView.downPath = _idModel?.downPath | 122 | self.upSlideView.downPath = _idModel?.downPath |
| 123 | 123 | ||
| 124 | - self.downSlideView.type = _idModel?.upType | ||
| 125 | - self.downSlideView.downPath = _idModel?.upPath | 124 | + self.downSlideView.type = _idModel?.upType |
| 125 | + self.downSlideView.downPath = _idModel?.upPath | ||
| 126 | 126 | ||
| 127 | self.topNavView.setTitleString(title:(_idModel?.name)!) | 127 | self.topNavView.setTitleString(title:(_idModel?.name)!) |
| 128 | 128 | ||
| @@ -192,6 +192,9 @@ class CNCustomIndexView:PGIndexBannerSubiew, UIScrollViewDelegate, WJColorChange | @@ -192,6 +192,9 @@ class CNCustomIndexView:PGIndexBannerSubiew, UIScrollViewDelegate, WJColorChange | ||
| 192 | collectionView.backAction = {[weak self] in | 192 | collectionView.backAction = {[weak self] in |
| 193 | self?.baseScrollView.setContentOffset(CGPoint(x: 0, y: (self!.baseScrollView.height)), animated: true) | 193 | self?.baseScrollView.setContentOffset(CGPoint(x: 0, y: (self!.baseScrollView.height)), animated: true) |
| 194 | currentViewController()?.tabBarController?.tabBar.isHidden = false | 194 | currentViewController()?.tabBarController?.tabBar.isHidden = false |
| 195 | + let vc = currentViewController() as! CNMetaCodeHomePageController | ||
| 196 | + vc.vNumPage = .VNumPageMain | ||
| 197 | + | ||
| 195 | self?.superScrollView?.isScrollEnabled = true | 198 | self?.superScrollView?.isScrollEnabled = true |
| 196 | 199 | ||
| 197 | let time = DispatchTime.now() + 0.5 | 200 | let time = DispatchTime.now() + 0.5 |
| @@ -236,6 +239,8 @@ class CNCustomIndexView:PGIndexBannerSubiew, UIScrollViewDelegate, WJColorChange | @@ -236,6 +239,8 @@ class CNCustomIndexView:PGIndexBannerSubiew, UIScrollViewDelegate, WJColorChange | ||
| 236 | self!.baseScrollView.setContentOffset(CGPoint(x: 0, y: self!.baseScrollView.height), animated: true) | 239 | self!.baseScrollView.setContentOffset(CGPoint(x: 0, y: self!.baseScrollView.height), animated: true) |
| 237 | self?.superScrollView?.isScrollEnabled = true | 240 | self?.superScrollView?.isScrollEnabled = true |
| 238 | currentViewController()?.tabBarController?.tabBar.isHidden = false | 241 | currentViewController()?.tabBarController?.tabBar.isHidden = false |
| 242 | + let vc = currentViewController() as! CNMetaCodeHomePageController | ||
| 243 | + vc.vNumPage = .VNumPageMain | ||
| 239 | } | 244 | } |
| 240 | return topNavView | 245 | return topNavView |
| 241 | }() | 246 | }() |
| @@ -311,8 +316,37 @@ class CNCustomIndexView:PGIndexBannerSubiew, UIScrollViewDelegate, WJColorChange | @@ -311,8 +316,37 @@ class CNCustomIndexView:PGIndexBannerSubiew, UIScrollViewDelegate, WJColorChange | ||
| 311 | /**隐藏左右view*/ | 316 | /**隐藏左右view*/ |
| 312 | let fabsOffset: CGFloat = abs(defaultOffset - currentOffset) | 317 | let fabsOffset: CGFloat = abs(defaultOffset - currentOffset) |
| 313 | 318 | ||
| 314 | - let leftView:UIView? = self.superScrollView?.viewWithTag(tag-1) | ||
| 315 | - let rightView:UIView? = self.superScrollView?.viewWithTag(tag+1) | 319 | + var leftView:CNCustomIndexView? = self.superScrollView?.viewWithTag(tag-1) as? CNCustomIndexView |
| 320 | + var rightView:CNCustomIndexView? = self.superScrollView?.viewWithTag(tag+1) as? CNCustomIndexView | ||
| 321 | + if leftView == nil{ | ||
| 322 | + if let haveSub = self.superScrollView?.subviews.filter({ tempLeftView in | ||
| 323 | + if tempLeftView is CNCustomIndexView && tempLeftView.tag == tag-1{ | ||
| 324 | + leftView = (tempLeftView as! CNCustomIndexView) | ||
| 325 | + return true | ||
| 326 | + }else{ | ||
| 327 | + return false | ||
| 328 | + } | ||
| 329 | + }){ | ||
| 330 | +// print("leftView\(leftView)") | ||
| 331 | + }else{ | ||
| 332 | + | ||
| 333 | + } | ||
| 334 | + } | ||
| 335 | + if rightView == nil{ | ||
| 336 | + if let haveSub = self.superScrollView?.subviews.filter({ tempRightView in | ||
| 337 | + if tempRightView is CNCustomIndexView && tempRightView.tag == tag+1{ | ||
| 338 | + rightView = (tempRightView as! CNCustomIndexView) | ||
| 339 | + return true | ||
| 340 | + }else{ | ||
| 341 | + return false | ||
| 342 | + } | ||
| 343 | + }){ | ||
| 344 | +// print("rightView\(rightView)") | ||
| 345 | + }else{ | ||
| 346 | + | ||
| 347 | + } | ||
| 348 | + } | ||
| 349 | + | ||
| 316 | if fabsOffset > 70 { | 350 | if fabsOffset > 70 { |
| 317 | leftView?.alpha = 0 | 351 | leftView?.alpha = 0 |
| 318 | rightView?.alpha = 0 | 352 | rightView?.alpha = 0 |
metaCode/Classes/Main/HomePage/View/VerticalViews/DownSlide/CNDownSlideSingleCourseCell.swift
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | // metaCode | 3 | // metaCode |
| 4 | // | 4 | // |
| 5 | // Created by zx on 2023/10/16. | 5 | // Created by zx on 2023/10/16. |
| 6 | -// 单课程大图专辑 | 6 | +// 单课程大图专辑 | 全部课程列表 |
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | import Foundation | 9 | import Foundation |
| @@ -128,6 +128,9 @@ class CNDownSlideSingleCourseCell: UITableViewCell { | @@ -128,6 +128,9 @@ class CNDownSlideSingleCourseCell: UITableViewCell { | ||
| 128 | //小icon | 128 | //小icon |
| 129 | let imageView = UIImageView(frame: CGRectMake(DownSlideRecommendLeftGap, titleLbl.bottom+DownSlideRecommendLeftGap+CGFloat(i)*(DownSlideAllCourseRowTopYGap+DownSlideAllCourseRowImageWH+DownSlideAllCourseRowBottomYGap), CGFloat(DownSlideAllCourseRowImageWH), CGFloat(DownSlideAllCourseRowImageWH))) | 129 | let imageView = UIImageView(frame: CGRectMake(DownSlideRecommendLeftGap, titleLbl.bottom+DownSlideRecommendLeftGap+CGFloat(i)*(DownSlideAllCourseRowTopYGap+DownSlideAllCourseRowImageWH+DownSlideAllCourseRowBottomYGap), CGFloat(DownSlideAllCourseRowImageWH), CGFloat(DownSlideAllCourseRowImageWH))) |
| 130 | imageView.kf.setImage(with: URL(string:contentMdl.poster!)) | 130 | imageView.kf.setImage(with: URL(string:contentMdl.poster!)) |
| 131 | + imageView.layer.cornerRadius = 12 | ||
| 132 | + imageView.clipsToBounds = true | ||
| 133 | + imageView.contentMode = .scaleAspectFill | ||
| 131 | bgBackView.addSubview(imageView) | 134 | bgBackView.addSubview(imageView) |
| 132 | 135 | ||
| 133 | let titleLbl = UILabel(frame: CGRect(x: imageView.right+DownSlideRecommendLeftGap, y: imageView.top, width: DownSlideSingleCourseW-90-imageView.right, height: 21)) | 136 | let titleLbl = UILabel(frame: CGRect(x: imageView.right+DownSlideRecommendLeftGap, y: imageView.top, width: DownSlideSingleCourseW-90-imageView.right, height: 21)) |
| @@ -137,7 +140,7 @@ class CNDownSlideSingleCourseCell: UITableViewCell { | @@ -137,7 +140,7 @@ class CNDownSlideSingleCourseCell: UITableViewCell { | ||
| 137 | bgBackView.addSubview(titleLbl) | 140 | bgBackView.addSubview(titleLbl) |
| 138 | 141 | ||
| 139 | let subTitleLbl = UILabel(frame: CGRect(x: titleLbl.left, y:titleLbl.bottom+3 , width: titleLbl.width, height: 17)) | 142 | let subTitleLbl = UILabel(frame: CGRect(x: titleLbl.left, y:titleLbl.bottom+3 , width: titleLbl.width, height: 17)) |
| 140 | - subTitleLbl.text = contentMdl.subTitle ?? "" | 143 | + subTitleLbl.text = contentMdl.subTitle ?? "" |
| 141 | subTitleLbl.font = Font_12 | 144 | subTitleLbl.font = Font_12 |
| 142 | subTitleLbl.textColor = HexColor("#999999") | 145 | subTitleLbl.textColor = HexColor("#999999") |
| 143 | bgBackView.addSubview(subTitleLbl) | 146 | bgBackView.addSubview(subTitleLbl) |
| @@ -202,7 +205,7 @@ class CNDownSlideSingleCourseCell: UITableViewCell { | @@ -202,7 +205,7 @@ class CNDownSlideSingleCourseCell: UITableViewCell { | ||
| 202 | 205 | ||
| 203 | let moreLabel = UILabel(frame: CGRect(x: DownSlideRecommendLeftGap, y: 15, width: DownSlideSingleCourseW - 50 - DownSlideRecommendLeftGap , height: 30)) | 206 | let moreLabel = UILabel(frame: CGRect(x: DownSlideRecommendLeftGap, y: 15, width: DownSlideSingleCourseW - 50 - DownSlideRecommendLeftGap , height: 30)) |
| 204 | moreLabel.text = model.blockName ?? "更多" | 207 | moreLabel.text = model.blockName ?? "更多" |
| 205 | - moreLabel.font = Font_15 | 208 | + moreLabel.font = BoldFont_15_Fit |
| 206 | moreLabel.textColor = HexColor("#333333") | 209 | moreLabel.textColor = HexColor("#333333") |
| 207 | singleCourseBottomView.addSubview(moreLabel) | 210 | singleCourseBottomView.addSubview(moreLabel) |
| 208 | 211 |
metaCode/Classes/Main/HomePage/View/VerticalViews/DownSlide/CNDownSlideView.swift
| @@ -23,28 +23,30 @@ class CNDownSlideView:UIView{ | @@ -23,28 +23,30 @@ class CNDownSlideView:UIView{ | ||
| 23 | let contentView = UIView.init(frame: CGRect(x: 0, y: 0, width: self.width, height: self.height)) | 23 | let contentView = UIView.init(frame: CGRect(x: 0, y: 0, width: self.width, height: self.height)) |
| 24 | contentView.backgroundColor = UIColor.clear | 24 | contentView.backgroundColor = UIColor.clear |
| 25 | contentView.isUserInteractionEnabled = true | 25 | contentView.isUserInteractionEnabled = true |
| 26 | -// let path:UIBezierPath = UIBezierPath.init(roundedRect: contentView.bounds, byRoundingCorners: [.bottomLeft, .bottomRight], cornerRadii: CGSize.init(width: 20, height: 20)) | ||
| 27 | -// | ||
| 28 | -// let maskLayer:CAShapeLayer = CAShapeLayer() | ||
| 29 | -// maskLayer.frame = contentView.bounds | ||
| 30 | -// maskLayer.path = path.cgPath | ||
| 31 | -// contentView.layer.mask = maskLayer | ||
| 32 | - | ||
| 33 | -// let imageView = UIImageView(frame: CGRect(x: 10, y: 20, width: contentView.width - 20, height: contentView.height - 40)) | ||
| 34 | -// imageView.image = UIImage(named: "homePage_collectMoneyImage") | ||
| 35 | -// contentView.addSubview(imageView) | ||
| 36 | - | ||
| 37 | return contentView | 26 | return contentView |
| 38 | }() | 27 | }() |
| 39 | 28 | ||
| 40 | //h5网页 | 29 | //h5网页 |
| 41 | - // TODO: H:-10原为self.height-KTabBarHeight,但有白条,改成了-10 | ||
| 42 | - lazy var webView: WKWebView = { | ||
| 43 | - let webView = WKWebView.init(frame: CGRectMake(0, 0, self.width, self.height-KTabBarHeight-10)) | ||
| 44 | - webView.scrollView.showsVerticalScrollIndicator = false | ||
| 45 | - webView.scrollView.showsHorizontalScrollIndicator = false | ||
| 46 | - webView.backgroundColor = .clear | ||
| 47 | - webView.isOpaque = false | 30 | + lazy var webView: CNWebView = { |
| 31 | + let configuration = WKWebViewConfiguration() | ||
| 32 | + configuration.allowsInlineMediaPlayback = true | ||
| 33 | + let preferences = WKPreferences() | ||
| 34 | + preferences.javaScriptCanOpenWindowsAutomatically = true | ||
| 35 | + preferences.javaScriptEnabled = true | ||
| 36 | + configuration.preferences.minimumFontSize = 0.0 | ||
| 37 | + configuration.preferences = preferences | ||
| 38 | + configuration.userContentController = WKUserContentController() | ||
| 39 | + | ||
| 40 | + var url:URL? | ||
| 41 | + if (_downPath != ""){ | ||
| 42 | + url = URL.init(string: _downPath!) | ||
| 43 | + }else{ | ||
| 44 | + url = nil | ||
| 45 | + } | ||
| 46 | + let webView = CNWebView(frame: CGRectMake(0, 0, Width, self.height-DownSlideBottomViewHeight), configuration: configuration,url: url) | ||
| 47 | + | ||
| 48 | + webView.cnWebView.scrollView.showsVerticalScrollIndicator = false | ||
| 49 | + webView.cnWebView.scrollView.showsHorizontalScrollIndicator = false | ||
| 48 | return webView | 50 | return webView |
| 49 | }() | 51 | }() |
| 50 | 52 | ||
| @@ -74,12 +76,9 @@ class CNDownSlideView:UIView{ | @@ -74,12 +76,9 @@ class CNDownSlideView:UIView{ | ||
| 74 | // self.subviews.forEach { view in | 76 | // self.subviews.forEach { view in |
| 75 | // view.removeFromSuperview() | 77 | // view.removeFromSuperview() |
| 76 | // }//会删除button | 78 | // }//会删除button |
| 79 | + | ||
| 77 | if(type == UpDownTypeH5){ | 80 | if(type == UpDownTypeH5){ |
| 78 | self.addSubview(self.webView) | 81 | self.addSubview(self.webView) |
| 79 | - if (_downPath != ""){ | ||
| 80 | - let webUrl: URL! = URL.init(string: _downPath!) | ||
| 81 | - webView.load(URLRequest.init(url:webUrl)) | ||
| 82 | - } | ||
| 83 | }else if(type == UpDownTypePage){ | 82 | }else if(type == UpDownTypePage){ |
| 84 | self.addSubview(self.upSlideVC.view) | 83 | self.addSubview(self.upSlideVC.view) |
| 85 | self.upSlideVC.downPath = _downPath | 84 | self.upSlideVC.downPath = _downPath |
| @@ -108,18 +107,6 @@ class CNDownSlideView:UIView{ | @@ -108,18 +107,6 @@ class CNDownSlideView:UIView{ | ||
| 108 | let bottomView = UIView(frame: CGRect(x:0, y:self.height - DownSlideBottomViewHeight, width: self.width, height: DownSlideBottomViewHeight)) | 107 | let bottomView = UIView(frame: CGRect(x:0, y:self.height - DownSlideBottomViewHeight, width: self.width, height: DownSlideBottomViewHeight)) |
| 109 | bottomView.backgroundColor = HexColor("#FFFFFF") | 108 | bottomView.backgroundColor = HexColor("#FFFFFF") |
| 110 | bottomView.isHidden = true | 109 | bottomView.isHidden = true |
| 111 | - | ||
| 112 | -// let path:UIBezierPath = UIBezierPath.init(roundedRect: bottomView.bounds, byRoundingCorners: [.topLeft, .topRight], cornerRadii: CGSize.init(width: 50, height: 50)) | ||
| 113 | -// let maskLayer:CAShapeLayer = CAShapeLayer() | ||
| 114 | -// maskLayer.frame = bottomView.bounds | ||
| 115 | -// maskLayer.path = path.cgPath | ||
| 116 | -// bottomView.layer.mask = maskLayer | ||
| 117 | -// bottomView.clipsToBounds = true | ||
| 118 | - | ||
| 119 | -// bottomView.layer.cornerRadius = 50 | ||
| 120 | -// bottomView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] | ||
| 121 | - | ||
| 122 | - | ||
| 123 | // 设置阴影效果 | 110 | // 设置阴影效果 |
| 124 | bottomView.layer.masksToBounds = false | 111 | bottomView.layer.masksToBounds = false |
| 125 | //定义view的阴影颜色 | 112 | //定义view的阴影颜色 |
metaCode/Classes/Main/HomePage/View/VerticalViews/MainView/CNMainView.swift
| @@ -140,6 +140,7 @@ class CNFrontMainView : UIView{ | @@ -140,6 +140,7 @@ class CNFrontMainView : UIView{ | ||
| 140 | enterpriseTipsLabel.font = Font(9) | 140 | enterpriseTipsLabel.font = Font(9) |
| 141 | enterpriseTipsLabel.text = "企业认证适合企业、个体工商户申请" | 141 | enterpriseTipsLabel.text = "企业认证适合企业、个体工商户申请" |
| 142 | enterpriseTipsLabel.adjustsFontSizeToFitWidth=true | 142 | enterpriseTipsLabel.adjustsFontSizeToFitWidth=true |
| 143 | + enterpriseTipsLabel.isHidden = true | ||
| 143 | return enterpriseTipsLabel | 144 | return enterpriseTipsLabel |
| 144 | }() | 145 | }() |
| 145 | ///未认证-机构认证提示 | 146 | ///未认证-机构认证提示 |
| @@ -150,6 +151,7 @@ class CNFrontMainView : UIView{ | @@ -150,6 +151,7 @@ class CNFrontMainView : UIView{ | ||
| 150 | agencyTipsLabel.font = Font(9) | 151 | agencyTipsLabel.font = Font(9) |
| 151 | agencyTipsLabel.text = "机构认证适合国家机构、社会组织、高校等申请" | 152 | agencyTipsLabel.text = "机构认证适合国家机构、社会组织、高校等申请" |
| 152 | agencyTipsLabel.adjustsFontSizeToFitWidth=true | 153 | agencyTipsLabel.adjustsFontSizeToFitWidth=true |
| 154 | + agencyTipsLabel.isHidden = true | ||
| 153 | return agencyTipsLabel | 155 | return agencyTipsLabel |
| 154 | }() | 156 | }() |
| 155 | 157 | ||
| @@ -414,6 +416,8 @@ class CNFrontMainView : UIView{ | @@ -414,6 +416,8 @@ class CNFrontMainView : UIView{ | ||
| 414 | if idModel?.id == 9{ | 416 | if idModel?.id == 9{ |
| 415 | //电商 | 417 | //电商 |
| 416 | //隐藏上滑下滑gif | 418 | //隐藏上滑下滑gif |
| 419 | + self.agencyTipsLabel.isHidden = true | ||
| 420 | + self.enterpriseTipsLabel.isHidden = true | ||
| 417 | upMoreGIF.isHidden = true | 421 | upMoreGIF.isHidden = true |
| 418 | downMoreGIF.isHidden = true | 422 | downMoreGIF.isHidden = true |
| 419 | self.addStandBtn.isHidden = false | 423 | self.addStandBtn.isHidden = false |
| @@ -691,6 +695,10 @@ class CNFrontMainView : UIView{ | @@ -691,6 +695,10 @@ class CNFrontMainView : UIView{ | ||
| 691 | let customIndexView = ((self.superview as! CNMainView).superview as! UIScrollView).superview as! CNCustomIndexView | 695 | let customIndexView = ((self.superview as! CNMainView).superview as! UIScrollView).superview as! CNCustomIndexView |
| 692 | let baseScrollView = customIndexView.baseScrollView | 696 | let baseScrollView = customIndexView.baseScrollView |
| 693 | baseScrollView.setContentOffset(CGPoint(x: 0, y: 0), animated: true) | 697 | baseScrollView.setContentOffset(CGPoint(x: 0, y: 0), animated: true) |
| 698 | + | ||
| 699 | + let result:Dictionary = ["AuthVNumPage":1] | ||
| 700 | + NotificationCenter.default.post(name: Notification.Name.AuthVNumPageManage.kAuthVNumPageChangedNotification, object: nil, userInfo: result) | ||
| 701 | + | ||
| 694 | currentViewController()?.tabBarController?.tabBar.isHidden = false | 702 | currentViewController()?.tabBarController?.tabBar.isHidden = false |
| 695 | customIndexView.superScrollView?.isScrollEnabled = true | 703 | customIndexView.superScrollView?.isScrollEnabled = true |
| 696 | 704 | ||
| @@ -703,7 +711,11 @@ class CNFrontMainView : UIView{ | @@ -703,7 +711,11 @@ class CNFrontMainView : UIView{ | ||
| 703 | }else if self.standInfoSubTitleModel?.jumpType == UpDownTypeAuthAlertDown{ | 711 | }else if self.standInfoSubTitleModel?.jumpType == UpDownTypeAuthAlertDown{ |
| 704 | let customIndexView = ((self.superview as! CNMainView).superview as! UIScrollView).superview as! CNCustomIndexView | 712 | let customIndexView = ((self.superview as! CNMainView).superview as! UIScrollView).superview as! CNCustomIndexView |
| 705 | let baseScrollView = customIndexView.baseScrollView | 713 | let baseScrollView = customIndexView.baseScrollView |
| 706 | - baseScrollView.setContentOffset(CGPoint(x: 0, y: (baseScrollView.height*2+KNavigationHeight)), animated: true) | 714 | + baseScrollView.setContentOffset(CGPoint(x: 0, y: (baseScrollView.height*2)), animated: true) |
| 715 | + | ||
| 716 | + let result:Dictionary = ["AuthVNumPage":3] | ||
| 717 | + NotificationCenter.default.post(name: Notification.Name.AuthVNumPageManage.kAuthVNumPageChangedNotification, object: nil, userInfo: result) | ||
| 718 | + | ||
| 707 | currentViewController()?.tabBarController?.tabBar.isHidden = false | 719 | currentViewController()?.tabBarController?.tabBar.isHidden = false |
| 708 | customIndexView.superScrollView?.isScrollEnabled = true | 720 | customIndexView.superScrollView?.isScrollEnabled = true |
| 709 | 721 |
metaCode/Classes/Main/HomePage/View/VerticalViews/UpSlide/CNUpSlideView.swift
| @@ -18,14 +18,30 @@ let UpDownTypeAuthAlertDown = 6///下滑地址 认证-弹窗 | @@ -18,14 +18,30 @@ let UpDownTypeAuthAlertDown = 6///下滑地址 认证-弹窗 | ||
| 18 | ///上滑显示的VIew | 18 | ///上滑显示的VIew |
| 19 | class CNUpSlideView:UIView{ | 19 | class CNUpSlideView:UIView{ |
| 20 | 20 | ||
| 21 | - lazy var webView: WKWebView = { | ||
| 22 | - let webView = WKWebView.init(frame: CGRectMake(10, KNavigationHeight+KStatusBarHeight+10, self.width - 20, self.height-KNavigationHeight-KStatusBarHeight-10)) | ||
| 23 | - webView.scrollView.showsVerticalScrollIndicator = false | ||
| 24 | - webView.scrollView.showsHorizontalScrollIndicator = false | ||
| 25 | - webView.backgroundColor = .clear | ||
| 26 | - webView.layer.cornerRadius = 29 | ||
| 27 | - webView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] | ||
| 28 | - webView.clipsToBounds = true | 21 | + lazy var webView: CNWebView = { |
| 22 | + let configuration = WKWebViewConfiguration() | ||
| 23 | + configuration.allowsInlineMediaPlayback = true | ||
| 24 | + let preferences = WKPreferences() | ||
| 25 | + preferences.javaScriptCanOpenWindowsAutomatically = true | ||
| 26 | + preferences.javaScriptEnabled = true | ||
| 27 | + configuration.preferences.minimumFontSize = 0.0 | ||
| 28 | + configuration.preferences = preferences | ||
| 29 | + configuration.userContentController = WKUserContentController() | ||
| 30 | + | ||
| 31 | + var url:URL? | ||
| 32 | + if (_downPath != ""){ | ||
| 33 | + url = URL.init(string: _downPath!) | ||
| 34 | + }else{ | ||
| 35 | + url = nil | ||
| 36 | + } | ||
| 37 | + let webView = CNWebView(frame: CGRectMake(10, KNavigationHeight+KStatusBarHeight+10, self.width - 20, self.height-KNavigationHeight-KStatusBarHeight-10), configuration: configuration,url: url) | ||
| 38 | + | ||
| 39 | + webView.cnWebView.scrollView.showsVerticalScrollIndicator = false | ||
| 40 | + webView.cnWebView.scrollView.showsHorizontalScrollIndicator = false | ||
| 41 | + webView.cnWebView.backgroundColor = .clear | ||
| 42 | + webView.cnWebView.layer.cornerRadius = 29 | ||
| 43 | + webView.cnWebView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] | ||
| 44 | + webView.cnWebView.clipsToBounds = true | ||
| 29 | return webView | 45 | return webView |
| 30 | }() | 46 | }() |
| 31 | 47 | ||
| @@ -51,10 +67,6 @@ class CNUpSlideView:UIView{ | @@ -51,10 +67,6 @@ class CNUpSlideView:UIView{ | ||
| 51 | } | 67 | } |
| 52 | if(type == UpDownTypeH5){ | 68 | if(type == UpDownTypeH5){ |
| 53 | self.addSubview(self.webView) | 69 | self.addSubview(self.webView) |
| 54 | - if (_downPath != ""){ | ||
| 55 | - let webUrl: URL! = URL.init(string: _downPath!) | ||
| 56 | - webView.load(URLRequest.init(url:webUrl)) | ||
| 57 | - } | ||
| 58 | } | 70 | } |
| 59 | else if(type == UpDownTypePage){ | 71 | else if(type == UpDownTypePage){ |
| 60 | 72 |
metaCode/Classes/Main/HomePages/Controller/AuthController/CNLiveAuthViewController.swift
| @@ -9,7 +9,7 @@ import Foundation | @@ -9,7 +9,7 @@ import Foundation | ||
| 9 | import MJRefresh | 9 | import MJRefresh |
| 10 | class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITableViewDataSource{ | 10 | class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITableViewDataSource{ |
| 11 | 11 | ||
| 12 | - //下滑tableview背景颜色 | 12 | + //下滑tableview背景颜色 浅灰色 |
| 13 | let kCNDownSlideBackgroundColorHex: String = "#F7F8FA" | 13 | let kCNDownSlideBackgroundColorHex: String = "#F7F8FA" |
| 14 | 14 | ||
| 15 | ///CNliveDownSlideModel Type | 15 | ///CNliveDownSlideModel Type |
| @@ -62,7 +62,7 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa | @@ -62,7 +62,7 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa | ||
| 62 | } | 62 | } |
| 63 | override func viewDidLoad() { | 63 | override func viewDidLoad() { |
| 64 | super.viewDidLoad() | 64 | super.viewDidLoad() |
| 65 | - self.view.backgroundColor = .white | 65 | + self.view.backgroundColor = HexColor(kCNDownSlideBackgroundColorHex) |
| 66 | view.addSubview(tableView) | 66 | view.addSubview(tableView) |
| 67 | tableView.frame = CGRect(x: 0, y: KStatusBarHeight, width: KSreenWidth, height: KSreenHeight-DownSlideBottomViewHeight-KStatusBarHeight) | 67 | tableView.frame = CGRect(x: 0, y: KStatusBarHeight, width: KSreenWidth, height: KSreenHeight-DownSlideBottomViewHeight-KStatusBarHeight) |
| 68 | self.addRefreshView() | 68 | self.addRefreshView() |
| @@ -221,7 +221,7 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa | @@ -221,7 +221,7 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa | ||
| 221 | ///(3)“album”,“album_video”,“album_ugc” -> http://wjjh5.cnlive.com/cnYmAlbumVideoList.html?aid=contentId&title=titlle | 221 | ///(3)“album”,“album_video”,“album_ugc” -> http://wjjh5.cnlive.com/cnYmAlbumVideoList.html?aid=contentId&title=titlle |
| 222 | 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 | 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"{ |
| 223 | cellType = .playletToCourse | 223 | cellType = .playletToCourse |
| 224 | - }else if slideModel.contents.first?.model ?? "0" == "album_ugc"{ | 224 | + }else if slideModel.contents.first?.model ?? "0" == kCNDownSlideContentsModelModelAlbum_ugc{ |
| 225 | cellType = .playlet | 225 | cellType = .playlet |
| 226 | }else{ | 226 | }else{ |
| 227 | //新类型 | 227 | //新类型 |
metaCode/Classes/Main/HomePages/Controller/AuthController/push相关/CNHomePageAnimationTransition.swift
| @@ -69,12 +69,12 @@ extension CNHomePageAnimationTransition: UIViewControllerAnimatedTransitioning { | @@ -69,12 +69,12 @@ extension CNHomePageAnimationTransition: UIViewControllerAnimatedTransitioning { | ||
| 69 | if fromNaviVC.topViewController is CNHomepageDuanJuDetailViewController{ | 69 | if fromNaviVC.topViewController is CNHomepageDuanJuDetailViewController{ |
| 70 | guard let selectedCell = toVC.selectedDuanjuCell else { return } | 70 | guard let selectedCell = toVC.selectedDuanjuCell else { return } |
| 71 | let fromVC = fromNaviVC.topViewController as! CNHomepageDuanJuDetailViewController | 71 | let fromVC = fromNaviVC.topViewController as! CNHomepageDuanJuDetailViewController |
| 72 | - UIView.animate(withDuration: transitonDuration - 0.3, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { | 72 | + UIView.animate(withDuration: transitonDuration - 0.8, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { |
| 73 | let frame = selectedCell.convert(selectedCell.totalView.frame, to: toVC.view) | 73 | let frame = selectedCell.convert(selectedCell.totalView.frame, to: toVC.view) |
| 74 | fromVC.view.frame = frame | 74 | fromVC.view.frame = frame |
| 75 | fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius | 75 | fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius |
| 76 | fromVC.closeBtn.alpha = 0 | 76 | fromVC.closeBtn.alpha = 0 |
| 77 | - | 77 | + fromVC.tableView.alpha = 0 |
| 78 | }) { (completed) in | 78 | }) { (completed) in |
| 79 | transitionContext.completeTransition(completed) | 79 | transitionContext.completeTransition(completed) |
| 80 | } | 80 | } |
metaCode/Classes/Main/HomePages/Controller/AuthController/push相关/CNHomepageDuanJuDetailViewController.swift
| @@ -137,6 +137,14 @@ class CNHomepageDuanJuDetailViewController: CNLiveBaseViewController ,UITableVi | @@ -137,6 +137,14 @@ class CNHomepageDuanJuDetailViewController: CNLiveBaseViewController ,UITableVi | ||
| 137 | return cell | 137 | return cell |
| 138 | } | 138 | } |
| 139 | } | 139 | } |
| 140 | + | ||
| 141 | + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { | ||
| 142 | + let albumModel = self.dataArray[indexPath.row] as! CNLiveAlbumMsgModel | ||
| 143 | + //短剧-跳转短剧播放页 | ||
| 144 | + navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveShortVideoViewController(aid: albumModel.albumId), animated: pushAnimated) | ||
| 145 | + | ||
| 146 | + } | ||
| 147 | + | ||
| 140 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { | 148 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { |
| 141 | if indexPath.section == 0{ | 149 | if indexPath.section == 0{ |
| 142 | return 45//10+30+5 | 150 | return 45//10+30+5 |
metaCode/Classes/Main/HomePages/Controller/PlayletHomePage/CNLivePlayletHomePageController.swift
| @@ -167,7 +167,7 @@ class CNLivePlayletHomePageController:CNLiveBaseViewController, UITableViewDataS | @@ -167,7 +167,7 @@ class CNLivePlayletHomePageController:CNLiveBaseViewController, UITableViewDataS | ||
| 167 | } | 167 | } |
| 168 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { | 168 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { |
| 169 | if indexPath.section == 0{ | 169 | if indexPath.section == 0{ |
| 170 | - return 15+147+20+self.jianjieLblHeight+25+39+23.5+15.5 | 170 | + return 15+147+20+self.jianjieLblHeight+25+39+23.5+15.5+18.5 |
| 171 | }else{ | 171 | }else{ |
| 172 | return 75+12*2 | 172 | return 75+12*2 |
| 173 | } | 173 | } |
metaCode/Classes/Main/HomePages/Model/CNLiveAlbumModel.swift
| @@ -36,7 +36,7 @@ class CNLiveAlbumModel:BaseModel{ | @@ -36,7 +36,7 @@ class CNLiveAlbumModel:BaseModel{ | ||
| 36 | var contentId = "" | 36 | var contentId = "" |
| 37 | var pid = "" | 37 | var pid = "" |
| 38 | var tag = "" | 38 | var tag = "" |
| 39 | - var model = "" | 39 | + var model = ""//1,2,3,4课程 album_ugc短剧 |
| 40 | var thirdUrl = "" | 40 | var thirdUrl = "" |
| 41 | var publishTime = "" | 41 | var publishTime = "" |
| 42 | var shareUrl = "" | 42 | var shareUrl = "" |
metaCode/Classes/Main/HomePages/View/HomepageDetail/CNLiveAlbumCell.swift
| @@ -47,6 +47,7 @@ class CNLiveAlbumCell:UITableViewCell{ | @@ -47,6 +47,7 @@ class CNLiveAlbumCell:UITableViewCell{ | ||
| 47 | let iconImgView = UIImageView(frame: CGRect(x: 15, y: 15, width: 45, height: 45)) | 47 | let iconImgView = UIImageView(frame: CGRect(x: 15, y: 15, width: 45, height: 45)) |
| 48 | iconImgView.layer.cornerRadius = 5 | 48 | iconImgView.layer.cornerRadius = 5 |
| 49 | iconImgView.clipsToBounds = true | 49 | iconImgView.clipsToBounds = true |
| 50 | + iconImgView.contentMode = .scaleAspectFill | ||
| 50 | return iconImgView | 51 | return iconImgView |
| 51 | }() | 52 | }() |
| 52 | ///标题 | 53 | ///标题 |
| @@ -60,13 +61,14 @@ class CNLiveAlbumCell:UITableViewCell{ | @@ -60,13 +61,14 @@ class CNLiveAlbumCell:UITableViewCell{ | ||
| 60 | }() | 61 | }() |
| 61 | ///副标题 | 62 | ///副标题 |
| 62 | lazy var subTitleLabel: UILabel = { | 63 | lazy var subTitleLabel: UILabel = { |
| 63 | - let titleLabel = UILabel.init(frame: CGRectMake(self.iconImgView.right+15, self.titleLabl.bottom+5, 60, 17)) | 64 | + let titleLabel = UILabel.init(frame: CGRectMake(self.iconImgView.right+15, self.titleLabl.bottom+5, self.titleLabl.width, 17)) |
| 64 | titleLabel.textColor = HexColor("#999999") | 65 | titleLabel.textColor = HexColor("#999999") |
| 65 | titleLabel.textAlignment = .left | 66 | titleLabel.textAlignment = .left |
| 66 | titleLabel.font = Font_12 | 67 | titleLabel.font = Font_12 |
| 67 | titleLabel.text = "共68集" | 68 | titleLabel.text = "共68集" |
| 68 | return titleLabel | 69 | return titleLabel |
| 69 | }() | 70 | }() |
| 71 | + let playBtnSubLayer = "playBtnSubLayer" | ||
| 70 | lazy var playBtn: QMUIButton = { | 72 | lazy var playBtn: QMUIButton = { |
| 71 | let playBtn = QMUIButton.init(type: .custom) | 73 | let playBtn = QMUIButton.init(type: .custom) |
| 72 | playBtn.frame = CGRect(x: KSreenWidth-80, y: 0, width: 65, height: 26) | 74 | playBtn.frame = CGRect(x: KSreenWidth-80, y: 0, width: 65, height: 26) |
| @@ -75,9 +77,17 @@ class CNLiveAlbumCell:UITableViewCell{ | @@ -75,9 +77,17 @@ class CNLiveAlbumCell:UITableViewCell{ | ||
| 75 | playBtn.clipsToBounds = true | 77 | playBtn.clipsToBounds = true |
| 76 | playBtn.setTitle("播放", for: .normal) | 78 | playBtn.setTitle("播放", for: .normal) |
| 77 | playBtn.setTitleColor(HexColor("#FFFFFF"), for: .normal) | 79 | playBtn.setTitleColor(HexColor("#FFFFFF"), for: .normal) |
| 78 | - playBtn.backgroundColor = HexColor("#609AFF") | ||
| 79 | playBtn.titleLabel?.font = Font_13 | 80 | playBtn.titleLabel?.font = Font_13 |
| 80 | playBtn.addTarget(self, action: #selector(playBtnAction), for: .touchUpInside) | 81 | playBtn.addTarget(self, action: #selector(playBtnAction), for: .touchUpInside) |
| 82 | + | ||
| 83 | + let gradient = CAGradientLayer() | ||
| 84 | + gradient.frame = playBtn.bounds | ||
| 85 | + gradient.colors = [HexColor("#67C5FF")!.cgColor, HexColor("#609AFF")!.cgColor] | ||
| 86 | + gradient.locations = [0, 1] | ||
| 87 | + gradient.startPoint = CGPoint(x: 0, y: 0.5) | ||
| 88 | + gradient.endPoint = CGPoint(x: 0.5, y: 0.5) | ||
| 89 | + gradient.name = playBtnSubLayer | ||
| 90 | + playBtn.layer.insertSublayer(gradient, at: 0) | ||
| 81 | return playBtn | 91 | return playBtn |
| 82 | }() | 92 | }() |
| 83 | override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | 93 | override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { |
| @@ -97,7 +107,7 @@ class CNLiveAlbumCell:UITableViewCell{ | @@ -97,7 +107,7 @@ class CNLiveAlbumCell:UITableViewCell{ | ||
| 97 | //课程-跳转h5网页 | 107 | //课程-跳转h5网页 |
| 98 | self.cellType = .course | 108 | self.cellType = .course |
| 99 | self.playBtn.setTitle("进入", for: .normal) | 109 | self.playBtn.setTitle("进入", for: .normal) |
| 100 | - }else if model.model == "album_ugc"{ | 110 | + }else if model.model == kCNDownSlideContentsModelModelAlbum_ugc{ |
| 101 | //短剧-跳转短剧播放页 | 111 | //短剧-跳转短剧播放页 |
| 102 | self.cellType = .playlet | 112 | self.cellType = .playlet |
| 103 | self.playBtn.setTitle("播放", for: .normal) | 113 | self.playBtn.setTitle("播放", for: .normal) |
| @@ -106,6 +116,7 @@ class CNLiveAlbumCell:UITableViewCell{ | @@ -106,6 +116,7 @@ class CNLiveAlbumCell:UITableViewCell{ | ||
| 106 | self.subTitleLabel.text = model.subTitle | 116 | self.subTitleLabel.text = model.subTitle |
| 107 | self.iconImgView.kf.setImage(with: URL(string: model.poster)) | 117 | self.iconImgView.kf.setImage(with: URL(string: model.poster)) |
| 108 | self.titleLabl.width = KSreenWidth-(self.iconImgView.right+15)-80 | 118 | self.titleLabl.width = KSreenWidth-(self.iconImgView.right+15)-80 |
| 119 | + self.subTitleLabel.width = self.titleLabl.width | ||
| 109 | self.playBtn.left = KSreenWidth-80 | 120 | self.playBtn.left = KSreenWidth-80 |
| 110 | } | 121 | } |
| 111 | func setupNewUIMsgModel(model:CNLiveAlbumMsgModel,isDetail:Bool){ | 122 | func setupNewUIMsgModel(model:CNLiveAlbumMsgModel,isDetail:Bool){ |
| @@ -115,12 +126,14 @@ class CNLiveAlbumCell:UITableViewCell{ | @@ -115,12 +126,14 @@ class CNLiveAlbumCell:UITableViewCell{ | ||
| 115 | self.subTitleLabel.text = model.subTitle | 126 | self.subTitleLabel.text = model.subTitle |
| 116 | self.iconImgView.kf.setImage(with: URL(string: model.albumImg)) | 127 | self.iconImgView.kf.setImage(with: URL(string: model.albumImg)) |
| 117 | self.titleLabl.width = KSreenWidth-(self.iconImgView.right+15)-80-30 | 128 | self.titleLabl.width = KSreenWidth-(self.iconImgView.right+15)-80-30 |
| 129 | + self.subTitleLabel.width = self.titleLabl.width | ||
| 118 | if self.isDetail{ | 130 | if self.isDetail{ |
| 119 | self.playBtn.left = KSreenWidth-80 | 131 | self.playBtn.left = KSreenWidth-80 |
| 120 | }else{ | 132 | }else{ |
| 121 | self.playBtn.left = KSreenWidth-80-30 | 133 | self.playBtn.left = KSreenWidth-80-30 |
| 122 | } | 134 | } |
| 123 | } | 135 | } |
| 136 | + | ||
| 124 | @objc func playBtnAction(){ | 137 | @objc func playBtnAction(){ |
| 125 | var aid = "" | 138 | var aid = "" |
| 126 | if self.albumModel != nil{ | 139 | if self.albumModel != nil{ |
| @@ -134,7 +147,7 @@ class CNLiveAlbumCell:UITableViewCell{ | @@ -134,7 +147,7 @@ class CNLiveAlbumCell:UITableViewCell{ | ||
| 134 | if (self.albumModel?.model == "1" || self.albumModel?.model == "2" || self.albumModel?.model == "3" || self.albumModel?.model == "4"){ | 147 | if (self.albumModel?.model == "1" || self.albumModel?.model == "2" || self.albumModel?.model == "3" || self.albumModel?.model == "4"){ |
| 135 | //课程-跳转h5网页 | 148 | //课程-跳转h5网页 |
| 136 | self.enterBlock!(self.albumModel!) | 149 | self.enterBlock!(self.albumModel!) |
| 137 | - }else if self.albumModel?.model == "album_ugc"{ | 150 | + }else if self.albumModel?.model == kCNDownSlideContentsModelModelAlbum_ugc{ |
| 138 | //短剧-跳转短剧播放页 | 151 | //短剧-跳转短剧播放页 |
| 139 | navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveShortVideoViewController(aid: aid), animated: pushAnimated) | 152 | navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveShortVideoViewController(aid: aid), animated: pushAnimated) |
| 140 | } | 153 | } |
metaCode/Classes/Main/HomePages/View/HomepageDetail/CNLiveAlbumImageCell.swift
| @@ -11,11 +11,18 @@ class CNLiveAlbumImageCell:UITableViewCell{ | @@ -11,11 +11,18 @@ class CNLiveAlbumImageCell:UITableViewCell{ | ||
| 11 | 11 | ||
| 12 | //MARK: - 懒加载 | 12 | //MARK: - 懒加载 |
| 13 | lazy var iconImgView :UIImageView = { | 13 | lazy var iconImgView :UIImageView = { |
| 14 | - let iconImgView = UIImageView(frame: CGRect(x: (KSreenWidth - KSreenWidth*(KSreenWidth/DownSlideSingleCourseW))/2, y: 0, width: KSreenWidth*(KSreenWidth/DownSlideSingleCourseW), height: KSreenWidth*(KSreenWidth/DownSlideSingleCourseW))) | 14 | + let iconImgView = UIImageView(frame: CGRect(x: 0, y: 0, width: KSreenWidth, height: KSreenWidth)) |
| 15 | iconImgView.contentMode = .scaleAspectFill | 15 | iconImgView.contentMode = .scaleAspectFill |
| 16 | return iconImgView | 16 | return iconImgView |
| 17 | }() | 17 | }() |
| 18 | 18 | ||
| 19 | + lazy var titleLabel: UILabel = { | ||
| 20 | + let titleLbl = UILabel(frame: CGRect(x: DownSlideRecommendLeftGap, y: DownSlideRecommendLeftGap+get_system_statusBar_height(), width: KSreenWidth-DownSlideRecommendLeftGap*2, height: 30)) | ||
| 21 | + titleLbl.font = BoldFont_21 | ||
| 22 | + titleLbl.textColor = HexColor("#FFFFFF") | ||
| 23 | + return titleLbl | ||
| 24 | + }() | ||
| 25 | + | ||
| 19 | override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | 26 | override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { |
| 20 | super.init(style: style, reuseIdentifier: reuseIdentifier) | 27 | super.init(style: style, reuseIdentifier: reuseIdentifier) |
| 21 | self.selectionStyle = .none | 28 | self.selectionStyle = .none |
| @@ -29,6 +36,7 @@ class CNLiveAlbumImageCell:UITableViewCell{ | @@ -29,6 +36,7 @@ class CNLiveAlbumImageCell:UITableViewCell{ | ||
| 29 | private func setupUI() { | 36 | private func setupUI() { |
| 30 | contentView.backgroundColor = HexColor(kCNDownSlideBackgroundColorHex) | 37 | contentView.backgroundColor = HexColor(kCNDownSlideBackgroundColorHex) |
| 31 | self.contentView.addSubview(self.iconImgView) | 38 | self.contentView.addSubview(self.iconImgView) |
| 39 | + self.contentView.addSubview(self.titleLabel) | ||
| 32 | self.contentView.clipsToBounds = true | 40 | self.contentView.clipsToBounds = true |
| 33 | } | 41 | } |
| 34 | 42 |
metaCode/Classes/Main/HomePages/View/HomepageDetail/CNLiveDuanjuTitleCell.swift
| @@ -18,11 +18,10 @@ class CNLiveDuanjuTitleCell:UITableViewCell{ | @@ -18,11 +18,10 @@ class CNLiveDuanjuTitleCell:UITableViewCell{ | ||
| 18 | 18 | ||
| 19 | if self.cellType == .course || self.cellType == .playletToCourse{ | 19 | if self.cellType == .course || self.cellType == .playletToCourse{ |
| 20 | self.blockTitleLabl.text = _blockName ?? "全部课程" | 20 | self.blockTitleLabl.text = _blockName ?? "全部课程" |
| 21 | - self.blockTitleLabl.top = (allCourseCellHeight-30)/2 | 21 | + self.blockTitleLabl.top = (allCourseCellHeight-30)/2+get_system_statusBar_height() |
| 22 | }else if self.cellType == .playlet{ | 22 | }else if self.cellType == .playlet{ |
| 23 | self.blockTitleLabl.text = _blockName ?? "在追短剧" | 23 | self.blockTitleLabl.text = _blockName ?? "在追短剧" |
| 24 | self.blockTitleLabl.top = (45-30)/2 | 24 | self.blockTitleLabl.top = (45-30)/2 |
| 25 | - | ||
| 26 | } | 25 | } |
| 27 | } | 26 | } |
| 28 | } | 27 | } |
metaCode/Classes/Main/HomePages/View/PlayletHomePage/CNLivePlayletHomePageCell.swift
| @@ -25,6 +25,7 @@ class CNLivePlayletHomePageCell:UITableViewCell{ | @@ -25,6 +25,7 @@ class CNLivePlayletHomePageCell:UITableViewCell{ | ||
| 25 | lazy var iconImgView :UIImageView = { | 25 | lazy var iconImgView :UIImageView = { |
| 26 | let iconImgView = UIImageView(frame: CGRect(x: 15, y: 12, width: 57, height: 75)) | 26 | let iconImgView = UIImageView(frame: CGRect(x: 15, y: 12, width: 57, height: 75)) |
| 27 | iconImgView.layer.cornerRadius = 5 | 27 | iconImgView.layer.cornerRadius = 5 |
| 28 | + iconImgView.contentMode = .scaleAspectFill | ||
| 28 | iconImgView.clipsToBounds = true | 29 | iconImgView.clipsToBounds = true |
| 29 | return iconImgView | 30 | return iconImgView |
| 30 | }() | 31 | }() |
| @@ -78,7 +79,7 @@ class CNLivePlayletHomePageCell:UITableViewCell{ | @@ -78,7 +79,7 @@ class CNLivePlayletHomePageCell:UITableViewCell{ | ||
| 78 | //付过费 或 免费 | 79 | //付过费 或 免费 |
| 79 | self.payIconImgView.isHidden = true | 80 | self.payIconImgView.isHidden = true |
| 80 | //显示已购买 或者 不显示 | 81 | //显示已购买 或者 不显示 |
| 81 | - if model.product?.productType == "0"{ | 82 | + if model.product?.productType == "0" || model.product?.productType == "4"{ |
| 82 | //免费 | 83 | //免费 |
| 83 | self.payIconImgView.isHidden = true | 84 | self.payIconImgView.isHidden = true |
| 84 | }else if model.product?.productType == "1"{ | 85 | }else if model.product?.productType == "1"{ |
| @@ -90,8 +91,7 @@ class CNLivePlayletHomePageCell:UITableViewCell{ | @@ -90,8 +91,7 @@ class CNLivePlayletHomePageCell:UITableViewCell{ | ||
| 90 | self.payIconImgView.isHidden = false | 91 | self.payIconImgView.isHidden = false |
| 91 | self.payIconImgView.image = UIImage(named: "homePage_payed") | 92 | self.payIconImgView.image = UIImage(named: "homePage_payed") |
| 92 | }else{ | 93 | }else{ |
| 93 | - self.payIconImgView.isHidden = false | ||
| 94 | - self.payIconImgView.image = UIImage(named: "homePage_payed") | 94 | + |
| 95 | } | 95 | } |
| 96 | }else{ | 96 | }else{ |
| 97 | //需要付费 | 97 | //需要付费 |
metaCode/Classes/Main/HomePages/View/PlayletHomePage/CNLivePlayletHomePageHeaderCell.swift
| @@ -41,6 +41,7 @@ class CNLivePlayletHomePageHeaderCell:UITableViewCell{ | @@ -41,6 +41,7 @@ class CNLivePlayletHomePageHeaderCell:UITableViewCell{ | ||
| 41 | lazy var iconImgView :UIImageView = { | 41 | lazy var iconImgView :UIImageView = { |
| 42 | let iconImgView = UIImageView(frame: CGRect(x: 15, y: 20, width: 112, height: 147)) | 42 | let iconImgView = UIImageView(frame: CGRect(x: 15, y: 20, width: 112, height: 147)) |
| 43 | iconImgView.layer.cornerRadius = 5 | 43 | iconImgView.layer.cornerRadius = 5 |
| 44 | + iconImgView.contentMode = .scaleAspectFill | ||
| 44 | iconImgView.clipsToBounds = true | 45 | iconImgView.clipsToBounds = true |
| 45 | return iconImgView | 46 | return iconImgView |
| 46 | }() | 47 | }() |
metaCode/Classes/Main/Util/CNUpSlideAnimationTransition.swift
| @@ -151,26 +151,26 @@ extension CNUpSlideAnimationTransition: UIViewControllerAnimatedTransitioning { | @@ -151,26 +151,26 @@ extension CNUpSlideAnimationTransition: UIViewControllerAnimatedTransitioning { | ||
| 151 | guard let selectedCell = toVC.selectedCell else { return } | 151 | guard let selectedCell = toVC.selectedCell else { return } |
| 152 | let fromVC = fromNaviVC.topViewController as! CNUpSlideDetailViewController | 152 | let fromVC = fromNaviVC.topViewController as! CNUpSlideDetailViewController |
| 153 | 153 | ||
| 154 | - UIView.animate(withDuration: transitonDuration - 0.3, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { | 154 | + UIView.animate(withDuration: transitonDuration - 0.8, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { |
| 155 | let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: toVC.view) | 155 | let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: toVC.view) |
| 156 | fromVC.view.frame = frame | 156 | fromVC.view.frame = frame |
| 157 | fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius | 157 | fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius |
| 158 | fromVC.scrollView.imageView.frame.size.width = GlobalConstants.todayCardSize.width | 158 | fromVC.scrollView.imageView.frame.size.width = GlobalConstants.todayCardSize.width |
| 159 | fromVC.scrollView.imageView.frame.size.height = GlobalConstants.todayCardSize.height | 159 | fromVC.scrollView.imageView.frame.size.height = GlobalConstants.todayCardSize.height |
| 160 | fromVC.closeBtn.alpha = 0 | 160 | fromVC.closeBtn.alpha = 0 |
| 161 | - | 161 | + fromVC.tableView.alpha = 0 |
| 162 | }) { (completed) in | 162 | }) { (completed) in |
| 163 | transitionContext.completeTransition(completed) | 163 | transitionContext.completeTransition(completed) |
| 164 | } | 164 | } |
| 165 | }else if fromNaviVC.topViewController is CNHomepageDuanJuDetailViewController{ | 165 | }else if fromNaviVC.topViewController is CNHomepageDuanJuDetailViewController{ |
| 166 | guard let selectedCell = toVC.selectedDuanjuCell else { return } | 166 | guard let selectedCell = toVC.selectedDuanjuCell else { return } |
| 167 | let fromVC = fromNaviVC.topViewController as! CNHomepageDuanJuDetailViewController | 167 | let fromVC = fromNaviVC.topViewController as! CNHomepageDuanJuDetailViewController |
| 168 | - UIView.animate(withDuration: transitonDuration - 0.3, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { | 168 | + UIView.animate(withDuration: transitonDuration - 0.8, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { |
| 169 | let frame = selectedCell.convert(selectedCell.totalView.frame, to: toVC.view) | 169 | let frame = selectedCell.convert(selectedCell.totalView.frame, to: toVC.view) |
| 170 | fromVC.view.frame = frame | 170 | fromVC.view.frame = frame |
| 171 | fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius | 171 | fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius |
| 172 | fromVC.closeBtn.alpha = 0 | 172 | fromVC.closeBtn.alpha = 0 |
| 173 | - | 173 | + fromVC.tableView.alpha = 0 |
| 174 | }) { (completed) in | 174 | }) { (completed) in |
| 175 | transitionContext.completeTransition(completed) | 175 | transitionContext.completeTransition(completed) |
| 176 | } | 176 | } |
| @@ -185,14 +185,14 @@ extension CNUpSlideAnimationTransition: UIViewControllerAnimatedTransitioning { | @@ -185,14 +185,14 @@ extension CNUpSlideAnimationTransition: UIViewControllerAnimatedTransitioning { | ||
| 185 | guard let selectedCell = toVC.selectedCell else { return } | 185 | guard let selectedCell = toVC.selectedCell else { return } |
| 186 | let fromVC = fromNaviVC.topViewController as! CNUpSlideDetailViewController | 186 | let fromVC = fromNaviVC.topViewController as! CNUpSlideDetailViewController |
| 187 | 187 | ||
| 188 | - UIView.animate(withDuration: transitonDuration - 0.3, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { | 188 | + UIView.animate(withDuration: transitonDuration - 0.8, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { |
| 189 | let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: toVC.view) | 189 | let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: toVC.view) |
| 190 | fromVC.view.frame = frame | 190 | fromVC.view.frame = frame |
| 191 | fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius | 191 | fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius |
| 192 | fromVC.scrollView.imageView.frame.size.width = GlobalConstants.todayCardSize.width | 192 | fromVC.scrollView.imageView.frame.size.width = GlobalConstants.todayCardSize.width |
| 193 | fromVC.scrollView.imageView.frame.size.height = GlobalConstants.todayCardSize.height | 193 | fromVC.scrollView.imageView.frame.size.height = GlobalConstants.todayCardSize.height |
| 194 | fromVC.closeBtn.alpha = 0 | 194 | fromVC.closeBtn.alpha = 0 |
| 195 | - | 195 | + fromVC.tableView.alpha = 0 |
| 196 | }) { (completed) in | 196 | }) { (completed) in |
| 197 | transitionContext.completeTransition(completed) | 197 | transitionContext.completeTransition(completed) |
| 198 | } | 198 | } |
| @@ -205,14 +205,14 @@ extension CNUpSlideAnimationTransition: UIViewControllerAnimatedTransitioning { | @@ -205,14 +205,14 @@ extension CNUpSlideAnimationTransition: UIViewControllerAnimatedTransitioning { | ||
| 205 | guard let selectedCell = toVC.selectedCell else { return } | 205 | guard let selectedCell = toVC.selectedCell else { return } |
| 206 | if fromNaviVC.topViewController is CNUpSlideDetailViewController{ | 206 | if fromNaviVC.topViewController is CNUpSlideDetailViewController{ |
| 207 | let fromVC = fromNaviVC.topViewController as! CNUpSlideDetailViewController | 207 | let fromVC = fromNaviVC.topViewController as! CNUpSlideDetailViewController |
| 208 | - UIView.animate(withDuration: transitonDuration - 0.3, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { | 208 | + UIView.animate(withDuration: transitonDuration - 0.8, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { |
| 209 | let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: toVC.view) | 209 | let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: toVC.view) |
| 210 | fromVC.view.frame = frame | 210 | fromVC.view.frame = frame |
| 211 | fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius | 211 | fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius |
| 212 | fromVC.scrollView.imageView.frame.size.width = GlobalConstants.todayCardSize.width | 212 | fromVC.scrollView.imageView.frame.size.width = GlobalConstants.todayCardSize.width |
| 213 | fromVC.scrollView.imageView.frame.size.height = GlobalConstants.todayCardSize.height | 213 | fromVC.scrollView.imageView.frame.size.height = GlobalConstants.todayCardSize.height |
| 214 | fromVC.closeBtn.alpha = 0 | 214 | fromVC.closeBtn.alpha = 0 |
| 215 | - | 215 | + fromVC.tableView.alpha = 0 |
| 216 | }) { (completed) in | 216 | }) { (completed) in |
| 217 | transitionContext.completeTransition(completed) | 217 | transitionContext.completeTransition(completed) |
| 218 | } | 218 | } |