Commit ee7e9e8268e6b767eddf50ffb07a5ac399cf4c1a

Authored by 张旭
1 parent b9f01d49

1. 只替换 点播详情数据 的点赞 评论 ,看点 专辑 电商 不替换

2. videoId 不重复加mc_
metaCode.xcodeproj/project.pbxproj
... ... @@ -2972,7 +2972,7 @@
2972 2972 CODE_SIGN_ENTITLEMENTS = metaCode/metaCode.entitlements;
2973 2973 CODE_SIGN_IDENTITY = "Apple Development";
2974 2974 CODE_SIGN_STYLE = Automatic;
2975   - CURRENT_PROJECT_VERSION = 1.1.8.25.04.27.16;
  2975 + CURRENT_PROJECT_VERSION = 1.1.8.25.04.28.22;
2976 2976 DEBUG_INFORMATION_FORMAT = dwarf;
2977 2977 DEVELOPMENT_TEAM = 94X49GG3ZW;
2978 2978 ENABLE_BITCODE = NO;
... ... @@ -3228,7 +3228,7 @@
3228 3228 CODE_SIGN_ENTITLEMENTS = metaCode/metaCode.entitlements;
3229 3229 CODE_SIGN_IDENTITY = "Apple Development";
3230 3230 CODE_SIGN_STYLE = Automatic;
3231   - CURRENT_PROJECT_VERSION = 1.1.8.25.04.27.16;
  3231 + CURRENT_PROJECT_VERSION = 1.1.8.25.04.28.22;
3232 3232 DEVELOPMENT_TEAM = 94X49GG3ZW;
3233 3233 ENABLE_BITCODE = NO;
3234 3234 ENABLE_MODULE_VERIFIER = NO;
... ...
metaCode/Classes/Main/HuBiLieHomePage/Controller/CNLiveTVPlayerViewController.swift
... ... @@ -454,6 +454,84 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa
454 454  
455 455 }
456 456  
  457 + //只替换 点播详情数据 ,看点 专辑 电商 不替换
  458 + func configDataArrayWithVodPlay5(vodPlayMdl : CNLiveVodPlayModel?){
  459 + //配置数据
  460 + let tempDataArray = NSMutableArray()
  461 + //单集 简介
  462 + var newVodPlayBlockListModel5:CNLiveVodPlayBlockListListModel?
  463 + if let vodPlayModel = vodPlayMdl{//单集有值-简介
  464 + for (_,mdl) in vodPlayModel.blockList.enumerated(){
  465 + if mdl.type == "5"{//点播详情数据
  466 + newVodPlayBlockListModel5 = mdl.list.first
  467 + }
  468 + }
  469 + }
  470 + if let vodPlayModel = self.vodPlayModel{//单集有值-简介
  471 + for (_,mdl) in vodPlayModel.blockList.enumerated(){
  472 + if mdl.type == "5"{//点播详情数据
  473 + //CNLiveVodPlayBlockListModel
  474 + mdl.list[0] = newVodPlayBlockListModel5 ?? CNLiveVodPlayBlockListListModel()
  475 + tempDataArray.add(mdl)
  476 + self.vodPlayBlockListList5Model = newVodPlayBlockListModel5//mdl.list.first
  477 + }
  478 + }
  479 + }
  480 + //专辑-简介
  481 + if let vodAlbumListBaseModel = self.vodAlbumListBaseModel{//专辑有值-专辑列表
  482 + if let mdl = vodAlbumListBaseModel.list.first{
  483 + if let msgModel = mdl.vodAlbumMsgModel{
  484 + let tempArr = NSMutableArray(array: tempDataArray as! [Any])
  485 + if let vodMdl = tempArr.firstObject as? CNLiveVodPlayBlockListModel{
  486 + for firMdl in vodMdl.list{
  487 + firMdl.title = msgModel.albumName
  488 + firMdl.desc = msgModel.desc
  489 + }
  490 + tempDataArray.removeAllObjects()
  491 + tempDataArray.add(vodMdl)
  492 + }
  493 +
  494 + }
  495 + }
  496 + }
  497 + //专辑有值-专辑列表
  498 + if let vodAlbumListBaseModel = self.vodAlbumListBaseModel{//专辑有值-专辑列表
  499 + tempDataArray.add(vodAlbumListBaseModel)
  500 + self.albumListArr = NSMutableArray(array: vodAlbumListBaseModel.list)
  501 + }
  502 + //看点
  503 + ///**blockList.type 1/2/3/4/5 商品入口/片花资讯/活动推荐/相关推荐/点播详情 */
  504 + if let vodPlayModel = self.vodPlayModel{//单集有值-简介
  505 + for (_,mdl) in vodPlayModel.blockList.enumerated(){
  506 + if mdl.type == "2"{//看点list数据
  507 + //CNLiveVodPlayBlockListModel
  508 + tempDataArray.add(mdl)
  509 + self.kanDianListArr = NSMutableArray(array: mdl.list)
  510 + }
  511 + }
  512 + }
  513 + //商品
  514 + if let vodPlayModel = self.vodPlayModel{//单集有值
  515 +
  516 + if vodPlayModel.goodsJson.count > 0{
  517 + let goodMdls = jsonArrayToModel(vodPlayModel.goodsJson, CNLiveVodPlayShopModel.self)
  518 + if goodMdls.count > 0{//CNLiveVodPlayModel [CNLiveVodPlayShopModel]
  519 + //有商品
  520 + tempDataArray.add(goodMdls)
  521 + }else{
  522 + //没商品
  523 + self.getGoodBlockContents()
  524 + }
  525 + }else{
  526 + //没商品
  527 + self.getGoodBlockContents()
  528 + }
  529 + }
  530 +
  531 + self.dataArray = NSMutableArray(array: tempDataArray)
  532 +
  533 + }
  534 +
457 535 func setupNewUI(model:CNLiveDownSlideContentsModel){
458 536  
459 537 }
... ... @@ -1812,35 +1890,52 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa
1812 1890  
1813 1891 }
1814 1892  
  1893 + // MARK: -点赞/收藏 刷新数据 不刷新看点列表 专辑列表
  1894 + func getVodPlayApi(contentId:String){
  1895 + //play接口刷新 看点和电商 1350755
  1896 + showLoading(message: "")
  1897 + CNLiveDownSlideTool.getVodPlayApi(contentId: contentId) {[weak self] result, status in
  1898 + guard let self = self else { return }
  1899 + if status == .success{
  1900 + if let vodPlayModel = result as? CNLiveVodPlayModel{
  1901 + self.configDataArrayWithVodPlay5(vodPlayMdl: vodPlayModel)
  1902 + self.tableView.reloadData()
  1903 + }
  1904 + }
  1905 + }
  1906 + }
1815 1907 func vodSupport(vodPlayBlockListListModel:CNLiveVodPlayBlockListListModel,isLiked:Bool,favoriteNum:Int){
1816 1908 if metaAppDelegate.isLogin{
1817 1909 CNLiveVodPlayViewModel.vodSupport(contentId: vodPlayBlockListListModel.pid, support: isLiked) {[weak self] result, status in
1818 1910 guard let self = self else { return }
1819 1911 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   -
1828   - }
1829   - }
1830   - self.tableView.reloadRow(at: IndexPath(row: 0, section: 0), with: .none)
  1912 + self.getVodPlayApi(contentId: self.contentId.count>0 ? self.contentId : vodPlayBlockListListModel.contentId)
  1913 +// if let vodPlayBlockListModel = self.dataArray[0] as? CNLiveVodPlayBlockListModel{
  1914 +// if vodPlayBlockListModel.type == "5"{//简介
  1915 +// if let model = vodPlayBlockListModel.list.first{
  1916 +// model.liked = isLiked
  1917 +// model.likesNum = favoriteNum
  1918 +// self.dataArray.replaceObject(at: 0, with: vodPlayBlockListModel)
  1919 +// }
  1920 +//
  1921 +// }
  1922 +// }
  1923 +// self.tableView.reloadRow(at: IndexPath(row: 0, section: 0), with: .none)
1831 1924 }
1832 1925 }
1833 1926 }else{
1834 1927 metaAppDelegate.pushLoginVC()
1835 1928 }
1836 1929 }
  1930 +
1837 1931 func vodCollection(vodPlayBlockListListModel:CNLiveVodPlayBlockListListModel,isCollectioned:Bool){
1838 1932 if metaAppDelegate.isLogin{
1839 1933 let type = isCollectioned ? "1" : "2"
  1934 + showLoading(message: "")
1840 1935 CNLiveVodPlayViewModel.vodCollection(type: type, vodPlayBlockListListModel: vodPlayBlockListListModel) {[weak self] result, status in
1841 1936 guard let self = self else { return }
1842 1937 if status == .success{
1843   - //不改数据了
  1938 + self.getVodPlayApi(contentId: self.contentId.count>0 ? self.contentId : vodPlayBlockListListModel.contentId)
1844 1939 }
1845 1940 }
1846 1941 }else{
... ...
metaCode/Classes/Main/HuBiLieHomePage/View/VodDetail/CNLiveVodIntroductionCell.swift
... ... @@ -210,28 +210,34 @@ class CNLiveVodIntroductionCell:UITableViewCell{
210 210  
211 211 @objc func likeBtnAction(){
212 212 let vodMdl = self.vodPlayBlockListModel!.list.first!
213   - let num = likeBtn.isSelected ? 1 : -1
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   - }
222   - likeBtn.setTitle("\(likeNum)", for: .normal)
223   - likeBtn.setTitle("\(likeNum)", for: .selected)
  213 + let isLike = !vodMdl.liked
  214 +
  215 +// let num = likeBtn.isSelected ? 1 : -1
  216 +// var likeNum = 0//((vodMdl.likesNum+num) == -1) ? 0 : vodMdl.likesNum+num
  217 +// if metaAppDelegate.isLogin{
  218 +// likeNum = ((vodMdl.likesNum+num) == -1) ? 0 : vodMdl.likesNum+num
  219 +// likeBtn.isSelected = likeBtn.isSelected ? false : true
  220 +// }else{
  221 +// likeNum = vodMdl.likesNum
  222 +// likeBtn.isSelected = false
  223 +// }
  224 +// print("1111111likeNum\(likeNum)")
  225 +// likeBtn.setTitle("\(likeNum)", for: .normal)
  226 +// likeBtn.setTitle("\(likeNum)", for: .selected)
  227 +
  228 +// self.updateCellBlock?(false, likeBtn.isSelected,likeNum, false, "2",self.vodPlayBlockListModel!.list.first!)
  229 + self.updateCellBlock?(false, isLike,0, false, "2",self.vodPlayBlockListModel!.list.first!)
224 230  
225   - self.updateCellBlock?(false, likeBtn.isSelected,likeNum, false, "2",self.vodPlayBlockListModel!.list.first!)
226 231 }
227 232 @objc func collectionBtnAction(){
228   -
229   - if metaAppDelegate.isLogin{
230   - collectionBtn.isSelected = collectionBtn.isSelected ? false : true
231   - }else{
232   - collectionBtn.isSelected = false
233   - }
234   - self.updateCellBlock?(false, false,0, true, "3",self.vodPlayBlockListModel!.list.first!)
  233 + let vodMdl = self.vodPlayBlockListModel!.list.first!
  234 + let isCollectioned = !vodMdl.collectioned
  235 +// if metaAppDelegate.isLogin{
  236 +// collectionBtn.isSelected = collectionBtn.isSelected ? false : true
  237 +// }else{
  238 +// collectionBtn.isSelected = false
  239 +// }
  240 + self.updateCellBlock?(false, false,0, isCollectioned, "3",self.vodPlayBlockListModel!.list.first!)
235 241 }
236 242 @objc func shareBtnAction(){
237 243 self.updateCellBlock?(false, false,0, false, "4",self.vodPlayBlockListModel!.list.first!)
... ...
metaCode/Classes/Main/LoginPage/Controller/CNLiveLoginViewController.swift
... ... @@ -342,14 +342,13 @@ class CNLiveLoginViewController : CNLiveBaseViewController, UITextViewDelegate {
342 342 NotificationCenter.default.post(name: Notification.Name.LoginManage.CNLiveLoginSuccessNotification, object: nil)
343 343 metaAppDelegate.isLogin = true
344 344 if self.navBackButton.isHidden{
345   - //未登录push过来的
  345 + //退出登录后->登录
346 346 let window = UIApplication.shared.delegate?.window
347 347 window??.rootViewController = CNLiveBaseTabBarViewController.init()
348 348 }else{
349   - //发通知
  349 + //未登录push过来的
350 350 self.navigationController?.popViewController(animated: true)
351 351 }
352   -
353 352 }
354 353 }else{
355 354 let window = UIApplication.shared.delegate?.window
... ...
metaCode/Classes/Main/VideoPage/View/CNLiveShortVideoCommentListView.swift
... ... @@ -716,16 +716,44 @@ class CNLiveShortVideoCommentListTableViewCell: UITableViewCell , UITableViewDel
716 716  
717 717 @objc func longPressGestureRecognizerAction(gestureRecognizer: UIGestureRecognizer) {
718 718 if gestureRecognizer.state == .began {
  719 + let commentModelUid = commentModel.uid
  720 + let uid = UserInfoManager.shared.userInfo.uid
  721 + let contentsid = contentSid
  722 + print("\(commentModelUid),\(uid),\(contentsid)")
719 723 if commentModel.uid == UserInfoManager.shared.userInfo.uid || contentSid == UserInfoManager.shared.userInfo.uid {
720   - AlertTool.systemAlert(title: "确认删除该条评论吗?", message: "", cancelTitle: "取消", confirmTitle: "确定") {[weak self] index in
  724 + AlertTool.systemActionSheet(title: "请选择", message: "", actionTitles: ["删除该条评论","举报"], cancelTitle: "取消") {[weak self] index in
721 725 guard let self = self else { return }
722 726 if index == 1 {
  727 + //"删除该条评论"
723 728 showLoading(message: "")
724 729 CNLiveShortVideoViewModel.requestCommentDelete(videoId: self.videoId, commentId: self.commentModel.commentId!) {result, respStatue in
725 730 if respStatue == .success {
726 731 self.deleteBlock(self.commentModel!)
727 732 }
728 733 }
  734 + }else if index == 2 {
  735 + //"举报"
  736 + currentViewController()?.navigationController?.pushViewController(CNLiveInputFeedBackViewController.init(show_type: .problem), animated: true)
  737 + }
  738 + }
  739 +// AlertTool.systemAlert(title: "确认删除该条评论吗?", message: "", cancelTitle: "取消", confirmTitle: "确定") {[weak self] index in
  740 +// guard let self = self else { return }
  741 +// if index == 1 {
  742 +// showLoading(message: "")
  743 +// CNLiveShortVideoViewModel.requestCommentDelete(videoId: self.videoId, commentId: self.commentModel.commentId!) {result, respStatue in
  744 +// if respStatue == .success {
  745 +// self.deleteBlock(self.commentModel!)
  746 +// }
  747 +// }
  748 +// }
  749 +// }
  750 + }else{
  751 + //不是本人
  752 + AlertTool.systemActionSheet(title: "请选择", message: "", actionTitles: ["举报"], cancelTitle: "取消") {[weak self] index in
  753 + guard let self = self else { return }
  754 + if index == 1 {
  755 + //"举报"
  756 + currentViewController()?.navigationController?.pushViewController(CNLiveInputFeedBackViewController.init(show_type: .problem), animated: true)
729 757 }
730 758 }
731 759 }
... ...
metaCode/Classes/Main/VideoPage/ViewModel/CNLiveShortVideoViewModel.swift
... ... @@ -302,7 +302,14 @@ class CNLiveShortVideoViewModel: NSObject {
302 302 /// - reultShortVideoBlock: 返回
303 303 static func requestCommentList(pid: String,page: NSInteger,reultShortVideoBlock: @escaping resultShortVideoBlock) {
304 304 let param = NSMutableDictionary()
305   - param.setValue("mc_\(pid)", forKey: "topicId")
  305 + var videoId = pid
  306 + let isContainMC = videoId.contains("mc_")
  307 + if isContainMC{
  308 + param.setValue("\(videoId)", forKey: "topicId")
  309 + }else{
  310 + param.setValue("mc_\(videoId)", forKey: "topicId")
  311 + }
  312 +// param.setValue("\(videoId)", forKey: "topicId")
306 313 param.setValue("i", forKey: "plat")
307 314 param.setValue(CNLiveMCEnvironmentManager.shared.appId, forKey: "appId")
308 315 param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "sid")
... ... @@ -351,7 +358,17 @@ class CNLiveShortVideoViewModel: NSObject {
351 358 /// - reultShortVideoBlock: 返回
352 359 static func requestCommentWithSend(videoId: String, comment: String, isAuthor: Bool,reultShortVideoBlock: @escaping resultShortVideoBlock) {
353 360 let param = NSMutableDictionary()
354   - param.setValue("mc_\(videoId)", forKey: "topicId")
  361 +
  362 + var videoIdStr = videoId
  363 + let isContainMC = videoIdStr.contains("mc_")
  364 + if isContainMC{
  365 + param.setValue("\(videoIdStr)", forKey: "topicId")
  366 + }else{
  367 + param.setValue("mc_\(videoIdStr)", forKey: "topicId")
  368 + }
  369 +// param.setValue("\(videoIdStr)", forKey: "topicId")
  370 +
  371 +// param.setValue("mc_\(videoId)", forKey: "topicId")
355 372 param.setValue(CNLiveMCEnvironmentManager.shared.appId, forKey: "appId")
356 373 param.setValue("i", forKey: "plat")
357 374 param.setValue(comment.qmui_trim, forKey: "comment")
... ... @@ -503,7 +520,13 @@ class CNLiveShortVideoViewModel: NSObject {
503 520 let param = NSMutableDictionary()
504 521 param.setValue(commentId, forKey: "commentId")
505 522 param.setValue(CNLiveMCEnvironmentManager.shared.appId, forKey: "appId")
506   - param.setValue("mc_\(videoId)", forKey: "topicId")
  523 +// param.setValue("mc_\(videoId)", forKey: "topicId")
  524 + let isContainMC = videoId.contains("mc_")
  525 + if isContainMC{
  526 + param.setValue("\(videoId)", forKey: "topicId")
  527 + }else{
  528 + param.setValue("mc_\(videoId)", forKey: "topicId")
  529 + }
507 530 param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "sid")
508 531 let custom_param = NSMutableDictionary()
509 532 custom_param.setValue(CNLiveMCEnvironmentManager.shared.appId, forKey: "appId")
... ...