소스 검색

推荐页面完成

南鑫林 5 년 전
부모
커밋
0602840e80
16개의 변경된 파일1894개의 추가작업 그리고 87개의 파일을 삭제
  1. 76 0
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  2. 55 0
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/Banner/CommunityBannerFSPagerViewCell.swift
  3. 117 0
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/Banner/CommunityBannerTableViewCell.swift
  4. 0 3
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/PicVideo/CardContentPicVideoModel.swift
  5. 98 0
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/FeaturedTopics/FeaturedTopicsCollectionViewCell.swift
  6. 97 0
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/FeaturedTopics/FeaturedTopicsTableViewCell.swift
  7. 84 0
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/PopularVideo/PopularVideoCollectionViewCell.swift
  8. 94 0
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/PopularVideo/PopularVideoTableViewCell.swift
  9. 1226 84
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/CommunityListViewController.swift
  10. 25 0
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityFeaturedTopics/ViewController/CommunityFeaturedTopicsViewController.swift
  11. 0 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/logo.imageset/Contents.json
  12. 0 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/logo.imageset/logo@2x.png
  13. 0 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/logo.imageset/logo@3x.png
  14. 22 0
      RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/edit_ico_topic_pre.imageset/Contents.json
  15. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/edit_ico_topic_pre.imageset/edit_ico_topic_pre@2x.png
  16. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/edit_ico_topic_pre.imageset/edit_ico_topic_pre@3x.png

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

@@ -278,6 +278,13 @@
 		A7C0FDE722B4A38500BC1E86 /* CardContentCommentListTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C0FDE622B4A38500BC1E86 /* CardContentCommentListTableViewCell.swift */; };
 		A7C0FDE922B4BC5600BC1E86 /* CardContentCommentListContentTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C0FDE822B4BC5600BC1E86 /* CardContentCommentListContentTableViewCell.swift */; };
 		A7C0FDEB22B4C6C300BC1E86 /* CardContentCommentListFooterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C0FDEA22B4C6C300BC1E86 /* CardContentCommentListFooterView.swift */; };
+		A7C0FDEE22B6516A00BC1E86 /* CommunityBannerTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C0FDED22B6516900BC1E86 /* CommunityBannerTableViewCell.swift */; };
+		A7C0FDF022B6538200BC1E86 /* CommunityBannerFSPagerViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C0FDEF22B6538200BC1E86 /* CommunityBannerFSPagerViewCell.swift */; };
+		A7C0FDF322B65E5400BC1E86 /* FeaturedTopicsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C0FDF222B65E5400BC1E86 /* FeaturedTopicsTableViewCell.swift */; };
+		A7C0FDF522B65FE000BC1E86 /* FeaturedTopicsCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C0FDF422B65FE000BC1E86 /* FeaturedTopicsCollectionViewCell.swift */; };
+		A7C0FDF822B6671C00BC1E86 /* PopularVideoCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C0FDF722B6671C00BC1E86 /* PopularVideoCollectionViewCell.swift */; };
+		A7C0FDFB22B6672F00BC1E86 /* PopularVideoTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C0FDFA22B6672F00BC1E86 /* PopularVideoTableViewCell.swift */; };
+		A7C0FE0022B66E5A00BC1E86 /* CommunityFeaturedTopicsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C0FDFF22B66E5A00BC1E86 /* CommunityFeaturedTopicsViewController.swift */; };
 		A7C3DD1A226422BF00FA262E /* SwiftMoyaServiceSMSApi.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C3DD19226422BF00FA262E /* SwiftMoyaServiceSMSApi.swift */; };
 		A7C3DD1C226422D200FA262E /* SwiftMoyaNetWorkServiceSMS.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C3DD1B226422D200FA262E /* SwiftMoyaNetWorkServiceSMS.swift */; };
 		A7CC74D4226FF1AA003C4F38 /* MineView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7CC74D3226FF1AA003C4F38 /* MineView.swift */; };
@@ -760,6 +767,13 @@
 		A7C0FDE622B4A38500BC1E86 /* CardContentCommentListTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardContentCommentListTableViewCell.swift; sourceTree = "<group>"; };
 		A7C0FDE822B4BC5600BC1E86 /* CardContentCommentListContentTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardContentCommentListContentTableViewCell.swift; sourceTree = "<group>"; };
 		A7C0FDEA22B4C6C300BC1E86 /* CardContentCommentListFooterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardContentCommentListFooterView.swift; sourceTree = "<group>"; };
+		A7C0FDED22B6516900BC1E86 /* CommunityBannerTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityBannerTableViewCell.swift; sourceTree = "<group>"; };
+		A7C0FDEF22B6538200BC1E86 /* CommunityBannerFSPagerViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityBannerFSPagerViewCell.swift; sourceTree = "<group>"; };
+		A7C0FDF222B65E5400BC1E86 /* FeaturedTopicsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeaturedTopicsTableViewCell.swift; sourceTree = "<group>"; };
+		A7C0FDF422B65FE000BC1E86 /* FeaturedTopicsCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeaturedTopicsCollectionViewCell.swift; sourceTree = "<group>"; };
+		A7C0FDF722B6671C00BC1E86 /* PopularVideoCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PopularVideoCollectionViewCell.swift; sourceTree = "<group>"; };
+		A7C0FDFA22B6672F00BC1E86 /* PopularVideoTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PopularVideoTableViewCell.swift; sourceTree = "<group>"; };
+		A7C0FDFF22B66E5A00BC1E86 /* CommunityFeaturedTopicsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityFeaturedTopicsViewController.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>"; };
 		A7CC74D3226FF1AA003C4F38 /* MineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MineView.swift; sourceTree = "<group>"; };
@@ -1339,6 +1353,7 @@
 			isa = PBXGroup;
 			children = (
 				A719EE6722AF438E001AAC98 /* Community */,
+				A7C0FDFC22B66B3C00BC1E86 /* CommunityFeaturedTopics */,
 				BD1FC18222B09F4700D55081 /* CommunitySubComment */,
 				BD2FCBDE22B21BE00006D974 /* CommunityRecommendDetail */,
 				BD1FC17D22B08CEB00D55081 /* CommunityMyFollowTopic */,
@@ -2786,6 +2801,57 @@
 			path = CommentList;
 			sourceTree = "<group>";
 		};
+		A7C0FDEC22B650FA00BC1E86 /* Banner */ = {
+			isa = PBXGroup;
+			children = (
+				A7C0FDED22B6516900BC1E86 /* CommunityBannerTableViewCell.swift */,
+				A7C0FDEF22B6538200BC1E86 /* CommunityBannerFSPagerViewCell.swift */,
+			);
+			path = Banner;
+			sourceTree = "<group>";
+		};
+		A7C0FDF122B65DAD00BC1E86 /* FeaturedTopics */ = {
+			isa = PBXGroup;
+			children = (
+				A7C0FDF222B65E5400BC1E86 /* FeaturedTopicsTableViewCell.swift */,
+				A7C0FDF422B65FE000BC1E86 /* FeaturedTopicsCollectionViewCell.swift */,
+			);
+			path = FeaturedTopics;
+			sourceTree = "<group>";
+		};
+		A7C0FDF622B6670900BC1E86 /* PopularVideo */ = {
+			isa = PBXGroup;
+			children = (
+				A7C0FDFA22B6672F00BC1E86 /* PopularVideoTableViewCell.swift */,
+				A7C0FDF722B6671C00BC1E86 /* PopularVideoCollectionViewCell.swift */,
+			);
+			path = PopularVideo;
+			sourceTree = "<group>";
+		};
+		A7C0FDFC22B66B3C00BC1E86 /* CommunityFeaturedTopics */ = {
+			isa = PBXGroup;
+			children = (
+				A7C0FDFE22B66C8E00BC1E86 /* View */,
+				A7C0FDFD22B66C8000BC1E86 /* ViewController */,
+			);
+			path = CommunityFeaturedTopics;
+			sourceTree = "<group>";
+		};
+		A7C0FDFD22B66C8000BC1E86 /* ViewController */ = {
+			isa = PBXGroup;
+			children = (
+				A7C0FDFF22B66E5A00BC1E86 /* CommunityFeaturedTopicsViewController.swift */,
+			);
+			path = ViewController;
+			sourceTree = "<group>";
+		};
+		A7C0FDFE22B66C8E00BC1E86 /* View */ = {
+			isa = PBXGroup;
+			children = (
+			);
+			path = View;
+			sourceTree = "<group>";
+		};
 		A7C3DD182264229900FA262E /* SwiftMoyaServiceSMS */ = {
 			isa = PBXGroup;
 			children = (
@@ -3043,6 +3109,9 @@
 		A7F2D6C422B0DBCB0093000B /* Cell */ = {
 			isa = PBXGroup;
 			children = (
+				A7C0FDF622B6670900BC1E86 /* PopularVideo */,
+				A7C0FDF122B65DAD00BC1E86 /* FeaturedTopics */,
+				A7C0FDEC22B650FA00BC1E86 /* Banner */,
 				A7F2D6D522B1ED100093000B /* CardContent */,
 				A7F2D6CC22B0FEF60093000B /* FollowStatus */,
 				A7F2D6C922B0E2FE0093000B /* RecommendFollow */,
@@ -3946,12 +4015,14 @@
 				A7778CA72243A05400C7C47A /* IQKeyboardManagerSwiftManager.swift in Sources */,
 				A7B4E738228191CC0012914A /* CommondModel.swift in Sources */,
 				BD7AB841228438C80030646A /* OrderPaySelfPickAddressCell.swift in Sources */,
+				A7C0FDF022B6538200BC1E86 /* CommunityBannerFSPagerViewCell.swift in Sources */,
 				BDF862AC228E5112000DEF84 /* OrderCommentAddImgCollectionCell.swift in Sources */,
 				A7931E0222AF827600297D0A /* ESTabBarItem.swift in Sources */,
 				A7CC74D4226FF1AA003C4F38 /* MineView.swift in Sources */,
 				A71AA5152272160A008FF1A5 /* ExpressAddressListTableViewCell.swift in Sources */,
 				A72A72B722321DE000B21995 /* Extension+NSMutableAttributedString.swift in Sources */,
 				A7931E0D22AF874600297D0A /* GenderSelectionViewController.swift in Sources */,
+				A7C0FDF522B65FE000BC1E86 /* FeaturedTopicsCollectionViewCell.swift in Sources */,
 				A7F2D6D022B1119A0093000B /* CommunityEnum.swift in Sources */,
 				A7BB6857226965C100AB07A2 /* SelfRecommendationHeaderCollectionReusableView.swift in Sources */,
 				BDE3045F228554CA001D050F /* ProductCartAmountModel.swift in Sources */,
@@ -3987,6 +4058,7 @@
 				A72A7386223396CB00B21995 /* SwiftMoyaNetWorkManager.swift in Sources */,
 				A70B2C252286C03800B2449F /* NXLPageControl.swift in Sources */,
 				A7F2D6C122B0D1CB0093000B /* CommunityFollowTableHeaderView.swift in Sources */,
+				A7C0FE0022B66E5A00BC1E86 /* CommunityFeaturedTopicsViewController.swift in Sources */,
 				A7A98E12227ECA11005306E9 /* ProductSearchModel.swift in Sources */,
 				A71AF0B0226EF185001730FE /* SearchCollectionViewCell.swift in Sources */,
 				A7A98E1D227EF1CB005306E9 /* SpecialBannerView.swift in Sources */,
@@ -4055,6 +4127,7 @@
 				BDAF83A622B334D90004BCC3 /* RecommendSimilarCollectionCell.swift in Sources */,
 				A70EBBC022561179000AD74F /* Extension+UITableView.swift in Sources */,
 				A72A72B022321DE000B21995 /* CGView.swift in Sources */,
+				A7C0FDF322B65E5400BC1E86 /* FeaturedTopicsTableViewCell.swift in Sources */,
 				A7A98E0B227EBD04005306E9 /* CategorySearchView.swift in Sources */,
 				A72A73142232475E00B21995 /* AlipayManager.swift in Sources */,
 				A7824B042271F10300ABA381 /* EditSelfMentionContactsView.swift in Sources */,
@@ -4097,6 +4170,7 @@
 				A70B843422911AF600882BC5 /* ProductDetailView.swift in Sources */,
 				A7FF1598228D092A00A85748 /* OrderListModel.swift in Sources */,
 				A7FF157D228C837100A85748 /* OrderDetailStatusTableViewCell.swift in Sources */,
+				A7C0FDFB22B6672F00BC1E86 /* PopularVideoTableViewCell.swift in Sources */,
 				BD12204B22AF99C80051C7C2 /* MessageFollowNotiTableCell.swift in Sources */,
 				A7A98E41228046C5005306E9 /* ShoppingMallSepcialTableViewCell.swift in Sources */,
 				A70B2C5E22886F4D00B2449F /* ShopViewTableViewCell.swift in Sources */,
@@ -4136,6 +4210,7 @@
 				A70B842E228F97EC00882BC5 /* ProcuctDetailSelectSkuTableViewCell.swift in Sources */,
 				A72A72AE22321DE000B21995 /* CountdownButton.swift in Sources */,
 				A71738AD228AB7B2000AEA6A /* ProductCommentListModel.swift in Sources */,
+				A7C0FDF822B6671C00BC1E86 /* PopularVideoCollectionViewCell.swift in Sources */,
 				A7B4E71F228131720012914A /* ProductSlidingLeftRightCollectionViewCell.swift in Sources */,
 				A77F2CB72232010F001BD3F6 /* MineViewController.swift in Sources */,
 				A7778CA92244904500C7C47A /* Extension+Gifu.GIFImageView.swift in Sources */,
@@ -4204,6 +4279,7 @@
 				A7CC7516227161D5003C4F38 /* SetViewController.swift in Sources */,
 				A7778CBA2244F14B00C7C47A /* Extension+UIViewController.swift in Sources */,
 				A7CC752C2271A1AE003C4F38 /* SetPasswordViewController.swift in Sources */,
+				A7C0FDEE22B6516A00BC1E86 /* CommunityBannerTableViewCell.swift in Sources */,
 				A7CC74E222704429003C4F38 /* MineServiceCollectionViewCell.swift in Sources */,
 				A738D202225AD6AD00EEE860 /* Extension+UICollectionView.swift in Sources */,
 				A7CC74D6226FF421003C4F38 /* MineNavigationBarView.swift in Sources */,

+ 55 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/Banner/CommunityBannerFSPagerViewCell.swift

@@ -0,0 +1,55 @@
+//
+//  CommunityBannerFSPagerViewCell.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/6/16.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import FSPagerView
+
+class CommunityBannerFSPagerViewCell: FSPagerViewCell {
+    class func cellWith(collectionView:FSPagerView,index:Int) -> CommunityBannerFSPagerViewCell {
+        let ID = "CommunityBannerFSPagerViewCell"
+        collectionView.register(CommunityBannerFSPagerViewCell.self, forCellWithReuseIdentifier: ID)
+        let cell : CommunityBannerFSPagerViewCell =
+            collectionView.dequeueReusableCell(withReuseIdentifier: ID, at: index) as! CommunityBannerFSPagerViewCell
+        cell.index = index
+        return cell
+    }
+    //MARK: - indexPath
+    var index: Int?{
+        didSet {
+            
+        }
+    }
+    //MARK: - 初始化
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+        setupViews()
+        setupLayouts()
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    //MARK: - 设置view
+    private func setupViews() {
+        addSubview(bgImageView)
+    }
+    
+    private func setupLayouts() {
+        bgImageView.snp.makeConstraints { (make) in
+            make.top.bottom.left.right.equalToSuperview()
+        }
+    }
+    
+    private lazy var bgImageView: UIImageView = {
+        let bgImageView = UIImageView()
+        bgImageView.isUserInteractionEnabled = true
+        bgImageView.image = kImage(name: "pic_preload")
+        return bgImageView
+    }()
+}

+ 117 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/Banner/CommunityBannerTableViewCell.swift

@@ -0,0 +1,117 @@
+//
+//  CommunityBannerTableViewCell.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/6/16.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import FSPagerView
+
+class CommunityBannerTableViewCell: UITableViewCell {
+
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> UITableViewCell {
+        let ID = "CommunityBannerTableViewCell"
+        tableView.register(CommunityBannerTableViewCell.self, forCellReuseIdentifier: ID)
+        let cell : CommunityBannerTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! CommunityBannerTableViewCell
+        cell.indexPath = indexPath
+        return cell
+    }
+    
+    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
+        super.init(style: style, reuseIdentifier: reuseIdentifier)
+        setupViews()
+        setupLayouts()
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    var indexPath: IndexPath? {
+        didSet {
+            
+        }
+    }
+    
+    //MRAK: - 设置View
+    private func setupViews() {
+        self.selectionStyle = .none
+        backgroundColor = kf7f8faColor
+        addSubview(pagerView)
+        addSubview(pageControl)
+    }
+    
+    private func setupLayouts() {
+        pagerView.snp.makeConstraints { (make) in
+            make.edges.equalToSuperview()
+        }
+        let pageControlWidth = 3 * kScaleValue(value: 5) +  CGFloat(3 - 1) * kScaleValue(value: 5)
+        
+        pageControl.snp.remakeConstraints { (make) in
+            make.bottom.equalTo(-10)
+            make.height.equalTo(5)
+            make.centerX.equalToSuperview()
+            make.width.equalTo(pageControlWidth)
+        }
+        pageControl.numberOfPages = 3
+        if  pageControl.numberOfPages > 1 {
+            pageControl.isHidden = false
+            pagerView.automaticSlidingInterval = 5.0
+            pagerView.isInfinite = true
+        }else {
+            pageControl.isHidden = true
+            pagerView.automaticSlidingInterval = 0.0
+            pagerView.isInfinite = false
+        }
+    }
+    
+    private lazy var pagerView: FSPagerView = {
+        let pagerView = FSPagerView(frame: CGRect.zero)
+        pagerView.backgroundColor = kf7f8faColor
+        pagerView.delegate = self
+        pagerView.dataSource = self
+        pagerView.scrollDirection = .horizontal
+        return pagerView
+    }()
+    
+    private lazy var pageControl: NXLPageControl = {
+        let pageControl = NXLPageControl()
+        pageControl.pointSize = CGSize.init(width: kScaleValue(value: 5), height: 5)
+        pageControl.currentWidthMultiple = 1//当前点的宽度为其他点的4倍
+        pageControl.localPointSpace = 5
+        pageControl.currentColor = kThemeColor
+        pageControl.otherColor = UIColor(white: 0, alpha: 0.2)
+        pageControl.clickPoint { [weak self] (index) in
+            
+        }
+        return pageControl
+    }()
+
+}
+
+extension CommunityBannerTableViewCell:FSPagerViewDataSource,FSPagerViewDelegate {
+    func numberOfItems(in pagerView: FSPagerView) -> Int {
+        return 3
+    }
+    func pagerView(_ pagerView: FSPagerView, cellForItemAt index: Int) -> FSPagerViewCell {
+        let cell  = CommunityBannerFSPagerViewCell.cellWith(collectionView: pagerView, index: index)
+        return cell
+    }
+    
+    func pagerView(_ pagerView: FSPagerView, didSelectItemAt index: Int) {
+        pagerView.deselectItem(at: index, animated: true)
+        
+    }
+    
+    func pagerViewWillEndDragging(_ pagerView: FSPagerView, targetIndex: Int) {
+        self.pageControl.currentPage = targetIndex
+    }
+    
+    func pagerViewDidEndScrollAnimation(_ pagerView: FSPagerView) {
+        self.pageControl.currentPage = pagerView.currentIndex
+    }
+    
+}
+

+ 0 - 3
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/PicVideo/CardContentPicVideoModel.swift

@@ -22,14 +22,11 @@ class CardContentPicVideoModel: NSObject {
             case 1:
                 if width < height { //图片宽度大于图片高度
                     if height / width > 2 {
-                        NXLLog(347 * kScaleWidth)
                         return 347 * kScaleWidth
                     }else {
-                        NXLLog(232 * kScaleWidth)
                         return 232 * kScaleWidth
                     }
                 }else if width == height { //图片宽度等于图片高度
-                    NXLLog(232 * kScaleWidth)
                     return 232 * kScaleWidth
                 }else{
                      if width / height > 2 {

+ 98 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/FeaturedTopics/FeaturedTopicsCollectionViewCell.swift

@@ -0,0 +1,98 @@
+//
+//  FeaturedTopicsCollectionViewCell.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/6/16.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class FeaturedTopicsCollectionViewCell: UICollectionViewCell {
+    class func cellWith(collectionView:UICollectionView,indexPath:IndexPath) -> FeaturedTopicsCollectionViewCell {
+        let ID = "FeaturedTopicsCollectionViewCell"
+        collectionView.register(FeaturedTopicsCollectionViewCell.self, forCellWithReuseIdentifier: ID)
+        let cell : FeaturedTopicsCollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: ID, for: indexPath) as! FeaturedTopicsCollectionViewCell
+        cell.indexPath = indexPath
+        return cell
+    }
+    //MARK: - indexPath
+    var indexPath: IndexPath?{
+        didSet {
+            
+        }
+    }
+    //MARK: - 初始化
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+        setupViews()
+        setupLayouts()
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    //MRAK: - 设置View
+    private func setupViews() {
+        addSubview(picImageView)
+        addSubview(iconImageView)
+        addSubview(topicLabel)
+        addSubview(numberPeopleLable)
+    }
+    
+    private func setupLayouts() {
+        picImageView.snp_makeConstraints { (make) in
+            make.top.left.right.equalToSuperview()
+            make.height.equalTo(130)
+        }
+        iconImageView.snp_makeConstraints { (make) in
+            make.left.equalToSuperview()
+            make.top.equalTo(picImageView.snp_bottom).offset(10)
+            make.size.equalTo(20)
+        }
+        topicLabel.snp_makeConstraints { (make) in
+            make.centerY.equalTo(iconImageView)
+            make.left.equalTo(iconImageView.snp_right).offset(2)
+            make.right.lessThanOrEqualTo(numberPeopleLable.snp_left)
+            make.height.equalTo(23)
+        }
+        numberPeopleLable.snp_makeConstraints { (make) in
+            make.centerY.equalTo(iconImageView)
+            make.right.equalToSuperview()
+            make.height.equalTo(23)
+        }
+    }
+    
+    private lazy var picImageView : UIImageView = {
+        let picImageView = UIImageView()
+        picImageView.image = kImage(name: "pic_preload")
+        picImageView.cornerRadius = 4
+        picImageView.masksToBounds = true
+        return picImageView
+    }()
+    
+    private lazy var iconImageView : UIImageView = {
+        let iconImageView = UIImageView()
+        iconImageView.image = kImage(name: "edit_ico_topic_pre")
+        return iconImageView
+    }()
+    
+    private lazy var topicLabel: UILabel = {
+        let topicLabel = UILabel()
+        topicLabel.text = "吃出你的好身材"
+        topicLabel.textColor = k333333Color
+        topicLabel.font = kMediumFont16
+        return topicLabel
+    }()
+    
+    private lazy var numberPeopleLable: UILabel = {
+        let numberPeopleLable = UILabel()
+        numberPeopleLable.text = "8888人参与"
+        numberPeopleLable.textColor = k999999Color
+        numberPeopleLable.font = kRegularFont12
+        return numberPeopleLable
+    }()
+    
+    
+}

+ 97 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/FeaturedTopics/FeaturedTopicsTableViewCell.swift

@@ -0,0 +1,97 @@
+//
+//  FeaturedTopicsTableViewCell.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/6/16.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class FeaturedTopicsTableViewCell: UITableViewCell {
+
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> FeaturedTopicsTableViewCell {
+        let ID = "FeaturedTopicsTableViewCell"
+        tableView.register(FeaturedTopicsTableViewCell.self, forCellReuseIdentifier: ID)
+        let cell : FeaturedTopicsTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! FeaturedTopicsTableViewCell
+        cell.indexPath = indexPath
+        return cell
+    }
+    
+    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
+        super.init(style: style, reuseIdentifier: reuseIdentifier)
+        setupViews()
+        setupLayouts()
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    var indexPath: IndexPath? {
+        didSet {
+            
+        }
+    }
+    //MRAK: - 设置View
+    private func setupViews() {
+        self.selectionStyle = .none
+        addSubview(collectionView)
+    }
+    
+    private func setupLayouts() {
+        collectionView.snp_makeConstraints { (make) in
+            make.top.left.right.bottom.equalToSuperview()
+        }
+    }
+    
+    private lazy var collectionView: UICollectionView = {
+        let collectionView = UICollectionView.init(frame: CGRect.zero, collectionViewLayout: collectionViewLayout)
+        collectionView.backgroundColor = .gray
+        collectionView.delegate = self;
+        collectionView.dataSource = self;
+        collectionView.showsVerticalScrollIndicator = false
+        collectionView.showsHorizontalScrollIndicator = false
+        return collectionView
+    }()
+    
+    private lazy var collectionViewLayout: UICollectionViewFlowLayout = {
+        let collectionViewLayout = UICollectionViewFlowLayout.init()
+        collectionViewLayout.minimumLineSpacing = 10
+        collectionViewLayout.minimumInteritemSpacing = 0
+        collectionViewLayout.scrollDirection = .horizontal
+        return collectionViewLayout
+    }()
+
+}
+
+extension FeaturedTopicsTableViewCell: UICollectionViewDelegateFlowLayout,UICollectionViewDataSource {
+    func numberOfSections(in collectionView: UICollectionView) -> Int {
+        
+        return 1
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+        return 5
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+        let cell = FeaturedTopicsCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
+        return cell
+        
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
+        
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
+        return CGSize(width:231, height: 163)
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
+        return UIEdgeInsets(top: 0, left: 14, bottom: 10, right: 14)
+    }
+    
+}
+

+ 84 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/PopularVideo/PopularVideoCollectionViewCell.swift

@@ -0,0 +1,84 @@
+//
+//  PopularVideoCollectionViewCell.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/6/16.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class PopularVideoCollectionViewCell: UICollectionViewCell {
+    class func cellWith(collectionView:UICollectionView,indexPath:IndexPath) -> PopularVideoCollectionViewCell {
+        let ID = "PopularVideoCollectionViewCell"
+        collectionView.register(PopularVideoCollectionViewCell.self, forCellWithReuseIdentifier: ID)
+        let cell : PopularVideoCollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: ID, for: indexPath) as! PopularVideoCollectionViewCell
+        cell.indexPath = indexPath
+        return cell
+    }
+    //MARK: - indexPath
+    var indexPath: IndexPath?{
+        didSet {
+            
+        }
+    }
+    //MARK: - 初始化
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+        setupViews()
+        setupLayouts()
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    //MARK: - 设置view
+    private func setupViews() {
+        addSubview(picImageView)
+        addSubview(avatarImageView)
+        addSubview(nameLabel)
+    }
+    
+    private func setupLayouts() {
+        picImageView.snp_makeConstraints { (make) in
+            make.top.left.right.bottom.equalToSuperview()
+        }
+        avatarImageView.snp_makeConstraints { (make) in
+            make.centerX.equalToSuperview()
+            make.top.equalTo(136)
+            make.size.equalTo(54)
+        }
+        nameLabel.snp_makeConstraints { (make) in
+            make.top.equalTo(avatarImageView.snp_bottom).offset(10)
+            make.height.equalTo(17)
+            make.left.equalTo(5)
+            make.right.equalTo(-5)
+        }
+    }
+    
+    private lazy var picImageView : UIImageView = {
+        let picImageView = UIImageView()
+        picImageView.image = kImage(name: "pic_preload")
+        picImageView.cornerRadius = 4
+        picImageView.masksToBounds = true
+        return picImageView
+    }()
+    
+    private lazy var avatarImageView : UIImageView = {
+        let avatarImageView = UIImageView()
+        avatarImageView.image = kImage(name: "pic_preload")
+        avatarImageView.cornerRadius = 27
+        avatarImageView.masksToBounds = true
+        return avatarImageView
+    }()
+    
+    private lazy var nameLabel: UILabel = {
+        let nameLabel = UILabel()
+        nameLabel.text = "彩虹星球小太阳"
+        nameLabel.textColor = kffffffColor
+        nameLabel.font = kMediumFont12
+        return nameLabel
+    }()
+    
+}

+ 94 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/PopularVideo/PopularVideoTableViewCell.swift

@@ -0,0 +1,94 @@
+//
+//  PopularVideoTableViewCell.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/6/16.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class PopularVideoTableViewCell: UITableViewCell {
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> PopularVideoTableViewCell {
+        let ID = "PopularVideoTableViewCell"
+        tableView.register(PopularVideoTableViewCell.self, forCellReuseIdentifier: ID)
+        let cell : PopularVideoTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! PopularVideoTableViewCell
+        cell.indexPath = indexPath
+        return cell
+    }
+    
+    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
+        super.init(style: style, reuseIdentifier: reuseIdentifier)
+        setupViews()
+        setupLayouts()
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    var indexPath: IndexPath? {
+        didSet {
+            
+        }
+    }
+    //MRAK: - 设置View
+    private func setupViews() {
+        self.selectionStyle = .none
+        addSubview(collectionView)
+    }
+    
+    private func setupLayouts() {
+        collectionView.snp_makeConstraints { (make) in
+            make.top.left.right.bottom.equalToSuperview()
+        }
+    }
+    
+    private lazy var collectionView: UICollectionView = {
+        let collectionView = UICollectionView.init(frame: CGRect.zero, collectionViewLayout: collectionViewLayout)
+        collectionView.backgroundColor = .gray
+        collectionView.delegate = self;
+        collectionView.dataSource = self;
+        collectionView.showsVerticalScrollIndicator = false
+        collectionView.showsHorizontalScrollIndicator = false
+        return collectionView
+    }()
+    
+    private lazy var collectionViewLayout: UICollectionViewFlowLayout = {
+        let collectionViewLayout = UICollectionViewFlowLayout.init()
+        collectionViewLayout.minimumLineSpacing = 10
+        collectionViewLayout.minimumInteritemSpacing = 0
+        collectionViewLayout.scrollDirection = .horizontal
+        return collectionViewLayout
+    }()
+    
+}
+
+extension PopularVideoTableViewCell: UICollectionViewDelegateFlowLayout,UICollectionViewDataSource {
+    func numberOfSections(in collectionView: UICollectionView) -> Int {
+        return 1
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+        return 5
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+        let cell = PopularVideoCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
+        return cell
+        
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
+        
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
+        return CGSize(width:131, height: 231)
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
+        return UIEdgeInsets(top: 0, left: 14, bottom: 10, right: 14)
+    }
+    
+}

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1226 - 84
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/CommunityListViewController.swift


+ 25 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityFeaturedTopics/ViewController/CommunityFeaturedTopicsViewController.swift

@@ -0,0 +1,25 @@
+//
+//  CommunityFeaturedTopicsViewController.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/6/16.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class CommunityFeaturedTopicsViewController: BaseViewController {
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+    }
+    
+    override func setupViews() {
+        
+    }
+    
+    override func setupLayouts() {
+        
+    }
+
+}

RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/DefaultPage/logo.imageset/Contents.json → RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/logo.imageset/Contents.json


RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/DefaultPage/logo.imageset/logo@2x.png → RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/logo.imageset/logo@2x.png


RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/DefaultPage/logo.imageset/logo@3x.png → RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/logo.imageset/logo@3x.png


+ 22 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/edit_ico_topic_pre.imageset/Contents.json

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

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/edit_ico_topic_pre.imageset/edit_ico_topic_pre@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/edit_ico_topic_pre.imageset/edit_ico_topic_pre@3x.png