Ver código fonte

Merge branch 'develop' into feature/jeremy

南鑫林 5 anos atrás
pai
commit
40f1e7cb4f
18 arquivos alterados com 717 adições e 135 exclusões
  1. 16 8
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  2. 53 0
      RainbowPlanet/RainbowPlanet/Model/CommunityModel/CommunityMusicCategoryListModel.swift
  3. 63 0
      RainbowPlanet/RainbowPlanet/Model/CommunityModel/CommunityRecommendMusicListModel.swift
  4. 1 1
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoEdit/Controller/AliyunEditViewController.m
  5. 167 11
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMusicAbout/PublishMusicChooseView.swift
  6. 53 30
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishTakeVideo/PublishMusicItemCell.swift
  7. 169 0
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMusicAbout/PublishMusicListController.swift
  8. 25 0
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMusicAbout/PublishRecommendMusicController.swift
  9. 0 59
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishTakeVideo/PublishMusicHeader.swift
  10. 2 21
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishTakeVideo/PublishMusicView.swift
  11. 71 0
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceCommunity/SwiftMoyaNetWorkServiceCommunity.swift
  12. 53 5
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceCommunity/SwiftMoyaServiceCommunityApi.swift
  13. 22 0
      RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/music_btn_loading.imageset/Contents.json
  14. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/music_btn_loading.imageset/music_btn_loading@2x.png
  15. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/music_btn_loading.imageset/music_btn_loading@3x.png
  16. 22 0
      RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/music_ico_selected.imageset/Contents.json
  17. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/music_ico_selected.imageset/music_ico_selected@2x.png
  18. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/music_ico_selected.imageset/music_ico_selected@3x.png

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

@@ -474,6 +474,7 @@
 		BD0FAA6322C4C35E00DDFB37 /* AliyunCropViewBottomView.m in Sources */ = {isa = PBXBuildFile; fileRef = BD0FAA5D22C4C35D00DDFB37 /* AliyunCropViewBottomView.m */; };
 		BD0FAA6422C4C35E00DDFB37 /* AliyunCropThumbnailView.m in Sources */ = {isa = PBXBuildFile; fileRef = BD0FAA5F22C4C35D00DDFB37 /* AliyunCropThumbnailView.m */; };
 		BD0FAA6522C4C35E00DDFB37 /* AliyunCycleProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = BD0FAA6122C4C35E00DDFB37 /* AliyunCycleProgressView.m */; };
+		BD10121122DEBAF0008DF528 /* CommunityRecommendMusicListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD10121022DEBAF0008DF528 /* CommunityRecommendMusicListModel.swift */; };
 		BD108C9322A60C2100837DAB /* HGImageCompleteButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD108C8E22A60C2100837DAB /* HGImageCompleteButton.swift */; };
 		BD108C9422A60C2100837DAB /* HGImageCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD108C8F22A60C2100837DAB /* HGImageCollectionViewController.swift */; };
 		BD108C9522A60C2100837DAB /* HGImageCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD108C9022A60C2100837DAB /* HGImageCollectionViewCell.swift */; };
@@ -481,8 +482,6 @@
 		BD108C9722A60C2100837DAB /* HGImagePickerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD108C9222A60C2100837DAB /* HGImagePickerController.swift */; };
 		BD108C9A22A60C3300837DAB /* HGImage.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BD108C9822A60C3200837DAB /* HGImage.xcassets */; };
 		BD108C9B22A60C3300837DAB /* HGImage.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BD108C9922A60C3300837DAB /* HGImage.storyboard */; };
-		BD10CD0822BFC1C20040796E /* PublishMusicItemCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD10CD0722BFC1C20040796E /* PublishMusicItemCell.swift */; };
-		BD10CD0A22BFC5E40040796E /* PublishMusicHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD10CD0922BFC5E40040796E /* PublishMusicHeader.swift */; };
 		BD10CD0C22BFCC7C0040796E /* PublishMusicView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD10CD0B22BFCC7C0040796E /* PublishMusicView.swift */; };
 		BD10FBFE22C6F7D90096A34E /* AliyunPublishService.m in Sources */ = {isa = PBXBuildFile; fileRef = BD10FBFB22C6F7D80096A34E /* AliyunPublishService.m */; };
 		BD10FBFF22C6F7D90096A34E /* AlivcShortVideoPublishManager.m in Sources */ = {isa = PBXBuildFile; fileRef = BD10FBFD22C6F7D90096A34E /* AlivcShortVideoPublishManager.m */; };
@@ -557,6 +556,7 @@
 		BD2FCBE622B2586C0006D974 /* CommunityTagCollectionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD2FCBE522B2586C0006D974 /* CommunityTagCollectionCell.swift */; };
 		BD2FCBEA22B267280006D974 /* RecommendNoneCommentCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD2FCBE922B267280006D974 /* RecommendNoneCommentCell.swift */; };
 		BD3474F522857B85000908C5 /* CommonPayHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD3474F422857B85000908C5 /* CommonPayHeader.swift */; };
+		BD377DA422DEC2CA00D5B903 /* CommunityMusicCategoryListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD377DA322DEC2CA00D5B903 /* CommunityMusicCategoryListModel.swift */; };
 		BD37E38322CDF5BA003A14A2 /* CommunityVideoTopicView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD37E38222CDF5BA003A14A2 /* CommunityVideoTopicView.swift */; };
 		BD37E38522CDF91A003A14A2 /* CommunityVideoSelTopicCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD37E38422CDF91A003A14A2 /* CommunityVideoSelTopicCell.swift */; };
 		BD37E38722CE200E003A14A2 /* CommunityAllCommentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD37E38622CE200E003A14A2 /* CommunityAllCommentView.swift */; };
@@ -652,6 +652,8 @@
 		BDD54A2822C31D60005BBE19 /* LocalFilter.json in Resources */ = {isa = PBXBuildFile; fileRef = BDD54A2322C31D5F005BBE19 /* LocalFilter.json */; };
 		BDD54A2922C31D60005BBE19 /* LocalMV.json in Resources */ = {isa = PBXBuildFile; fileRef = BDD54A2422C31D5F005BBE19 /* LocalMV.json */; };
 		BDD54A2B22C31D78005BBE19 /* filter in Resources */ = {isa = PBXBuildFile; fileRef = BDD54A2A22C31D78005BBE19 /* filter */; };
+		BDD9377522DEF371002D11B3 /* PublishMusicListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDD9377422DEF371002D11B3 /* PublishMusicListCell.swift */; };
+		BDD9377722DF3B47002D11B3 /* PublishMusicListController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDD9377622DF3B47002D11B3 /* PublishMusicListController.swift */; };
 		BDDF3B28228EBB72003A7D16 /* ProductRefundReasonModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDDF3B27228EBB72003A7D16 /* ProductRefundReasonModel.swift */; };
 		BDE3045D22851E4F001D050F /* ProductCartListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDE3045C22851E4F001D050F /* ProductCartListModel.swift */; };
 		BDE3045F228554CA001D050F /* ProductCartAmountModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDE3045E228554CA001D050F /* ProductCartAmountModel.swift */; };
@@ -1201,6 +1203,7 @@
 		BD0FAA6022C4C35E00DDFB37 /* AliyunCropThumbnailView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AliyunCropThumbnailView.h; sourceTree = "<group>"; };
 		BD0FAA6122C4C35E00DDFB37 /* AliyunCycleProgressView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AliyunCycleProgressView.m; sourceTree = "<group>"; };
 		BD0FAA6222C4C35E00DDFB37 /* AliyunCropViewBottomView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AliyunCropViewBottomView.h; sourceTree = "<group>"; };
+		BD10121022DEBAF0008DF528 /* CommunityRecommendMusicListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityRecommendMusicListModel.swift; sourceTree = "<group>"; };
 		BD108C8E22A60C2100837DAB /* HGImageCompleteButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HGImageCompleteButton.swift; sourceTree = "<group>"; };
 		BD108C8F22A60C2100837DAB /* HGImageCollectionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HGImageCollectionViewController.swift; sourceTree = "<group>"; };
 		BD108C9022A60C2100837DAB /* HGImageCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HGImageCollectionViewCell.swift; sourceTree = "<group>"; };
@@ -1208,8 +1211,6 @@
 		BD108C9222A60C2100837DAB /* HGImagePickerController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HGImagePickerController.swift; sourceTree = "<group>"; };
 		BD108C9822A60C3200837DAB /* HGImage.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = HGImage.xcassets; sourceTree = "<group>"; };
 		BD108C9922A60C3300837DAB /* HGImage.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = HGImage.storyboard; sourceTree = "<group>"; };
-		BD10CD0722BFC1C20040796E /* PublishMusicItemCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishMusicItemCell.swift; sourceTree = "<group>"; };
-		BD10CD0922BFC5E40040796E /* PublishMusicHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishMusicHeader.swift; sourceTree = "<group>"; };
 		BD10CD0B22BFCC7C0040796E /* PublishMusicView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishMusicView.swift; sourceTree = "<group>"; };
 		BD10FBFA22C6F7D70096A34E /* AlivcShortVideoPublishManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlivcShortVideoPublishManager.h; sourceTree = "<group>"; };
 		BD10FBFB22C6F7D80096A34E /* AliyunPublishService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AliyunPublishService.m; sourceTree = "<group>"; };
@@ -1293,6 +1294,7 @@
 		BD2FCBE522B2586C0006D974 /* CommunityTagCollectionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityTagCollectionCell.swift; sourceTree = "<group>"; };
 		BD2FCBE922B267280006D974 /* RecommendNoneCommentCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecommendNoneCommentCell.swift; sourceTree = "<group>"; };
 		BD3474F422857B85000908C5 /* CommonPayHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommonPayHeader.swift; sourceTree = "<group>"; };
+		BD377DA322DEC2CA00D5B903 /* CommunityMusicCategoryListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityMusicCategoryListModel.swift; sourceTree = "<group>"; };
 		BD37E38222CDF5BA003A14A2 /* CommunityVideoTopicView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityVideoTopicView.swift; sourceTree = "<group>"; };
 		BD37E38422CDF91A003A14A2 /* CommunityVideoSelTopicCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityVideoSelTopicCell.swift; sourceTree = "<group>"; };
 		BD37E38622CE200E003A14A2 /* CommunityAllCommentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityAllCommentView.swift; sourceTree = "<group>"; };
@@ -1439,6 +1441,8 @@
 		BDD54A2322C31D5F005BBE19 /* LocalFilter.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = LocalFilter.json; sourceTree = "<group>"; };
 		BDD54A2422C31D5F005BBE19 /* LocalMV.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = LocalMV.json; sourceTree = "<group>"; };
 		BDD54A2A22C31D78005BBE19 /* filter */ = {isa = PBXFileReference; lastKnownFileType = folder; path = filter; sourceTree = "<group>"; };
+		BDD9377422DEF371002D11B3 /* PublishMusicListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishMusicListCell.swift; sourceTree = "<group>"; };
+		BDD9377622DF3B47002D11B3 /* PublishMusicListController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishMusicListController.swift; sourceTree = "<group>"; };
 		BDDF3B27228EBB72003A7D16 /* ProductRefundReasonModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductRefundReasonModel.swift; sourceTree = "<group>"; };
 		BDE3045C22851E4F001D050F /* ProductCartListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductCartListModel.swift; sourceTree = "<group>"; };
 		BDE3045E228554CA001D050F /* ProductCartAmountModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductCartAmountModel.swift; sourceTree = "<group>"; };
@@ -4212,6 +4216,8 @@
 				A7C2567B22CD8EEE00420828 /* CommunityPostCommentsModel.swift */,
 				A7C2567D22CD90D700420828 /* CommunityPostReplysModel.swift */,
 				A770E5E822D383E500CBD0A4 /* CommunityCustomCommnetModel.swift */,
+				BD10121022DEBAF0008DF528 /* CommunityRecommendMusicListModel.swift */,
+				BD377DA322DEC2CA00D5B903 /* CommunityMusicCategoryListModel.swift */,
 			);
 			path = CommunityModel;
 			sourceTree = "<group>";
@@ -4596,8 +4602,6 @@
 				BD01B1FE22BC677900CE9F36 /* PublishFilterView.swift */,
 				BD4B50AD22BC815F0073B516 /* PublishFilterCollectionCell.swift */,
 				BD10CD0B22BFCC7C0040796E /* PublishMusicView.swift */,
-				BD10CD0922BFC5E40040796E /* PublishMusicHeader.swift */,
-				BD10CD0722BFC1C20040796E /* PublishMusicItemCell.swift */,
 			);
 			path = PublishTakeVideo;
 			sourceTree = "<group>";
@@ -5127,6 +5131,8 @@
 			isa = PBXGroup;
 			children = (
 				BDBC0AF122DDD7E800CA788E /* PublishMusicChooseView.swift */,
+				BDD9377622DF3B47002D11B3 /* PublishMusicListController.swift */,
+				BDD9377422DEF371002D11B3 /* PublishMusicListCell.swift */,
 				BD5CA89122DD73A500364A67 /* PublishMusicVolumnView.swift */,
 				BDBC0AF522DDEA4E00CA788E /* PublishRecommendMusicController.swift */,
 			);
@@ -6072,12 +6078,14 @@
 				A770E5F522D5BC2000CBD0A4 /* CommonH5.swift in Sources */,
 				A739121D229F75F50033177E /* JXPagingListContainerView.swift in Sources */,
 				A72A7386223396CB00B21995 /* SwiftMoyaNetWorkManager.swift in Sources */,
+				BD10121122DEBAF0008DF528 /* CommunityRecommendMusicListModel.swift in Sources */,
 				A7E19FAA22BA2CF1009BCCE1 /* SearchUserListViewController.swift in Sources */,
 				A7D07CCD22B77D2E00186014 /* UserPersonalCenterOrderView.swift in Sources */,
 				A70B2C252286C03800B2449F /* NXLPageControl.swift in Sources */,
 				BDF7C5DB22D72405007F3B79 /* CommunityVideoSubCommentController.swift in Sources */,
 				A7F2D6C122B0D1CB0093000B /* CommunityFollowTableHeaderView.swift in Sources */,
 				A7C0FE0022B66E5A00BC1E86 /* CommunityFeaturedTopicsViewController.swift in Sources */,
+				BDD9377522DEF371002D11B3 /* PublishMusicListCell.swift in Sources */,
 				A7A98E12227ECA11005306E9 /* ProductSearchModel.swift in Sources */,
 				BD61225E22C3561C00D3F513 /* AlivcRecordFocusView.m in Sources */,
 				A71AF0B0226EF185001730FE /* SearchCollectionViewCell.swift in Sources */,
@@ -6310,6 +6318,7 @@
 				BD13B6C522BA034D008BB323 /* PublishEditAddAddressCell.swift in Sources */,
 				A7B4E71F228131720012914A /* ProductSlidingLeftRightCollectionViewCell.swift in Sources */,
 				BD37E38722CE200E003A14A2 /* CommunityAllCommentView.swift in Sources */,
+				BD377DA422DEC2CA00D5B903 /* CommunityMusicCategoryListModel.swift in Sources */,
 				A7778CA92244904500C7C47A /* Extension+Gifu.GIFImageView.swift in Sources */,
 				A71738AB22898660000AEA6A /* ShopModel.swift in Sources */,
 				A7FF1557228AC3E800A85748 /* ProductAllCommentViewController.swift in Sources */,
@@ -6360,7 +6369,6 @@
 				A7DF50E322A55AB600998908 /* BrowsePicturesPagerViewCell.swift in Sources */,
 				A77F2CC822320627001BD3F6 /* WRCustomNavigationBar.swift in Sources */,
 				A72623DB22C2FC3C00AEF875 /* MessageHomeTwoCollectionViewCell.swift in Sources */,
-				BD10CD0822BFC1C20040796E /* PublishMusicItemCell.swift in Sources */,
 				A7FF1564228C696B00A85748 /* OrderListView.swift in Sources */,
 				A70B2C072284305400B2449F /* ProductModel.swift in Sources */,
 				A72A72BC22321DE000B21995 /* Extension+UIAlertController.swift in Sources */,
@@ -6527,6 +6535,7 @@
 				A72A72B522321DE000B21995 /* Extension+UITextView.swift in Sources */,
 				A770E61922D6780600CBD0A4 /* ShareCommunityVideoView.swift in Sources */,
 				A7DAB33922DC2B83005B964E /* ShareRouterModuleType.swift in Sources */,
+				BDD9377722DF3B47002D11B3 /* PublishMusicListController.swift in Sources */,
 				BD6122FD22C36B0F00D3F513 /* AlivcBaseViewController.m in Sources */,
 				BD0FAA6522C4C35E00DDFB37 /* AliyunCycleProgressView.m in Sources */,
 				A7AA9F6322C62B270086498B /* CommunityRecommnendViewController.swift in Sources */,
@@ -6543,7 +6552,6 @@
 				BD13B6E422BA0546008BB323 /* PublishAddressPOICell.swift in Sources */,
 				BDE376E922C22D4E0055E2EA /* AlivcUIConfig.m in Sources */,
 				A7C2567C22CD8EEE00420828 /* CommunityPostCommentsModel.swift in Sources */,
-				BD10CD0A22BFC5E40040796E /* PublishMusicHeader.swift in Sources */,
 				A7541502224C5ECB002480B5 /* BaiduMapManager.swift in Sources */,
 				A773D02F229FDC3B007A5751 /* DIYEmptyView.swift in Sources */,
 				BD6122B022C3638300D3F513 /* AliyunEffectInfo.m in Sources */,

+ 53 - 0
RainbowPlanet/RainbowPlanet/Model/CommunityModel/CommunityMusicCategoryListModel.swift

@@ -0,0 +1,53 @@
+//
+//  CommunityMusicCategoryListModel.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/7/17.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//  音乐分类のModel
+
+import Foundation
+import ObjectMapper
+
+class CommunityMusicCategoryListModel : NSObject, Mappable{
+    
+    var data : [MusicCategoryItemModel]?
+    var pagination : PaginationModel?
+    
+    
+    class func newInstance(map: Map) -> Mappable?{
+        return CommunityMusicCategoryListModel()
+    }
+    required init?(map: Map){}
+    private override init(){}
+    
+    func mapping(map: Map)
+    {
+        data <- map["data"]
+        pagination <- map["pagination"]
+        
+    }
+    
+}
+
+
+class MusicCategoryItemModel : NSObject, Mappable{
+    
+    var id : Int?
+    var name : String?
+    
+    
+    class func newInstance(map: Map) -> Mappable?{
+        return MusicCategoryItemModel()
+    }
+    required init?(map: Map){}
+    private override init(){}
+    
+    func mapping(map: Map)
+    {
+        id <- map["id"]
+        name <- map["name"]
+        
+    }
+    
+}

+ 63 - 0
RainbowPlanet/RainbowPlanet/Model/CommunityModel/CommunityRecommendMusicListModel.swift

@@ -0,0 +1,63 @@
+//
+//  CommunityRecommendMusicListModel.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/7/17.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import Foundation
+import ObjectMapper
+
+// 推荐&&分类のModelList
+class CommunityRecommendMusicListModel : NSObject, Mappable{
+    
+    var data : [CommunityMusicItemModel]?
+    var pagination : PaginationModel?
+    
+    
+    class func newInstance(map: Map) -> Mappable?{
+        return CommunityRecommendMusicListModel()
+    }
+    required init?(map: Map){}
+    private override init(){}
+    
+    func mapping(map: Map)
+    {
+        data <- map["data"]
+        pagination <- map["pagination"]
+        
+    }
+    
+}
+
+
+// 歌曲Model
+class CommunityMusicItemModel : NSObject, Mappable{
+    
+    var id : Int?
+    var img : String?
+    var musicDuration : Int?
+    var name : String?
+    var singer : String?
+    var url : String?
+    
+    
+    class func newInstance(map: Map) -> Mappable?{
+        return CommunityMusicItemModel()
+    }
+    required init?(map: Map){}
+    private override init(){}
+    
+    func mapping(map: Map)
+    {
+        id <- map["id"]
+        img <- map["img"]
+        musicDuration <- map["music_duration"]
+        name <- map["name"]
+        singer <- map["singer"]
+        url <- map["url"]
+        
+    }
+    
+}

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoEdit/Controller/AliyunEditViewController.m

@@ -1149,7 +1149,7 @@ AliyunIExporterCallback, AliyunIPlayerCallback, AliyunMusicPickViewControllerDel
 //    [self.navigationController pushViewController:vc animated:YES];
     
 //    self.volumnView = [PublishMusicVolumnView publishMusicVolumnView];
-    self.musicView = [PublishMusicChooseView publishMusicChooseView];
+    self.musicView = [PublishMusicChooseView publishMusicChooseViewWithAttachedView:self.view];
     
 }
 

+ 167 - 11
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMusicAbout/PublishMusicChooseView.swift

@@ -10,6 +10,7 @@ import UIKit
 import FWPopupView
 import RxSwift
 import SwiftyMediator
+import JXSegmentedView
 
 class PublishMusicChooseView: FWPopupView {
     
@@ -22,15 +23,45 @@ class PublishMusicChooseView: FWPopupView {
         super.init(frame: frame)
         setupViews()
         setupLayouts()
+        
+        // 获取分类列表
+        self.communityGetMusicCategoryApi()
     }
     
     required init?(coder aDecoder: NSCoder) {
         fatalError("init(coder:) has not been implemented")
     }
     
+    var JXheightForHeaderInSection: Int = 44
+    var categoryTitleArr = Array<String>()
+    
+    var categoryListMdlArr : Array<MusicCategoryItemModel>? {
+        didSet {
+            guard categoryListMdlArr?.isEmpty ?? true else {
+                categoryTitleArr.removeAll()
+                categoryTitleArr.append("推荐")
+                for categoryMdl in categoryListMdlArr! {
+                    categoryTitleArr.append(categoryMdl.name!)
+                }
+                setupSegmentedView()
+                return
+            }
+            setupSegmentedView()
+            return
+        }
+    }
+    
     func setupViews() {
         frame = CGRect(x: 0, y: 0, width: kScreenWidth, height: kScreenHeight - kSafeTabBarHeight - kSafeStatusBarHeight - 22)
-        backgroundColor = UIColor(hexString: "000000", alpha: 0.5)
+        
+        // 添加毛玻璃效果,需使用frame设置位置
+        let blurEffect = UIBlurEffect(style: .dark)
+        let blurEffectView = UIVisualEffectView(effect: blurEffect)
+        blurEffectView.frame = CGRect(x: CGFloat(0), y: 0, width: kScreenWidth, height: kScreenHeight - kSafeTabBarHeight - kSafeStatusBarHeight - 22)
+        addSubview(blurEffectView)
+        
+        self.backgroundColor = UIColor.clear
+        
         configRectCorner(corner: [.topLeft,.topRight], radii: CGSize(width: 8, height: 8))
         
         addSubview(cancelButton)
@@ -55,7 +86,7 @@ class PublishMusicChooseView: FWPopupView {
         // 底部分割线
         sepLineView.snp.makeConstraints { (make) in
             make.left.right.equalToSuperview()
-            make.bottom.equalTo(-48-kSafeStatusBarHeight)
+            make.bottom.equalTo(-48-kSafeTabBarHeight)
             make.height.equalTo(0.5)
         }
         
@@ -73,13 +104,13 @@ class PublishMusicChooseView: FWPopupView {
         
         musicButton.snp.makeConstraints { (make) in
             make.centerX.equalTo(kScreenWidth*0.25)
-            make.bottom.equalTo(-17-kSafeStatusBarHeight)
+            make.bottom.equalTo(-17-kSafeTabBarHeight)
             make.width.equalTo(40)
             make.height.equalTo(21)
         }
         volumnButton.snp.makeConstraints { (make) in
             make.centerX.equalTo(kScreenWidth*0.75)
-            make.bottom.equalTo(-17-kSafeStatusBarHeight)
+            make.bottom.equalTo(-17-kSafeTabBarHeight)
             make.width.equalTo(40)
             make.height.equalTo(21)
         }
@@ -87,11 +118,31 @@ class PublishMusicChooseView: FWPopupView {
             make.centerX.equalTo(volumnButton.snp_centerX)
             make.width.equalTo(20)
             make.height.equalTo(3)
-            make.bottom.equalTo(-11-kSafeStatusBarHeight)
+            make.bottom.equalTo(-11-kSafeTabBarHeight)
         }
         
     }
     
+    func setupSegmentedView() {
+        addSubview(segmentedView)
+        addSubview(listContainerView)
+        reloadData()
+    }
+    
+    /// 刷新页面
+    func reloadData() {
+        segmentedDataSource.titles = categoryTitleArr
+        segmentedView.indicators = [indicator]
+
+        JXheightForHeaderInSection = 44
+        
+        //        self.segmentedDataSource.reloadData(selectedIndex: shoppingMallListVCType)
+        //        self.segmentedView.defaultSelectedIndex = shoppingMallListVCType
+        self.segmentedView.reloadData()
+        
+    }
+    
+    // MARK: - 视图创建
     lazy var cancelButton: UIButton = {
         let cancelButton = UIButton(type: UIButton.ButtonType.custom)
         cancelButton.setImage(kImage(name: "video_btn_close_white"), for: .normal)
@@ -143,10 +194,59 @@ class PublishMusicChooseView: FWPopupView {
         return v_lineLabel
     }()
     
+    //MARK: -
+    //1.初始化JXSegmentedView
+    lazy var segmentedView: JXSegmentedView = {
+        let segmentedView = JXSegmentedView(frame: CGRect(x: 0, y: 48, width: kScreenWidth, height: CGFloat(JXheightForHeaderInSection)))
+        segmentedView.delegate = self
+        segmentedView.dataSource = segmentedDataSource
+        segmentedView.indicators = [indicator]
+        segmentedView.contentScrollView = listContainerView.scrollView
+        segmentedView.selectItemAt(index: 0)
+        segmentedView.defaultSelectedIndex = 0
+        segmentedView.backgroundColor = UIColor.yellow
+        return segmentedView
+    }()
+    
+    //2.初始化dataSource
+    lazy var segmentedDataSource: JXSegmentedTitleDataSource = {
+        let segmentedDataSource = JXSegmentedTitleDataSource()
+        segmentedDataSource.titles = categoryTitleArr
+        segmentedDataSource.isTitleColorGradientEnabled = true
+        segmentedDataSource.isItemSpacingAverageEnabled = true
+        segmentedDataSource.titleNormalColor = kffffffColor
+        segmentedDataSource.titleSelectedColor = kbbbbbbColor
+        segmentedDataSource.titleNormalFont = kRegularFont14!
+        segmentedDataSource.titleSelectedFont = kMediumFont14
+        
+        //reloadData(selectedIndex:)方法一定要调用,方法内部会刷新数据源数组
+        segmentedDataSource.reloadData(selectedIndex: 0)
+        return segmentedDataSource
+    }()
+    
+    //3.初始化指示器indicator
+    lazy var indicator: JXSegmentedIndicatorLineView = {
+        let indicator = JXSegmentedIndicatorLineView()
+        indicator.indicatorColor = kFFA42FColor
+        indicator.indicatorHeight = 4
+        indicator.indicatorWidth = 34
+        return indicator
+    }()
+    
+    //4.初始化JXSegmentedListContainerView
+    private lazy var listContainerView: JXSegmentedListContainerView = {
+        let listContainerView = JXSegmentedListContainerView(dataSource: self)
+        listContainerView.didAppearPercent = 0.01
+        listContainerView.defaultSelectedIndex = 0
+        listContainerView.scrollView.isScrollEnabled = true
+        listContainerView.frame = CGRect(x: 0, y: 48+44, width: kScreenWidth, height: kScreenHeight - kSafeTabBarHeight - kSafeStatusBarHeight - 103 - 114)        
+        return listContainerView
+    }()
     
     /// 初始化View
-    @objc class func publishMusicChooseView() -> PublishMusicChooseView {
+    @objc class func publishMusicChooseView(attachedView:UIView) -> PublishMusicChooseView {
         let view = PublishMusicChooseView()
+        view.attachedView = attachedView
         let vProperty = FWPopupViewProperty()
         vProperty.popupCustomAlignment = .bottomCenter
         vProperty.popupViewEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
@@ -156,16 +256,13 @@ class PublishMusicChooseView: FWPopupView {
         view.vProperty = vProperty
         view.show()
         
-        view.cancelButton.rx.tap.subscribe(onNext: { (data) in
-            print("----点击了-取消")
+        view.cancelButton.rx.tap.subscribe(onNext: { (data) in            
             view.hide()
             
         }).disposed(by: view.disposeBag)
         
         
-        view.recommendButton.rx.tap.subscribe(onNext: {
-            [weak view] (data) in
-            view?.hide()
+        view.recommendButton.rx.tap.subscribe(onNext: { (data) in
             Mediator.push(PublishRouterModuleType.push)
             
         }).disposed(by: view.disposeBag)
@@ -184,3 +281,62 @@ class PublishMusicChooseView: FWPopupView {
     }
     
 }
+
+// MARK: - JXSegmentedViewDelegate
+extension PublishMusicChooseView : JXSegmentedViewDelegate {
+    //点击选中或者滚动选中都会调用该方法。适用于只关心选中事件,而不关心具体是点击还是滚动选中的情况。
+    func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
+        //传递didClickSelectedItemAt事件给listContainerView,必须调用!!!
+        listContainerView.didClickSelectedItem(at: index)
+    }
+    
+    // 点击选中的情况才会调用该方法
+    func segmentedView(_ segmentedView: JXSegmentedView, didClickSelectedItemAt index: Int) {
+        listContainerView.didClickSelectedItem(at: index)
+    }
+    
+    // 滚动选中的情况才会调用该方法
+    func segmentedView(_ segmentedView: JXSegmentedView, didScrollSelectedItemAt index: Int) {
+    }
+    
+    // 正在滚动中的回调
+    func segmentedView(_ segmentedView: JXSegmentedView, scrollingFrom leftIndex: Int, to rightIndex: Int, percent: CGFloat) {
+        //传递scrolling事件给listContainerView,必须调用!!!
+        listContainerView.segmentedViewScrolling(from: leftIndex, to: rightIndex, percent: percent, selectedIndex: segmentedView.selectedIndex)
+    }
+    
+    /// 是否允许点击选中目标index的item
+    func segmentedView(_ segmentedView: JXSegmentedView, canClickItemAt index: Int) -> Bool {
+        return true
+    }
+}
+
+// MARK: - JXSegmentedListContainerViewDataSource
+extension PublishMusicChooseView :JXSegmentedListContainerViewDataSource {
+    
+    func numberOfLists(in listContainerView: JXSegmentedListContainerView) -> Int {
+        return categoryTitleArr.count
+    }
+    func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate {
+        let listVc = PublishMusicListController()
+        if index == 0 {
+            listVc.isReccomendList = true
+        } else {
+            listVc.categoryItemMdl = categoryListMdlArr![index-1]
+        }
+        return listVc
+    }
+}
+
+// MARK: - 网络请求
+extension PublishMusicChooseView {
+    /// 获取音乐分类
+    func communityGetMusicCategoryApi() {
+        SwiftMoyaNetWorkServiceCommunity.shared().communityGetMusicCategoryApi() {
+            [weak self] (musicCategoryListModel) -> (Void) in
+            let musicCategoryListModel = musicCategoryListModel as? CommunityMusicCategoryListModel
+            self?.categoryListMdlArr = musicCategoryListModel?.data
+        }
+    }
+}
+

+ 53 - 30
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishTakeVideo/PublishMusicItemCell.swift

@@ -1,25 +1,32 @@
 //
-//  PublishMusicItemCell.swift
+//  PublishMusicListCell.swift
 //  RainbowPlanet
 //
-//  Created by Christopher on 2019/6/23.
+//  Created by Christopher on 2019/7/17.
 //  Copyright © 2019 RainbowPlanet. All rights reserved.
 //
 
+
 import UIKit
 import RxSwift
 
-class PublishMusicItemCell: UITableViewCell {
+class PublishMusicListCell: UITableViewCell {
+    
+    var musicItemMdl: CommunityMusicItemModel? {
+        didSet {
+            titleLabel.text = self.musicItemMdl?.name
+        }
+    }
     
     let disposeBag = DisposeBag()
     
     typealias BtnClickClosure = () -> Void
     var btnClickClosure : BtnClickClosure?
     
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> PublishMusicItemCell {
-        let ID = "PublishMusicItemCell"
-        tableView.register(PublishMusicItemCell.self, forCellReuseIdentifier: ID)
-        let cell : PublishMusicItemCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! PublishMusicItemCell
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> PublishMusicListCell {
+        let ID = "PublishMusicListCell"
+        tableView.register(PublishMusicListCell.self, forCellReuseIdentifier: ID)
+        let cell : PublishMusicListCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! PublishMusicListCell
         cell.indexPath = indexPath
         return cell
     }
@@ -45,35 +52,45 @@ class PublishMusicItemCell: UITableViewCell {
         self.selectionStyle = .none
         backgroundColor = UIColor.clear
         
-        addSubview(playImageView)
+        addSubview(iconImageView)
         addSubview(titleLabel)
+        addSubview(curPlayImageView)
         addSubview(useButton)
     }
     
     private func setupLayouts() {
-        playImageView.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
+        iconImageView.snp.makeConstraints { (make) in
             make.left.equalTo(14)
+            make.centerY.equalToSuperview()
             make.size.equalTo(18)
         }
-        useButton.snp.makeConstraints { (make) in
+        
+        titleLabel.snp.makeConstraints { (make) in
+            make.left.equalTo(iconImageView.snp_right).offset(8)
+            make.centerY.equalToSuperview()
+            make.height.equalTo(20)
+            make.right.equalTo(-86)
+        }
+        
+        curPlayImageView.snp.makeConstraints { (make) in
+            make.right.equalTo(-37)
             make.centerY.equalToSuperview()
+            make.size.equalTo(18)
+        }
+        
+        useButton.snp.makeConstraints { (make) in
             make.right.equalTo(-14)
+            make.centerY.equalToSuperview()
             make.width.equalTo(64)
             make.height.equalTo(26)
         }
-        titleLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(playImageView.snp_right).offset(8)
-            make.right.equalTo(useButton.snp_left).offset(-10)
-            make.centerY.equalTo(playImageView)
-            make.height.equalTo(20)
-        }
+        
     }
     
-    lazy var playImageView : UIImageView = {
-        let playImageView = UIImageView()
-        playImageView.image = kImage(name: "music_btn_play")
-        return playImageView
+    private lazy var iconImageView: UIImageView = {
+        let iconImageView = UIImageView()
+        iconImageView.image = kImage(name: "music_btn_play")
+        return iconImageView
     }()
     
     private lazy var titleLabel: UILabel = {
@@ -85,20 +102,26 @@ class PublishMusicItemCell: UITableViewCell {
         return titleLabel
     }()
     
+    private lazy var curPlayImageView: UIImageView = {
+        let curPlayImageView = UIImageView()
+        curPlayImageView.image = kImage(name: "music_ico_selected")
+        return curPlayImageView
+        //        music_btn_pause
+    }()
+    
     private lazy var useButton: UIButton = {
         let useButton = UIButton(type: UIButton.ButtonType.custom)
         useButton.setTitle("使用", for: UIControl.State.normal)
-        useButton.setTitleColor(kffffffColor, for: UIControl.State.normal)
-        useButton.backgroundColor = k62CC74Color
-        useButton.titleLabel?.font = kMediumFont13
-        useButton.cornerRadius = 16
-        useButton.masksToBounds = true
-        useButton.rx.tap.subscribe(onNext: { [weak self] (data) in
-            if let btnClickClosure = self?.btnClickClosure {
-                btnClickClosure()
-            }
+        useButton.titleLabel?.font = kRegularFont13
+        useButton.setBackgroundImage(UIImage.imageWithColor(color: k62CC74Color), for: UIControl.State.normal)
+        useButton.setTitleColor(kEnabledTitleColor, for: UIControl.State.normal)
+        useButton.layer.cornerRadius = kScaleValue(value: 13)
+        useButton.layer.masksToBounds = true
+        useButton.rx.tap.subscribe(onNext: { [weak self] in
+            print("----点击了-使用")
         }).disposed(by: disposeBag)
         return useButton
     }()
     
 }
+

+ 169 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMusicAbout/PublishMusicListController.swift

@@ -0,0 +1,169 @@
+//
+//  PublishMusicListController.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/7/17.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import RxSwift
+import JXSegmentedView
+
+class PublishMusicListController: BaseViewController {
+    
+    var listViewDidScrollCallback: ((UIScrollView) -> ())?
+    deinit {
+        listViewDidScrollCallback = nil
+    }
+    
+    // 推荐下の音乐
+    var isReccomendList: Bool? {
+        didSet {
+            communityRecMusicListApi(page: 1)
+        }
+    }
+    
+    // 分类下の音乐
+    var categoryItemMdl: MusicCategoryItemModel? {
+        didSet {
+            communityCateMusicListApi(page: 1, categoryId: self.categoryItemMdl!.id!)
+        }
+    }
+    
+    var musicItemMdlArr = Array<CommunityMusicItemModel>()
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        setupViews()
+        setupLayouts()
+    }
+    
+    override func setupViews() {
+        navigationBar.isHidden = true
+        view.backgroundColor = UIColor.clear
+        
+        view.addSubview(tableView)
+        let emptyView = DIYEmptyView.empty(with: kImage(name: "default_page_data"), titleStr: nil, detailStr: "当前暂无数据")
+        emptyView!.contentViewY = kScaleValue(value: 182)
+        tableView.ly_emptyView = emptyView
+        tableView.ly_startLoading()
+    }
+    
+    override func setupLayouts() {
+        tableView.snp.makeConstraints { (make) in
+            make.edges.equalToSuperview()
+        }
+    }
+    
+    lazy var tableView: UITableView = {
+        let tableView = UITableView(frame: CGRect.zero, style: UITableView.Style.grouped)
+        tableView.separatorStyle = .none
+//        tableView.backgroundColor = kRGBColor(r: 255, g: 192, b: 203)
+        tableView.backgroundColor = UIColor.clear
+        tableView.dataSource = self
+        tableView.delegate = self
+        tableView.estimatedRowHeight = 0.000001
+        tableView.estimatedSectionFooterHeight = 0.000001
+        tableView.estimatedSectionHeaderHeight = 0.000001
+        return tableView
+    }()
+    
+}
+
+extension PublishMusicListController : UITableViewDelegate, UITableViewDataSource {
+    func numberOfSections(in tableView: UITableView) -> Int {
+        return 1
+    }
+    
+    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+        return musicItemMdlArr.isEmpty ?? true ? 0 : musicItemMdlArr.count
+    }
+    
+    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
+        let cell = PublishMusicListCell.cellWith(tableView: tableView, indexPath: indexPath)
+        cell.musicItemMdl = musicItemMdlArr[indexPath.row]
+        return cell
+    }
+    
+    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
+        return 50
+    }
+    
+    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
+        return 0
+    }
+    
+    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
+        return nil
+    }
+    
+    func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
+        return 0.000001
+    }
+    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
+        return nil
+    }
+    
+    public func scrollViewDidScroll(_ scrollView: UIScrollView) {
+        self.listViewDidScrollCallback?(scrollView)
+    }
+    
+}
+
+extension PublishMusicListController : JXSegmentedListContainerViewListDelegate {
+    func listView() -> UIView {
+        return view
+    }
+    func listDidAppear() {
+        
+    }
+    func listDidDisappear() {
+        
+    }
+}
+
+extension PublishMusicListController {
+    /// 热门推荐音乐列表
+    func communityRecMusicListApi(page:Int) {
+        SwiftMoyaNetWorkServiceCommunity.shared().communityRecMusicListApi(page: page) { [weak self] (recommendMusicListModel) -> (Void) in
+            let recommendMusicListModel = recommendMusicListModel as? CommunityRecommendMusicListModel
+            if recommendMusicListModel?.pagination?.currentPage ?? 1 <= recommendMusicListModel?.pagination?.totalPages ?? 1 {
+                
+                if recommendMusicListModel?.pagination?.currentPage == 1 {
+                    self?.musicItemMdlArr.removeAll()
+                }
+                self?.musicItemMdlArr = (self?.musicItemMdlArr)! + (recommendMusicListModel?.data!)!
+                
+                self?.tableView.reloadData()
+                if  self?.musicItemMdlArr.count ?? 0 >= recommendMusicListModel?.pagination?.total ?? 0 {
+                    self?.tableView.endFooterNoMoreData()
+                }
+                
+            } else {
+                self?.tableView.endFooterNoMoreData()
+            }
+        }
+    }
+    
+    /// 获取分类下所有音乐
+    func communityCateMusicListApi(page:Int, categoryId:Int) {
+        SwiftMoyaNetWorkServiceCommunity.shared().communityCateMusicListApi(categoryID: categoryId, page: page) { [weak self] (categoryMusicListModel) -> (Void) in
+            let categoryMusicListModel = categoryMusicListModel as? CommunityRecommendMusicListModel
+            if categoryMusicListModel?.pagination?.currentPage ?? 1 <= categoryMusicListModel?.pagination?.totalPages ?? 1 {
+                if categoryMusicListModel?.pagination?.currentPage == 1 {
+                    self?.musicItemMdlArr.removeAll()
+                }
+                self?.musicItemMdlArr = (self?.musicItemMdlArr)! + (categoryMusicListModel?.data!)!
+                
+                self?.tableView.reloadData()
+                if  self?.musicItemMdlArr.count ?? 0 >= categoryMusicListModel?.pagination?.total ?? 0 {
+                    self?.tableView.endFooterNoMoreData()
+                }
+                
+            } else {
+                self?.tableView.endFooterNoMoreData()
+            }
+        }
+    }
+}

+ 25 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMusicAbout/PublishRecommendMusicController.swift

@@ -33,6 +33,15 @@ class PublishRecommendMusicController: BaseViewController {
             [weak self] in
             print("----点击了-提交")
             
+            let name = self?.nameTextView.text
+            let url  = self?.linkTextView.text
+            
+            if name == nil || name == "" {
+                SwiftProgressHUD.shared().showText("请填写歌曲名称")
+                return
+            }
+            
+            self?.communityUploadMusicApi(name!, url ?? "")
         }
         
         view.addSubview(cardBackView)
@@ -111,6 +120,7 @@ class PublishRecommendMusicController: BaseViewController {
     
 }
 
+// MARK: -
 extension PublishRecommendMusicController: UITextViewDelegate {
     func textViewDidChange(_ textView: UITextView) {
         if textView == nameTextView {
@@ -129,3 +139,18 @@ extension PublishRecommendMusicController: UITextViewDelegate {
     }
     
 }
+
+extension PublishRecommendMusicController {
+    /// 用户上传音乐
+    func communityUploadMusicApi(_ name: String, _ url: String) {
+        let userName = UserModel.shared().getModel()?.username ?? ""
+        let uid = UserModel.shared().getModel()?.uid ?? 0
+        
+        SwiftMoyaNetWorkServiceCommunity.shared().communityUploadMusicApi(name: name, username: userName, url: url, uid: uid) { (data) -> (Void) in
+            // 上传成功,返回
+            SwiftProgressHUD.shared().showText("提交成功")
+            self.navigationController?.popViewController(animated: true)
+        }
+        
+    }
+}

+ 0 - 59
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishTakeVideo/PublishMusicHeader.swift

@@ -1,59 +0,0 @@
-//
-//  PublishMusicHeader.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/6/23.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import RxSwift
-
-class PublishMusicHeader: BaseView {
-    
-    typealias DismissClosure = () -> Void
-    var dismissClosure : DismissClosure?
-    
-    override func setupViews() {
-        self.backgroundColor = UIColor.clear
-        
-        addSubview(titleLabel)
-        addSubview(dismissBtn)
-    }
-    
-    override func setupLayouts() {
-        
-        titleLabel.snp.makeConstraints { (make) in
-            make.center.equalToSuperview()
-            make.width.equalTo(64)
-            make.height.equalTo(23)
-        }
-        
-        dismissBtn.snp.makeConstraints { (make) in
-            make.left.equalTo(9)
-            make.centerY.equalToSuperview()
-            make.size.equalTo(32)
-        }
-    }
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.text = "推荐音乐"
-        titleLabel.textColor = kffffffColor
-        titleLabel.font = kRegularFont16
-        titleLabel.textAlignment = .center
-        return titleLabel
-    }()
-    
-    private lazy var dismissBtn: UIButton = {
-        let dismissBtn = UIButton(type: UIButton.ButtonType.custom)
-        dismissBtn.setImage(kImage(name: "video_btn_close_white"), for: UIControl.State.normal)
-        dismissBtn.rx.tap.subscribe(onNext: { [weak self] (data) in
-            if let dismissClosure = self?.dismissClosure {
-                dismissClosure()
-            }
-        }).disposed(by: disposeBag)
-        return dismissBtn
-    }()
-    
-}

+ 2 - 21
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishTakeVideo/PublishMusicView.swift

@@ -22,34 +22,16 @@ class PublishMusicView: BaseView {
         blurEffectView.frame = CGRect(x: CGFloat(0), y: kNavBarTotalHeight, width: kScreenWidth, height: kScreenHeight-kNavBarTotalHeight)
         addSubview(blurEffectView)
         
-        addSubview(headerView)
         addSubview(tableView)
     }
     
     override func setupLayouts() {
-        headerView.snp.makeConstraints { (make) in
-            make.top.equalToSuperview().offset(kNavBarTotalHeight)
-            make.left.right.equalTo(0)
-            make.height.equalTo(48)
-        }
         tableView.snp.makeConstraints { (make) in
-            make.top.equalTo(headerView.snp_bottom)
+            make.top.equalToSuperview()
             make.left.right.bottom.equalTo(0)
         }
     }
     
-    lazy var headerView: PublishMusicHeader = {
-        let headerView = PublishMusicHeader()
-        headerView.backgroundColor = UIColor.clear
-        headerView.dismissClosure = {
-            [weak self] in
-            if let dismissViewClosure = self?.dismissViewClosure {
-                dismissViewClosure()
-            }
-        }
-        return headerView
-    }()
-    
     lazy var tableView: UITableView = {
         let tableView = UITableView(frame: CGRect.zero, style: UITableView.Style.grouped)
         tableView.separatorStyle = .none
@@ -69,8 +51,7 @@ extension PublishMusicView: UITableViewDataSource, UITableViewDelegate {
     }
     
     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-        let cell = PublishMusicItemCell.cellWith(tableView: tableView, indexPath: indexPath)
-        return cell
+        return UITableViewCell()
     }
     
     func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {

+ 71 - 0
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceCommunity/SwiftMoyaNetWorkServiceCommunity.swift

@@ -181,6 +181,77 @@ public class SwiftMoyaNetWorkServiceCommunity: NSObject {
         }
     }
     
+    // MARK: - 音乐相关
+    /// 用户上传音乐
+    ///
+    /// - Parameters:
+    ///   - name: 音乐名称
+    ///   - username: 上传用户
+    ///   - url: 音乐路径
+    ///   - uid: 用户ID
+    ///   - completion: 回调
+    func communityUploadMusicApi(name:String = "", username:String = "", url:String = "", uid:Int = 0, completion: @escaping apiCallBack) {
+        var parameters = Dictionary<String,Any>()
+        parameters.updateValue(name, forKey: "name")
+        parameters.updateValue(username, forKey: "username")
+        parameters.updateValue(url, forKey: "url")
+        parameters.updateValue(uid, forKey: "uid")
+        SwiftProgressHUD.shared().showWait()
+        
+        SwiftMoyaNetWorkManager.shared.requestRootModel(target: MultiTarget(SwiftMoyaServiceCommunityApi.communityUploadMusic(parameters: parameters))) { (rootModel) in
+            SwiftProgressHUD.shared().showText(rootModel.msg!)
+            if rootModel.code == 0 {                
+                completion("")
+            }
+        }
+    }
+    
+    /// 热门推荐音乐列表
+    ///
+    /// - Parameters:
+    ///   - page: 分页
+    ///   - completion: 回调
+    func communityRecMusicListApi(page:Int = 1,completion: @escaping apiCallBack) {
+        var parameters = Dictionary<String,Any>()
+        parameters.updateValue(page, forKey: "page")
+        
+        SwiftMoyaNetWorkManager.shared.requestObject(CommunityRecommendMusicListModel.self, target: MultiTarget(SwiftMoyaServiceCommunityApi.communityRecMusicList(parameters: parameters))) { (communityRecommendMusicListModel) in
+            SwiftProgressHUD.shared().hide()
+            completion(communityRecommendMusicListModel)
+        }
+    }
+    
+    /// 获取音乐分类
+    ///
+    /// - Parameters:
+    ///   - page: 分页
+    ///   - completion: 回调
+    func communityGetMusicCategoryApi(completion: @escaping apiCallBack) {
+        let parameters = Dictionary<String,Any>()
+        
+        SwiftMoyaNetWorkManager.shared.requestObject(CommunityMusicCategoryListModel.self, target: MultiTarget(SwiftMoyaServiceCommunityApi.communityGetMusicCategory(parameters: parameters))) { (communityMusicCategoryListModel) in
+            SwiftProgressHUD.shared().hide()
+            completion(communityMusicCategoryListModel)
+        }
+    }
+    
+    /// 获取分类下所有音乐
+    ///
+    /// - Parameters:
+    ///   - category_id: 分类ID
+    ///   - page: 分页
+    ///   - completion: 回调
+    func communityCateMusicListApi(categoryID:Int = 0, page:Int = 1, completion: @escaping apiCallBack) {
+        var parameters = Dictionary<String,Any>()
+        parameters.updateValue(categoryID, forKey: "category_id")
+        parameters.updateValue(page, forKey: "page")
+        
+        SwiftMoyaNetWorkManager.shared.requestObject(CommunityRecommendMusicListModel.self, target: MultiTarget(SwiftMoyaServiceCommunityApi.communityCateMusicList(parameters: parameters))) { (communityMusicListModel) in
+            SwiftProgressHUD.shared().hide()
+            completion(communityMusicListModel)
+        }
+    }
+    
     // MARK: - 多关注页面feed流
     /// 多关注页面feed流
     ///

+ 53 - 5
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceCommunity/SwiftMoyaServiceCommunityApi.swift

@@ -85,6 +85,22 @@ public let kCommunityPostReplyApi = "/community/post/reply"
 ///// 评论&回复
 public let kCommunityPostCommentApi = "/community/post/comment"
 
+//// MARK: - 用户上传音乐
+///// 用户上传音乐
+public let kCommunityUploadMusicApi = "/community/music/upload"
+
+//// MARK: - 热门推荐音乐列表
+///// 热门推荐音乐列表
+public let kCommunityRecMusicListApi = "/community/musicList"
+
+//// MARK: - 获取音乐分类
+///// 获取音乐分类
+public let kCommunityGetMusicCategoryApi = "/community/category/list"
+
+//// MARK: - 获取分类下所有音乐
+///// 获取分类下所有音乐
+public let kCommunityCateMusicListApi = "/community/music"
+
 /// 社区
 ///
 /// - communityTopicCategory: 话题组列表
@@ -106,6 +122,10 @@ public let kCommunityPostCommentApi = "/community/post/comment"
 /// - communityPostComments : 评论列表
 /// - communityPostReply : 回复列表
 /// - communityPostComment : 评论&回复
+/// - communityUploadMusic : 用户上传音乐
+/// - communityRecMusicList : 热门推荐音乐列表
+/// - communityGetMusicCategory : 获取音乐分类
+/// - communityCateMusicList : 获取分类下所有音乐
 
 public enum SwiftMoyaServiceCommunityApi {
     case communityTopicCategory(parameters:Dictionary<String, Any>)
@@ -127,6 +147,10 @@ public enum SwiftMoyaServiceCommunityApi {
     case communityPostComments(parameters:Dictionary<String, Any>)
     case communityPostReply(parameters:Dictionary<String, Any>)
     case communityPostComment(parameters:Dictionary<String, Any>)
+    case communityUploadMusic(parameters:Dictionary<String, Any>)
+    case communityRecMusicList(parameters:Dictionary<String, Any>)
+    case communityGetMusicCategory(parameters:Dictionary<String, Any>)
+    case communityCateMusicList(parameters:Dictionary<String, Any>)
 }
 
 extension SwiftMoyaServiceCommunityApi: TargetType {
@@ -151,7 +175,11 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
              .communityPostDetail,
              .communityPostComments,
              .communityPostReply,
-             .communityPostComment
+             .communityPostComment,
+             .communityUploadMusic,
+             .communityRecMusicList,
+             .communityGetMusicCategory,
+             .communityCateMusicList
             :
             return URL(string: kApiDataPrefix())!
         }
@@ -197,6 +225,14 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
             return kCommunityPostReplyApi
         case .communityPostComment:
             return kCommunityPostCommentApi
+        case .communityUploadMusic:
+            return kCommunityUploadMusicApi
+        case .communityRecMusicList:
+            return kCommunityRecMusicListApi
+        case .communityGetMusicCategory:
+            return kCommunityGetMusicCategoryApi
+        case .communityCateMusicList:
+            return kCommunityCateMusicListApi
         }
     }
     
@@ -205,7 +241,8 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
         case .communityMemberFollowTopic,
              .communityPublish,
              .communityMemberFollowTopicFollow,
-             .communityPostComment
+             .communityPostComment,
+             .communityUploadMusic
             :
             return .post
         case .communityTopicCategory,
@@ -221,7 +258,10 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
              .communityMemberFollowTopicList,
              .communityPostDetail,
              .communityPostComments,
-             .communityPostReply
+             .communityPostReply,
+             .communityRecMusicList,
+             .communityGetMusicCategory,
+             .communityCateMusicList
             :
             return .get
         case .communityMemberFollowTopicCancelFollow
@@ -252,7 +292,11 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
              .communityPostDetail(var parameters),
              .communityPostComments(var parameters),
              .communityPostReply(var parameters),
-             .communityPostComment(var parameters)
+             .communityPostComment(var parameters),
+             .communityUploadMusic(var parameters),
+             .communityRecMusicList(var parameters),
+             .communityGetMusicCategory(var parameters),
+             .communityCateMusicList(var parameters)
             :
             let sign = SwiftSign.shared().sign(signType:.AccessToken, parameters: parameters)
             parameters.updateValue(sign, forKey: "sign")
@@ -293,7 +337,11 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
              .communityPostDetail,
              .communityPostComments,
              .communityPostReply,
-             .communityPostComment
+             .communityPostComment,
+             .communityUploadMusic,
+             .communityRecMusicList,
+             .communityGetMusicCategory,
+             .communityCateMusicList
             :
             return (headerParameters(headerType: .tokenHeader) as! [String : String])
         }

+ 22 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/music_btn_loading.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "music_btn_loading@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "music_btn_loading@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/music_btn_loading.imageset/music_btn_loading@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/music_btn_loading.imageset/music_btn_loading@3x.png


+ 22 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/music_ico_selected.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "music_ico_selected@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "music_ico_selected@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/music_ico_selected.imageset/music_ico_selected@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/music_ico_selected.imageset/music_ico_selected@3x.png