南鑫林 il y a 5 ans
Parent
commit
d5a8ca5573
68 fichiers modifiés avec 430 ajouts et 379 suppressions
  1. 23 7
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  2. 3 3
      RainbowPlanet/RainbowPlanet/Macro/Common.swift
  3. 4 2
      RainbowPlanet/RainbowPlanet/Manager/ATAuthSDKManager/ATAuthSDKManager.swift
  4. 72 27
      RainbowPlanet/RainbowPlanet/Manager/MJRefreshManager/MJRefreshManager.swift
  5. 2 2
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/RecommendFollow/CommunityRecommendFollowCollectionViewCell.swift
  6. 10 26
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityFeaturedTopics/View/CommunityFeaturedTopicsHeaderView.swift
  7. 9 22
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityFeaturedTopics/ViewController/CommunityFeaturedTopicsViewController.swift
  8. 4 50
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityMyFollowTopic/View/CommunityMyFollowTopicCell.swift
  9. 2 2
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/Controller/CommunityRecommendController.swift
  10. 1 1
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/View/HTMLCell/CommunityRecommendDetailHTMLTableViewCell.swift
  11. 7 6
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/View/CommunityVideoCoverCollectionCell.swift
  12. 1 1
      RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageList/ViewController/MessageListController.swift
  13. 1 1
      RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessagePlanetActivity/Controller/MessagePlanetActivityController.swift
  14. 3 3
      RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/PersonalCenterView/PersonViewUserAndOtherHeaderView.swift
  15. 1 1
      RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/PersonalCenterView/PersonViewUserAndOtherListCollectionViewCell.swift
  16. 1 1
      RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/PersonalCenterView/PersonViewUserAndOtherListView.swift
  17. 1 1
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoCoverPick/View/AliyunPublishTopView.m
  18. 23 3
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoCrop/View/AliyunCropThumbnailView.m
  19. 1 1
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoCrop/View/AliyunCropViewBottomView.m
  20. 33 7
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoEdit/Controller/AliyunEditViewController.m
  21. 1 0
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoRecord/Controller/AliyunMagicCameraViewController.m
  22. 0 0
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishAddAddress/View/PublishAddressPOICell.swift
  23. 0 0
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishAddAddress/View/PublishAddressPOIView.swift
  24. 1 1
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishAddAddress/SearchAddrNavigationbarView.swift
  25. 2 3
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishAddAddress/PublishAddAddressController.swift
  26. 27 21
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishAddTopic/Controller/PublishAddTopicController.swift
  27. 3 3
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishAddTopic/View/PublishSelTopicCollectionCell.swift
  28. 12 3
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEditController/Controller/PublishEditController.swift
  29. 0 0
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEdit/View/PublishEditAddAddressCell.swift
  30. 0 0
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEdit/View/PublishEditAddImgCollectionCell.swift
  31. 4 4
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEditController/View/PublishEditAddPicCell.swift
  32. 0 0
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEdit/View/PublishEditAddTopicCell.swift
  33. 0 0
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEdit/View/PublishEditDefaultCollectionCell.swift
  34. 1 0
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEditController/View/PublishEditDescribeCell.swift
  35. 0 0
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEdit/View/PublishEditTitleCell.swift
  36. 40 14
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/Controller/KSMediaPickerController.swift
  37. 6 12
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/View/KSMediaPickerNavigationView.swift
  38. 15 3
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/View/KSMediaPickerView.swift
  39. 3 3
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMusicAbout/PublishMusicChooseView.swift
  40. 1 0
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMusicAbout/PublishMusicVolumnView.swift
  41. 4 5
      RainbowPlanet/RainbowPlanet/Modules/SearchModule/SearchUser/View/SearchUserLitTableViewCell.swift
  42. 3 2
      RainbowPlanet/RainbowPlanet/Router/CommunityRouterModuleType.swift
  43. 4 0
      RainbowPlanet/RainbowPlanet/Router/RegisterLoginRouterModuleType.swift
  44. 2 2
      RainbowPlanet/RainbowPlanet/Router/RouterManager.swift
  45. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/DefaultPage/default_pic.imageset/default_pic@2x.png
  46. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/DefaultPage/default_pic.imageset/default_pic@3x.png
  47. 0 22
      RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/center_attention_white.imageset/Contents.json
  48. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/center_attention_white.imageset/center_attention_white@2x.png
  49. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/center_attention_white.imageset/center_attention_white@3x.png
  50. 0 22
      RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/center_followed_white.imageset/Contents.json
  51. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/center_followed_white.imageset/center_followed_white@2x.png
  52. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/center_followed_white.imageset/center_followed_white@3x.png
  53. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/followed.imageset/followed@2x.png
  54. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/followed.imageset/followed@3x.png
  55. 0 22
      RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/star_attention.imageset/Contents.json
  56. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/star_attention.imageset/star_attention@2x.png
  57. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/star_attention.imageset/star_attention@3x.png
  58. 0 22
      RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/star_followed.imageset/Contents.json
  59. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/star_followed.imageset/star_followed@2x.png
  60. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/star_followed.imageset/star_followed@3x.png
  61. 0 22
      RainbowPlanet/RainbowPlanet/Supporting Files/MineModule.xcassets/center_peas.imageset/Contents.json
  62. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/MineModule.xcassets/center_peas.imageset/center_peas@2x.png
  63. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/MineModule.xcassets/center_peas.imageset/center_peas@3x.png
  64. 2 2
      RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/followed.imageset/Contents.json
  65. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/MineModule.xcassets/center_umi.imageset/center_umi@2x.png
  66. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/MineModule.xcassets/center_umi.imageset/center_umi@3x.png
  67. 91 12
      RainbowPlanet/RainbowPlanet/ViewModel/Community/CommunityFollowTopicViewModel.swift
  68. 6 12
      RainbowPlanet/RainbowPlanet/ViewModel/Community/CommunityFollowUserViewModel.swift

+ 23 - 7
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -3455,6 +3455,24 @@
 			path = Gif;
 			sourceTree = "<group>";
 		};
+		A78A5F7922FBFCFC00DD1764 /* ViewController */ = {
+			isa = PBXGroup;
+			children = (
+				BD13B6CC22BA03BB008BB323 /* PublishAddAddressController.swift */,
+			);
+			path = ViewController;
+			sourceTree = "<group>";
+		};
+		A78A5F7A22FC011F00DD1764 /* View */ = {
+			isa = PBXGroup;
+			children = (
+				BD13B6CE22BA03BB008BB323 /* SearchAddrNavigationbarView.swift */,
+				BD13B6CD22BA03BB008BB323 /* PublishAddressPOIView.swift */,
+				BD13B6E322BA0546008BB323 /* PublishAddressPOICell.swift */,
+			);
+			path = View;
+			sourceTree = "<group>";
+		};
 		A79057032276D5FE0037F823 /* ConfigModel */ = {
 			isa = PBXGroup;
 			children = (
@@ -4893,7 +4911,7 @@
 				BD12B67222B4E99800AEB10B /* PublishMediaPicker */,
 				BD01B1F722BC673900CE9F36 /* PublishTakePhoto */,
 				BD5CA89022DD719000364A67 /* PublishMusicAbout */,
-				BD13B69F22B9CE8D008BB323 /* PublishEditController */,
+				BD13B69F22B9CE8D008BB323 /* PublishEdit */,
 				BD13B6CF22BA03BB008BB323 /* PublishAddTopic */,
 				BD13B6CB22BA03BB008BB323 /* PublishAddAddress */,
 				BDA45BFD22E45DDD009DE548 /* PublishManager */,
@@ -4958,13 +4976,13 @@
 			path = KSVideoPlayerView;
 			sourceTree = "<group>";
 		};
-		BD13B69F22B9CE8D008BB323 /* PublishEditController */ = {
+		BD13B69F22B9CE8D008BB323 /* PublishEdit */ = {
 			isa = PBXGroup;
 			children = (
 				BD13B6A022B9CE8D008BB323 /* Controller */,
 				BD13B6A222B9CE8D008BB323 /* View */,
 			);
-			path = PublishEditController;
+			path = PublishEdit;
 			sourceTree = "<group>";
 		};
 		BD13B6A022B9CE8D008BB323 /* Controller */ = {
@@ -5001,10 +5019,8 @@
 		BD13B6CB22BA03BB008BB323 /* PublishAddAddress */ = {
 			isa = PBXGroup;
 			children = (
-				BD13B6CC22BA03BB008BB323 /* PublishAddAddressController.swift */,
-				BD13B6CE22BA03BB008BB323 /* SearchAddrNavigationbarView.swift */,
-				BD13B6CD22BA03BB008BB323 /* PublishAddressPOIView.swift */,
-				BD13B6E322BA0546008BB323 /* PublishAddressPOICell.swift */,
+				A78A5F7A22FC011F00DD1764 /* View */,
+				A78A5F7922FBFCFC00DD1764 /* ViewController */,
 			);
 			path = PublishAddAddress;
 			sourceTree = "<group>";

+ 3 - 3
RainbowPlanet/RainbowPlanet/Macro/Common.swift

@@ -321,18 +321,18 @@ func getImageHeight(imgStr:String) -> CGFloat {
 func getImageUrlStr(imgStr:String,width:CGFloat,height:CGFloat) -> String {
     if imgStr.contains("*") {
         let imgStr1 = imgStr + "?x-oss-process=image/resize,m_fill,w_\(Int(width*2)),h_\(Int(height*2))"
-        NXLLog(imgStr1)
+//        NXLLog(imgStr1)
         return String(imgStr1)
     }else {
         if imgStr.contains("?") {
             var imgStr1 = imgStr.prefix(upTo:(imgStr.lastIndex(of: "?"))!)
             imgStr1 = imgStr1 + "?x-oss-process=image/resize,m_fill,w_\(Int(width*2)),h_\(Int(height*2))"
-            NXLLog(imgStr1)
+//            NXLLog(imgStr1)
 
             return String(imgStr1)
         }else {
             let imgStr1 = imgStr + "?x-oss-process=image/resize,m_fill,w_\(Int(280 * 2 * kScaleWidth)),h_\(Int(280 * 2 * kScaleWidth))"
-            NXLLog(imgStr1)
+//            NXLLog(imgStr1)
             return String(imgStr1)
         }
     }

+ 4 - 2
RainbowPlanet/RainbowPlanet/Manager/ATAuthSDKManager/ATAuthSDKManager.swift

@@ -8,6 +8,7 @@
 
 import UIKit
 import SwiftyJSON
+import SwiftyMediator
 
 class ATAuthSDKManager: NSObject {
 
@@ -16,11 +17,12 @@ class ATAuthSDKManager: NSObject {
         TXCommonHandler.sharedInstance().checkAsyncGatewayVerifyEnable(nil) {[weak vc] (enable) in
             DispatchQueue.main.async {
                 if !enable {//先获取authortoken并认证
-                    SwiftProgressHUD.shared().showText("设备无移动数据网络 或 获取供应商信息失败")
+                    Mediator.push(RegisterLoginRouterModuleType.pushmobileLoginView)
+                    SwiftProgressHUD.shared().showText("一键登录失败,请使用验证码登录")
                     return
                 }
                 let modelNew = TXCustomModel()
-                
+
                 /// navigationbara
                 modelNew.navColor = kffffffColor
                 modelNew.navBackImage = kImage(name: "navbar_back_black")!

+ 72 - 27
RainbowPlanet/RainbowPlanet/Manager/MJRefreshManager/MJRefreshManager.swift

@@ -12,8 +12,12 @@ class MJRefreshManager: NSObject {
 
     //MARK: - tableView
     class func hiddenHeaderWithFooter(tableView : UITableView?) {
-        tableView?.endHeaderRefresh()
-        tableView?.endFooterRefresh()
+        if tableView?.mj_footer != nil {
+            tableView?.endFooterRefresh()
+        }
+        if tableView?.mj_header != nil {
+            tableView?.endHeaderRefresh()
+        }
         tableView?.ly_endLoading()
     }
     
@@ -22,20 +26,31 @@ class MJRefreshManager: NSObject {
             [weak tableView] in
             tableView?.mj_header.beginRefreshing()
         })
-        tableView?.endHeaderRefresh()
-        tableView?.endFooterRefresh()
+
+        if tableView?.mj_footer != nil {
+            tableView?.endFooterRefresh()
+        }
+        if tableView?.mj_header != nil {
+            tableView?.endHeaderRefresh()
+        }
         tableView?.ly_endLoading()
     }
     
     class func hiddenHeaderWithFooterNOData(tableView : UITableView?) {
         DIYEmptyView.emptyNoDataTableView(tableView: tableView,imageStr: .one,detailStr: .one)
-        tableView?.endHeaderRefresh()
-        tableView?.endFooterRefresh()
+        if tableView?.mj_footer != nil {
+            tableView?.endFooterRefresh()
+        }
+        if tableView?.mj_header != nil {
+            tableView?.endHeaderRefresh()
+        }
         tableView?.ly_endLoading()
     }
     
     class func hiddenHeaderWithFooter(tableView:UITableView?,loadingStatus:SwiftMoyaNetWorkManagerLoadingStatus) {
-        tableView?.isHiddenFooter(true)
+        if tableView?.mj_footer != nil {
+            tableView?.isHiddenFooter(true)
+        }
         if loadingStatus == .noData {
             MJRefreshManager.hiddenHeaderWithFooterNOData(tableView: tableView)
         }else if loadingStatus == .noNetwork {
@@ -46,26 +61,38 @@ class MJRefreshManager: NSObject {
     
     class func hiddenHeaderWithFooter(tableView : UITableView?,pagination : PaginationModel?) {
         
-        tableView?.endHeaderRefresh()
-        tableView?.endFooterRefresh()
-        
+        if tableView?.mj_header != nil {
+            tableView?.endHeaderRefresh()
+        }
+        if tableView?.mj_footer != nil {
+            tableView?.endFooterRefresh()
+        }
         if pagination?.total == 0 {
-            tableView?.isHiddenFooter(true)
+            if tableView?.mj_footer != nil {
+                tableView?.isHiddenFooter(true)
+            }
         }else {
             if  pagination?.currentPage ?? 1  >= pagination?.totalPages ?? 1  {
-                tableView?.endFooterNoMoreData()
-                tableView?.mj_footer.pullingPercent = 1
+                tableView?.mj_footer.isHidden = false
+                if tableView?.mj_footer != nil {
+                    tableView?.endFooterNoMoreData()
+                    tableView?.mj_footer.pullingPercent = 1
+                }
             }
         }
-        
         tableView?.ly_endLoading()
     }
     
     
     //MARK: - collectionView
     class func hiddenHeaderWithFooter(collectionView : UICollectionView?) {
-        collectionView?.endHeaderRefresh()
-        collectionView?.endFooterRefresh()
+
+        if collectionView?.mj_header != nil {
+            collectionView?.endHeaderRefresh()
+        }
+        if collectionView?.mj_footer != nil {
+            collectionView?.endFooterRefresh()
+        }
         collectionView?.ly_endLoading()
     }
     
@@ -74,20 +101,30 @@ class MJRefreshManager: NSObject {
             [weak collectionView] in
             collectionView?.mj_header.beginRefreshing()
         })
-        collectionView?.endHeaderRefresh()
-        collectionView?.endFooterRefresh()
+        if collectionView?.mj_header != nil {
+            collectionView?.endHeaderRefresh()
+        }
+        if collectionView?.mj_footer != nil {
+            collectionView?.endFooterRefresh()
+        }
         collectionView?.ly_endLoading()
     }
     
     class func hiddenHeaderWithFooterNOData(collectionView : UICollectionView?) {
         DIYEmptyView.emptyNoDataCollectionView(collectionView: collectionView)
-        collectionView?.endHeaderRefresh()
-        collectionView?.endFooterRefresh()
+        if collectionView?.mj_header != nil {
+            collectionView?.endHeaderRefresh()
+        }
+        if collectionView?.mj_footer != nil {
+            collectionView?.endFooterRefresh()
+        }
         collectionView?.ly_endLoading()
     }
     
     class func hiddenHeaderWithFooter(collectionView:UICollectionView?,loadingStatus:SwiftMoyaNetWorkManagerLoadingStatus) {
-        collectionView?.isHiddenFooter(true)
+        if collectionView?.mj_footer != nil {
+            collectionView?.isHiddenFooter(true)
+        }
         if loadingStatus == .noData {
             MJRefreshManager.hiddenHeaderWithFooterNOData(collectionView: collectionView)
         }else if loadingStatus == .noNetwork {
@@ -96,16 +133,24 @@ class MJRefreshManager: NSObject {
     }
     
     class func hiddenHeaderWithFooter(collectionView : UICollectionView?,pagination : PaginationModel?) {
-        
-        collectionView?.endHeaderRefresh()
-        collectionView?.endFooterRefresh()
+        if collectionView?.mj_header != nil {
+            collectionView?.endHeaderRefresh()
+        }
+        if collectionView?.mj_footer != nil {
+            collectionView?.endFooterRefresh()
+        }
         
         if pagination?.total == 0 {
-            collectionView?.isHiddenFooter(true)
+            if collectionView?.mj_footer != nil {
+                collectionView?.isHiddenFooter(true)
+            }
         }else {
             if  pagination?.currentPage ?? 1  >= pagination?.totalPages ?? 1  {
-                collectionView?.endFooterNoMoreData()
-                collectionView?.mj_footer.pullingPercent = 1
+                collectionView?.mj_footer.isHidden = false
+                if collectionView?.mj_footer != nil {
+                    collectionView?.endFooterNoMoreData()
+                    collectionView?.mj_footer.pullingPercent = 1
+                }
             }
         }
 

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/RecommendFollow/CommunityRecommendFollowCollectionViewCell.swift

@@ -128,7 +128,7 @@ class CommunityRecommendFollowCollectionViewCell: UICollectionViewCell {
         didSet {
             avatarButton.kf.setImage(with: kURLImage(name: communityRecommendTypeDataModel?.avatar ?? ""), for: UIControl.State.normal, placeholder: kImage(name: "default_avatar"))
             titleButton.setTitle(communityRecommendTypeDataModel?.userName, for: UIControl.State.normal)
-            CommunityFollowUserViewModel.shared.setFollowType(followButton: followButton, followType: FollowType(rawValue: communityRecommendTypeDataModel?.followStatus ?? 0)!)
+            CommunityFollowUserViewModel.setFollowType(followButton: followButton, followType: FollowType(rawValue: communityRecommendTypeDataModel?.followStatus ?? 0)!)
 
             if communityRecommendTypeDataModel?.uid == UserModel.shared().getModel()?.uid {
                 followButton.isHidden = true
@@ -153,7 +153,7 @@ class CommunityRecommendFollowCollectionViewCell: UICollectionViewCell {
             }else {
                 topicLabel.text = "#\(cmsMemberModel?.topicName ?? "")"
             }
-            CommunityFollowUserViewModel.shared.setFollowType(followButton: followButton, followType: FollowType(rawValue: cmsMemberModel?.followStatus ?? 0)!)
+            CommunityFollowUserViewModel.setFollowType(followButton: followButton, followType: FollowType(rawValue: cmsMemberModel?.followStatus ?? 0)!)
             if cmsMemberModel?.uid == UserModel.shared().getModel()?.uid {
                 followButton.isHidden = true
             }else {

+ 10 - 26
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityFeaturedTopics/View/CommunityFeaturedTopicsHeaderView.swift

@@ -35,10 +35,9 @@ class CommunityFeaturedTopicsHeaderView: BaseView {
         focusButton.snp_makeConstraints { (make) in
             make.centerY.equalTo(topicLabel)
             make.right.equalTo(-14)
-            make.height.equalTo(26)
+            make.height.equalTo(28)
             make.width.equalTo(80)
         }
-        focusButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.left, imageTitleSpace: 2)
     }
     
     private lazy var numberPeopleLabel: UILabel = {
@@ -62,17 +61,15 @@ class CommunityFeaturedTopicsHeaderView: BaseView {
     
     private lazy var focusButton: UIButton = {
         let focusButton = UIButton(type: UIButton.ButtonType.custom)
-        focusButton.setImage(kImage(name: "star_attention"), for: UIControl.State.normal)
-        focusButton.setImage(kImage(name: "star_followed"), for: UIControl.State.selected)
-        focusButton.setTitleColor(k666666Color, for: UIControl.State.selected)
-        focusButton.setTitleColor(kThemeColor, for: UIControl.State.normal)
+        focusButton.setTitleColor(kffffffColor, for: UIControl.State.selected)
+        focusButton.setTitleColor(kffffffColor, for: UIControl.State.normal)
         focusButton.setTitle("关注话题", for: UIControl.State.normal)
-        focusButton.setTitle("关注话题", for: UIControl.State.selected)
-        focusButton.titleLabel?.font = kMediumFont13
-        focusButton.setBackgroundImage(UIImage.imageWithColor(color: kffffffColor), for: UIControl.State.normal)
-        focusButton.setBackgroundImage(UIImage.imageWithColor(color: kf7f8faColor), for: UIControl.State.selected)
-        focusButton.layer.borderWidth = 1
-        focusButton.cornerRadius = 13
+        focusButton.setTitle("已关注", for: UIControl.State.selected)
+        focusButton.titleLabel?.font = kRegularFont13
+        focusButton.setBackgroundImage(UIImage.imageWithColor(color: kThemeColor), for: UIControl.State.normal)
+        focusButton.setBackgroundImage(UIImage.imageWithColor(color: UIColor.clear), for: UIControl.State.selected)
+        focusButton.layer.borderWidth = 0.5
+        focusButton.cornerRadius = 14
         focusButton.masksToBounds = true
         focusButton.rx.tap.subscribe(onNext: { [weak self] (data) in
             if let followClosureName = self?.followClosureName {
@@ -98,21 +95,8 @@ class CommunityFeaturedTopicsHeaderView: BaseView {
         didSet {
             numberPeopleLabel.text = "\(communityTopicDetailModel?.followCount ?? "0")位彩虹居民参与此话题"
             topicLabel.text = communityTopicDetailModel?.name
-            isFollow()
+            CommunityFollowTopicViewModel.shared.followTopicButton(communityTopicDetailModel: communityTopicDetailModel!, button: focusButton)
         }
     }
 
 }
-
-extension CommunityFeaturedTopicsHeaderView {
-    func isFollow() {
-        if communityTopicDetailModel?.isFollow == 1 {
-            focusButton.isSelected = true
-            focusButton.layer.borderColor = kf7f8faColor.cgColor
-        }else {
-            focusButton.isSelected = false
-            focusButton.layer.borderColor = kThemeColor.cgColor
-        }
-    }
-    
-}

+ 9 - 22
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityFeaturedTopics/ViewController/CommunityFeaturedTopicsViewController.swift

@@ -86,7 +86,7 @@ class CommunityFeaturedTopicsViewController: BaseViewController {
             make.right.equalTo(-14)
             make.centerY.equalTo(navigationBar.leftButton)
             make.width.equalTo(60)
-            make.height.equalTo(24)
+            make.height.equalTo(28)
         }
     }
     
@@ -134,12 +134,12 @@ class CommunityFeaturedTopicsViewController: BaseViewController {
     private lazy var focusButton: UIButton = {
         let focusButton = UIButton(type: UIButton.ButtonType.custom)
         focusButton.setTitleColor(kffffffColor, for: UIControl.State.normal)
-        focusButton.setTitleColor(kThemeColor, for: UIControl.State.selected)
+        focusButton.setTitleColor(kffffffColor, for: UIControl.State.selected)
         focusButton.setTitle("关注", for: UIControl.State.normal)
         focusButton.setTitle("已关注", for: UIControl.State.selected)
         focusButton.titleLabel?.font = kRegularFont13
         focusButton.setBackgroundImage(UIImage.imageWithColor(color: kThemeColor), for: UIControl.State.normal)
-        focusButton.setBackgroundImage(UIImage.imageWithColor(color: kffffffColor), for: UIControl.State.selected)
+        focusButton.setBackgroundImage(UIImage.imageWithColor(color: UIColor.clear), for: UIControl.State.selected)
         focusButton.alpha = 0
         focusButton.layer.borderWidth = 0.5
         focusButton.layer.borderColor = kThemeColor.cgColor
@@ -147,9 +147,9 @@ class CommunityFeaturedTopicsViewController: BaseViewController {
         focusButton.masksToBounds = true
         focusButton.rx.tap.subscribe(onNext: { [weak self] (data) in
             if self?.communityTopicDetailModel?.isFollow == 1 {
-                CommunityFollowTopicViewModel.shared.communityMemberFollowTopicCancelFollowApi(topicId: (self?.id)!, communityTopicDetailModel: (self?.communityTopicDetailModel!)!, communityFeaturedTopicsHeaderView: (self?.communityFeaturedTopicsHeaderView)!, button: (self?.focusButton)!)
+                CommunityFollowTopicViewModel.shared.communityMemberFollowTopicCancelFollowApi(topicId: (self?.id)!, communityTopicDetailModel: (self?.communityTopicDetailModel!)!, communityFeaturedTopicsHeaderView: (self?.communityFeaturedTopicsHeaderView)!, button: (self?.focusButton)!, communityFollowTopicType: .view)
             }else {
-                CommunityFollowTopicViewModel.shared.communityMemberFollowTopicFollowApi(topicId: (self?.id)!, communityTopicDetailModel: (self?.communityTopicDetailModel!)!, communityFeaturedTopicsHeaderView: (self?.communityFeaturedTopicsHeaderView)!, button: (self?.focusButton)!)
+                CommunityFollowTopicViewModel.shared.communityMemberFollowTopicFollowApi(topicId: (self?.id)!, communityTopicDetailModel: (self?.communityTopicDetailModel!)!, communityFeaturedTopicsHeaderView: (self?.communityFeaturedTopicsHeaderView)!, button: (self?.focusButton)!, communityFollowTopicType: .view)
             }
         }).disposed(by: disposeBag)
         
@@ -164,7 +164,6 @@ class CommunityFeaturedTopicsViewController: BaseViewController {
     }()
     
     override func setupData() {
-        communityPostTopicApi(page: 1)
         //下拉刷新
         tableView.addFullScreenHeader(withBeginRefresh: true, animation: true) {
             [weak self] (page) in
@@ -179,9 +178,9 @@ class CommunityFeaturedTopicsViewController: BaseViewController {
         communityFeaturedTopicsHeaderView.followClosureName = {
             [weak self] in
             if self?.communityTopicDetailModel?.isFollow == 1 {
-                CommunityFollowTopicViewModel.shared.communityMemberFollowTopicCancelFollowApi(topicId: (self?.id)!, communityTopicDetailModel: (self?.communityTopicDetailModel!)!, communityFeaturedTopicsHeaderView: (self?.communityFeaturedTopicsHeaderView)!, button: (self?.focusButton)!)
+                CommunityFollowTopicViewModel.shared.communityMemberFollowTopicCancelFollowApi(topicId: (self?.id)!, communityTopicDetailModel: (self?.communityTopicDetailModel!)!, communityFeaturedTopicsHeaderView: (self?.communityFeaturedTopicsHeaderView)!, button: (self?.focusButton)!, communityFollowTopicType: .view)
             }else {
-                CommunityFollowTopicViewModel.shared.communityMemberFollowTopicFollowApi(topicId: (self?.id)!, communityTopicDetailModel: (self?.communityTopicDetailModel!)!, communityFeaturedTopicsHeaderView: (self?.communityFeaturedTopicsHeaderView)!, button: (self?.focusButton)!)
+                CommunityFollowTopicViewModel.shared.communityMemberFollowTopicFollowApi(topicId: (self?.id)!, communityTopicDetailModel: (self?.communityTopicDetailModel!)!, communityFeaturedTopicsHeaderView: (self?.communityFeaturedTopicsHeaderView)!, button: (self?.focusButton)!, communityFollowTopicType: .view)
             }
         }
         navigationBar.onClickRightButton = {
@@ -251,7 +250,6 @@ class CommunityFeaturedTopicsViewController: BaseViewController {
     }
     
     
-    
     /// 显示键盘
     func showKeyBoardCommentView() {
         KeyBoardInputView.show(inputViewResultClosure: {
@@ -294,18 +292,6 @@ extension CommunityFeaturedTopicsViewController {
     }
 }
 
-extension CommunityFeaturedTopicsViewController {
-    func isFollow() {
-        if communityTopicDetailModel?.isFollow == 1 {
-            focusButton.isSelected = true
-            focusButton.layer.borderColor = kf7f8faColor.cgColor
-        }else {
-            focusButton.isSelected = false
-            focusButton.layer.borderColor = kThemeColor.cgColor
-        }
-    }
-}
-
 extension CommunityFeaturedTopicsViewController {
     
     /// 话题详情页面
@@ -314,7 +300,7 @@ extension CommunityFeaturedTopicsViewController {
             [weak self] (communityTopicDetailModel) -> (Void) in
             self?.communityTopicDetailModel = communityTopicDetailModel as? CommunityTopicDetailModel
             self?.topicLable.text = self?.communityTopicDetailModel?.name
-            self?.isFollow()
+            CommunityFollowTopicViewModel.shared.followTopicButton(communityTopicDetailModel: self?.communityTopicDetailModel, button: (self?.focusButton)!)
             self?.bgImageView.kf.setImage(with: kURLImage(name: self?.communityTopicDetailModel?.img ?? ""), placeholder: kImage(name: "pic_example_12"))
             self?.navigationBar.barBackgroundImage = self?.bgImageView.image
             self?.communityFeaturedTopicsHeaderView.communityTopicDetailModel = self?.communityTopicDetailModel
@@ -470,6 +456,7 @@ extension CommunityFeaturedTopicsViewController : UITableViewDelegate,UITableVie
                 let vc = CommunityVideoListController()
                 vc.contentId = communityRecommendDataModel.id ?? 0
                 vc.topicId = self.id
+                vc.departureVc = .others
                 self.navigationController?.pushViewController(vc, animated: true)
             }else {
                 let vc = CommunityRecommendController()

+ 4 - 50
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityMyFollowTopic/View/CommunityMyFollowTopicCell.swift

@@ -87,17 +87,16 @@ class CommunityMyFollowTopicCell: UITableViewCell {
         focusButton.titleLabel?.font = kRegularFont13
         focusButton.setBackgroundImage(UIImage.imageWithColor(color: kThemeColor), for: UIControl.State.normal)
         focusButton.setBackgroundImage(UIImage.imageWithColor(color: kffffffColor), for: UIControl.State.selected)
-        focusButton.alpha = 0
         focusButton.layer.borderWidth = 0.5
         focusButton.layer.borderColor = kThemeColor.cgColor
         focusButton.cornerRadius = 14
         focusButton.masksToBounds = true
         focusButton.rx.tap.subscribe(onNext: { [weak self] (data) in
-            focusButton.isEnabled = false
             if self?.communityMemberFollowTopicListDataModel?.isFollow == 1 {
-                self?.communityMemberFollowTopicCancelFollowApi()
+                CommunityFollowTopicViewModel.shared.communityMemberFollowTopicCancelFollowApi(topicId: self?.communityMemberFollowTopicListDataModel?.topicId ?? 0, communityMemberFollowTopicListDataModel: self?.communityMemberFollowTopicListDataModel, button: (self?.focusButton)!, communityFollowTopicType:.listView)
             }else {
-                self?.communityMemberFollowTopicFollowApi()
+                CommunityFollowTopicViewModel.shared.communityMemberFollowTopicFollowApi(topicId: self?.communityMemberFollowTopicListDataModel?.topicId ?? 0, communityMemberFollowTopicListDataModel: self?.communityMemberFollowTopicListDataModel, button: (self?.focusButton)!, communityFollowTopicType:.listView)
+
             }
         }).disposed(by: disposeBag)
         
@@ -113,54 +112,9 @@ class CommunityMyFollowTopicCell: UITableViewCell {
     var communityMemberFollowTopicListDataModel: CommunityMemberFollowTopicListDataModel? {
         didSet {
             titleLabel.text = communityMemberFollowTopicListDataModel?.topicName
-            isFollow()
+            CommunityFollowTopicViewModel.shared.followTopicListButton(communityMemberFollowTopicListDataModel: communityMemberFollowTopicListDataModel, button: focusButton)
         }
     }
     
 }
 
-
-extension CommunityMyFollowTopicCell {
-    func isFollow() {
-        if communityMemberFollowTopicListDataModel?.isFollow == 1 {
-            focusButton.isSelected = true
-            UIView.animate(withDuration: 1) {
-                [weak self] in
-                self?.focusButton.alpha = 0
-            }
-        }else {
-            focusButton.isSelected = false
-            focusButton.alpha = 1
-        }
-    }
-}
-
-extension CommunityMyFollowTopicCell {
-    /// 关注话题(单个)
-    ///
-    /// - Parameters:
-    ///   - topicId: 话题Id
-    ///   - completion: 回调
-    func communityMemberFollowTopicFollowApi() {
-        SwiftMoyaNetWorkServiceCommunity.shared().communityMemberFollowTopicFollowApi(topicId: communityMemberFollowTopicListDataModel?.topicId ?? 0) {
-            [weak self] (data) -> (Void) in
-            self?.focusButton.isEnabled = true
-            self?.communityMemberFollowTopicListDataModel?.isFollow = 1
-            self?.isFollow()
-        }
-    }
-    
-    /// 取消关注话题
-    ///
-    /// - Parameters:
-    ///   - topicId: 话题Id
-    ///   - completion: 回调
-    func communityMemberFollowTopicCancelFollowApi() {
-        SwiftMoyaNetWorkServiceCommunity.shared().communityMemberFollowTopicCancelFollowApi(topicId: communityMemberFollowTopicListDataModel?.topicId ?? 0) {
-            [weak self] (data) -> (Void) in
-            self?.focusButton.isEnabled = true
-            self?.communityMemberFollowTopicListDataModel?.isFollow = 0
-            self?.isFollow()
-        }
-    }
-}

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/Controller/CommunityRecommendController.swift

@@ -236,7 +236,7 @@ class CommunityRecommendController: BaseViewController {
             if self?.communityPostDetailModel?.uid == followStatusModel?.uid {
                 self?.communityPostDetailModel?.isFollow = followStatusModel?.isFollowStatus
                 self?.communityPostDetailTableViewHeaderView.communityPostDetailModel = self?.communityPostDetailModel
-                CommunityFollowUserViewModel.shared.setFollowType(followButton: (self?.followButton)!, followType: FollowType(rawValue: self?.communityPostDetailModel?.isFollow ?? 0) ?? .futureFollow)
+                CommunityFollowUserViewModel.setFollowType(followButton: (self?.followButton)!, followType: FollowType(rawValue: self?.communityPostDetailModel?.isFollow ?? 0) ?? .futureFollow)
                 self?.tableView.reloadData()
             }
         }
@@ -366,7 +366,7 @@ extension CommunityRecommendController {
             }else {
                 self?.followButton.isHidden = false
             }
-            CommunityFollowUserViewModel.shared.setFollowType(followButton: (self?.followButton)!, followType: FollowType(rawValue: self?.communityPostDetailModel?.isFollow ?? 0) ?? .futureFollow)
+            CommunityFollowUserViewModel.setFollowType(followButton: (self?.followButton)!, followType: FollowType(rawValue: self?.communityPostDetailModel?.isFollow ?? 0) ?? .futureFollow)
             self?.commentView.communityPostDetailModel = self?.communityPostDetailModel
             self?.count = self?.communityPostDetailModel?.commentCount ?? 0
             

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/View/HTMLCell/CommunityRecommendDetailHTMLTableViewCell.swift

@@ -249,7 +249,7 @@ class CommunityRecommendDetailHTMLTableViewCell: UITableViewCell {
             
             avatarButton.kf.setImage(with: kURLImage(name: communityPostDetailModel?.avatar ?? ""), for: UIControl.State.normal, placeholder: kImage(name: "default_avatar"))
             nameButton.setTitle(communityPostDetailModel?.username, for: UIControl.State.normal)
-            CommunityFollowUserViewModel.shared.setFollowType(followButton: followButton, followType: FollowType(rawValue: communityPostDetailModel?.isFollow ?? 0) ?? .futureFollow)
+            CommunityFollowUserViewModel.setFollowType(followButton: followButton, followType: FollowType(rawValue: communityPostDetailModel?.isFollow ?? 0) ?? .futureFollow)
             beanLabel.text = "\(communityPostDetailModel?.availableBean ?? 0)U米待收获"
             timeReadLabel.text = " I \(communityPostDetailModel?.createdAt ?? "") I 阅读·\(communityPostDetailModel?.pv ?? 0)"
             webView.load(URLRequest(url: URL(string: communityPostDetailModel?.descUrl ?? "")!))

+ 7 - 6
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/View/CommunityVideoCoverCollectionCell.swift

@@ -152,9 +152,9 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
         }
         shareBtnLeft.snp.makeConstraints { (make) in
             make.right.equalTo(-52)
-            make.bottom.equalTo(-8)
-            make.width.equalTo(123)
-            make.height.equalTo(35)
+            make.bottom.equalTo(-4)
+            make.width.equalTo(109)
+            make.height.equalTo(44)
         }
         
         // 底部
@@ -258,8 +258,8 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
         followButton.snp.makeConstraints { (make) in
             make.left.equalTo(personLabel.snp_right).offset(10)
             make.centerY.equalToSuperview()
-            make.width.equalTo(64)
-            make.height.equalTo(20)
+            make.width.equalTo(54)
+            make.height.equalTo(24)
             make.right.equalToSuperview()
         }
         
@@ -739,10 +739,11 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
     private lazy var followButton: UIButton = {
         let followButton = UIButton(type: UIButton.ButtonType.custom)
         followButton.titleLabel?.font = kMediumFont13
-        followButton.layer.cornerRadius = 10
+        followButton.layer.cornerRadius = 12
         followButton.layer.masksToBounds = true
         followButton.setTitleColor(kffffffColor, for: .normal)
         followButton.rx.tap.subscribe(onNext: {[weak self] (data) in
+            followButton.isEnabled = true
             if let followClosure = self?.followClosure {
                 followClosure(self!.videoItemMdl!, followButton)
             }

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageList/ViewController/MessageListController.swift

@@ -137,7 +137,7 @@ extension MessageListController: UITableViewDataSource, UITableViewDelegate {
         switch messageVCType {
         case .comment?,.praise?:
             if messageDataModel.param?.postTypeEnum == .video {
-                Mediator.push(CommunityRouterModuleType.pushPostDetailVoide(postId: "\(messageDataModel.param?.postId ?? 0)", departType: .others))
+                Mediator.push(CommunityRouterModuleType.pushPostDetailVoide(postId: "\(messageDataModel.param?.postId ?? 0)", departType: .others, topicId: 0))
             }else {
                 Mediator.push(CommunityRouterModuleType.pushPostDetailContent(postId: "\(messageDataModel.param?.postId ?? 0)"))
             }

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessagePlanetActivity/Controller/MessagePlanetActivityController.swift

@@ -113,7 +113,7 @@ extension MessagePlanetActivityController: UITableViewDataSource, UITableViewDel
             break
         case .post?:
             if messageDataModel.param?.postTypeEnum == .video {
-                Mediator.push(CommunityRouterModuleType.pushPostDetailVoide(postId: "\(messageDataModel.param?.activityUrl ?? "")", departType: .others))
+                Mediator.push(CommunityRouterModuleType.pushPostDetailVoide(postId: "\(messageDataModel.param?.activityUrl ?? "")", departType: .others, topicId: 0))
             }else {
                 Mediator.push(CommunityRouterModuleType.pushPostDetailContent(postId: "\(messageDataModel.param?.activityUrl ?? "")"))
             }

+ 3 - 3
RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/PersonalCenterView/PersonViewUserAndOtherHeaderView.swift

@@ -184,12 +184,12 @@ class PersonViewUserAndOtherHeaderView: BaseView {
             if self?.userDetailModel?.isFollowStatus == 0 {
                 self?.userFollow(followUid: self?.userDetailModel?.uid ?? 0, completion: { (isFollowStatus) in
                     self?.userDetailModel?.isFollowStatus = isFollowStatus
-                    CommunityFollowUserViewModel.shared.setFollowType(followButton: followButton, followType: FollowType(rawValue: self?.userDetailModel?.isFollowStatus ?? 0))
+                    CommunityFollowUserViewModel.setFollowType(followButton: followButton, followType: FollowType(rawValue: self?.userDetailModel?.isFollowStatus ?? 0))
                 })
             }else {
                 self?.userCancelFollow(followUid: self?.userDetailModel?.uid ?? 0, completion: { (isFollowStatus) in
                     self?.userDetailModel?.isFollowStatus = isFollowStatus
-                    CommunityFollowUserViewModel.shared.setFollowType(followButton: followButton, followType: FollowType(rawValue: self?.userDetailModel?.isFollowStatus ?? 0))
+                    CommunityFollowUserViewModel.setFollowType(followButton: followButton, followType: FollowType(rawValue: self?.userDetailModel?.isFollowStatus ?? 0))
                 })
             }
         }).disposed(by: disposeBag)
@@ -229,7 +229,7 @@ class PersonViewUserAndOtherHeaderView: BaseView {
     
     var userDetailModel: UserDetailModel? {
         didSet {
-            CommunityFollowUserViewModel.shared.setFollowType(followButton: followButton, followType: FollowType(rawValue: userDetailModel?.isFollowStatus ?? 0))
+            CommunityFollowUserViewModel.setFollowType(followButton: followButton, followType: FollowType(rawValue: userDetailModel?.isFollowStatus ?? 0))
             bgImageView.kf.setImage(with: kURLImage(name: userDetailModel?.backgroundImg ?? "default_pic"), placeholder: kImage(name: "default_pic"))
             titleLabel.text = userDetailModel?.username
             if userDetailModel?.signature == "" || userDetailModel?.signature == nil  {

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/PersonalCenterView/PersonViewUserAndOtherListCollectionViewCell.swift

@@ -88,7 +88,7 @@ class PersonViewUserAndOtherListCollectionViewCell: UICollectionViewCell {
     
     private lazy var rainbowBeanImageView: UIImageView = {
         let rainbowBeanImageView = UIImageView()
-        rainbowBeanImageView.image = kImage(name: "center_peas")
+        rainbowBeanImageView.image = kImage(name: "center_umi")
         return rainbowBeanImageView
     }()
     

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/PersonalCenterView/PersonViewUserAndOtherListView.swift

@@ -141,7 +141,7 @@ extension PersonViewUserAndOtherListView: UICollectionViewDelegateFlowLayout,UIC
         let postMyModel = postMyModels[indexPath.row]
 
         if PostType(rawValue: postMyModel.type ?? "video") == .video {
-            Mediator.push(CommunityRouterModuleType.pushPostDetailVoide(postId: "\(postMyModel.id ?? 0)", departType: .personal))
+            Mediator.push(CommunityRouterModuleType.pushPostDetailVoide(postId: "\(postMyModel.id ?? 0)", departType: .personal, topicId: 0))
             
         }else {
             let vc = CommunityRecommendController()

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoCoverPick/View/AliyunPublishTopView.m

@@ -50,7 +50,7 @@
                      forState:UIControlStateNormal];
     [nextButton setTitleColor:rgba(110, 118, 139, 1)
                      forState:(UIControlStateDisabled)];
-    nextButton.backgroundColor = RGBToColor(98, 204, 116);
+    nextButton.backgroundColor = RGBToColor(37, 224, 205);
     nextButton.layer.cornerRadius = 13;
     nextButton.layer.masksToBounds = YES;
     

+ 23 - 3
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoCrop/View/AliyunCropThumbnailView.m

@@ -61,7 +61,9 @@
     followLayout.itemSize = CGSizeMake((ScreenWidth-28)/kCutSegment , 72);
     followLayout.minimumLineSpacing = 0;
     followLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
-    
+    _collectionView.layer.cornerRadius = 3;
+    _collectionView.layer.masksToBounds = YES;
+    _collectionView.clipsToBounds = YES;
     _collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 38, ScreenWidth-28, 72) collectionViewLayout:followLayout];
     _collectionView.dataSource = (id<UICollectionViewDataSource>)self;
     [_collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"cell"];
@@ -70,6 +72,8 @@
 
 - (void)setupSubviews {
     
+    
+    
     _progressView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"video_edit_progressbar"]];
     _progressView.bounds = CGRectMake(0, 0, 4, 80);
     _progressView.center = CGPointMake(0, CGRectGetMidY(self.bounds) + 19);
@@ -90,10 +94,10 @@
     _imageViewRight.userInteractionEnabled = YES;
     
     _topLineView = [[UIImageView alloc]initWithFrame:CGRectMake(_imageViewWith - 3 , 38, ScreenWidth-28 - 2*_imageViewWith+6, 3)];
-    _topLineView.backgroundColor = [UIColor colorWithHexString:@"#62CC74"];
+    _topLineView.backgroundColor = [UIColor colorWithHexString:@"#25E0CD"];
     
     _underLineView = [[UIImageView alloc]initWithFrame:CGRectMake(_imageViewWith - 3, _imageViewLeft.frame.size.height + 38 - 3  , ScreenWidth-28 - 2*_imageViewWith+6, 3)];
-    _underLineView.backgroundColor = [UIColor colorWithHexString:@"#62CC74"];
+    _underLineView.backgroundColor = [UIColor colorWithHexString:@"#25E0CD"];
     
     [self addSubview:_topLineView];
     [self addSubview:_underLineView];
@@ -180,6 +184,22 @@
     imageView.contentMode = UIViewContentModeScaleAspectFill;
     imageView.clipsToBounds = YES;
     [cell.contentView addSubview:imageView];
+    if (indexPath.row == 0){
+        UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:imageView.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopLeft cornerRadii:CGSizeMake(3, 3)];
+        CAShapeLayer *maskLayer = [CAShapeLayer new];
+        maskLayer.frame = imageView.bounds;
+
+        maskLayer.path = maskPath.CGPath;
+        imageView.layer.mask = maskLayer;
+    }
+    if (indexPath.row == _imagesArray.count - 1){
+        UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:imageView.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopLeft cornerRadii:CGSizeMake(3, 3)];
+        CAShapeLayer *maskLayer = [CAShapeLayer new];
+        maskLayer.frame = imageView.bounds;
+        
+        maskLayer.path = maskPath.CGPath;
+        imageView.layer.mask = maskLayer;
+    }
     return cell;
 }
 

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoCrop/View/AliyunCropViewBottomView.m

@@ -47,7 +47,7 @@
     self.cropButton = [self buttonWithRect:(CGRectMake(width - 14 - 64, 8, 64, 26)) image:nil action:@selector(cropButtonAction)];
     [self.cropButton setTitle:@"下一步" forState:UIControlStateNormal];
     [self.cropButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
-    self.cropButton.backgroundColor = RGBToColor(98, 204, 116);
+    self.cropButton.backgroundColor = RGBToColor(37, 224, 205);
     self.cropButton.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightMedium];
     self.cropButton.layer.cornerRadius = 13;
     self.cropButton.layer.masksToBounds = YES;

+ 33 - 7
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoEdit/Controller/AliyunEditViewController.m

@@ -500,7 +500,7 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
         [_publishButton setTitle:@"下一步" forState:UIControlStateNormal];
         _publishButton.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightMedium];
         [_publishButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
-        _publishButton.backgroundColor = RGBToColor(98, 204, 116);
+        _publishButton.backgroundColor = RGBToColor(37, 224, 205);
         [_publishButton addTarget:self action:@selector(publish) forControlEvents:UIControlEventTouchUpInside];
         _publishButton.layer.cornerRadius = 13;
         _publishButton.layer.masksToBounds = YES;
@@ -613,6 +613,7 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
 
 - (void)dimRateViewTapGesture {
     self.rateViewWithDim.hidden = true;
+    [self hiddenButtonisHidden:false];
 }
 
 /**
@@ -652,7 +653,13 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(resourceDeleteNoti:) name:AliyunEffectResourceDeleteNotification object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(downloadMusicAndCombineNoti:) name:@"DownloadMusicAndCombineNoti" object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeAudioVolumn:) name:@"ChangeAudioVolumnNoti" object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(musicViewDidClose) name:@"EditCloseMusicChooseViewNoti" object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(musicViewDidClose:) name:@"EditCloseMusicChooseViewNoti" object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(volumnDidClose) name:@"EditCloseChooseVolumnNoti" object:nil];
+
+}
+
+- (void)volumnDidClose {
+    [self hiddenButtonisHidden:false];
 }
 
 - (void)removeNotifications {
@@ -673,6 +680,7 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
         
     } else {
         [self downloadFileFromServerWithUrlStr:urlStr];
+        [self hiddenButtonisHidden:false];
     }
     
     // 音乐按钮动效设置
@@ -688,13 +696,15 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
 
     [self.editor setMainStreamsAudioWeight:_originAudioVolumn];
     [self.editor setAudioWeight:_backAudioVolumn streamId:_curEffectVid];
+    [self hiddenButtonisHidden:false];
 }
 
-- (void)musicViewDidClose {
+- (void)musicViewDidClose:(NSNotification *)noti {
     [self resume];
-    
+    if ([noti.object isEqual: @"1"]) {
+        [self hiddenButtonisHidden:false];
+    }
     [self hideMusicView:YES];
-
 }
 
 
@@ -904,8 +914,7 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
  */
 - (void)enterEditWithActionType:(AliyunEditSouceClickType)type
             animationCompletion:(void (^__nullable)(BOOL finished))completion {
-    NSLog(@"多点测试:%lu", (unsigned long)type);
-    NSLog(@"多点测试:底部按钮失效");
+
     _editSouceClickType = type;
     _vcStatus = AlivcEditVCStatus_Edit;
     
@@ -920,6 +929,7 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
     if (view) {
         [self p_showEffectView:view duration:animationTime];
     }
+    [self hiddenButtonisHidden:true];
 }
 
 /**
@@ -945,6 +955,8 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
     } else {
         [self p_dismissBackgroundButton];
     }
+    [self hiddenButtonisHidden:false];
+
 }
 
 /**
@@ -1281,6 +1293,8 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
     self.musicView.backVolumn = self.backAudioVolumn;
     
     [self hideMusicView:NO];
+    [self hiddenButtonisHidden:true];
+
 }
 
 - (void)hideMusicView:(BOOL)hidden {
@@ -1298,7 +1312,19 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
 
 //时间特效
 - (void)timeButtonClicked {
+    
     self.rateViewWithDim.hidden = false;
+    
+    [self hiddenButtonisHidden:true];
+
+}
+
+- (void)hiddenButtonisHidden:(BOOL)isHidden {
+    self.backButton.hidden = isHidden;
+    self.publishButton.hidden = isHidden;
+    self.musicButton.hidden = isHidden;
+    self.filterButton.hidden = isHidden;
+    self.speedButton.hidden = isHidden;
 }
 
 #pragma mark - AliyunEffectFilter2ViewDelegate - 滤镜

+ 1 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoRecord/Controller/AliyunMagicCameraViewController.m

@@ -388,6 +388,7 @@
 }
 
 - (void)musicViewDidClose {
+    
     [self hideMusicView:YES];
     self.magicCameraView.rateView.hidden = false;
     

RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishAddAddress/PublishAddressPOICell.swift → RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishAddAddress/View/PublishAddressPOICell.swift


RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishAddAddress/PublishAddressPOIView.swift → RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishAddAddress/View/PublishAddressPOIView.swift


+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishAddAddress/SearchAddrNavigationbarView.swift

@@ -81,7 +81,7 @@ class SearchAddrNavigationbarView: BaseView {
     private lazy var searchTextField: UITextField = {
         let searchTextField = UITextField()
         searchTextField.placeholder = "请输入地址"
-        searchTextField.tintColor = kFFA42FColor
+        searchTextField.tintColor = kThemeColor
         searchTextField.textColor = k333333Color
         searchTextField.returnKeyType = .search
         searchTextField.font = kScaleRegularFont14

+ 2 - 3
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishAddAddress/PublishAddAddressController.swift

@@ -49,11 +49,10 @@ class PublishAddAddressController: BaseViewController {
     }
     
     override func setupViews() {
-        navigationBar.isHidden = true
+        navigationBar.leftButton.isHidden = true
         navigationBar.addSubview(navigationBarView)
-        
-        
         view.addSubview(addressPOIView)
+        view.insertSubview(navigationBar, aboveSubview: addressPOIView)
         addressPOIView.locationAddress = locationAddress
         addressPOIView.longitude = longitude
         addressPOIView.latitude = latitude

+ 27 - 21
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishAddTopic/Controller/PublishAddTopicController.swift

@@ -14,7 +14,7 @@ import Photos
 class PublishAddTopicController: BaseViewController {
     
     // 话题组のModelArr
-    var communityTopicModels = Array<CommunityTopicModel>()
+    var communityTopicModels : Array<CommunityTopicModel>?
     
     // 话题组下子话题のModelArr
     var topicListModels = Array<CommunityTopicDataModel>()
@@ -25,6 +25,7 @@ class PublishAddTopicController: BaseViewController {
     typealias SelTopicsClosure = (_ topicMdlArr: Array<CommunityTopicDataModel>) -> Void
     var selTopicsClosure : SelTopicsClosure?
     
+    var categoryId : Int = 0
     
     override func viewDidLoad() {
         super.viewDidLoad()
@@ -58,13 +59,18 @@ class PublishAddTopicController: BaseViewController {
             make.top.equalToSuperview().offset(kNavBarTotalHeight)
             make.left.right.bottom.equalToSuperview()
         }
+        view.insertSubview(navigationBar, aboveSubview: tableView)
     }
     
     override func setupData() {
-        // 话题组
+
         communityTopicCategoryApi(page:1)
-        // 子话题
-        communityTopicsApi(isSuggest: 0, categoryId: -2, page: 1)
+        tableView.addAutoNormalFooter(withAutomaticallyRefresh: true) {
+            [weak self] (page) in
+            // 子话题
+            self?.communityTopicsApi(categoryId: (self?.categoryId)!, page: page)
+        }
+        
     }
     
     lazy var tableView: UITableView = {
@@ -73,9 +79,9 @@ class PublishAddTopicController: BaseViewController {
         tableView.backgroundColor = kffffffColor
         tableView.dataSource = self
         tableView.delegate = self
-        tableView.estimatedRowHeight = 0.000001
-        tableView.estimatedSectionFooterHeight = 0.000001
-        tableView.estimatedSectionHeaderHeight = 0.000001
+        tableView.estimatedRowHeight = 0
+        tableView.estimatedSectionFooterHeight = 0
+        tableView.estimatedSectionHeaderHeight = 0
         return tableView
     }()
     
@@ -106,13 +112,8 @@ extension PublishAddTopicController : UITableViewDelegate, UITableViewDataSource
             picCell.topicModels = communityTopicModels
             picCell.chooseTopicBlock = {
                 [weak self] (topicId, indexRow) in
-                if indexRow == 0 {
-                    // 推荐
-                    self?.communityTopicsApi(isSuggest: 1, categoryId: topicId, page: 1)
-                } else {
-                    // 其他
-                    self?.communityTopicsApi(isSuggest: 0, categoryId: topicId, page: 1)
-                }
+                self?.categoryId = topicId
+                self?.communityTopicsApi(categoryId: topicId, page: 1)
             }
             return picCell
         case 1:
@@ -171,7 +172,7 @@ extension PublishAddTopicController : UITableViewDelegate, UITableViewDataSource
                 return 44
             }
         } else {
-            return 0
+            return 0.000001
         }
     }
     
@@ -217,22 +218,27 @@ extension PublishAddTopicController {
     func communityTopicCategoryApi(page:Int) {
         SwiftMoyaNetWorkServiceCommunity.shared().communityTopicCategoryApi(isSuggest: 0) {   [weak self] (communityTopicCategoryModel) -> (Void) in
             let topicCategoryModel = communityTopicCategoryModel as? CommunityTopicCategoryModel
-            self?.communityTopicModels = (topicCategoryModel?.data)!
-            self?.tableView.reloadData()
+            self?.communityTopicModels = topicCategoryModel?.data ?? Array<CommunityTopicModel>()
+            if !(self?.communityTopicModels?.isEmpty ?? true) {
+                let communityTopicModel = self?.communityTopicModels?[0]
+                // 子话题
+                self?.communityTopicsApi(isSuggest: 0, categoryId: communityTopicModel?.id ?? 0, page: 1)
+            }else {
+                MJRefreshManager.hiddenHeaderWithFooter(tableView: self?.tableView,loadingStatus: .noData)
+            }
         }
     }
     
     /// 话题列表
     ///
     /// - Parameter page: 分页
-    func communityTopicsApi(isSuggest:Int, categoryId:Int, page:Int) {
+    func communityTopicsApi(isSuggest:Int = 0, categoryId:Int, page:Int) {
         SwiftMoyaNetWorkServiceCommunity.shared().communityTopicsApi(categoryId: categoryId, isSuggest: isSuggest, page: page, completion: {
             [weak self] (communityTopicsModel) -> (Void) in
             let communityTopicsModel = communityTopicsModel as? CommunityTopicsModel
             if communityTopicsModel?.pagination?.currentPage == 1{
                 self?.topicListModels.removeAll()
                 self?.tableView.resetNoMoreData()
-                self?.tableView.isHiddenFooter(true)
             }
             self?.topicListModels = (self?.topicListModels)! + (communityTopicsModel?.data!)!
             // 更新选中状态
@@ -241,7 +247,7 @@ extension PublishAddTopicController {
             MJRefreshManager.hiddenHeaderWithFooter(tableView: self?.tableView, pagination: communityTopicsModel?.pagination)
         }) {
             [weak self] (loadingStatus) in
-            MJRefreshManager.hiddenHeaderWithFooter(tableView: self?.tableView)
+            MJRefreshManager.hiddenHeaderWithFooter(tableView: self?.tableView,loadingStatus: loadingStatus)
             
         }
 
@@ -266,7 +272,7 @@ extension PublishAddTopicController {
             navigationBar.wr_setRightButton(title: "完成(\(selCount)/5)", titleColor: k999999Color)
             navigationBar.rightButton.isUserInteractionEnabled = false
         } else {
-            navigationBar.wr_setRightButton(title: "完成(\(selCount)/5)", titleColor: k7AD489Color)
+            navigationBar.wr_setRightButton(title: "完成(\(selCount)/5)", titleColor: kThemeColor)
             navigationBar.rightButton.isUserInteractionEnabled = true
         }
     }

+ 3 - 3
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishAddTopic/View/PublishSelTopicCollectionCell.swift

@@ -58,12 +58,12 @@ class PublishSelTopicCollectionCell: UICollectionViewCell {
     
     private func setupLayouts() {
         iconImageView.snp.makeConstraints { (make) in
-            make.top.equalTo(5)
+            make.centerY.equalToSuperview()
             make.left.equalTo(6)
             make.size.equalTo(16)
         }
         titleLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(3)
+            make.centerY.equalToSuperview()
             make.left.equalTo(iconImageView.snp_right).offset(5)
             make.right.equalTo(-26)
             make.height.equalTo(19)
@@ -71,7 +71,7 @@ class PublishSelTopicCollectionCell: UICollectionViewCell {
         deleteButton.snp.makeConstraints { (make) in
             make.left.equalTo(titleLabel.snp_right).offset(2)
             make.right.equalTo(-2)
-            make.size.equalTo(22)
+            make.centerY.equalToSuperview()
         }
     }
     

+ 12 - 3
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEditController/Controller/PublishEditController.swift

@@ -150,7 +150,16 @@ extension PublishEditController : UITableViewDelegate, UITableViewDataSource {
             picCell.reloadData()
             picCell.choosePicBlock = {
                 [weak self] in
-                self?.navigationController?.popViewController(animated: false)
+                let vc = KSMediaPickerController(maxVideoItemCount: 0, maxPictureItemCount: (UInt(9 -
+                    (self?.imageArr?.count ?? 0))))
+                vc.mediaType = KSMediaPickerController.mediaType.picture
+                vc.jumpType = .publishEdit
+                vc.pubEditImgClosure = {
+                    [weak self] (imageArray) in
+                    self?.imageArr = (self?.imageArr ?? Array<UIImage>()) + imageArray
+                    self?.tableView.reloadData()
+                }
+                self?.present(vc, animated: true, completion: nil)
             }
             picCell.delPicTransBlock = {
                 [weak self] (picIdx) in
@@ -239,7 +248,7 @@ extension PublishEditController : UITableViewDelegate, UITableViewDataSource {
     }
     
     func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
-        return 0
+        return 0.000001
     }
     
     func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
@@ -315,7 +324,7 @@ extension PublishEditController {
         if pubContent.count == 0 || selTopicIdArr.count == 0 {
             rightButton.backgroundColor = kd8d8d8Color
         } else {
-            rightButton.backgroundColor = k62CC74Color
+            rightButton.backgroundColor = kThemeColor
         }
     }
     

RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEditController/View/PublishEditAddAddressCell.swift → RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEdit/View/PublishEditAddAddressCell.swift


RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEditController/View/PublishEditAddImgCollectionCell.swift → RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEdit/View/PublishEditAddImgCollectionCell.swift


+ 4 - 4
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEditController/View/PublishEditAddPicCell.swift

@@ -116,10 +116,10 @@ extension PublishEditAddPicCell: UICollectionViewDelegateFlowLayout,UICollection
             }
             pCell.delPicBlock = {
                 [weak self] (idxRow) in
-                if self?.imgCount == 1 {
-                    SwiftProgressHUD.shared().showText("请保留至少1张图片")
-                    return
-                }
+//                if self?.imgCount == 1 {
+//                    SwiftProgressHUD.shared().showText("请保留至少1张图片")
+//                    return
+//                }
                 
                 if let delPicTransBlock = self?.delPicTransBlock {
                     delPicTransBlock(idxRow)

RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEditController/View/PublishEditAddTopicCell.swift → RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEdit/View/PublishEditAddTopicCell.swift


RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEditController/View/PublishEditDefaultCollectionCell.swift → RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEdit/View/PublishEditDefaultCollectionCell.swift


+ 1 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEditController/View/PublishEditDescribeCell.swift

@@ -64,6 +64,7 @@ class PublishEditDescribeCell: UITableViewCell {
         cmtTextView.placeholder = "说一说你的美好心得..."
         cmtTextView.placeholderTextColor = kDDDDDDColor
         cmtTextView.delegate = self
+        cmtTextView.tintColor = kThemeColor
         return cmtTextView
     }()
     

RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEditController/View/PublishEditTitleCell.swift → RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEdit/View/PublishEditTitleCell.swift


+ 40 - 14
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/Controller/KSMediaPickerController.swift

@@ -6,8 +6,6 @@
 //
 
 import UIKit
-import Photos
-import JXSegmentedView
 
 open class KSNavigationController: UINavigationController {
     
@@ -17,6 +15,9 @@ open class KSNavigationController: UINavigationController {
     }
 }
 
+import Photos
+import JXSegmentedView
+
 @objc public protocol KSMediaPickerControllerDelegate: NSObjectProtocol {
     
     @objc optional func mediaPicker(_ mediaPicker: KSMediaPickerController, didFinishSelected outputArray: [KSMediaPickerOutputModel])
@@ -33,17 +34,27 @@ open class KSMediaPickerController: UIViewController, UICollectionViewDelegate,
     typealias PubImgClosure = (_ selectedAssetArray: Array<UIImage>) -> Void
     var pubImgClosure: PubImgClosure?
     
+    typealias PubEditImgClosure = (_ selectedAssetArray: Array<UIImage>) -> Void
+    var pubEditImgClosure: PubEditImgClosure?
+    
     @objc public enum mediaType : Int {
         case all        = 0
         case picture    = 1
         case video      = 2
     }
     
+    @objc enum jumpType : Int {
+        case publish = 0
+        case publishEdit = 1
+    }
+    
     @objc public let maxItemCount: UInt
     @objc public let maxVideoItemCount: UInt
     @objc public let maxPictureItemCount: UInt
-    @objc public let mediaType: KSMediaPickerController.mediaType
+    @objc public var mediaType: KSMediaPickerController.mediaType
+    var jumpType: KSMediaPickerController.jumpType?
     @objc open weak var delegate: KSMediaPickerControllerDelegate?
+
     
     var curSelectCount: UInt = 0
     
@@ -88,6 +99,7 @@ open class KSMediaPickerController: UIViewController, UICollectionViewDelegate,
     
     override open func loadView() {
         let view = KSMediaPickerView()
+        view.jumpType = self.jumpType
         
         let nav = view.albumNavigationView
         nav.closeButton.addTarget(self, action: #selector(_didClick(closeButton:)), for: .touchUpInside)
@@ -160,10 +172,15 @@ open class KSMediaPickerController: UIViewController, UICollectionViewDelegate,
     }
     
     @objc private func _didClick(closeButton: UIButton?) {
-        if let dismissClosure = self.dismissClosure {
-            (view as! KSMediaPickerView).previewView.videoPause()
-            dismissClosure()
-        }        
+        
+        if self.jumpType == .publishEdit {
+            self.dismiss(animated: true, completion: nil)
+        }else {
+            if let dismissClosure = self.dismissClosure {
+                (view as! KSMediaPickerView).previewView.videoPause()
+                dismissClosure()
+            }
+        }
     }
     
     @objc private func _didClick(nextButton: UIButton) {
@@ -184,9 +201,18 @@ open class KSMediaPickerController: UIViewController, UICollectionViewDelegate,
                 imageArray.append(image)
                 
                 if index == self._selectedAssetArray.count-1 {
-                    if let pubImgClosure = self.pubImgClosure {
-                        (self.view as! KSMediaPickerView).previewView.videoPause()
-                        pubImgClosure(imageArray)
+                    
+                    if self.jumpType == .publishEdit {
+                        if let pubEditImgClosure = self.pubEditImgClosure {
+                            pubEditImgClosure(imageArray)
+                        }
+                        self.dismiss(animated: true, completion: nil)
+
+                    }else {
+                        if let pubImgClosure = self.pubImgClosure {
+                            (self.view as! KSMediaPickerView).previewView.videoPause()
+                            pubImgClosure(imageArray)
+                        }
                     }
                 }
             }
@@ -200,7 +226,7 @@ open class KSMediaPickerController: UIViewController, UICollectionViewDelegate,
         }
         let indexPath = (view as! KSMediaPickerView).collectionView.indexPath(for: collectionViewCell)
         if indexPath != nil {
-            updateHighlightItem(at: indexPath!)
+            _updateHighlightItem(at: indexPath!)
         }
         
         var selCount: UInt = 0
@@ -209,7 +235,7 @@ open class KSMediaPickerController: UIViewController, UICollectionViewDelegate,
         if assetMediaType == .video {
             maxCount = 1
         } else if assetMediaType == .image {
-            maxCount = 9
+            maxCount = maxPictureItemCount
         }
         
         if itemModel.index > 0 {
@@ -427,10 +453,10 @@ open class KSMediaPickerController: UIViewController, UICollectionViewDelegate,
     
     public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
         collectionView.deselectItem(at: indexPath, animated: true)
-        updateHighlightItem(at: indexPath)
+        _updateHighlightItem(at: indexPath)
     }
     
-    private func updateHighlightItem(at indexPath: IndexPath) {
+    private func _updateHighlightItem(at indexPath: IndexPath) {
         let view = self.view as! KSMediaPickerView
         guard indexPath != _highlightedItemIndexPath,
             let cell = view.collectionView.cellForItem(at: indexPath) as? KSMediaPickerViewImageCell,

+ 6 - 12
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/View/KSMediaPickerNavigationView.swift

@@ -18,7 +18,7 @@ extension KSMediaPickerView {
         public let nextButton = {() -> UIButton in
             let nextButton = UIButton(type: .custom)
             nextButton.titleLabel?.font = .systemFont(ofSize: 14.0)
-            nextButton.setTitle("完成(0/0)", for: .normal)
+            nextButton.setTitle("完成", for: .normal)
             nextButton.setTitleColor(k333333Color, for: .normal)
             nextButton.setTitleColor(k999999Color, for: .disabled)
             return nextButton
@@ -38,19 +38,13 @@ extension KSMediaPickerView {
         }
         
         override open func layoutSubviews() {
-            super.layoutSubviews()
-            let windowSize = bounds.size
-            let windowWidth = windowSize.width
-            
-            var viewX = CGFloat(0.0)
+            super.layoutSubviews()            
             let viewY = UIView.statusBarSize.height
-            let viewH = windowSize.height-viewY
-            var viewW = viewH+30.0
             closeButton.frame = CGRect(x: 5, y: viewY, width: 40, height: 44)
-            
-            viewW = nextButton.sizeThatFits(windowSize).width+30.0
-            viewX = windowWidth-viewW
-            nextButton.frame = CGRect(x: viewX, y: viewY, width: viewW, height: viewH)
+            nextButton.snp.makeConstraints { (make) in
+                make.right.equalTo(-14)
+                make.centerY.equalTo(closeButton)
+            }
         }
     }
 }

+ 15 - 3
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/View/KSMediaPickerView.swift

@@ -15,6 +15,9 @@ open class KSMediaPickerView: UIView {
     
     public let albumNavigationView = KSMediaPickerView.navigationView()
     
+    var jumpType: KSMediaPickerController.jumpType?
+
+    
     public let collectionView = {() -> KSMediaPickerCollectionView in
         let layout = UICollectionViewFlowLayout()
         layout.scrollDirection = .vertical
@@ -127,11 +130,20 @@ open class KSMediaPickerView: UIView {
         viewY = floatZore
         viewW = windowWidth
         viewH = windowHeight-toolBarSafeAreaViewHeight
-        let frame = CGRect(x: viewX, y: viewY, width: viewW, height: viewH)
-        collectionView.frame = frame
+        
+        if jumpType == .publishEdit {
+            let frame = CGRect(x: viewX, y: viewY, width: viewW, height: viewH + kTabBarTotalHeight)
+            collectionView.frame = frame
+        }else {
+
+            let frame = CGRect(x: viewX, y: viewY, width: viewW, height: viewH)
+            collectionView.frame = frame
+        }
+        
         let conetntInset = UIEdgeInsets(top: previewViewFrameMaxY+3.0, left: 0.0, bottom: 0.0, right: 0.0)
         collectionView.contentInset = conetntInset
-        collectionView.scrollIndicatorInsets = conetntInset                
+        collectionView.scrollIndicatorInsets = conetntInset
+        
     }
     
     private var _baseY: CGFloat?

+ 3 - 3
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMusicAbout/PublishMusicChooseView.swift

@@ -128,7 +128,7 @@ class PublishMusicChooseView: BaseView {
         let cancelButton = UIButton(type: UIButton.ButtonType.custom)
         cancelButton.setImage(kImage(name: "video_btn_close_white"), for: .normal)
         cancelButton.rx.tap.subscribe(onNext: { [weak self] in
-            NotificationCenter.default.post(name: NSNotification.Name(rawValue: "EditCloseMusicChooseViewNoti"), object: nil)
+            NotificationCenter.default.post(name: NSNotification.Name(rawValue: "EditCloseMusicChooseViewNoti"), object: "1")
             
             MusicPlayManager.shared().destroyPlayer()
             MusicPlayManager.shared().curPlayingId = -1
@@ -180,7 +180,7 @@ class PublishMusicChooseView: BaseView {
         volumnButton.rx.tap.subscribe(onNext: { [weak self] in
             _ = PublishMusicVolumnView.publishMusicVolumnView(attachedView: self?.attachedView ?? UIView(), oriVolumn: self?.originVolumn ?? 0, backVolumn: self?.backVolumn ?? 0)
             
-            NotificationCenter.default.post(name: NSNotification.Name(rawValue: "EditCloseMusicChooseViewNoti"), object: nil)
+            NotificationCenter.default.post(name: NSNotification.Name(rawValue: "EditCloseMusicChooseViewNoti"), object: "0")
         }).disposed(by: disposeBag)
         return volumnButton
     }()
@@ -314,7 +314,7 @@ extension PublishMusicChooseView :JXSegmentedListContainerViewDataSource {
     
     func chooseMusicAction(_ musicUrl: String) {
         NotificationCenter.default.post(name: NSNotification.Name(rawValue: "DownloadMusicAndCombineNoti"), object: musicUrl)
-        NotificationCenter.default.post(name: NSNotification.Name(rawValue: "EditCloseMusicChooseViewNoti"), object: nil)
+        NotificationCenter.default.post(name: NSNotification.Name(rawValue: "EditCloseMusicChooseViewNoti"), object: "1")
         
         MusicPlayManager.shared().destroyPlayer()
         MusicPlayManager.shared().curPlayingId = -1

+ 1 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMusicAbout/PublishMusicVolumnView.swift

@@ -241,6 +241,7 @@ class PublishMusicVolumnView: FWPopupView {
         view.show()
         
         view.cancelButton.rx.tap.subscribe(onNext: { (data) in
+            NotificationCenter.default.post(name: NSNotification.Name(rawValue: "EditCloseChooseVolumnNoti"), object: nil)
             view.hide()
             
         }).disposed(by: view.disposeBag)

+ 4 - 5
RainbowPlanet/RainbowPlanet/Modules/SearchModule/SearchUser/View/SearchUserLitTableViewCell.swift

@@ -119,7 +119,6 @@ class SearchUserLitTableViewCell: UITableViewCell {
         followButton.layer.cornerRadius = 14
         followButton.layer.masksToBounds = true
         followButton.rx.tap.subscribe(onNext: {[weak self] (data) in
-            followButton.isEnabled = false
             if let followButtonClosure = self?.followButtonClosure {
                 followButtonClosure()
             }
@@ -136,7 +135,7 @@ class SearchUserLitTableViewCell: UITableViewCell {
     var userFollowModel: UserFollowModel? {
         didSet {
             
-            CommunityFollowUserViewModel.setFollowFeedType(followButton: followButton, followType: FollowType(rawValue: userFollowModel?.isFollowStatus ?? 0))
+            CommunityFollowUserViewModel.setFollowType(followButton: followButton, followType: FollowType(rawValue: userFollowModel?.isFollowStatus ?? 0))
 
             avatarButton.kf.setImage(with: kURLImage(name: userFollowModel?.followAvatar ?? ""), for: UIControl.State.normal, placeholder: kImage(name: "default_avatar"))
             titleButton.setTitle(userFollowModel?.followUsername, for: UIControl.State.normal)
@@ -158,7 +157,7 @@ class SearchUserLitTableViewCell: UITableViewCell {
     
     var userFanModel: UserFanModel? {
         didSet {
-            CommunityFollowUserViewModel.setFollowFeedType(followButton: followButton, followType: FollowType(rawValue: userFanModel?.isFollowStatus ?? 0))
+            CommunityFollowUserViewModel.setFollowType(followButton: followButton, followType: FollowType(rawValue: userFanModel?.isFollowStatus ?? 0))
 
             avatarButton.kf.setImage(with: kURLImage(name: userFanModel?.fanAvatar ?? ""), for: UIControl.State.normal, placeholder: kImage(name: "default_avatar"))
             titleButton.setTitle(userFanModel?.fanUsername, for: UIControl.State.normal)
@@ -180,7 +179,7 @@ class SearchUserLitTableViewCell: UITableViewCell {
     
     var cmsMemberModel: CMSMemberModel? {
         didSet {
-            CommunityFollowUserViewModel.setFollowFeedType(followButton: followButton, followType: FollowType(rawValue: cmsMemberModel?.followStatus ?? 0))
+            CommunityFollowUserViewModel.setFollowType(followButton: followButton, followType: FollowType(rawValue: cmsMemberModel?.followStatus ?? 0))
 
             avatarButton.kf.setImage(with: kURLImage(name: cmsMemberModel?.avatar ?? ""), for: UIControl.State.normal, placeholder: kImage(name: "default_avatar"))
             titleButton.setTitle(cmsMemberModel?.username, for: UIControl.State.normal)
@@ -203,7 +202,7 @@ class SearchUserLitTableViewCell: UITableViewCell {
     
     var searchMemberModel: SearchMemberModel? {
         didSet {
-            CommunityFollowUserViewModel.setFollowFeedType(followButton: followButton, followType: FollowType(rawValue: searchMemberModel?.followStatus ?? 0))
+            CommunityFollowUserViewModel.setFollowType(followButton: followButton, followType: FollowType(rawValue: searchMemberModel?.followStatus ?? 0))
 
             avatarButton.kf.setImage(with: kURLImage(name: searchMemberModel?.avatar ?? ""), for: UIControl.State.normal, placeholder: kImage(name: "default_avatar"))
             titleButton.setTitle(searchMemberModel?.username, for: UIControl.State.normal)

+ 3 - 2
RainbowPlanet/RainbowPlanet/Router/CommunityRouterModuleType.swift

@@ -17,7 +17,7 @@ import SwiftyMediator
 /// - pushFindFriends: 找朋友
 public enum CommunityRouterModuleType: MediatorTargetType {
     case pushPostDetailContent(postId: String)
-    case pushPostDetailVoide(postId: String, departType: DepartureVCType)
+    case pushPostDetailVoide(postId: String, departType: DepartureVCType,topicId:Int)
     case pushFeaturedTopics(id : Int)
     case pushFindFriends
 }
@@ -29,10 +29,11 @@ extension CommunityRouterModuleType: MediatorSourceType {
             let vc = CommunityRecommendController()
             vc.id = Int(postId) ?? 0
             return vc
-        case .pushPostDetailVoide(let postId, let departType):
+        case .pushPostDetailVoide(let postId, let departType, let topicId):
             let vc = CommunityVideoListController()
             vc.contentId = Int(postId) ?? 0
             vc.departureVc = departType
+            vc.topicId = topicId
             return vc
         case .pushFeaturedTopics(let id):
             let vc = CommunityFeaturedTopicsViewController()

+ 4 - 0
RainbowPlanet/RainbowPlanet/Router/RegisterLoginRouterModuleType.swift

@@ -16,6 +16,7 @@ import SwiftyMediator
 public enum RegisterLoginRouterModuleType: MediatorTargetType {
     case pushBindPhoneNumber(bindPhoneNumberVCType:BindPhoneNumberVCType,userModel:UserModel)
     case presentRegisterLogin
+    case pushmobileLoginView
 }
 
 extension RegisterLoginRouterModuleType: MediatorSourceType {
@@ -30,6 +31,9 @@ extension RegisterLoginRouterModuleType: MediatorSourceType {
             let vc = RegisterLoginViewController()
             let navc = BaseNavigationViewController(rootViewController: vc)
             return navc
+        case .pushmobileLoginView:
+            let vc = MobileLoginViewController()
+            return vc
         }
     }
 }

+ 2 - 2
RainbowPlanet/RainbowPlanet/Router/RouterManager.swift

@@ -27,7 +27,7 @@ class RouterManager: NSObject {
                     Mediator.push(CommunityRouterModuleType.pushPostDetailContent(postId: openAppModel?.postId ?? "0"))
                     break
                 case .video?:
-                    Mediator.push(CommunityRouterModuleType.pushPostDetailVoide(postId: openAppModel?.postId ?? "0", departType: .others))
+                    Mediator.push(CommunityRouterModuleType.pushPostDetailVoide(postId: openAppModel?.postId ?? "0", departType: .others, topicId: 0))
                     break
                 default:
                     break
@@ -50,7 +50,7 @@ class RouterManager: NSObject {
                 Mediator.push(CommunityRouterModuleType.pushPostDetailContent(postId: "\(pushModel.actionId ?? 0)"))
                 break
             case .video?: //视频帖子
-                Mediator.push(CommunityRouterModuleType.pushPostDetailVoide(postId: "\(pushModel.actionId ?? 0)", departType: .others))
+                Mediator.push(CommunityRouterModuleType.pushPostDetailVoide(postId: "\(pushModel.actionId ?? 0)", departType: .others, topicId: 0))
                 break
             default:
                 break

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/DefaultPage/default_pic.imageset/default_pic@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/DefaultPage/default_pic.imageset/default_pic@3x.png


+ 0 - 22
RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/center_attention_white.imageset/Contents.json

@@ -1,22 +0,0 @@
-{
-  "images" : [
-    {
-      "idiom" : "universal",
-      "scale" : "1x"
-    },
-    {
-      "idiom" : "universal",
-      "filename" : "center_attention_white@2x.png",
-      "scale" : "2x"
-    },
-    {
-      "idiom" : "universal",
-      "filename" : "center_attention_white@3x.png",
-      "scale" : "3x"
-    }
-  ],
-  "info" : {
-    "version" : 1,
-    "author" : "xcode"
-  }
-}

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/center_attention_white.imageset/center_attention_white@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/center_attention_white.imageset/center_attention_white@3x.png


+ 0 - 22
RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/center_followed_white.imageset/Contents.json

@@ -1,22 +0,0 @@
-{
-  "images" : [
-    {
-      "idiom" : "universal",
-      "scale" : "1x"
-    },
-    {
-      "idiom" : "universal",
-      "filename" : "center_followed_white@2x.png",
-      "scale" : "2x"
-    },
-    {
-      "idiom" : "universal",
-      "filename" : "center_followed_white@3x.png",
-      "scale" : "3x"
-    }
-  ],
-  "info" : {
-    "version" : 1,
-    "author" : "xcode"
-  }
-}

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/center_followed_white.imageset/center_followed_white@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/center_followed_white.imageset/center_followed_white@3x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/followed.imageset/followed@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/followed.imageset/followed@3x.png


+ 0 - 22
RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/star_attention.imageset/Contents.json

@@ -1,22 +0,0 @@
-{
-  "images" : [
-    {
-      "idiom" : "universal",
-      "scale" : "1x"
-    },
-    {
-      "idiom" : "universal",
-      "filename" : "star_attention@2x.png",
-      "scale" : "2x"
-    },
-    {
-      "idiom" : "universal",
-      "filename" : "star_attention@3x.png",
-      "scale" : "3x"
-    }
-  ],
-  "info" : {
-    "version" : 1,
-    "author" : "xcode"
-  }
-}

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/star_attention.imageset/star_attention@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/star_attention.imageset/star_attention@3x.png


+ 0 - 22
RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/star_followed.imageset/Contents.json

@@ -1,22 +0,0 @@
-{
-  "images" : [
-    {
-      "idiom" : "universal",
-      "scale" : "1x"
-    },
-    {
-      "idiom" : "universal",
-      "filename" : "star_followed@2x.png",
-      "scale" : "2x"
-    },
-    {
-      "idiom" : "universal",
-      "filename" : "star_followed@3x.png",
-      "scale" : "3x"
-    }
-  ],
-  "info" : {
-    "version" : 1,
-    "author" : "xcode"
-  }
-}

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/star_followed.imageset/star_followed@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/star_followed.imageset/star_followed@3x.png


+ 0 - 22
RainbowPlanet/RainbowPlanet/Supporting Files/MineModule.xcassets/center_peas.imageset/Contents.json

@@ -1,22 +0,0 @@
-{
-  "images" : [
-    {
-      "idiom" : "universal",
-      "scale" : "1x"
-    },
-    {
-      "idiom" : "universal",
-      "filename" : "center_peas@2x.png",
-      "scale" : "2x"
-    },
-    {
-      "idiom" : "universal",
-      "filename" : "center_peas@3x.png",
-      "scale" : "3x"
-    }
-  ],
-  "info" : {
-    "version" : 1,
-    "author" : "xcode"
-  }
-}

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/MineModule.xcassets/center_peas.imageset/center_peas@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/MineModule.xcassets/center_peas.imageset/center_peas@3x.png


+ 2 - 2
RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/followed.imageset/Contents.json

@@ -6,12 +6,12 @@
     },
     {
       "idiom" : "universal",
-      "filename" : "followed@2x.png",
+      "filename" : "center_umi@2x.png",
       "scale" : "2x"
     },
     {
       "idiom" : "universal",
-      "filename" : "followed@3x.png",
+      "filename" : "center_umi@3x.png",
       "scale" : "3x"
     }
   ],

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/MineModule.xcassets/center_umi.imageset/center_umi@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/MineModule.xcassets/center_umi.imageset/center_umi@3x.png


+ 91 - 12
RainbowPlanet/RainbowPlanet/ViewModel/Community/CommunityFollowTopicViewModel.swift

@@ -10,6 +10,10 @@ import UIKit
 
 class CommunityFollowTopicViewModel: NSObject {
     static let shared : CommunityFollowTopicViewModel = CommunityFollowTopicViewModel()
+    enum CommunityFollowTopicType {
+        case view
+        case listView
+    }
 }
 
 extension CommunityFollowTopicViewModel {
@@ -18,34 +22,109 @@ extension CommunityFollowTopicViewModel {
     /// - Parameters:
     ///   - topicId: 话题Id
     ///   - completion: 回调
-    func communityMemberFollowTopicFollowApi(topicId:Int,communityTopicDetailModel:CommunityTopicDetailModel,communityFeaturedTopicsHeaderView:CommunityFeaturedTopicsHeaderView,button:UIButton) {
-        SwiftMoyaNetWorkServiceCommunity.shared().communityMemberFollowTopicFollowApi(topicId: topicId) {(data) -> (Void) in
+    func communityMemberFollowTopicFollowApi(topicId:Int,communityTopicDetailModel:CommunityTopicDetailModel,communityFeaturedTopicsHeaderView:CommunityFeaturedTopicsHeaderView,button:UIButton,communityFollowTopicType:CommunityFollowTopicType) {
+        SwiftMoyaNetWorkServiceCommunity.shared().communityMemberFollowTopicFollowApi(topicId: topicId) {
+            [weak self] (data) -> (Void) in
             communityTopicDetailModel.isFollow = 1
             communityFeaturedTopicsHeaderView.communityTopicDetailModel = communityTopicDetailModel
-            if communityTopicDetailModel.isFollow == 1 {
-                button.isSelected = true
-                button.layer.borderColor = kf7f8faColor.cgColor
+            if communityFollowTopicType == .view  {
+                self?.followTopicButton(communityTopicDetailModel: communityTopicDetailModel, button: button)
             }else {
-                button.isSelected = false
-                button.layer.borderColor = kThemeColor.cgColor
+                self?.followTopicListButton(communityTopicDetailModel: communityTopicDetailModel, button: button)
             }
         }
     }
     
+
+    
     /// 取消关注话题
     ///
     /// - Parameters:
     ///   - topicId: 话题Id
     ///   - completion: 回调
-    func communityMemberFollowTopicCancelFollowApi(topicId:Int,communityTopicDetailModel:CommunityTopicDetailModel,communityFeaturedTopicsHeaderView:CommunityFeaturedTopicsHeaderView,button:UIButton) {
-        SwiftMoyaNetWorkServiceCommunity.shared().communityMemberFollowTopicCancelFollowApi(topicId:topicId) { (data) -> (Void) in
+    func communityMemberFollowTopicCancelFollowApi(topicId:Int,communityTopicDetailModel:CommunityTopicDetailModel,communityFeaturedTopicsHeaderView:CommunityFeaturedTopicsHeaderView,button:UIButton,communityFollowTopicType:CommunityFollowTopicType) {
+        SwiftMoyaNetWorkServiceCommunity.shared().communityMemberFollowTopicCancelFollowApi(topicId:topicId) {
+            [weak self] (data) -> (Void) in
             communityTopicDetailModel.isFollow = 0
             communityFeaturedTopicsHeaderView.communityTopicDetailModel = communityTopicDetailModel
-            if communityTopicDetailModel.isFollow == 1 {
-                button.isSelected = true
+
+            if communityFollowTopicType == .view  {
+                self?.followTopicButton(communityTopicDetailModel: communityTopicDetailModel, button: button)
             }else {
-                button.isSelected = false
+                self?.followTopicListButton(communityTopicDetailModel: communityTopicDetailModel, button: button)
             }
         }
     }
+    
+    
+    func followTopicButton(communityTopicDetailModel:CommunityTopicDetailModel?,button:UIButton) {
+        if communityTopicDetailModel?.isFollow == 1 {
+            button.isSelected = true
+            button.layer.borderColor = kffffffColor.cgColor
+        }else {
+            button.isSelected = false
+            button.layer.borderColor = kThemeColor.cgColor
+        }
+    }
+    func followTopicListButton(communityTopicDetailModel:CommunityTopicDetailModel?,button:UIButton) {
+        if communityTopicDetailModel?.isFollow == 1 {
+            button.isSelected = true
+            button.layer.borderColor = kf7f8faColor.cgColor
+        }else {
+            button.isSelected = false
+            button.layer.borderColor = kThemeColor.cgColor
+        }
+    }
+    
+    /// 关注话题(单个)
+    ///
+    /// - Parameters:
+    ///   - topicId: 话题Id
+    ///   - completion: 回调
+    func communityMemberFollowTopicFollowApi(topicId:Int,communityMemberFollowTopicListDataModel:CommunityMemberFollowTopicListDataModel?,button:UIButton,communityFollowTopicType:CommunityFollowTopicType) {
+        SwiftMoyaNetWorkServiceCommunity.shared().communityMemberFollowTopicFollowApi(topicId: topicId) {
+            [weak self] (data) -> (Void) in
+            communityMemberFollowTopicListDataModel?.isFollow = 1
+            if communityFollowTopicType == .view  {
+                self?.followTopicButton(communityMemberFollowTopicListDataModel: communityMemberFollowTopicListDataModel, button: button)
+            }else {
+                self?.followTopicListButton(communityMemberFollowTopicListDataModel: communityMemberFollowTopicListDataModel, button: button)
+            }
+        }
+    }
+    
+    /// 取消关注话题
+    ///
+    /// - Parameters:
+    ///   - topicId: 话题Id
+    ///   - completion: 回调
+    func communityMemberFollowTopicCancelFollowApi(topicId:Int,communityMemberFollowTopicListDataModel:CommunityMemberFollowTopicListDataModel?,button:UIButton,communityFollowTopicType:CommunityFollowTopicType) {
+        SwiftMoyaNetWorkServiceCommunity.shared().communityMemberFollowTopicCancelFollowApi(topicId:topicId) {
+            [weak self] (data) -> (Void) in
+            communityMemberFollowTopicListDataModel?.isFollow = 0
+            if communityFollowTopicType == .view  {
+                self?.followTopicButton(communityMemberFollowTopicListDataModel: communityMemberFollowTopicListDataModel, button: button)
+            }else {
+                self?.followTopicListButton(communityMemberFollowTopicListDataModel: communityMemberFollowTopicListDataModel, button: button)
+            }
+        }
+           
+    }
+    
+    func followTopicButton(communityMemberFollowTopicListDataModel:CommunityMemberFollowTopicListDataModel?,button:UIButton) {
+        if communityMemberFollowTopicListDataModel?.isFollow == 1 {
+            button.isSelected = true
+            button.layer.borderColor = kffffffColor.cgColor
+        }else {
+            button.isSelected = false
+            button.layer.borderColor = kThemeColor.cgColor
+        }
+    }
+    func followTopicListButton(communityMemberFollowTopicListDataModel:CommunityMemberFollowTopicListDataModel?,button:UIButton) {
+        if communityMemberFollowTopicListDataModel?.isFollow == 1 {
+            button.isSelected = true
+        }else {
+            button.isSelected = false
+        }
+    }
 }

+ 6 - 12
RainbowPlanet/RainbowPlanet/ViewModel/Community/CommunityFollowUserViewModel.swift

@@ -72,8 +72,7 @@ class CommunityFollowUserViewModel: NSObject {
     /// - Parameters:
     ///   - followButton: 关注button
     ///   - followType: 关注类型
-    func setFollowType(followButton:UIButton? = nil,followType: FollowType? = nil) {
-        followButton?.isEnabled = true
+    class func setFollowType(followButton:UIButton? = nil,followType: FollowType? = nil) {
         switch followType {
         case .futureFollow?:
             followButton?.setTitle("关注", for: UIControl.State.normal)
@@ -106,35 +105,30 @@ class CommunityFollowUserViewModel: NSObject {
     ///   - followButton: 关注button
     ///   - followType: 关注类型
     func setVideoFollowType(followButton:UIButton,followType: FollowType) {
+        followButton.isEnabled = true
         switch followType {
         case .futureFollow:
             followButton.setTitle("关注", for: UIControl.State.normal)
             followButton.setTitleColor(kffffffColor, for: UIControl.State.normal)
-            followButton.setImage(kImage(name: "center_attention_white"), for: UIControl.State.normal)
             followButton.layer.borderColor = kThemeColor.cgColor
             followButton.layer.borderWidth = 0.5
             followButton.setBackgroundImage(UIImage.imageWithColor(color: kThemeColor), for: UIControl.State.normal)
-            followButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.left, imageTitleSpace: 2)
             
             break
         case .alreadyFollow:
-            followButton.setTitle("关注", for: UIControl.State.normal)
+            followButton.setTitle("关注", for: UIControl.State.normal)
             followButton.setTitleColor(kffffffColor, for: UIControl.State.normal)
-            followButton.setImage(kImage(name: "center_followed_white"), for: UIControl.State.normal)
             followButton.layer.borderColor = kffffffColor.cgColor
             followButton.layer.borderWidth = 0.5
             followButton.setBackgroundImage(UIImage.imageWithColor(color: UIColor.clear), for: UIControl.State.normal)
-            followButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.left, imageTitleSpace: 2)
             break
         case .mutualFollow:
-            followButton.setTitle("互", for: UIControl.State.normal)
+            followButton.setTitle("互关", for: UIControl.State.normal)
             followButton.setTitleColor(kffffffColor, for: UIControl.State.normal)
             followButton.setImage(nil, for: UIControl.State.normal)
             followButton.layer.borderColor = kffffffColor.cgColor
             followButton.layer.borderWidth = 0.5
-
             followButton.setBackgroundImage(UIImage.imageWithColor(color: UIColor.clear), for: UIControl.State.normal)
-            followButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.left, imageTitleSpace: 0)
             
             break
         }
@@ -151,13 +145,13 @@ extension CommunityFollowUserViewModel {
         if communityPostDetailModel.isFollow == 0 {//加关注
             self.userFollow(followUid:  communityPostDetailModel.uid ?? 0, completion: { (isFollow) -> Void in
                 communityPostDetailModel.isFollow = isFollow
-                CommunityFollowUserViewModel.shared.setFollowType(followButton: button, followType: FollowType(rawValue: communityPostDetailModel.isFollow ?? 0) ?? .futureFollow)
+                CommunityFollowUserViewModel.setFollowType(followButton: button, followType: FollowType(rawValue: communityPostDetailModel.isFollow ?? 0) ?? .futureFollow)
 
             })
         }else {//取消关注
             self.userCancelFollow(followUid:  communityPostDetailModel.uid ?? 0, completion: { (isFollow) -> Void in
                 communityPostDetailModel.isFollow = isFollow
-                CommunityFollowUserViewModel.shared.setFollowType(followButton: button, followType: FollowType(rawValue: communityPostDetailModel.isFollow ?? 0) ?? .futureFollow)
+                CommunityFollowUserViewModel.setFollowType(followButton: button, followType: FollowType(rawValue: communityPostDetailModel.isFollow ?? 0) ?? .futureFollow)
 
             })
         }