소스 검색

no message

南鑫林 5 년 전
부모
커밋
9c7ce2444f
16개의 변경된 파일544개의 추가작업 그리고 40개의 파일을 삭제
  1. 39 3
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  2. 3 3
      RainbowPlanet/RainbowPlanet/Base/BaseTabbarViewController/BaseTabbarViewController.swift
  3. 1 1
      RainbowPlanet/RainbowPlanet/Manager/RongCloudIMManager/RongCloudIMManager.swift
  4. 14 14
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Main/CommunityViewController.swift
  5. 1 0
      RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageMain/ViewController/MessageMainViewController.swift
  6. 6 2
      RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/OtherPersonalCenter/ViewController/OtherPersonalCenterViewController.swift
  7. 131 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/PublishNewAlbumCollocationTableView/PublishNewAlbumCollocationView.swift
  8. 54 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/PublishNewAlbumCollocationTableView/PublishNewAlbumTableView.swift
  9. 77 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/PublishNewAlbumNavigationBarView.swift
  10. 17 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/PublishNewAlbumPreView.swift
  11. 164 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/PublishNewAlbumView.swift
  12. 0 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewVideoPhotoView/PublishNewRecorderPreview.swift
  13. 0 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewVideoPhotoView/PublishNewVideoPhotoSetView.swift
  14. 0 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewVideoPhotoView/PublishNewVideoPhotoView.swift
  15. 22 3
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/ViewController/PublishNewViewController.swift
  16. 15 14
      RainbowPlanet/RainbowPlanet/Modules/RongCloudIMModule/IMChatPrivate/ViewController/IMChatPrivateViewController.swift

+ 39 - 3
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -408,6 +408,11 @@
 		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 */; };
+		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 */; };
@@ -1192,6 +1197,11 @@
 		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>"; };
+		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>"; };
@@ -4069,6 +4079,26 @@
 			path = SwiftMoyaServiceSMS;
 			sourceTree = "<group>";
 		};
+		A7CA33F923838354009B0C40 /* PublishNewAlbumCollocationTableView */ = {
+			isa = PBXGroup;
+			children = (
+				A7CC19BB238271080053B4B5 /* PublishNewAlbumCollocationView.swift */,
+				A7CA33FA2383888F009B0C40 /* PublishNewAlbumTableView.swift */,
+			);
+			path = PublishNewAlbumCollocationTableView;
+			sourceTree = "<group>";
+		};
+		A7CC19B623826FC60053B4B5 /* PublishNewAlbumView */ = {
+			isa = PBXGroup;
+			children = (
+				A7CC19B42382678E0053B4B5 /* PublishNewAlbumView.swift */,
+				A7CC19B7238270940053B4B5 /* PublishNewAlbumNavigationBarView.swift */,
+				A7CC19B9238270D30053B4B5 /* PublishNewAlbumPreView.swift */,
+				A7CA33F923838354009B0C40 /* PublishNewAlbumCollocationTableView */,
+			);
+			path = PublishNewAlbumView;
+			sourceTree = "<group>";
+		};
 		A7CC751222716194003C4F38 /* Set */ = {
 			isa = PBXGroup;
 			children = (
@@ -4727,7 +4757,8 @@
 		A7EE5AC8236C131C00309931 /* View */ = {
 			isa = PBXGroup;
 			children = (
-				A7EE5ACD236C131C00309931 /* PublishNewView */,
+				A7CC19B623826FC60053B4B5 /* PublishNewAlbumView */,
+				A7EE5ACD236C131C00309931 /* PublishNewVideoPhotoView */,
 				A7EE5AC9236C131C00309931 /* PublishNewProgress */,
 				A7EE5ACB236C131C00309931 /* PublishNewPopView */,
 				A7EE5AD1236C131C00309931 /* PublishNewMusicView */,
@@ -4753,14 +4784,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 */ = {
@@ -6416,6 +6447,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 */,
@@ -6631,6 +6663,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 */,
@@ -6698,6 +6731,7 @@
 				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 */,
@@ -6725,6 +6759,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 */,
@@ -6933,6 +6968,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 */,

+ 3 - 3
RainbowPlanet/RainbowPlanet/Base/BaseTabbarViewController/BaseTabbarViewController.swift

@@ -90,10 +90,10 @@ class BaseTabbarViewController: UITabBarController {
         if !AliyunVodUpToyoPublishManager.shared.isUploading { // 是否正在上传中
             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
-//                    let  pickVc = PublishNewViewController()
+//                    let pickVc = PublishViewController()
 //                    pickVc.index = index
+                    let  pickVc = PublishNewViewController()
+                    pickVc.index = index
                     let nav = BaseNavigationViewController.init(rootViewController: pickVc)
                     nav.modalPresentationStyle = .fullScreen
                     self?.present(nav, animated: true, completion: nil)

+ 1 - 1
RainbowPlanet/RainbowPlanet/Manager/RongCloudIMManager/RongCloudIMManager.swift

@@ -65,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

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

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

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

@@ -11,6 +11,7 @@ import UIKit
 import Lottie
 import Kingfisher
 import RongIMLib
+import RongIMKit
 import SwiftyJSON
 import ObjectMapper
 import SwiftyMediator

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

+ 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]) {
+//
+//    }
+//}

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

@@ -0,0 +1,54 @@
+//
+//  PublishNewAlbumTableView.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/11/19.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class PublishNewAlbumTableView: BaseView {
+
+    /*
+    // Only override draw() if you perform custom drawing.
+    // An empty implementation adversely affects performance during animation.
+    override func draw(_ rect: CGRect) {
+        // Drawing code
+    }
+    */
+    
+    /// 资源
+    lazy var photoLibrary: TLPhotoLibrary = {
+        let photoLibrary = TLPhotoLibrary()
+        photoLibrary.delegate = self
+        return photoLibrary
+    }()
+    
+    /// 资源
+    lazy var collections: Array<TLAssetsCollection> = {
+        let collections = Array<TLAssetsCollection>()
+        return collections
+    }()
+    
+    
+    override func setupViews() {
+        
+    }
+
+}
+
+extension PublishNewAlbumTableView : TLPhotoLibraryDelegate {
+    
+    /// 加载相机collection
+    func loadCameraRollCollection(collection: TLAssetsCollection) {
+        self.collections = [collection]
+    }
+    
+    /// 加载所有collections
+    func loadCompleteAllCollection(collections: [TLAssetsCollection]) {
+        self.collections = collections
+    }
+    
+    
+}

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

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

@@ -0,0 +1,164 @@
+//
+//  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)
+        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
+    }()
+    
+    /// 移动
+    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

+ 15 - 14
RainbowPlanet/RainbowPlanet/Modules/RongCloudIMModule/IMChatPrivate/ViewController/IMChatPrivateViewController.swift

@@ -29,6 +29,21 @@ class IMChatPrivateViewController: RCConversationViewController {
         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()
     {
@@ -86,20 +101,6 @@ class IMChatPrivateViewController: RCConversationViewController {
         leftBarButtonItemPressed(sender)
     }
     
-    override func viewWillAppear(_ animated: Bool) {
-        super.viewWillAppear(animated)
-        self.navigationItem.leftBarButtonItem = nil
-        self.navigationItem.rightBarButtonItem = nil
-        self.navigationController?.navigationBar.isHidden = true
-        if #available(iOS 11.0, *) {
-            UIScrollView.appearance().contentInsetAdjustmentBehavior = .never
-        } else {
-            if self.responds(to: #selector(setter: self.automaticallyAdjustsScrollViewInsets)) {
-                self.automaticallyAdjustsScrollViewInsets = false
-            }
-        }
-    }
-    
     
     func setRCIM() {
         // 您可以针对群聊、聊天室、单聊等不同场景,自己定制是否显示发送方的名字。