Commit b9f01d495bd1031a164f058645eb636d37d5d76c
1 parent
62fb1aac
游客登录方式登录
播放免费内容-快速点击看点 免费+付费 出现的播放免费内容的bug
Showing
19 changed files
with
217 additions
and
107 deletions
metaCode.xcodeproj/project.pbxproj
| @@ -276,6 +276,7 @@ | @@ -276,6 +276,7 @@ | ||
| 276 | 19FA20192AE22D98001F7186 /* CNLiveDownSlideTodayRecommendCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19FA20182AE22D98001F7186 /* CNLiveDownSlideTodayRecommendCell.swift */; }; | 276 | 19FA20192AE22D98001F7186 /* CNLiveDownSlideTodayRecommendCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19FA20182AE22D98001F7186 /* CNLiveDownSlideTodayRecommendCell.swift */; }; |
| 277 | 19FA201B2AE60423001F7186 /* CNLiveDownSlideModelLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19FA201A2AE60423001F7186 /* CNLiveDownSlideModelLayout.swift */; }; | 277 | 19FA201B2AE60423001F7186 /* CNLiveDownSlideModelLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19FA201A2AE60423001F7186 /* CNLiveDownSlideModelLayout.swift */; }; |
| 278 | 1DD2808DF02C120276F99F4D /* Pods_metaCode.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F1C55A719CFEE073C06D37CE /* Pods_metaCode.framework */; }; | 278 | 1DD2808DF02C120276F99F4D /* Pods_metaCode.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F1C55A719CFEE073C06D37CE /* Pods_metaCode.framework */; }; |
| 279 | + 3D30BC782DBF8A2500CA9AD3 /* CNLiveZFPlayerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D30BC772DBF8A2500CA9AD3 /* CNLiveZFPlayerController.swift */; }; | ||
| 279 | 7905BB492AB0588B0089BC50 /* CNLiveMineAuthResultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7905BB482AB0588B0089BC50 /* CNLiveMineAuthResultViewController.swift */; }; | 280 | 7905BB492AB0588B0089BC50 /* CNLiveMineAuthResultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7905BB482AB0588B0089BC50 /* CNLiveMineAuthResultViewController.swift */; }; |
| 280 | 790B1FB42A4153E90074CF00 /* CNLiveMineBaseModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 790B1FB32A4153E90074CF00 /* CNLiveMineBaseModel.swift */; }; | 281 | 790B1FB42A4153E90074CF00 /* CNLiveMineBaseModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 790B1FB32A4153E90074CF00 /* CNLiveMineBaseModel.swift */; }; |
| 281 | 790B1FB62A41938F0074CF00 /* UIImage+CNLiveExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 790B1FB52A41938F0074CF00 /* UIImage+CNLiveExtensions.swift */; }; | 282 | 790B1FB62A41938F0074CF00 /* UIImage+CNLiveExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 790B1FB52A41938F0074CF00 /* UIImage+CNLiveExtensions.swift */; }; |
| @@ -683,6 +684,7 @@ | @@ -683,6 +684,7 @@ | ||
| 683 | 19FA20162AE22D3C001F7186 /* CNLiveDownSlideRecommendCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDownSlideRecommendCell.swift; sourceTree = "<group>"; }; | 684 | 19FA20162AE22D3C001F7186 /* CNLiveDownSlideRecommendCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDownSlideRecommendCell.swift; sourceTree = "<group>"; }; |
| 684 | 19FA20182AE22D98001F7186 /* CNLiveDownSlideTodayRecommendCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDownSlideTodayRecommendCell.swift; sourceTree = "<group>"; }; | 685 | 19FA20182AE22D98001F7186 /* CNLiveDownSlideTodayRecommendCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDownSlideTodayRecommendCell.swift; sourceTree = "<group>"; }; |
| 685 | 19FA201A2AE60423001F7186 /* CNLiveDownSlideModelLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDownSlideModelLayout.swift; sourceTree = "<group>"; }; | 686 | 19FA201A2AE60423001F7186 /* CNLiveDownSlideModelLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDownSlideModelLayout.swift; sourceTree = "<group>"; }; |
| 687 | + 3D30BC772DBF8A2500CA9AD3 /* CNLiveZFPlayerController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveZFPlayerController.swift; sourceTree = "<group>"; }; | ||
| 686 | 7902A8BA2B551C6E009AA653 /* metaCode.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = metaCode.entitlements; sourceTree = "<group>"; }; | 688 | 7902A8BA2B551C6E009AA653 /* metaCode.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = metaCode.entitlements; sourceTree = "<group>"; }; |
| 687 | 7905BB482AB0588B0089BC50 /* CNLiveMineAuthResultViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveMineAuthResultViewController.swift; sourceTree = "<group>"; }; | 689 | 7905BB482AB0588B0089BC50 /* CNLiveMineAuthResultViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveMineAuthResultViewController.swift; sourceTree = "<group>"; }; |
| 688 | 790B1FB32A4153E90074CF00 /* CNLiveMineBaseModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveMineBaseModel.swift; sourceTree = "<group>"; }; | 690 | 790B1FB32A4153E90074CF00 /* CNLiveMineBaseModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveMineBaseModel.swift; sourceTree = "<group>"; }; |
| @@ -1359,6 +1361,7 @@ | @@ -1359,6 +1361,7 @@ | ||
| 1359 | 195650D52D7A9B5700818FC8 /* CNLiveHomeSearchController.swift */, | 1361 | 195650D52D7A9B5700818FC8 /* CNLiveHomeSearchController.swift */, |
| 1360 | 19023DB42D801EF700872398 /* CNLiveHomeLanmuController.swift */, | 1362 | 19023DB42D801EF700872398 /* CNLiveHomeLanmuController.swift */, |
| 1361 | 1958B4132D83D2BA00F37E35 /* CNLiveHomeMoreController.swift */, | 1363 | 1958B4132D83D2BA00F37E35 /* CNLiveHomeMoreController.swift */, |
| 1364 | + 3D30BC772DBF8A2500CA9AD3 /* CNLiveZFPlayerController.swift */, | ||
| 1362 | 19416F812D3F9B3000ACD0A7 /* CNLiveTVPlayerViewController.swift */, | 1365 | 19416F812D3F9B3000ACD0A7 /* CNLiveTVPlayerViewController.swift */, |
| 1363 | ); | 1366 | ); |
| 1364 | path = Controller; | 1367 | path = Controller; |
| @@ -2551,6 +2554,7 @@ | @@ -2551,6 +2554,7 @@ | ||
| 2551 | 1917334A2B2BE746007BCC04 /* CNLiveCreateCouponTableViewCell.swift in Sources */, | 2554 | 1917334A2B2BE746007BCC04 /* CNLiveCreateCouponTableViewCell.swift in Sources */, |
| 2552 | 191732FE2B0B3EBF007BCC04 /* CNLiveShopGoodsDetailsViewController.swift in Sources */, | 2555 | 191732FE2B0B3EBF007BCC04 /* CNLiveShopGoodsDetailsViewController.swift in Sources */, |
| 2553 | 79E496E32AB9357000127BF8 /* UITableViewCell+CNLiveExtension.swift in Sources */, | 2556 | 79E496E32AB9357000127BF8 /* UITableViewCell+CNLiveExtension.swift in Sources */, |
| 2557 | + 3D30BC782DBF8A2500CA9AD3 /* CNLiveZFPlayerController.swift in Sources */, | ||
| 2554 | 7C83B4422A541EBF004BF4A4 /* CALayer+CNLiveExtensions.swift in Sources */, | 2558 | 7C83B4422A541EBF004BF4A4 /* CALayer+CNLiveExtensions.swift in Sources */, |
| 2555 | 1938BD472B4FD5A500390A34 /* CNLiveIntegralAlertTool.swift in Sources */, | 2559 | 1938BD472B4FD5A500390A34 /* CNLiveIntegralAlertTool.swift in Sources */, |
| 2556 | 19565EC72AF8AD38007D6727 /* CNLiveShopNewProductController.swift in Sources */, | 2560 | 19565EC72AF8AD38007D6727 /* CNLiveShopNewProductController.swift in Sources */, |
metaCode/Classes/Common/Util/CNLiveCommonQiniuTool.swift
| @@ -181,7 +181,7 @@ class UploadManager: NSObject { | @@ -181,7 +181,7 @@ class UploadManager: NSObject { | ||
| 181 | }, option: uploadOption) | 181 | }, option: uploadOption) |
| 182 | } | 182 | } |
| 183 | } else { | 183 | } else { |
| 184 | - showMessage(message: resp["errorMessage"] as! String) | 184 | + //showMessage(message: resp["errorMessage"] as! String) |
| 185 | if success != nil { | 185 | if success != nil { |
| 186 | success!("", "") | 186 | success!("", "") |
| 187 | } | 187 | } |
metaCode/Classes/Main/HomePages/ViewModel/CNLiveHomePageViewModel.swift
| @@ -168,7 +168,7 @@ class CNLiveHomePageViewModel:NSObject,URLSessionTaskDelegate{ | @@ -168,7 +168,7 @@ class CNLiveHomePageViewModel:NSObject,URLSessionTaskDelegate{ | ||
| 168 | resultBlock(listModel, .success) | 168 | resultBlock(listModel, .success) |
| 169 | } | 169 | } |
| 170 | } else { | 170 | } else { |
| 171 | - showMessage(message: resp["errorMessage"] as! String) | 171 | + //showMessage(message: resp["errorMessage"] as! String) |
| 172 | resultBlock(NSNull(),.failed) | 172 | resultBlock(NSNull(),.failed) |
| 173 | } | 173 | } |
| 174 | } else { | 174 | } else { |
| @@ -210,7 +210,7 @@ class CNLiveHomePageViewModel:NSObject,URLSessionTaskDelegate{ | @@ -210,7 +210,7 @@ class CNLiveHomePageViewModel:NSObject,URLSessionTaskDelegate{ | ||
| 210 | resultBlock(listModel, .success) | 210 | resultBlock(listModel, .success) |
| 211 | } | 211 | } |
| 212 | } else { | 212 | } else { |
| 213 | - showMessage(message: resp["errorMessage"] as! String) | 213 | + //showMessage(message: resp["errorMessage"] as! String) |
| 214 | resultBlock(NSNull(),.failed) | 214 | resultBlock(NSNull(),.failed) |
| 215 | } | 215 | } |
| 216 | } else { | 216 | } else { |
| @@ -393,7 +393,7 @@ class CNLiveHomePageViewModel:NSObject,URLSessionTaskDelegate{ | @@ -393,7 +393,7 @@ class CNLiveHomePageViewModel:NSObject,URLSessionTaskDelegate{ | ||
| 393 | resultBlock(listModel, .success) | 393 | resultBlock(listModel, .success) |
| 394 | } | 394 | } |
| 395 | } else { | 395 | } else { |
| 396 | - showMessage(message: resp["errorMessage"] as! String) | 396 | + //showMessage(message: resp["errorMessage"] as! String) |
| 397 | resultBlock(NSNull(),.failed) | 397 | resultBlock(NSNull(),.failed) |
| 398 | } | 398 | } |
| 399 | } else { | 399 | } else { |
| @@ -435,7 +435,7 @@ class CNLiveHomePageViewModel:NSObject,URLSessionTaskDelegate{ | @@ -435,7 +435,7 @@ class CNLiveHomePageViewModel:NSObject,URLSessionTaskDelegate{ | ||
| 435 | resultBlock(listModel, .success) | 435 | resultBlock(listModel, .success) |
| 436 | } | 436 | } |
| 437 | } else { | 437 | } else { |
| 438 | - showMessage(message: resp["errorMessage"] as! String) | 438 | + //showMessage(message: resp["errorMessage"] as! String) |
| 439 | resultBlock(NSNull(),.failed) | 439 | resultBlock(NSNull(),.failed) |
| 440 | } | 440 | } |
| 441 | }else{ | 441 | }else{ |
metaCode/Classes/Main/HuBiLieHomePage/Controller/CNLiveTVHomeViewController.swift
| @@ -707,8 +707,13 @@ class CNLiveTVHomeViewController:CNLiveBaseViewController, UITableViewDataSource | @@ -707,8 +707,13 @@ class CNLiveTVHomeViewController:CNLiveBaseViewController, UITableViewDataSource | ||
| 707 | newDataArray.addObjects(from: [cellModel]) | 707 | newDataArray.addObjects(from: [cellModel]) |
| 708 | if model.type == SlideModelTypeFollow77{ | 708 | if model.type == SlideModelTypeFollow77{ |
| 709 | // self.group.enter() | 709 | // self.group.enter() |
| 710 | - self.getHomePageFollowApi(sid: UserInfoManager.shared.userInfo.uid) | ||
| 711 | - isRefreshTable = false | 710 | + if metaAppDelegate.isLogin{ |
| 711 | + self.getHomePageFollowApi(sid: UserInfoManager.shared.userInfo.uid) | ||
| 712 | + isRefreshTable = false | ||
| 713 | + }else{ | ||
| 714 | + | ||
| 715 | + } | ||
| 716 | + | ||
| 712 | }else if model.type == SlideModelTypeShopCategory78{ | 717 | }else if model.type == SlideModelTypeShopCategory78{ |
| 713 | if model.contents.count > 0{ | 718 | if model.contents.count > 0{ |
| 714 | let shop_id = model.contents[0].contentId | 719 | let shop_id = model.contents[0].contentId |
metaCode/Classes/Main/HuBiLieHomePage/Controller/CNLiveTVPlayerViewController.swift
| @@ -30,7 +30,7 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa | @@ -30,7 +30,7 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa | ||
| 30 | var currentPlayIsNeedPay = false | 30 | var currentPlayIsNeedPay = false |
| 31 | 31 | ||
| 32 | 32 | ||
| 33 | - var player: ZFPlayerController! | 33 | + var player: CNLiveZFPlayerController! |
| 34 | //当前内容id | 34 | //当前内容id |
| 35 | var contentId = "" | 35 | var contentId = "" |
| 36 | var playTitle = "" | 36 | var playTitle = "" |
| @@ -261,19 +261,24 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa | @@ -261,19 +261,24 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa | ||
| 261 | self.configDataArray() | 261 | self.configDataArray() |
| 262 | self.setupPlayer() | 262 | self.setupPlayer() |
| 263 | 263 | ||
| 264 | - let pid = (self.vodPlayBlockListList5Model?.pid.count ?? 0 > 0) ? (self.vodPlayBlockListList5Model?.pid ?? "") : (self.vodPlayBlockListList5Model?.contentId ?? "") | ||
| 265 | - CNLiveShortVideoViewModel.requestCommentList(pid: pid, page: 1) {[weak self] result, respStatue in | ||
| 266 | - guard let self = self else { return } | ||
| 267 | - if respStatue == .success { | ||
| 268 | - let total_hd = (result as! ShortVideoHomeCommentModel).total_hd ?? 0 | ||
| 269 | - if total_hd == 0{ | ||
| 270 | - self.bottomCommentNumLabel.isHidden = true | ||
| 271 | - }else{ | ||
| 272 | - self.bottomCommentNumLabel.isHidden = false | ||
| 273 | - self.bottomCommentNumLabel.text = "\(total_hd)" | 264 | + |
| 265 | + if metaAppDelegate.isLogin{ | ||
| 266 | + let pid = (self.vodPlayBlockListList5Model?.pid.count ?? 0 > 0) ? (self.vodPlayBlockListList5Model?.pid ?? "") : (self.vodPlayBlockListList5Model?.contentId ?? "") | ||
| 267 | + CNLiveShortVideoViewModel.requestCommentList(pid: pid, page: 1) {[weak self] result, respStatue in | ||
| 268 | + guard let self = self else { return } | ||
| 269 | + if respStatue == .success { | ||
| 270 | + let total_hd = (result as! ShortVideoHomeCommentModel).total_hd ?? 0 | ||
| 271 | + if total_hd == 0{ | ||
| 272 | + self.bottomCommentNumLabel.isHidden = true | ||
| 273 | + }else{ | ||
| 274 | + self.bottomCommentNumLabel.isHidden = false | ||
| 275 | + self.bottomCommentNumLabel.text = "\(total_hd)" | ||
| 276 | + } | ||
| 277 | + | ||
| 274 | } | 278 | } |
| 275 | - | ||
| 276 | } | 279 | } |
| 280 | + }else{ | ||
| 281 | + self.bottomCommentNumLabel.isHidden = true | ||
| 277 | } | 282 | } |
| 278 | 283 | ||
| 279 | 284 | ||
| @@ -484,7 +489,7 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa | @@ -484,7 +489,7 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa | ||
| 484 | let playerManager = ZFAVPlayerManager() | 489 | let playerManager = ZFAVPlayerManager() |
| 485 | playerManager.shouldAutoPlay = true | 490 | playerManager.shouldAutoPlay = true |
| 486 | 491 | ||
| 487 | - player = ZFPlayerController(playerManager: playerManager, containerView: containerView) | 492 | + player = CNLiveZFPlayerController(playerManager: playerManager, containerView: containerView) |
| 488 | player.pauseWhenAppResignActive = false | 493 | player.pauseWhenAppResignActive = false |
| 489 | player.controlView = controlView | 494 | player.controlView = controlView |
| 490 | //是否跟随设备旋转 | 495 | //是否跟随设备旋转 |
| @@ -913,16 +918,17 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa | @@ -913,16 +918,17 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa | ||
| 913 | self.controlView.payBgView.isHidden = true | 918 | self.controlView.payBgView.isHidden = true |
| 914 | self.isSeek = false | 919 | self.isSeek = false |
| 915 | self.player.currentPlayerManager.rate = 1.0 | 920 | self.player.currentPlayerManager.rate = 1.0 |
| 916 | - self.playTitle = title | ||
| 917 | - self.url = URL(string: url) | ||
| 918 | - var urls = [URL]() | ||
| 919 | - urls.append(self.url!) | ||
| 920 | - self.player.assetURLs = urls | ||
| 921 | - self.player.playTheIndex(0) | ||
| 922 | - self.controlView.showTitle(title, cover: UIImage.imageWithColor(color: .darkGray, size: CGSize(width: 50, height: 50)), fullScreenMode: .landscape) | 921 | + if self.contentId == self.player.contentId{ |
| 922 | + self.playTitle = title | ||
| 923 | + self.url = URL(string: url) | ||
| 924 | + var urls = [URL]() | ||
| 925 | + urls.append(self.url!) | ||
| 926 | + self.player.assetURLs = urls | ||
| 927 | + self.player.playTheIndex(0) | ||
| 928 | + self.controlView.showTitle(title, cover: UIImage.imageWithColor(color: .darkGray, size: CGSize(width: 50, height: 50)), fullScreenMode: .landscape) | ||
| 929 | + } | ||
| 923 | //上报end | 930 | //上报end |
| 924 | CNLiveShortVideoViewModel.requestVodPlayRecordEnd(contentId: self.contentId , channelName: "yszg",model: self.vodPlayModel?.model ?? "1") | 931 | CNLiveShortVideoViewModel.requestVodPlayRecordEnd(contentId: self.contentId , channelName: "yszg",model: self.vodPlayModel?.model ?? "1") |
| 925 | - print("2222222:\(self.contentId),\(self.vodPlayModel?.model ?? "1")") | ||
| 926 | } | 932 | } |
| 927 | func seekPlayerWithUrlAndTitle(url:String,title:String,seekTime:TimeInterval){ | 933 | func seekPlayerWithUrlAndTitle(url:String,title:String,seekTime:TimeInterval){ |
| 928 | self.isSeek = true | 934 | self.isSeek = true |
| @@ -1038,6 +1044,7 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa | @@ -1038,6 +1044,7 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa | ||
| 1038 | // MARK: -专辑/看点 列表切换某集 ,刷新看点和电商 | 1044 | // MARK: -专辑/看点 列表切换某集 ,刷新看点和电商 |
| 1039 | func changeContentApi(activityId:String,title:String,contentId:String,isRefreshPlayer:Bool){ | 1045 | func changeContentApi(activityId:String,title:String,contentId:String,isRefreshPlayer:Bool){ |
| 1040 | //play接口刷新 看点和电商 1350755 | 1046 | //play接口刷新 看点和电商 1350755 |
| 1047 | + showLoading(message: "") | ||
| 1041 | CNLiveDownSlideTool.getVodPlayApi(contentId: contentId) {[weak self] result, status in | 1048 | CNLiveDownSlideTool.getVodPlayApi(contentId: contentId) {[weak self] result, status in |
| 1042 | guard let self = self else { return } | 1049 | guard let self = self else { return } |
| 1043 | if status == .success{ | 1050 | if status == .success{ |
| @@ -1082,13 +1089,33 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa | @@ -1082,13 +1089,33 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa | ||
| 1082 | 1089 | ||
| 1083 | //刷新url 1955_71512cfbcd5b497580732b48e26d16d6 | 1090 | //刷新url 1955_71512cfbcd5b497580732b48e26d16d6 |
| 1084 | if isRefreshPlayer{ | 1091 | if isRefreshPlayer{ |
| 1092 | + showLoading(message: "") | ||
| 1085 | CNLiveHomePageViewModel.shared.getVodVideoURL(contentId: activityId) {[weak self] result, status in | 1093 | CNLiveHomePageViewModel.shared.getVodVideoURL(contentId: activityId) {[weak self] result, status in |
| 1086 | guard let self = self else { return } | 1094 | guard let self = self else { return } |
| 1095 | + hiddenLoading() | ||
| 1087 | if status == .success | 1096 | if status == .success |
| 1088 | { | 1097 | { |
| 1089 | if let url = result as? String{ | 1098 | if let url = result as? String{ |
| 1090 | - self.playWithUrlAndTitle(url: url, title: title) | ||
| 1091 | - self.url = URL(string: url) | 1099 | + print("2222222:selfContentId:\(self.contentId),playerCid:\(contentId),playerActiId:\(activityId),playerTitle:\(title),playUrl:\(url)") |
| 1100 | + if self.contentId == contentId{ | ||
| 1101 | + self.player.contentId = contentId | ||
| 1102 | + self.player.activityId = activityId | ||
| 1103 | + self.player.title = title | ||
| 1104 | + self.player.url = url | ||
| 1105 | + | ||
| 1106 | + self.playWithUrlAndTitle(url: url, title: title) | ||
| 1107 | + self.url = URL(string: url) | ||
| 1108 | + }else{ | ||
| 1109 | + print("2222222:vodPlayMdlCId:\(self.vodPlayModel?.cid),vodPlayMdlContentId:\(self.vodPlayModel?.contentId),currentPlayIsNeedPay:\(self.currentPlayIsNeedPay)") | ||
| 1110 | + if self.currentPlayIsNeedPay{ | ||
| 1111 | + //需要付费 | ||
| 1112 | + self.controlView.payBgView.isHidden = false | ||
| 1113 | + }else{ | ||
| 1114 | + //免费或者付过费了 | ||
| 1115 | + self.controlView.payBgView.isHidden = true | ||
| 1116 | + } | ||
| 1117 | + | ||
| 1118 | + } | ||
| 1092 | } | 1119 | } |
| 1093 | }else{ | 1120 | }else{ |
| 1094 | 1121 | ||
| @@ -1110,8 +1137,10 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa | @@ -1110,8 +1137,10 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa | ||
| 1110 | // MARK: - 专辑刷新整个页面 | 1137 | // MARK: - 专辑刷新整个页面 |
| 1111 | func refreshVodData(isAblumVideo:Bool){ | 1138 | func refreshVodData(isAblumVideo:Bool){ |
| 1112 | print("重定向地址 ==payAid:\(self.payAid),payContentId:\(self.payContentId)") | 1139 | print("重定向地址 ==payAid:\(self.payAid),payContentId:\(self.payContentId)") |
| 1140 | + showLoading(message: "") | ||
| 1113 | CNLiveDownSlideTool.getVodData(contentId: self.payAid, isAblumVideo: isAblumVideo,seleContentId: self.payContentId) {[weak self] vodPlayModel, contentId,url, result, status in | 1141 | CNLiveDownSlideTool.getVodData(contentId: self.payAid, isAblumVideo: isAblumVideo,seleContentId: self.payContentId) {[weak self] vodPlayModel, contentId,url, result, status in |
| 1114 | guard let self = self else { return } | 1142 | guard let self = self else { return } |
| 1143 | + hiddenLoading() | ||
| 1115 | if status == .success{ | 1144 | if status == .success{ |
| 1116 | self.vodPlayModel = vodPlayModel | 1145 | self.vodPlayModel = vodPlayModel |
| 1117 | self.controlView.vodPlayModel = vodPlayModel | 1146 | self.controlView.vodPlayModel = vodPlayModel |
| @@ -1784,30 +1813,38 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa | @@ -1784,30 +1813,38 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa | ||
| 1784 | } | 1813 | } |
| 1785 | 1814 | ||
| 1786 | func vodSupport(vodPlayBlockListListModel:CNLiveVodPlayBlockListListModel,isLiked:Bool,favoriteNum:Int){ | 1815 | func vodSupport(vodPlayBlockListListModel:CNLiveVodPlayBlockListListModel,isLiked:Bool,favoriteNum:Int){ |
| 1787 | - CNLiveVodPlayViewModel.vodSupport(contentId: vodPlayBlockListListModel.pid, support: isLiked) {[weak self] result, status in | ||
| 1788 | - guard let self = self else { return } | ||
| 1789 | - if status == .success{ | ||
| 1790 | - if let vodPlayBlockListModel = self.dataArray[0] as? CNLiveVodPlayBlockListModel{ | ||
| 1791 | - if vodPlayBlockListModel.type == "5"{//简介 | ||
| 1792 | - if let model = vodPlayBlockListModel.list.first{ | ||
| 1793 | - model.liked = isLiked | ||
| 1794 | - model.likesNum = favoriteNum | ||
| 1795 | - self.dataArray.replaceObject(at: 0, with: vodPlayBlockListModel) | 1816 | + if metaAppDelegate.isLogin{ |
| 1817 | + CNLiveVodPlayViewModel.vodSupport(contentId: vodPlayBlockListListModel.pid, support: isLiked) {[weak self] result, status in | ||
| 1818 | + guard let self = self else { return } | ||
| 1819 | + if status == .success{ | ||
| 1820 | + if let vodPlayBlockListModel = self.dataArray[0] as? CNLiveVodPlayBlockListModel{ | ||
| 1821 | + if vodPlayBlockListModel.type == "5"{//简介 | ||
| 1822 | + if let model = vodPlayBlockListModel.list.first{ | ||
| 1823 | + model.liked = isLiked | ||
| 1824 | + model.likesNum = favoriteNum | ||
| 1825 | + self.dataArray.replaceObject(at: 0, with: vodPlayBlockListModel) | ||
| 1826 | + } | ||
| 1827 | + | ||
| 1796 | } | 1828 | } |
| 1797 | - | ||
| 1798 | } | 1829 | } |
| 1830 | + self.tableView.reloadRow(at: IndexPath(row: 0, section: 0), with: .none) | ||
| 1799 | } | 1831 | } |
| 1800 | - self.tableView.reloadRow(at: IndexPath(row: 0, section: 0), with: .none) | ||
| 1801 | } | 1832 | } |
| 1833 | + }else{ | ||
| 1834 | + metaAppDelegate.pushLoginVC() | ||
| 1802 | } | 1835 | } |
| 1803 | } | 1836 | } |
| 1804 | func vodCollection(vodPlayBlockListListModel:CNLiveVodPlayBlockListListModel,isCollectioned:Bool){ | 1837 | func vodCollection(vodPlayBlockListListModel:CNLiveVodPlayBlockListListModel,isCollectioned:Bool){ |
| 1805 | - let type = isCollectioned ? "1" : "2" | ||
| 1806 | - CNLiveVodPlayViewModel.vodCollection(type: type, vodPlayBlockListListModel: vodPlayBlockListListModel) {[weak self] result, status in | ||
| 1807 | - guard let self = self else { return } | ||
| 1808 | - if status == .success{ | ||
| 1809 | - //不改数据了 | 1838 | + if metaAppDelegate.isLogin{ |
| 1839 | + let type = isCollectioned ? "1" : "2" | ||
| 1840 | + CNLiveVodPlayViewModel.vodCollection(type: type, vodPlayBlockListListModel: vodPlayBlockListListModel) {[weak self] result, status in | ||
| 1841 | + guard let self = self else { return } | ||
| 1842 | + if status == .success{ | ||
| 1843 | + //不改数据了 | ||
| 1844 | + } | ||
| 1810 | } | 1845 | } |
| 1846 | + }else{ | ||
| 1847 | + metaAppDelegate.pushLoginVC() | ||
| 1811 | } | 1848 | } |
| 1812 | } | 1849 | } |
| 1813 | func vodShare(vodPlayBlockListListModel:CNLiveVodPlayBlockListListModel){ | 1850 | func vodShare(vodPlayBlockListListModel:CNLiveVodPlayBlockListListModel){ |
| @@ -1828,15 +1865,18 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa | @@ -1828,15 +1865,18 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa | ||
| 1828 | self.bottomCommentShowContainView.isHidden = true | 1865 | self.bottomCommentShowContainView.isHidden = true |
| 1829 | } | 1866 | } |
| 1830 | @objc func bottomCommentViewTapAction() { | 1867 | @objc func bottomCommentViewTapAction() { |
| 1831 | - bottomCommentShowContainView.isHidden = false | ||
| 1832 | - //评论 | ||
| 1833 | - CNLiveShortVideoCommentListView.showVideoCommentListView(pid: self.vodPlayModel?.contentId ?? "", contentSid: UserInfoManager.shared.userInfo.uid,containView:self.bottomCommentShowContainView, result: { commentModel in | ||
| 1834 | - print("\(commentModel)") | ||
| 1835 | - }, close: {[weak self] in | ||
| 1836 | - guard let self = self else { return } | ||
| 1837 | - self.bottomCommentShowContainView.isHidden = true | ||
| 1838 | - }) | ||
| 1839 | - | 1868 | + if metaAppDelegate.isLogin{ |
| 1869 | + bottomCommentShowContainView.isHidden = false | ||
| 1870 | + //评论 | ||
| 1871 | + CNLiveShortVideoCommentListView.showVideoCommentListView(pid: self.vodPlayModel?.contentId ?? "", contentSid: UserInfoManager.shared.userInfo.uid,containView:self.bottomCommentShowContainView, result: { commentModel in | ||
| 1872 | + print("\(commentModel)") | ||
| 1873 | + }, close: {[weak self] in | ||
| 1874 | + guard let self = self else { return } | ||
| 1875 | + self.bottomCommentShowContainView.isHidden = true | ||
| 1876 | + }) | ||
| 1877 | + }else{ | ||
| 1878 | + metaAppDelegate.pushLoginVC() | ||
| 1879 | + } | ||
| 1840 | } | 1880 | } |
| 1841 | 1881 | ||
| 1842 | @objc func ClickBackBtn() { | 1882 | @objc func ClickBackBtn() { |
metaCode/Classes/Main/HuBiLieHomePage/Controller/CNLiveZFPlayerController.swift
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveZFPlayerController.swift | ||
| 3 | +// metaCode | ||
| 4 | +// | ||
| 5 | +// Created by 张亦玓 on 2025/4/28. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +import Foundation | ||
| 9 | +import ZFPlayer | ||
| 10 | + | ||
| 11 | +//activityId:String,title:String,contentId:String | ||
| 12 | + | ||
| 13 | +class CNLiveZFPlayerController:ZFPlayerController{ | ||
| 14 | + | ||
| 15 | + var activityId = ""// | ||
| 16 | + var contentId = ""// | ||
| 17 | + var title = "" | ||
| 18 | + var url = "" | ||
| 19 | + | ||
| 20 | +} |
metaCode/Classes/Main/HuBiLieHomePage/Util/CNLiveDownSlideTool.swift
| @@ -295,6 +295,7 @@ class CNLiveDownSlideTool:NSObject{ | @@ -295,6 +295,7 @@ class CNLiveDownSlideTool:NSObject{ | ||
| 295 | if status == .success{ | 295 | if status == .success{ |
| 296 | if let vodModel = result as? CNLiveVodAlbumMsgModel{ | 296 | if let vodModel = result as? CNLiveVodAlbumMsgModel{ |
| 297 | //获取专辑列表 contentId:2653 | 297 | //获取专辑列表 contentId:2653 |
| 298 | + showLoading(message: "") | ||
| 298 | CNLiveHomePageViewModel.requstWithVodAlbumVideoList(aid: contentId){result, status in | 299 | CNLiveHomePageViewModel.requstWithVodAlbumVideoList(aid: contentId){result, status in |
| 299 | hiddenLoading() | 300 | hiddenLoading() |
| 300 | if let albumListBaseModel = result as? CNLiveVodAlbumListBaseModel{ | 301 | if let albumListBaseModel = result as? CNLiveVodAlbumListBaseModel{ |
| @@ -306,6 +307,7 @@ class CNLiveDownSlideTool:NSObject{ | @@ -306,6 +307,7 @@ class CNLiveDownSlideTool:NSObject{ | ||
| 306 | albumListModel} | 307 | albumListModel} |
| 307 | } | 308 | } |
| 308 | //拿最新播放集数的单集pid,再请求play | 309 | //拿最新播放集数的单集pid,再请求play |
| 310 | + showLoading(message: "") | ||
| 309 | CNLiveDownSlideTool.getVodPlayApi(contentId:(seleContentId.count>0 ? seleContentId : currVodModel?.contentId ?? "") ){ result, status in | 311 | CNLiveDownSlideTool.getVodPlayApi(contentId:(seleContentId.count>0 ? seleContentId : currVodModel?.contentId ?? "") ){ result, status in |
| 310 | if status == .success{ | 312 | if status == .success{ |
| 311 | if let vodModel = result as? CNLiveVodPlayModel{ | 313 | if let vodModel = result as? CNLiveVodPlayModel{ |
| @@ -343,11 +345,13 @@ class CNLiveDownSlideTool:NSObject{ | @@ -343,11 +345,13 @@ class CNLiveDownSlideTool:NSObject{ | ||
| 343 | }else{ | 345 | }else{ |
| 344 | //单集 | 346 | //单集 |
| 345 | //获取play | 347 | //获取play |
| 348 | + showLoading(message: "") | ||
| 346 | CNLiveDownSlideTool.getVodPlayApi(contentId: contentId.count > 0 ? contentId : seleContentId){ result, status in | 349 | CNLiveDownSlideTool.getVodPlayApi(contentId: contentId.count > 0 ? contentId : seleContentId){ result, status in |
| 347 | if status == .success{ | 350 | if status == .success{ |
| 348 | if let vodModel = result as? CNLiveVodPlayModel{ | 351 | if let vodModel = result as? CNLiveVodPlayModel{ |
| 349 | //获得点播url | 352 | //获得点播url |
| 350 | //获取301播放地址 | 353 | //获取301播放地址 |
| 354 | + showLoading(message: "") | ||
| 351 | CNLiveHomePageViewModel.shared.getVodVideoURL(contentId: vodModel.contentId) { result, status in | 355 | CNLiveHomePageViewModel.shared.getVodVideoURL(contentId: vodModel.contentId) { result, status in |
| 352 | hiddenLoading() | 356 | hiddenLoading() |
| 353 | if status == .success{ | 357 | if status == .success{ |
| @@ -372,11 +376,13 @@ class CNLiveDownSlideTool:NSObject{ | @@ -372,11 +376,13 @@ class CNLiveDownSlideTool:NSObject{ | ||
| 372 | 376 | ||
| 373 | //已经确定专辑 ,只有 albumId 2653 ,其他contentId为nil时 跳转点播页 | 377 | //已经确定专辑 ,只有 albumId 2653 ,其他contentId为nil时 跳转点播页 |
| 374 | class func pushVodController(albumId:String,navigationVC:UINavigationController?){ | 378 | class func pushVodController(albumId:String,navigationVC:UINavigationController?){ |
| 379 | + showLoading(message: "") | ||
| 375 | //获取专辑详情 | 380 | //获取专辑详情 |
| 376 | CNLiveDownSlideTool.getVodAlbumMsgApi(contentId: albumId){ result, status in | 381 | CNLiveDownSlideTool.getVodAlbumMsgApi(contentId: albumId){ result, status in |
| 377 | if status == .success{ | 382 | if status == .success{ |
| 378 | if let vodModel = result as? CNLiveVodAlbumMsgModel{ | 383 | if let vodModel = result as? CNLiveVodAlbumMsgModel{ |
| 379 | //获取专辑列表 | 384 | //获取专辑列表 |
| 385 | + showLoading(message: "") | ||
| 380 | CNLiveHomePageViewModel.requstWithVodAlbumVideoList(aid: albumId){result, status in | 386 | CNLiveHomePageViewModel.requstWithVodAlbumVideoList(aid: albumId){result, status in |
| 381 | if let albumListBaseModel = result as? CNLiveVodAlbumListBaseModel{ | 387 | if let albumListBaseModel = result as? CNLiveVodAlbumListBaseModel{ |
| 382 | var currVodModel:CNLiveVodAlbumListModel? | 388 | var currVodModel:CNLiveVodAlbumListModel? |
| @@ -389,11 +395,13 @@ CNLiveDownSlideTool.getVodAlbumMsgApi(contentId: albumId){ result, status in | @@ -389,11 +395,13 @@ CNLiveDownSlideTool.getVodAlbumMsgApi(contentId: albumId){ result, status in | ||
| 389 | albumListModel } | 395 | albumListModel } |
| 390 | } | 396 | } |
| 391 | //拿最新播放集数的单集pid,再请求play | 397 | //拿最新播放集数的单集pid,再请求play |
| 398 | + showLoading(message: "") | ||
| 392 | CNLiveDownSlideTool.getVodPlayApi(contentId: currVodModel?.contentId ?? ""){ result, status in | 399 | CNLiveDownSlideTool.getVodPlayApi(contentId: currVodModel?.contentId ?? ""){ result, status in |
| 393 | if status == .success{ | 400 | if status == .success{ |
| 394 | if let vodModel = result as? CNLiveVodPlayModel{ | 401 | if let vodModel = result as? CNLiveVodPlayModel{ |
| 395 | //获得点播url | 402 | //获得点播url |
| 396 | //获取301播放地址 | 403 | //获取301播放地址 |
| 404 | + showLoading(message: "") | ||
| 397 | CNLiveHomePageViewModel.shared.getVodVideoURL(contentId: vodModel.contentId) {result,status in //vodModel.contentId result, status in | 405 | CNLiveHomePageViewModel.shared.getVodVideoURL(contentId: vodModel.contentId) {result,status in //vodModel.contentId result, status in |
| 398 | hiddenLoading() | 406 | hiddenLoading() |
| 399 | if status == .success{ | 407 | if status == .success{ |
| @@ -442,10 +450,12 @@ CNLiveDownSlideTool.getVodPlayApi(contentId: contentId){ result, status in | @@ -442,10 +450,12 @@ CNLiveDownSlideTool.getVodPlayApi(contentId: contentId){ result, status in | ||
| 442 | if tempVodModel.album?.albumId.count ?? 0 > 0{ | 450 | if tempVodModel.album?.albumId.count ?? 0 > 0{ |
| 443 | //专辑 | 451 | //专辑 |
| 444 | //获取专辑详情 | 452 | //获取专辑详情 |
| 453 | + showLoading(message: "") | ||
| 445 | CNLiveDownSlideTool.getVodAlbumMsgApi(contentId: tempVodModel.album!.albumId){ result, status in | 454 | CNLiveDownSlideTool.getVodAlbumMsgApi(contentId: tempVodModel.album!.albumId){ result, status in |
| 446 | if status == .success{ | 455 | if status == .success{ |
| 447 | if let vodModel = result as? CNLiveVodAlbumMsgModel{ | 456 | if let vodModel = result as? CNLiveVodAlbumMsgModel{ |
| 448 | //获取专辑列表 | 457 | //获取专辑列表 |
| 458 | + showLoading(message: "") | ||
| 449 | CNLiveHomePageViewModel.requstWithVodAlbumVideoList(aid: tempVodModel.album!.albumId){result, status in | 459 | CNLiveHomePageViewModel.requstWithVodAlbumVideoList(aid: tempVodModel.album!.albumId){result, status in |
| 450 | if let albumListBaseModel = result as? CNLiveVodAlbumListBaseModel{ | 460 | if let albumListBaseModel = result as? CNLiveVodAlbumListBaseModel{ |
| 451 | var currVodModel:CNLiveVodAlbumListModel? | 461 | var currVodModel:CNLiveVodAlbumListModel? |
| @@ -461,6 +471,7 @@ CNLiveDownSlideTool.getVodPlayApi(contentId: contentId){ result, status in | @@ -461,6 +471,7 @@ CNLiveDownSlideTool.getVodPlayApi(contentId: contentId){ result, status in | ||
| 461 | // if let vodModel = result as? CNLiveVodPlayModel{ | 471 | // if let vodModel = result as? CNLiveVodPlayModel{ |
| 462 | //获得点播url | 472 | //获得点播url |
| 463 | //获取301播放地址 | 473 | //获取301播放地址 |
| 474 | + showLoading(message: "") | ||
| 464 | CNLiveHomePageViewModel.shared.getVodVideoURL(contentId: tempVodModel.contentId) {result,status in //vodModel.contentId result, status in | 475 | CNLiveHomePageViewModel.shared.getVodVideoURL(contentId: tempVodModel.contentId) {result,status in //vodModel.contentId result, status in |
| 465 | hiddenLoading() | 476 | hiddenLoading() |
| 466 | if status == .success{ | 477 | if status == .success{ |
| @@ -502,6 +513,7 @@ CNLiveDownSlideTool.getVodPlayApi(contentId: contentId){ result, status in | @@ -502,6 +513,7 @@ CNLiveDownSlideTool.getVodPlayApi(contentId: contentId){ result, status in | ||
| 502 | //单集 | 513 | //单集 |
| 503 | //获得点播url | 514 | //获得点播url |
| 504 | //获取301播放地址 | 515 | //获取301播放地址 |
| 516 | + showLoading(message: "") | ||
| 505 | CNLiveHomePageViewModel.shared.getVodVideoURL(contentId: tempVodModel.contentId) { result, status in | 517 | CNLiveHomePageViewModel.shared.getVodVideoURL(contentId: tempVodModel.contentId) { result, status in |
| 506 | hiddenLoading() | 518 | hiddenLoading() |
| 507 | if status == .success{ | 519 | if status == .success{ |
metaCode/Classes/Main/HuBiLieHomePage/View/VodDetail/CNLiveVodIntroductionCell.swift
| @@ -195,7 +195,11 @@ class CNLiveVodIntroductionCell:UITableViewCell{ | @@ -195,7 +195,11 @@ class CNLiveVodIntroductionCell:UITableViewCell{ | ||
| 195 | likeBtn.setTitle("\(vodMdl.likesNum)", for: .selected) | 195 | likeBtn.setTitle("\(vodMdl.likesNum)", for: .selected) |
| 196 | likeBtn.isSelected = vodMdl.liked | 196 | likeBtn.isSelected = vodMdl.liked |
| 197 | 197 | ||
| 198 | - collectionBtn.isSelected = vodMdl.collectioned | 198 | + if metaAppDelegate.isLogin{ |
| 199 | + collectionBtn.isSelected = vodMdl.collectioned | ||
| 200 | + }else{ | ||
| 201 | + collectionBtn.isSelected = false | ||
| 202 | + } | ||
| 199 | } | 203 | } |
| 200 | } | 204 | } |
| 201 | } | 205 | } |
| @@ -205,17 +209,28 @@ class CNLiveVodIntroductionCell:UITableViewCell{ | @@ -205,17 +209,28 @@ class CNLiveVodIntroductionCell:UITableViewCell{ | ||
| 205 | } | 209 | } |
| 206 | 210 | ||
| 207 | @objc func likeBtnAction(){ | 211 | @objc func likeBtnAction(){ |
| 208 | - likeBtn.isSelected = likeBtn.isSelected ? false : true | ||
| 209 | let vodMdl = self.vodPlayBlockListModel!.list.first! | 212 | let vodMdl = self.vodPlayBlockListModel!.list.first! |
| 210 | let num = likeBtn.isSelected ? 1 : -1 | 213 | let num = likeBtn.isSelected ? 1 : -1 |
| 211 | - let likeNum = ((vodMdl.likesNum+num) == -1) ? 0 : vodMdl.likesNum+num | 214 | + var likeNum = 0//((vodMdl.likesNum+num) == -1) ? 0 : vodMdl.likesNum+num |
| 215 | + if metaAppDelegate.isLogin{ | ||
| 216 | + likeNum = ((vodMdl.likesNum+num) == -1) ? 0 : vodMdl.likesNum+num | ||
| 217 | + likeBtn.isSelected = likeBtn.isSelected ? false : true | ||
| 218 | + }else{ | ||
| 219 | + likeNum = vodMdl.likesNum | ||
| 220 | + likeBtn.isSelected = false | ||
| 221 | + } | ||
| 212 | likeBtn.setTitle("\(likeNum)", for: .normal) | 222 | likeBtn.setTitle("\(likeNum)", for: .normal) |
| 213 | likeBtn.setTitle("\(likeNum)", for: .selected) | 223 | likeBtn.setTitle("\(likeNum)", for: .selected) |
| 214 | 224 | ||
| 215 | self.updateCellBlock?(false, likeBtn.isSelected,likeNum, false, "2",self.vodPlayBlockListModel!.list.first!) | 225 | self.updateCellBlock?(false, likeBtn.isSelected,likeNum, false, "2",self.vodPlayBlockListModel!.list.first!) |
| 216 | } | 226 | } |
| 217 | @objc func collectionBtnAction(){ | 227 | @objc func collectionBtnAction(){ |
| 218 | - collectionBtn.isSelected = collectionBtn.isSelected ? false : true | 228 | + |
| 229 | + if metaAppDelegate.isLogin{ | ||
| 230 | + collectionBtn.isSelected = collectionBtn.isSelected ? false : true | ||
| 231 | + }else{ | ||
| 232 | + collectionBtn.isSelected = false | ||
| 233 | + } | ||
| 219 | self.updateCellBlock?(false, false,0, true, "3",self.vodPlayBlockListModel!.list.first!) | 234 | self.updateCellBlock?(false, false,0, true, "3",self.vodPlayBlockListModel!.list.first!) |
| 220 | } | 235 | } |
| 221 | @objc func shareBtnAction(){ | 236 | @objc func shareBtnAction(){ |
metaCode/Classes/Main/HuBiLieHomePage/View/VodDetail/CNLiveVodPlayShopCell.swift
| @@ -153,6 +153,7 @@ class CNLiveVodPlayShopCell:UITableViewCell, UICollectionViewDelegate, UICollect | @@ -153,6 +153,7 @@ class CNLiveVodPlayShopCell:UITableViewCell, UICollectionViewDelegate, UICollect | ||
| 153 | } | 153 | } |
| 154 | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { | 154 | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { |
| 155 | if let vodPlayShopModel = self.albumListArr[indexPath.row] as? CNLiveVodPlayShopModel{ | 155 | if let vodPlayShopModel = self.albumListArr[indexPath.row] as? CNLiveVodPlayShopModel{ |
| 156 | + //相关推荐的商品 | ||
| 156 | 157 | ||
| 157 | let urlString = "https://managemall.cnlive.com/html/mall/1/#/pages/main/detail/detail?"+"id=\(vodPlayShopModel.id)&uid=\(UserInfoManager.shared.userInfo.uid)" | 158 | let urlString = "https://managemall.cnlive.com/html/mall/1/#/pages/main/detail/detail?"+"id=\(vodPlayShopModel.id)&uid=\(UserInfoManager.shared.userInfo.uid)" |
| 158 | 159 |
metaCode/Classes/Main/HuBiLieHomePage/View/VodDetail/CNLiveVodTrailersCell.swift
| @@ -134,6 +134,7 @@ class CNLiveVodTrailersCell:UITableViewCell, UICollectionViewDelegate, UICollect | @@ -134,6 +134,7 @@ class CNLiveVodTrailersCell:UITableViewCell, UICollectionViewDelegate, UICollect | ||
| 134 | } | 134 | } |
| 135 | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { | 135 | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { |
| 136 | if let vodAlbumListModel = self.albumListArr[indexPath.row] as? CNLiveVodPlayBlockListListModel{ | 136 | if let vodAlbumListModel = self.albumListArr[indexPath.row] as? CNLiveVodPlayBlockListListModel{ |
| 137 | + print("1111111看点index:\(indexPath.row)") | ||
| 137 | self.currSeleIdx = indexPath.row | 138 | self.currSeleIdx = indexPath.row |
| 138 | //点击某集,刷新页面 | 139 | //点击某集,刷新页面 |
| 139 | self.selectBlock?(vodAlbumListModel,currSeleIdx,self.albumListArr) | 140 | self.selectBlock?(vodAlbumListModel,currSeleIdx,self.albumListArr) |
metaCode/Classes/Main/HuBiLieHomePage/View/VodDetail/HengPing/CNLiveVodPayView.swift
| @@ -105,7 +105,11 @@ class CNLiveVodPayView:UIView,UIGestureRecognizerDelegate{ | @@ -105,7 +105,11 @@ class CNLiveVodPayView:UIView,UIGestureRecognizerDelegate{ | ||
| 105 | 105 | ||
| 106 | @objc func payBtnAction(){ | 106 | @objc func payBtnAction(){ |
| 107 | //拉起支付 | 107 | //拉起支付 |
| 108 | - self.payBlock?() | 108 | + if metaAppDelegate.isLogin{ |
| 109 | + self.payBlock?() | ||
| 110 | + }else{ | ||
| 111 | + metaAppDelegate.pushLoginVC() | ||
| 112 | + } | ||
| 109 | } | 113 | } |
| 110 | 114 | ||
| 111 | @objc func tapAction(){ | 115 | @objc func tapAction(){ |
metaCode/Classes/Main/HuBiLieHomePage/ViewModel/CNLiveHomeSearchViewModel.swift
| @@ -77,7 +77,7 @@ class CNLiveHomeSearchViewModel:NSObject,URLSessionTaskDelegate{ | @@ -77,7 +77,7 @@ class CNLiveHomeSearchViewModel:NSObject,URLSessionTaskDelegate{ | ||
| 77 | resultBlock(listModel, .success) | 77 | resultBlock(listModel, .success) |
| 78 | } | 78 | } |
| 79 | } else { | 79 | } else { |
| 80 | - showMessage(message: resp["errorMessage"] as! String) | 80 | + //showMessage(message: resp["errorMessage"] as! String) |
| 81 | resultBlock(NSNull(),.failed) | 81 | resultBlock(NSNull(),.failed) |
| 82 | } | 82 | } |
| 83 | }else{ | 83 | }else{ |
metaCode/Classes/Main/HuBiLieHomePage/ViewModel/CNLiveVodPlayViewModel.swift
| @@ -36,7 +36,7 @@ class CNLiveVodPlayViewModel:NSObject,URLSessionTaskDelegate{ | @@ -36,7 +36,7 @@ class CNLiveVodPlayViewModel:NSObject,URLSessionTaskDelegate{ | ||
| 36 | if (errorCode == "0") { | 36 | if (errorCode == "0") { |
| 37 | resultBlock(support ? "点赞成功" : "取消点赞成功", .success) | 37 | resultBlock(support ? "点赞成功" : "取消点赞成功", .success) |
| 38 | } else { | 38 | } else { |
| 39 | - showMessage(message: resp["errorMessage"] as! String) | 39 | + //showMessage(message: resp["errorMessage"] as! String) |
| 40 | resultBlock(NSNull(),.failed) | 40 | resultBlock(NSNull(),.failed) |
| 41 | } | 41 | } |
| 42 | } else { | 42 | } else { |
| @@ -81,7 +81,7 @@ class CNLiveVodPlayViewModel:NSObject,URLSessionTaskDelegate{ | @@ -81,7 +81,7 @@ class CNLiveVodPlayViewModel:NSObject,URLSessionTaskDelegate{ | ||
| 81 | if (errorCode == "0") { | 81 | if (errorCode == "0") { |
| 82 | resultBlock("成功", .success) | 82 | resultBlock("成功", .success) |
| 83 | } else { | 83 | } else { |
| 84 | - showMessage(message: resp["errorMessage"] as! String) | 84 | + //showMessage(message: resp["errorMessage"] as! String) |
| 85 | resultBlock(NSNull(),.failed) | 85 | resultBlock(NSNull(),.failed) |
| 86 | } | 86 | } |
| 87 | } else { | 87 | } else { |
metaCode/Classes/Main/LoginPage/Controller/CNLiveLoginViewController.swift
| @@ -339,13 +339,14 @@ class CNLiveLoginViewController : CNLiveBaseViewController, UITextViewDelegate { | @@ -339,13 +339,14 @@ class CNLiveLoginViewController : CNLiveBaseViewController, UITextViewDelegate { | ||
| 339 | UserDefaults.standard.synchronize() | 339 | UserDefaults.standard.synchronize() |
| 340 | } | 340 | } |
| 341 | 341 | ||
| 342 | + NotificationCenter.default.post(name: Notification.Name.LoginManage.CNLiveLoginSuccessNotification, object: nil) | ||
| 343 | + metaAppDelegate.isLogin = true | ||
| 342 | if self.navBackButton.isHidden{ | 344 | if self.navBackButton.isHidden{ |
| 345 | + //未登录push过来的 | ||
| 343 | let window = UIApplication.shared.delegate?.window | 346 | let window = UIApplication.shared.delegate?.window |
| 344 | window??.rootViewController = CNLiveBaseTabBarViewController.init() | 347 | window??.rootViewController = CNLiveBaseTabBarViewController.init() |
| 345 | }else{ | 348 | }else{ |
| 346 | //发通知 | 349 | //发通知 |
| 347 | - NotificationCenter.default.post(name: Notification.Name.LoginManage.CNLiveLoginSuccessNotification, object: nil) | ||
| 348 | - metaAppDelegate.isLogin = true | ||
| 349 | self.navigationController?.popViewController(animated: true) | 350 | self.navigationController?.popViewController(animated: true) |
| 350 | } | 351 | } |
| 351 | 352 | ||
| @@ -478,13 +479,13 @@ class CNLiveLoginViewController : CNLiveBaseViewController, UITextViewDelegate { | @@ -478,13 +479,13 @@ class CNLiveLoginViewController : CNLiveBaseViewController, UITextViewDelegate { | ||
| 478 | UserDefaults.standard.synchronize() | 479 | UserDefaults.standard.synchronize() |
| 479 | } | 480 | } |
| 480 | 481 | ||
| 482 | + NotificationCenter.default.post(name: Notification.Name.LoginManage.CNLiveLoginSuccessNotification, object: nil) | ||
| 483 | + metaAppDelegate.isLogin = true | ||
| 481 | if self.navBackButton.isHidden{ | 484 | if self.navBackButton.isHidden{ |
| 482 | let window = UIApplication.shared.delegate?.window | 485 | let window = UIApplication.shared.delegate?.window |
| 483 | window??.rootViewController = CNLiveBaseTabBarViewController.init() | 486 | window??.rootViewController = CNLiveBaseTabBarViewController.init() |
| 484 | }else{ | 487 | }else{ |
| 485 | //发通知 | 488 | //发通知 |
| 486 | - NotificationCenter.default.post(name: Notification.Name.LoginManage.CNLiveLoginSuccessNotification, object: nil) | ||
| 487 | - metaAppDelegate.isLogin = true | ||
| 488 | self.navigationController?.popViewController(animated: true) | 489 | self.navigationController?.popViewController(animated: true) |
| 489 | } | 490 | } |
| 490 | } | 491 | } |
| @@ -515,14 +516,13 @@ class CNLiveLoginViewController : CNLiveBaseViewController, UITextViewDelegate { | @@ -515,14 +516,13 @@ class CNLiveLoginViewController : CNLiveBaseViewController, UITextViewDelegate { | ||
| 515 | UserDefaults.standard.setValue(tempDic, forKey: UserInfoManager.shared.userInfo.uid) | 516 | UserDefaults.standard.setValue(tempDic, forKey: UserInfoManager.shared.userInfo.uid) |
| 516 | UserDefaults.standard.synchronize() | 517 | UserDefaults.standard.synchronize() |
| 517 | } | 518 | } |
| 518 | - | 519 | + NotificationCenter.default.post(name: Notification.Name.LoginManage.CNLiveLoginSuccessNotification, object: nil) |
| 520 | + metaAppDelegate.isLogin = true | ||
| 519 | if self.navBackButton.isHidden{ | 521 | if self.navBackButton.isHidden{ |
| 520 | let window = UIApplication.shared.delegate?.window | 522 | let window = UIApplication.shared.delegate?.window |
| 521 | window??.rootViewController = CNLiveBaseTabBarViewController.init() | 523 | window??.rootViewController = CNLiveBaseTabBarViewController.init() |
| 522 | }else{ | 524 | }else{ |
| 523 | //发通知 | 525 | //发通知 |
| 524 | - NotificationCenter.default.post(name: Notification.Name.LoginManage.CNLiveLoginSuccessNotification, object: nil) | ||
| 525 | - metaAppDelegate.isLogin = true | ||
| 526 | self.navigationController?.popViewController(animated: true) | 526 | self.navigationController?.popViewController(animated: true) |
| 527 | } | 527 | } |
| 528 | } | 528 | } |
| @@ -609,13 +609,13 @@ extension CNLiveLoginViewController { | @@ -609,13 +609,13 @@ extension CNLiveLoginViewController { | ||
| 609 | UserDefaults.standard.synchronize() | 609 | UserDefaults.standard.synchronize() |
| 610 | } | 610 | } |
| 611 | 611 | ||
| 612 | + //发通知 | ||
| 613 | + NotificationCenter.default.post(name: Notification.Name.LoginManage.CNLiveLoginSuccessNotification, object: nil) | ||
| 614 | + metaAppDelegate.isLogin = true | ||
| 612 | if self.navBackButton.isHidden{ | 615 | if self.navBackButton.isHidden{ |
| 613 | let window = UIApplication.shared.delegate?.window | 616 | let window = UIApplication.shared.delegate?.window |
| 614 | window??.rootViewController = CNLiveBaseTabBarViewController.init() | 617 | window??.rootViewController = CNLiveBaseTabBarViewController.init() |
| 615 | }else{ | 618 | }else{ |
| 616 | - //发通知 | ||
| 617 | - NotificationCenter.default.post(name: Notification.Name.LoginManage.CNLiveLoginSuccessNotification, object: nil) | ||
| 618 | - metaAppDelegate.isLogin = true | ||
| 619 | self.navigationController?.popViewController(animated: true) | 619 | self.navigationController?.popViewController(animated: true) |
| 620 | } | 620 | } |
| 621 | } | 621 | } |
metaCode/Classes/Main/LoginPage/ViewModel/CNLiveLoginViewModel.swift
| @@ -59,7 +59,7 @@ class CNLiveLoginViewModel : NSObject { | @@ -59,7 +59,7 @@ class CNLiveLoginViewModel : NSObject { | ||
| 59 | showMessage(message: "验证码已发送") | 59 | showMessage(message: "验证码已发送") |
| 60 | resultBlock() | 60 | resultBlock() |
| 61 | } else { | 61 | } else { |
| 62 | - showMessage(message: resp["errorMessage"] as! String) | 62 | + //showMessage(message: resp["errorMessage"] as! String) |
| 63 | } | 63 | } |
| 64 | } else{ | 64 | } else{ |
| 65 | showMessage(message: "获取验证码失败") | 65 | showMessage(message: "获取验证码失败") |
| @@ -103,7 +103,7 @@ class CNLiveLoginViewModel : NSObject { | @@ -103,7 +103,7 @@ class CNLiveLoginViewModel : NSObject { | ||
| 103 | showMessage(message: "验证码已发送") | 103 | showMessage(message: "验证码已发送") |
| 104 | resultBlock() | 104 | resultBlock() |
| 105 | } else { | 105 | } else { |
| 106 | - showMessage(message: resp["errorMessage"] as! String) | 106 | + //showMessage(message: resp["errorMessage"] as! String) |
| 107 | } | 107 | } |
| 108 | } else{ | 108 | } else{ |
| 109 | showMessage(message: "获取验证码失败") | 109 | showMessage(message: "获取验证码失败") |
| @@ -174,7 +174,7 @@ class CNLiveLoginViewModel : NSObject { | @@ -174,7 +174,7 @@ class CNLiveLoginViewModel : NSObject { | ||
| 174 | resultBlock() | 174 | resultBlock() |
| 175 | } | 175 | } |
| 176 | } else { | 176 | } else { |
| 177 | - showMessage(message: resp["errorMessage"] as! String) | 177 | + //showMessage(message: resp["errorMessage"] as! String) |
| 178 | endrefreshBlock() | 178 | endrefreshBlock() |
| 179 | } | 179 | } |
| 180 | } else { | 180 | } else { |
| @@ -217,7 +217,7 @@ class CNLiveLoginViewModel : NSObject { | @@ -217,7 +217,7 @@ class CNLiveLoginViewModel : NSObject { | ||
| 217 | resultBlock(userInfoModel, .success) | 217 | resultBlock(userInfoModel, .success) |
| 218 | } | 218 | } |
| 219 | } else { | 219 | } else { |
| 220 | - showMessage(message: resp["errorMessage"] as! String) | 220 | + //showMessage(message: resp["errorMessage"] as! String) |
| 221 | if errorCode as? String == "42013"{ | 221 | if errorCode as? String == "42013"{ |
| 222 | resultBlock(errorCode ?? "", .failed) | 222 | resultBlock(errorCode ?? "", .failed) |
| 223 | }else{ | 223 | }else{ |
| @@ -262,7 +262,7 @@ class CNLiveLoginViewModel : NSObject { | @@ -262,7 +262,7 @@ class CNLiveLoginViewModel : NSObject { | ||
| 262 | resultBlock(userInfoModel, .success) | 262 | resultBlock(userInfoModel, .success) |
| 263 | } | 263 | } |
| 264 | } else { | 264 | } else { |
| 265 | - showMessage(message: resp["errorMessage"] as! String) | 265 | + //showMessage(message: resp["errorMessage"] as! String) |
| 266 | resultBlock(NSNull(), .failed) | 266 | resultBlock(NSNull(), .failed) |
| 267 | } | 267 | } |
| 268 | } else { | 268 | } else { |
| @@ -307,7 +307,9 @@ class CNLiveLoginViewModel : NSObject { | @@ -307,7 +307,9 @@ class CNLiveLoginViewModel : NSObject { | ||
| 307 | resultBlock(NSNull(), .failed) | 307 | resultBlock(NSNull(), .failed) |
| 308 | } | 308 | } |
| 309 | } else { | 309 | } else { |
| 310 | - showMessage(message: "登录失败") | 310 | + let resp = result as? NSDictionary |
| 311 | + let err = resp?["errorMessage"] as? String | ||
| 312 | + showMessage(message: err ?? "登录失败") | ||
| 311 | resultBlock(NSNull(), .failed) | 313 | resultBlock(NSNull(), .failed) |
| 312 | } | 314 | } |
| 313 | } | 315 | } |
metaCode/Classes/Main/MinePage/View/CNLiveMineHeaderView.swift
| @@ -85,9 +85,15 @@ class MineHeaderView : UIView { | @@ -85,9 +85,15 @@ class MineHeaderView : UIView { | ||
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | public func updateHeaderView() { | 87 | public func updateHeaderView() { |
| 88 | - iconView.kf.indicatorType = .activity | ||
| 89 | - iconView.kf.setImage(with: URL(string: UserInfoManager.shared.userInfo.bigFaceUrl), placeholder: UIImage(named: "mine_header_icon_defult_ava")) | ||
| 90 | - nameLabel.text = UserInfoManager.shared.userInfo.nickName | 88 | + if metaAppDelegate.isLogin{ |
| 89 | + iconView.kf.indicatorType = .activity | ||
| 90 | + iconView.kf.setImage(with: URL(string: UserInfoManager.shared.userInfo.bigFaceUrl), placeholder: UIImage(named: "mine_header_icon_defult_ava")) | ||
| 91 | + nameLabel.text = UserInfoManager.shared.userInfo.nickName | ||
| 92 | + loginBtn.isHidden = true | ||
| 93 | + }else{ | ||
| 94 | + loginBtn.isHidden = false | ||
| 95 | + } | ||
| 96 | + | ||
| 91 | } | 97 | } |
| 92 | 98 | ||
| 93 | required init?(coder: NSCoder) { | 99 | required init?(coder: NSCoder) { |
metaCode/Classes/Main/MinePage/ViewModel/CNLiveMineViewModel.swift
| @@ -133,7 +133,7 @@ class CNLiveMineViewModel: NSObject { | @@ -133,7 +133,7 @@ class CNLiveMineViewModel: NSObject { | ||
| 133 | UserInfoManager.cacheUserInfo(userInfo: userModel) | 133 | UserInfoManager.cacheUserInfo(userInfo: userModel) |
| 134 | resultBlock(model, .success) | 134 | resultBlock(model, .success) |
| 135 | } else { | 135 | } else { |
| 136 | - showMessage(message: resp["errorMessage"] as! String) | 136 | + //showMessage(message: resp["errorMessage"] as! String) |
| 137 | resultBlock(NSNull(), .failed) | 137 | resultBlock(NSNull(), .failed) |
| 138 | } | 138 | } |
| 139 | } else { | 139 | } else { |
| @@ -193,7 +193,7 @@ class CNLiveMineViewModel: NSObject { | @@ -193,7 +193,7 @@ class CNLiveMineViewModel: NSObject { | ||
| 193 | UserInfoManager.cacheUserInfo(userInfo: userModel) | 193 | UserInfoManager.cacheUserInfo(userInfo: userModel) |
| 194 | resultBlock(model, .success) | 194 | resultBlock(model, .success) |
| 195 | } else { | 195 | } else { |
| 196 | - showMessage(message: resp["errorMessage"] as! String) | 196 | + //showMessage(message: resp["errorMessage"] as! String) |
| 197 | resultBlock(NSNull(), .failed) | 197 | resultBlock(NSNull(), .failed) |
| 198 | } | 198 | } |
| 199 | } else { | 199 | } else { |
| @@ -234,7 +234,7 @@ class CNLiveMineViewModel: NSObject { | @@ -234,7 +234,7 @@ class CNLiveMineViewModel: NSObject { | ||
| 234 | 234 | ||
| 235 | resultBlock(resp, .success) | 235 | resultBlock(resp, .success) |
| 236 | } else { | 236 | } else { |
| 237 | - showMessage(message: resp["errorMessage"] as! String) | 237 | + //showMessage(message: resp["errorMessage"] as! String) |
| 238 | resultBlock(NSNull(), .failed) | 238 | resultBlock(NSNull(), .failed) |
| 239 | } | 239 | } |
| 240 | } else { | 240 | } else { |
| @@ -291,7 +291,7 @@ class CNLiveMineViewModel: NSObject { | @@ -291,7 +291,7 @@ class CNLiveMineViewModel: NSObject { | ||
| 291 | showMessage(message: "更改成功") | 291 | showMessage(message: "更改成功") |
| 292 | resultBlock(type,true) | 292 | resultBlock(type,true) |
| 293 | } else { | 293 | } else { |
| 294 | - showMessage(message: resp["errorMessage"] as! String) | 294 | + //showMessage(message: resp["errorMessage"] as! String) |
| 295 | resultBlock(type,false) | 295 | resultBlock(type,false) |
| 296 | } | 296 | } |
| 297 | } else { | 297 | } else { |
| @@ -341,7 +341,7 @@ class CNLiveMineViewModel: NSObject { | @@ -341,7 +341,7 @@ class CNLiveMineViewModel: NSObject { | ||
| 341 | UserInfoManager.cacheUserInfo(userInfo: userInfo) | 341 | UserInfoManager.cacheUserInfo(userInfo: userInfo) |
| 342 | resultBlock(.icon,true) | 342 | resultBlock(.icon,true) |
| 343 | } else { | 343 | } else { |
| 344 | - showMessage(message: resp["errorMessage"] as! String) | 344 | + //showMessage(message: resp["errorMessage"] as! String) |
| 345 | resultBlock(.icon,false) | 345 | resultBlock(.icon,false) |
| 346 | } | 346 | } |
| 347 | } else { | 347 | } else { |
| @@ -383,7 +383,7 @@ class CNLiveMineViewModel: NSObject { | @@ -383,7 +383,7 @@ class CNLiveMineViewModel: NSObject { | ||
| 383 | UserInfoManager.cacheUserInfo(userInfo: userInfo) | 383 | UserInfoManager.cacheUserInfo(userInfo: userInfo) |
| 384 | resultBlock(.other,true) | 384 | resultBlock(.other,true) |
| 385 | } else { | 385 | } else { |
| 386 | - showMessage(message: resp["errorMessage"] as! String) | 386 | + //showMessage(message: resp["errorMessage"] as! String) |
| 387 | resultBlock(.other,false) | 387 | resultBlock(.other,false) |
| 388 | } | 388 | } |
| 389 | } else { | 389 | } else { |
| @@ -435,7 +435,7 @@ class CNLiveMineViewModel: NSObject { | @@ -435,7 +435,7 @@ class CNLiveMineViewModel: NSObject { | ||
| 435 | if (errorCode == "0") { | 435 | if (errorCode == "0") { |
| 436 | resultBlock(.other,true) | 436 | resultBlock(.other,true) |
| 437 | } else { | 437 | } else { |
| 438 | - showMessage(message: resp["errorMessage"] as! String) | 438 | + //showMessage(message: resp["errorMessage"] as! String) |
| 439 | resultBlock(.other,false) | 439 | resultBlock(.other,false) |
| 440 | } | 440 | } |
| 441 | } else { | 441 | } else { |
| @@ -464,7 +464,7 @@ class CNLiveMineViewModel: NSObject { | @@ -464,7 +464,7 @@ class CNLiveMineViewModel: NSObject { | ||
| 464 | let newsModel = dictionaryToModel(resp as! [String : Any], NewsModel.self,"data") as! NewsModel | 464 | let newsModel = dictionaryToModel(resp as! [String : Any], NewsModel.self,"data") as! NewsModel |
| 465 | resultBlock(newsModel,.success) | 465 | resultBlock(newsModel,.success) |
| 466 | } else { | 466 | } else { |
| 467 | - showMessage(message: resp["errorMessage"] as! String) | 467 | + //showMessage(message: resp["errorMessage"] as! String) |
| 468 | resultBlock(NSNull(),.failed) | 468 | resultBlock(NSNull(),.failed) |
| 469 | } | 469 | } |
| 470 | } else { | 470 | } else { |
| @@ -515,7 +515,7 @@ class CNLiveMineViewModel: NSObject { | @@ -515,7 +515,7 @@ class CNLiveMineViewModel: NSObject { | ||
| 515 | listModel.list = StandSortManager.sortAllListData(stands: tempArray as NSArray) as! [StandListModel] | 515 | listModel.list = StandSortManager.sortAllListData(stands: tempArray as NSArray) as! [StandListModel] |
| 516 | resultBlock(listModel,.success) | 516 | resultBlock(listModel,.success) |
| 517 | }else{ | 517 | }else{ |
| 518 | - showMessage(message: resp["errorMessage"] as! String) | 518 | + //showMessage(message: resp["errorMessage"] as! String) |
| 519 | resultBlock(NSNull(),.failed) | 519 | resultBlock(NSNull(),.failed) |
| 520 | } | 520 | } |
| 521 | } | 521 | } |
| @@ -562,7 +562,7 @@ class CNLiveMineViewModel: NSObject { | @@ -562,7 +562,7 @@ class CNLiveMineViewModel: NSObject { | ||
| 562 | let listModel = dictionaryToModel(resp as! [String : Any], MineGetUserMsgUsersModel.self,"data") as! MineGetUserMsgUsersModel | 562 | let listModel = dictionaryToModel(resp as! [String : Any], MineGetUserMsgUsersModel.self,"data") as! MineGetUserMsgUsersModel |
| 563 | resultBlock(listModel,.success) | 563 | resultBlock(listModel,.success) |
| 564 | } else { | 564 | } else { |
| 565 | - showMessage(message: resp["errorMessage"] as! String) | 565 | + //showMessage(message: resp["errorMessage"] as! String) |
| 566 | resultBlock(NSNull(),.failed) | 566 | resultBlock(NSNull(),.failed) |
| 567 | } | 567 | } |
| 568 | } else { | 568 | } else { |
| @@ -615,7 +615,7 @@ class CNLiveMineViewModel: NSObject { | @@ -615,7 +615,7 @@ class CNLiveMineViewModel: NSObject { | ||
| 615 | listModel.list = StandSortManager.sortMyListData(auths: tempArray as NSArray) as! [MineAuthListModel] | 615 | listModel.list = StandSortManager.sortMyListData(auths: tempArray as NSArray) as! [MineAuthListModel] |
| 616 | resultBlock(listModel,.success) | 616 | resultBlock(listModel,.success) |
| 617 | }else{ | 617 | }else{ |
| 618 | - showMessage(message: resp["errorMessage"] as! String) | 618 | + //showMessage(message: resp["errorMessage"] as! String) |
| 619 | resultBlock(NSNull(),.failed) | 619 | resultBlock(NSNull(),.failed) |
| 620 | } | 620 | } |
| 621 | } | 621 | } |
| @@ -691,7 +691,7 @@ class CNLiveMineViewModel: NSObject { | @@ -691,7 +691,7 @@ class CNLiveMineViewModel: NSObject { | ||
| 691 | if (errorCode == "0") { | 691 | if (errorCode == "0") { |
| 692 | resultBlock(NSNull(),.success) | 692 | resultBlock(NSNull(),.success) |
| 693 | } else { | 693 | } else { |
| 694 | - showMessage(message: resp["errorMessage"] as! String) | 694 | + //showMessage(message: resp["errorMessage"] as! String) |
| 695 | resultBlock(NSNull(),.failed) | 695 | resultBlock(NSNull(),.failed) |
| 696 | } | 696 | } |
| 697 | } else { | 697 | } else { |
| @@ -748,7 +748,7 @@ class CNLiveMineViewModel: NSObject { | @@ -748,7 +748,7 @@ class CNLiveMineViewModel: NSObject { | ||
| 748 | resultBlock(resultArr,.success) | 748 | resultBlock(resultArr,.success) |
| 749 | } | 749 | } |
| 750 | } else { | 750 | } else { |
| 751 | - showMessage(message: resp["errorMessage"] as! String) | 751 | + //showMessage(message: resp["errorMessage"] as! String) |
| 752 | resultBlock(NSNull(),.failed) | 752 | resultBlock(NSNull(),.failed) |
| 753 | } | 753 | } |
| 754 | } else { | 754 | } else { |
| @@ -842,7 +842,7 @@ class CNLiveMineViewModel: NSObject { | @@ -842,7 +842,7 @@ class CNLiveMineViewModel: NSObject { | ||
| 842 | } | 842 | } |
| 843 | } | 843 | } |
| 844 | } else { | 844 | } else { |
| 845 | - showMessage(message: resp["errorMessage"] as! String) | 845 | + //showMessage(message: resp["errorMessage"] as! String) |
| 846 | resultBlock(NSNull(),.failed) | 846 | resultBlock(NSNull(),.failed) |
| 847 | } | 847 | } |
| 848 | } else { | 848 | } else { |
| @@ -1078,7 +1078,7 @@ class CNLiveMineViewModel: NSObject { | @@ -1078,7 +1078,7 @@ class CNLiveMineViewModel: NSObject { | ||
| 1078 | } | 1078 | } |
| 1079 | resultBlock(tempArray,.success) | 1079 | resultBlock(tempArray,.success) |
| 1080 | } else { | 1080 | } else { |
| 1081 | - showMessage(message: resp["errorMessage"] as! String) | 1081 | + //showMessage(message: resp["errorMessage"] as! String) |
| 1082 | resultBlock(NSNull(),.failed) | 1082 | resultBlock(NSNull(),.failed) |
| 1083 | } | 1083 | } |
| 1084 | } else { | 1084 | } else { |
| @@ -1123,7 +1123,7 @@ class CNLiveMineViewModel: NSObject { | @@ -1123,7 +1123,7 @@ class CNLiveMineViewModel: NSObject { | ||
| 1123 | let listModel = dictionaryToModel(resp as! [String : Any], MineTradingRecordBaseModel.self,"data") as! MineTradingRecordBaseModel | 1123 | let listModel = dictionaryToModel(resp as! [String : Any], MineTradingRecordBaseModel.self,"data") as! MineTradingRecordBaseModel |
| 1124 | resultBlock(listModel,.success) | 1124 | resultBlock(listModel,.success) |
| 1125 | } else { | 1125 | } else { |
| 1126 | - showMessage(message: resp["errorMessage"] as! String) | 1126 | + //showMessage(message: resp["errorMessage"] as! String) |
| 1127 | resultBlock(NSNull(),.failed) | 1127 | resultBlock(NSNull(),.failed) |
| 1128 | } | 1128 | } |
| 1129 | } else { | 1129 | } else { |
| @@ -1169,7 +1169,7 @@ class CNLiveMineViewModel: NSObject { | @@ -1169,7 +1169,7 @@ class CNLiveMineViewModel: NSObject { | ||
| 1169 | let listModel = dictionaryToModel(resp as! [String : Any], MineIntegralRecordModel.self,"data") as! MineIntegralRecordModel | 1169 | let listModel = dictionaryToModel(resp as! [String : Any], MineIntegralRecordModel.self,"data") as! MineIntegralRecordModel |
| 1170 | resultBlock(listModel,.success) | 1170 | resultBlock(listModel,.success) |
| 1171 | } else { | 1171 | } else { |
| 1172 | - showMessage(message: resp["errorMessage"] as! String) | 1172 | + //showMessage(message: resp["errorMessage"] as! String) |
| 1173 | resultBlock(NSNull(),.failed) | 1173 | resultBlock(NSNull(),.failed) |
| 1174 | } | 1174 | } |
| 1175 | } else { | 1175 | } else { |
| @@ -1205,7 +1205,7 @@ class CNLiveMineViewModel: NSObject { | @@ -1205,7 +1205,7 @@ class CNLiveMineViewModel: NSObject { | ||
| 1205 | if (errorCode == "0") { | 1205 | if (errorCode == "0") { |
| 1206 | resultBlock(resp,.success) | 1206 | resultBlock(resp,.success) |
| 1207 | } else { | 1207 | } else { |
| 1208 | - showMessage(message: resp["errorMessage"] as! String) | 1208 | + //showMessage(message: resp["errorMessage"] as! String) |
| 1209 | resultBlock(NSNull(),.failed) | 1209 | resultBlock(NSNull(),.failed) |
| 1210 | } | 1210 | } |
| 1211 | } else { | 1211 | } else { |
| @@ -1349,7 +1349,7 @@ class CNLiveMineViewModel: NSObject { | @@ -1349,7 +1349,7 @@ class CNLiveMineViewModel: NSObject { | ||
| 1349 | } else if (errorCode == "455") { | 1349 | } else if (errorCode == "455") { |
| 1350 | resultBlock("455",.success) | 1350 | resultBlock("455",.success) |
| 1351 | } else { | 1351 | } else { |
| 1352 | - showMessage(message: resp["errorMessage"] as! String) | 1352 | + //showMessage(message: resp["errorMessage"] as! String) |
| 1353 | resultBlock(NSNull(),.failed) | 1353 | resultBlock(NSNull(),.failed) |
| 1354 | } | 1354 | } |
| 1355 | } else { | 1355 | } else { |
metaCode/Classes/Main/VideoPage/ViewModel/CNLiveShortVideoViewModel.swift
| @@ -67,7 +67,7 @@ class CNLiveShortVideoViewModel: NSObject { | @@ -67,7 +67,7 @@ class CNLiveShortVideoViewModel: NSObject { | ||
| 67 | } | 67 | } |
| 68 | } | 68 | } |
| 69 | } else { | 69 | } else { |
| 70 | - showMessage(message: resp["errorMessage"] as! String) | 70 | + //showMessage(message: resp["errorMessage"] as! String) |
| 71 | reultShortVideoBlock(NSNull(),.failed) | 71 | reultShortVideoBlock(NSNull(),.failed) |
| 72 | } | 72 | } |
| 73 | } else { | 73 | } else { |
| @@ -109,7 +109,7 @@ class CNLiveShortVideoViewModel: NSObject { | @@ -109,7 +109,7 @@ class CNLiveShortVideoViewModel: NSObject { | ||
| 109 | reultShortVideoBlock(listModel, .success) | 109 | reultShortVideoBlock(listModel, .success) |
| 110 | } | 110 | } |
| 111 | } else { | 111 | } else { |
| 112 | - showMessage(message: resp["errorMessage"] as! String) | 112 | + //showMessage(message: resp["errorMessage"] as! String) |
| 113 | reultShortVideoBlock(NSNull(),.failed) | 113 | reultShortVideoBlock(NSNull(),.failed) |
| 114 | } | 114 | } |
| 115 | } else { | 115 | } else { |
| @@ -168,7 +168,7 @@ class CNLiveShortVideoViewModel: NSObject { | @@ -168,7 +168,7 @@ class CNLiveShortVideoViewModel: NSObject { | ||
| 168 | reultShortVideoBlock(support ? "取消点赞成功" : "点赞成功", .success) | 168 | reultShortVideoBlock(support ? "取消点赞成功" : "点赞成功", .success) |
| 169 | } | 169 | } |
| 170 | } else { | 170 | } else { |
| 171 | - showMessage(message: resp["errorMessage"] as! String) | 171 | + //showMessage(message: resp["errorMessage"] as! String) |
| 172 | reultShortVideoBlock(NSNull(),.failed) | 172 | reultShortVideoBlock(NSNull(),.failed) |
| 173 | } | 173 | } |
| 174 | } else { | 174 | } else { |
| @@ -208,7 +208,7 @@ class CNLiveShortVideoViewModel: NSObject { | @@ -208,7 +208,7 @@ class CNLiveShortVideoViewModel: NSObject { | ||
| 208 | if (errorCode == "0") { | 208 | if (errorCode == "0") { |
| 209 | reultShortVideoBlock(type ? "取消收藏成功" : "收藏成功", .success) | 209 | reultShortVideoBlock(type ? "取消收藏成功" : "收藏成功", .success) |
| 210 | } else { | 210 | } else { |
| 211 | - showMessage(message: resp["errorMessage"] as! String) | 211 | + //showMessage(message: resp["errorMessage"] as! String) |
| 212 | reultShortVideoBlock(NSNull(),.failed) | 212 | reultShortVideoBlock(NSNull(),.failed) |
| 213 | } | 213 | } |
| 214 | } else { | 214 | } else { |
| @@ -328,7 +328,7 @@ class CNLiveShortVideoViewModel: NSObject { | @@ -328,7 +328,7 @@ class CNLiveShortVideoViewModel: NSObject { | ||
| 328 | reultShortVideoBlock(listModel, .success) | 328 | reultShortVideoBlock(listModel, .success) |
| 329 | } | 329 | } |
| 330 | } else { | 330 | } else { |
| 331 | - showMessage(message: resp["errorMessage"] as! String) | 331 | + //showMessage(message: resp["errorMessage"] as! String) |
| 332 | reultShortVideoBlock(NSNull(),.failed) | 332 | reultShortVideoBlock(NSNull(),.failed) |
| 333 | } | 333 | } |
| 334 | } else { | 334 | } else { |
metaCode/Classes/Other/AppDelegate.swift
| @@ -181,7 +181,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { | @@ -181,7 +181,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { | ||
| 181 | } | 181 | } |
| 182 | func pushLoginVC(){ | 182 | func pushLoginVC(){ |
| 183 | currentViewController()?.navigationController?.pushViewController(CNLiveLoginViewController.init(), animated: true) | 183 | currentViewController()?.navigationController?.pushViewController(CNLiveLoginViewController.init(), animated: true) |
| 184 | - } | 184 | + } |
| 185 | 185 | ||
| 186 | 186 | ||
| 187 | // MARK: - 响应录屏状态变化 | 187 | // MARK: - 响应录屏状态变化 |