14 Commits fa7f978629 ... f4dd24a094

Auteur SHA1 Message Date
  南鑫林 f4dd24a094 1 il y a 5 ans
  南鑫林 175f26d432 no message il y a 5 ans
  南鑫林 eb59afa6e3 1.4.0 il y a 5 ans
  南鑫林 9c7ce2444f no message il y a 5 ans
  南鑫林 53b753c5e3 no message il y a 5 ans
  南鑫林 e288356d83 no message il y a 5 ans
  南鑫林 77669fdf42 1.4.0 il y a 5 ans
  南鑫林 de91b8d62d no message il y a 5 ans
  南鑫林 ff6713a735 no message il y a 5 ans
  南鑫林 17b52adfc5 修复tabbar il y a 5 ans
  南鑫林 f809282ec7 no message il y a 5 ans
  南鑫林 7cf06f03b4 更新数据 il y a 5 ans
  南鑫林 9174f6897d 消息列表置顶完成 il y a 5 ans
  南鑫林 45d25cd4ef 列表完 il y a 5 ans
71 fichiers modifiés avec 3073 ajouts et 671 suppressions
  1. 1 1
      RainbowPlanet/NotificationService/Info.plist
  2. 9 14
      RainbowPlanet/Podfile
  3. 19 23
      RainbowPlanet/Podfile.lock
  4. 163 27
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  5. 5 1
      RainbowPlanet/RainbowPlanet.xcodeproj/xcshareddata/xcschemes/RainbowPlanet.xcscheme
  6. 7 6
      RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate+Window.swift
  7. 1 1
      RainbowPlanet/RainbowPlanet/Base/BaseNavigationController/BaseNavigationViewController.swift
  8. 0 72
      RainbowPlanet/RainbowPlanet/Base/BaseTabbarViewController/BaseLottieAnimateContentView.swift
  9. 0 28
      RainbowPlanet/RainbowPlanet/Base/BaseTabbarViewController/BaseTabBarItemContentView.swift
  10. 75 153
      RainbowPlanet/RainbowPlanet/Base/BaseTabbarViewController/BaseTabbarViewController.swift
  11. 6 6
      RainbowPlanet/RainbowPlanet/Manager/MJRefreshManager/MJRefreshManager.swift
  12. 2 3
      RainbowPlanet/RainbowPlanet/Manager/RegisterLoginManager/RegisterLoginManager.swift
  13. 21 3
      RainbowPlanet/RainbowPlanet/Manager/RongCloudIMManager/RongCloudIMManager.swift
  14. 5 5
      RainbowPlanet/RainbowPlanet/Manager/WebViewJavascriptBridgeManager/WebViewJavascriptBridgeManager.swift
  15. 39 0
      RainbowPlanet/RainbowPlanet/Model/RongCloudIMModel/ConversationModel.swift
  16. 1 1
      RainbowPlanet/RainbowPlanet/Modules/CircleModule/CircleAlbum/ViewController/CircleAlbumViewController.swift
  17. 1 1
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/CommunityNavigationBarView.swift
  18. 3 3
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Follow/CommunityFollowViewController.swift
  19. 1 0
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Main/CommunityViewController.swift
  20. 2 2
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Recommend/CommunityRecommnendViewController.swift
  21. 1 1
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/ViewController/CommunityVideoListController.swift
  22. 193 0
      RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageMain/View/MessageHomeOneSectionTableViewCell.swift
  23. 85 0
      RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageMain/View/MessageHomeThreeSectionTableViewCell.swift
  24. 21 19
      RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageMain/View/MessageHomeTwoCollectionViewCell.swift
  25. 169 152
      RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageMain/ViewController/MessageMainViewController.swift
  26. 6 2
      RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/OtherPersonalCenter/ViewController/OtherPersonalCenterViewController.swift
  27. 33 0
      RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/PersonalCenterView/PersonViewUserAndOtherHeaderView.swift
  28. 0 1
      RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/UserPersonalCenter/ViewController/UserPersonalCenterViewController.swift
  29. 1 1
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEdit/Controller/PublishEditController.swift
  30. 1 1
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishArticle/ViewController/PublishArticleViewController.swift
  31. 1 1
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishEditContent/ViewController/PublishEditVideoContentViewController.swift
  32. 1 1
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishManager/PublishManagerUploadView.swift
  33. 149 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/NXLPhotoPicker/NXLAssetsCollection.swift
  34. 322 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/NXLPhotoPicker/NXLPHAsset.swift
  35. 342 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/NXLPhotoPicker/NXLPhotoLibrary.swift
  36. 97 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/NXLPhotoPicker/NXLPhotoPickerConfigure.swift
  37. 131 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/PublishNewAlbumCollocationTableView/PublishNewAlbumCollocationView.swift
  38. 108 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/PublishNewAlbumCollocationTableView/PublishNewAlbumTableView.swift
  39. 76 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/PublishNewAlbumCollocationTableView/PublishNewAlbumTableViewCell.swift
  40. 77 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/PublishNewAlbumNavigationBarView.swift
  41. 17 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/PublishNewAlbumPreView.swift
  42. 189 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/PublishNewAlbumView.swift
  43. 0 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewVideoPhotoView/PublishNewRecorderPreview.swift
  44. 0 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewVideoPhotoView/PublishNewVideoPhotoSetView.swift
  45. 0 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewVideoPhotoView/PublishNewVideoPhotoView.swift
  46. 22 3
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/ViewController/PublishNewViewController.swift
  47. 1 1
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNewCommonView/PublishNewMusicListView/PublishNewMusicListView.swift
  48. 3 3
      RainbowPlanet/RainbowPlanet/Modules/RedemptionAreaModule/RedemptionArea/ViewController/RedemptionAreaViewController.swift
  49. 2 2
      RainbowPlanet/RainbowPlanet/Modules/RegisterLoginModule/LoginNow/LoginNowView.swift
  50. 164 0
      RainbowPlanet/RainbowPlanet/Modules/RongCloudIMModule/IMChatPrivate/ViewController/IMChatPrivateViewController.swift
  51. 163 0
      RainbowPlanet/RainbowPlanet/Modules/RongCloudIMModule/IMChatPrivateSet/View/IMChatPrivateSetOneTableViewCell.swift
  52. 67 0
      RainbowPlanet/RainbowPlanet/Modules/RongCloudIMModule/IMChatPrivateSet/View/IMChatPrivateSetTwoTableViewCell.swift
  53. 131 0
      RainbowPlanet/RainbowPlanet/Modules/RongCloudIMModule/IMChatPrivateSet/ViewController/IMChatPrivateSetViewController.swift
  54. 9 5
      RainbowPlanet/RainbowPlanet/Modules/RongCloudIMModule/IMChatRoom/ViewController/IMChatRoomViewController.swift
  55. 1 1
      RainbowPlanet/RainbowPlanet/Modules/SearchModule/SearchContentList/ViewController/SearchContentListViewController.swift
  56. 6 0
      RainbowPlanet/RainbowPlanet/Router/RongCloudIMRouterModuleType.swift
  57. 2 2
      RainbowPlanet/RainbowPlanet/Router/RouterManager.swift
  58. 19 4
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceManger/SwiftMoyaNetWorkManager/ApiMacro.swift
  59. 1 1
      RainbowPlanet/RainbowPlanet/Supporting Files/Info.plist
  60. 6 0
      RainbowPlanet/RainbowPlanet/Tools/Extension/Extension+Array.swift
  61. 9 0
      RainbowPlanet/RainbowPlanet/Tools/Extension/Extension+Date.swift
  62. 19 0
      RainbowPlanet/RainbowPlanet/Tools/Extension/Extension+PHFetchOptions.swift
  63. 7 0
      RainbowPlanet/RainbowPlanet/Tools/Extension/Extension+String.swift
  64. 15 0
      RainbowPlanet/RainbowPlanet/Tools/Extension/Extension+UIImage.swift
  65. 2 2
      RainbowPlanet/RainbowPlanet/Tools/MJRefreshEX/MJDIYFullScreenHeader.swift
  66. 2 2
      RainbowPlanet/RainbowPlanet/Tools/MJRefreshEX/MJDIYHeader.swift
  67. 0 25
      RainbowPlanet/RainbowPlanet/Tools/TLPhotoPicker/TLAssetCollection+Extension.swift
  68. 0 21
      RainbowPlanet/RainbowPlanet/Tools/TLPhotoPicker/TLAssetsCollection.swift
  69. 0 10
      RainbowPlanet/RainbowPlanet/Tools/TLPhotoPicker/TLPhotoLibrary.swift
  70. 0 19
      RainbowPlanet/RainbowPlanet/Tools/TLPhotoPicker/TLPhotosPickerViewController.swift
  71. 41 41
      RainbowPlanet/RainbowPlanet/Tools/WRNavigationBar/WRNavigationBar.swift

+ 1 - 1
RainbowPlanet/NotificationService/Info.plist

@@ -17,7 +17,7 @@
 	<key>CFBundlePackageType</key>
 	<string>XPC!</string>
 	<key>CFBundleShortVersionString</key>
-	<string>1.3.1</string>
+	<string>$(MARKETING_VERSION)</string>
 	<key>CFBundleVersion</key>
 	<string>19</string>
 	<key>NSAppTransportSecurity</key>

+ 9 - 14
RainbowPlanet/Podfile

@@ -58,15 +58,15 @@ target 'RainbowPlanet' do
   # 上下滚动的Label
   pod 'DPScrollNumberLabel'
   # TabBarController
-  pod 'ESTabBarController-swift'
+#  pod 'ESTabBarController-swift'
   # 日期选择器
   pod 'PGDatePicker'
   # 生成二维码
   pod 'EFQRCode'
-  
+
   # Label扩展
   pod 'YYText'
-  
+
   pod 'AFNetworking', '~> 3.0'
   pod 'JSONModel','~> 1.7.0'
   pod 'ZipArchive','1.4.0'
@@ -75,8 +75,8 @@ target 'RainbowPlanet' do
   # 内存泄露
   #  pod 'MLeaksFinder'
   #  pod 'FBMemoryProfiler'
-  
-  
+
+
   #======================第三方平台===========
   #======================友盟===========
   # UM基础库
@@ -96,33 +96,28 @@ target 'RainbowPlanet' do
   pod 'UMCShare/Social/ReducedQQ'
   # 集成新浪微博(精简版1M)
   pod 'UMCShare/Social/ReducedSina'
-  
+
   #=====================百度地图===========
   # 百度地图定位SDK
   pod 'BMKLocationKit', '1.5.0'
   # 百度地图SDK
   pod 'BaiduMapKit'
-  
+
   #=====================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

+ 19 - 23
RainbowPlanet/Podfile.lock

@@ -15,15 +15,15 @@ PODS:
   - AFNetworking/UIKit (3.2.1):
     - AFNetworking/NSURLSession
   - Alamofire (4.9.1)
-  - AliPlayerPartSDK_iOS (4.7.1):
-    - AliPlayerPartSDK_iOS/AliPlayerPartSDK (= 4.7.1)
-  - AliPlayerPartSDK_iOS/AliPlayerPartSDK (4.7.1)
+  - AliPlayerPartSDK_iOS (4.7.2):
+    - AliPlayerPartSDK_iOS/AliPlayerPartSDK (= 4.7.2)
+  - AliPlayerPartSDK_iOS/AliPlayerPartSDK (4.7.2)
   - AlivcConan (1.0.0):
     - AlivcConan/AlivcConan (= 1.0.0)
   - AlivcConan/AlivcConan (1.0.0)
   - AliyunOSSiOS (2.10.7)
   - AliyunVideoSDKPro (3.12.0)
-  - BaiduMapKit (5.0.0)
+  - BaiduMapKit (5.1.0)
   - BMKLocationKit (1.5.0)
   - Cache (5.2.0)
   - DeviceKit (2.3.0)
@@ -36,27 +36,26 @@ PODS:
     - EFQRCode/Core (= 5.1.3)
   - EFQRCode/Core (5.1.3):
     - EFFoundation (>= 1.1.1)
-  - ESTabBarController-swift (2.7)
   - FMDB (2.7.5):
     - FMDB/standard (= 2.7.5)
   - FMDB/standard (2.7.5)
   - FSPagerView (0.8.3)
-  - FWPopupView (4.0.8):
+  - FWPopupView (4.0.9):
     - SnapKit
   - InputBarAccessoryView (4.3.1):
     - InputBarAccessoryView/Core (= 4.3.1)
   - InputBarAccessoryView/Core (4.3.1)
   - IQKeyboardManagerSwift (6.5.2)
   - JSONModel (1.7.0)
-  - JXPagingView/Paging (1.1.18)
-  - JXSegmentedView (1.0.0)
-  - KeychainAccess (4.0.0)
+  - JXPagingView/Paging (1.1.19)
+  - JXSegmentedView (1.0.2)
+  - KeychainAccess (4.1.0)
   - Kingfisher (5.7.1)
-  - lottie-ios (3.1.3)
+  - lottie-ios (3.1.5)
   - LYEmptyView (1.3.1)
   - Masonry (1.1.0)
   - MBProgressHUD (1.1.0)
-  - MJRefresh (3.2.0)
+  - MJRefresh (3.2.2)
   - Moya/Core (13.0.1):
     - Alamofire (~> 4.1)
     - Result (~> 4.1)
@@ -120,7 +119,6 @@ DEPENDENCIES:
   - DeviceKit
   - DPScrollNumberLabel
   - EFQRCode
-  - ESTabBarController-swift
   - FMDB
   - FSPagerView
   - FWPopupView
@@ -177,7 +175,6 @@ SPEC REPOS:
     - DPScrollNumberLabel
     - EFFoundation
     - EFQRCode
-    - ESTabBarController-swift
     - FMDB
     - FSPagerView
     - FWPopupView
@@ -220,33 +217,32 @@ SPEC REPOS:
 SPEC CHECKSUMS:
   AFNetworking: b6f891fdfaed196b46c7a83cf209e09697b94057
   Alamofire: 85e8a02c69d6020a0d734f6054870d7ecb75cf18
-  AliPlayerPartSDK_iOS: b7acc7cf47271f67a4eed38185438371e382b749
+  AliPlayerPartSDK_iOS: 812f1b73d2f1bbdf08e1186df1e164956257dfbb
   AlivcConan: 3e339a2bc6ce11e47c20ff4f2bd9c0a0dd90ebc8
   AliyunOSSiOS: 602b6a4e70e62a5f0a6431c20496343141d7e66f
   AliyunVideoSDKPro: 3f19f021ab48fbc41ac667a08322a506950281de
-  BaiduMapKit: 3a875b001293a9ee6692febd549d8bf82108dbac
+  BaiduMapKit: be03d7c0d625e2106ba04691e4be45f71f8dee7f
   BMKLocationKit: 40d267478acd8704ddebd0e9deaddc727b13df9f
   Cache: 807c5d86d01a177f06ede9865add3aea269bbfd4
   DeviceKit: da103891aa928d89f64ea8dd8aca738c5f3d8ac0
   DPScrollNumberLabel: 5124eaccf3029bb84116de391e1273cba676f4f5
   EFFoundation: 26a2731ace3e22cf5f7bb45d28c6afbc945959dd
   EFQRCode: 0979a5c181864085ca7f317b5b5c7b5bf496ad0e
-  ESTabBarController-swift: 4fb52ad03d94d0717ef97bc9eb09a5abfdded0a2
   FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
   FSPagerView: 670405b2f18e2a87fa37f20b00de783e562c25a8
-  FWPopupView: 8357f7ab0185e1dcaaf888fbc8ee81ab8dccab72
+  FWPopupView: 94c091c5352cc557cc5e1bff127c02a027059e38
   InputBarAccessoryView: 58a348be7ea2736c7eec60e5c315511c2dbb39fd
   IQKeyboardManagerSwift: c75366f1f19590e8caeae45fcd5815c9289d6099
   JSONModel: 840bc0fcffb24b8454d2c026bf26fea454b8e98d
-  JXPagingView: 34bc70f962404e1a0b092ef643e5ccf6882119b2
-  JXSegmentedView: 257773dde0c65f86c9d873c5cf93d15c76e170cc
-  KeychainAccess: 57ce5b7653644c49749d35e840bf4e63dbde82f3
+  JXPagingView: d28c0e245b850cdb47e3f04c07d8c35e30c18531
+  JXSegmentedView: 2988fe07060a9b91b0112eabd6dee0df0cbca8b3
+  KeychainAccess: 445e28864fe6d3458b41fa211bcdc39890e8bd5a
   Kingfisher: 176d377ad339113c99ad4980cbae687f807e20fe
-  lottie-ios: 496ac5cea1bbf1a7bd1f1f472f3232eb1b8d744b
+  lottie-ios: 32bf84389337d86fbc8b12266e88452e0abf1dee
   LYEmptyView: b6d418cfa38b78df0cf243f9a9c25ccbdc399922
   Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
   MBProgressHUD: e7baa36a220447d8aeb12769bf0585582f3866d9
-  MJRefresh: ed450d6eb9d3346a2cb033ab7eb6de090aeef437
+  MJRefresh: 72a46ecaa2a0feaf48fc5198dff95f25f8bb27c6
   Moya: f4a4b80ff2f8a4ffc208dfb31cd91636622fee6e
   ObjectMapper: 70187b8941977c62ccfb423caf6b50be405cabf0
   PGDatePicker: 88960f3760edac96219c10320f25536ad31d0f44
@@ -271,6 +267,6 @@ SPEC CHECKSUMS:
   YYText: 5c461d709e24d55a182d1441c41dc639a18a4849
   ZipArchive: e25a4373192673e3229ac8d6e9f64a3e5713c966
 
-PODFILE CHECKSUM: b27e2ccae0be82e0a4ac1b5a2293ef59c10e73c5
+PODFILE CHECKSUM: 04cf48f67a5c94b9e4d561732d82e9818fee09bb
 
 COCOAPODS: 1.8.4

+ 163 - 27
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 */; };
@@ -335,7 +343,6 @@
 		A784F2CC23547C9600E49140 /* CommunityCircleModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A784F2CB23547C9600E49140 /* CommunityCircleModel.swift */; };
 		A78A5F7622FAA03800DD1764 /* share_iSpt.gif in Resources */ = {isa = PBXBuildFile; fileRef = A78A5F7522FAA03800DD1764 /* share_iSpt.gif */; };
 		A78A5F7822FAC7F000DD1764 /* SetGenderModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A78A5F7722FAC7F000DD1764 /* SetGenderModel.swift */; };
-		A78CEE0A22E0864100C512A4 /* BaseLottieAnimateContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A78CEE0922E0864100C512A4 /* BaseLottieAnimateContentView.swift */; };
 		A79057022276C9770037F823 /* SetPasswordModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A79057012276C9770037F823 /* SetPasswordModel.swift */; };
 		A79057062276EA3D0037F823 /* OpenCityListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A79057052276EA3D0037F823 /* OpenCityListModel.swift */; };
 		A790705B22B9B680008CE279 /* ModifyDataViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A790705A22B9B680008CE279 /* ModifyDataViewController.swift */; };
@@ -401,6 +408,17 @@
 		A7C2568022CD9D8E00420828 /* RecommendSimilarHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C2567F22CD9D8E00420828 /* RecommendSimilarHeaderView.swift */; };
 		A7C3DD1A226422BF00FA262E /* SwiftMoyaServiceSMSApi.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C3DD19226422BF00FA262E /* SwiftMoyaServiceSMSApi.swift */; };
 		A7C3DD1C226422D200FA262E /* SwiftMoyaNetWorkServiceSMS.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C3DD1B226422D200FA262E /* SwiftMoyaNetWorkServiceSMS.swift */; };
+		A7CA33FB2383888F009B0C40 /* PublishNewAlbumTableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7CA33FA2383888F009B0C40 /* PublishNewAlbumTableView.swift */; };
+		A7CA33FE238398DB009B0C40 /* NXLPhotoLibrary.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7CA33FD238398DB009B0C40 /* NXLPhotoLibrary.swift */; };
+		A7CA340023839917009B0C40 /* NXLPHAsset.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7CA33FF23839917009B0C40 /* NXLPHAsset.swift */; };
+		A7CA340223839B28009B0C40 /* NXLAssetsCollection.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7CA340123839B28009B0C40 /* NXLAssetsCollection.swift */; };
+		A7CA34042383C119009B0C40 /* Extension+PHFetchOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7CA34032383C119009B0C40 /* Extension+PHFetchOptions.swift */; };
+		A7CA34062383C1C9009B0C40 /* NXLPhotoPickerConfigure.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7CA34052383C1C9009B0C40 /* NXLPhotoPickerConfigure.swift */; };
+		A7CA34082383ECB1009B0C40 /* PublishNewAlbumTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7CA34072383ECB1009B0C40 /* PublishNewAlbumTableViewCell.swift */; };
+		A7CC19B52382678E0053B4B5 /* PublishNewAlbumView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7CC19B42382678E0053B4B5 /* PublishNewAlbumView.swift */; };
+		A7CC19B8238270940053B4B5 /* PublishNewAlbumNavigationBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7CC19B7238270940053B4B5 /* PublishNewAlbumNavigationBarView.swift */; };
+		A7CC19BA238270D30053B4B5 /* PublishNewAlbumPreView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7CC19B9238270D30053B4B5 /* PublishNewAlbumPreView.swift */; };
+		A7CC19BC238271080053B4B5 /* PublishNewAlbumCollocationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7CC19BB238271080053B4B5 /* PublishNewAlbumCollocationView.swift */; };
 		A7CC74DE22703B4A003C4F38 /* MineModule.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A7CC74DD22703B4A003C4F38 /* MineModule.xcassets */; };
 		A7CC74E62270628B003C4F38 /* DeliveryMethodTypeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7CC74E52270628B003C4F38 /* DeliveryMethodTypeModel.swift */; };
 		A7CC7516227161D5003C4F38 /* SetViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7CC7515227161D5003C4F38 /* SetViewController.swift */; };
@@ -456,7 +474,6 @@
 		A7DAB33522D8D3AC005B964E /* RegisterLoginRouterModuleType.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DAB33422D8D3AC005B964E /* RegisterLoginRouterModuleType.swift */; };
 		A7DAB33922DC2B83005B964E /* ShareRouterModuleType.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DAB33822DC2B83005B964E /* ShareRouterModuleType.swift */; };
 		A7DC467F22783A47001F3EFC /* EditExpressAddressTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DC467E22783A47001F3EFC /* EditExpressAddressTableViewCell.swift */; };
-		A7DC8EC122EF1C82004EEBE9 /* BaseTabBarItemContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DC8EC022EF1C82004EEBE9 /* BaseTabBarItemContentView.swift */; };
 		A7DE18CD2379100A00D9D72E /* PublishEditVideoCoverImageTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DE18CC2379100A00D9D72E /* PublishEditVideoCoverImageTableViewCell.swift */; };
 		A7DE18D023793DFA00D9D72E /* PublishNewEditTopicViewTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DE18CF23793DFA00D9D72E /* PublishNewEditTopicViewTableViewCell.swift */; };
 		A7DE18D423794DD000D9D72E /* PublishNewEditLocationTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DE18D323794DD000D9D72E /* PublishNewEditLocationTableViewCell.swift */; };
@@ -646,7 +663,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 +832,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 +1006,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 +1062,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>"; };
@@ -1109,7 +1133,6 @@
 		A784F2CB23547C9600E49140 /* CommunityCircleModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommunityCircleModel.swift; sourceTree = "<group>"; };
 		A78A5F7522FAA03800DD1764 /* share_iSpt.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = share_iSpt.gif; sourceTree = "<group>"; };
 		A78A5F7722FAC7F000DD1764 /* SetGenderModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SetGenderModel.swift; sourceTree = "<group>"; };
-		A78CEE0922E0864100C512A4 /* BaseLottieAnimateContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseLottieAnimateContentView.swift; sourceTree = "<group>"; };
 		A79057012276C9770037F823 /* SetPasswordModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SetPasswordModel.swift; sourceTree = "<group>"; };
 		A79057052276EA3D0037F823 /* OpenCityListModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OpenCityListModel.swift; sourceTree = "<group>"; };
 		A790705A22B9B680008CE279 /* ModifyDataViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModifyDataViewController.swift; sourceTree = "<group>"; };
@@ -1180,6 +1203,17 @@
 		A7C2567F22CD9D8E00420828 /* RecommendSimilarHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecommendSimilarHeaderView.swift; sourceTree = "<group>"; };
 		A7C3DD19226422BF00FA262E /* SwiftMoyaServiceSMSApi.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftMoyaServiceSMSApi.swift; sourceTree = "<group>"; };
 		A7C3DD1B226422D200FA262E /* SwiftMoyaNetWorkServiceSMS.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftMoyaNetWorkServiceSMS.swift; sourceTree = "<group>"; };
+		A7CA33FA2383888F009B0C40 /* PublishNewAlbumTableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishNewAlbumTableView.swift; sourceTree = "<group>"; };
+		A7CA33FD238398DB009B0C40 /* NXLPhotoLibrary.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NXLPhotoLibrary.swift; sourceTree = "<group>"; };
+		A7CA33FF23839917009B0C40 /* NXLPHAsset.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NXLPHAsset.swift; sourceTree = "<group>"; };
+		A7CA340123839B28009B0C40 /* NXLAssetsCollection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NXLAssetsCollection.swift; sourceTree = "<group>"; };
+		A7CA34032383C119009B0C40 /* Extension+PHFetchOptions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Extension+PHFetchOptions.swift"; sourceTree = "<group>"; };
+		A7CA34052383C1C9009B0C40 /* NXLPhotoPickerConfigure.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NXLPhotoPickerConfigure.swift; sourceTree = "<group>"; };
+		A7CA34072383ECB1009B0C40 /* PublishNewAlbumTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishNewAlbumTableViewCell.swift; sourceTree = "<group>"; };
+		A7CC19B42382678E0053B4B5 /* PublishNewAlbumView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishNewAlbumView.swift; sourceTree = "<group>"; };
+		A7CC19B7238270940053B4B5 /* PublishNewAlbumNavigationBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishNewAlbumNavigationBarView.swift; sourceTree = "<group>"; };
+		A7CC19B9238270D30053B4B5 /* PublishNewAlbumPreView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishNewAlbumPreView.swift; sourceTree = "<group>"; };
+		A7CC19BB238271080053B4B5 /* PublishNewAlbumCollocationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishNewAlbumCollocationView.swift; sourceTree = "<group>"; };
 		A7CC74DD22703B4A003C4F38 /* MineModule.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = MineModule.xcassets; sourceTree = "<group>"; };
 		A7CC74E52270628B003C4F38 /* DeliveryMethodTypeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeliveryMethodTypeModel.swift; sourceTree = "<group>"; };
 		A7CC7515227161D5003C4F38 /* SetViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SetViewController.swift; sourceTree = "<group>"; };
@@ -1235,7 +1269,6 @@
 		A7DAB33422D8D3AC005B964E /* RegisterLoginRouterModuleType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegisterLoginRouterModuleType.swift; sourceTree = "<group>"; };
 		A7DAB33822DC2B83005B964E /* ShareRouterModuleType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareRouterModuleType.swift; sourceTree = "<group>"; };
 		A7DC467E22783A47001F3EFC /* EditExpressAddressTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditExpressAddressTableViewCell.swift; sourceTree = "<group>"; };
-		A7DC8EC022EF1C82004EEBE9 /* BaseTabBarItemContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseTabBarItemContentView.swift; sourceTree = "<group>"; };
 		A7DE18CC2379100A00D9D72E /* PublishEditVideoCoverImageTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishEditVideoCoverImageTableViewCell.swift; sourceTree = "<group>"; };
 		A7DE18CF23793DFA00D9D72E /* PublishNewEditTopicViewTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishNewEditTopicViewTableViewCell.swift; sourceTree = "<group>"; };
 		A7DE18D323794DD000D9D72E /* PublishNewEditLocationTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishNewEditLocationTableViewCell.swift; sourceTree = "<group>"; };
@@ -1444,7 +1477,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>"; };
@@ -2307,6 +2339,7 @@
 				A72A729222321DE000B21995 /* Extension+String.swift */,
 				A72A728E22321DE000B21995 /* Extension+NSRange.swift */,
 				A72A729122321DE000B21995 /* Extension+Array.swift */,
+				A7CA34032383C119009B0C40 /* Extension+PHFetchOptions.swift */,
 				A72A729022321DE000B21995 /* Extension+UserDefaults.swift */,
 				A72A729D22321DE000B21995 /* Extension+Date.swift */,
 				A72A729E22321DE000B21995 /* Extension+CAGradientLayer.swift */,
@@ -2388,6 +2421,7 @@
 		A738D203225AEAD000EEE860 /* Model */ = {
 			isa = PBXGroup;
 			children = (
+				A763DFFB237CF80800B2ADBF /* RongCloudIMModel */,
 				A73A56D122DC598F004920FE /* PushModel */,
 				A770E5DE22CEDF5700CBD0A4 /* OpenAppModel */,
 				A72A73722233966800B21995 /* RootModel */,
@@ -2473,6 +2507,8 @@
 		A74144AD233076D10062FB6F /* RongCloudIMModule */ = {
 			isa = PBXGroup;
 			children = (
+				A77D020A237BD699001980BA /* IMChatPrivateSet */,
+				A77D0206237BD17A001980BA /* IMChatPrivate */,
 				A7F304B323331A4500A4850F /* IMChatRoom */,
 			);
 			path = RongCloudIMModule;
@@ -2855,6 +2891,14 @@
 			path = Video;
 			sourceTree = "<group>";
 		};
+		A763DFFB237CF80800B2ADBF /* RongCloudIMModel */ = {
+			isa = PBXGroup;
+			children = (
+				A763DFFC237CF82C00B2ADBF /* ConversationModel.swift */,
+			);
+			path = RongCloudIMModel;
+			sourceTree = "<group>";
+		};
 		A76893942339C26900819EC3 /* StartupPageView */ = {
 			isa = PBXGroup;
 			children = (
@@ -3123,6 +3167,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 = (
@@ -3211,8 +3297,6 @@
 			isa = PBXGroup;
 			children = (
 				A77F2CC9223209F2001BD3F6 /* BaseTabbarViewController.swift */,
-				A78CEE0922E0864100C512A4 /* BaseLottieAnimateContentView.swift */,
-				A7DC8EC022EF1C82004EEBE9 /* BaseTabBarItemContentView.swift */,
 			);
 			path = BaseTabbarViewController;
 			sourceTree = "<group>";
@@ -4008,6 +4092,39 @@
 			path = SwiftMoyaServiceSMS;
 			sourceTree = "<group>";
 		};
+		A7CA33F923838354009B0C40 /* PublishNewAlbumCollocationTableView */ = {
+			isa = PBXGroup;
+			children = (
+				A7CC19BB238271080053B4B5 /* PublishNewAlbumCollocationView.swift */,
+				A7CA33FA2383888F009B0C40 /* PublishNewAlbumTableView.swift */,
+				A7CA34072383ECB1009B0C40 /* PublishNewAlbumTableViewCell.swift */,
+			);
+			path = PublishNewAlbumCollocationTableView;
+			sourceTree = "<group>";
+		};
+		A7CA33FC23839880009B0C40 /* NXLPhotoPicker */ = {
+			isa = PBXGroup;
+			children = (
+				A7CA33FD238398DB009B0C40 /* NXLPhotoLibrary.swift */,
+				A7CA33FF23839917009B0C40 /* NXLPHAsset.swift */,
+				A7CA340123839B28009B0C40 /* NXLAssetsCollection.swift */,
+				A7CA34052383C1C9009B0C40 /* NXLPhotoPickerConfigure.swift */,
+			);
+			path = NXLPhotoPicker;
+			sourceTree = "<group>";
+		};
+		A7CC19B623826FC60053B4B5 /* PublishNewAlbumView */ = {
+			isa = PBXGroup;
+			children = (
+				A7CC19B42382678E0053B4B5 /* PublishNewAlbumView.swift */,
+				A7CC19B7238270940053B4B5 /* PublishNewAlbumNavigationBarView.swift */,
+				A7CC19B9238270D30053B4B5 /* PublishNewAlbumPreView.swift */,
+				A7CA33F923838354009B0C40 /* PublishNewAlbumCollocationTableView */,
+				A7CA33FC23839880009B0C40 /* NXLPhotoPicker */,
+			);
+			path = PublishNewAlbumView;
+			sourceTree = "<group>";
+		};
 		A7CC751222716194003C4F38 /* Set */ = {
 			isa = PBXGroup;
 			children = (
@@ -4666,7 +4783,8 @@
 		A7EE5AC8236C131C00309931 /* View */ = {
 			isa = PBXGroup;
 			children = (
-				A7EE5ACD236C131C00309931 /* PublishNewView */,
+				A7CC19B623826FC60053B4B5 /* PublishNewAlbumView */,
+				A7EE5ACD236C131C00309931 /* PublishNewVideoPhotoView */,
 				A7EE5AC9236C131C00309931 /* PublishNewProgress */,
 				A7EE5ACB236C131C00309931 /* PublishNewPopView */,
 				A7EE5AD1236C131C00309931 /* PublishNewMusicView */,
@@ -4692,14 +4810,14 @@
 			path = PublishNewPopView;
 			sourceTree = "<group>";
 		};
-		A7EE5ACD236C131C00309931 /* PublishNewView */ = {
+		A7EE5ACD236C131C00309931 /* PublishNewVideoPhotoView */ = {
 			isa = PBXGroup;
 			children = (
 				A7EE5AD0236C131C00309931 /* PublishNewVideoPhotoView.swift */,
 				A7EE5ACE236C131C00309931 /* PublishNewRecorderPreview.swift */,
 				A7EE5ACF236C131C00309931 /* PublishNewVideoPhotoSetView.swift */,
 			);
-			path = PublishNewView;
+			path = PublishNewVideoPhotoView;
 			sourceTree = "<group>";
 		};
 		A7EE5AD1236C131C00309931 /* PublishNewMusicView */ = {
@@ -5642,7 +5760,7 @@
 		BD3AA45622AE63B800EF4F20 /* ViewController */ = {
 			isa = PBXGroup;
 			children = (
-				BD3AA45722AE63EC00EF4F20 /* MessageMainViewController.swift */,
+				A763DFF9237CEB0700B2ADBF /* MessageMainViewController.swift */,
 			);
 			path = ViewController;
 			sourceTree = "<group>";
@@ -5650,8 +5768,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>";
@@ -6052,8 +6172,8 @@
 				A77F2C5A2231FB49001BD3F6 /* Frameworks */,
 				A77F2C5B2231FB49001BD3F6 /* Resources */,
 				A74D9D5F2327B54100F05C14 /* Embed App Extensions */,
-				5255517EC082CDBDA16A6A75 /* [CP] Embed Pods Frameworks */,
-				633D32F14EB76DCDC1DC9853 /* [CP] Copy Pods Resources */,
+				4BAE8F1C0261EFD89B7C6205 /* [CP] Embed Pods Frameworks */,
+				C50BFE7850FCD104573727C9 /* [CP] Copy Pods Resources */,
 			);
 			buildRules = (
 			);
@@ -6235,7 +6355,7 @@
 /* End PBXResourcesBuildPhase section */
 
 /* Begin PBXShellScriptBuildPhase section */
-		5255517EC082CDBDA16A6A75 /* [CP] Embed Pods Frameworks */ = {
+		4BAE8F1C0261EFD89B7C6205 /* [CP] Embed Pods Frameworks */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
@@ -6252,7 +6372,7 @@
 			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RainbowPlanet/Pods-RainbowPlanet-frameworks.sh\"\n";
 			showEnvVarsInLog = 0;
 		};
-		633D32F14EB76DCDC1DC9853 /* [CP] Copy Pods Resources */ = {
+		C50BFE7850FCD104573727C9 /* [CP] Copy Pods Resources */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
@@ -6353,6 +6473,7 @@
 				BD13B6DB22BA03BC008BB323 /* PublishAddressPOIView.swift in Sources */,
 				A72A72BE22321DE000B21995 /* Extension+RxTimer.swift in Sources */,
 				BD61225F22C3561C00D3F513 /* AliyunMagicCameraView.m in Sources */,
+				A7CC19B52382678E0053B4B5 /* PublishNewAlbumView.swift in Sources */,
 				A770E61422D6625700CBD0A4 /* ShareCommunityView.swift in Sources */,
 				A7F2D6CB22B0E4270093000B /* CommunityRecommendFollowCollectionViewCell.swift in Sources */,
 				BD108C9522A60C2100837DAB /* HGImageCollectionViewCell.swift in Sources */,
@@ -6370,6 +6491,8 @@
 				BD6122F822C36A8100D3F513 /* AVAsset+VideoInfo.m in Sources */,
 				BD61226022C3561C00D3F513 /* AliyunRateSelectView.m in Sources */,
 				A7C0FDF022B6538200BC1E86 /* CommunityBannerFSPagerViewCell.swift in Sources */,
+				A763DFF4237C144400B2ADBF /* MessageHomeOneSectionTableViewCell.swift in Sources */,
+				A7CA34082383ECB1009B0C40 /* PublishNewAlbumTableViewCell.swift in Sources */,
 				A7EE5BD4236C16E100309931 /* SwiftMoyaServiceDownLoadApi.swift in Sources */,
 				BDE376DB22C22A260055E2EA /* UIView+AlivcHelper.m in Sources */,
 				A7DE18D723795A3200D9D72E /* PublishManagerUploadView.swift in Sources */,
@@ -6440,6 +6563,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 +6597,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 */,
@@ -6489,7 +6614,6 @@
 				A72A726822321DBD00B21995 /* UMManager.swift in Sources */,
 				A747D80C2359C2BE007F4E33 /* ConfigOSSStsModel.swift in Sources */,
 				A70DE55222E7E53F009E06BE /* KeyBoardInputView.swift in Sources */,
-				A78CEE0A22E0864100C512A4 /* BaseLottieAnimateContentView.swift in Sources */,
 				BD108C9322A60C2100837DAB /* HGImageCompleteButton.swift in Sources */,
 				A729B5AD2266FF45004AE098 /* BindPhoneNumberView.swift in Sources */,
 				BD12B67822B4ED9200AEB10B /* KSMediaPickerOutputModel.swift in Sources */,
@@ -6530,11 +6654,13 @@
 				A7AA9F6722C640F10086498B /* CommunityRecommendFeedModel.swift in Sources */,
 				A7824B082271F53A00ABA381 /* EditSetDefaultTableViewCell.swift in Sources */,
 				A7811C98231F503800C2D8DE /* CommunityRecommnendSuperViewController.swift in Sources */,
+				A7CA34042383C119009B0C40 /* Extension+PHFetchOptions.swift in Sources */,
 				A7EE5AEA236C131D00309931 /* PublishNewVideoPhotoSetView.swift in Sources */,
 				A7811C89231ACC3900C2D8DE /* OtherPersonalCenterReportView.swift in Sources */,
 				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 */,
@@ -6545,6 +6671,7 @@
 				A77FAEF6235844BC002A1D08 /* CircleCommentListCommentTableViewCell.swift in Sources */,
 				A7FF1DAA23753A16002B3435 /* PublishEditNewEffectFilterView.swift in Sources */,
 				A7EE5AF2236C131D00309931 /* PublishNewEffectFilterCollectionViewCell.swift in Sources */,
+				A7CA34062383C1C9009B0C40 /* NXLPhotoPickerConfigure.swift in Sources */,
 				A7C0FDF322B65E5400BC1E86 /* FeaturedTopicsTableViewCell.swift in Sources */,
 				A770E61322D6625700CBD0A4 /* ShareCommunityViewCollectionViewCell.swift in Sources */,
 				A7F577D722FED3A100E2D757 /* PathManager.swift in Sources */,
@@ -6565,6 +6692,7 @@
 				A76068E022E43DAC008DF18F /* CardContentUserDeleteView.swift in Sources */,
 				A747D83D235D8046007F4E33 /* CircleAlbumViewController.swift in Sources */,
 				A7B77497236B2E5600BF26F1 /* WKWebView+PAWebCache.m in Sources */,
+				A7CC19BA238270D30053B4B5 /* PublishNewAlbumPreView.swift in Sources */,
 				BD6122BB22C3639E00D3F513 /* AlivcEditIconButton.m in Sources */,
 				A72A72D522321E2700B21995 /* ColorMacro.swift in Sources */,
 				BD0FAA5C22C4C32E00DDFB37 /* AliyunCropViewController.m in Sources */,
@@ -6598,6 +6726,7 @@
 				A7F689002356F2A6000C313F /* CircleUserListTableViewCell.swift in Sources */,
 				A72623D722C26A2A00AEF875 /* MessageListModel.swift in Sources */,
 				A7FF1598228D092A00A85748 /* OrderListModel.swift in Sources */,
+				A7CA340223839B28009B0C40 /* NXLAssetsCollection.swift in Sources */,
 				A76068E222E44D6A008DF18F /* SheetSureView.swift in Sources */,
 				A7C0FDFB22B6672F00BC1E86 /* PopularVideoTableViewCell.swift in Sources */,
 				A797FDEB22C5AC6A0076DCB3 /* CacheManager.swift in Sources */,
@@ -6627,10 +6756,12 @@
 				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 */,
 				A7F2D6CE22B0FF180093000B /* CommunityFollowStatusTableViewCell.swift in Sources */,
+				A7CC19B8238270940053B4B5 /* PublishNewAlbumNavigationBarView.swift in Sources */,
 				BD1FC18A22B0A32100D55081 /* CommunityReplyCommentCell.swift in Sources */,
 				A770E61522D6625700CBD0A4 /* ShareView.swift in Sources */,
 				A7F2D6D722B1ED370093000B /* CardContentUserTableViewCell.swift in Sources */,
@@ -6658,6 +6789,7 @@
 				BD61227822C35C1000D3F513 /* AlivcShortVideoRoute.m in Sources */,
 				A770E60622D64CD700CBD0A4 /* UIScrollView+SwCapture.swift in Sources */,
 				A75414FD224B5F28002480B5 /* MobileLoginViewController.swift in Sources */,
+				A7CC19BC238271080053B4B5 /* PublishNewAlbumCollocationView.swift in Sources */,
 				A7F688F72356AB3B000C313F /* CircleQuestionsAnswersSectionHeader.swift in Sources */,
 				A771F07C226D4E1C007999DB /* AddressPOITableViewCell.swift in Sources */,
 				A72A72AE22321DE000B21995 /* CountdownButton.swift in Sources */,
@@ -6724,7 +6856,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 */,
@@ -6752,6 +6883,7 @@
 				A70E3F30236FF9530039D7FC /* PublishConfirmPhotoNewViewController.swift in Sources */,
 				A76068E722E48DC5008DF18F /* BrowsePictureRouterModuleType.swift in Sources */,
 				A70E3F40236FF9CD0039D7FC /* AliyunVodUpToYoPublishModel.swift in Sources */,
+				A7CA340023839917009B0C40 /* NXLPHAsset.swift in Sources */,
 				BD12B66922B47D4800AEB10B /* RecommendSubCommentTableViewCell.swift in Sources */,
 				A784F2B32350337D00E49140 /* ShareH5LinkView.swift in Sources */,
 				A7931E1822AFC1DF00297D0A /* CommunityFollowViewController.swift in Sources */,
@@ -6785,8 +6917,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,9 +6929,11 @@
 				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 */,
+				A7CA33FE238398DB009B0C40 /* NXLPhotoLibrary.swift in Sources */,
 				A7284A542252FB5C000BAEC4 /* PaginationModel.swift in Sources */,
 				A77BB4672329EF7300DCAE32 /* NXLPermissionContacts.swift in Sources */,
 				A7C2567622CCB38D00420828 /* HeightModel.swift in Sources */,
@@ -6846,6 +6980,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 */,
@@ -6865,6 +7000,7 @@
 				A7DE18E4237A862D00D9D72E /* PublishCoverVideoCollectionViewCell.swift in Sources */,
 				BD01B1FB22BC673A00CE9F36 /* PublishTakePhotoController.swift in Sources */,
 				A7B7748E236AF22300BF26F1 /* NXLWebView.swift in Sources */,
+				A7CA33FB2383888F009B0C40 /* PublishNewAlbumTableView.swift in Sources */,
 				A7D07CCF22B77E0200186014 /* UserPersonalCenterOrderCollectionViewCell.swift in Sources */,
 				BD0808EC22C5BA3100D12E6A /* AliyunCompositionInfo.m in Sources */,
 				A72A72D222321E2700B21995 /* Common.swift in Sources */,
@@ -6924,6 +7060,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 */,
@@ -6957,7 +7094,6 @@
 				A7D07CBF22B73EE600186014 /* UserPersonalCenterViewController.swift in Sources */,
 				BD27F0AD22CC5E4D00A6514D /* CommunityVideoListController.swift in Sources */,
 				A7CC753C2271C177003C4F38 /* AddressManagerSelfMentionTableViewCell.swift in Sources */,
-				A7DC8EC122EF1C82004EEBE9 /* BaseTabBarItemContentView.swift in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -7013,7 +7149,7 @@
 					"@executable_path/Frameworks",
 					"@executable_path/../../Frameworks",
 				);
-				MARKETING_VERSION = 1.0.2;
+				MARKETING_VERSION = 1.4.0;
 				PRODUCT_BUNDLE_IDENTIFIER = com.uptoyo.uptoyo.NotificationService;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";
@@ -7039,7 +7175,7 @@
 					"@executable_path/Frameworks",
 					"@executable_path/../../Frameworks",
 				);
-				MARKETING_VERSION = 1.0.2;
+				MARKETING_VERSION = 1.4.0;
 				PRODUCT_BUNDLE_IDENTIFIER = com.uptoyo.uptoyo.NotificationService;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";
@@ -7200,7 +7336,7 @@
 					"@executable_path/Frameworks",
 				);
 				LIBRARY_SEARCH_PATHS = "$(inherited)";
-				MARKETING_VERSION = 1.0.2;
+				MARKETING_VERSION = 1.4.0;
 				OTHER_CFLAGS = (
 					"$(inherited)",
 					"-isystem",
@@ -7450,7 +7586,7 @@
 					"@executable_path/Frameworks",
 				);
 				LIBRARY_SEARCH_PATHS = "$(inherited)";
-				MARKETING_VERSION = 1.0.2;
+				MARKETING_VERSION = 1.4.0;
 				OTHER_CFLAGS = (
 					"$(inherited)",
 					"-isystem",

+ 5 - 1
RainbowPlanet/RainbowPlanet.xcodeproj/xcshareddata/xcschemes/RainbowPlanet.xcscheme

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
    LastUpgradeVersion = "1120"
-   version = "1.3">
+   version = "1.7">
    <BuildAction
       parallelizeBuildables = "YES"
       buildImplicitDependencies = "YES">
@@ -87,6 +87,10 @@
             isEnabled = "YES">
          </EnvironmentVariable>
       </EnvironmentVariables>
+      <LocationScenarioReference
+         identifier = "com.apple.dt.IDEFoundation.CurrentLocationScenarioIdentifier"
+         referenceType = "1">
+      </LocationScenarioReference>
    </LaunchAction>
    <ProfileAction
       buildConfiguration = "Release"

+ 7 - 6
RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate+Window.swift

@@ -57,8 +57,9 @@ extension AppDelegate {
             if(UserModel.shared().getModel()?.isFollowSuggestTopic == 0 || UserModel.shared().getModel()?.isFollowSuggestTopic == nil ) {//设置性别话题
                 setNoLoginOut()
             }else {
-                window?.rootViewController = BaseTabbarViewController.shared.tabBarViewController()
+                window?.rootViewController = BaseTabbarViewController.shared()
                 setData()
+                LoginNowView.removeLoginNowView()
             }
         }else {// 进入首页
             setNoLoginOut()
@@ -81,7 +82,7 @@ extension AppDelegate {
         // 移除快递信息
         DeliveryMethodTypeModel.shared().removeLoginModel()
         // 设置tabBar
-        self.window?.rootViewController = BaseTabbarViewController.shared.tabBarViewController()
+        self.window?.rootViewController = BaseTabbarViewController.shared()
         //添加登录view
         LoginNowView.initLoginNowView()
     }
@@ -93,10 +94,10 @@ extension AppDelegate {
         // 移除快递信息
         DeliveryMethodTypeModel.shared().removeLoginModel()
         // 选择中index
-        BaseTabbarViewController.shared.setBadge()
+        baseTabbarViewController?.setBadge()
         //添加登录view
         LoginNowView.initLoginNowView()
-        BaseTabbarViewController.shared.esTabBarController.selectedIndex = 0
+        baseTabbarViewController?.selectedIndex = 0
         // 退出登录
         NotificationCenter.default.post(name: NSNotification.Name("loginOut"), object: nil)
     }
@@ -158,8 +159,8 @@ extension AppDelegate {
 //        NXLPermission.request(NXLPermissionType.locationAlwaysAndWhenInUse) {}
 //        NXLPermission.request(NXLPermissionType.notification) {}
         NXLPermission.request(NXLPermissionType.photoLibrary) {}
-        NXLPermission.request(NXLPermissionType.camera) {}
-        NXLPermission.request(NXLPermissionType.microphone) {}
+//        NXLPermission.request(NXLPermissionType.camera) {}
+//        NXLPermission.request(NXLPermissionType.microphone) {}
     }
     
 }

+ 1 - 1
RainbowPlanet/RainbowPlanet/Base/BaseNavigationController/BaseNavigationViewController.swift

@@ -23,5 +23,5 @@ class BaseNavigationViewController: UINavigationController {
         }
         super.pushViewController(viewController, animated: animated)
     }
-
+    
 }

+ 0 - 72
RainbowPlanet/RainbowPlanet/Base/BaseTabbarViewController/BaseLottieAnimateContentView.swift

@@ -1,72 +0,0 @@
-//
-//  BaseLottieAnimateContentView.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/7/18.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import ESTabBarController_swift
-import Lottie
-
-
-class BaseLottieAnimateContentView: ESTabBarItemContentView {
-    
-    let animationView = AnimationView()
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        self.imageView.isHidden = true
-        
-    }
-    
-    init(jsonStr:String) {
-        self.init()
-        
-        textColor = k666666Color
-        iconColor = k333333Color
-        highlightTextColor = k333333Color
-
-        let animation = Animation.named(jsonStr)
-        animationView.animation = animation
-        animationView.contentMode = .scaleAspectFit
-        animationView.loopMode = .playOnce
-        animationView.animationSpeed = 1.5
-        addSubview(animationView)
-
-    }
-    
-    public required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    override func updateLayout() {
-        super.updateLayout()
-        animationView.frame = self.imageView.frame
-        if selected {
-            animationView.isHidden = false
-            self.imageView.isHidden = true
-            animationView.play()
-        }else {
-            animationView.isHidden = true
-            self.imageView.isHidden = false
-            animationView.stop()
-        }
-    }
-    
-    override func selectAnimation(animated: Bool, completion: (() -> ())?) {
-        super.selectAnimation(animated: animated, completion: nil)
-        animationView.isHidden = false
-        self.imageView.isHidden = true
-        animationView.play()
-    }
-    
-    override func deselectAnimation(animated: Bool, completion: (() -> ())?) {
-        super.deselectAnimation(animated: animated, completion: nil)
-        animationView.isHidden = true
-        self.imageView.isHidden = false
-        
-        animationView.stop()
-    }
-    
-
-}

+ 0 - 28
RainbowPlanet/RainbowPlanet/Base/BaseTabbarViewController/BaseTabBarItemContentView.swift

@@ -1,28 +0,0 @@
-//
-//  File.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/7/29.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import Foundation
-
-import UIKit
-import ESTabBarController_swift
-
-
-class BaseTabBarItemContentView: ESTabBarItemContentView {
-    
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        textColor = k666666Color
-        highlightTextColor = k333333Color
-//        iconColor = k333333Color
-    }
-    public required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    
-}

+ 75 - 153
RainbowPlanet/RainbowPlanet/Base/BaseTabbarViewController/BaseTabbarViewController.swift

@@ -1,5 +1,5 @@
 //
-//  BaseTabbarViewController.swift
+//  baseTabbarViewController?.swift
 //  RainbowPlanet
 //
 //  Created by 南鑫林 on 2019/3/8.
@@ -8,20 +8,21 @@
 
 import UIKit
 import Lottie
-import ESTabBarController_swift
 import PPBadgeViewSwift
 import SwiftyMediator
+import RongIMLib
 
-class BaseTabbarViewController: NSObject {
+var baseTabbarViewController : BaseTabbarViewController?
 
-    static let shared : BaseTabbarViewController = BaseTabbarViewController()
+class BaseTabbarViewController: UITabBarController {
     
-    var esTabBarController : ESTabBarController!
+    class func shared() -> UITabBarController {
+        baseTabbarViewController = BaseTabbarViewController()
+        return baseTabbarViewController ?? BaseTabbarViewController()
+    }
     
     /// 社区
     var v1 : CommunityViewController!
-    /// 商城
-//    var v2 = ShoppingMallViewController!
     /// 兑换专区
     var v2 : BackyardViewController!
     /// 发布
@@ -31,69 +32,25 @@ class BaseTabbarViewController: NSObject {
     /// 我的
     var v5 : UserPersonalCenterViewController!
     
-    /// 社区
-    var lottieAnimateContentView1 : BaseLottieAnimateContentView!
-    
-    /// 商城
-    var lottieAnimateContentView2 : BaseLottieAnimateContentView!
-    
-    /// 消息
-    var lottieAnimateContentView4 : BaseLottieAnimateContentView!
-    
-    /// 我的
-    var lottieAnimateContentView5 : BaseLottieAnimateContentView!
-    
+    /// 选中的selected
+    var customSelectedIndex : Int = 0
     var lastIndex : Int = 0
-
-    func tabBarViewController() -> ESTabBarController {
-        esTabBarController = ESTabBarController()
-        
-        if #available(iOS 13.0, *) {
-            esTabBarController.tabBar.standardAppearance.configureWithOpaqueBackground()
-            esTabBarController.tabBar.standardAppearance.backgroundImage = UIImage.imageWithColor(color: UIColor.white)
-            esTabBarController.tabBar.standardAppearance.shadowImage = UIImage(named: "navbar_shadow_pic_down")
+    
+    override func viewDidLoad() {
+        delegate = self
+        tabBar.layer.shadowOpacity = 0.1
+        if #available(iOS 13, *) {
+            let appearance = tabBar.standardAppearance.copy()
+            appearance.backgroundImage = UIImage.imageWithColor(color: UIColor.white)
+            appearance.shadowImage = UIImage.imageWithColor(color: UIColor.clear)
+            tabBar.standardAppearance = appearance
         } else {
-            esTabBarController.tabBar.shadowImage = UIImage(named: "navbar_shadow_pic_down")
-        }
-        
-        esTabBarController.shouldHijackHandler = {
-           [weak self] (tabbarController, viewController, index) in
-            AudioServicesPlaySystemSound(1519)
-
-            if UserModel.isTokenNil() {
-                if index == 2 || index == 3 || index == 4 {
-                    return true
-                }else {
-                    self?.reloadTabbar(index:index)
-                    self?.lastIndex = index
-                    return false
-                }
-            }else {
-                if index == 2 {
-                    return true
-                }else {
-                    self?.reloadTabbar(index:index)
-                    self?.lastIndex = index
-                    return false
-                }
-            }
-            
-            
-        }
-
-        esTabBarController.didHijackHandler = {
-            [weak self] tabbarController, viewController, index in
-            if UserModel.isTokenNil() {
-                kAppDelegate.setLogin()
-            }else {
-                self?.pushPublishVC()
-            }
+            tabBar.backgroundImage = UIImage.imageWithColor(color: UIColor.white)
+            tabBar.shadowImage = UIImage.imageWithColor(color: UIColor.clear)
         }
         
         /// 社区
         v1 = CommunityViewController()
-        /// 商城
-        //    var v2 = ShoppingMallViewController!
         /// 兑换专区
         v2 = BackyardViewController()
         /// 发布
@@ -103,41 +60,16 @@ class BaseTabbarViewController: NSObject {
         /// 我的
         v5 = UserPersonalCenterViewController()
         
-        /// 社区
-        lottieAnimateContentView1 = BaseLottieAnimateContentView(jsonStr: "communityModuleTabbar")
-        
-        /// 商城
-        lottieAnimateContentView2 = BaseLottieAnimateContentView(jsonStr: "shoppingMallModuleTabbar")
-        
-        /// 消息
-        lottieAnimateContentView4 = BaseLottieAnimateContentView(jsonStr: "messageModuleTabbar")
-        
-        /// 我的
-        lottieAnimateContentView5 = BaseLottieAnimateContentView(jsonStr: "MineModuleTabbar")
+        setupChildController(controller: v1, title: "社区", image: "tabbar_home", selectedImage: "tabbar_home_pre")
+        setupChildController(controller: v2, title: "后院", image: "tabbar_shopping", selectedImage: "tabbar_shopping_pre")
+        setupChildController(controller: v3, title: "", image: "tabbar_publish", selectedImage: "tabbar_publish")
+        setupChildController(controller: v4, title: "消息", image: "tabbar_massage", selectedImage: "tabbar_massage_pre")
+        setupChildController(controller: v5, title: "我的", image: "tabbar_my", selectedImage: "tabbar_my_pre")
         
-//        v1.tabBarItem = ESTabBarItem.init(lottieAnimateContentView1, title: "社区", image: UIImage(named: "tabbar_home")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal), selectedImage: nil)
-//        v2.tabBarItem = ESTabBarItem.init(lottieAnimateContentView2, title: "福利", image: UIImage(named: "tabbar_shopping")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal), selectedImage: nil)
-        
-        tabBarItemStyle(navc: v1, normalImg: "tabbar_home", selectorImg: "tabbar_home_pre", title: "社区")
-        tabBarItemStyle(navc: v2, normalImg: "tabbar_shopping", selectorImg: "tabbar_shopping_pre", title: "后院")
         v3.tabBarItem = UITabBarItem(title: nil, image: UIImage(named: "tabbar_publish")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal), selectedImage: UIImage(named: "tabbar_publish")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal))
         v3.tabBarItem.imageInsets = UIEdgeInsets(top: 4, left: 0, bottom: -4, right: 0);
-        tabBarItemStyle(navc: v4, normalImg: "tabbar_massage", selectorImg: "tabbar_massage_pre", title: "消息")
-        tabBarItemStyle(navc: v5, normalImg: "tabbar_my", selectorImg: "tabbar_my_pre", title: "我的")
-        
-//        if UserModel.isTokenNil() {
-//            setLoginOutTabBarItem()
-//        }else {
-//            setLoginTabBarItem()
-//        }
 
-        let n1 = BaseNavigationViewController.init(rootViewController: v1)
-        let n2 = BaseNavigationViewController.init(rootViewController: v2)
-        let n3 = BaseNavigationViewController.init(rootViewController: v3)
-        let n4 = BaseNavigationViewController.init(rootViewController: v4)
-        let n5 = BaseNavigationViewController.init(rootViewController: v5)
-
-        esTabBarController.viewControllers = [n1, n2, n3, n4, n5]
+        UITabBarItem.appearance().setTitleTextAttributes([NSAttributedString.Key.foregroundColor: k333333Color], for: .selected)
         //将要进入前台的时候
         setBadge()
         NotificationCenter.default.addObserver(forName: UIApplication.willEnterForegroundNotification, object: nil, queue: OperationQueue.main, using: {
@@ -154,36 +86,12 @@ class BaseTabbarViewController: NSObject {
             [weak self] notification in
             self?.setBadge()
         }
-        return esTabBarController
-    }
-    
-    func setLoginTabBarItem() {
-//        v4.tabBarItem = ESTabBarItem.init(lottieAnimateContentView4, title: "消息", image: UIImage(named: "tabbar_massage")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal), selectedImage: nil)
-//        v5.tabBarItem = ESTabBarItem.init(lottieAnimateContentView5, title: "我的", image: UIImage(named: "tabbar_my")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal), selectedImage: nil)
-        tabBarItemStyle(navc: v1, normalImg: "tabbar_home", selectorImg: "tabbar_home_pre", title: "社区")
-        tabBarItemStyle(navc: v2, normalImg: "tabbar_shopping", selectorImg: "tabbar_shopping_pre", title: "后院")
-        v3.tabBarItem = UITabBarItem(title: nil, image: UIImage(named: "tabbar_publish")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal), selectedImage: UIImage(named: "tabbar_publish")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal))
-        v3.tabBarItem.imageInsets = UIEdgeInsets(top: 4, left: 0, bottom: -4, right: 0);
-        tabBarItemStyle(navc: v4, normalImg: "tabbar_massage", selectorImg: "tabbar_massage_pre", title: "消息")
-        tabBarItemStyle(navc: v5, normalImg: "tabbar_my", selectorImg: "tabbar_my_pre", title: "我的")
-    }
-    
-    func setLoginOutTabBarItem() {
-//        v4.tabBarItem = ESTabBarItem.init(BaseTabBarItemContentView(), title: "消息", image: UIImage(named: "tabbar_massage")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal), selectedImage:nil)
-//        v5.tabBarItem = ESTabBarItem.init(BaseTabBarItemContentView(), title: "我的", image: UIImage(named: "tabbar_my")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal), selectedImage:nil)
-        tabBarItemStyle(navc: v1, normalImg: "tabbar_home", selectorImg: "tabbar_home_pre", title: "社区")
-        tabBarItemStyle(navc: v2, normalImg: "tabbar_shopping", selectorImg: "tabbar_shopping_pre", title: "后院")
-        v3.tabBarItem = UITabBarItem(title: nil, image: UIImage(named: "tabbar_publish")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal), selectedImage: UIImage(named: "tabbar_publish")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal))
-        v3.tabBarItem.imageInsets = UIEdgeInsets(top: 4, left: 0, bottom: -4, right: 0);
-        tabBarItemStyle(navc: v4, normalImg: "tabbar_massage", selectorImg: "tabbar_massage_pre", title: "消息")
-        tabBarItemStyle(navc: v5, normalImg: "tabbar_my", selectorImg: "tabbar_my_pre", title: "我的")
     }
-    
     /// 跳转到VC
     func pushPublishVC() {
         
         if !AliyunVodUpToyoPublishManager.shared.isUploading { // 是否正在上传中
-            PublishNewPopView.show(imageStrs: ["publish_btn_picture","publish_btn_video","publish_btn_photo","publish_btn_article"], titles: ["相册","视频","拍照","文章"], columnCount: 4) { (index) in
+            PublishNewPopView.show(imageStrs: ["publish_btn_picture","publish_btn_video","publish_btn_photo","publish_btn_article"], titles: ["相册","视频","拍照","文章"], columnCount: 4) { [weak self] (index) in
                 if index != 3 {
 //                    let pickVc = PublishViewController()
 //                    pickVc.index = index
@@ -191,7 +99,7 @@ class BaseTabbarViewController: NSObject {
                     pickVc.index = index
                     let nav = BaseNavigationViewController.init(rootViewController: pickVc)
                     nav.modalPresentationStyle = .fullScreen
-                    BaseTabbarViewController.shared.esTabBarController.present(nav, animated: true, completion: nil)
+                    self?.present(nav, animated: true, completion: nil)
                 }else {
                     Mediator.push(H5RouterModuleType.pushPostArticle)
                 }
@@ -209,32 +117,18 @@ 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)
-                
-                //            let tabBarItem = v4.tabBarItem as? ESTabBarItem
-                //            tabBarItem?.contentView?.badgeColor = kFE352BColor
-                //            tabBarItem?.contentView?.badgeValue = ""
-                //            tabBarItem?.contentView?.badgeOffset = UIOffset(horizontal: 0, vertical: -22)
             }else {
-                //            let tabBarItem = v4.tabBarItem as? ESTabBarItem
-                //            tabBarItem?.contentView?.badgeValue = nil
                 v4.tabBarItem.pp.hiddenBadge()
             }
             
             //我的
             if UpdateVersionModel.shared.object()?.upGradeModelType == .update ||  UpdateVersionModel.shared.object()?.upGradeModelType == .strongUpdate {
-                
-                //            let tabBarItem = v5.tabBarItem as? ESTabBarItem
-                //            tabBarItem?.contentView?.badgeColor = kFE352BColor
-                //            tabBarItem?.contentView?.badgeValue = ""
-                //            tabBarItem?.contentView?.badgeOffset = UIOffset(horizontal: 0, vertical: -22)
                 v5.tabBarItem.pp.addDot(color:kFE352BColor)
                 v5.tabBarItem.pp.moveBadge(x: -3,y: 3)
             }else {
-                //            let tabBarItem = v5.tabBarItem as? ESTabBarItem
-                //            tabBarItem?.contentView?.badgeValue = nil
                 v5.tabBarItem.pp.hiddenBadge()
             }
         }
@@ -243,48 +137,75 @@ class BaseTabbarViewController: NSObject {
     func reloadTabbar(index:Int) {
         
         if index == 0 && lastIndex == 0  {
-//            self.lottieAnimateContentView1.animationView.stop()
-//            self.lottieAnimateContentView1.animationView.play()
-
             if communityModuleTopType == .communityModuleFollowTop {
                 NotificationCenter.default.post(name: NSNotification.Name("CommunityModuleFollowTop"), object: nil)
-                
             }
             if communityModuleTopType == .communityModuleRecommendTop {
                     NotificationCenter.default.post(name: NSNotification.Name("CommunityModuleRecommendTop"), object: nil)
-                
             }
-            
         }
         if index == 1 && lastIndex == 1  {
-//            self.lottieAnimateContentView2.animationView.stop()
-//            self.lottieAnimateContentView2.animationView.play()
             NotificationCenter.default.post(name: NSNotification.Name("BackyardViewModuleTop"), object: nil)
             
         }
         if index == 3 && lastIndex == 3  {
-//            self.lottieAnimateContentView4.animationView.stop()
-//            self.lottieAnimateContentView4.animationView.play()
             NotificationCenter.default.post(name: NSNotification.Name("MessageModuleTop"), object: nil)
             
         }
         if index == 4 && lastIndex == 4  {
-//            self.lottieAnimateContentView5.animationView.stop()
-//            self.lottieAnimateContentView5.animationView.play()
             NotificationCenter.default.post(name: NSNotification.Name("MineModuleTop"), object: nil)
         }
     }
+    
+    func setupChildController(controller: UIViewController, title: String, image: String, selectedImage: String) {
+        
+        controller.tabBarItem.title = title
+        controller.tabBarItem.image = UIImage.init(named: image)?.withRenderingMode(.alwaysOriginal)
+        controller.tabBarItem.selectedImage = UIImage.init(named: selectedImage)?.withRenderingMode(.alwaysOriginal)
+        addChild(BaseNavigationViewController.init(rootViewController: controller))
 
-    private func tabBarItemStyle(navc : BaseViewController, normalImg : String, selectorImg : String, title : String){
-        navc.tabBarItem = UITabBarItem.init(title: title, image: UIImage(named:normalImg), selectedImage: UIImage(named:selectorImg))
-        navc.tabBarItem.setTitleTextAttributes([NSAttributedString.Key.foregroundColor:k333333Color], for: UIControl.State.normal)
-        navc.tabBarItem.setTitleTextAttributes([NSAttributedString.Key.foregroundColor:k333333Color], for: UIControl.State.selected)
+    }
+    
+}
 
+extension BaseTabbarViewController : UITabBarControllerDelegate{
+    func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
+        AudioServicesPlaySystemSound(1519)
+         if UserModel.isTokenNil() {
+            if customSelectedIndex == 2 || customSelectedIndex == 3 || customSelectedIndex == 4 {
+                kAppDelegate.setLogin()
+                return false
+            }else {
+                self.reloadTabbar(index:customSelectedIndex)
+                self.lastIndex = customSelectedIndex
+                return true
+            }
+        }else {
+            if customSelectedIndex == 2 {
+                self.pushPublishVC()
+                return false
+            }else {
+                self.reloadTabbar(index:customSelectedIndex)
+                self.lastIndex = customSelectedIndex
+                return true
+            }
+        }
     }
     
 }
 
-extension ESTabBar {
+///UITabBarDelegate
+extension BaseTabbarViewController {
+
+    override func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) {
+        guard let index = tabBar.items?.firstIndex(of: item) else {
+            return;
+        }
+        customSelectedIndex = index
+    }
+}
+
+extension UITabBar {
     open override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
         
         let view  = super.hitTest(point, with: event)
@@ -312,3 +233,4 @@ extension ESTabBar {
         return view
     }
 }
+

+ 6 - 6
RainbowPlanet/RainbowPlanet/Manager/MJRefreshManager/MJRefreshManager.swift

@@ -24,7 +24,7 @@ class MJRefreshManager: NSObject {
     class func mjRefreshManagerNONetWork(tableView : UITableView?) {
         DIYEmptyView.emptyNoDataActionTableView(tableView: tableView, btnClickBlock: {
             [weak tableView] in
-            tableView?.mj_header.beginRefreshing()
+            tableView?.mj_header?.beginRefreshing()
         })
 
         if tableView?.mj_footer != nil {
@@ -81,13 +81,13 @@ class MJRefreshManager: NSObject {
             }
         }else {
             if  pagination?.currentPage ?? 1  >= pagination?.totalPages ?? 1  {
-                tableView?.mj_footer.isHidden = false
+                tableView?.mj_footer?.isHidden = false
                 if tableView?.mj_footer != nil {
                     tableView?.endFooterNoMoreData()
                     if isHidden {
                         tableView?.isHiddenFooter(true)
                     }else {
-                        tableView?.mj_footer.pullingPercent = 1
+                        tableView?.mj_footer?.pullingPercent = 1
                     }
                 }
             }
@@ -113,7 +113,7 @@ class MJRefreshManager: NSObject {
     class func mjRefreshManagerNONetWork(collectionView : UICollectionView?) {
         DIYEmptyView.emptyNoDataActionCollectionView(collectionView: collectionView, btnClickBlock: {
             [weak collectionView] in
-            collectionView?.mj_header.beginRefreshing()
+            collectionView?.mj_header?.beginRefreshing()
         })
         if collectionView?.mj_header != nil {
             collectionView?.endHeaderRefresh()
@@ -168,13 +168,13 @@ class MJRefreshManager: NSObject {
             }
         }else {
             if  pagination?.currentPage ?? 1  >= pagination?.totalPages ?? 1  {
-                collectionView?.mj_footer.isHidden = false
+                collectionView?.mj_footer?.isHidden = false
                 if collectionView?.mj_footer != nil {
                     collectionView?.endFooterNoMoreData()
                     if isHidden {
                         collectionView?.isHiddenFooter(true)
                     }else {
-                        collectionView?.mj_footer.pullingPercent = 1
+                        collectionView?.mj_footer?.pullingPercent = 1
                     }
                 }
             }

+ 2 - 3
RainbowPlanet/RainbowPlanet/Manager/RegisterLoginManager/RegisterLoginManager.swift

@@ -7,7 +7,6 @@
 //
 
 import UIKit
-import ESTabBarController_swift
 
 class RegisterLoginManager: NSObject {
 
@@ -18,7 +17,7 @@ class RegisterLoginManager: NSObject {
         if UserModel.shared().getModel()?.isFollowSuggestTopic == 0 || UserModel.shared().getModel()?.isFollowSuggestTopic == nil  { //设置性别
             vc?.navigationController?.pushViewController(GenderSelectionViewController(), animated: true)
         }else {// 设置首页
-            BaseTabbarViewController.shared.setBadge()
+            baseTabbarViewController?.setBadge()
             if vc?.presentingViewController != nil {
                 if vc?.navigationController?.presentationController != nil {
                         vc?.navigationController?.dismiss(animated: false, completion: {
@@ -41,7 +40,7 @@ class RegisterLoginManager: NSObject {
                 LoginNowView.removeLoginNowView()
                 kAppDelegate.setData()
             }
-            BaseTabbarViewController.shared.esTabBarController.selectedIndex = 0
+            baseTabbarViewController?.selectedIndex = 0
 
         }
     }

+ 21 - 3
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]
         /*!
@@ -63,7 +65,7 @@ class RongCloudIMManager: NSObject {
         //开启多端未读状态同步
         RCIM.shared()?.enableSyncReadStatus = true
         //是否在发送的所有消息中携带当前登录的用户信息,默认值为 NO
-        RCIM.shared()?.enableMessageAttachUserInfo = true
+        RCIM.shared()?.enableMessageAttachUserInfo = false
         //设置头像为圆形
         RCIM.shared()?.globalMessagePortraitSize = CGSize(width: 50, height: 50)
         RCIM.shared()?.globalMessageAvatarStyle = .USER_AVATAR_CYCLE
@@ -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)
     }
 }

+ 5 - 5
RainbowPlanet/RainbowPlanet/Manager/WebViewJavascriptBridgeManager/WebViewJavascriptBridgeManager.swift

@@ -205,12 +205,12 @@ class WebViewJavascriptBridgeManager: NSObject {
         if wvjbModel?.modelType  == .view {
             // 发布
             if wvjbModel?.params?.paramsModelPage == .publist {
-                BaseTabbarViewController.shared.pushPublishVC()
+                baseTabbarViewController?.pushPublishVC()
             }
             // 推荐
             if wvjbModel?.params?.paramsModelPage == .join {
-                BaseTabbarViewController.shared.esTabBarController.selectedIndex = 0
-                BaseTabbarViewController.shared.v1.reloadSegmentedView()
+                baseTabbarViewController?.selectedIndex = 0
+                baseTabbarViewController?.v1.reloadSegmentedView()
                 if viewController != nil {
                     viewController?.navigationController?.popToRootViewController(animated: true)
                 }
@@ -221,8 +221,8 @@ class WebViewJavascriptBridgeManager: NSObject {
             }
             // 去星球
             if wvjbModel?.params?.paramsModelPage == .planet {
-                BaseTabbarViewController.shared.esTabBarController.selectedIndex = 0
-                BaseTabbarViewController.shared.v1.reloadSegmentedStarView()
+                baseTabbarViewController?.selectedIndex = 0
+                baseTabbarViewController?.v1.reloadSegmentedStarView()
                 if viewController != nil {
                     viewController?.navigationController?.popToRootViewController(animated: true)
                 }

+ 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"]
+		
+	}
+
+}

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/CircleModule/CircleAlbum/ViewController/CircleAlbumViewController.swift

@@ -54,7 +54,7 @@ class CircleAlbumViewController: BaseViewController {
         })
         circleAlbumHeaderView.uploadSuccessClosure = {
             [weak self] in
-            self?.collectionView.mj_header.beginRefreshing()
+            self?.collectionView.mj_header?.beginRefreshing()
         }
     }
 

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/CommunityNavigationBarView.swift

@@ -151,7 +151,7 @@ class CommunityNavigationBarView: BaseView {
             if UserModel.isTokenNil() {
                 kAppDelegate.setLogin()
             }else {
-                BaseTabbarViewController.shared.pushPublishVC()
+                baseTabbarViewController?.pushPublishVC()
             }
         }).disposed(by: disposeBag)
         return leftButton

+ 3 - 3
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Follow/CommunityFollowViewController.swift

@@ -84,12 +84,12 @@ class CommunityFollowViewController: BaseViewController {
         
         observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("login"), object: nil, queue: OperationQueue.main, using: {
             [weak self] (notification) in
-            self?.tableView.mj_header.beginRefreshing()
+            self?.tableView.mj_header?.beginRefreshing()
         })
         
         observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("loginOut"), object: nil, queue: OperationQueue.main, using: {
             [weak self] (notification) in
-            self?.tableView.mj_header.beginRefreshing()
+            self?.tableView.mj_header?.beginRefreshing()
         })
         
         observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("followApi"), object: nil, queue: OperationQueue.main) { [weak self] (notification) in
@@ -194,7 +194,7 @@ class CommunityFollowViewController: BaseViewController {
         
         observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("PublishPostSuccess"), object: nil, queue: OperationQueue.main, using: {
             [weak self] (notification) in
-            self?.tableView.mj_header.beginRefreshing()
+            self?.tableView.mj_header?.beginRefreshing()
             
         })
 

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

@@ -92,6 +92,7 @@ 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)

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Recommend/CommunityRecommnendViewController.swift

@@ -68,12 +68,12 @@ class CommunityRecommnendViewController: UIViewController {
         
         observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("login"), object: nil, queue: OperationQueue.main, using: {
             [weak self] (notification) in
-            self?.tableView.mj_header.beginRefreshing()
+            self?.tableView.mj_header?.beginRefreshing()
         })
         
         observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("loginOut"), object: nil, queue: OperationQueue.main, using: {
             [weak self] (notification) in
-            self?.tableView.mj_header.beginRefreshing()
+            self?.tableView.mj_header?.beginRefreshing()
         })
 
         

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/ViewController/CommunityVideoListController.swift

@@ -149,7 +149,7 @@ class CommunityVideoListController: BaseViewController {
         collectionView.addHeader(withBeginRefresh: true,  animation: false) {
             [weak self] (page) in
             self?.communityVideoListApi(page:page)
-            self?.collectionView.mj_header.isHidden = true
+            self?.collectionView.mj_header?.isHidden = true
         }
         collectionView.addPreloadingAutoNormalFooter(withAutomaticallyRefresh: true) {
             [weak self] (page) in

+ 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?.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?.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?.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?.setBadge()
+
+    }
+}

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

@@ -0,0 +1,85 @@
+//
+//  MessageHomeThreeSectionTableViewCell.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/11/13.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import RongIMKit
+import SwiftyMediator
+
+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)
+        delegate = self
+        addSubview(lineLabel)
+        lineLabel.snp.makeConstraints { (make) in
+            make.bottom.equalToSuperview()
+            make.height.equalTo(1)
+            make.right.equalToSuperview()
+            make.left.equalTo(14)
+        }
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+        //MARK: - indexPath
+    var indexPath: IndexPath?{
+        didSet {
+        }
+    }
+    
+    private lazy var lineLabel: UILabel = {
+        let lineLabel = UILabel()
+        lineLabel.backgroundColor = kf7f8faColor
+        return lineLabel
+    }()
+    
+    var conversationModel : ConversationModel? {
+        didSet {
+           rcConversation = RCIMClient.shared()?.getConversation(RCConversationType.ConversationType_PRIVATE, targetId: conversationModel?.targetId)
+        }
+    }
+    var rcConversation : RCConversation? {
+        didSet{
+            rcConversationModel = RCConversationModel.init(conversation: rcConversation, extend: "")
+        }
+    }
+    var rcConversationModel : RCConversationModel? {
+        didSet {
+            setDataModel(rcConversationModel)
+            if rcConversationModel?.isTop ?? false {
+                backgroundColor = kf7f8faColor
+            }else {
+                backgroundColor = kffffffColor
+            }
+        }
+    }
+}
+
+extension MessageHomeThreeSectionTableViewCell : RCConversationCellDelegate {
+    func didTapCellPortrait(_ model: RCConversationModel!) {
+        
+        let userID = model.targetId.suffix(from: String.Index(utf16Offset: model.targetId.indexOf(key: "-") + 1, in: model.targetId))
+        if Int(userID) != UserModel.shared().getModel()?.uid {
+            Mediator.push(MineRouterModuleType.pushOtherPersonalCenter(uid: Int(userID) ?? 0))
+        }
+    }
+    
+    func didLongPressCellPortrait(_ model: 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 {
             }
         }
     }
+
+
 }

+ 169 - 152
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 RongIMKit
+import SwiftyJSON
+import ObjectMapper
+import SwiftyMediator
 
 class MessageMainViewController: BaseViewController {
     override func didReceiveMemoryWarning() {
@@ -26,6 +31,10 @@ class MessageMainViewController: BaseViewController {
     weak var observe : NSObjectProtocol?
     
     var messageIndexModel : MessageIndexModel?
+    var users : Array<Any>?
+    var conversationModels : Array<ConversationModel>?
+    var rcConversations : Array<RCConversation>?
+    
     
     override func viewDidLoad() {
         super.viewDidLoad()
@@ -33,11 +42,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 +59,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()
-            BaseTabbarViewController.shared.setBadge()
+            self?.tableView.reloadData()
+            baseTabbarViewController?.setBadge()
+        }
+        
+        observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("RCIMReceiveMessageDelegate"), object: nil, queue: OperationQueue.main) {
+             [weak self] notification in
+            self?.setConversationList()
         }
-        collectionView.addHeader(withBeginRefresh: true,  animation: true) {
+        
+        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 +102,12 @@ extension MessageMainViewController {
         SwiftMoyaNetWorkServiceUser.shared().userMemberMessageIndexApi(completion: {
             [weak self] (messageIndexModel) -> (Void) in
             self?.messageIndexModel = messageIndexModel as? MessageIndexModel
-            self?.collectionView.reloadData()
-            BaseTabbarViewController.shared.setBadge()
-            MJRefreshManager.mjRefreshManager(collectionView: self?.collectionView)
+            self?.tableView.reloadData()
+            baseTabbarViewController?.setBadge()
+            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 +118,15 @@ 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?.setBadge()
+        NXLLog(self.users)
+    }
+    
 }
 
 extension MessageMainViewController {
@@ -119,45 +141,36 @@ extension MessageMainViewController {
         vc.messageVCType = messageVCType
         vc.messageShowTypes = messageShowTypes
         self.navigationController?.pushViewController(vc, animated: true)
-//        self.setTabBarItemBadge()
-        BaseTabbarViewController.shared.setBadge()
-
-
+        baseTabbarViewController?.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,102 +180,45 @@ 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)
                         let messageIndexModel = MessageIndexModel.shared.object()
                         messageIndexModel?.notification?.isYes =  self?.messageIndexModel?.notification?.isYes
                         MessageIndexModel.shared.saveObject(model: messageIndexModel!)
-                        BaseTabbarViewController.shared.setBadge()
-
-//                        self?.setTabBarItemBadge()
+                        baseTabbarViewController?.setBadge()
                     }
                 }else {
                     let vc = MessagePlanetNotiController()
                     vc.messageShowTypes = self.messageIndexModel?.notification?.key ?? ""
                     self.navigationController?.pushViewController(vc, animated: true)
-                    BaseTabbarViewController.shared.setBadge()
-
-//                    self.setTabBarItemBadge()
-
+                    baseTabbarViewController?.setBadge()
                 }
             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)
@@ -270,53 +226,114 @@ extension MessageMainViewController: UICollectionViewDelegateFlowLayout,UICollec
                         let messageIndexModel = MessageIndexModel.shared.object()
                         messageIndexModel?.activity?.isYes =  self?.messageIndexModel?.activity?.isYes
                         MessageIndexModel.shared.saveObject(model: messageIndexModel!)
-                        BaseTabbarViewController.shared.setBadge()
-
-//                        self?.setTabBarItemBadge()
+                        baseTabbarViewController?.setBadge()
                     }
                 }else {
                     let vc = MessagePlanetActivityController()
                     vc.messageShowTypes = self.messageIndexModel?.activity?.key ?? ""
                     self.navigationController?.pushViewController(vc, animated: true)
-                    BaseTabbarViewController.shared.setBadge()
-
-//                    self.setTabBarItemBadge()
-
+                    baseTabbarViewController?.setBadge()
                 }
             }
+        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,3:
+            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, canEditRowAt indexPath: IndexPath) -> Bool {
+        if indexPath.section == 2 {
+            return true
+        }
+        return false
     }
     
-    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForFooterInSection section: Int) -> CGSize {
-        return CGSize(width: kScreenWidth, height: 10)
+    func tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath) -> UITableViewCell.EditingStyle {
+        return .delete
     }
     
-}
+    func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) {
+        if editingStyle == .delete {
+            let cell = tableView.cellForRow(at: indexPath) as? MessageHomeThreeSectionTableViewCell
+            RCIMClient.shared()?.remove(RCConversationType.ConversationType_PRIVATE, targetId: cell?.rcConversation?.targetId)
+            self.conversationModels?.remove(at: indexPath.row)
+            tableView.deleteRows(at: [indexPath], with: UITableView.RowAnimation.left)
+        }
+    }
+    
+    func tableView(_ tableView: UITableView, titleForDeleteConfirmationButtonForRowAt indexPath: IndexPath) -> String? {
+        return "删除"
+    }
+    
+    @available(iOS 11.0, *)
+    func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
+        switch indexPath.section {
+        case 2:
+            let cell = tableView.cellForRow(at: indexPath) as? MessageHomeThreeSectionTableViewCell
+            let deleteRowAction = UIContextualAction(style: UIContextualAction.Style.destructive, title: "删除") {  [weak self] (contextualAction, view, completionHandler) in
+                guard let strongSelf = self else { return }
+                RCIMClient.shared()?.remove(RCConversationType.ConversationType_PRIVATE, targetId: cell?.rcConversation?.targetId)
+                strongSelf.conversationModels?.remove(at: indexPath.row)
+                tableView.deleteRows(at: [indexPath], with: UITableView.RowAnimation.left)
+            }
+            deleteRowAction.backgroundColor = .red
+            
+            var topRowtitle : String?
+            if cell?.rcConversationModel?.isTop ?? false {
+                topRowtitle = "取消置顶"
+            } else {
+                topRowtitle = "置顶"
 
+            }
+            let topRowAction = UIContextualAction(style: UIContextualAction.Style.destructive, title: topRowtitle) { [weak self] (contextualAction, view, completionHandler) in
+                if cell?.rcConversationModel?.isTop ?? false {
+                    RCIMClient.shared()?.setConversationToTop(RCConversationType.ConversationType_PRIVATE, targetId: cell?.rcConversation?.targetId, isTop: false)
+                } else {
+                    RCIMClient.shared()?.setConversationToTop(RCConversationType.ConversationType_PRIVATE, targetId: cell?.rcConversation?.targetId, isTop: true)
+                }
+                self?.setConversationList()
+            }
+            topRowAction.backgroundColor = kThemeColor
+            let config = UISwipeActionsConfiguration(actions: [deleteRowAction,topRowAction])
+            return config
+        default:
+            return nil
+        }
+       
+    }
+    
+    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
+        if section == 2 {
+            return 0.000001
+        }
+        return 10
+    }
+    
+    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
+        return nil
+    }
+    
+    func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
+        return 0.000001
+        
+    }
+    
+    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
+        return nil
+    }
+    
+}

+ 6 - 2
RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/OtherPersonalCenter/ViewController/OtherPersonalCenterViewController.swift

@@ -12,6 +12,7 @@ import JXPagingView
 import RxSwift
 import SwiftyMediator
 import Kingfisher
+import RongIMKit
 
 class OtherPersonalCenterViewController: BaseViewController {
     deinit {
@@ -193,11 +194,14 @@ extension OtherPersonalCenterViewController {
         SwiftMoyaNetWorkServiceUser.shared().userMemberDetailApi(uid: uid ) {
             [weak self] (userDetailModel) -> (Void) in
             self?.userDetailModel = userDetailModel as? UserDetailModel
+            let rcUserInfo = RCUserInfo()
+            rcUserInfo.userId = kRongCloudIMUserIdPrefix(userId: self?.userDetailModel?.uid ?? 0)
+            rcUserInfo.name = self?.userDetailModel?.username
+            rcUserInfo.portraitUri = self?.userDetailModel?.avatar
+            RCIM.shared()?.refreshUserInfoCache(rcUserInfo, withUserId: rcUserInfo.userId)
             self?.otherHeaderView.userDetailModel = self?.userDetailModel
             self?.navigationBar.backgroundImageView.kf.setImage(with: kURLImage(name: self?.userDetailModel?.backgroundImg ?? "default_pic"), placeholder: kImage(name: "default_pic"))
             self?.avatarButton.kf.setImage(with: kURLImage(name: self?.userDetailModel?.avatar ?? ""), for: UIControl.State.normal, placeholder: kImage(name: "default_avatar"))
-            
-
             self?.nameButton.setTitle(self?.userDetailModel?.username, for: UIControl.State.normal)
             self?.cmsTemplateTitles = ["发布 \(self?.userDetailModel?.postCount ?? "0")","收藏 \(self?.userDetailModel?.collectCount ?? "0")","分享 \(self?.userDetailModel?.shareCount ?? "0")"]
             self?.reloadData()

+ 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 = 0.5
+        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

+ 0 - 1
RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/UserPersonalCenter/ViewController/UserPersonalCenterViewController.swift

@@ -11,7 +11,6 @@ import JXSegmentedView
 import JXPagingView
 import RxSwift
 import SwiftyMediator
-import ESTabBarController_swift
 import Kingfisher
 
 class UserPersonalCenterViewController: BaseViewController {

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEdit/Controller/PublishEditController.swift

@@ -319,7 +319,7 @@ extension PublishEditController {
         }
         self.dismissToRootViewController(animated: false) {
             NotificationCenter.default.post(name: NSNotification.Name(rawValue: "DismissFromPublishEditVc"), object: aliyunVodUpToYoPublishModel)
-            BaseTabbarViewController.shared.esTabBarController.selectedIndex = 0
+            baseTabbarViewController?.selectedIndex = 0
         }
 
     }

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishArticle/ViewController/PublishArticleViewController.swift

@@ -67,7 +67,7 @@ class PublishArticleViewController: BaseNewWebViewController {
                 break
             case 3://3.发布成功
                 NotificationCenter.default.post(name: NSNotification.Name("PublishPostSuccess"), object: nil)
-                BaseTabbarViewController.shared.v1.reloadSegmentedFollowView()
+                baseTabbarViewController?.v1.reloadSegmentedFollowView()
                 SwiftProgressHUD.shared().hide()
                 self?.tabBarController?.selectedIndex = 0
                 self?.navigationController?.popViewController(animated: true)

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishEditContent/ViewController/PublishEditVideoContentViewController.swift

@@ -188,7 +188,7 @@ class PublishEditVideoContentViewController: BaseViewController {
             self.navigationController?.popViewController(animated: true)
         }else {
             self.dismissToRootViewController(animated: false) {
-                BaseTabbarViewController.shared.esTabBarController.selectedIndex = 0
+                baseTabbarViewController?.selectedIndex = 0
             }
         }
     }

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishManager/PublishManagerUploadView.swift

@@ -56,7 +56,7 @@ class PublishManagerUploadView: BaseView {
            let vc = PublishEditVideoContentViewController()
             vc.publishManagerModel = self?.publishManagerModel
             vc.isRenewEdit = true
-            BaseTabbarViewController.shared.v1.navigationController?.pushViewController(vc, animated: true)
+            baseTabbarViewController?.v1.navigationController?.pushViewController(vc, animated: true)
         }).disposed(by: disposeBag)
     }
     

+ 149 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/NXLPhotoPicker/NXLAssetsCollection.swift

@@ -0,0 +1,149 @@
+//
+//  NXLAssetsCollection.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/11/19.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+struct NXLAssetsCollection {
+    
+    /// 资源列表
+    var phAssetCollection: PHAssetCollection? = nil
+    
+    /// 取得结果PHAsset
+    var fetchResult: PHFetchResult<PHAsset>? = nil
+    
+    /// 是否是使用相机
+    var isUsedCamera: Bool = false
+    
+    /// 最近点
+    var recentPosition: CGPoint = CGPoint.zero
+    
+    /// 标题
+    var title: String
+    
+    /// 封面
+    var coverImage : UIImage {
+        get {
+            if self.fetchResult?.count ?? 0 > 0 {
+                return NXLPhotoLibrary.fullResolutionImageData(asset: (self.fetchResult?.firstObject)!)!
+            }else {
+                return UIImage(named: "default_pic")!
+            }
+        }
+    }
+    
+    /// 资源的数
+    var fetchResultCount :Int {
+        get {
+            return self.fetchResult?.count ?? 0
+        }
+    }
+    
+    /// 本地标识符
+    var localIdentifier: String
+    
+    /// 分区
+    var sections: [(title: String, assets: [NXLPHAsset])]? = nil
+    
+    /// 数量
+    var count: Int {
+        get {
+            guard let count = self.fetchResult?.count, count > 0 else { return self.isUsedCamera ? 1 : 0 }
+            return count + (self.isUsedCamera ? 1 : 0)
+        }
+    }
+    
+    /// 初始化
+    /// - Parameter collection: 资源
+    init(collection: PHAssetCollection) {
+        self.phAssetCollection = collection
+        self.title = collection.localizedTitle ?? ""
+        self.localIdentifier = collection.localIdentifier
+    }
+    
+    static func ==(lhs: NXLAssetsCollection, rhs: NXLAssetsCollection) -> Bool {
+        return lhs.localIdentifier == rhs.localIdentifier
+    }
+    
+    
+    /// 获取PHAsset
+    /// - Parameter index: 指定的资源
+    func getAsset(at index: Int) -> PHAsset? {
+        if self.isUsedCamera && index == 0 { return nil }
+        let index = index - (self.isUsedCamera ? 1 : 0)
+        guard let result = self.fetchResult, index < result.count else { return nil }
+        return result.object(at: max(index,0))
+    }
+    
+    /// 获取NXLPHAsset
+    /// - Parameter indexPath: 指定的资源
+    func getTLAsset(at indexPath: IndexPath) -> NXLPHAsset? {
+        let isCameraRow = self.isUsedCamera && indexPath.section == 0 && indexPath.row == 0
+        if isCameraRow { return nil }
+        if let sections = self.sections {
+            let index = indexPath.row - ((self.isUsedCamera && indexPath.section == 0) ? 1 : 0)
+            let result = sections[safe: indexPath.section]
+            return result?.assets[safe: index]
+        }else {
+            var index = indexPath.row
+            index = index - (self.isUsedCamera ? 1 : 0)
+            guard let result = self.fetchResult, index < result.count else { return nil }
+            return NXLPHAsset(asset: result.object(at: max(index,0)))
+        }
+    }
+    
+    /// 重新加载分区
+    /// - Parameter groupedBy: 分区类型
+    mutating func reloadSection(groupedBy: PHFetchedResultGroupedBy) {
+        var groupedSections = self.section(groupedBy: groupedBy)
+        if self.isUsedCamera {
+            groupedSections.insert(("camera",[NXLPHAsset(asset: nil)]), at: 0)
+        }
+        self.sections = groupedSections
+    }
+    
+}
+
+extension NXLAssetsCollection {
+    
+    
+    /// 遍历获取的结果
+    /// - Parameter groupedBy: 分组类型
+    func enumarateFetchResult(groupedBy: PHFetchedResultGroupedBy) -> Dictionary<String,[NXLPHAsset]> {
+        let dateFormatter = DateFormatter()
+        dateFormatter.dateFormat = groupedBy.dateFormat
+        var assets = [PHAsset]()
+        assets.reserveCapacity(self.fetchResult?.count ?? 0)
+        self.fetchResult?.enumerateObjects({ (phAsset, idx, stop) in
+            if phAsset.creationDate != nil {
+                assets.append(phAsset)
+            }
+        })
+        let sections = Dictionary(grouping: assets.map{ NXLPHAsset(asset: $0) }) { (element) -> String in
+            if let creationDate = element.phAsset?.creationDate {
+                let identifier = dateFormatter.string(from: creationDate)
+                return identifier
+            }
+            return ""
+        }
+        return sections
+    }
+    
+    /// 获取分区
+    /// - Parameter groupedBy: 分区类型
+    func section(groupedBy: PHFetchedResultGroupedBy) -> [(String,[NXLPHAsset])] {
+        let dict = enumarateFetchResult(groupedBy: groupedBy)
+        var sections = [(String,[NXLPHAsset])]()
+        let sortedKeys = dict.keys.sorted(by: >)
+        for key in sortedKeys {
+            if let array = dict[key] {
+                sections.append((key, array))
+            }
+        }
+        return sections
+    }
+}

+ 322 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/NXLPhotoPicker/NXLPHAsset.swift

@@ -0,0 +1,322 @@
+//
+//  NXLAssetsCollection.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/11/19.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import Photos
+import PhotosUI
+import MobileCoreServices
+
+public struct NXLPHAsset {
+    
+    /// 云端下载状态
+    enum CloudDownloadState {
+        case ready, progress, complete, failed
+    }
+    
+    /// 资源类型
+    public enum AssetType {
+        case photo, video, livePhoto
+    }
+    
+    /// 图片后缀
+    public enum ImageExtType: String {
+        case png, jpg, gif, heic
+    }
+    
+    
+    /// 云端下载状态
+    var state = CloudDownloadState.ready
+    
+    /// 资源
+    var phAsset: PHAsset? = nil
+    
+    /// 是否选中相机
+    var isSelectedFromCamera = false
+    
+    /// 选中的订单
+    var selectedOrder: Int = 0
+    
+    /// 资源类型
+    var type: AssetType {
+        get {
+            guard let phAsset = self.phAsset else { return .photo }
+            if phAsset.mediaSubtypes.contains(.photoLive) {
+                return .livePhoto
+            }else if phAsset.mediaType == .video {
+                return .video
+            }else {
+                return .photo
+            }
+        }
+    }
+    
+    init(asset: PHAsset?) {
+        phAsset = asset
+    }
+    
+    static func asset(with localIdentifier: String) -> NXLPHAsset? {
+        let fetchResult = PHAsset.fetchAssets(withLocalIdentifiers: [localIdentifier], options: nil)
+        return NXLPHAsset(asset: fetchResult.firstObject)
+    }
+    
+    /// 全分辨率图像
+    var fullResolutionImage: UIImage? {
+        get {
+            guard let phAsset = self.phAsset else { return nil }
+            return NXLPhotoLibrary.fullResolutionImageData(asset: phAsset)
+        }
+    }
+    
+    /// 原始文件名
+    var originalFileName: String? {
+        get {
+            guard let phAsset = self.phAsset,let resource = PHAssetResource.assetResources(for: phAsset).first else { return nil }
+            return resource.originalFilename
+        }
+    }
+    
+    /// 图片后缀类型
+    func extType() -> ImageExtType {
+        var ext = ImageExtType.png
+        if let fileName = self.originalFileName, let extention = URL(string: fileName)?.pathExtension.lowercased() {
+            ext = ImageExtType(rawValue: extention) ?? .png
+        }
+        return ext
+    }
+    
+    /// 图片size
+    /// - Parameters:
+    ///   - options: 图像请求选项
+    ///   - completion: 完成回调
+    ///   - livePhotoVideoSize: 是否livePhotoView
+    func photoSize(options: PHImageRequestOptions? = nil ,completion: @escaping ((Int)->Void), livePhotoVideoSize: Bool = false) {
+        guard let phAsset = self.phAsset, self.type == .photo || self.type == .livePhoto else { completion(-1); return }
+        var resource: PHAssetResource? = nil
+        if phAsset.mediaSubtypes.contains(.photoLive) == true, livePhotoVideoSize {
+            resource = PHAssetResource.assetResources(for: phAsset).filter { $0.type == .pairedVideo }.first
+        }else {
+            resource = PHAssetResource.assetResources(for: phAsset).filter { $0.type == .photo }.first
+        }
+        if let fileSize = resource?.value(forKey: "fileSize") as? Int {
+            completion(fileSize)
+        }else {
+            PHImageManager.default().requestImageData(for: phAsset, options: nil) { (data, uti, orientation, info) in
+                var fileSize = -1
+                if let data = data {
+                    let bcf = ByteCountFormatter()
+                    bcf.countStyle = .file
+                    fileSize = data.count
+                }
+                DispatchQueue.main.async {
+                    completion(fileSize)
+                }
+            }
+        }
+    }
+    
+    
+    /// 视频size
+    /// - Parameters:
+    ///   - options: 视频请求选项
+    ///   - completion: 完成回调
+    public func videoSize(options: PHVideoRequestOptions? = nil, completion: @escaping ((Int)->Void)) {
+        guard let phAsset = self.phAsset, self.type == .video else {  completion(-1); return }
+        let resource = PHAssetResource.assetResources(for: phAsset).filter { $0.type == .video }.first
+        if let fileSize = resource?.value(forKey: "fileSize") as? Int {
+            completion(fileSize)
+        }else {
+            PHImageManager.default().requestAVAsset(forVideo: phAsset, options: options) { (avasset, audioMix, info) in
+                func fileSize(_ url: URL?) -> Int? {
+                    do {
+                        guard let fileSize = try url?.resourceValues(forKeys: [.fileSizeKey]).fileSize else { return nil }
+                        return fileSize
+                    }catch { return nil }
+                }
+                var url: URL? = nil
+                if let urlAsset = avasset as? AVURLAsset {
+                    url = urlAsset.url
+                }else if let sandboxKeys = info?["PHImageFileSandboxExtensionTokenKey"] as? String, let path = sandboxKeys.components(separatedBy: ";").last {
+                    url = URL(fileURLWithPath: path)
+                }
+                let size = fileSize(url) ?? -1
+                DispatchQueue.main.async {
+                    completion(size)
+                }
+            }
+        }
+    }
+    
+    /// MIMEType
+    /// - Parameter url: URL
+    func MIMEType(_ url: URL?) -> String? {
+        guard let ext = url?.pathExtension else { return nil }
+        if !ext.isEmpty {
+            let UTIRef = UTTypeCreatePreferredIdentifierForTag("public.filename-extension" as CFString, ext as CFString, nil)
+            let UTI = UTIRef?.takeUnretainedValue()
+            UTIRef?.release()
+            if let UTI = UTI {
+                guard let MIMETypeRef = UTTypeCopyPreferredTagWithClass(UTI, kUTTagClassMIMEType) else { return nil }
+                let MIMEType = MIMETypeRef.takeUnretainedValue()
+                MIMETypeRef.release()
+                return MIMEType as String
+            }
+        }
+        return nil
+    }
+    
+    
+    /// 临时复制媒体文件
+    /// - Parameters:
+    ///   - videoRequestOptions: 视频请求选项
+    ///   - imageRequestOptions: 图片请求选项
+    ///   - exportPreset: 出口预设
+    ///   - convertLivePhotosToJPG:将实时照片转换为JPG /false : If you want mov file at live photos / true  : If you want png file at live photos ( HEIC )
+    ///   - progressBlock: 进度回调
+    ///   - completionBlock: 完成回调
+    @discardableResult
+    public func tempCopyMediaFile(videoRequestOptions: PHVideoRequestOptions? = nil, imageRequestOptions: PHImageRequestOptions? = nil, exportPreset: String = AVAssetExportPresetHighestQuality, convertLivePhotosToJPG: Bool = false, progressBlock:((Double) -> Void)? = nil, completionBlock:@escaping ((URL,String) -> Void)) -> PHImageRequestID? {
+        guard let phAsset = self.phAsset else { return nil }
+        var type: PHAssetResourceType? = nil
+        if phAsset.mediaSubtypes.contains(.photoLive) == true, convertLivePhotosToJPG == false {
+            type = .pairedVideo
+        }else {
+            type = phAsset.mediaType == .video ? .video : .photo
+        }
+        guard let resource = (PHAssetResource.assetResources(for: phAsset).filter{ $0.type == type }).first else { return nil }
+        let fileName = resource.originalFilename
+        var writeURL: URL? = nil
+        if #available(iOS 10.0, *) {
+            writeURL = FileManager.default.temporaryDirectory.appendingPathComponent("\(fileName)")
+        } else {
+            writeURL = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true).appendingPathComponent("\(fileName)")
+        }
+        if (writeURL?.pathExtension.uppercased() == "HEIC" || writeURL?.pathExtension.uppercased() == "HEIF") && convertLivePhotosToJPG {
+            if let fileName2 = writeURL?.deletingPathExtension().lastPathComponent {
+                writeURL?.deleteLastPathComponent()
+                writeURL?.appendPathComponent("\(fileName2).jpg")
+            }
+        }
+        guard let localURL = writeURL,let mimetype = MIMEType(writeURL) else { return nil }
+        switch phAsset.mediaType {
+        case .video:
+            var requestOptions = PHVideoRequestOptions()
+            if let options = videoRequestOptions {
+                requestOptions = options
+            }else {
+                requestOptions.isNetworkAccessAllowed = true
+            }
+            //iCloud download progress
+            requestOptions.progressHandler = { (progress, error, stop, info) in
+                DispatchQueue.main.async {
+                    progressBlock?(progress)
+                }
+            }
+            return PHImageManager.default().requestExportSession(forVideo: phAsset, options: requestOptions, exportPreset: exportPreset) { (session, infoDict) in
+                session?.outputURL = localURL
+                session?.outputFileType = AVFileType.mov
+                session?.exportAsynchronously(completionHandler: {
+                    DispatchQueue.main.async {
+                        completionBlock(localURL, mimetype)
+                    }
+                })
+            }
+        case .image:
+            var requestOptions = PHImageRequestOptions()
+            if let options = imageRequestOptions {
+                requestOptions = options
+            }else {
+                requestOptions.isNetworkAccessAllowed = true
+            }
+            //iCloud download progress
+            requestOptions.progressHandler = { (progress, error, stop, info) in
+                DispatchQueue.main.async {
+                    progressBlock?(progress)
+                }
+            }
+            return PHImageManager.default().requestImageData(for: phAsset, options: requestOptions, resultHandler: { (data, uti, orientation, info) in
+                do {
+                    var data = data
+                    let needConvertLivePhotoToJPG = phAsset.mediaSubtypes.contains(.photoLive) == true && convertLivePhotosToJPG == true
+                    if needConvertLivePhotoToJPG, let imgData = data, let rawImage = UIImage(data: imgData)?.upOrientationImage() {
+                        data = rawImage.jpegData(compressionQuality: 1)
+                    }
+                    try data?.write(to: localURL)
+                    DispatchQueue.main.async {
+                        completionBlock(localURL, mimetype)
+                    }
+                }catch { }
+            })
+        default:
+            return nil
+        }
+    }
+    
+    /// 视频文件名
+    /// - Parameter phAsset: 资源
+    func videoFilename(phAsset: PHAsset) -> URL? {
+        guard let resource = (PHAssetResource.assetResources(for: phAsset).filter{ $0.type == .video }).first else {
+            return nil
+        }
+        var writeURL: URL?
+        let fileName = resource.originalFilename
+        if #available(iOS 10.0, *) {
+            writeURL = FileManager.default.temporaryDirectory.appendingPathComponent("\(fileName)")
+        } else {
+            writeURL = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true).appendingPathComponent("\(fileName)")
+        }
+        return writeURL
+    }
+    
+    /// 导出视频文件
+    /// - Parameters:
+    ///   - options: 视频请求选项
+    ///   - outputURL: 输出网址
+    ///   - outputFileType: 输出文件类型
+    ///   - progressBlock: 进度回调
+    ///   - completionBlock: 完成回调
+    func exportVideoFile(options: PHVideoRequestOptions? = nil, outputURL: URL? = nil, outputFileType: AVFileType = .mov, progressBlock:((Double) -> Void)? = nil, completionBlock:@escaping ((URL,String) -> Void)) {
+        guard
+            let phAsset = self.phAsset,
+            phAsset.mediaType == .video,
+            let writeURL = outputURL ?? videoFilename(phAsset: phAsset),
+            let mimetype = MIMEType(writeURL)
+            else {
+                return
+        }
+        var requestOptions = PHVideoRequestOptions()
+        if let options = options {
+            requestOptions = options
+        }else {
+            requestOptions.isNetworkAccessAllowed = true
+        }
+        requestOptions.progressHandler = { (progress, error, stop, info) in
+            DispatchQueue.main.async {
+                progressBlock?(progress)
+            }
+        }
+        PHImageManager.default().requestAVAsset(forVideo: phAsset, options: requestOptions) { (avasset, avaudioMix, infoDict) in
+            guard let avasset = avasset else {
+                return
+            }
+            let exportSession = AVAssetExportSession.init(asset: avasset, presetName: AVAssetExportPresetHighestQuality)
+            exportSession?.outputURL = writeURL
+            exportSession?.outputFileType = outputFileType
+            exportSession?.exportAsynchronously(completionHandler: {
+                completionBlock(writeURL, mimetype)
+            })
+        }
+    }
+    
+}
+
+extension NXLPHAsset: Equatable {
+    public static func ==(lhs: NXLPHAsset, rhs: NXLPHAsset) -> Bool {
+        guard let lphAsset = lhs.phAsset, let rphAsset = rhs.phAsset else { return false }
+        return lphAsset.localIdentifier == rphAsset.localIdentifier
+    }
+}

+ 342 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/NXLPhotoPicker/NXLPhotoLibrary.swift

@@ -0,0 +1,342 @@
+//
+//  NXLPhotoLibrary.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/11/19.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import Photos
+
+protocol NXLPhotoLibraryDelegate: class {
+    
+    /// 加载相机
+    func loadCameraRollCollection(collection: NXLAssetsCollection)
+    
+    /// 加载全部资源
+    func loadCompleteAllCollection(collections: [NXLAssetsCollection])
+}
+
+/// 类型
+class NXLPhotoLibrary {
+    
+    deinit {
+        NXLLog("deinit")
+    }
+    
+    weak var delegate: NXLPhotoLibraryDelegate? = nil
+
+    /// 图片管理器
+    lazy var imageManager: PHCachingImageManager = {
+        return PHCachingImageManager()
+    }()
+    
+    /// videoAsset
+    /// - Parameters:
+    ///   - asset: 资源
+    ///   - size: 资源打下
+    ///   - progressBlock: 加载进度
+    ///   - completionBlock: 完成回调
+    @discardableResult
+    func videoAsset(asset: PHAsset, size: CGSize = CGSize(width: 720, height: 1280), progressBlock: Photos.PHAssetImageProgressHandler? = nil, completionBlock:@escaping (AVPlayerItem?, [AnyHashable : Any]?) -> Void ) -> PHImageRequestID {
+        let options = PHVideoRequestOptions()
+        options.isNetworkAccessAllowed = true
+        options.deliveryMode = .automatic
+        options.progressHandler = progressBlock
+        let requestID = self.imageManager.requestPlayerItem(forVideo: asset, options: options, resultHandler: { playerItem, info in
+            completionBlock(playerItem,info)
+        })
+        return requestID
+    }
+    
+    /// livePhotoAsset
+    /// - Parameters:
+    ///   - asset: 资源
+    ///   - size: 资源打下
+    ///   - progressBlock: 加载进度
+    ///   - completionBlock: 完成回调
+    @discardableResult
+    func livePhotoAsset(asset: PHAsset, size: CGSize = CGSize(width: 720, height: 1280), progressBlock: Photos.PHAssetImageProgressHandler? = nil, completionBlock:@escaping (PHLivePhoto,Bool)-> Void ) -> PHImageRequestID {
+        let options = PHLivePhotoRequestOptions()
+        options.deliveryMode = .opportunistic
+        options.isNetworkAccessAllowed = true
+        options.progressHandler = progressBlock
+        let scale = min(UIScreen.main.scale,2)
+        let targetSize = CGSize(width: size.width*scale, height: size.height*scale)
+        let requestID = self.imageManager.requestLivePhoto(for: asset, targetSize: targetSize, contentMode: .aspectFill, options: options) { (livePhoto, info) in
+            let complete = (info?["PHImageResultIsDegradedKey"] as? Bool) == false
+            if let livePhoto = livePhoto {
+                completionBlock(livePhoto,complete)
+            }
+        }
+        return requestID
+    }
+    
+    /// imageAsset
+    /// - Parameters:
+    ///   - asset: 资源
+    ///   - size: 资源打下
+    ///   - progressBlock: 加载进度
+    ///   - completionBlock: 完成回调
+    @discardableResult
+    func imageAsset(asset: PHAsset, size: CGSize = CGSize(width: 160, height: 160), options: PHImageRequestOptions? = nil, completionBlock:@escaping (UIImage,Bool)-> Void ) -> PHImageRequestID {
+        var options = options
+        if options == nil {
+            options = PHImageRequestOptions()
+            options?.isSynchronous = false
+            options?.resizeMode = .exact
+            options?.deliveryMode = .opportunistic
+            options?.isNetworkAccessAllowed = true
+        }
+        let scale = min(UIScreen.main.scale,2)
+        let targetSize = CGSize(width: size.width*scale, height: size.height*scale)
+        let requestID = self.imageManager.requestImage(for: asset, targetSize: targetSize, contentMode: .aspectFill, options: options) { image, info in
+            let complete = (info?["PHImageResultIsDegradedKey"] as? Bool) == false
+            if let image = image {
+                completionBlock(image,complete)
+            }
+        }
+        return requestID
+    }
+    
+    /// 取消加载
+    /// - Parameter requestID: 图片ID
+    func cancelPHImageRequest(requestID: PHImageRequestID) {
+        self.imageManager.cancelImageRequest(requestID)
+    }
+    
+    /// 下载云端图片
+    /// - Parameters:
+    ///   - asset: 资源
+    ///   - size: 图片打下
+    ///   - progressBlock: 下载进度
+    ///   - completionBlock: 完成回调
+    @discardableResult
+    class func cloudImageDownload(asset: PHAsset, size: CGSize = PHImageManagerMaximumSize, progressBlock: @escaping (Double) -> Void, completionBlock:@escaping (UIImage?)-> Void ) -> PHImageRequestID {
+        let options = PHImageRequestOptions()
+        options.isSynchronous = false
+        options.isNetworkAccessAllowed = true
+        options.deliveryMode = .opportunistic
+        options.version = .current
+        options.resizeMode = .exact
+        options.progressHandler = { (progress,error,stop,info) in
+            progressBlock(progress)
+        }
+        let requestID = PHCachingImageManager().requestImageData(for: asset, options: options) { (imageData, dataUTI, orientation, info) in
+            if let data = imageData,let _ = info {
+                completionBlock(UIImage(data: data))
+            }else{
+                completionBlock(nil)//error
+            }
+        }
+        return requestID
+    }
+    
+    /// 全分辨率图像
+    /// - Parameter asset: 资源
+    @discardableResult
+    class func fullResolutionImageData(asset: PHAsset) -> UIImage? {
+        let options = PHImageRequestOptions()
+        options.isSynchronous = true
+        options.resizeMode = .none
+        options.isNetworkAccessAllowed = true
+        options.version = .current
+        var image: UIImage? = nil
+        _ = PHCachingImageManager().requestImageData(for: asset, options: options) { (imageData, dataUTI, orientation, info) in
+            if let data = imageData {
+                image = UIImage(data: data)
+            }
+        }
+        return image
+    }
+    
+}
+
+extension NXLPhotoLibrary {
+    
+    /// 获取提取的设置
+    /// - Parameter configure: NXLPhotoPickerConfigure
+    func getOption(configure: NXLPhotoPickerConfigure) -> PHFetchOptions {
+        
+        /// 是否提取设置
+        let options: PHFetchOptions
+        if let fetchOption = configure.fetchOption {
+            options = fetchOption
+        }else {
+            options = PHFetchOptions()
+            options.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: false)]
+        }
+        
+        /// 类型
+        if let mediaType = configure.mediaType {
+            let mediaPredicate = NSPredicate(format: "mediaType = %i", mediaType.rawValue)
+            options.merge(predicate: mediaPredicate)
+        }
+        
+        /// 是否允许视频
+        if configure.isAllowedVideo == false {
+            let notVideoPredicate = NSPredicate(format: "mediaType != %i", PHAssetMediaType.video.rawValue)
+            options.merge(predicate: notVideoPredicate)
+        }
+        
+        /// 是否允许图片
+        if configure.isAllowedPhotos == false {
+            let notVideoPredicate = NSPredicate(format: "mediaType != %i", PHAssetMediaType.image.rawValue)
+            options.merge(predicate: notVideoPredicate)
+        }
+        
+        /// 是否允许是图片
+        if configure.isAllowedLivePhotos == false {
+            let notLivePhotoPredicate = NSPredicate(format: "NOT ((mediaSubtype & %d) != 0)", PHAssetMediaSubtype.photoLive.rawValue)
+            options.merge(predicate: notLivePhotoPredicate)
+        }
+        
+        /// 最大时长
+        if let maxVideoDuration = configure.maxVideoDuration {
+            let durationPredicate = NSPredicate(format: "duration < %f", maxVideoDuration)
+            options.merge(predicate: durationPredicate)
+        }
+        return options
+    }
+    
+    
+    /// 提取结果
+    /// - Parameters:
+    ///   - collection: 资源
+    ///   - configure: NXLPhotoPickerConfigure
+    func fetchResult(collection: NXLAssetsCollection?, configure: NXLPhotoPickerConfigure) -> PHFetchResult<PHAsset>? {
+        guard let phAssetCollection = collection?.phAssetCollection else { return nil }
+        let options = getOption(configure: configure)
+        return PHAsset.fetchAssets(in: phAssetCollection, options: options)
+    }
+    
+    /// 提取结果 
+    /// - Parameter configure: NXLPhotoPickerConfigure
+    func fetchCollection(configure: NXLPhotoPickerConfigure) {
+        let isUsedCamera = configure.isUsedCamera
+        let options = getOption(configure: configure)
+        let fetchCollectionOption = configure.fetchCollectionOption
+        
+        
+        /// 获取相册
+        /// - Parameters:
+        ///   - subType: 类型
+        ///   - result: 返回值
+        func getAlbum(subType: PHAssetCollectionSubtype, result: inout [NXLAssetsCollection]) {
+            let collectionOption = fetchCollectionOption[.assetCollections(.album)]
+            let fetchCollection = PHAssetCollection.fetchAssetCollections(with: .album,
+                                                                          subtype: subType,
+                                                                          options: collectionOption)
+            var collections = [PHAssetCollection]()
+            fetchCollection.enumerateObjects { (collection, index, _) in
+                if configure.isAllowedAlbumCloudShared == false && collection.assetCollectionSubtype == .albumCloudShared {
+                }else {
+                    collections.append(collection)
+                }
+            }
+            for collection in collections {
+                if !result.contains(where: { $0.localIdentifier == collection.localIdentifier }) {
+                    var assetsCollection = NXLAssetsCollection(collection: collection)
+                    assetsCollection.title = configure.customLocalizedTitle[assetsCollection.title] ?? assetsCollection.title
+                    assetsCollection.fetchResult = PHAsset.fetchAssets(in: collection, options: options)
+                    if assetsCollection.count > 0 {
+                        result.append(assetsCollection)
+                    }
+                }
+            }
+        }
+        
+        /// 获取小相册
+        /// - Parameters:
+        ///   - subType: 类型
+        ///   - isUseCamera: 是否使用相机
+        ///   - result: [NXLAssetsCollection]
+        @discardableResult
+        
+        func getSmartAlbum(subType: PHAssetCollectionSubtype, isUseCamera: Bool? = false, result: inout [NXLAssetsCollection])
+            -> NXLAssetsCollection?
+        {
+            let collectionOption = fetchCollectionOption[.assetCollections(.smartAlbum)]
+            let fetchCollection = PHAssetCollection.fetchAssetCollections(with: .smartAlbum,
+                                                                          subtype: subType,
+                                                                          options: collectionOption)
+            if
+                let collection = fetchCollection.firstObject,
+                result.contains(where: { $0.localIdentifier == collection.localIdentifier }) == false
+            {
+                var assetsCollection = NXLAssetsCollection(collection: collection)
+                assetsCollection.title = configure.customLocalizedTitle[assetsCollection.title] ?? assetsCollection.title
+                assetsCollection.fetchResult = PHAsset.fetchAssets(in: collection, options: options)
+                if assetsCollection.count > 0 || isUseCamera ?? false {
+                    result.append(assetsCollection)
+                    return assetsCollection
+                }
+            }
+            return nil
+        }
+        
+        if let fetchCollectionTypes = configure.fetchCollectionTypes {
+            DispatchQueue.global(qos: .userInteractive).async { [weak self] in
+                var assetCollections = [NXLAssetsCollection]()
+                for (type,subType) in fetchCollectionTypes {
+                    if type == .smartAlbum {
+                        getSmartAlbum(subType: subType, result: &assetCollections)
+                    }else {
+                        getAlbum(subType: subType, result: &assetCollections)
+                    }
+                }
+                DispatchQueue.main.async {
+                    self?.delegate?.loadCompleteAllCollection(collections: assetCollections)
+                }
+            }
+        }else {
+            DispatchQueue.global(qos: .userInteractive).async { [weak self] in
+                var assetCollections = [NXLAssetsCollection]()
+                //Camera Roll
+                let camerarollCollection = getSmartAlbum(subType: .smartAlbumUserLibrary,
+                                                         isUseCamera: isUsedCamera,
+                                                         result: &assetCollections)
+                if var cameraRoll = camerarollCollection {
+                    cameraRoll.title = configure.customLocalizedTitle[cameraRoll.title] ?? cameraRoll.title
+                    cameraRoll.isUsedCamera = isUsedCamera
+                    assetCollections[0] = cameraRoll
+                    DispatchQueue.main.async {
+                        self?.delegate?.loadCameraRollCollection(collection: cameraRoll)
+                    }
+                }
+                //Selfies
+                getSmartAlbum(subType: .smartAlbumSelfPortraits, result: &assetCollections)
+                //Panoramas
+                getSmartAlbum(subType: .smartAlbumPanoramas, result: &assetCollections)
+                //Favorites
+                getSmartAlbum(subType: .smartAlbumFavorites, result: &assetCollections)
+                //CloudShared
+                getSmartAlbum(subType: .albumCloudShared, result: &assetCollections)
+                //get all another albums
+                getAlbum(subType: .any, result: &assetCollections)
+                if configure.isAllowedVideo ?? false {
+                    //Videos
+                    getSmartAlbum(subType: .smartAlbumVideos, result: &assetCollections)
+                }
+                //Album
+                let collectionOption = fetchCollectionOption[.topLevelUserCollections]
+                let albumsResult = PHCollectionList.fetchTopLevelUserCollections(with: collectionOption)
+                albumsResult.enumerateObjects({ (collection, index, stop) -> Void in
+                    guard let collection = collection as? PHAssetCollection else { return }
+                    var assetsCollection = NXLAssetsCollection(collection: collection)
+                    assetsCollection.title = configure.customLocalizedTitle[assetsCollection.title] ?? assetsCollection.title
+                    assetsCollection.fetchResult = PHAsset.fetchAssets(in: collection, options: options)
+                    if assetsCollection.count > 0, !assetCollections.contains(where: { $0.localIdentifier == collection.localIdentifier }) {
+                        assetCollections.append(assetsCollection)
+                    }
+                })
+                
+                DispatchQueue.main.async {
+                    self?.delegate?.loadCompleteAllCollection(collections: assetCollections)
+                }
+            }
+        }
+    }
+    
+}

+ 97 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/NXLPhotoPicker/NXLPhotoPickerConfigure.swift

@@ -0,0 +1,97 @@
+//
+//  NXLPhotoPickerConfigure.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/11/19.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import Foundation
+
+struct NXLPhotoPickerConfigure {
+    /// 是否允许视频
+    var isAllowedVideo : Bool? = true
+    
+    /// 是否允许照片
+    var isAllowedPhotos : Bool? = true
+    
+    /// 是否允许实时照片
+    var isAllowedLivePhotos : Bool? = true
+    
+    /// 是否是使用相机
+    var isUsedCamera: Bool = false
+    
+    /// 是否允许云端相册
+    var isAllowedAlbumCloudShared : Bool? = false
+    
+    /// 是否允许视屏录制
+    var isAllowedVideoRecording : Bool? = false
+    
+    /// 提取设置
+    var fetchOption: PHFetchOptions? = nil
+    
+    ///显示类型 unknown, image, video, audio
+    var mediaType: PHAssetMediaType? = nil
+    
+    /// 最大时长
+    var maxVideoDuration:TimeInterval? = nil
+    
+    /// 最小时长
+    var minVideoDuration:TimeInterval? = nil
+    
+    /// 提取的类型
+    public var fetchCollectionTypes: [(PHAssetCollectionType,PHAssetCollectionSubtype)]? = nil
+    
+    /// 提取fetchCollectionOption
+    var fetchCollectionOption: [FetchCollectionType: PHFetchOptions] = [:]
+    
+    /// 自定义本地的标题
+    var customLocalizedTitle: [String: String] = ["Camera Roll": "Camera Roll"]
+
+    
+}
+
+public enum PHFetchedResultGroupedBy {
+    case year
+    case month
+    case week
+    case day
+    case hour
+    case custom(dateFormat: String)
+    var dateFormat: String {
+        switch self {
+        case .year:
+            return "yyyy"
+        case .month:
+            return "yyyyMM"
+        case .week:
+            return "yyyyMMW"
+        case .day:
+            return "yyyyMMdd"
+        case .hour:
+            return "yyyyMMddHH"
+        case let .custom(dateFormat):
+            return dateFormat
+        }
+    }
+}
+
+public enum FetchCollectionType {
+    case assetCollections(PHAssetCollectionType)
+    case topLevelUserCollections
+}
+
+extension FetchCollectionType: Hashable {
+    private var identifier: String {
+        switch self {
+        case let .assetCollections(collectionType):
+            return "assetCollections\(collectionType.rawValue)"
+        case .topLevelUserCollections:
+            return "topLevelUserCollections"
+        }
+    }
+    
+    public func hash(into hasher: inout Hasher) {
+        hasher.combine(self.identifier)
+    }
+}

+ 131 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/PublishNewAlbumCollocationTableView/PublishNewAlbumCollocationView.swift

@@ -0,0 +1,131 @@
+//
+//  PublishNewAlbumCollocationView.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/11/18.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+class PublishNewAlbumCollocationView: BaseView {
+    
+    deinit {
+        NXLLog("deinitdein")
+    }
+    
+    /// 是否总是视频
+    var isAllowedVideo : Bool? = nil
+    
+    /// 是否总是照片
+    var isAllowedPhotos : Bool? = nil
+    
+    /// 是否总是实时照片
+    var isAllowedLivePhotos : Bool? = nil
+    
+    /// 是否使用预取
+    var isUsedPrefetch : Bool = true
+    
+    /// 是否是使用相机
+    var isUsedCamera: Bool? = true
+    
+    /// 是否自动播放视频
+    var isAutoPlay : Bool = true
+    
+    /// 是否静音
+    var isMuteAudio : Bool = true
+    
+    ///显示类型 unknown, image, video, audio
+    var mediaType: PHAssetMediaType? = nil
+    
+    /// 显示类型 photo, video, livePhoto
+    var assetType : TLPHAsset.AssetType? = nil
+    
+    /// 显示的列数
+    var numberOfColumn : Int = 4
+    
+    /// 最小行间距
+    var minimumLineSpacing : CGFloat = 1.0
+    
+    /// 最item间距
+    var minimumInteritemSpacing : CGFloat = 1.0
+    
+    /// 选中的Asset
+    var selectedAssets : Array<TLPHAsset> = [TLPHAsset]()
+    
+    /// 照片资源分类的表现形式
+    var focusedCollection: TLAssetsCollection? = nil
+    
+    override func setupViews() {
+        backgroundColor = .green
+    }
+    override func setupLayouts() {
+        
+    }
+    
+//    lazy var collectionView: UICollectionView = {
+//        let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: kScreenWidth, height: kScreenHeight-kSafeTabBarHeight-48-kNavBarTotalHeight), collectionViewLayout: collectionViewFlowLayout)
+//        collectionView.delegate = self
+//        collectionView.dataSource = self
+//        if isUsedPrefetch {
+//            collectionView.isPrefetchingEnabled = true
+//            collectionView.prefetchDataSource = self
+//        }
+//        return collectionView
+//    }()
+//
+//    lazy var collectionViewFlowLayout: UICollectionViewFlowLayout = {
+//        let collectionViewFlowLayout = UICollectionViewFlowLayout()
+//        collectionViewFlowLayout.scrollDirection = .vertical
+//        collectionViewFlowLayout.minimumLineSpacing = minimumLineSpacing
+//        collectionViewFlowLayout.minimumInteritemSpacing = minimumInteritemSpacing
+//        collectionViewFlowLayout.itemSize = CGSize(width: (kScreenWidth - CGFloat(numberOfColumn) + 1.0)/CGFloat(numberOfColumn), height: (kScreenWidth - CGFloat(numberOfColumn) + 1.0) / CGFloat(numberOfColumn))
+//        return collectionViewFlowLayout
+//    }()
+}
+
+//extension PublishNewAlbumCollocationView {
+//
+//    /// 获取SelectedTLPHAsset
+//    /// - Parameter asset: 资源
+//    func getSelectedAssets(_ asset: TLPHAsset) -> TLPHAsset? {
+//        if let index = self.selectedAssets.firstIndex(where: { $0.phAsset == asset.phAsset }) {
+//            return self.selectedAssets[index]
+//        }
+//        return nil
+//    }
+//}
+//
+//extension PublishNewAlbumCollocationView : UICollectionViewDataSource {
+//
+//    func numberOfSections(in collectionView: UICollectionView) -> Int {
+//
+//    }
+//
+//    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+//
+//    }
+//
+//    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+//
+//    }
+//
+//
+//}
+//
+//extension PublishNewAlbumCollocationView : UICollectionViewDelegateFlowLayout {
+//
+//}
+//
+//extension PublishNewAlbumCollocationView : UICollectionViewDataSourcePrefetching {
+//
+//    /// 预取的item
+//    func collectionView(_ collectionView: UICollectionView, prefetchItemsAt indexPaths: [IndexPath]) {
+//
+//    }
+//
+//
+//    /// 取消 预取的item
+//    func collectionView(_ collectionView: UICollectionView, cancelPrefetchingForItemsAt indexPaths: [IndexPath]) {
+//
+//    }
+//}

+ 108 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/PublishNewAlbumCollocationTableView/PublishNewAlbumTableView.swift

@@ -0,0 +1,108 @@
+//
+//  PublishNewAlbumTableView.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/11/19.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import RxSwift
+
+class PublishNewAlbumTableView: UIView {
+    
+    let disposeBag = DisposeBag()
+    /// 配置
+    var configure : NXLPhotoPickerConfigure?
+    
+    /// 媒体资源
+    lazy var photoLibrary: NXLPhotoLibrary = {
+        let photoLibrary = NXLPhotoLibrary()
+        photoLibrary.delegate = self
+        return photoLibrary
+    }()
+    
+    /// 资源
+    lazy var collections: Array<NXLAssetsCollection> = {
+        let collections = Array<NXLAssetsCollection>()
+        return collections
+    }()
+    
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+
+    }
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    init(configure:NXLPhotoPickerConfigure? = nil) {
+        self.init()
+        self.configure = configure
+        self.setupViews()
+        self.setupLayouts()
+        self.setupData()
+    }
+
+    func setupViews() {
+        backgroundColor = UIColor.white
+    }
+
+    func setupLayouts() {
+
+    }
+    
+    func setupData() {
+        if  NXLPermission.isAllowed(NXLPermissionType.photoLibrary) {
+            guard let configure = self.configure  else { return }
+            photoLibrary.fetchCollection(configure: configure)
+        }
+    }
+    
+    lazy var tableView: UITableView = {
+        let tableView = UITableView(frame: CGRect.zero, style: UITableView.Style.grouped)
+        tableView.separatorStyle = .none
+        tableView.backgroundColor = UIColor.clear
+//        tableView.dataSource = self
+//        tableView.delegate = self
+        tableView.rowHeight = 80
+        return tableView
+    }()
+    
+    
+    
+    
+
+}
+
+extension PublishNewAlbumTableView : NXLPhotoLibraryDelegate {
+    
+    /// 加载相机collection
+    func loadCameraRollCollection(collection: NXLAssetsCollection) {
+        self.collections = [collection]
+    }
+    
+    /// 加载所有collections
+    func loadCompleteAllCollection(collections: [NXLAssetsCollection]) {
+        self.collections = collections
+    }
+    
+}
+
+//extension PublishNewAlbumTableView : UITableViewDataSource {
+//    func numberOfSections(in tableView: UITableView) -> Int {
+//        return 1
+//    }
+//
+//    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+//        return self.collections.count
+//    }
+//
+//    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
+//
+//    }
+//}
+//
+//extension PublishNewAlbumTableView : UITableViewDelegate {
+//
+//}

+ 76 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/PublishNewAlbumCollocationTableView/PublishNewAlbumTableViewCell.swift

@@ -0,0 +1,76 @@
+//
+//  PublishNewAlbumTableViewCell.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/11/19.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class PublishNewAlbumTableViewCell: UITableViewCell {
+
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> PublishNewAlbumTableViewCell {
+        let ID = "PublishNewAlbumTableViewCell"
+        tableView.register(PublishNewAlbumTableViewCell.self, forCellReuseIdentifier: ID)
+        let cell : PublishNewAlbumTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! PublishNewAlbumTableViewCell
+        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(coverImage)
+        
+        
+    }
+    
+    private func setupLayouts() {
+        coverImage.snp.makeConstraints { (make) in
+            make.centerY.equalToSuperview()
+            make.left.equalTo(14)
+            make.size.equalTo(60)
+        }
+    }
+    
+    /// 封面图
+    lazy var coverImage: UIImageView = {
+        let coverImage = UIImageView()
+        coverImage.cornerRadius = 4
+        coverImage.masksToBounds = true
+        return coverImage
+    }()
+    
+    /// 标题
+    lazy var titleLabel: UILabel = {
+        let titleLabel = UILabel()
+        titleLabel.font = kMediumFont15
+        titleLabel.textColor = k333333Color
+        return titleLabel
+    }()
+    
+    /// 副标题
+    lazy var detailTitleLabel: UILabel = {
+        let detailTitleLabel = UILabel()
+        detailTitleLabel.font = kMediumFont15
+        detailTitleLabel.textColor = k333333Color
+        return detailTitleLabel
+    }()
+    
+}

+ 77 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/PublishNewAlbumNavigationBarView.swift

@@ -0,0 +1,77 @@
+//
+//  PublishNewAlbumNavigationBarView.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/11/18.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class PublishNewAlbumNavigationBarView: BaseView {
+
+
+    override func setupViews() {
+        backgroundColor = .white
+        addSubview(navigationBgView)
+        navigationBgView.addSubview(backButton)
+        navigationBgView.addSubview(titleButton)
+        navigationBgView.addSubview(finishButton)
+    }
+    
+    override func setupLayouts() {
+        navigationBgView.snp.makeConstraints { (make) in
+            make.top.equalTo(kSafeStatusBarHeight)
+            make.left.right.bottom.equalToSuperview()
+        }
+        backButton.snp.makeConstraints { (make) in
+            make.centerY.equalToSuperview()
+            make.left.equalTo(14)
+            make.size.equalTo(30)
+        }
+        titleButton.snp.makeConstraints { (make) in
+            make.center.equalToSuperview()
+        }
+        titleButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.right, imageTitleSpace: 2)
+        
+        finishButton.snp.makeConstraints { (make) in
+            make.centerY.equalToSuperview()
+            make.right.equalTo(-14)
+        }
+    }
+    
+    lazy var navigationBgView: UIView = {
+        let navigationBgView = UIView()
+        return navigationBgView
+    }()
+    
+    /// 返回按钮
+    lazy var backButton: UIButton = {
+        let backButton = UIButton(type: UIButton.ButtonType.custom)
+        backButton.setImage(kImage(name: "navbar_back_black"), for: UIControl.State.normal)
+        return backButton
+    }()
+    
+    /// 标题按钮
+    lazy var titleButton: UIButton = {
+        let backButton = UIButton(type: UIButton.ButtonType.custom)
+        backButton.setImage(kImage(name: "ico_arrow_down"), for: UIControl.State.normal)
+        backButton.setImage(kImage(name: "ico_arrow_up"), for: UIControl.State.selected)
+        backButton.setTitle("所有照片", for: UIControl.State.normal)
+        backButton.titleLabel?.font = kMediumFont16
+        backButton.setTitleColor(k333333Color, for: UIControl.State.normal)
+        return backButton
+    }()
+    
+    /// 完成
+    lazy var finishButton: UIButton = {
+        let finishButton = UIButton(type: UIButton.ButtonType.custom)
+        finishButton.isEnabled = false
+        finishButton.setTitle("完成", for: UIControl.State.disabled)
+        finishButton.setTitleColor(kThemeColor, for: UIControl.State.normal)
+        finishButton.setTitleColor(k999999Color, for: UIControl.State.normal)
+        backButton.titleLabel?.font = kRegularFont14
+        return finishButton
+    }()
+
+}

+ 17 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/PublishNewAlbumPreView.swift

@@ -0,0 +1,17 @@
+//
+//  PublishNewAlbumPreView.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/11/18.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class PublishNewAlbumPreView: BaseView {
+
+    override func setupViews() {
+        backgroundColor = .blue
+    }
+
+}

+ 189 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/PublishNewAlbumView.swift

@@ -0,0 +1,189 @@
+//
+//  PublishNewAlbumView.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/11/18.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class PublishNewAlbumView: BaseView {
+
+    override func setupViews() {
+        backgroundColor = .yellow
+        addSubview(publishNewAlbumNavigationBarView)
+        addSubview(publishNewAlbumPreView)
+        addSubview(publishNewAlbumCollocationView)
+        addSubview(publishNewAlbumTableView)
+        addGestureRecognizer(panGesture)
+    }
+    
+    override func setupLayouts() {
+        publishNewAlbumNavigationBarView.snp.makeConstraints { (make) in
+            make.top.left.right.equalToSuperview()
+            make.height.equalTo(kNavBarTotalHeight)
+        }
+        publishNewAlbumPreView.snp.makeConstraints { (make) in
+            make.top.equalTo(publishNewAlbumNavigationBarView.snp.bottom)
+            make.left.right.equalToSuperview()
+            make.height.equalTo(kScreenWidth)
+        }
+        publishNewAlbumCollocationView.snp.makeConstraints { (make) in
+            make.top.equalTo(publishNewAlbumPreView.snp.bottom)
+            make.bottom.left.right.equalToSuperview()
+        }
+    }
+    
+    override func setupData() {
+        
+        publishNewAlbumNavigationBarView.backButton.rx.tap.subscribe(onNext: { (_) in
+            let vc = UIViewController.topMost
+            vc?.navigationController?.dismiss(animated: true, completion: nil)
+        }).disposed(by: disposeBag)
+    }
+    
+    /// navigationBar
+    lazy var publishNewAlbumNavigationBarView: PublishNewAlbumNavigationBarView = {
+        let publishNewAlbumNavigationBarView = PublishNewAlbumNavigationBarView()
+        return publishNewAlbumNavigationBarView
+    }()
+    
+    /// publishNewAlbumPreView
+    lazy var publishNewAlbumPreView: PublishNewAlbumPreView = {
+        let publishNewAlbumPreView = PublishNewAlbumPreView()
+        return publishNewAlbumPreView
+    }()
+    
+    /// publishNewAlbumCollocationView
+    lazy var publishNewAlbumCollocationView: PublishNewAlbumCollocationView = {
+        let publishNewAlbumCollocationView = PublishNewAlbumCollocationView()
+        return publishNewAlbumCollocationView
+    }()
+    
+    /// PublishNewAlbumTableView
+    lazy var publishNewAlbumTableView: PublishNewAlbumTableView = {
+        let publishNewAlbumTableView = PublishNewAlbumTableView(configure: configure)
+        publishNewAlbumTableView.frame = CGRect(x: 0, y: kNavBarTotalHeight, width: kScreenWidth, height: kScreenHeight - kNavBarTotalHeight)
+        publishNewAlbumTableView.alpha = 0
+        return publishNewAlbumTableView
+    }()
+    
+    lazy var configure : NXLPhotoPickerConfigure = {
+        var configure = NXLPhotoPickerConfigure()
+        configure.isAllowedVideo = true
+        configure.isAllowedPhotos = true
+        configure.isAllowedLivePhotos = true
+        configure.isUsedCamera = false
+        configure.isAllowedAlbumCloudShared = false
+        configure.isAllowedVideoRecording = false
+        configure.mediaType = nil
+        configure.maxVideoDuration = nil
+        configure.minVideoDuration = 3.0
+        configure.fetchCollectionTypes = nil
+        return configure
+    }()
+    
+    /// 移动
+    lazy var panGesture: UIPanGestureRecognizer = {
+        let panGesture = UIPanGestureRecognizer()
+        panGesture.delegate = self
+        panGesture.addTarget(self, action: #selector(Panned(_:)))
+        return panGesture
+    }()
+    
+    var currentMainViewY : CGFloat = 0.0
+    var mainViewStartY: CGFloat?
+    
+    /// 主view的手势
+    /// - Parameter gesture: 手势
+    @objc func Panned(_ gesture : UIPanGestureRecognizer) {
+//        if self.collectionView.isScrollEnabled
+//        {
+//            return
+//        }
+        switch gesture.state
+        {
+        case .began:
+            mainViewStartY = currentMainViewY
+            break
+        case .changed:
+            mainViewStartY = mainViewStartY == nil ? currentMainViewY - gesture.translation(in: gesture.view).y : mainViewStartY
+            let gestureY = (mainViewStartY ?? 0.0) + gesture.translation(in: gesture.view).y
+            currentMainViewY = gestureY < -kScreenWidth ? -kScreenWidth : gestureY
+            if gestureY < 0.0 {
+                mainViewMoveOp()
+            }
+            break
+        case .ended:
+            let velocityY = gesture.velocity(in: gesture.view).y
+            mainViewMoveToWhere(velocity: velocityY)
+            mainViewStartY = nil
+            break
+        case .cancelled, .failed:
+            mainViewMoveTopOp(velocity: 0.0)
+            mainViewStartY = nil
+            break
+        default:
+            break
+        }
+    }
+    
+    /// 移动到指定的位置
+    func mainViewMoveOp() {
+        frame = CGRect(x: 0, y: currentMainViewY, width: kScreenWidth, height: kScreenHeight - 48 - kSafeTabBarHeight + kScreenWidth)
+    }
+    
+    /// 移动到中间位置
+    func mainViewMoveCenterOp(velocity: CGFloat) {
+        let distination : CGFloat = -kScreenWidth
+        let v = velocity / abs(distination - currentMainViewY) //Conversion unit
+        currentMainViewY = distination
+//        self.collectionView.isScrollEnabled = true
+        UIView.animate(withDuration: 0.4, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: v, options: [.allowUserInteraction, .curveEaseInOut], animations: {
+            [weak self] in
+            guard let strongSelf = self else { return }
+            strongSelf.frame = CGRect(x: 0, y: strongSelf.currentMainViewY, width: kScreenWidth, height: kScreenHeight - 48 - kSafeTabBarHeight + kScreenWidth)
+        }, completion: nil)
+    }
+    
+    /// 移动到顶部
+    func mainViewMoveTopOp(velocity: CGFloat) {
+        let distination : CGFloat = 0.0
+        let v = velocity / abs(distination - currentMainViewY) //Conversion unit
+        currentMainViewY = distination
+//        self.collectionView.isScrollEnabled = true
+        UIView.animate(withDuration: 0.4, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: v, options: [.allowUserInteraction, .curveEaseInOut], animations: {
+            [weak self] in
+            guard let strongSelf = self else { return }
+            strongSelf.frame = CGRect(x: 0, y: strongSelf.currentMainViewY, width: kScreenWidth, height: kScreenHeight - 48 - kSafeTabBarHeight + kScreenWidth)
+        }, completion: nil)
+    }
+    
+    
+    /// 移动到指定的位置
+    func mainViewMoveToWhere(velocity: CGFloat) {
+        if currentMainViewY < 0.0 {
+            if mainViewStartY == -kScreenWidth && currentMainViewY != mainViewStartY  {
+                mainViewMoveTopOp(velocity: velocity)
+            }else {
+                mainViewMoveCenterOp(velocity: velocity)
+            }
+        }else {
+            mainViewMoveTopOp(velocity: velocity)
+        }
+    }
+    
+    let collectionViewPanGesture = UIPanGestureRecognizer()
+    
+    
+
+}
+
+extension PublishNewAlbumView: UIGestureRecognizerDelegate {
+    
+    func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
+        return true
+    }
+    
+}

RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewView/PublishNewRecorderPreview.swift → RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewVideoPhotoView/PublishNewRecorderPreview.swift


RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewView/PublishNewVideoPhotoSetView.swift → RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewVideoPhotoView/PublishNewVideoPhotoSetView.swift


RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewView/PublishNewVideoPhotoView.swift → RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewVideoPhotoView/PublishNewVideoPhotoView.swift


+ 22 - 3
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/ViewController/PublishNewViewController.swift

@@ -47,19 +47,24 @@ class PublishNewViewController: BaseViewController {
     override func setupViews() {
         navigationBar.isHidden = true
         view.addSubview(scrollView)
+        scrollView.addSubview(publishNewAlbumView)
         scrollView.addSubview(publishNewVideoPhotoView)
-        view.addSubview(segmentedView)
+        view.addSubview(segmentedViewBgView)
+        segmentedViewBgView.addSubview(segmentedView)
         view.addSubview(publishNewAuthorizationView)
 
     }
     override func setupLayouts() {
+        segmentedViewBgView.snp.makeConstraints { (make) in
+            make.bottom.left.right.equalToSuperview()
+            make.height.equalTo(48+kSafeTabBarHeight)
+        }
         segmentedView.snp.makeConstraints { (make) in
             make.height.equalTo(48)
             make.left.equalTo(0)
             make.right.equalTo(0)
-            make.bottom.equalTo(-kSafeTabBarHeight)
+            make.top.equalTo(0)
         }
-        
         publishNewAuthorizationView.snp.makeConstraints { (make) in
             make.edges.equalToSuperview()
         }
@@ -112,12 +117,23 @@ class PublishNewViewController: BaseViewController {
         return scrollView
     }()
     
+    /// 相册
+    lazy var publishNewAlbumView: PublishNewAlbumView = {
+        let publishNewAlbumView = PublishNewAlbumView(frame: CGRect(x: 0, y: 0, width: kScreenWidth, height: kScreenHeight - 48 - kSafeTabBarHeight + kScreenWidth ))
+        return publishNewAlbumView
+    }()
     /// 拍视频/拍照片
     private lazy var publishNewVideoPhotoView: PublishNewVideoPhotoView = {
         let publishNewVideoPhotoView = PublishNewVideoPhotoView(frame: CGRect(x: kScreenWidth, y: 0, width: kScreenWidth, height: kScreenHeight))
         publishNewVideoPhotoView.backgroundColor = UIColor.black
         return publishNewVideoPhotoView
     }()
+    /// JXSegmentedViewxBgView
+    lazy var segmentedViewBgView: UIView = {
+        let segmentedViewBgView = UIView()
+        segmentedViewBgView.backgroundColor = UIColor.white
+        return segmentedViewBgView
+    }()
     
     //1.初始化JXSegmentedViewx
     private lazy var segmentedView: JXSegmentedView = {
@@ -227,10 +243,13 @@ extension PublishNewViewController : JXSegmentedViewDelegate {
     func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
         switch index {
         case 0:
+            segmentedViewBgView.backgroundColor = .white
             setRecorder(index: index, isStartPreview: false, duration: 0.5)
         case 1:
+            segmentedViewBgView.backgroundColor = .clear
             setRecorder(index: index, isStartPreview: true, duration: 0.5)
         case 2:
+            segmentedViewBgView.backgroundColor = .clear
             setRecorder(index: index, isStartPreview: true, duration: 0.5)
         default:
             break

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNewCommonView/PublishNewMusicListView/PublishNewMusicListView.swift

@@ -66,7 +66,7 @@ class PublishNewMusicListView: BaseView {
             self?.communityMusicItemModels = (self?.communityMusicItemModels)! + (communityRecommendMusicListModel?.data!)!
             self?.tableView.reloadData()
             MJRefreshManager.mjRefreshManagerNoHiddenFooter(tableView: self?.tableView, pagination: communityRecommendMusicListModel?.pagination)
-            self?.tableView.mj_header.isHidden = true
+            self?.tableView.mj_header?.isHidden = true
         }) { [weak self] (loadingStatus) in
             MJRefreshManager.mjRefreshManagerLoadingStatus(tableView: self?.tableView,loadingStatus: loadingStatus)
         }

+ 3 - 3
RainbowPlanet/RainbowPlanet/Modules/RedemptionAreaModule/RedemptionArea/ViewController/RedemptionAreaViewController.swift

@@ -64,7 +64,7 @@ class RedemptionAreaViewController: BaseViewController {
         observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("RedemptionAreaModuleTop"), object: nil, queue: OperationQueue.main, using: {
             [weak self] (notification) in
             if self?.tableView.contentOffset == CGPoint(x: 0, y: 0) {
-                self?.tableView.mj_header.beginRefreshing()
+                self?.tableView.mj_header?.beginRefreshing()
             }else {
                 self?.tableView.scrollToTop()
             }
@@ -72,12 +72,12 @@ class RedemptionAreaViewController: BaseViewController {
         
         observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("login"), object: nil, queue: OperationQueue.main, using: {
             [weak self] (notification) in
-            self?.tableView.mj_header.beginRefreshing()
+            self?.tableView.mj_header?.beginRefreshing()
         })
         
         observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("loginOut"), object: nil, queue: OperationQueue.main, using: {
             [weak self] (notification) in
-            self?.tableView.mj_header.beginRefreshing()
+            self?.tableView.mj_header?.beginRefreshing()
         })
         
     }

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/RegisterLoginModule/LoginNow/LoginNowView.swift

@@ -7,7 +7,6 @@
 //
 
 import UIKit
-import ESTabBarController_swift
 
 class LoginNowView: UIView {
     
@@ -108,7 +107,8 @@ class LoginNowView: UIView {
     class func initLoginNowView() {
         if  LoginNowView.shared.loginNowView == nil {
             let loginNowView = LoginNowView(frame:CGRect(x: 0, y: -50, width: kScreenWidth, height: 50))
-            let tabbar = BaseTabbarViewController.shared.esTabBarController.tabBar as? ESTabBar
+//            let tabbar = baseTabbarViewController?.esTabBarController.tabBar as? ESTabBar
+            let tabbar = baseTabbarViewController?.tabBar
             tabbar?.addSubview(loginNowView)
             LoginNowView.shared.loginNowView = loginNowView
         }

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

@@ -0,0 +1,164 @@
+//
+//  IMChatPrivateViewController.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/11/13.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import RongIMKit
+import RongIMLib
+import SwiftyMediator
+
+class IMChatPrivateViewController: RCConversationViewController {
+    
+    override var preferredStatusBarStyle: UIStatusBarStyle {
+        return .lightContent
+    }
+    
+    deinit {
+        NXLLog("deinit")
+    }
+    
+    lazy var navigationBar = WRCustomNavigationBar.CustomNavigationBar()
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        setupNavigationBar()
+        setRCIM()
+        
+    }
+    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
+            }
+        }
+        RCIM.shared()?.clearUserInfoCache()
+        self.conversationMessageCollectionView.reloadData()
+    }
+    
+    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
+            vc.backClosure = {
+                self?.conversationDataRepository.removeAllObjects()
+                self?.conversationMessageCollectionView.reloadData()                
+            }
+            self?.navigationController?.pushViewController(vc, animated: true)
+        }
+    }
+    
+    
+    @objc func backAction(sender:Any) {
+        // 推荐页面清理工作
+        leftBarButtonItemPressed(sender)
+    }
+    
+    
+    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) {
+        if #available(iOS 11.0, *) {
+            UIScrollView.appearance().contentInsetAdjustmentBehavior = .automatic
+        } else {
+            if self.responds(to: #selector(setter: self.automaticallyAdjustsScrollViewInsets)) {
+                self.automaticallyAdjustsScrollViewInsets = true
+            }
+        }
+        super.pluginBoardView(pluginBoardView, clickedItemWithTag: tag)
+        WRNavigationBar.defaultNavBarBarTintColor = kThemeColor
+        WRNavigationBar.defaultNavBarTitleColor = UIColor.white
+        WRNavigationBar.defaultNavBarTintColor = UIColor.white
+        WRNavigationBar.defaultNavBarBackgroundImage = UIImage.imageWithColor(color: kThemeColor)
+        UINavigationBar.appearance().tintColor = UIColor.white
+
+    }
+    
+    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))
+        }
+    }
+    
+
+}
+
+extension IMChatPrivateViewController {
+    override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
+        return true
+    }
+}

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

@@ -0,0 +1,163 @@
+//
+//  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 {
+            if rcConversation?.isTop ?? false {
+                RCIMClient.shared()?.setConversationToTop(type!, targetId: targetId!, isTop: false)
+            }else {
+                RCIMClient.shared()?.setConversationToTop(type!, targetId: targetId!, isTop: true)
+            }
+        }
+        
+        if indexPath?.row == 1 {
+            if isBlackList {
+                RCIMClient.shared()?.remove(fromBlacklist: targetId!, success: {
+                }, error: { [weak self] (error) in
+                     self?.onSwitch.setOn(false, animated: false)
+                     NXLLog(error)
+                })
+            }else {
+                RCIMClient.shared()?.add(toBlacklist: targetId!, success: {
+                }, error: { [weak self] (error) in
+                    self?.onSwitch.setOn(false, animated: false)
+                    NXLLog(error)
+                })
+            }
+            
+        }
+    }
+    
+    var title : String? {
+        didSet {
+            titleLabel.text = title
+        }
+    }
+    
+    /// 会话类型
+    var type : RCConversationType?
+    /// 会话目标
+    var targetId : String? {
+        didSet {
+            rcConversation = RCIMClient.shared()?.getConversation(type!, targetId: targetId)
+        }
+    }
+    var rcConversation : RCConversation? {
+        didSet {
+            
+            if indexPath?.row == 0 {
+                self.onSwitch.setOn(rcConversation?.isTop ?? false, animated: true)
+            }
+            
+            if indexPath?.row == 1 {
+                RCIMClient.shared()?.getBlacklistStatus(targetId!, success: {
+                    [weak self] (isBlack) in
+                    //0表示已经在黑名单中,101表示不在黑名单中
+                    if isBlack == 0 {
+                        self?.onSwitch.setOn(true, animated: true)
+                        self?.isBlackList = true
+                    } else {
+                        self?.onSwitch.setOn(false, animated: true)
+                        self?.isBlackList = false
+                    }
+                }, error: { [weak self] (error) in
+                    self?.onSwitch.setOn(false, animated: true)
+                    NXLLog(error)
+                })
+            }
+        }
+    }
+    
+    var isBlackList : Bool = false
+
+
+    
+
+
+}

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

@@ -0,0 +1,67 @@
+//
+//  IMChatPrivateSetTwoTableViewCell.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/11/13.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import RongIMLib
+
+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
+        }
+    }
+    
+    /// 会话目标
+    var targetId : String?
+    /// 会话类型
+    var type : RCConversationType?
+
+}

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

@@ -0,0 +1,131 @@
+//
+//  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?
+    
+    typealias BackClosure = () -> Void
+    var backClosure : BackClosure?
+    
+    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
+    }()
+    
+    override func didMove(toParent parent: UIViewController?) {
+        if !(parent != nil) {
+            
+        }
+    }
+    
+
+}
+
+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]
+            cell.type = type
+            cell.targetId = targetId
+            
+            return cell
+        case 1:
+            let cell = IMChatPrivateSetTwoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+            cell.title =  sections[indexPath.section][indexPath.row]
+            cell.type = type
+            cell.targetId = targetId
+            return cell
+        default:
+            return UITableViewCell()
+        }
+    }
+    
+    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
+        switch indexPath.section {
+        case 1:
+            RCIMClient.shared()?.clearHistoryMessages(type!, targetId: targetId!, recordTime: 0, clearRemote: true, success: { [weak self] in
+                DispatchQueue.main.async {
+                    if let backClosure = self?.backClosure {
+                        backClosure()
+                    }
+                    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
+    }
+}

+ 9 - 5
RainbowPlanet/RainbowPlanet/Modules/RongCloudIMModule/IMChatRoom/ViewController/IMChatRoomViewController.swift

@@ -9,6 +9,7 @@
 import UIKit
 import RongIMKit
 import RongIMLib
+import SwiftyMediator
 
 
 class IMChatRoomViewController: RCConversationViewController {
@@ -120,9 +121,6 @@ class IMChatRoomViewController: RCConversationViewController {
     }
     
     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 {
@@ -130,16 +128,22 @@ class IMChatRoomViewController: RCConversationViewController {
                 self.automaticallyAdjustsScrollViewInsets = true
             }
         }
-        
+        super.pluginBoardView(pluginBoardView, clickedItemWithTag: tag)
         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)
 
     }
     
+    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))
+        }
+    }
+    
 
 }
 

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/SearchModule/SearchContentList/ViewController/SearchContentListViewController.swift

@@ -97,7 +97,7 @@ extension SearchContentListViewController {
             [weak self] (communityPostsModel) -> (Void) in
             
             DIYEmptyView.emptyNoDataActionCollectionView(collectionView: self?.collectionView, imageStr: .six, detailStr: .six, btnTitleStr: .three, btnClickBlock: {
-                BaseTabbarViewController.shared.pushPublishVC()
+                baseTabbarViewController?.pushPublishVC()
 
             })
             

+ 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
         }
     }
 }

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

@@ -62,7 +62,7 @@ class RouterManager: NSObject {
             break
         case .recommend?: //推荐
             let vc = UIViewController.topMost
-            let v1 = BaseTabbarViewController.shared.v1
+            let v1 = baseTabbarViewController?.v1
             v1?.reloadSegmentedView()
             v1?.tabBarController?.selectedIndex = 0
             if vc?.presentingViewController != nil {
@@ -75,7 +75,7 @@ class RouterManager: NSObject {
             break
         case .star?: //星球
             let vc = UIViewController.topMost
-            let v1 = BaseTabbarViewController.shared.v1
+            let v1 = baseTabbarViewController?.v1
             v1?.reloadSegmentedStarView()
             v1?.tabBarController?.selectedIndex = 0
             if vc?.presentingViewController != nil {

+ 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 ""
+    }
+}
+
 
 /// 头部类型
 ///

+ 1 - 1
RainbowPlanet/RainbowPlanet/Supporting Files/Info.plist

@@ -22,7 +22,7 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>1.3.1</string>
+	<string>$(MARKETING_VERSION)</string>
 	<key>CFBundleURLTypes</key>
 	<array>
 		<dict>

+ 6 - 0
RainbowPlanet/RainbowPlanet/Tools/Extension/Extension+Array.swift

@@ -54,3 +54,9 @@ extension Array {
     }
     
 }
+
+extension Array {
+    subscript (safe index: Int) -> Element? {
+        return indices ~= index ? self[index] : nil
+    }
+}

+ 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: 时间戳

+ 19 - 0
RainbowPlanet/RainbowPlanet/Tools/Extension/Extension+PHFetchOptions.swift

@@ -0,0 +1,19 @@
+//
+//  Extension+PHFetchOptions.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/11/19.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import Foundation
+
+extension PHFetchOptions {
+    func merge(predicate: NSPredicate) {
+        if let storePredicate = self.predicate {
+            self.predicate = NSCompoundPredicate(andPredicateWithSubpredicates: [storePredicate, predicate])
+        }else {
+            self.predicate = predicate
+        }
+    }
+}

+ 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: 数字

+ 15 - 0
RainbowPlanet/RainbowPlanet/Tools/Extension/Extension+UIImage.swift

@@ -294,3 +294,18 @@ extension UIImage {
     }
 }
 
+extension UIImage {
+    func upOrientationImage() -> UIImage? {
+        switch imageOrientation {
+        case .up:
+            return self
+        default:
+            UIGraphicsBeginImageContextWithOptions(size, false, scale)
+            draw(in: CGRect(origin: .zero, size: size))
+            let result = UIGraphicsGetImageFromCurrentImageContext()
+            UIGraphicsEndImageContext()
+            return result
+        }
+    }
+}
+

+ 2 - 2
RainbowPlanet/RainbowPlanet/Tools/MJRefreshEX/MJDIYFullScreenHeader.swift

@@ -17,8 +17,8 @@ class MJDIYFullScreenHeader: MJRefreshGifHeader {
         super.prepare()
         // 设置控件的高度
         self.mj_h = 44 + kSafeStatusBarHeight
-        self.stateLabel.isHidden = true
-        self.lastUpdatedTimeLabel.isHidden = true
+        self.stateLabel?.isHidden = true
+        self.lastUpdatedTimeLabel?.isHidden = true
         
         /** 普通闲置状态 */
         var idleImages: [AnyHashable] = []

+ 2 - 2
RainbowPlanet/RainbowPlanet/Tools/MJRefreshEX/MJDIYHeader.swift

@@ -17,8 +17,8 @@ class MJDIYHeader: MJRefreshGifHeader {
         super.prepare()
         // 设置控件的高度
         self.mj_h = 44
-        self.stateLabel.isHidden = true
-        self.lastUpdatedTimeLabel.isHidden = true
+        self.stateLabel?.isHidden = true
+        self.lastUpdatedTimeLabel?.isHidden = true
         
         /** 普通闲置状态 */
         var idleImages: [AnyHashable] = []

+ 0 - 25
RainbowPlanet/RainbowPlanet/Tools/TLPhotoPicker/TLAssetCollection+Extension.swift

@@ -8,31 +8,6 @@
 import Foundation
 import Photos
 
-public enum PHFetchedResultGroupedBy {
-    case year
-    case month
-    case week
-    case day
-    case hour
-    case custom(dateFormat: String)
-    var dateFormat: String {
-        switch self {
-        case .year:
-            return "yyyy"
-        case .month:
-            return "yyyyMM"
-        case .week:
-            return "yyyyMMW"
-        case .day:
-            return "yyyyMMdd"
-        case .hour:
-            return "yyyyMMddHH"
-        case let .custom(dateFormat):
-            return dateFormat
-        }
-    }
-}
-
 extension TLAssetsCollection {
     func enumarateFetchResult(groupedBy: PHFetchedResultGroupedBy) -> Dictionary<String,[TLPHAsset]> {
         let dateFormatter = DateFormatter()

+ 0 - 21
RainbowPlanet/RainbowPlanet/Tools/TLPhotoPicker/TLAssetsCollection.swift

@@ -290,12 +290,6 @@ extension TLPHAsset: Equatable {
     }
 }
 
-extension Array {
-    subscript (safe index: Int) -> Element? {
-        return indices ~= index ? self[index] : nil
-    }
-}
-
 public struct TLAssetsCollection {
     var phAssetCollection: PHAssetCollection? = nil
     var fetchResult: PHFetchResult<PHAsset>? = nil
@@ -366,18 +360,3 @@ public struct TLAssetsCollection {
         return lhs.localIdentifier == rhs.localIdentifier
     }
 }
-
-extension UIImage {
-    func upOrientationImage() -> UIImage? {
-        switch imageOrientation {
-        case .up:
-            return self
-        default:
-            UIGraphicsBeginImageContextWithOptions(size, false, scale)
-            draw(in: CGRect(origin: .zero, size: size))
-            let result = UIGraphicsGetImageFromCurrentImageContext()
-            UIGraphicsEndImageContext()
-            return result
-        }
-    }
-}

+ 0 - 10
RainbowPlanet/RainbowPlanet/Tools/TLPhotoPicker/TLPhotoLibrary.swift

@@ -118,16 +118,6 @@ class TLPhotoLibrary {
     }
 }
 
-extension PHFetchOptions {
-    func merge(predicate: NSPredicate) {
-        if let storePredicate = self.predicate {
-            self.predicate = NSCompoundPredicate(andPredicateWithSubpredicates: [storePredicate, predicate])
-        }else {
-            self.predicate = predicate
-        }
-    }
-}
-
 //MARK: - Load Collection
 extension TLPhotoLibrary {
     func getOption(configure: TLPhotosPickerConfigure) -> PHFetchOptions {

+ 0 - 19
RainbowPlanet/RainbowPlanet/Tools/TLPhotoPicker/TLPhotosPickerViewController.swift

@@ -91,25 +91,6 @@ public struct TLPhotosPickerConfigure {
     }
 }
 
-public enum FetchCollectionType {
-    case assetCollections(PHAssetCollectionType)
-    case topLevelUserCollections
-}
-
-extension FetchCollectionType: Hashable {
-    private var identifier: String {
-        switch self {
-        case let .assetCollections(collectionType):
-            return "assetCollections\(collectionType.rawValue)"
-        case .topLevelUserCollections:
-            return "topLevelUserCollections"
-        }
-    }
-    
-    public func hash(into hasher: inout Hasher) {
-        hasher.combine(self.identifier)
-    }
-}
 
 public enum PopupConfigure {
     case animation(TimeInterval)

+ 41 - 41
RainbowPlanet/RainbowPlanet/Tools/WRNavigationBar/WRNavigationBar.swift

@@ -311,24 +311,24 @@ extension UINavigationController: WRFatherAwakeProtocol
     }
     
     // swizzling system method: popToViewController
-    @objc func wr_popToViewController(_ viewController: UIViewController, animated: Bool) -> [UIViewController]?
-    {
-        setNeedsNavigationBarUpdate(titleColor: viewController.navBarTitleColor)
-        var displayLink:CADisplayLink? = CADisplayLink(target: self, selector: #selector(popNeedDisplay))
-        // UITrackingRunLoopMode: 界面跟踪 Mode,用于 ScrollView 追踪触摸滑动,保证界面滑动时不受其他 Mode 影响
-        // NSRunLoopCommonModes contains kCFRunLoopDefaultMode and UITrackingRunLoopMode
-        displayLink?.add(to: RunLoop.main, forMode: RunLoop.Mode.common)
-        CATransaction.setCompletionBlock {
-            displayLink?.invalidate()
-            displayLink = nil
-            popProperties.displayCount = 0
-        }
-        CATransaction.setAnimationDuration(popProperties.popDuration)
-        CATransaction.begin()
-        let vcs = wr_popToViewController(viewController, animated: animated)
-        CATransaction.commit()
-        return vcs
-    }
+//    @objc func wr_popToViewController(_ viewController: UIViewController, animated: Bool) -> [UIViewController]?
+//    {
+//        setNeedsNavigationBarUpdate(titleColor: viewController.navBarTitleColor)
+//        var displayLink:CADisplayLink? = CADisplayLink(target: self, selector: #selector(popNeedDisplay))
+//        // UITrackingRunLoopMode: 界面跟踪 Mode,用于 ScrollView 追踪触摸滑动,保证界面滑动时不受其他 Mode 影响
+//        // NSRunLoopCommonModes contains kCFRunLoopDefaultMode and UITrackingRunLoopMode
+//        displayLink?.add(to: RunLoop.main, forMode: RunLoop.Mode.common)
+//        CATransaction.setCompletionBlock {
+//            displayLink?.invalidate()
+//            displayLink = nil
+//            popProperties.displayCount = 0
+//        }
+//        CATransaction.setAnimationDuration(popProperties.popDuration)
+//        CATransaction.begin()
+//        let vcs = wr_popToViewController(viewController, animated: animated)
+//        CATransaction.commit()
+//        return vcs
+//    }
     
     // swizzling system method: popToRootViewControllerAnimated
     @objc func wr_popToRootViewControllerAnimated(_ animated: Bool) -> [UIViewController]?
@@ -416,29 +416,29 @@ extension UINavigationController: WRFatherAwakeProtocol
 //==========================================================================
 extension UINavigationController: UINavigationBarDelegate
 {
-    public func navigationBar(_ navigationBar: UINavigationBar, shouldPop item: UINavigationItem) -> Bool
-    {
-        if let topVC = topViewController,
-           let coor = topVC.transitionCoordinator, coor.initiallyInteractive {
-            if #available(iOS 10.0, *) {
-                coor.notifyWhenInteractionChanges({ (context) in
-                    self.dealInteractionChanges(context)
-                })
-            } else {
-                coor.notifyWhenInteractionEnds({ (context) in
-                    self.dealInteractionChanges(context)
-                })
-            }
-            return true
-        }
-        
-        let itemCount = navigationBar.items?.count ?? 0
-        let n = viewControllers.count >= itemCount ? 2 : 1
-        let popToVC = viewControllers[viewControllers.count - n]
-        
-        popToViewController(popToVC, animated: true)
-        return true
-    }
+//    public func navigationBar(_ navigationBar: UINavigationBar, shouldPop item: UINavigationItem) -> Bool
+//    {
+//        if let topVC = topViewController,
+//           let coor = topVC.transitionCoordinator, coor.initiallyInteractive {
+//            if #available(iOS 10.0, *) {
+//                coor.notifyWhenInteractionChanges({ (context) in
+//                    self.dealInteractionChanges(context)
+//                })
+//            } else {
+//                coor.notifyWhenInteractionEnds({ (context) in
+//                    self.dealInteractionChanges(context)
+//                })
+//            }
+//            return true
+//        }
+//
+//        let itemCount = navigationBar.items?.count ?? 0
+//        let n = viewControllers.count >= itemCount ? 2 : 1
+//        let popToVC = viewControllers[viewControllers.count - n]
+//
+//        popToViewController(popToVC, animated: true)
+//        return true
+//    }
     
     // deal the gesture of return break off
     private func dealInteractionChanges(_ context: UIViewControllerTransitionCoordinatorContext)