瀏覽代碼

更新数据

南鑫林 5 年之前
父節點
當前提交
7cf06f03b4
共有 17 個文件被更改,包括 184 次插入56 次删除
  1. 2 2
      RainbowPlanet/Podfile
  2. 17 17
      RainbowPlanet/Podfile.lock
  3. 4 4
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  4. 6 6
      RainbowPlanet/RainbowPlanet/Manager/MJRefreshManager/MJRefreshManager.swift
  5. 1 1
      RainbowPlanet/RainbowPlanet/Modules/CircleModule/CircleAlbum/ViewController/CircleAlbumViewController.swift
  6. 3 3
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Follow/CommunityFollowViewController.swift
  7. 2 2
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Recommend/CommunityRecommnendViewController.swift
  8. 1 1
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/ViewController/CommunityVideoListController.swift
  9. 29 0
      RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageMain/View/MessageHomeThreeSectionTableViewCell.swift
  10. 25 1
      RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageMain/ViewController/MessageMainViewController.swift
  11. 1 1
      RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/PersonalCenterView/PersonViewUserAndOtherHeaderView.swift
  12. 3 3
      RainbowPlanet/RainbowPlanet/Modules/RedemptionAreaModule/RedemptionArea/ViewController/RedemptionAreaViewController.swift
  13. 12 0
      RainbowPlanet/RainbowPlanet/Modules/RongCloudIMModule/IMChatPrivate/ViewController/IMChatPrivateViewController.swift
  14. 58 8
      RainbowPlanet/RainbowPlanet/Modules/RongCloudIMModule/IMChatPrivateSet/View/IMChatPrivateSetOneTableViewCell.swift
  15. 16 3
      RainbowPlanet/RainbowPlanet/Modules/RongCloudIMModule/IMChatPrivateSet/ViewController/IMChatPrivateSetViewController.swift
  16. 2 2
      RainbowPlanet/RainbowPlanet/Tools/MJRefreshEX/MJDIYFullScreenHeader.swift
  17. 2 2
      RainbowPlanet/RainbowPlanet/Tools/MJRefreshEX/MJDIYHeader.swift

+ 2 - 2
RainbowPlanet/Podfile

@@ -39,8 +39,8 @@ target 'RainbowPlanet' do
   # 占位图
   pod 'LYEmptyView'
   # 分段导航栏
-  pod 'JXSegmentedView'
-  pod 'JXPagingView/Paging'
+  pod 'JXSegmentedView', '1.0.0'
+  pod 'JXPagingView/Paging', '1.1.18'
   # 轮播
   pod 'FSPagerView'
   # 小红点

+ 17 - 17
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)
@@ -41,7 +41,7 @@ PODS:
     - 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)
@@ -50,13 +50,13 @@ PODS:
   - JSONModel (1.7.0)
   - JXPagingView/Paging (1.1.18)
   - JXSegmentedView (1.0.0)
-  - KeychainAccess (4.0.0)
+  - 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)
@@ -127,8 +127,8 @@ DEPENDENCIES:
   - InputBarAccessoryView
   - IQKeyboardManagerSwift
   - JSONModel (~> 1.7.0)
-  - JXPagingView/Paging
-  - JXSegmentedView
+  - JXPagingView/Paging (= 1.1.18)
+  - JXSegmentedView (= 1.0.0)
   - KeychainAccess
   - Kingfisher (~> 5.7.1)
   - lottie-ios
@@ -220,11 +220,11 @@ 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
@@ -234,19 +234,19 @@ SPEC CHECKSUMS:
   ESTabBarController-swift: 4fb52ad03d94d0717ef97bc9eb09a5abfdded0a2
   FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
   FSPagerView: 670405b2f18e2a87fa37f20b00de783e562c25a8
-  FWPopupView: 8357f7ab0185e1dcaaf888fbc8ee81ab8dccab72
+  FWPopupView: 94c091c5352cc557cc5e1bff127c02a027059e38
   InputBarAccessoryView: 58a348be7ea2736c7eec60e5c315511c2dbb39fd
   IQKeyboardManagerSwift: c75366f1f19590e8caeae45fcd5815c9289d6099
   JSONModel: 840bc0fcffb24b8454d2c026bf26fea454b8e98d
   JXPagingView: 34bc70f962404e1a0b092ef643e5ccf6882119b2
   JXSegmentedView: 257773dde0c65f86c9d873c5cf93d15c76e170cc
-  KeychainAccess: 57ce5b7653644c49749d35e840bf4e63dbde82f3
+  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 +271,6 @@ SPEC CHECKSUMS:
   YYText: 5c461d709e24d55a182d1441c41dc639a18a4849
   ZipArchive: e25a4373192673e3229ac8d6e9f64a3e5713c966
 
-PODFILE CHECKSUM: b27e2ccae0be82e0a4ac1b5a2293ef59c10e73c5
+PODFILE CHECKSUM: d64cb4bc33c8115a6e4011949628e85da090a924
 
 COCOAPODS: 1.8.4

+ 4 - 4
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -6121,8 +6121,8 @@
 				A77F2C5A2231FB49001BD3F6 /* Frameworks */,
 				A77F2C5B2231FB49001BD3F6 /* Resources */,
 				A74D9D5F2327B54100F05C14 /* Embed App Extensions */,
-				5255517EC082CDBDA16A6A75 /* [CP] Embed Pods Frameworks */,
-				633D32F14EB76DCDC1DC9853 /* [CP] Copy Pods Resources */,
+				95ACAEC80CC4F909AD2D6F4A /* [CP] Embed Pods Frameworks */,
+				B44DBEB9B9F5EE1308FF8647 /* [CP] Copy Pods Resources */,
 			);
 			buildRules = (
 			);
@@ -6304,7 +6304,7 @@
 /* End PBXResourcesBuildPhase section */
 
 /* Begin PBXShellScriptBuildPhase section */
-		5255517EC082CDBDA16A6A75 /* [CP] Embed Pods Frameworks */ = {
+		95ACAEC80CC4F909AD2D6F4A /* [CP] Embed Pods Frameworks */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
@@ -6321,7 +6321,7 @@
 			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RainbowPlanet/Pods-RainbowPlanet-frameworks.sh\"\n";
 			showEnvVarsInLog = 0;
 		};
-		633D32F14EB76DCDC1DC9853 /* [CP] Copy Pods Resources */ = {
+		B44DBEB9B9F5EE1308FF8647 /* [CP] Copy Pods Resources */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			files = (

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

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

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

+ 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

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

@@ -8,6 +8,7 @@
 
 import UIKit
 import RongIMKit
+import SwiftyMediator
 
 class MessageHomeThreeSectionTableViewCell: RCConversationCell {
 
@@ -21,6 +22,14 @@ class MessageHomeThreeSectionTableViewCell: RCConversationCell {
     
     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) {
@@ -33,6 +42,12 @@ class MessageHomeThreeSectionTableViewCell: RCConversationCell {
         }
     }
     
+    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)
@@ -49,3 +64,17 @@ class MessageHomeThreeSectionTableViewCell: RCConversationCell {
         }
     }
 }
+
+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!) {
+        
+    }
+}

+ 25 - 1
RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageMain/ViewController/MessageMainViewController.swift

@@ -77,7 +77,7 @@ class MessageMainViewController: BaseViewController {
         observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("MessageModuleTop"), 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()
             }
@@ -254,6 +254,30 @@ extension MessageMainViewController: UITableViewDelegate,UITableViewDataSource {
         }
     }
     
+    func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
+        if indexPath.section == 2 {
+            return true
+        }
+        return false
+    }
+    
+    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 {

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

@@ -213,7 +213,7 @@ class PersonViewUserAndOtherHeaderView: BaseView {
         chatButton.titleLabel?.font = kMediumFont13
         chatButton.alpha = 0
         chatButton.layer.borderColor = kffffffColor.cgColor
-        chatButton.layer.borderWidth = 1
+        chatButton.layer.borderWidth = 0.5
         chatButton.cornerRadius = 14
         chatButton.masksToBounds = true
         chatButton.rx.tap.subscribe(onNext: {

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

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

@@ -9,6 +9,7 @@
 import UIKit
 import RongIMKit
 import RongIMLib
+import SwiftyMediator
 
 class IMChatPrivateViewController: RCConversationViewController {
     
@@ -71,6 +72,10 @@ class IMChatPrivateViewController: RCConversationViewController {
             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)
         }
     }
@@ -145,6 +150,13 @@ class IMChatPrivateViewController: RCConversationViewController {
 
     }
     
+    override func didTapCellPortrait(_ userId: String!) {
+        let userID = userId.suffix(from: String.Index(utf16Offset: userId.indexOf(key: "-") + 1, in: userId))
+        if Int(userID) != UserModel.shared().getModel()?.uid {
+            Mediator.push(MineRouterModuleType.pushOtherPersonalCenter(uid: Int(userID) ?? 0))
+        }
+    }
+    
 
 }
 

+ 58 - 8
RainbowPlanet/RainbowPlanet/Modules/RongCloudIMModule/IMChatPrivateSet/View/IMChatPrivateSetOneTableViewCell.swift

@@ -89,15 +89,28 @@ class IMChatPrivateSetOneTableViewCell: UITableViewCell {
     
     @objc func onSwitchAction(onSwitch:UISwitch) {
         if indexPath?.row == 0 {
-            RCIMClient.shared()?.setConversationToTop(type!, targetId: targetId!, isTop: onSwitch.isOn)
+            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 {
-            RCIMClient.shared()?.setConversationNotificationStatus(type!, targetId:targetId!, isBlocked: onSwitch.isOn, success: { (RCConversationNotificationStatus) in
-                
-            }, error: { (errorCode) in
-                
-            })
+            if isBlackList {
+                RCIMClient.shared()?.remove(fromBlacklist: targetId!, success: {
+                }, error: { [weak self] (error) in
+                     self?.onSwitch.isOn = true
+                     NXLLog(error)
+                })
+            }else {
+                RCIMClient.shared()?.add(toBlacklist: targetId!, success: {
+                }, error: { [weak self] (error) in
+                    self?.onSwitch.isOn = false
+                    NXLLog(error)
+                })
+            }
+            
         }
     }
     
@@ -107,9 +120,46 @@ class IMChatPrivateSetOneTableViewCell: UITableViewCell {
         }
     }
     
-    /// 会话目标
-    var targetId : String?
     /// 会话类型
     var type : RCConversationType?
+    /// 会话目标
+    var targetId : String? {
+        didSet {
+            rcConversation = RCIMClient.shared()?.getConversation(type!, targetId: targetId)
+        }
+    }
+    var rcConversation : RCConversation? {
+        didSet {
+            
+            if indexPath?.row == 0 {
+                onSwitch.isOn = rcConversation?.isTop ?? false
+            }
+            
+            if indexPath?.row == 1 {
+                RCIMClient.shared()?.getBlacklistStatus(targetId!, success: {
+                    [weak self] (isBlack) in
+                    //0表示已经在黑名单中,101表示不在黑名单中
+                    if isBlack == 0 {
+                        self?.onSwitch.isOn = true
+                        self?.isBlackList = true
+                    }
+                    
+                    if isBlack == 101 {
+                        self?.onSwitch.isOn = false
+                        self?.isBlackList = false
+                    }
+                }, error: { [weak self] (error) in
+                    self?.onSwitch.isOn = false
+                    NXLLog(error)
+                })
+            }
+        }
+    }
+    
+    var isBlackList : Bool = false
+
+
+    
+
 
 }

+ 16 - 3
RainbowPlanet/RainbowPlanet/Modules/RongCloudIMModule/IMChatPrivateSet/ViewController/IMChatPrivateSetViewController.swift

@@ -17,6 +17,9 @@ class IMChatPrivateSetViewController: BaseViewController {
     /// 会话类型
     var type : RCConversationType?
     
+    typealias BackClosure = () -> Void
+    var backClosure : BackClosure?
+    
     let sections = [["置顶聊天","屏蔽消息"],
                     ["清空聊天记录"]]
     
@@ -48,6 +51,12 @@ class IMChatPrivateSetViewController: BaseViewController {
         return tableView
     }()
     
+    override func didMove(toParent parent: UIViewController?) {
+        if !(parent != nil) {
+            
+        }
+    }
+    
 
 }
 
@@ -66,14 +75,15 @@ extension IMChatPrivateSetViewController: UITableViewDelegate,UITableViewDataSou
         case 0:
             let cell = IMChatPrivateSetOneTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
             cell.title =  sections[indexPath.section][indexPath.row]
-            cell.targetId = targetId
             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.targetId = targetId
             cell.type = type
+            cell.targetId = targetId
             return cell
         default:
             return UITableViewCell()
@@ -83,8 +93,11 @@ extension IMChatPrivateSetViewController: UITableViewDelegate,UITableViewDataSou
     func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
         switch indexPath.section {
         case 1:
-            RCIMClient.shared()?.deleteMessages(type!, targetId: targetId!, success: {
+            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

+ 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] = []