南鑫林 5 gadi atpakaļ
vecāks
revīzija
45d25cd4ef
20 mainītis faili ar 1043 papildinājumiem un 199 dzēšanām
  1. 1 6
      RainbowPlanet/Podfile
  2. 84 8
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  3. 6 4
      RainbowPlanet/RainbowPlanet/Base/BaseTabbarViewController/BaseTabbarViewController.swift
  4. 20 2
      RainbowPlanet/RainbowPlanet/Manager/RongCloudIMManager/RongCloudIMManager.swift
  5. 39 0
      RainbowPlanet/RainbowPlanet/Model/RongCloudIMModel/ConversationModel.swift
  6. 14 14
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Main/CommunityViewController.swift
  7. 193 0
      RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageMain/View/MessageHomeOneSectionTableViewCell.swift
  8. 43 0
      RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageMain/View/MessageHomeThreeSectionTableViewCell.swift
  9. 21 19
      RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageMain/View/MessageHomeTwoCollectionViewCell.swift
  10. 95 142
      RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageMain/ViewController/MessageMainViewController.swift
  11. 33 0
      RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/PersonalCenterView/PersonViewUserAndOtherHeaderView.swift
  12. 155 0
      RainbowPlanet/RainbowPlanet/Modules/RongCloudIMModule/IMChatPrivate/ViewController/IMChatPrivateViewController.swift
  13. 115 0
      RainbowPlanet/RainbowPlanet/Modules/RongCloudIMModule/IMChatPrivateSet/View/IMChatPrivateSetOneTableViewCell.swift
  14. 61 0
      RainbowPlanet/RainbowPlanet/Modules/RongCloudIMModule/IMChatPrivateSet/View/IMChatPrivateSetTwoTableViewCell.swift
  15. 114 0
      RainbowPlanet/RainbowPlanet/Modules/RongCloudIMModule/IMChatPrivateSet/ViewController/IMChatPrivateSetViewController.swift
  16. 8 0
      RainbowPlanet/RainbowPlanet/Modules/RongCloudIMModule/IMChatRoom/ViewController/IMChatRoomViewController.swift
  17. 6 0
      RainbowPlanet/RainbowPlanet/Router/RongCloudIMRouterModuleType.swift
  18. 19 4
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceManger/SwiftMoyaNetWorkManager/ApiMacro.swift
  19. 9 0
      RainbowPlanet/RainbowPlanet/Tools/Extension/Extension+Date.swift
  20. 7 0
      RainbowPlanet/RainbowPlanet/Tools/Extension/Extension+String.swift

+ 1 - 6
RainbowPlanet/Podfile

@@ -106,23 +106,18 @@ target 'RainbowPlanet' do
   #=====================AliyunVideoSDK===========
   #共同依赖的库
   pod 'QuCore-ThirdParty'
-#  pod 'AlivcConan', '0.9.5'
   pod 'AlivcConan'
   #短视频SDK
-#  pod 'AliyunVideoSDKPro', '3.11.0'  #短视频核心库
   pod 'AliyunVideoSDKPro'
   pod 'VODUpload'  #短视频上传,不使用上传功能可以不依赖此库
   #播放器SDK
-#  pod 'AliPlayerPartSDK_iOS', '4.7.1' #播放器和短视频SDK同时集成时使用这个
    pod 'AliPlayerPartSDK_iOS'
-  #    pod 'AliPlayerSDK_iOS', '4.7.1' #单独集成播放器时使用这个
+  #    pod 'AliPlayerSDK_iOS' #单独集成播放器时使用这个
   
   #=====================融云IMSDK===========
   #融云 IM 通讯能力库
-#  pod 'RongCloudIM/IMLib', '2.9.24'
   pod 'RongCloudIM/IMLib'
   #融云 IM 界面组件
-#  pod 'RongCloudIM/IMKit', '2.9.24'
   pod 'RongCloudIM/IMKit'
   
 end

+ 84 - 8
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -62,7 +62,6 @@
 		A72623D522C2646200AEF875 /* MessageIndexModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72623D422C2646200AEF875 /* MessageIndexModel.swift */; };
 		A72623D722C26A2A00AEF875 /* MessageListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72623D622C26A2A00AEF875 /* MessageListModel.swift */; };
 		A72623D922C2F8B100AEF875 /* MessageHomeOneCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72623D822C2F8B100AEF875 /* MessageHomeOneCollectionViewCell.swift */; };
-		A72623DB22C2FC3C00AEF875 /* MessageHomeTwoCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72623DA22C2FC3C00AEF875 /* MessageHomeTwoCollectionViewCell.swift */; };
 		A72623E522C39C7000AEF875 /* FMLinkLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = A72623E422C39C6F00AEF875 /* FMLinkLabel.m */; };
 		A72623E722C469B700AEF875 /* SearchMemberListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72623E622C469B600AEF875 /* SearchMemberListModel.swift */; };
 		A72623E922C4AFF200AEF875 /* CommunityTopicsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72623E822C4AFF200AEF875 /* CommunityTopicsModel.swift */; };
@@ -230,6 +229,11 @@
 		A7636AC822682BAF00374F9E /* LocationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7636AC722682BAF00374F9E /* LocationView.swift */; };
 		A763BE6C22F173A0000CE594 /* LoginNowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A763BE6B22F173A0000CE594 /* LoginNowView.swift */; };
 		A763BE6E22F1953D000CE594 /* CommunityFollowLoginTableHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A763BE6D22F1953D000CE594 /* CommunityFollowLoginTableHeaderView.swift */; };
+		A763DFF4237C144400B2ADBF /* MessageHomeOneSectionTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A763DFF3237C144400B2ADBF /* MessageHomeOneSectionTableViewCell.swift */; };
+		A763DFF6237C145F00B2ADBF /* MessageHomeTwoSectionTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A763DFF5237C145F00B2ADBF /* MessageHomeTwoSectionTableViewCell.swift */; };
+		A763DFF8237C147700B2ADBF /* MessageHomeThreeSectionTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A763DFF7237C147700B2ADBF /* MessageHomeThreeSectionTableViewCell.swift */; };
+		A763DFFA237CEB0700B2ADBF /* MessageMainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A763DFF9237CEB0700B2ADBF /* MessageMainViewController.swift */; };
+		A763DFFD237CF82C00B2ADBF /* ConversationModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A763DFFC237CF82C00B2ADBF /* ConversationModel.swift */; };
 		A76893962339C28800819EC3 /* StartupPageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A76893952339C28800819EC3 /* StartupPageView.swift */; };
 		A76893982339C9EB00819EC3 /* StartupModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A76893972339C9EB00819EC3 /* StartupModel.swift */; };
 		A76893A2233A0BB000819EC3 /* DrawCircleProgressButton.m in Sources */ = {isa = PBXBuildFile; fileRef = A76893A1233A0BB000819EC3 /* DrawCircleProgressButton.m */; };
@@ -280,6 +284,10 @@
 		A77BB46D2329F01C00DCAE32 /* NXLPermissionReminders.swift in Sources */ = {isa = PBXBuildFile; fileRef = A77BB46C2329F01C00DCAE32 /* NXLPermissionReminders.swift */; };
 		A77BB46F2329F05500DCAE32 /* NXLPermissionSpeech.swift in Sources */ = {isa = PBXBuildFile; fileRef = A77BB46E2329F05500DCAE32 /* NXLPermissionSpeech.swift */; };
 		A77BB4712329F08900DCAE32 /* NXLPermissionCalendar.swift in Sources */ = {isa = PBXBuildFile; fileRef = A77BB4702329F08900DCAE32 /* NXLPermissionCalendar.swift */; };
+		A77D0209237BD297001980BA /* IMChatPrivateViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A77D0208237BD297001980BA /* IMChatPrivateViewController.swift */; };
+		A77D020D237BD6EC001980BA /* IMChatPrivateSetViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A77D020C237BD6EC001980BA /* IMChatPrivateSetViewController.swift */; };
+		A77D0210237BE88A001980BA /* IMChatPrivateSetOneTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A77D020F237BE88A001980BA /* IMChatPrivateSetOneTableViewCell.swift */; };
+		A77D0218237BF36C001980BA /* IMChatPrivateSetTwoTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A77D0217237BF36C001980BA /* IMChatPrivateSetTwoTableViewCell.swift */; };
 		A77F2C612231FB49001BD3F6 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A77F2C602231FB49001BD3F6 /* AppDelegate.swift */; };
 		A77F2C682231FB4A001BD3F6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A77F2C672231FB4A001BD3F6 /* Assets.xcassets */; };
 		A77F2C762231FB4A001BD3F6 /* RainbowPlanetTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A77F2C752231FB4A001BD3F6 /* RainbowPlanetTests.swift */; };
@@ -646,7 +654,6 @@
 		BD37E38322CDF5BA003A14A2 /* CommunityVideoTopicView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD37E38222CDF5BA003A14A2 /* CommunityVideoTopicView.swift */; };
 		BD37E38522CDF91A003A14A2 /* CommunityVideoSelTopicCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD37E38422CDF91A003A14A2 /* CommunityVideoSelTopicCell.swift */; };
 		BD37E38722CE200E003A14A2 /* CommunityAllCommentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD37E38622CE200E003A14A2 /* CommunityAllCommentView.swift */; };
-		BD3AA45822AE63EC00EF4F20 /* MessageMainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD3AA45722AE63EC00EF4F20 /* MessageMainViewController.swift */; };
 		BD477F6322C23D66008BE2CB /* AliyunReachability.m in Sources */ = {isa = PBXBuildFile; fileRef = BD477F6222C23D66008BE2CB /* AliyunReachability.m */; };
 		BD4B50AC22BC7DEA0073B516 /* FilterResource.bundle in Resources */ = {isa = PBXBuildFile; fileRef = BD4B50AB22BC7DEA0073B516 /* FilterResource.bundle */; };
 		BD50F47022E157F50077D4BF /* PublishRecordMusicView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD50F46F22E157F50077D4BF /* PublishRecordMusicView.swift */; };
@@ -816,7 +823,6 @@
 		A72623D422C2646200AEF875 /* MessageIndexModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MessageIndexModel.swift; sourceTree = "<group>"; };
 		A72623D622C26A2A00AEF875 /* MessageListModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MessageListModel.swift; sourceTree = "<group>"; };
 		A72623D822C2F8B100AEF875 /* MessageHomeOneCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageHomeOneCollectionViewCell.swift; sourceTree = "<group>"; };
-		A72623DA22C2FC3C00AEF875 /* MessageHomeTwoCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageHomeTwoCollectionViewCell.swift; sourceTree = "<group>"; };
 		A72623E322C39C6F00AEF875 /* FMLinkLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FMLinkLabel.h; sourceTree = "<group>"; };
 		A72623E422C39C6F00AEF875 /* FMLinkLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FMLinkLabel.m; sourceTree = "<group>"; };
 		A72623E622C469B600AEF875 /* SearchMemberListModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchMemberListModel.swift; sourceTree = "<group>"; };
@@ -991,6 +997,11 @@
 		A76390EA2248E27A0067EEE0 /* UserNotifications.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UserNotifications.framework; path = System/Library/Frameworks/UserNotifications.framework; sourceTree = SDKROOT; };
 		A763BE6B22F173A0000CE594 /* LoginNowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginNowView.swift; sourceTree = "<group>"; };
 		A763BE6D22F1953D000CE594 /* CommunityFollowLoginTableHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityFollowLoginTableHeaderView.swift; sourceTree = "<group>"; };
+		A763DFF3237C144400B2ADBF /* MessageHomeOneSectionTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageHomeOneSectionTableViewCell.swift; sourceTree = "<group>"; };
+		A763DFF5237C145F00B2ADBF /* MessageHomeTwoSectionTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageHomeTwoSectionTableViewCell.swift; sourceTree = "<group>"; };
+		A763DFF7237C147700B2ADBF /* MessageHomeThreeSectionTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageHomeThreeSectionTableViewCell.swift; sourceTree = "<group>"; };
+		A763DFF9237CEB0700B2ADBF /* MessageMainViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageMainViewController.swift; sourceTree = "<group>"; };
+		A763DFFC237CF82C00B2ADBF /* ConversationModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConversationModel.swift; sourceTree = "<group>"; };
 		A76893952339C28800819EC3 /* StartupPageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StartupPageView.swift; sourceTree = "<group>"; };
 		A76893972339C9EB00819EC3 /* StartupModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StartupModel.swift; sourceTree = "<group>"; };
 		A76893A0233A0BB000819EC3 /* DrawCircleProgressButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawCircleProgressButton.h; sourceTree = "<group>"; };
@@ -1042,6 +1053,10 @@
 		A77BB46C2329F01C00DCAE32 /* NXLPermissionReminders.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NXLPermissionReminders.swift; sourceTree = "<group>"; };
 		A77BB46E2329F05500DCAE32 /* NXLPermissionSpeech.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NXLPermissionSpeech.swift; sourceTree = "<group>"; };
 		A77BB4702329F08900DCAE32 /* NXLPermissionCalendar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NXLPermissionCalendar.swift; sourceTree = "<group>"; };
+		A77D0208237BD297001980BA /* IMChatPrivateViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IMChatPrivateViewController.swift; sourceTree = "<group>"; };
+		A77D020C237BD6EC001980BA /* IMChatPrivateSetViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IMChatPrivateSetViewController.swift; sourceTree = "<group>"; };
+		A77D020F237BE88A001980BA /* IMChatPrivateSetOneTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IMChatPrivateSetOneTableViewCell.swift; sourceTree = "<group>"; };
+		A77D0217237BF36C001980BA /* IMChatPrivateSetTwoTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IMChatPrivateSetTwoTableViewCell.swift; sourceTree = "<group>"; };
 		A77F2C5D2231FB49001BD3F6 /* RainbowPlanet.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RainbowPlanet.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		A77F2C602231FB49001BD3F6 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
 		A77F2C672231FB4A001BD3F6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
@@ -1444,7 +1459,6 @@
 		BD37E38222CDF5BA003A14A2 /* CommunityVideoTopicView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityVideoTopicView.swift; sourceTree = "<group>"; };
 		BD37E38422CDF91A003A14A2 /* CommunityVideoSelTopicCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityVideoSelTopicCell.swift; sourceTree = "<group>"; };
 		BD37E38622CE200E003A14A2 /* CommunityAllCommentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityAllCommentView.swift; sourceTree = "<group>"; };
-		BD3AA45722AE63EC00EF4F20 /* MessageMainViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageMainViewController.swift; sourceTree = "<group>"; };
 		BD477F6122C23D65008BE2CB /* AliyunReachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AliyunReachability.h; sourceTree = "<group>"; };
 		BD477F6222C23D66008BE2CB /* AliyunReachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AliyunReachability.m; sourceTree = "<group>"; };
 		BD4B50AB22BC7DEA0073B516 /* FilterResource.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = FilterResource.bundle; sourceTree = "<group>"; };
@@ -2388,6 +2402,7 @@
 		A738D203225AEAD000EEE860 /* Model */ = {
 			isa = PBXGroup;
 			children = (
+				A763DFFB237CF80800B2ADBF /* RongCloudIMModel */,
 				A73A56D122DC598F004920FE /* PushModel */,
 				A770E5DE22CEDF5700CBD0A4 /* OpenAppModel */,
 				A72A73722233966800B21995 /* RootModel */,
@@ -2473,6 +2488,8 @@
 		A74144AD233076D10062FB6F /* RongCloudIMModule */ = {
 			isa = PBXGroup;
 			children = (
+				A77D020A237BD699001980BA /* IMChatPrivateSet */,
+				A77D0206237BD17A001980BA /* IMChatPrivate */,
 				A7F304B323331A4500A4850F /* IMChatRoom */,
 			);
 			path = RongCloudIMModule;
@@ -2855,6 +2872,14 @@
 			path = Video;
 			sourceTree = "<group>";
 		};
+		A763DFFB237CF80800B2ADBF /* RongCloudIMModel */ = {
+			isa = PBXGroup;
+			children = (
+				A763DFFC237CF82C00B2ADBF /* ConversationModel.swift */,
+			);
+			path = RongCloudIMModel;
+			sourceTree = "<group>";
+		};
 		A76893942339C26900819EC3 /* StartupPageView */ = {
 			isa = PBXGroup;
 			children = (
@@ -3123,6 +3148,48 @@
 			path = NXLPermissions;
 			sourceTree = "<group>";
 		};
+		A77D0206237BD17A001980BA /* IMChatPrivate */ = {
+			isa = PBXGroup;
+			children = (
+				A77D0207237BD18A001980BA /* ViewController */,
+			);
+			path = IMChatPrivate;
+			sourceTree = "<group>";
+		};
+		A77D0207237BD18A001980BA /* ViewController */ = {
+			isa = PBXGroup;
+			children = (
+				A77D0208237BD297001980BA /* IMChatPrivateViewController.swift */,
+			);
+			path = ViewController;
+			sourceTree = "<group>";
+		};
+		A77D020A237BD699001980BA /* IMChatPrivateSet */ = {
+			isa = PBXGroup;
+			children = (
+				A77D020E237BE842001980BA /* View */,
+				A77D020B237BD6B5001980BA /* ViewController */,
+			);
+			path = IMChatPrivateSet;
+			sourceTree = "<group>";
+		};
+		A77D020B237BD6B5001980BA /* ViewController */ = {
+			isa = PBXGroup;
+			children = (
+				A77D020C237BD6EC001980BA /* IMChatPrivateSetViewController.swift */,
+			);
+			path = ViewController;
+			sourceTree = "<group>";
+		};
+		A77D020E237BE842001980BA /* View */ = {
+			isa = PBXGroup;
+			children = (
+				A77D020F237BE88A001980BA /* IMChatPrivateSetOneTableViewCell.swift */,
+				A77D0217237BF36C001980BA /* IMChatPrivateSetTwoTableViewCell.swift */,
+			);
+			path = View;
+			sourceTree = "<group>";
+		};
 		A77F2C542231FB49001BD3F6 = {
 			isa = PBXGroup;
 			children = (
@@ -5642,7 +5709,7 @@
 		BD3AA45622AE63B800EF4F20 /* ViewController */ = {
 			isa = PBXGroup;
 			children = (
-				BD3AA45722AE63EC00EF4F20 /* MessageMainViewController.swift */,
+				A763DFF9237CEB0700B2ADBF /* MessageMainViewController.swift */,
 			);
 			path = ViewController;
 			sourceTree = "<group>";
@@ -5650,8 +5717,10 @@
 		BD3AA45922AE63FB00EF4F20 /* View */ = {
 			isa = PBXGroup;
 			children = (
+				A763DFF3237C144400B2ADBF /* MessageHomeOneSectionTableViewCell.swift */,
 				A72623D822C2F8B100AEF875 /* MessageHomeOneCollectionViewCell.swift */,
-				A72623DA22C2FC3C00AEF875 /* MessageHomeTwoCollectionViewCell.swift */,
+				A763DFF5237C145F00B2ADBF /* MessageHomeTwoSectionTableViewCell.swift */,
+				A763DFF7237C147700B2ADBF /* MessageHomeThreeSectionTableViewCell.swift */,
 			);
 			path = View;
 			sourceTree = "<group>";
@@ -6370,6 +6439,7 @@
 				BD6122F822C36A8100D3F513 /* AVAsset+VideoInfo.m in Sources */,
 				BD61226022C3561C00D3F513 /* AliyunRateSelectView.m in Sources */,
 				A7C0FDF022B6538200BC1E86 /* CommunityBannerFSPagerViewCell.swift in Sources */,
+				A763DFF4237C144400B2ADBF /* MessageHomeOneSectionTableViewCell.swift in Sources */,
 				A7EE5BD4236C16E100309931 /* SwiftMoyaServiceDownLoadApi.swift in Sources */,
 				BDE376DB22C22A260055E2EA /* UIView+AlivcHelper.m in Sources */,
 				A7DE18D723795A3200D9D72E /* PublishManagerUploadView.swift in Sources */,
@@ -6440,6 +6510,7 @@
 				A7D07CCD22B77D2E00186014 /* UserPersonalCenterOrderView.swift in Sources */,
 				A70B2C252286C03800B2449F /* NXLPageControl.swift in Sources */,
 				BDF7C5DB22D72405007F3B79 /* CommunityVideoSubCommentController.swift in Sources */,
+				A77D0218237BF36C001980BA /* IMChatPrivateSetTwoTableViewCell.swift in Sources */,
 				A7F2D6C122B0D1CB0093000B /* CommunityFollowTableHeaderView.swift in Sources */,
 				A7C0FE0022B66E5A00BC1E86 /* CommunityFeaturedTopicsViewController.swift in Sources */,
 				A747D825235C8FA8007F4E33 /* TLPhotopickerDataSourcesProtocol.swift in Sources */,
@@ -6473,6 +6544,7 @@
 				A75B782822DEC708007B986A /* SepcialTwoTypeLayout.swift in Sources */,
 				A71AA519227219D7008FF1A5 /* EditExpressAddressViewController.swift in Sources */,
 				A7464B722338AC4E003CE3A0 /* BackyardModuleRouterType.swift in Sources */,
+				A77D0210237BE88A001980BA /* IMChatPrivateSetOneTableViewCell.swift in Sources */,
 				A790705B22B9B680008CE279 /* ModifyDataViewController.swift in Sources */,
 				BD27F0B022CC929800A6514D /* CommunityVideoCoverCollectionCell.swift in Sources */,
 				A71738A822897E96000AEA6A /* SwiftMoyaNetWorkServiceShop.swift in Sources */,
@@ -6535,6 +6607,7 @@
 				A77F2CC3223203BA001BD3F6 /* AppDelegate+Window.swift in Sources */,
 				A7824B062271F25400ABA381 /* EditAddressTableViewCell.swift in Sources */,
 				BD12B69E22B4FAF000AEB10B /* KSMediaPickerNavigationView.swift in Sources */,
+				A763DFF8237C147700B2ADBF /* MessageHomeThreeSectionTableViewCell.swift in Sources */,
 				A715333E22980CC60017C861 /* ConfigModel.swift in Sources */,
 				BD6122FA22C36A8100D3F513 /* QUProgressView.m in Sources */,
 				BD10FC0222C6F9770096A34E /* AlivcShortVideoUploadManager.m in Sources */,
@@ -6627,6 +6700,7 @@
 				A7AA9F5A22C5FB1E0086498B /* SwiftMoyaNetWorkServiceVirus.swift in Sources */,
 				A7A98E2D22801642005306E9 /* SwiftMoyaServiceCMSApi.swift in Sources */,
 				A74144AC23306EA90062FB6F /* RongCloudIMManager.swift in Sources */,
+				A77D020D237BD6EC001980BA /* IMChatPrivateSetViewController.swift in Sources */,
 				A770E60022D6203F00CBD0A4 /* CommunityShareActivityViewController.swift in Sources */,
 				A7EE5AF1236C131D00309931 /* PublishNewEffectBeautyCollectionViewCell.swift in Sources */,
 				BD1DC6C6228CFD0B00B89C57 /* SwiftMoyaServiceOrderApi.swift in Sources */,
@@ -6724,7 +6798,6 @@
 				A72A72BD22321DE000B21995 /* Extension+UIColor.swift in Sources */,
 				A7DF50E322A55AB600998908 /* BrowsePicturesPagerViewCell.swift in Sources */,
 				A77F2CC822320627001BD3F6 /* WRCustomNavigationBar.swift in Sources */,
-				A72623DB22C2FC3C00AEF875 /* MessageHomeTwoCollectionViewCell.swift in Sources */,
 				A7464B7023389688003CE3A0 /* BackyardViewController.swift in Sources */,
 				A70B2C072284305400B2449F /* ProductModel.swift in Sources */,
 				A72A72BC22321DE000B21995 /* Extension+UIAlertController.swift in Sources */,
@@ -6785,8 +6858,8 @@
 				A7EE5AEE236C131D00309931 /* PublishNewMusicListViewTableViewCell.swift in Sources */,
 				A7F688E723556EA1000C313F /* CircleEssenceView.swift in Sources */,
 				BD108C9622A60C2100837DAB /* HGImagePickerCell.swift in Sources */,
+				A763DFFA237CEB0700B2ADBF /* MessageMainViewController.swift in Sources */,
 				A7C0FDEB22B4C6C300BC1E86 /* CardContentCommentListFooterView.swift in Sources */,
-				BD3AA45822AE63EC00EF4F20 /* MessageMainViewController.swift in Sources */,
 				A7DE18D423794DD000D9D72E /* PublishNewEditLocationTableViewCell.swift in Sources */,
 				A7C2567122CC895F00420828 /* CommunityPostDetailTableViewHeaderView.swift in Sources */,
 				A71AF0AA226EDDF5001730FE /* SearchView.swift in Sources */,
@@ -6797,6 +6870,7 @@
 				A7D07CC722B774D600186014 /* RainbowBeanPhysicalView.swift in Sources */,
 				A71CAB4122CB32C700D908A8 /* VirusViewModel.swift in Sources */,
 				A7DE18CD2379100A00D9D72E /* PublishEditVideoCoverImageTableViewCell.swift in Sources */,
+				A77D0209237BD297001980BA /* IMChatPrivateViewController.swift in Sources */,
 				BD61226122C3561C00D3F513 /* MagicCameraPressCircleView.m in Sources */,
 				A7EE5B0A236C13B900309931 /* AliPlayerManager.swift in Sources */,
 				A7AA9F5822C5F6150086498B /* SwiftMoyaServiceVirusApi.swift in Sources */,
@@ -6846,6 +6920,7 @@
 				A729B5A82266F2E0004AE098 /* AlertSheetView.swift in Sources */,
 				A7D07CC322B745C800186014 /* PersonViewUserAndOtherHeaderView.swift in Sources */,
 				A7CC75382271ADD6003C4F38 /* AddressManagerSelfMentionExpressHeaderView.swift in Sources */,
+				A763DFF6237C145F00B2ADBF /* MessageHomeTwoSectionTableViewCell.swift in Sources */,
 				A7AD2795231365470099B3E0 /* QRCode.swift in Sources */,
 				A714348C22DDA3E400132DA9 /* CMSRedemptionAreaModel.swift in Sources */,
 				A738D66F225D9BD900EEE860 /* UMLoginModel.swift in Sources */,
@@ -6924,6 +6999,7 @@
 				BD6EDF48229007EA009A20FE /* OrderApplyRefundModel.swift in Sources */,
 				A770E5EB22D424A300CBD0A4 /* CommunityPostCommentIdModel.swift in Sources */,
 				A72A7388223396CB00B21995 /* ApiMacro.swift in Sources */,
+				A763DFFD237CF82C00B2ADBF /* ConversationModel.swift in Sources */,
 				BD50F47022E157F50077D4BF /* PublishRecordMusicView.swift in Sources */,
 				A72A72B922321DE000B21995 /* Extension+Array.swift in Sources */,
 				A74DF74D22EAEF60007FB505 /* MJRefreshManager.swift in Sources */,

+ 6 - 4
RainbowPlanet/RainbowPlanet/Base/BaseTabbarViewController/BaseTabbarViewController.swift

@@ -11,6 +11,7 @@ import Lottie
 import ESTabBarController_swift
 import PPBadgeViewSwift
 import SwiftyMediator
+import RongIMLib
 
 class BaseTabbarViewController: NSObject {
 
@@ -28,6 +29,7 @@ class BaseTabbarViewController: NSObject {
     var v3 : BaseViewController!
     /// 消息
     var v4 : MessageMainViewController!
+    
     /// 我的
     var v5 : UserPersonalCenterViewController!
     
@@ -185,10 +187,10 @@ class BaseTabbarViewController: NSObject {
         if !AliyunVodUpToyoPublishManager.shared.isUploading { // 是否正在上传中
             PublishNewPopView.show(imageStrs: ["publish_btn_picture","publish_btn_video","publish_btn_photo","publish_btn_article"], titles: ["相册","视频","拍照","文章"], columnCount: 4) { (index) in
                 if index != 3 {
-//                    let pickVc = PublishViewController()
-//                    pickVc.index = index
-                    let  pickVc = PublishNewViewController()
+                    let pickVc = PublishViewController()
                     pickVc.index = index
+//                    let  pickVc = PublishNewViewController()
+//                    pickVc.index = index
                     let nav = BaseNavigationViewController.init(rootViewController: pickVc)
                     nav.modalPresentationStyle = .fullScreen
                     BaseTabbarViewController.shared.esTabBarController.present(nav, animated: true, completion: nil)
@@ -209,7 +211,7 @@ class BaseTabbarViewController: NSObject {
         }else {
             //消息
             let messageIndexModel = MessageIndexModel.shared.object()
-            if messageIndexModel?.activity?.isYes == 1 || messageIndexModel?.follow?.isYes == 1 || messageIndexModel?.notification?.isYes == 1 || messageIndexModel?.praise?.isYes == 1 || messageIndexModel?.comment?.isYes == 1 {
+            if messageIndexModel?.activity?.isYes == 1 || messageIndexModel?.follow?.isYes == 1 || messageIndexModel?.notification?.isYes == 1 || messageIndexModel?.praise?.isYes == 1 || messageIndexModel?.comment?.isYes == 1 || (RCIMClient.shared()?.getTotalUnreadCount())! > Int32(0) {
                 v4.tabBarItem.pp.addDot(color:kFE352BColor)
                 v4.tabBarItem.pp.moveBadge(x: -3,y: 3)
                 

+ 20 - 2
RainbowPlanet/RainbowPlanet/Manager/RongCloudIMManager/RongCloudIMManager.swift

@@ -51,6 +51,8 @@ class RongCloudIMManager: NSObject {
          RCIM.shared()?.showUnkownMessageNotificaiton = true
         //用户头像
          RCIM.shared()?.userInfoDataSource = self
+        //接受消息的代理
+        RCIM.shared()?.receiveMessageDelegate = self
         //开启发送已读回执
          RCIM.shared()?.enabledReadReceiptConversationTypeList = [RCConversationType.ConversationType_PRIVATE,RCConversationType.ConversationType_DISCUSSION,RCConversationType.ConversationType_GROUP]
         /*!
@@ -142,7 +144,23 @@ extension RongCloudIMManager : RCIMUserInfoDataSource {
     /// - Parameter completion: 获取用户信息完成之后需要执行的Block [userInfo:该用户ID对应的用户信息]
     func getUserInfo(withUserId userId: String!, completion: ((RCUserInfo?) -> Void)!) {
 
-        let userInfo = RCUserInfo.init(userId: UserModel.shared().getModel()?.rcIMUid, name: UserModel.shared().getModel()?.username, portrait: UserModel.shared().getModel()?.avatarurl)
-        return completion(userInfo)
+        userMemberDetailApi(userId: userId, completion: completion)
+    }
+    
+    /// 获取用户详情
+    func userMemberDetailApi(userId: String!,completion: ((RCUserInfo?) -> Void)!) {
+        let uid = userId.suffix(from: String.Index(utf16Offset: userId.indexOf(key: "-") + 1, in: userId))
+        SwiftMoyaNetWorkServiceUser.shared().userMemberDetailApi(uid: Int(uid) ?? 0) {
+            (userDetailModel) -> (Void) in
+            let userDetailModel = userDetailModel as? UserDetailModel
+            let userInfo = RCUserInfo.init(userId: userId, name: userDetailModel?.username, portrait: userDetailModel?.avatar)
+            completion(userInfo)
+        }
+    }
+}
+
+extension RongCloudIMManager : RCIMReceiveMessageDelegate {
+    func onRCIMReceive(_ message: RCMessage!, left: Int32) {
+        NotificationCenter.default.post(name: NSNotification.Name(rawValue: "RCIMReceiveMessageDelegate"), object: nil)
     }
 }

+ 39 - 0
RainbowPlanet/RainbowPlanet/Model/RongCloudIMModel/ConversationModel.swift

@@ -0,0 +1,39 @@
+//
+//	ConversationModel.swift
+//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport
+
+import Foundation 
+import ObjectMapper
+
+class ConversationModel : NSObject, Mappable{
+
+	var conversationTitle : String?
+	var lastestMessageId : Int?
+	var objectName : String?
+	var receivedTime : Int?
+	var senderUserId : String?
+	var sentTime : Int?
+	var targetId : String?
+	var unreadMessageCount : Int?
+
+
+	class func newInstance(map: Map) -> Mappable?{
+		return ConversationModel()
+	}
+	required init?(map: Map){}
+    override init(){}
+
+	func mapping(map: Map)
+	{
+		conversationTitle <- map["conversationTitle"]
+		lastestMessageId <- map["lastestMessageId"]
+		objectName <- map["objectName"]
+		receivedTime <- map["receivedTime"]
+		senderUserId <- map["senderUserId"]
+		sentTime <- map["sentTime"]
+		targetId <- map["targetId"]
+		unreadMessageCount <- map["unreadMessageCount"]
+		
+	}
+
+}

+ 14 - 14
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Main/CommunityViewController.swift

@@ -65,10 +65,10 @@ class CommunityViewController: BaseViewController {
         navigationBar.isHidden = true
         view.addSubview(segmentedView)
         view.addSubview(listContainerView)
-//        listContainerView.addSubview(publishUploadProgressView)
-//        listContainerView.bringSubviewToFront(publishUploadProgressView)
-        listContainerView.addSubview(publishManagerUploadView)
-        listContainerView.bringSubviewToFront(publishManagerUploadView)
+        listContainerView.addSubview(publishUploadProgressView)
+        listContainerView.bringSubviewToFront(publishUploadProgressView)
+//        listContainerView.addSubview(publishManagerUploadView)
+//        listContainerView.bringSubviewToFront(publishManagerUploadView)
 
         view.addSubview(communityNavigationBarView)
         
@@ -92,15 +92,15 @@ class CommunityViewController: BaseViewController {
             make.top.equalTo(segmentedView.snp.bottom)
             make.left.right.bottom.equalToSuperview()
         }
-//        publishUploadProgressView.snp.makeConstraints { (make) in
-//            make.top.left.right.equalToSuperview()
-//             make.height.equalTo(62)
-//        }
-        
-        publishManagerUploadView.snp.makeConstraints { (make) in
+        publishUploadProgressView.snp.makeConstraints { (make) in
             make.top.left.right.equalToSuperview()
              make.height.equalTo(62)
         }
+        
+//        publishManagerUploadView.snp.makeConstraints { (make) in
+//            make.top.left.right.equalToSuperview()
+//             make.height.equalTo(62)
+//        }
 
 
     }
@@ -213,10 +213,10 @@ class CommunityViewController: BaseViewController {
         // 待发布
         observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("DismissFromPublishEditVc"), object: nil, queue: OperationQueue.main) {[weak self] (notification) in
             self?.reloadSegmentedFollowView()
-//            let aliyunVodUpToYoPublishModel = notification.object as? AliyunVodUpToYoPublishModel
-//            self?.publishUploadProgressView.aliyunVodUpToYoPublishModel = aliyunVodUpToYoPublishModel
-            let publishManagerModel = notification.object as? PublishManagerModel
-            self?.publishManagerUploadView.publishManagerModel = publishManagerModel
+            let aliyunVodUpToYoPublishModel = notification.object as? AliyunVodUpToYoPublishModel
+            self?.publishUploadProgressView.aliyunVodUpToYoPublishModel = aliyunVodUpToYoPublishModel
+//            let publishManagerModel = notification.object as? PublishManagerModel
+//            self?.publishManagerUploadView.publishManagerModel = publishManagerModel
 
         }
         

+ 193 - 0
RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageMain/View/MessageHomeOneSectionTableViewCell.swift

@@ -0,0 +1,193 @@
+//
+//  MessageHomeOneSectionTableViewCell.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/11/13.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class MessageHomeOneSectionTableViewCell: UITableViewCell {
+
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> MessageHomeOneSectionTableViewCell {
+        let ID = "MessageHomeOneSectionTableViewCell"
+        tableView.register(MessageHomeOneSectionTableViewCell.self, forCellReuseIdentifier: ID)
+        let cell : MessageHomeOneSectionTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! MessageHomeOneSectionTableViewCell
+        cell.indexPath = indexPath
+        return cell
+    }
+    
+    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
+        super.init(style: style, reuseIdentifier: reuseIdentifier)
+        setupViews()
+        setupLayouts()
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    var indexPath: IndexPath? {
+        didSet {
+            
+        }
+    }
+    
+    //MRAK: - 设置View
+    private func setupViews() {
+        self.selectionStyle = .none
+        backgroundColor = kffffffColor
+        addSubview(collectionView)
+        
+    }
+    
+    private func setupLayouts() {
+        
+    }
+    
+    lazy var collectionView: UICollectionView = {
+        let collectionView = UICollectionView.init(frame: CGRect(x: 0, y: 0, width: kScreenWidth, height: 104), collectionViewLayout: collectionViewLayout)
+        collectionView.backgroundColor = kf7f8faColor
+        collectionView.delegate = self;
+        collectionView.dataSource = self;
+        collectionView.showsVerticalScrollIndicator = false
+        collectionView.showsHorizontalScrollIndicator = false
+        return collectionView
+    }()
+    
+    private lazy var collectionViewLayout: UICollectionViewFlowLayout = {
+        let collectionViewLayout = UICollectionViewFlowLayout.init()
+        collectionViewLayout.minimumLineSpacing = 0
+        collectionViewLayout.minimumInteritemSpacing = 0
+        return collectionViewLayout
+    }()
+    
+    var messageIndexModel : MessageIndexModel? {
+        didSet {
+            collectionView.reloadData()
+        }
+    }
+
+}
+
+extension MessageHomeOneSectionTableViewCell: UICollectionViewDelegateFlowLayout,UICollectionViewDataSource {
+    func numberOfSections(in collectionView: UICollectionView) -> Int {
+        return 1
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+        return 3
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+        let cell = MessageHomeOneCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
+        if self.messageIndexModel != nil {
+            switch indexPath.row {
+            case 0:// 评论和@
+                cell.messageModel = (self.messageIndexModel?.comment)!
+            case 1:// 赞与互动
+                cell.messageModel = (self.messageIndexModel?.praise)!
+            default: //关注通知
+                cell.messageModel = (self.messageIndexModel?.follow)!
+            }
+        }
+        
+        return cell
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
+        
+        switch indexPath.row {
+        case 0:// 评论和@
+            if  self.messageIndexModel?.comment?.isYes == 1 {
+                userMemberReadMessageApi(messageShowTypes: self.messageIndexModel?.comment?.key ?? "") {
+                    [weak self] in
+                    self?.messageIndexModel?.comment?.isYes = 0
+                    collectionView.reloadItems(at: [indexPath])
+                    self?.pushMessageListController(messageVCType: .comment, messageShowTypes:  self?.messageIndexModel?.comment?.key ?? "")
+//                        self?.setTabBarItemBadge()
+                    let messageIndexModel = MessageIndexModel.shared.object()
+                    messageIndexModel?.comment?.isYes =  self?.messageIndexModel?.comment?.isYes
+                    MessageIndexModel.shared.saveObject(model: messageIndexModel!)
+                    BaseTabbarViewController.shared.setBadge()
+
+                }
+            }else {
+                self.pushMessageListController(messageVCType: .comment, messageShowTypes:  self.messageIndexModel?.comment?.key ?? "")
+            }
+        case 1:// 赞与互动
+            if  self.messageIndexModel?.praise?.isYes == 1 {
+                userMemberReadMessageApi(messageShowTypes: self.messageIndexModel?.praise?.key ?? "") {
+                    [weak self] in
+                    self?.messageIndexModel?.praise?.isYes = 0
+                    collectionView.reloadItems(at: [indexPath])
+                    self?.pushMessageListController(messageVCType: .praise, messageShowTypes:  self?.messageIndexModel?.praise?.key ?? "")
+//                        self?.setTabBarItemBadge()
+                    let messageIndexModel = MessageIndexModel.shared.object()
+                    messageIndexModel?.praise?.isYes =  self?.messageIndexModel?.praise?.isYes
+                    MessageIndexModel.shared.saveObject(model: messageIndexModel!)
+                    BaseTabbarViewController.shared.setBadge()
+
+                }
+            }else {
+                self.pushMessageListController(messageVCType: .praise, messageShowTypes:  self.messageIndexModel?.praise?.key ?? "")
+
+            }
+        default:
+            if  self.messageIndexModel?.follow?.isYes == 1 {
+                userMemberReadMessageApi(messageShowTypes: self.messageIndexModel?.follow?.key ?? "") {
+                    [weak self] in
+                    self?.messageIndexModel?.follow?.isYes = 0
+                    collectionView.reloadItems(at: [indexPath])
+                    self?.pushMessageListController(messageVCType: .follow, messageShowTypes:  self?.messageIndexModel?.follow?.key ?? "")
+                    let messageIndexModel = MessageIndexModel.shared.object()
+                    messageIndexModel?.follow?.isYes =  self?.messageIndexModel?.follow?.isYes
+                    MessageIndexModel.shared.saveObject(model: messageIndexModel!)
+                    BaseTabbarViewController.shared.setBadge()
+                }
+            }else {
+                pushMessageListController(messageVCType: .follow, messageShowTypes:  self.messageIndexModel?.follow?.key ?? "")
+            }
+        }
+        
+    }
+
+    
+    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
+        return CGSize(width:(kScreenWidth)/3, height:104)
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
+        return UIEdgeInsets(top:0, left: 0, bottom: 0, right: 0)
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForFooterInSection section: Int) -> CGSize {
+        return CGSize(width: kScreenWidth, height: 0)
+    }
+    
+}
+
+extension MessageHomeOneSectionTableViewCell {
+    
+    /// 用户消息阅读
+    func userMemberReadMessageApi(messageShowTypes:String,completion: @escaping () -> Void){
+        SwiftMoyaNetWorkServiceUser.shared().userMemberReadMessageApi(messageShowTypes: messageShowTypes) { (data) -> (Void) in
+            completion()
+        }
+    }
+    
+    /// push到消息控制器
+    ///
+    /// - Parameters:
+    ///   - messageVCType: 类型
+    ///   - messageShowTypes: key
+    func pushMessageListController(messageVCType:MessageListVCType,messageShowTypes:String) {
+        let vc = MessageListController()
+        vc.messageVCType = messageVCType
+        vc.messageShowTypes = messageShowTypes
+        UIViewController.topMost?.navigationController?.pushViewController(vc, animated: true)
+        BaseTabbarViewController.shared.setBadge()
+
+    }
+}

+ 43 - 0
RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageMain/View/MessageHomeThreeSectionTableViewCell.swift

@@ -0,0 +1,43 @@
+//
+//  MessageHomeThreeSectionTableViewCell.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/11/13.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import RongIMKit
+
+class MessageHomeThreeSectionTableViewCell: RCConversationCell {
+
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> MessageHomeThreeSectionTableViewCell {
+        let ID = "MessageHomeThreeSectionTableViewCell"
+        tableView.register(MessageHomeThreeSectionTableViewCell.self, forCellReuseIdentifier: ID)
+        let cell : MessageHomeThreeSectionTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! MessageHomeThreeSectionTableViewCell
+        cell.indexPath = indexPath
+        return cell
+    }
+    
+    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
+        super.init(style: style, reuseIdentifier: reuseIdentifier)
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+        //MARK: - indexPath
+    var indexPath: IndexPath?{
+        didSet {
+        }
+    }
+    
+    var conversationModel : ConversationModel? {
+        didSet {
+           let rcConversation = RCIMClient.shared()?.getConversation(RCConversationType.ConversationType_PRIVATE, targetId: conversationModel?.targetId)
+           let rcConversationModel = RCConversationModel.init(conversation: rcConversation, extend: "")
+            setDataModel(rcConversationModel)
+        }
+    }
+}

+ 21 - 19
RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageMain/View/MessageHomeTwoCollectionViewCell.swift

@@ -1,37 +1,28 @@
 //
-//  MessageHomeTwoCollectionViewCell.swift
+//  MessageHomeTwoSectionTableViewCell.swift
 //  RainbowPlanet
 //
-//  Created by 南鑫林 on 2019/6/26.
+//  Created by 南鑫林 on 2019/11/13.
 //  Copyright © 2019 RainbowPlanet. All rights reserved.
 //
 
 import UIKit
 
-class MessageHomeTwoCollectionViewCell: UICollectionViewCell {
-    
+class MessageHomeTwoSectionTableViewCell: UITableViewCell {
+
     var images = ["news_notice","news_activity"]
     var titles = ["由你通知","由你活动"]
     
-    class func cellWith(collectionView:UICollectionView,indexPath:IndexPath) -> MessageHomeTwoCollectionViewCell {
-        let ID = "MessageHomeTwoCollectionViewCell"
-        collectionView.register(MessageHomeTwoCollectionViewCell.self, forCellWithReuseIdentifier: ID)
-        let cell : MessageHomeTwoCollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: ID, for: indexPath) as! MessageHomeTwoCollectionViewCell
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> MessageHomeTwoSectionTableViewCell {
+        let ID = "MessageHomeTwoSectionTableViewCell"
+        tableView.register(MessageHomeTwoSectionTableViewCell.self, forCellReuseIdentifier: ID)
+        let cell : MessageHomeTwoSectionTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! MessageHomeTwoSectionTableViewCell
         cell.indexPath = indexPath
         return cell
     }
     
-   
-    //MARK: - indexPath
-    var indexPath: IndexPath?{
-        didSet {
-            iconImageView.image = kImage(name: images[(indexPath?.row)!])
-            titleLabel.text = titles[(indexPath?.row)!]
-        }
-    }
-    //MARK: - 初始化
-    override init(frame: CGRect) {
-        super.init(frame: frame)
+    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
+        super.init(style: style, reuseIdentifier: reuseIdentifier)
         setupViews()
         setupLayouts()
     }
@@ -40,9 +31,18 @@ class MessageHomeTwoCollectionViewCell: UICollectionViewCell {
         fatalError("init(coder:) has not been implemented")
     }
     
+        //MARK: - indexPath
+    var indexPath: IndexPath?{
+        didSet {
+            iconImageView.image = kImage(name: images[(indexPath?.row)!])
+            titleLabel.text = titles[(indexPath?.row)!]
+        }
+    }
+    
     //MRAK: - 设置View
     private func setupViews() {
         backgroundColor = kffffffColor
+        selectionStyle = .none
         addSubview(iconImageView)
         addSubview(titleLabel)
         addSubview(subLabel)
@@ -173,4 +173,6 @@ class MessageHomeTwoCollectionViewCell: UICollectionViewCell {
             }
         }
     }
+
+
 }

+ 95 - 142
RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageMain/ViewController/MessageMainViewController.swift

@@ -2,14 +2,19 @@
 //  MessageMainViewController.swift
 //  RainbowPlanet
 //
-//  Created by Christopher on 2019/6/10.
+//  Created by 南鑫林 on 2019/11/14.
 //  Copyright © 2019 RainbowPlanet. All rights reserved.
 //
 
 import UIKit
+
 import Lottie
 import ESTabBarController_swift
 import Kingfisher
+import RongIMLib
+import SwiftyJSON
+import ObjectMapper
+import SwiftyMediator
 
 class MessageMainViewController: BaseViewController {
     override func didReceiveMemoryWarning() {
@@ -26,6 +31,9 @@ class MessageMainViewController: BaseViewController {
     weak var observe : NSObjectProtocol?
     
     var messageIndexModel : MessageIndexModel?
+    var users : Array<Any>?
+    var conversationModels : Array<ConversationModel>?
+    
     
     override func viewDidLoad() {
         super.viewDidLoad()
@@ -33,11 +41,16 @@ class MessageMainViewController: BaseViewController {
         setupData()
     }
     
+    override func viewWillAppear(_ animated: Bool) {
+        super.viewWillAppear(animated)
+        setConversationList()
+    }
+    
     override func setupViews() {
         navigationBar.title = "消息"
         view.backgroundColor = kf7f8faColor
-        view.addSubview(collectionView)
-        view.insertSubview(navigationBar, aboveSubview: collectionView)
+        view.addSubview(tableView)
+        view.insertSubview(navigationBar, aboveSubview: tableView)
     }
     
     override func setupData() {
@@ -45,39 +58,38 @@ class MessageMainViewController: BaseViewController {
         observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("MessageMainViewController"), object: nil, queue: OperationQueue.main) {
              [weak self] notification in
             self?.messageIndexModel = notification.object as? MessageIndexModel
-            self?.collectionView.reloadData()
+            self?.tableView.reloadData()
             BaseTabbarViewController.shared.setBadge()
         }
-        collectionView.addHeader(withBeginRefresh: true,  animation: true) {
+        
+        observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("RCIMReceiveMessageDelegate"), object: nil, queue: OperationQueue.main) {
+             [weak self] notification in
+            self?.setConversationList()
+        }
+        
+        tableView.addHeader(withBeginRefresh: true,  animation: true) {
             [weak self] (page) in
             self?.userMemberMessageIndexApi()
+            self?.setConversationList()
         }
         
         observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("MessageModuleTop"), object: nil, queue: OperationQueue.main, using: {
             [weak self] (notification) in
-            if self?.collectionView.contentOffset == CGPoint(x: 0, y: 0) {
-                self?.collectionView.mj_header.beginRefreshing()
+            if self?.tableView.contentOffset == CGPoint(x: 0, y: 0) {
+                self?.tableView.mj_header.beginRefreshing()
             }else {
-                self?.collectionView.scrollToTop()
+                self?.tableView.scrollToTop()
             }
         })
     }
     
-    lazy var collectionView: UICollectionView = {
-        let collectionView = UICollectionView.init(frame: CGRect(x: 0, y: kNavBarTotalHeight, width: kScreenWidth, height: kScreenHeight - kNavBarTotalHeight), collectionViewLayout: collectionViewLayout)
-        collectionView.backgroundColor = kf7f8faColor
-        collectionView.delegate = self;
-        collectionView.dataSource = self;
-        collectionView.showsVerticalScrollIndicator = false
-        collectionView.showsHorizontalScrollIndicator = false
-        return collectionView
-    }()
-    
-    private lazy var collectionViewLayout: UICollectionViewFlowLayout = {
-        let collectionViewLayout = UICollectionViewFlowLayout.init()
-        collectionViewLayout.minimumLineSpacing = 0
-        collectionViewLayout.minimumInteritemSpacing = 0
-        return collectionViewLayout
+    lazy var tableView: UITableView = {
+        let tableView = UITableView(frame: CGRect(x: 0, y: kNavBarTotalHeight, width: kScreenWidth, height: kScreenHeight - kNavBarTotalHeight), style: UITableView.Style.grouped)
+        tableView.separatorStyle = .none
+        tableView.backgroundColor = kf7f8faColor
+        tableView.dataSource = self
+        tableView.delegate = self
+        return tableView
     }()
     
 }
@@ -89,12 +101,12 @@ extension MessageMainViewController {
         SwiftMoyaNetWorkServiceUser.shared().userMemberMessageIndexApi(completion: {
             [weak self] (messageIndexModel) -> (Void) in
             self?.messageIndexModel = messageIndexModel as? MessageIndexModel
-            self?.collectionView.reloadData()
+            self?.tableView.reloadData()
             BaseTabbarViewController.shared.setBadge()
-            MJRefreshManager.mjRefreshManager(collectionView: self?.collectionView)
+            MJRefreshManager.mjRefreshManager(tableView: self?.tableView)
         }) {
             [weak self] loadingStauts in
-            MJRefreshManager.mjRefreshManagerLoadingStatus(collectionView: self?.collectionView, loadingStatus: loadingStauts)
+            MJRefreshManager.mjRefreshManagerLoadingStatus(tableView: self?.tableView, loadingStatus: loadingStauts)
         }
     }
     
@@ -105,6 +117,14 @@ extension MessageMainViewController {
         }
     }
     
+    /// 融云
+    func setConversationList() {
+        self.users = RCIMClient.shared()?.getConversationList([RCConversationType.ConversationType_PRIVATE.rawValue])
+        self.conversationModels = Mapper<ConversationModel>().mapArray(JSONString: self.users?.description ?? "[]")
+        self.tableView.reloadData()
+        BaseTabbarViewController.shared.setBadge()
+    }
+    
 }
 
 extension MessageMainViewController {
@@ -119,45 +139,38 @@ extension MessageMainViewController {
         vc.messageVCType = messageVCType
         vc.messageShowTypes = messageShowTypes
         self.navigationController?.pushViewController(vc, animated: true)
-//        self.setTabBarItemBadge()
         BaseTabbarViewController.shared.setBadge()
 
 
     }
 }
 
-extension MessageMainViewController: UICollectionViewDelegateFlowLayout,UICollectionViewDataSource {
-    func numberOfSections(in collectionView: UICollectionView) -> Int {
-        return 2
+extension MessageMainViewController: UITableViewDelegate,UITableViewDataSource {
+    func numberOfSections(in tableView: UITableView) -> Int {
+        return 3
     }
     
-    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
         switch section {
         case 0:
-            return 3
-        default:
+            return 1
+        case 1:
             return 2
+        case 2:
+            return self.conversationModels?.count ?? 0
+        default:
+            return 0
         }
     }
     
-    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
         switch indexPath.section {
         case 0:
-            let cell = MessageHomeOneCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
-            if self.messageIndexModel != nil {
-                switch indexPath.row {
-                case 0:// 评论和@
-                    cell.messageModel = (self.messageIndexModel?.comment)!
-                case 1:// 赞与互动
-                    cell.messageModel = (self.messageIndexModel?.praise)!
-                default: //关注通知
-                    cell.messageModel = (self.messageIndexModel?.follow)!
-                }
-            }
-            
+            let cell = MessageHomeOneSectionTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+            cell.messageIndexModel = messageIndexModel
             return cell
-        default:
-            let cell = MessageHomeTwoCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
+        case 1:
+            let cell = MessageHomeTwoSectionTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
             if self.messageIndexModel != nil {
                 switch indexPath.row {
                 case 0:// 星球通知
@@ -167,77 +180,25 @@ extension MessageMainViewController: UICollectionViewDelegateFlowLayout,UICollec
                 }
             }
             return cell
+        case 2:
+            let cell = MessageHomeThreeSectionTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+            cell.conversationModel = self.conversationModels?[indexPath.row]
+            return cell
+        default:
+            return UITableViewCell()
         }
     }
     
-    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
-        
+    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
         switch indexPath.section {
-        case 0:
-            switch indexPath.row {
-            case 0:// 评论和@
-                if  self.messageIndexModel?.comment?.isYes == 1 {
-                    userMemberReadMessageApi(messageShowTypes: self.messageIndexModel?.comment?.key ?? "") {
-                        [weak self] in
-                        self?.messageIndexModel?.comment?.isYes = 0
-                        collectionView.reloadItems(at: [indexPath])
-                        self?.pushMessageListController(messageVCType: .comment, messageShowTypes:  self?.messageIndexModel?.comment?.key ?? "")
-//                        self?.setTabBarItemBadge()
-                        let messageIndexModel = MessageIndexModel.shared.object()
-                        messageIndexModel?.comment?.isYes =  self?.messageIndexModel?.comment?.isYes
-                        MessageIndexModel.shared.saveObject(model: messageIndexModel!)
-                        BaseTabbarViewController.shared.setBadge()
-
-                    }
-                }else {
-                    self.pushMessageListController(messageVCType: .comment, messageShowTypes:  self.messageIndexModel?.comment?.key ?? "")
-                }
-                
-            case 1:// 赞与互动
-                if  self.messageIndexModel?.praise?.isYes == 1 {
-                    userMemberReadMessageApi(messageShowTypes: self.messageIndexModel?.praise?.key ?? "") {
-                        [weak self] in
-                        self?.messageIndexModel?.praise?.isYes = 0
-                        collectionView.reloadItems(at: [indexPath])
-                        self?.pushMessageListController(messageVCType: .praise, messageShowTypes:  self?.messageIndexModel?.praise?.key ?? "")
-//                        self?.setTabBarItemBadge()
-                        let messageIndexModel = MessageIndexModel.shared.object()
-                        messageIndexModel?.praise?.isYes =  self?.messageIndexModel?.praise?.isYes
-                        MessageIndexModel.shared.saveObject(model: messageIndexModel!)
-                        BaseTabbarViewController.shared.setBadge()
-
-                    }
-                }else {
-                    self.pushMessageListController(messageVCType: .praise, messageShowTypes:  self.messageIndexModel?.praise?.key ?? "")
-
-                }
-            default: //关注通知
-                if  self.messageIndexModel?.follow?.isYes == 1 {
-                    userMemberReadMessageApi(messageShowTypes: self.messageIndexModel?.follow?.key ?? "") {
-                        [weak self] in
-                        self?.messageIndexModel?.follow?.isYes = 0
-                        collectionView.reloadItems(at: [indexPath])
-                        self?.pushMessageListController(messageVCType: .follow, messageShowTypes:  self?.messageIndexModel?.follow?.key ?? "")
-                        let messageIndexModel = MessageIndexModel.shared.object()
-                        messageIndexModel?.follow?.isYes =  self?.messageIndexModel?.follow?.isYes
-                        MessageIndexModel.shared.saveObject(model: messageIndexModel!)
-                        BaseTabbarViewController.shared.setBadge()
-
-//                        self?.setTabBarItemBadge()
-                    }
-                }else {
-                    pushMessageListController(messageVCType: .follow, messageShowTypes:  self.messageIndexModel?.follow?.key ?? "")
-
-                }
-            }
-        default:
+        case 1:
             switch indexPath.row {
             case 0:// 星球通知
                 if  self.messageIndexModel?.notification?.isYes == 1 {
                     userMemberReadMessageApi(messageShowTypes: self.messageIndexModel?.notification?.key ?? "") {
                         [weak self] in
                         self?.messageIndexModel?.notification?.isYes = 0
-                        collectionView.reloadItems(at: [indexPath])
+                        tableView.reloadRows(at: [indexPath], with: UITableView.RowAnimation.none)
                         let vc = MessagePlanetNotiController()
                         vc.messageShowTypes = self?.messageIndexModel?.notification?.key ?? ""
                         self?.navigationController?.pushViewController(vc, animated: true)
@@ -245,24 +206,19 @@ extension MessageMainViewController: UICollectionViewDelegateFlowLayout,UICollec
                         messageIndexModel?.notification?.isYes =  self?.messageIndexModel?.notification?.isYes
                         MessageIndexModel.shared.saveObject(model: messageIndexModel!)
                         BaseTabbarViewController.shared.setBadge()
-
-//                        self?.setTabBarItemBadge()
                     }
                 }else {
                     let vc = MessagePlanetNotiController()
                     vc.messageShowTypes = self.messageIndexModel?.notification?.key ?? ""
                     self.navigationController?.pushViewController(vc, animated: true)
                     BaseTabbarViewController.shared.setBadge()
-
-//                    self.setTabBarItemBadge()
-
                 }
             default:// 星球活动
                 if  self.messageIndexModel?.activity?.isYes == 1 {
                     userMemberReadMessageApi(messageShowTypes: self.messageIndexModel?.activity?.key ?? "") {
                         [weak self] in
                         self?.messageIndexModel?.activity?.isYes = 0
-                        collectionView.reloadItems(at: [indexPath])
+                        tableView.reloadRows(at: [indexPath], with: UITableView.RowAnimation.none)
                         let vc = MessagePlanetActivityController()
                         vc.messageShowTypes = self?.messageIndexModel?.activity?.key ?? ""
                         self?.navigationController?.pushViewController(vc, animated: true)
@@ -271,52 +227,49 @@ extension MessageMainViewController: UICollectionViewDelegateFlowLayout,UICollec
                         messageIndexModel?.activity?.isYes =  self?.messageIndexModel?.activity?.isYes
                         MessageIndexModel.shared.saveObject(model: messageIndexModel!)
                         BaseTabbarViewController.shared.setBadge()
-
-//                        self?.setTabBarItemBadge()
                     }
                 }else {
                     let vc = MessagePlanetActivityController()
                     vc.messageShowTypes = self.messageIndexModel?.activity?.key ?? ""
                     self.navigationController?.pushViewController(vc, animated: true)
                     BaseTabbarViewController.shared.setBadge()
-
-//                    self.setTabBarItemBadge()
-
                 }
             }
+        case 2:
+            let cell = tableView.cellForRow(at: indexPath) as? MessageHomeThreeSectionTableViewCell
+            Mediator.push(RongCloudIMRouterModuleType.IMChatPrivate(targetId: cell?.conversationModel?.targetId ?? "0", title: cell?.conversationTitle.text ?? ""))
+        default:
+            break
         }
-       
     }
     
-//    func setTabBarItemBadge() {
-//        if self.messageIndexModel?.activity?.isYes == 1 || self.messageIndexModel?.follow?.isYes == 1 || self.messageIndexModel?.notification?.isYes == 1 || self.messageIndexModel?.praise?.isYes ==  1 ||  self.messageIndexModel?.comment?.isYes == 1{
-//            let tabBarItem = self.tabBarItem as? ESTabBarItem
-//            tabBarItem?.contentView?.badgeColor = kFE352BColor
-//            tabBarItem?.contentView?.badgeValue = ""
-//            tabBarItem?.contentView?.badgeOffset = UIOffset(horizontal: 0, vertical: -22)
-//        }else {
-//            let tabBarItem = self.tabBarItem as? ESTabBarItem
-//            tabBarItem?.contentView?.badgeValue = nil
-//        }
-//    }
-
-    
-    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
+    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
         switch indexPath.section {
         case 0:
-            return CGSize(width:(kScreenWidth)/3, height:104)
+            return 107
+        case 1,2:
+            return 70
         default:
-            return CGSize(width:kScreenWidth, height:70)
+            return 0
         }
     }
     
-    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
-        return UIEdgeInsets(top:0, left: 0, bottom: 0, right: 0)
+    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
+        return 10
+    }
+    
+    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
+        return nil
+        
+    }
+    
+    func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
+        return 0.000001
+        
     }
     
-    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForFooterInSection section: Int) -> CGSize {
-        return CGSize(width: kScreenWidth, height: 10)
+    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
+        return nil
     }
     
 }
-

+ 33 - 0
RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/PersonalCenterView/PersonViewUserAndOtherHeaderView.swift

@@ -8,6 +8,7 @@
 
 import UIKit
 import Kingfisher
+import SwiftyMediator
 /// 用户类型
 ///
 /// - user: 自己
@@ -25,9 +26,11 @@ class PersonViewUserAndOtherHeaderView: BaseView {
             if personViewUserAndOtherHeaderViewType == .user {
                 followButton.isHidden = true
                 editButton.isHidden = false
+                chatButton.alpha = 0
             }else {
                 followButton.isHidden = false
                 editButton.isHidden = true
+                chatButton.alpha = 1
             }
         }
     }
@@ -42,6 +45,7 @@ class PersonViewUserAndOtherHeaderView: BaseView {
         bgView.addSubview(avatarButton)
         bgView.addSubview(editButton)
         bgView.addSubview(followButton)
+        bgView.addSubview(chatButton)
     }
     
     override func setupLayouts() {
@@ -82,6 +86,13 @@ class PersonViewUserAndOtherHeaderView: BaseView {
             make.height.equalTo(28)
         }
         
+        chatButton.snp.makeConstraints { (make) in
+            make.centerY.equalTo(followButton)
+            make.right.equalTo(followButton.snp.left).offset(-10)
+            make.width.equalTo(60)
+            make.height.equalTo(28)
+        }
+        
     }
     
     private lazy var bgImageView: UIImageView = {
@@ -195,6 +206,28 @@ class PersonViewUserAndOtherHeaderView: BaseView {
         return followButton
     }()
     
+    lazy var chatButton: UIButton = {
+        let chatButton = UIButton(type: UIButton.ButtonType.custom)
+        chatButton.backgroundColor = .clear
+        chatButton.setTitle("私信", for: UIControl.State.normal)
+        chatButton.titleLabel?.font = kMediumFont13
+        chatButton.alpha = 0
+        chatButton.layer.borderColor = kffffffColor.cgColor
+        chatButton.layer.borderWidth = 1
+        chatButton.cornerRadius = 14
+        chatButton.masksToBounds = true
+        chatButton.rx.tap.subscribe(onNext: {
+            [weak self] (data) in
+            if self?.userDetailModel?.isFollowStatus == 0 {
+                SwiftProgressHUD.shared().showText("请您先关注该用户,再私信哦~")
+            }else { //私信
+                Mediator.push(RongCloudIMRouterModuleType.IMChatPrivate(targetId: kRongCloudIMUserIdPrefix(userId: self?.userDetailModel?.uid ?? 0), title: self?.userDetailModel?.username ?? ""))
+
+            }
+        }).disposed(by: disposeBag)
+        return chatButton
+    }()
+    
     private lazy var editButton : UIButton = {
         let editButton = UIButton(type: UIButton.ButtonType.custom)
         editButton.cornerRadius = 12

+ 155 - 0
RainbowPlanet/RainbowPlanet/Modules/RongCloudIMModule/IMChatPrivate/ViewController/IMChatPrivateViewController.swift

@@ -0,0 +1,155 @@
+//
+//  IMChatPrivateViewController.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/11/13.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import RongIMKit
+import RongIMLib
+
+class IMChatPrivateViewController: RCConversationViewController {
+    
+    override var preferredStatusBarStyle: UIStatusBarStyle {
+        return .lightContent
+    }
+    
+    deinit {
+        NXLLog("deinit")
+    }
+    
+    lazy var navigationBar = WRCustomNavigationBar.CustomNavigationBar()
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        setupNavigationBar()
+        setRCIM()
+        
+    }
+    
+    fileprivate func setupNavigationBar()
+    {
+        if #available(iOS 11.0, *) {
+            UIScrollView.appearance().contentInsetAdjustmentBehavior = .automatic
+        } else {
+            if self.responds(to: #selector(setter: self.automaticallyAdjustsScrollViewInsets)) {
+                self.automaticallyAdjustsScrollViewInsets = true
+            }
+        }
+        navigationController?.interactivePopGestureRecognizer?.delegate = self
+        navigationBar.wr_setBottomLineHidden(hidden: true)
+        navigationBar.barBackgroundColor = kThemeColor
+        navigationBar.titleLabelColor = UIColor.white
+        navigationBar.title = title
+        statusBarStyle = .lightContent
+        view.addSubview(navigationBar)
+        
+        if self.navigationController != nil {
+            if self.navigationController?.viewControllers.count == 1 {
+                if self.navigationController?.presentingViewController != nil {
+                    setLeftButton(image: UIImage(named: "navbar_back_white")! )
+                }
+            } else {
+                setLeftButton(image: UIImage(named: "navbar_back_white")!)
+            }
+        } else {
+            setLeftButton(image: UIImage(named: "navbar_back_white")!)
+        }
+    }
+    
+    private func setLeftButton(image:UIImage) {
+        navigationBar.wr_setLeftButton(image: image)
+        navigationBar.wr_setRightButton(title: "设置", titleColor: kffffffColor)
+        navigationBar.onClickLeftButton = {
+            [weak self] in
+            self?.wr_toLastViewController(animated: true)
+        }
+        navigationBar.onClickRightButton = {
+            [weak self] in
+            let vc = IMChatPrivateSetViewController()
+            vc.targetId = self?.targetId
+            vc.type = self?.conversationType
+            self?.navigationController?.pushViewController(vc, animated: true)
+        }
+    }
+    
+    
+    @objc func backAction(sender:Any) {
+        // 推荐页面清理工作
+        leftBarButtonItemPressed(sender)
+    }
+    
+    override func viewWillAppear(_ animated: Bool) {
+        super.viewWillAppear(animated)
+        self.navigationItem.leftBarButtonItem = nil
+        self.navigationItem.rightBarButtonItem = nil
+        self.navigationController?.navigationBar.isHidden = true
+        if #available(iOS 11.0, *) {
+            UIScrollView.appearance().contentInsetAdjustmentBehavior = .never
+        } else {
+            if self.responds(to: #selector(setter: self.automaticallyAdjustsScrollViewInsets)) {
+                self.automaticallyAdjustsScrollViewInsets = false
+            }
+        }
+    }
+    
+    
+    func setRCIM() {
+        // 您可以针对群聊、聊天室、单聊等不同场景,自己定制是否显示发送方的名字。
+        displayUserNameInCell = true
+        // conversationMessageCollectionView 背景色
+        let color = UIColor(patternImage: kImage(name: "chat_pic_bg")!)
+        view.backgroundColor = color
+        conversationMessageCollectionView.backgroundColor = UIColor.clear
+        // 刷新页面
+        conversationMessageCollectionView.reloadData()
+        // 删除地理位置
+        chatSessionInputBarControl.pluginBoardView.removeItem(withTag: 1003)
+        // 添加文件
+//        let fileImage = RCKitUtility.imageNamed("actionbar_file_icon", ofBundle: "RongCloud.bundle")
+//        chatSessionInputBarControl.pluginBoardView.insertItem(with: fileImage, title: NSLocalizedString("File", tableName: "RongCloudKit", comment: ""), at: 2, tag: 1006)
+        
+//        #define INPUT_MENTIONED_SELECT_TAG 1000
+//        #define PLUGIN_BOARD_ITEM_ALBUM_TAG 1001
+//        #define PLUGIN_BOARD_ITEM_CAMERA_TAG 1002
+//        #define PLUGIN_BOARD_ITEM_VOIP_TAG 1101
+//        #define PLUGIN_BOARD_ITEM_VIDEO_VOIP_TAG 1102
+//        #define PLUGIN_BOARD_ITEM_RED_PACKET_TAG 1104
+//        #define PLUGIN_BOARD_ITEM_VOICE_INPUT_TAG 1105
+//        #define PLUGIN_BOARD_ITEM_PTT_TAG 1106
+//        #define PLUGIN_BOARD_ITEM_CARD_TAG 1107
+//        #define PLUGIN_BOARD_ITEM_REMOTE_CONTROL_TAG 1108
+//        #define PLUGIN_BOARD_ITEM_TRANSFER_TAG 1109
+    }
+    
+    override func pluginBoardView(_ pluginBoardView: RCPluginBoardView!, clickedItemWithTag tag: Int) {
+        
+        self.navigationItem.leftBarButtonItem = nil
+        self.navigationItem.rightBarButtonItem = nil
+        if #available(iOS 11.0, *) {
+            UIScrollView.appearance().contentInsetAdjustmentBehavior = .automatic
+        } else {
+            if self.responds(to: #selector(setter: self.automaticallyAdjustsScrollViewInsets)) {
+                self.automaticallyAdjustsScrollViewInsets = true
+            }
+        }
+        
+        WRNavigationBar.defaultNavBarBarTintColor = kThemeColor
+        WRNavigationBar.defaultNavBarTitleColor = UIColor.white
+        WRNavigationBar.defaultNavBarTintColor = UIColor.white
+        WRNavigationBar.defaultNavBarBackgroundImage = UIImage.imageWithColor(color: kThemeColor)
+        UINavigationBar.appearance().tintColor = UIColor.white
+        super.pluginBoardView(pluginBoardView, clickedItemWithTag: tag)
+
+    }
+    
+
+}
+
+extension IMChatPrivateViewController {
+    override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
+        return true
+    }
+}

+ 115 - 0
RainbowPlanet/RainbowPlanet/Modules/RongCloudIMModule/IMChatPrivateSet/View/IMChatPrivateSetOneTableViewCell.swift

@@ -0,0 +1,115 @@
+//
+//  IMChatPrivateSetOneTableViewCell.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/11/13.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import RongIMLib
+
+class IMChatPrivateSetOneTableViewCell: UITableViewCell {
+
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> IMChatPrivateSetOneTableViewCell {
+        let ID = "IMChatPrivateSetOneTableViewCell"
+        tableView.register(IMChatPrivateSetOneTableViewCell.self, forCellReuseIdentifier: ID)
+        let cell : IMChatPrivateSetOneTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! IMChatPrivateSetOneTableViewCell
+        cell.indexPath = indexPath
+        return cell
+    }
+    
+    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
+        super.init(style: style, reuseIdentifier: reuseIdentifier)
+        setupViews()
+        setupLayouts()
+        setupData()
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    var indexPath: IndexPath? {
+        didSet {
+            
+        }
+    }
+    //MRAK: - 设置View
+    private func setupViews() {
+        self.selectionStyle = .none
+        addSubview(titleLabel)
+        addSubview(onSwitch)
+        addSubview(lineLabel)
+    }
+    
+    private func setupLayouts() {
+        titleLabel.snp.makeConstraints { (make) in
+            make.centerY.equalToSuperview()
+            make.left.equalTo(14)
+        }
+        onSwitch.snp.makeConstraints { (make) in
+            make.centerY.equalToSuperview()
+            make.right.equalTo(-14)
+        }
+        lineLabel.snp.makeConstraints { (make) in
+            make.bottom.right.equalToSuperview()
+            make.left.equalTo(14)
+            make.height.equalTo(0.5)
+        }
+    }
+    
+    func setupData() {
+        onSwitch.addTarget(self, action: #selector(onSwitchAction(onSwitch:)), for: UIControl.Event.touchUpInside)
+    }
+    private lazy var titleLabel: UILabel = {
+        let titleLabel = UILabel()
+        titleLabel.textColor = k333333Color
+        titleLabel.font = kRegularFont16
+        return titleLabel
+    }()
+    
+    
+    private lazy var lineLabel: UILabel = {
+        let lineLabel = UILabel()
+        lineLabel.backgroundColor = kf5f5f5Color
+        return lineLabel
+    }()
+    
+    lazy var onSwitch: UISwitch = {
+        let onSwitch = UISwitch()
+        onSwitch.backgroundColor = kf1f1f1Color
+        onSwitch.onTintColor = kThemeColor
+        onSwitch.tintColor = kf1f1f1Color
+        onSwitch.thumbTintColor = .white
+        onSwitch.cornerRadius = 15.5
+        onSwitch.masksToBounds = true
+        return onSwitch
+    }()
+    
+    @objc func onSwitchAction(onSwitch:UISwitch) {
+        if indexPath?.row == 0 {
+            RCIMClient.shared()?.setConversationToTop(type!, targetId: targetId!, isTop: onSwitch.isOn)
+        }
+        
+        if indexPath?.row == 1 {
+            RCIMClient.shared()?.setConversationNotificationStatus(type!, targetId:targetId!, isBlocked: onSwitch.isOn, success: { (RCConversationNotificationStatus) in
+                
+            }, error: { (errorCode) in
+                
+            })
+        }
+    }
+    
+    var title : String? {
+        didSet {
+            titleLabel.text = title
+        }
+    }
+    
+    /// 会话目标
+    var targetId : String?
+    /// 会话类型
+    var type : RCConversationType?
+
+}

+ 61 - 0
RainbowPlanet/RainbowPlanet/Modules/RongCloudIMModule/IMChatPrivateSet/View/IMChatPrivateSetTwoTableViewCell.swift

@@ -0,0 +1,61 @@
+//
+//  IMChatPrivateSetTwoTableViewCell.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/11/13.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class IMChatPrivateSetTwoTableViewCell: UITableViewCell {
+
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> IMChatPrivateSetTwoTableViewCell {
+        let ID = "IMChatPrivateSetTwoTableViewCell"
+        tableView.register(IMChatPrivateSetTwoTableViewCell.self, forCellReuseIdentifier: ID)
+        let cell : IMChatPrivateSetTwoTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! IMChatPrivateSetTwoTableViewCell
+        cell.indexPath = indexPath
+        return cell
+    }
+    
+    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
+        super.init(style: style, reuseIdentifier: reuseIdentifier)
+        setupViews()
+        setupLayouts()
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    var indexPath: IndexPath? {
+        didSet {
+            
+        }
+    }
+    //MRAK: - 设置View
+    private func setupViews() {
+        self.selectionStyle = .none
+        addSubview(titleLabel)
+    }
+    
+    private func setupLayouts() {
+        titleLabel.snp.makeConstraints { (make) in
+            make.center.equalToSuperview()
+        }
+
+    }
+    private lazy var titleLabel: UILabel = {
+        let titleLabel = UILabel()
+        titleLabel.textColor = k333333Color
+        titleLabel.font = kMediumFont16
+        return titleLabel
+    }()
+    
+    var title : String? {
+        didSet {
+            titleLabel.text = title
+        }
+    }
+
+}

+ 114 - 0
RainbowPlanet/RainbowPlanet/Modules/RongCloudIMModule/IMChatPrivateSet/ViewController/IMChatPrivateSetViewController.swift

@@ -0,0 +1,114 @@
+//
+//  IMChatPrivateSetViewController.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/11/13.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import RongIMLib
+
+class IMChatPrivateSetViewController: BaseViewController {
+
+    /// 会话目标
+    var targetId : String?
+    
+    /// 会话类型
+    var type : RCConversationType?
+    
+    let sections = [["置顶聊天","屏蔽消息"],
+                    ["清空聊天记录"]]
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        setupViews()
+        setupLayouts()
+    }
+    
+    override func setupViews() {
+        navigationBar.title = "聊天信息"
+        view.addSubview(tableView)
+    }
+    
+    override func setupLayouts() {
+        tableView.snp.makeConstraints { (make) in
+            make.right.left.bottom.equalToSuperview()
+            make.top.equalTo(kNavBarTotalHeight)
+        }
+    }
+    
+    private lazy var tableView: UITableView = {
+        let tableView = UITableView(frame: CGRect.zero, style: UITableView.Style.grouped)
+        tableView.backgroundColor = kf7f8faColor
+        tableView.delegate = self
+        tableView.dataSource = self
+        tableView.rowHeight = 48
+        tableView.separatorStyle = .none
+        return tableView
+    }()
+    
+
+}
+
+extension IMChatPrivateSetViewController: UITableViewDelegate,UITableViewDataSource {
+    
+    func numberOfSections(in tableView: UITableView) -> Int {
+        return sections.count
+    }
+    
+    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+       return sections[section].count
+    }
+    
+    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
+        switch indexPath.section {
+        case 0:
+            let cell = IMChatPrivateSetOneTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+            cell.title =  sections[indexPath.section][indexPath.row]
+            return cell
+        case 1:
+            let cell = IMChatPrivateSetTwoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+            cell.title =  sections[indexPath.section][indexPath.row]
+            return cell
+        default:
+            return UITableViewCell()
+        }
+    }
+    
+    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
+        switch indexPath.section {
+        case 1:
+            RCIMClient.shared()?.deleteMessages(type!, targetId: targetId!, success: {
+                DispatchQueue.main.async {
+                    SwiftProgressHUD.shared().showText("清理成功!")
+                }
+            }, error: { (errorCode) in
+                DispatchQueue.main.async {
+                    SwiftProgressHUD.shared().showText("清理失败!")
+                }
+            })
+            break
+        default:
+            break
+       }
+    }
+    
+    
+    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
+        return nil
+    }
+    
+    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
+        return 10
+    }
+    
+    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
+        return nil
+    }
+    
+    func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
+
+        return 0.0000001
+    }
+}

+ 8 - 0
RainbowPlanet/RainbowPlanet/Modules/RongCloudIMModule/IMChatRoom/ViewController/IMChatRoomViewController.swift

@@ -9,6 +9,7 @@
 import UIKit
 import RongIMKit
 import RongIMLib
+import SwiftyMediator
 
 
 class IMChatRoomViewController: RCConversationViewController {
@@ -140,6 +141,13 @@ class IMChatRoomViewController: RCConversationViewController {
 
     }
     
+    override func didTapCellPortrait(_ userId: String!) {
+        let userID = userId.suffix(from: String.Index(utf16Offset: userId.indexOf(key: "-") + 1, in: userId))
+        if Int(userID) != UserModel.shared().getModel()?.uid {
+            Mediator.push(MineRouterModuleType.pushOtherPersonalCenter(uid: Int(userID) ?? 0))
+        }
+    }
+    
 
 }
 

+ 6 - 0
RainbowPlanet/RainbowPlanet/Router/RongCloudIMRouterModuleType.swift

@@ -12,9 +12,11 @@ import RongIMKit
 /// RongCloudIM模块
 ///
 /// - IMChatRoom: 聊天室
+/// - IMChatsingle: 单聊
 
 public enum RongCloudIMRouterModuleType: MediatorTargetType {
     case IMChatRoom(targetId: String,messageCount:Int32,roomName:String)
+    case IMChatPrivate(targetId: String,title:String)
 }
 
 extension RongCloudIMRouterModuleType: MediatorSourceType {
@@ -25,6 +27,10 @@ extension RongCloudIMRouterModuleType: MediatorSourceType {
             vc?.defaultHistoryMessageCountOfChatRoom = messageCount
             vc?.roomName = roomName
             return vc
+        case .IMChatPrivate(let targetId,let title):
+            let vc = IMChatPrivateViewController.init(conversationType: .ConversationType_PRIVATE, targetId: targetId)
+            vc?.title = title
+            return vc
         }
     }
 }

+ 19 - 4
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceManger/SwiftMoyaNetWorkManager/ApiMacro.swift

@@ -1,14 +1,14 @@
 /// Service
 let kPersonalService = false
-let kDevelopSever = true
+let kDevelopSever = false
 let kBetaSever = false
-let kProductSever = false
+let kProductSever = true
 
 /// H5Service
 let kH5PersonalService = false
-let kH5DevelopSever = true
+let kH5DevelopSever = false
 let kH5BetaSever = false
-let kH5ProductSever = false
+let kH5ProductSever = true
 
 // MARK: - 数据服务器
 public func kApiDataPrefix() -> String {
@@ -74,6 +74,21 @@ public func kApiDownloadPrefix() -> String {
     }
 }
 
+// MARK: - 融云用户Id
+public func kRongCloudIMUserIdPrefix(userId:Int) -> String {
+    if kPersonalService /** 接口前缀-个人服务器*/ {
+        return "http://192.168.23.238:8820"
+    }else if kDevelopSever /** 接口前缀-开发服务器*/ {
+        return "alpha-\(userId)"
+    } else if kBetaSever /** 接口前缀-测试服务器*/{
+        return "beta-\(userId)"
+    }else if kProductSever /** 接口前缀-生产服务器*/ {
+        return "production-\(userId)"
+    }else {
+        return ""
+    }
+}
+
 
 /// 头部类型
 ///

+ 9 - 0
RainbowPlanet/RainbowPlanet/Tools/Extension/Extension+Date.swift

@@ -47,6 +47,15 @@ extension Date {
         return timeStamp
     }
     
+    /// 当前时间的时间戳
+    ///
+    /// - Returns: 时间戳
+    static func timeStamp() -> Int64 {
+        let timeInterval : TimeInterval = Date().timeIntervalSince1970
+        let timeStamp = timeInterval
+        return Int64(timeStamp)
+    }
+    
     /// 时间戳转时间
     ///
     /// - Parameter timeStamp: 时间戳

+ 7 - 0
RainbowPlanet/RainbowPlanet/Tools/Extension/Extension+String.swift

@@ -71,6 +71,13 @@ extension String {
         return String(self[st ..< en])
     }
     
+    func indexOf(key:String) -> Int {
+        if !self.contains(key) {return -1 }
+        guard let range : Range<String.Index> = self.range(of: key) else { return -1 }
+        let index = range.lowerBound.utf16Offset(in: key)
+        return index
+    }
+    
     /// 十六进制的字符串转成数字
     ///
     /// - Returns: 数字