Commit 36115f604a57b647a701a196156e1cec626b3a56

Authored by “张旭”
1 parent f7882b76

跳转播放页

metaCode/Classes/Main/HomePage/View/VerticalViews/DownSlide/CNDownSlideSingleCourseCell.swift
@@ -385,7 +385,7 @@ class CNDownSlideSingleCourseCell: UITableViewCell, UICollectionViewDelegate, UI @@ -385,7 +385,7 @@ class CNDownSlideSingleCourseCell: UITableViewCell, UICollectionViewDelegate, UI
385 //实时热榜 385 //实时热榜
386 contentView.addSubview(bgBackView) 386 contentView.addSubview(bgBackView)
387 387
388 - bgBackView.frame = CGRect(x: DownSlideRecommendLeftGap, y: 0,width:DownSlideSingleCourseW , height:CGFloat(model.cellH)) 388 + bgBackView.frame = CGRect(x: DownSlideRecommendLeftGap, y: 0,width:DownSlideSingleCourseW , height:CGFloat(model.cellH)-DownSlideRecommendLeftGap)
389 // 设置阴影效果 389 // 设置阴影效果
390 bgBackView.layer.masksToBounds = false 390 bgBackView.layer.masksToBounds = false
391 //定义view的阴影颜色 391 //定义view的阴影颜色
metaCode/Classes/Main/HomePages/Controller/PlayletHomePage/CNLivePlayletHomePageController.swift
@@ -185,7 +185,7 @@ class CNLivePlayletHomePageController:CNLiveBaseViewController, UITableViewDataS @@ -185,7 +185,7 @@ class CNLivePlayletHomePageController:CNLiveBaseViewController, UITableViewDataS
185 self.navigationController?.viewControllers = tempArray as! [CNLiveBaseViewController] 185 self.navigationController?.viewControllers = tempArray as! [CNLiveBaseViewController]
186 //跳转播放页 186 //跳转播放页
187 let dataArray = Array(self.albumModelArr) as! [CNLiveAlbumListModel] 187 let dataArray = Array(self.albumModelArr) as! [CNLiveAlbumListModel]
188 - navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveShortVideoViewController(aid: aid, page: self.pageNum, currentIndex: indexPath.row, dataArray: dataArray), animated: pushAnimated) 188 + CNLiveDownSlideTool.pushShortVideoController(aid: aid, page: self.pageNum, currentIndex: indexPath.row, dataArray: dataArray, navigationVC: navigationViewController().visibleViewController?.navigationController)
189 } 189 }
190 } 190 }
191 } 191 }
metaCode/Classes/Main/HomePages/View/HomepageDetail/CNLiveAlbumCell.swift
@@ -157,7 +157,7 @@ class CNLiveAlbumCell:UITableViewCell{ @@ -157,7 +157,7 @@ class CNLiveAlbumCell:UITableViewCell{
157 self.enterBlock!(self.albumModel!) 157 self.enterBlock!(self.albumModel!)
158 }else if self.albumModel?.model == kCNDownSlideContentsModelModelAlbum_ugc{ 158 }else if self.albumModel?.model == kCNDownSlideContentsModelModelAlbum_ugc{
159 //短剧-跳转短剧播放页 159 //短剧-跳转短剧播放页
160 - navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveShortVideoViewController(aid: aid), animated: pushAnimated) 160 + CNLiveDownSlideTool.pushShortVideoController(contentId: aid, navigationVC: navigationViewController().visibleViewController?.navigationController)
161 }else if self.albumModel?.model == kCNDownSlideContentsModelModelAlbum_video{ 161 }else if self.albumModel?.model == kCNDownSlideContentsModelModelAlbum_video{
162 //课程-跳转h5视频专辑页 162 //课程-跳转h5视频专辑页
163 self.enterBlock!(self.albumModel!) 163 self.enterBlock!(self.albumModel!)
@@ -166,7 +166,7 @@ class CNLiveAlbumCell:UITableViewCell{ @@ -166,7 +166,7 @@ class CNLiveAlbumCell:UITableViewCell{
166 } 166 }
167 }else if (self.albumMsgModel != nil){ 167 }else if (self.albumMsgModel != nil){
168 //短剧-跳转短剧播放页 168 //短剧-跳转短剧播放页
169 - navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveShortVideoViewController(aid: aid), animated: pushAnimated) 169 + CNLiveDownSlideTool.pushShortVideoController(contentId: aid, navigationVC: navigationViewController().visibleViewController?.navigationController)
170 170
171 } 171 }
172 172
metaCode/Classes/Main/LoginPage/Controller/CNLiveLoginViewController.swift
@@ -271,7 +271,7 @@ class CNLiveLoginViewController : CNLiveBaseViewController, UITextViewDelegate { @@ -271,7 +271,7 @@ class CNLiveLoginViewController : CNLiveBaseViewController, UITextViewDelegate {
271 threeModel.refresh_token = userModel.refresh_token ?? "" 271 threeModel.refresh_token = userModel.refresh_token ?? ""
272 threeModel.type = CNLiveSendAuthRespWX 272 threeModel.type = CNLiveSendAuthRespWX
273 // threeModel.countryName = self!.countryStr 273 // threeModel.countryName = self!.countryStr
274 - threeModel.countryCode = self!.countryCode 274 + threeModel.countryCode = self?.countryCode ?? "86"
275 threeModel.frmId = "Apple"//[CNTools getFrmId] 275 threeModel.frmId = "Apple"//[CNTools getFrmId]
276 switch resp { 276 switch resp {
277 case CNLiveSendAuthRespApple: 277 case CNLiveSendAuthRespApple:
@@ -285,9 +285,9 @@ class CNLiveLoginViewController : CNLiveBaseViewController, UITextViewDelegate { @@ -285,9 +285,9 @@ class CNLiveLoginViewController : CNLiveBaseViewController, UITextViewDelegate {
285 break 285 break
286 } 286 }
287 if resp == CNLiveSendAuthRespApple{ 287 if resp == CNLiveSendAuthRespApple{
288 - self!.appleLogin(model: threeModel) 288 + self?.appleLogin(model: threeModel)
289 }else{ 289 }else{
290 - self!.thirdPartyLoginWithType(type: resp, model: threeModel) 290 + self?.thirdPartyLoginWithType(type: resp, model: threeModel)
291 } 291 }
292 }else{ 292 }else{
293 293
metaCode/Classes/Main/Model/CNLiveDownSlideModelLayout.swift
@@ -68,7 +68,7 @@ class CNLiveDownSlideModelLayout:NSObject{ @@ -68,7 +68,7 @@ class CNLiveDownSlideModelLayout:NSObject{
68 _slideModel?.cellH = Float(ceil(CGFloat(totalNum)*0.5)*(DownSlideTwoDuanJuH)) 68 _slideModel?.cellH = Float(ceil(CGFloat(totalNum)*0.5)*(DownSlideTwoDuanJuH))
69 }else if(_slideModel?.type == SlideModelTypeRealHotList7){//7实时热榜 69 }else if(_slideModel?.type == SlideModelTypeRealHotList7){//7实时热榜
70 70
71 - _slideModel?.cellH = Float(DownSlideRealHotListH)//+Float(DownSlideRecommendLeftGap) 71 + _slideModel?.cellH = Float(DownSlideRealHotListH)+Float(DownSlideRecommendLeftGap)
72 }else{ 72 }else{
73 _slideModel?.cellH = 0 73 _slideModel?.cellH = 0
74 } 74 }
metaCode/Classes/Main/Util/CNLiveDownSlideTool.swift
@@ -83,8 +83,8 @@ class CNLiveDownSlideTool:NSObject{ @@ -83,8 +83,8 @@ class CNLiveDownSlideTool:NSObject{
83 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) 83 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated)
84 } 84 }
85 }else if (model == kCNDownSlideContentsModelModelAlbum_ugc){ 85 }else if (model == kCNDownSlideContentsModelModelAlbum_ugc){
86 - //短剧-跳转短剧播放页  
87 - navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveShortVideoViewController(aid: contentId), animated: pushAnimated) 86 + showLoading(message: "")
  87 + self.pushShortVideoController(contentId: contentId, navigationVC: navigationViewController().visibleViewController?.navigationController)
88 }else if model == kCNDownSlideContentsModelModelServing{ 88 }else if model == kCNDownSlideContentsModelModelServing{
89 //跳转微信小程序 89 //跳转微信小程序
90 if let data = s_to.data(using: .utf8) { 90 if let data = s_to.data(using: .utf8) {
@@ -104,4 +104,39 @@ class CNLiveDownSlideTool:NSObject{ @@ -104,4 +104,39 @@ class CNLiveDownSlideTool:NSObject{
104 return 104 return
105 } 105 }
106 } 106 }
  107 +
  108 + class func pushShortVideoController(contentId:String,navigationVC:UINavigationController?){
  109 + //请求getAlbumMsg获取上次播放集数
  110 + //获取专辑详情(简介等)
  111 + CNLiveHomePageViewModel.getAlbumMsg(aid: contentId) { result, status in
  112 + hiddenLoading()
  113 + if status == .success{
  114 + let model = result as! CNLiveAlbumMsgModel
  115 + //短剧-跳转短剧播放页
  116 + let toIndex = model.episodeLast-1 <= 0 ? 0 : model.episodeLast-1
  117 + navigationVC?.pushViewController( CNLiveShortVideoViewController(aid: contentId, currentIndex: toIndex), animated: pushAnimated)
  118 + }else{
  119 + //短剧-跳转短剧播放页
  120 + navigationVC?.pushViewController(CNLiveShortVideoViewController(aid: contentId), animated: pushAnimated)
  121 + }
  122 + }
  123 + }
  124 +
  125 + class func pushShortVideoController(aid:String,page: NSInteger, currentIndex: NSInteger, dataArray: [CNLiveAlbumListModel],navigationVC:UINavigationController?){
  126 + //请求getAlbumMsg获取上次播放集数
  127 + //获取专辑详情(简介等)
  128 + CNLiveHomePageViewModel.getAlbumMsg(aid: aid) { result, status in
  129 + hiddenLoading()
  130 + if status == .success{
  131 + let model = result as! CNLiveAlbumMsgModel
  132 + //短剧-跳转短剧播放页
  133 + let toIndex = model.episodeLast-1 <= 0 ? 0 : model.episodeLast-1
  134 +
  135 + navigationVC?.pushViewController( CNLiveShortVideoViewController(aid: aid, page: page, currentIndex: currentIndex, dataArray: dataArray), animated: pushAnimated)
  136 + }else{
  137 + //短剧-跳转短剧播放页
  138 + navigationVC?.pushViewController(CNLiveShortVideoViewController(aid: aid), animated: pushAnimated)
  139 + }
  140 + }
  141 + }
107 } 142 }
metaCode/Classes/Main/VideoPage/ViewModel/CNLiveShortVideoViewModel.swift
@@ -15,12 +15,12 @@ class CNLiveShortVideoViewModel: NSObject { @@ -15,12 +15,12 @@ class CNLiveShortVideoViewModel: NSObject {
15 /// - Parameters: 15 /// - Parameters:
16 /// - aid: 专辑 id 16 /// - aid: 专辑 id
17 /// - reultShortVideoBlock: 返回 17 /// - reultShortVideoBlock: 返回
18 - static func requstWithShortVideo(aid: String,page: NSInteger,reultShortVideoBlock: @escaping resultShortVideoBlock) { 18 + static func requstWithShortVideo(aid: String,page: NSInteger,pageSize:String,reultShortVideoBlock: @escaping resultShortVideoBlock) {
19 let param = NSMutableDictionary() 19 let param = NSMutableDictionary()
20 param.setValue(aid, forKey: "aid") 20 param.setValue(aid, forKey: "aid")
21 param.setValue("", forKey: "app_channel_id") 21 param.setValue("", forKey: "app_channel_id")
22 param.setValue("\(page)", forKey: "page") 22 param.setValue("\(page)", forKey: "page")
23 - param.setValue("10", forKey: "pageSize") 23 + param.setValue(pageSize, forKey: "pageSize")
24 param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "sid") 24 param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "sid")
25 let custom_param = NSMutableDictionary() 25 let custom_param = NSMutableDictionary()
26 custom_param.setValue(CNLiveMCEnvironmentManager.shared.appId_wjj, forKey: "appId") 26 custom_param.setValue(CNLiveMCEnvironmentManager.shared.appId_wjj, forKey: "appId")
@@ -222,7 +222,40 @@ class CNLiveShortVideoViewModel: NSObject { @@ -222,7 +222,40 @@ class CNLiveShortVideoViewModel: NSObject {
222 } 222 }
223 } 223 }
224 224
225 - 225 + //!!!: 上报播放了视频
  226 + /// 上报播放了某一集视频
  227 + /// - Parameters:
  228 + /// - contentId: 内容 id
  229 + /// - channelName:
  230 + /// - model:
  231 + static func requestAudioPlayRecordEnd(contentId: String, channelName: String) {
  232 + let param = NSMutableDictionary()
  233 + param.setValue("0", forKey: "schedule")
  234 + param.setValue(contentId, forKey: "contentId")
  235 + param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "sid")
  236 + param.setValue(channelName, forKey: "channelName")
  237 + param.setValue("album_ugc", forKey: "model")
  238 +
  239 + let custom_param = NSMutableDictionary()
  240 + custom_param.setValue(CNLiveMCEnvironmentManager.shared.appId_wjj, forKey: "appId")
  241 + custom_param.setValue(CNLiveMCEnvironmentManager.shared.appKey_wjj, forKey: "appKey")
  242 + CNLiveNetworking.setAllowRequestDefaultArgument(true)
  243 + CNLiveNetworking.setupShowDataResult(false)
  244 + CNLiveNetworking.setupShowResult(true)
  245 + CNLiveNetworking.setupCustomParam(custom_param as? [String : String])
  246 + CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseCMSClassUrl+"/recordApi/end", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in
  247 + hiddenLoading()
  248 + if (error == nil) {
  249 + let resp = result as! NSDictionary
  250 + let errorCode = "\(resp["errorCode"] ?? "0")"
  251 + if (errorCode == "0") {
  252 + print(resp)
  253 + } else {
  254 + }
  255 + } else {
  256 + }
  257 + }
  258 + }
226 259
227 //!!!: 评论相关 260 //!!!: 评论相关
228 261