jeremy 5 년 전
부모
커밋
a021c9c9e2
16개의 변경된 파일491개의 추가작업 그리고 60개의 파일을 삭제
  1. 60 0
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  2. 5 2
      RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate+Window.swift
  3. 1 0
      RainbowPlanet/RainbowPlanet/Macro/FontMacro.swift
  4. 12 4
      RainbowPlanet/RainbowPlanet/Manager/RongCloudIMManager/RongCloudIMManager.swift
  5. 9 0
      RainbowPlanet/RainbowPlanet/Model/UserModel/UserModel.swift
  6. 2 1
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/CommunityNavigationBarView.swift
  7. 76 43
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Main/CommunityViewController.swift
  8. 16 4
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Recommend/CommunityRecommnendViewController.swift
  9. 33 0
      RainbowPlanet/RainbowPlanet/Modules/MineModule/PushNotificationSettings/View/PushNotificationSettingsOneSectionHeaderView.swift
  10. 74 0
      RainbowPlanet/RainbowPlanet/Modules/MineModule/PushNotificationSettings/View/PushNotificationSettingsTableViewCell.swift
  11. 102 0
      RainbowPlanet/RainbowPlanet/Modules/MineModule/PushNotificationSettings/ViewController/PushNotificationSettingsViewController.swift
  12. 1 1
      RainbowPlanet/RainbowPlanet/Modules/MineModule/Set/View/SetView.swift
  13. 64 0
      RainbowPlanet/RainbowPlanet/Modules/RongCloudIMModule/IMChatRoom/ViewController/IMChatRoomViewController.swift
  14. 32 0
      RainbowPlanet/RainbowPlanet/Router/RongCloudIMRouterModuleType.swift
  15. 0 1
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceUser/SwiftMoyaNetWorkServiceUser.swift
  16. 4 4
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceManger/SwiftMoyaNetWorkManager/ApiMacro.swift

+ 60 - 0
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -427,6 +427,11 @@
 		A7F2D6DD22B2536F0093000B /* CardContentPicVideoCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7F2D6DC22B2536F0093000B /* CardContentPicVideoCollectionViewCell.swift */; };
 		A7F2D6DF22B25B5D0093000B /* CardContentPicVideoCollectionViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7F2D6DE22B25B5D0093000B /* CardContentPicVideoCollectionViewLayout.swift */; };
 		A7F2D6E122B25EF30093000B /* CardContentPicVideoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7F2D6E022B25EF30093000B /* CardContentPicVideoModel.swift */; };
+		A7F304B523331B0800A4850F /* IMChatRoomViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7F304B423331B0800A4850F /* IMChatRoomViewController.swift */; };
+		A7F304B9233324B400A4850F /* RongCloudIMRouterModuleType.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7F304B8233324B400A4850F /* RongCloudIMRouterModuleType.swift */; };
+		A7F304BE2333640F00A4850F /* PushNotificationSettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7F304BD2333640F00A4850F /* PushNotificationSettingsViewController.swift */; };
+		A7F304C12333651400A4850F /* PushNotificationSettingsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7F304C02333651400A4850F /* PushNotificationSettingsTableViewCell.swift */; };
+		A7F304C32333683600A4850F /* PushNotificationSettingsOneSectionHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7F304C22333683600A4850F /* PushNotificationSettingsOneSectionHeaderView.swift */; };
 		A7F3069122E1698400DC7917 /* json_Image_0.png in Resources */ = {isa = PBXBuildFile; fileRef = A7F3069022E1698400DC7917 /* json_Image_0.png */; };
 		A7F3069422E16A5B00DC7917 /* MineRouterModuleType.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7F3069322E16A5B00DC7917 /* MineRouterModuleType.swift */; };
 		A7F3069722E1AE9600DC7917 /* MessageModuleManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7F3069622E1AE9600DC7917 /* MessageModuleManager.swift */; };
@@ -1092,6 +1097,11 @@
 		A7F2D6DC22B2536F0093000B /* CardContentPicVideoCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardContentPicVideoCollectionViewCell.swift; sourceTree = "<group>"; };
 		A7F2D6DE22B25B5D0093000B /* CardContentPicVideoCollectionViewLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardContentPicVideoCollectionViewLayout.swift; sourceTree = "<group>"; };
 		A7F2D6E022B25EF30093000B /* CardContentPicVideoModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardContentPicVideoModel.swift; sourceTree = "<group>"; };
+		A7F304B423331B0800A4850F /* IMChatRoomViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IMChatRoomViewController.swift; sourceTree = "<group>"; };
+		A7F304B8233324B400A4850F /* RongCloudIMRouterModuleType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RongCloudIMRouterModuleType.swift; sourceTree = "<group>"; };
+		A7F304BD2333640F00A4850F /* PushNotificationSettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushNotificationSettingsViewController.swift; sourceTree = "<group>"; };
+		A7F304C02333651400A4850F /* PushNotificationSettingsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushNotificationSettingsTableViewCell.swift; sourceTree = "<group>"; };
+		A7F304C22333683600A4850F /* PushNotificationSettingsOneSectionHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushNotificationSettingsOneSectionHeaderView.swift; sourceTree = "<group>"; };
 		A7F3069022E1698400DC7917 /* json_Image_0.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = json_Image_0.png; sourceTree = "<group>"; };
 		A7F3069322E16A5B00DC7917 /* MineRouterModuleType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MineRouterModuleType.swift; sourceTree = "<group>"; };
 		A7F3069622E1AE9600DC7917 /* MessageModuleManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageModuleManager.swift; sourceTree = "<group>"; };
@@ -2245,6 +2255,7 @@
 		A74144AD233076D10062FB6F /* RongCloudIMModule */ = {
 			isa = PBXGroup;
 			children = (
+				A7F304B323331A4500A4850F /* IMChatRoom */,
 			);
 			path = RongCloudIMModule;
 			sourceTree = "<group>";
@@ -2887,6 +2898,7 @@
 				A7CC75292271A169003C4F38 /* SetPassword */,
 				A7CC751D22719091003C4F38 /* AccountSecurity */,
 				A7CC751222716194003C4F38 /* Set */,
+				A7F304BA2333630200A4850F /* PushNotificationSettings */,
 			);
 			path = MineModule;
 			sourceTree = "<group>";
@@ -3304,6 +3316,7 @@
 			isa = PBXGroup;
 			children = (
 				A770E5DA22CED8C600CBD0A4 /* RouterManager.swift */,
+				A7F304B8233324B400A4850F /* RongCloudIMRouterModuleType.swift */,
 				A770E5DF22CF19FA00CBD0A4 /* CommunityRouterModuleType.swift */,
 				A7DAB33222D881F5005B964E /* H5RouterModuleType.swift */,
 				A7DAB33422D8D3AC005B964E /* RegisterLoginRouterModuleType.swift */,
@@ -4149,6 +4162,48 @@
 			path = PicVideo;
 			sourceTree = "<group>";
 		};
+		A7F304B323331A4500A4850F /* IMChatRoom */ = {
+			isa = PBXGroup;
+			children = (
+				A7F304B623331FDB00A4850F /* ViewController */,
+			);
+			path = IMChatRoom;
+			sourceTree = "<group>";
+		};
+		A7F304B623331FDB00A4850F /* ViewController */ = {
+			isa = PBXGroup;
+			children = (
+				A7F304B423331B0800A4850F /* IMChatRoomViewController.swift */,
+			);
+			path = ViewController;
+			sourceTree = "<group>";
+		};
+		A7F304BA2333630200A4850F /* PushNotificationSettings */ = {
+			isa = PBXGroup;
+			children = (
+				A7F304BF233364B900A4850F /* View */,
+				A7F304BC2333636200A4850F /* ViewController */,
+			);
+			path = PushNotificationSettings;
+			sourceTree = "<group>";
+		};
+		A7F304BC2333636200A4850F /* ViewController */ = {
+			isa = PBXGroup;
+			children = (
+				A7F304BD2333640F00A4850F /* PushNotificationSettingsViewController.swift */,
+			);
+			path = ViewController;
+			sourceTree = "<group>";
+		};
+		A7F304BF233364B900A4850F /* View */ = {
+			isa = PBXGroup;
+			children = (
+				A7F304C02333651400A4850F /* PushNotificationSettingsTableViewCell.swift */,
+				A7F304C22333683600A4850F /* PushNotificationSettingsOneSectionHeaderView.swift */,
+			);
+			path = View;
+			sourceTree = "<group>";
+		};
 		A7F3068F22E1698400DC7917 /* JSONImages */ = {
 			isa = PBXGroup;
 			children = (
@@ -5354,6 +5409,7 @@
 				BDAF83B222B3B67D0004BCC3 /* RecommendCommentFooter.swift in Sources */,
 				A7EE6E102305487700628D39 /* ThumbnailsManager.swift in Sources */,
 				A70B8430228FF6D400882BC5 /* ProductCartCountModel.swift in Sources */,
+				A7F304B9233324B400A4850F /* RongCloudIMRouterModuleType.swift in Sources */,
 				A770E5ED22D4298100CBD0A4 /* CommentReplyView.swift in Sources */,
 				A77F2CA02231FE45001BD3F6 /* BaseWebViewController.swift in Sources */,
 				BDAF83B422B3B6DF0004BCC3 /* RecommendMajorCommentCell.swift in Sources */,
@@ -5498,6 +5554,7 @@
 				A7F2D6E122B25EF30093000B /* CardContentPicVideoModel.swift in Sources */,
 				BD0FAA5622C4752C00DDFB37 /* AliyunPublishTopView.m in Sources */,
 				A74322A922B900180017C367 /* CommunityFindFriendsViewController.swift in Sources */,
+				A7F304BE2333640F00A4850F /* PushNotificationSettingsViewController.swift in Sources */,
 				BD13B6E222BA03BC008BB323 /* PublishTopicTypeCell.swift in Sources */,
 				A72A726822321DBD00B21995 /* UMManager.swift in Sources */,
 				A70DE55222E7E53F009E06BE /* KeyBoardInputView.swift in Sources */,
@@ -5547,6 +5604,7 @@
 				BD6122FA22C36A8100D3F513 /* QUProgressView.m in Sources */,
 				BD10FC0222C6F9770096A34E /* AlivcShortVideoUploadManager.m in Sources */,
 				BDAF83A622B334D90004BCC3 /* SearchContentListCollectionCell.swift in Sources */,
+				A7F304C12333651400A4850F /* PushNotificationSettingsTableViewCell.swift in Sources */,
 				A70EBBC022561179000AD74F /* Extension+UITableView.swift in Sources */,
 				A72A72B022321DE000B21995 /* CGView.swift in Sources */,
 				BD01B20222BC677900CE9F36 /* PublishVideoView.swift in Sources */,
@@ -5648,6 +5706,7 @@
 				A71738AD228AB7B2000AEA6A /* ProductCommentListModel.swift in Sources */,
 				A7C0FDF822B6671C00BC1E86 /* PopularVideoCollectionViewCell.swift in Sources */,
 				BD61229522C3605C00D3F513 /* AliyunEffectModelTransManager.m in Sources */,
+				A7F304C32333683600A4850F /* PushNotificationSettingsOneSectionHeaderView.swift in Sources */,
 				A7E19FA822BA2CDF009BCCE1 /* SearchProductListViewController.swift in Sources */,
 				BD4B50AE22BC815F0073B516 /* PublishFilterCollectionCell.swift in Sources */,
 				A7D5F23322BB9BE600F8E9AF /* H5CommonViewController.swift in Sources */,
@@ -5888,6 +5947,7 @@
 				A72A72CF22321E2700B21995 /* NotificationCenterMacro.swift in Sources */,
 				A72A72BF22321DE000B21995 /* Extension+UIButton.swift in Sources */,
 				BDE376DA22C22A260055E2EA /* UIButton+AliyunBlock.m in Sources */,
+				A7F304B523331B0800A4850F /* IMChatRoomViewController.swift in Sources */,
 				A7D07CBF22B73EE600186014 /* UserPersonalCenterViewController.swift in Sources */,
 				BD27F0AD22CC5E4D00A6514D /* CommunityVideoListController.swift in Sources */,
 				A7CC753C2271C177003C4F38 /* AddressManagerSelfMentionTableViewCell.swift in Sources */,

+ 5 - 2
RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate+Window.swift

@@ -42,9 +42,11 @@ extension AppDelegate {
             DeliveryMethodTypeModel.shared().setModel(model: deliveryMethodTypeModel)
             //网络监听
             //        AlamofireReachabilityManager.shared.reachability()
-            //键盘处理
-            IQKeyboardManagerSwiftManager.shared().initIQKeyboardManagerSwift()
+            
         }
+        //键盘处理
+        IQKeyboardManagerSwiftManager.shared().initIQKeyboardManagerSwift()
+
     }
     
     /// 设置Tabbar
@@ -60,6 +62,7 @@ extension AppDelegate {
                     self?.window?.rootViewController = BaseTabbarViewController.shared.tabBarViewController()
                     
                     self?.setData()
+                    
                 }
             }
         }else {// 进入首页

+ 1 - 0
RainbowPlanet/RainbowPlanet/Macro/FontMacro.swift

@@ -56,6 +56,7 @@ let kRegularFont15 = UIFont(name: "PingFang-SC-Regular", size: 15)
 let kRegularFont16 = UIFont(name: "PingFang-SC-Regular", size: 16)
 let kRegularFont17 = UIFont(name: "PingFang-SC-Regular", size: 17)
 let kRegularFont18 = UIFont(name: "PingFang-SC-Regular", size: 18)
+let kRegularFont19 = UIFont(name: "PingFang-SC-Regular", size: 19)
 let kRegularFont22 = UIFont(name: "PingFang-SC-Regular", size: 22)
 
 

+ 12 - 4
RainbowPlanet/RainbowPlanet/Manager/RongCloudIMManager/RongCloudIMManager.swift

@@ -65,14 +65,21 @@ class RongCloudIMManager: NSObject {
         RCIM.shared()?.globalConversationAvatarStyle = .USER_AVATAR_CYCLE
        //设置优先使用WebView打开URL
         RCIM.shared()?.embeddedWebViewPreferred = true
-        
+
     }
     
     /// 链接融云
     func loginRCIM() {
-        RCIM.shared()?.connect(withToken: "", success: { userId in
+        RCIM.shared()?.connect(withToken:  UserModel.shared().getModel()?.rongCloudToken, success: { userId in
             let userModel = UserModel.shared().getModel()
-            userModel?.RCIMUid = userId
+            if kPersonalService /** 接口前缀-个人服务器*/ {
+            }else if kDevelopSever /** 接口前缀-开发服务器*/ {
+                userModel?.betaRCIMUid = userId
+            } else if kBetaSever /** 接口前缀-测试服务器*/{
+                userModel?.proRCIMUid = userId
+            }else if kProductSever /** 接口前缀-生产服务器*/ {
+                userModel?.devRCIMUid = userId
+            }
             UserModel.shared().setModel(model: userModel ?? UserModel())
         }, error: { [weak self] (status) in
             if status == .CONN_TOKEN_INCORRECT { //token无效
@@ -111,7 +118,8 @@ extension RongCloudIMManager : RCIMUserInfoDataSource {
     /// - Parameter userId: 用户ID
     /// - 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)
+
+        let userInfo = RCUserInfo.init(userId: UserModel.shared().getModel()?.devRCIMUid, name: UserModel.shared().getModel()?.username, portrait: UserModel.shared().getModel()?.avatarurl)
         return completion(userInfo)
     }
 }

+ 9 - 0
RainbowPlanet/RainbowPlanet/Model/UserModel/UserModel.swift

@@ -32,6 +32,8 @@ public class UserModel : NSObject, NSCoding, Mappable{
     var inviteCode : String?
     var bindWeixinUserModel : BindThirdPartyUserModel?
     var bindQQUserModel : BindThirdPartyUserModel?
+    var rongCloudToken : String?
+    
     
     var devRCIMUid : String?
     var betaRCIMUid : String?
@@ -60,6 +62,7 @@ public class UserModel : NSObject, NSCoding, Mappable{
         username <- map["username"]
         bindWeixinUserModel <- map["bind_weixin"]
         bindQQUserModel <- map["bind_qq"]
+        rongCloudToken <- map["rongcloud_token"]
 		
 	}
 
@@ -84,6 +87,7 @@ public class UserModel : NSObject, NSCoding, Mappable{
         inviteCode = aDecoder.decodeObject(forKey: "invite_code") as? String
         bindWeixinUserModel = aDecoder.decodeObject(forKey: "bind_weixin") as? BindThirdPartyUserModel
         bindQQUserModel = aDecoder.decodeObject(forKey: "bind_qq") as? BindThirdPartyUserModel
+        rongCloudToken = aDecoder.decodeObject(forKey: "rongcloud_token") as? String
 
 	}
 
@@ -139,6 +143,9 @@ public class UserModel : NSObject, NSCoding, Mappable{
         if bindQQUserModel != nil{
             aCoder.encode(bindQQUserModel, forKey: "bind_qq")
         }
+        if rongCloudToken != nil{
+            aCoder.encode(rongCloudToken, forKey: "rongcloud_token")
+        }
 
 	}
 
@@ -151,6 +158,8 @@ public class UserModel : NSObject, NSCoding, Mappable{
         //存储Data对象
         UserDefaults.standard.set(modelData, forKey: "UserModel")
         NXLLog("UserModel存储成功")
+        //登录融云
+        RongCloudIMManager.shared.loginRCIM()
     }
 
 

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

@@ -151,7 +151,8 @@ class CommunityNavigationBarView: BaseView {
             if UserModel.isTokenNil() {
                 kAppDelegate.setLogin()
             }else {
-                BaseTabbarViewController.shared.pushPublishVC()
+                Mediator.push(RongCloudIMRouterModuleType.IMChatRoom(targetId: "testUptoyo001", messageCount: 50))
+//                BaseTabbarViewController.shared.pushPublishVC()
             }
         }).disposed(by: disposeBag)
         return leftButton

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

@@ -38,6 +38,9 @@ class CommunityViewController: BaseViewController {
         }
     }
     weak var observe : NSObjectProtocol?
+    
+    var communityRecommendCategorysModel: CommunityRecommendCategorysModel?
+    
     override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
         self.view.frame = CGRect(x: 0, y: 0, width: kScreenWidth, height: kScreenHeight-kTabBarTotalHeight)
@@ -100,6 +103,9 @@ class CommunityViewController: BaseViewController {
     }
     
     override func setupData() {
+        
+        communityPostCategoryApi()
+
         //搜索
         communityNavigationBarView.searchClosure = {
             [weak self] in
@@ -338,7 +344,6 @@ class CommunityViewController: BaseViewController {
         self.listContainerView.defaultSelectedIndex = 1
         self.segmentedDataSource.reloadData(selectedIndex: 1)
         self.listContainerView.reloadData()
-
     }
     //选中星球
     func reloadSegmentedStarView() {
@@ -368,26 +373,25 @@ class CommunityViewController: BaseViewController {
     private lazy var segmentedView: JXSegmentedView = {
         let segmentedView = JXSegmentedView()
         segmentedView.delegate = self
-        segmentedView.dataSource = segmentedDataSource
         segmentedView.indicators = [indicator]
         segmentedView.contentScrollView = listContainerView.scrollView
         segmentedView.defaultSelectedIndex = 1
-        segmentedView.contentEdgeInsetLeft = 100 * kScaleWidth
-        segmentedView.contentEdgeInsetRight = 100 * kScaleWidth
+        segmentedView.contentEdgeInsetLeft = 14
+        segmentedView.contentEdgeInsetRight = 14
         return segmentedView
     }()
     
     //2.初始化dataSource
     private lazy var segmentedDataSource: JXSegmentedTitleDataSource = {
         let segmentedDataSource = JXSegmentedTitleDataSource()
-        segmentedDataSource.titles = ["关注","广场","后院"]
         segmentedDataSource.isTitleColorGradientEnabled = true
-        segmentedDataSource.isItemSpacingAverageEnabled = true
+        segmentedDataSource.isItemSpacingAverageEnabled = false
         segmentedDataSource.isTitleZoomEnabled = true
         segmentedDataSource.titleNormalColor = kbbbbbbColor
         segmentedDataSource.titleSelectedColor = k333333Color
-        segmentedDataSource.titleNormalFont = kBoldFont16
-        segmentedDataSource.titleSelectedFont = kBoldFont20
+        segmentedDataSource.titleNormalFont = kRegularFont15!
+        segmentedDataSource.titleSelectedFont = kRegularFont15
+        segmentedDataSource.titleSelectedZoomScale = 1.13
         segmentedDataSource.isTitleStrokeWidthEnabled = true
         
         //reloadData(selectedIndex:)方法一定要调用,方法内部会刷新数据源数组
@@ -395,12 +399,25 @@ class CommunityViewController: BaseViewController {
         
         return segmentedDataSource
     }()
+    
+    /// 刷新数据
+    func reloadDataDefault() {
+        self.setupViews()
+        self.setupLayouts()
+        segmentedDataSource.titles = ["关注","推荐"]
+        segmentedView.dataSource = segmentedDataSource
+        listContainerView.defaultSelectedIndex = 0
+        segmentedView.defaultSelectedIndex = 0
+        segmentedDataSource.reloadData(selectedIndex: 0)
+        listContainerView.reloadData()
+    }
+    
     //3.初始化指示器indicator
     private lazy var indicator: JXSegmentedIndicatorLineView = {
         let indicator = JXSegmentedIndicatorLineView()
-        indicator.indicatorColor = k333333Color
-        indicator.indicatorHeight = 4
-        indicator.indicatorWidth = 20
+        indicator.indicatorColor = kThemeColor
+        indicator.indicatorHeight = 3
+        indicator.indicatorWidth = 14
         return indicator
     }()
     
@@ -420,37 +437,57 @@ class CommunityViewController: BaseViewController {
     
     var index : Int?
     
+        /// 推荐分类
+        func communityPostCategoryApi() {
+            SwiftMoyaNetWorkServiceCommunity.shared().communityPostCategoryApi(completion: { [weak self] (communityRecommendCategorysModel) -> (Void) in
+                self?.communityRecommendCategorysModel = communityRecommendCategorysModel as? CommunityRecommendCategorysModel
+                self?.communityRecommendCategorysModel?.categoryListName?.insert("关注", at: 0)
+                self?.segmentedDataSource.titles = self?.communityRecommendCategorysModel?.categoryListName ?? ["关注","推荐"]
+                self?.segmentedView.dataSource = self?.segmentedDataSource
+                
+                self?.listContainerView.defaultSelectedIndex = 1
+                self?.segmentedView.defaultSelectedIndex = 1
+                self?.segmentedDataSource.reloadData(selectedIndex: 1)
+                self?.listContainerView.reloadData()
+                self?.segmentedView.reloadData()
+
+//                self?.reloadSegmentedView()
+            }) { [weak self] (loadingStatus) in
+                self?.reloadDataDefault()
+            }
+        }
+    
 }
 
 extension CommunityViewController : JXSegmentedViewDelegate {
     //点击选中或者滚动选中都会调用该方法。适用于只关心选中事件,而不关心具体是点击还是滚动选中的情况。
     func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
-        if index == 0 {
-            communityModuleTopType = .communityModuleFollowTop
-        }
-        if index == 1 {
-            communityModuleTopType = .communityModuleRecommendTop
-        }
-        if index == 2 {
-            communityModuleTopType = .communityModulePlanetTop
-            if (communityNavigationBarIsHidden) {
-                self.communityNavigationBarView.snp.updateConstraints { (make) in
-                    make.top.equalTo(kSafeStatusBarHeight)
-                }
-                self.segmentedView.snp.updateConstraints { (make) in
-                     make.top.equalTo(kNavBarTotalHeight)
-                }
-                communityNavigationBarIsHidden = false
-                UIView.animate(withDuration: 0.15, animations: { [weak self] in
-                    self?.view.layoutIfNeeded()
-                    self?.listContainerView.layoutSubviews()
-                }) { (complete) in}
-            }
-        }
-        communityIndex = index
+//        if index == 0 {
+//            communityModuleTopType = .communityModuleFollowTop
+//        }
+//        if index == 1 {
+//            communityModuleTopType = .communityModuleRecommendTop
+//        }
+//        if index == 2 {
+//            communityModuleTopType = .communityModulePlanetTop
+//            if (communityNavigationBarIsHidden) {
+//                self.communityNavigationBarView.snp.updateConstraints { (make) in
+//                    make.top.equalTo(kSafeStatusBarHeight)
+//                }
+//                self.segmentedView.snp.updateConstraints { (make) in
+//                     make.top.equalTo(kNavBarTotalHeight)
+//                }
+//                communityNavigationBarIsHidden = false
+//                UIView.animate(withDuration: 0.15, animations: { [weak self] in
+//                    self?.view.layoutIfNeeded()
+//                    self?.listContainerView.layoutSubviews()
+//                }) { (complete) in}
+//            }
+//        }
+//        communityIndex = index
         listContainerView.didClickSelectedItem(at: index)
 
-        self.index = index
+//        self.index = index
         
     }
     
@@ -488,17 +525,13 @@ extension CommunityViewController :JXSegmentedListContainerViewDataSource {
     func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate {
         if index == 0 {
             let vc = CommunityFollowViewController()
-            communityModuleTopType = .communityModuleFollowTop
+//            communityModuleTopType = .communityModuleFollowTop
 
-            return vc
-        }else if index == 1 {
-//            let vc = CommunityRecommnendViewController()
-            let vc = CommunityRecommnendSuperViewController()
-            communityModuleTopType = .communityModuleRecommendTop
             return vc
         }else {
-            let vc = CommunityPlanetViewController()
-            communityModuleTopType = .communityModulePlanetTop
+            let vc = CommunityRecommnendViewController()
+            vc.communityRecommendCategoryModel = communityRecommendCategorysModel?.categoryList?[index-1]
+//            communityModuleTopType = .communityModuleRecommendTop
             return vc
         }
     }

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

@@ -641,10 +641,10 @@ extension CommunityRecommnendViewController {
         
         if point.y < 0  {
             //向上
-            if communityNavigationBarIsHidden == false && communityIndex != 2 {
+            if communityNavigationBarIsHidden == false {
                 NotificationCenter.default.post(name: NSNotification.Name("CommunityViewControllerScrollView"), object: true)
                 tableView.snp.updateConstraints { (make) in
-                    make.height.equalTo(kScreenHeight-44-kSafeStatusBarHeight-kTabBarTotalHeight-44)
+                    make.height.equalTo(kScreenHeight-44-kSafeStatusBarHeight-kTabBarTotalHeight)
                 }
                 communityNavigationBarIsHidden = true
 
@@ -652,10 +652,10 @@ extension CommunityRecommnendViewController {
         } else  {
             //向下
             
-            if communityNavigationBarIsHidden && communityIndex != 2 {
+            if communityNavigationBarIsHidden  {
                 NotificationCenter.default.post(name: NSNotification.Name("CommunityViewControllerScrollView"), object: false)
                 tableView.snp.updateConstraints { (make) in
-                    make.height.equalTo(kScreenHeight-44-kNavBarTotalHeight-kTabBarTotalHeight-44)
+                    make.height.equalTo(kScreenHeight-44-kNavBarTotalHeight-kTabBarTotalHeight)
                 }
                 communityNavigationBarIsHidden = false
             }
@@ -671,4 +671,16 @@ extension CommunityRecommnendViewController : JXSegmentedListContainerViewListDe
     func listView() -> UIView {
         return view
     }
+    
+    func listDidAppear() {
+        if communityNavigationBarIsHidden  {
+            tableView.snp.updateConstraints { (make) in
+                make.height.equalTo(kScreenHeight-44-kSafeStatusBarHeight-kTabBarTotalHeight)
+            }
+        }else {
+            tableView.snp.updateConstraints { (make) in
+                make.height.equalTo(kScreenHeight-44-kNavBarTotalHeight-kTabBarTotalHeight)
+            }
+        }
+    }
 }

+ 33 - 0
RainbowPlanet/RainbowPlanet/Modules/MineModule/PushNotificationSettings/View/PushNotificationSettingsOneSectionHeaderView.swift

@@ -0,0 +1,33 @@
+//
+//  PushNotificationSettingsOneSectionHeaderView.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/9/19.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class PushNotificationSettingsOneSectionHeaderView: BaseView {
+
+    override func setupViews() {
+        backgroundColor = kf7f8faColor
+        addSubview(titleLabel)
+    }
+    
+    override func setupLayouts() {
+        titleLabel.snp.makeConstraints { (make) in
+            make.bottom.equalTo(5)
+            make.left.equalTo(14)
+        }
+    }
+    
+    lazy var titleLabel: UILabel = {
+        let titleLabel = UILabel()
+        titleLabel.text = "由你推送通知"
+        titleLabel.textColor = k999999Color
+        titleLabel.font = kRegularFont14
+        return titleLabel
+    }()
+
+}

+ 74 - 0
RainbowPlanet/RainbowPlanet/Modules/MineModule/PushNotificationSettings/View/PushNotificationSettingsTableViewCell.swift

@@ -0,0 +1,74 @@
+//
+//  PushNotificationSettingsTableViewCell.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/9/19.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class PushNotificationSettingsTableViewCell: UITableViewCell {
+
+       class func cellWith(tableView:UITableView,indexPath:IndexPath) -> PushNotificationSettingsTableViewCell {
+        let ID = "PushNotificationSettingsTableViewCell"
+        tableView.register(SetTableViewCell.self, forCellReuseIdentifier: ID)
+        let cell : PushNotificationSettingsTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! PushNotificationSettingsTableViewCell
+        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)
+        addSubview(lineLabel)
+    }
+    
+    private func setupLayouts() {
+        titleLabel.snp.makeConstraints { (make) in
+            make.centerY.equalToSuperview()
+            make.left.equalTo(14)
+        }
+        lineLabel.snp.makeConstraints { (make) in
+            make.bottom.right.equalToSuperview()
+            make.left.equalTo(14)
+            make.height.equalTo(0.5)
+        }
+    }
+    
+    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
+    }()
+    
+    var title : String? {
+        didSet {
+            titleLabel.text = title
+        }
+    }
+}

+ 102 - 0
RainbowPlanet/RainbowPlanet/Modules/MineModule/PushNotificationSettings/ViewController/PushNotificationSettingsViewController.swift

@@ -0,0 +1,102 @@
+//
+//  PushNotificationSettingsViewController.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/9/19.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class PushNotificationSettingsViewController: BaseViewController {
+
+    
+    let sections = [["接收推送通知"],
+                    ["系统通知","评论和回复","赞与互动","关注"]]
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+
+        // Do any additional setup after loading the view.
+    }
+    
+    override func setupViews() {
+        navigationBar.title = "设置"
+        view.addSubview(tableView)
+    }
+    
+    override func setupLayouts() {
+        tableView.snp.makeConstraints { (make) in
+            make.edges.equalToSuperview()
+        }
+    }
+    
+    private lazy var tableView: UITableView = {
+        let tableView = UITableView(frame: CGRect.zero, style: UITableView.Style.grouped)
+        tableView.backgroundColor = kf7f8faColor
+        tableView.delegate = self
+        tableView.dataSource = self
+        tableView.rowHeight = 48
+        tableView.separatorStyle = .none
+        return tableView
+    }()
+
+}
+
+extension PushNotificationSettingsViewController : 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 2:
+            let cell = SetLogoutTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+            cell.title = sections[indexPath.section][indexPath.row]
+            return cell
+        default:
+            let cell = SetTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+            cell.title = sections[indexPath.section][indexPath.row]
+            return cell
+        }
+       
+    }
+    
+    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
+
+    }
+    
+    
+    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
+        switch section {
+        case 1:
+            return nil
+        default:
+            return nil
+        }
+    }
+    
+    
+    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
+        switch section {
+        case 0:
+            return 10
+        default:
+            return 40
+        }
+    }
+    
+    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
+        return nil
+    }
+    
+    func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
+        return 0.0000001
+    }
+    
+}

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/MineModule/Set/View/SetView.swift

@@ -20,7 +20,7 @@ class SetView: BaseView {
     typealias DidSelectRowClosure = (_ indexPath: IndexPath) -> Void
     var didSelectRowClosure : DidSelectRowClosure?
     
-    let sections = [["账号与绑定"],
+    let sections = [["账号与绑定","推送通知设置"],
                     ["用户协议","为由你APP评分","投诉与建议","分享由你APP","版本号"],
                     ["退出登录"]]
     

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

@@ -0,0 +1,64 @@
+//
+//  IMChatRoomViewController.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/9/19.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import RongIMKit
+import RongIMLib
+
+
+class IMChatRoomViewController: RCConversationViewController {
+    
+    /// 历史消息的数量
+    var messageCount : Int32 = -1
+    
+    deinit {
+        NXLLog("deinit")
+    }
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        self.navigationItem.title = "消息";
+        setRCIM()
+        
+    }
+    
+    override func viewWillAppear(_ animated: Bool) {
+        super.viewWillAppear(animated)
+        self.navigationController?.navigationBar.isHidden = false
+        self.conversationMessageCollectionView.reloadData()
+    }
+    
+    override func viewWillDisappear(_ animated: Bool) {
+        super.viewWillDisappear(animated)
+        self.navigationController?.navigationBar.isHidden = true
+    }
+    
+    func setRCIM() {
+        // 默认历史消息
+        self.defaultHistoryMessageCountOfChatRoom = messageCount
+        // 删除地理位置
+        chatSessionInputBarControl.pluginBoardView.removeItem(withTag: 1003)
+        
+        
+//        #define INPUT_MENTIONED_SELECT_TAG 1000
+//        #define PLUGIN_BOARD_ITEM_ALBUM_TAG 1001
+//        #define PLUGIN_BOARD_ITEM_CAMERA_TAG 1002
+//        #define PLUGIN_BOARD_ITEM_FILE_TAG 1006
+//        #define PLUGIN_BOARD_ITEM_VOIP_TAG 1101
+//        #define PLUGIN_BOARD_ITEM_VIDEO_VOIP_TAG 1102
+//        #define PLUGIN_BOARD_ITEM_EVA_TAG 1103
+//        #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
+    }
+
+
+}

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

@@ -0,0 +1,32 @@
+//
+//  RongCloudIMRouterModuleType.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/9/19.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import SwiftyMediator
+import RongIMKit
+
+/// RongCloudIM模块
+///
+/// - IMChatRoom: 聊天室
+
+public enum RongCloudIMRouterModuleType: MediatorTargetType {
+    case IMChatRoom(targetId: String,messageCount:Int32)
+}
+
+extension RongCloudIMRouterModuleType: MediatorSourceType {
+    public var viewController: UIViewController? {
+        switch self {
+        case .IMChatRoom(let targetId,let messageCount):
+            let vc = IMChatRoomViewController.init(conversationType: .ConversationType_CHATROOM, targetId: targetId)
+            vc?.messageCount = messageCount
+            return vc
+        }
+    }
+}
+
+
+

+ 0 - 1
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceUser/SwiftMoyaNetWorkServiceUser.swift

@@ -114,7 +114,6 @@ public class SwiftMoyaNetWorkServiceUser: NSObject {
         
         SwiftMoyaNetWorkManager.shared.requestObject(UserModel.self,target: MultiTarget(SwiftMoyaServiceUserApi.userRefresh(parameters: parameters)), completion: { (userModel) in
             UserModel.shared().setModel(model: userModel as! UserModel)
-            
             completion("")
         }) {
             (loadingStatus) in

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

@@ -10,15 +10,15 @@ import Foundation
 
 /// Service
 let kPersonalService = false
-let kDevelopSever = false
+let kDevelopSever = true
 let kBetaSever = false
-let kProductSever = true
+let kProductSever = false
 
 /// H5Service
 let kH5PersonalService = false
-let kH5DevelopSever = false
+let kH5DevelopSever = true
 let kH5BetaSever = false
-let kH5ProductSever = true
+let kH5ProductSever = false
 
 // MARK: - 数据服务器
 public func kApiDataPrefix() -> String {