Browse Source

兑换商城完成

南鑫林 5 years ago
parent
commit
975de76b3c

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

@@ -195,6 +195,12 @@
 		A757C92E22744ACE00226355 /* AddressManagerListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A757C92D22744ACE00226355 /* AddressManagerListModel.swift */; };
 		A757C9302274839900226355 /* SelfMentionAddressListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A757C92F2274839900226355 /* SelfMentionAddressListModel.swift */; };
 		A757C9342274882E00226355 /* UIScrollView+MJRefreshEX.m in Sources */ = {isa = PBXBuildFile; fileRef = A757C9322274882E00226355 /* UIScrollView+MJRefreshEX.m */; };
+		A75B782222DEC2F8007B986A /* SepcialOneTypeLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = A75B782022DEC2F8007B986A /* SepcialOneTypeLayout.swift */; };
+		A75B782322DEC2F8007B986A /* RedemptionAreaSpecialOneTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A75B782122DEC2F8007B986A /* RedemptionAreaSpecialOneTableViewCell.swift */; };
+		A75B782522DEC592007B986A /* SpecialOneTypeCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A75B782422DEC592007B986A /* SpecialOneTypeCollectionViewCell.swift */; };
+		A75B782822DEC708007B986A /* SepcialTwoTypeLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = A75B782722DEC708007B986A /* SepcialTwoTypeLayout.swift */; };
+		A75B782A22DEC8B3007B986A /* RedemptionAreaSpecialTwoTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A75B782922DEC8B3007B986A /* RedemptionAreaSpecialTwoTableViewCell.swift */; };
+		A75B782C22DEC908007B986A /* SpecialTwoTypeCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A75B782B22DEC908007B986A /* SpecialTwoTypeCollectionViewCell.swift */; };
 		A75C474E22938B3900139C0C /* OrderFreightTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A75C474D22938B3900139C0C /* OrderFreightTableViewCell.swift */; };
 		A7636AC52268139C00374F9E /* LocationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7636AC42268139C00374F9E /* LocationViewController.swift */; };
 		A7636AC822682BAF00374F9E /* LocationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7636AC722682BAF00374F9E /* LocationView.swift */; };
@@ -889,6 +895,12 @@
 		A757C92F2274839900226355 /* SelfMentionAddressListModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SelfMentionAddressListModel.swift; sourceTree = "<group>"; };
 		A757C9322274882E00226355 /* UIScrollView+MJRefreshEX.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIScrollView+MJRefreshEX.m"; sourceTree = "<group>"; };
 		A757C9332274882E00226355 /* UIScrollView+MJRefreshEX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIScrollView+MJRefreshEX.h"; sourceTree = "<group>"; };
+		A75B782022DEC2F8007B986A /* SepcialOneTypeLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SepcialOneTypeLayout.swift; sourceTree = "<group>"; };
+		A75B782122DEC2F8007B986A /* RedemptionAreaSpecialOneTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RedemptionAreaSpecialOneTableViewCell.swift; sourceTree = "<group>"; };
+		A75B782422DEC592007B986A /* SpecialOneTypeCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpecialOneTypeCollectionViewCell.swift; sourceTree = "<group>"; };
+		A75B782722DEC708007B986A /* SepcialTwoTypeLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SepcialTwoTypeLayout.swift; sourceTree = "<group>"; };
+		A75B782922DEC8B3007B986A /* RedemptionAreaSpecialTwoTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RedemptionAreaSpecialTwoTableViewCell.swift; sourceTree = "<group>"; };
+		A75B782B22DEC908007B986A /* SpecialTwoTypeCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpecialTwoTypeCollectionViewCell.swift; sourceTree = "<group>"; };
 		A75C474D22938B3900139C0C /* OrderFreightTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderFreightTableViewCell.swift; sourceTree = "<group>"; };
 		A7636AC42268139C00374F9E /* LocationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationViewController.swift; sourceTree = "<group>"; };
 		A7636AC722682BAF00374F9E /* LocationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationView.swift; sourceTree = "<group>"; };
@@ -1792,6 +1804,8 @@
 		A714348A22DD9E4C00132DA9 /* View */ = {
 			isa = PBXGroup;
 			children = (
+				A75B782622DEC6E7007B986A /* SpecialLayout */,
+				A75B781F22DEC2F8007B986A /* SpecialCell */,
 				A7D77DF522DDF3940048D5F6 /* FloorCell */,
 				A7D77DF222DDEEAA0048D5F6 /* FloorHeader */,
 				A7D77DE522DDB4B50048D5F6 /* Banner */,
@@ -2682,6 +2696,26 @@
 			path = MJRefreshEX;
 			sourceTree = "<group>";
 		};
+		A75B781F22DEC2F8007B986A /* SpecialCell */ = {
+			isa = PBXGroup;
+			children = (
+				A75B782122DEC2F8007B986A /* RedemptionAreaSpecialOneTableViewCell.swift */,
+				A75B782922DEC8B3007B986A /* RedemptionAreaSpecialTwoTableViewCell.swift */,
+				A75B782422DEC592007B986A /* SpecialOneTypeCollectionViewCell.swift */,
+				A75B782B22DEC908007B986A /* SpecialTwoTypeCollectionViewCell.swift */,
+			);
+			path = SpecialCell;
+			sourceTree = "<group>";
+		};
+		A75B782622DEC6E7007B986A /* SpecialLayout */ = {
+			isa = PBXGroup;
+			children = (
+				A75B782022DEC2F8007B986A /* SepcialOneTypeLayout.swift */,
+				A75B782722DEC708007B986A /* SepcialTwoTypeLayout.swift */,
+			);
+			path = SpecialLayout;
+			sourceTree = "<group>";
+		};
 		A7636ABD2268123B00374F9E /* LocationModule */ = {
 			isa = PBXGroup;
 			children = (
@@ -5921,6 +5955,7 @@
 				BD108C9522A60C2100837DAB /* HGImageCollectionViewCell.swift in Sources */,
 				A7FF1589228C854900A85748 /* OrderDetailBottomView.swift in Sources */,
 				A770E5DB22CED8C600CBD0A4 /* RouterManager.swift in Sources */,
+				A75B782C22DEC908007B986A /* SpecialTwoTypeCollectionViewCell.swift in Sources */,
 				A714348722DD9D4700132DA9 /* RedemptionAreaViewController.swift in Sources */,
 				A73A56DE22DC9CCE004920FE /* UpdateVersionManager.swift in Sources */,
 				A7D5F22B22BB687100F8E9AF /* BaseJSWebViewController.swift in Sources */,
@@ -6007,6 +6042,7 @@
 				BDF47D852282C59F00941AB9 /* ShoppingCartListTableViewCell.swift in Sources */,
 				BD01B20122BC677900CE9F36 /* PublishFilterView.swift in Sources */,
 				BD5CA89522DDA2A100364A67 /* CustomSlider.swift in Sources */,
+				A75B782522DEC592007B986A /* SpecialOneTypeCollectionViewCell.swift in Sources */,
 				A77F2CCA223209F2001BD3F6 /* BaseTabbarViewController.swift in Sources */,
 				BD61229A22C3605C00D3F513 /* AliyunEffectFilterCell.m in Sources */,
 				A7BF202B22B396F300396DB3 /* CardContentTitleTableViewCell.swift in Sources */,
@@ -6020,6 +6056,7 @@
 				BD12B67D22B4EE6D00AEB10B /* KSMediaPickerItemModel.swift in Sources */,
 				A7F2D6DD22B2536F0093000B /* CardContentPicVideoCollectionViewCell.swift in Sources */,
 				A72623D922C2F8B100AEF875 /* MessageHomeOneCollectionViewCell.swift in Sources */,
+				A75B782822DEC708007B986A /* SepcialTwoTypeLayout.swift in Sources */,
 				BD7AB83622841A8B0030646A /* ShoppingCartPayOrderItemCell.swift in Sources */,
 				A71AA519227219D7008FF1A5 /* EditExpressAddressViewController.swift in Sources */,
 				A7FF1568228C6E2300A85748 /* OrderDeliveryModeAndTimeTableViewCell.swift in Sources */,
@@ -6080,6 +6117,7 @@
 				A77F2CB52232010F001BD3F6 /* ShoppingMallViewController.swift in Sources */,
 				A7D77DEB22DDC5900048D5F6 /* RedemptionAreaFSPagerViewCell.swift in Sources */,
 				A7D07CD622B78BC300186014 /* PersonViewUserAndOtherListCollectionViewCell.swift in Sources */,
+				A75B782322DEC2F8007B986A /* RedemptionAreaSpecialOneTableViewCell.swift in Sources */,
 				A71AA513227215B5008FF1A5 /* ExpressAddressListView.swift in Sources */,
 				A7B4E723228154750012914A /* ProductFloorBannerView.swift in Sources */,
 				A7003EA3229192CC004E51FB /* PayManagerPay.swift in Sources */,
@@ -6148,6 +6186,7 @@
 				A7284A7722547333000BAEC4 /* AlipayResultModel.swift in Sources */,
 				BD61226C22C3595B00D3F513 /* AlivcRecordUIConfig.m in Sources */,
 				A72A72B422321DE000B21995 /* Extension+UIImage.swift in Sources */,
+				A75B782222DEC2F8007B986A /* SepcialOneTypeLayout.swift in Sources */,
 				A7BB68552268DE8600AB07A2 /* SelfRecommendationView.swift in Sources */,
 				BD12B69622B4F72900AEB10B /* KSMediaPickerPreviewView.swift in Sources */,
 				A7BF203122B47CC000396DB3 /* CardContentCommnetTableViewCell.swift in Sources */,
@@ -6244,6 +6283,7 @@
 				A7274C5F228EE636000E3A07 /* LBXScanWrapper.swift in Sources */,
 				A7CC752F2271A1F2003C4F38 /* SetPasswordView.swift in Sources */,
 				A7A98E09227EB8DD005306E9 /* CategoryView.swift in Sources */,
+				A75B782A22DEC8B3007B986A /* RedemptionAreaSpecialTwoTableViewCell.swift in Sources */,
 				BD0F61F822CAFC8B004650FB /* CommunityVideoAuthModel.swift in Sources */,
 				A7D07CC122B73F0200186014 /* OtherPersonalCenterViewController.swift in Sources */,
 				A7CC75362271AC14003C4F38 /* AddressManagerView.swift in Sources */,

+ 3 - 3
RainbowPlanet/RainbowPlanet/Model/CMSModel/CMSRedemptionAreaModel.swift

@@ -32,8 +32,8 @@ class CMSRedemptionAreaModel : NSObject, Mappable{
 enum CMSRedemptionAreaContentType : String {
     case none = ""
     case banner = "banner"
-    case specialOne = "specialOne"
-    case specialTwo = "special_two"
+    case specialOne = "subject_one"
+    case specialTwo = "subject_two"
     case floor = "floor"
 }
 
@@ -48,7 +48,7 @@ class CMSRedemptionAreaContent : NSObject, Mappable{
     var floorImg : String?
     var id : Int?
     var linkType : Int?
-    var linkUrl : String?
+    var linkUrl : Int?
     var rule : [CMSRedemptionAreaRule]?
     var showType : Int?
     

+ 3 - 5
RainbowPlanet/RainbowPlanet/Modules/RedemptionAreaModule/View/FloorCell/RedemptionAreaFloorTableViewCell.swift

@@ -54,7 +54,7 @@ class RedemptionAreaFloorTableViewCell: UITableViewCell {
         collectionView.showsVerticalScrollIndicator = false
         collectionView.showsHorizontalScrollIndicator = false
         collectionView.backgroundColor = UIColor.white
-        collectionView.contentInset = UIEdgeInsets(top: 0, left: 5, bottom: 5, right: 5)
+        collectionView.isScrollEnabled = false
         return collectionView
     }()
     
@@ -108,10 +108,8 @@ extension RedemptionAreaFloorTableViewCell: UICollectionViewDelegateFlowLayout,U
     }
     
     func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
-        return UIEdgeInsets(top:0, left: 0, bottom: 0, right: 0)
+        return UIEdgeInsets(top: 0, left: 5, bottom: 5, right: 5)
+
     }
     
 }
-
-
-

+ 10 - 0
RainbowPlanet/RainbowPlanet/Modules/RedemptionAreaModule/View/FloorHeader/FloorHeaderViewFloorHeaderView.swift

@@ -7,11 +7,14 @@
 //
 
 import Foundation
+import SwiftyMediator
 
 class FloorHeaderViewFloorHeaderView: BaseView {
     
     override func setupViews() {
+        backgroundColor = UIColor.white
         addSubview(imageView)
+        self.addTapGesture(1, target: self, action: #selector(pushSubject))
     }
     
     override func setupLayouts() {
@@ -28,6 +31,7 @@ class FloorHeaderViewFloorHeaderView: BaseView {
         imageView.image = kImage(name: "pic_preload")
         imageView.contentMode =  .scaleAspectFill
         imageView.clipsToBounds = true
+        imageView.isUserInteractionEnabled = true
         return imageView
     }()
     
@@ -37,4 +41,10 @@ class FloorHeaderViewFloorHeaderView: BaseView {
         }
     }
     
+    @objc func pushSubject() {
+        if cmsRedemptionAreaContent?.linkUrl != nil {
+            Mediator.push(H5RouterModuleType.pushSubject(id: "\(cmsRedemptionAreaContent?.linkUrl ?? 0)"))
+        }
+    }
+    
 }

+ 113 - 0
RainbowPlanet/RainbowPlanet/Modules/RedemptionAreaModule/View/SpecialCell/RedemptionAreaSpecialOneTableViewCell.swift

@@ -0,0 +1,113 @@
+//
+//  SpecialTopicOneTableViewCell.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/7/17.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class RedemptionAreaSpecialOneTableViewCell: UITableViewCell {
+    
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> RedemptionAreaSpecialOneTableViewCell {
+        let ID = "RedemptionAreaSpecialOneTableViewCell"
+        tableView.register(RedemptionAreaSpecialOneTableViewCell.self, forCellReuseIdentifier: ID)
+        let cell : RedemptionAreaSpecialOneTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! RedemptionAreaSpecialOneTableViewCell
+        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 = UIColor.white
+        addSubview(collectionView)
+    }
+    
+    private func setupLayouts() {
+        collectionView.snp.remakeConstraints {(make) in
+            make.left.equalTo(14)
+            make.right.equalTo(-14)
+            make.top.equalToSuperview()
+            make.height.equalTo(193*kScaleWidth)
+        }
+    }
+    
+    private lazy var collectionView: UICollectionView = {
+        let collectionView = UICollectionView.init(frame: CGRect.zero,collectionViewLayout: collectionViewLayout)
+        collectionView.backgroundColor = UIColor.white
+        collectionView.delegate = self;
+        collectionView.dataSource = self;
+        collectionView.showsVerticalScrollIndicator = false
+        collectionView.showsHorizontalScrollIndicator = false
+        collectionView.isScrollEnabled = false
+        return collectionView
+    }()
+    
+    private lazy var collectionViewLayout: SepcialOneTypeLayout = {
+        let collectionViewLayout = SepcialOneTypeLayout()
+        return collectionViewLayout
+    }()
+    
+    
+    var cmsRedemptionAreaContent: CMSRedemptionAreaContent? {
+        didSet{
+            collectionView.reloadData()
+        }
+    }
+
+}
+
+extension RedemptionAreaSpecialOneTableViewCell: UICollectionViewDelegateFlowLayout,UICollectionViewDataSource {
+    func numberOfSections(in collectionView: UICollectionView) -> Int {
+        if !(cmsRedemptionAreaContent?.rule?.isEmpty ?? true) {
+            return 1
+        }else {
+            return 0
+        }
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+        if !(cmsRedemptionAreaContent?.rule?.isEmpty ?? true) {
+            return cmsRedemptionAreaContent?.rule?.count ?? 0
+        }else {
+            return 0
+        }
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+        let cmsRedemptionAreaRule = cmsRedemptionAreaContent?.rule?[indexPath.row]
+        let cell = SpecialOneTypeCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
+        cell.cmsRedemptionAreaRule = cmsRedemptionAreaRule
+        return cell
+        
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
+        let cmsRedemptionAreaRule = cmsRedemptionAreaContent?.rule?[indexPath.row]
+        RedemptionAreaViewModel.shared.pushVC(cmsRedemptionAreaRule: cmsRedemptionAreaRule)
+
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
+        return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
+        
+    }
+    
+}

+ 111 - 0
RainbowPlanet/RainbowPlanet/Modules/RedemptionAreaModule/View/SpecialCell/RedemptionAreaSpecialTwoTableViewCell.swift

@@ -0,0 +1,111 @@
+//
+//  RedemptionAreaSpecialTwoTableViewCell.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/7/17.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class RedemptionAreaSpecialTwoTableViewCell: UITableViewCell {
+
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> RedemptionAreaSpecialTwoTableViewCell {
+        let ID = "RedemptionAreaSpecialTwoTableViewCell"
+        tableView.register(RedemptionAreaSpecialTwoTableViewCell.self, forCellReuseIdentifier: ID)
+        let cell : RedemptionAreaSpecialTwoTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! RedemptionAreaSpecialTwoTableViewCell
+        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 = UIColor.white
+        addSubview(collectionView)
+    }
+    
+    private func setupLayouts() {
+        collectionView.snp.remakeConstraints {(make) in
+            make.top.left.right.equalToSuperview()
+            make.height.equalTo(275*kScaleWidth)
+        }
+    }
+    
+    private lazy var collectionView: UICollectionView = {
+        let collectionView = UICollectionView.init(frame: CGRect.zero,collectionViewLayout: collectionViewLayout)
+        collectionView.backgroundColor = UIColor.white
+        collectionView.delegate = self;
+        collectionView.dataSource = self;
+        collectionView.showsVerticalScrollIndicator = false
+        collectionView.showsHorizontalScrollIndicator = false
+        collectionView.isScrollEnabled = false
+        return collectionView
+    }()
+    
+    private lazy var collectionViewLayout: SepcialTwoTypeLayout = {
+        let collectionViewLayout = SepcialTwoTypeLayout()
+        return collectionViewLayout
+    }()
+    
+    
+    var cmsRedemptionAreaContent: CMSRedemptionAreaContent? {
+        didSet{
+            collectionView.reloadData()
+        }
+    }
+    
+}
+
+extension RedemptionAreaSpecialTwoTableViewCell: UICollectionViewDelegateFlowLayout,UICollectionViewDataSource {
+    func numberOfSections(in collectionView: UICollectionView) -> Int {
+        if !(cmsRedemptionAreaContent?.rule?.isEmpty ?? true) {
+            return 1
+        }else {
+            return 0
+        }
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+        if !(cmsRedemptionAreaContent?.rule?.isEmpty ?? true) {
+            return cmsRedemptionAreaContent?.rule?.count ?? 0
+        }else {
+            return 0
+        }
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+        let cmsRedemptionAreaRule = cmsRedemptionAreaContent?.rule?[indexPath.row]
+        let cell = SpecialTwoTypeCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
+        cell.cmsRedemptionAreaRule = cmsRedemptionAreaRule
+        return cell
+        
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
+        let cmsRedemptionAreaRule = cmsRedemptionAreaContent?.rule?[indexPath.row]
+        RedemptionAreaViewModel.shared.pushVC(cmsRedemptionAreaRule: cmsRedemptionAreaRule)
+        
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
+        return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
+        
+    }
+
+}

+ 62 - 0
RainbowPlanet/RainbowPlanet/Modules/RedemptionAreaModule/View/SpecialCell/SpecialOneTypeCollectionViewCell.swift

@@ -0,0 +1,62 @@
+//
+//  SpecialOneTypeCollectionViewCell.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/7/17.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class SpecialOneTypeCollectionViewCell: UICollectionViewCell {
+    class func cellWith(collectionView:UICollectionView,indexPath:IndexPath) -> SpecialOneTypeCollectionViewCell {
+        let ID = "SpecialOneTypeCollectionViewCell"
+        collectionView.register(SpecialOneTypeCollectionViewCell.self, forCellWithReuseIdentifier: ID)
+        let cell : SpecialOneTypeCollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: ID, for: indexPath) as! SpecialOneTypeCollectionViewCell
+        cell.indexPath = indexPath
+        return cell
+    }
+    //MARK: - indexPath
+    var indexPath: IndexPath?{
+        didSet {
+            
+        }
+    }
+    //MARK: - 初始化
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+        backgroundColor = UIColor.white
+        cornerRadius = 4
+        masksToBounds = true
+        setupViews()
+        setupLayouts()
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    //MARK: - 设置view
+    private func setupViews() {
+        addSubview(iconImageView)
+    }
+    
+    private func setupLayouts() {
+        iconImageView.snp.makeConstraints { (make) in
+            make.edges.equalToSuperview()
+        }
+    }
+    
+    lazy var iconImageView : UIImageView = {
+        let iconImageView = UIImageView()
+        iconImageView.image = kImage(name: "pic_preload")
+        iconImageView.isUserInteractionEnabled = true
+        return iconImageView
+    }()
+    
+    var cmsRedemptionAreaRule : CMSRedemptionAreaRule? {
+        didSet {
+            iconImageView.kf.setImage(with: kURLImage(name: cmsRedemptionAreaRule?.url ?? ""), placeholder: kImage(name: "pic_preload"))
+        }
+    }
+}

+ 60 - 0
RainbowPlanet/RainbowPlanet/Modules/RedemptionAreaModule/View/SpecialCell/SpecialTwoTypeCollectionViewCell.swift

@@ -0,0 +1,60 @@
+//
+//  SpecialTwoTypeCollectionViewCell.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/7/17.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class SpecialTwoTypeCollectionViewCell: UICollectionViewCell {
+    class func cellWith(collectionView:UICollectionView,indexPath:IndexPath) -> SpecialTwoTypeCollectionViewCell {
+        let ID = "SpecialTwoTypeCollectionViewCell"
+        collectionView.register(SpecialTwoTypeCollectionViewCell.self, forCellWithReuseIdentifier: ID)
+        let cell : SpecialTwoTypeCollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: ID, for: indexPath) as! SpecialTwoTypeCollectionViewCell
+        cell.indexPath = indexPath
+        return cell
+    }
+    //MARK: - indexPath
+    var indexPath: IndexPath?{
+        didSet {
+            
+        }
+    }
+    //MARK: - 初始化
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+        backgroundColor = UIColor.white
+        setupViews()
+        setupLayouts()
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    //MARK: - 设置view
+    private func setupViews() {
+        addSubview(iconImageView)
+    }
+    
+    private func setupLayouts() {
+        iconImageView.snp.makeConstraints { (make) in
+            make.edges.equalToSuperview()
+        }
+    }
+    
+    lazy var iconImageView : UIImageView = {
+        let iconImageView = UIImageView()
+        iconImageView.image = kImage(name: "pic_preload")
+        iconImageView.isUserInteractionEnabled = true
+        return iconImageView
+    }()
+    
+    var cmsRedemptionAreaRule : CMSRedemptionAreaRule? {
+        didSet {
+            iconImageView.kf.setImage(with: kURLImage(name: cmsRedemptionAreaRule?.url ?? ""), placeholder: kImage(name: "pic_preload"))
+        }
+    }
+}

+ 67 - 0
RainbowPlanet/RainbowPlanet/Modules/RedemptionAreaModule/View/SpecialLayout/SepcialOneTypeLayout.swift

@@ -0,0 +1,67 @@
+//
+//  SepcialOneTypeLayout.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/7/17.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class SepcialOneTypeLayout: UICollectionViewFlowLayout {
+    
+    // 内容区域总大小,不是可见区域
+    override var collectionViewContentSize: CGSize {
+        let width = collectionView!.bounds.size.width - collectionView!.contentInset.left
+            - collectionView!.contentInset.right
+        let height = 193 * kScaleWidth
+        return CGSize(width: width, height: height)
+    }
+    
+    // 所有单元格位置属性
+    override func layoutAttributesForElements(in rect: CGRect)
+        -> [UICollectionViewLayoutAttributes]? {
+            var attributesArray = [UICollectionViewLayoutAttributes]()
+            let cellCount = self.collectionView!.numberOfItems(inSection: 0)
+            for i in 0..<cellCount {
+                let indexPath =  IndexPath(item:i, section:0)
+                let attributes =  self.layoutAttributesForItem(at: indexPath)
+                attributesArray.append(attributes!)
+            }
+            return attributesArray
+    }
+    
+    // 这个方法返回每个单元格的位置和大小
+    override func layoutAttributesForItem(at indexPath: IndexPath)
+        -> UICollectionViewLayoutAttributes? {
+            //当前单元格布局属性
+            let attribute =  UICollectionViewLayoutAttributes(forCellWith:indexPath)
+            
+            //单元格边长
+            let largeCellSide = 153 * kScaleWidth
+            let smallCellSide = 190 * kScaleWidth
+            
+            //当前行数,每行显示3个图片,1大2小
+            let line:Int =  indexPath.item / 3
+            //当前行的Y坐标
+            let lineOriginY =  largeCellSide * CGFloat(line)
+            //右侧单元格X坐标,这里按左右对齐,所以中间空隙大
+            let rightSmallX = collectionViewContentSize.width - smallCellSide
+            
+            if (indexPath.item % 3 == 0) {
+                attribute.frame = CGRect(x:0, y:lineOriginY, width:largeCellSide,
+                                         height:collectionViewContentSize.height)
+            } else if (indexPath.item % 3 == 1) {
+                attribute.frame = CGRect(x:rightSmallX, y:lineOriginY, width:smallCellSide,
+                                         height:94 * kScaleWidth)
+            } else if (indexPath.item % 3 == 2) {
+                attribute.frame = CGRect(x:rightSmallX,
+                                         y:5 * kScaleWidth + 94 * kScaleWidth,
+                                         width:smallCellSide, height:94 * kScaleWidth)
+            }
+            
+            return attribute
+    }
+    
+}
+

+ 47 - 0
RainbowPlanet/RainbowPlanet/Modules/RedemptionAreaModule/View/SpecialLayout/SepcialTwoTypeLayout.swift

@@ -0,0 +1,47 @@
+//
+//  SepcialTwoTypeLayout.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/7/17.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class SepcialTwoTypeLayout: UICollectionViewFlowLayout {
+    // 内容区域总大小,不是可见区域
+    override var collectionViewContentSize: CGSize {
+        let width = collectionView!.bounds.size.width - collectionView!.contentInset.left
+            - collectionView!.contentInset.right
+        let height = 275 * kScaleWidth
+        return CGSize(width: width, height: height)
+    }
+    
+    // 所有单元格位置属性
+    override func layoutAttributesForElements(in rect: CGRect)
+        -> [UICollectionViewLayoutAttributes]? {
+            var attributesArray = [UICollectionViewLayoutAttributes]()
+            let cellCount = self.collectionView!.numberOfItems(inSection: 0)
+            for i in 0..<cellCount {
+                let indexPath =  IndexPath(item:i, section:0)
+                let attributes =  self.layoutAttributesForItem(at: indexPath)
+                attributesArray.append(attributes!)
+            }
+            return attributesArray
+    }
+    
+    // 这个方法返回每个单元格的位置和大小
+    override func layoutAttributesForItem(at indexPath: IndexPath)
+        -> UICollectionViewLayoutAttributes? {
+            //当前单元格布局属性
+            let attribute =  UICollectionViewLayoutAttributes(forCellWith:indexPath)
+            if (indexPath.item  == 0) {
+                attribute.frame = CGRect(x:0, y:0, width:kScreenWidth,
+                                         height:150*kScaleWidth)
+            }else {
+                attribute.frame = CGRect(x: CGFloat(indexPath.item-1) * (kScreenWidth/3), y:150*kScaleWidth, width:kScreenWidth/3,
+                                         height:kScreenWidth/3)
+            }
+            return attribute
+    }
+}

+ 35 - 21
RainbowPlanet/RainbowPlanet/Modules/RedemptionAreaModule/ViewController/RedemptionAreaViewController.swift

@@ -29,7 +29,7 @@ class RedemptionAreaViewController: BaseViewController {
     lazy var tableView: UITableView = {
         let tableView = UITableView(frame: CGRect(x: 0, y: kNavBarTotalHeight, width: kScreenWidth, height: kScreenHeight - kNavBarTotalHeight - kTabBarTotalHeight), style: UITableView.Style.grouped)
         tableView.separatorStyle = .none
-        tableView.backgroundColor = kf7f8faColor
+        tableView.backgroundColor = UIColor.white
         tableView.dataSource = self
         tableView.delegate = self
         tableView.estimatedRowHeight = 0
@@ -67,7 +67,6 @@ extension RedemptionAreaViewController {
 extension RedemptionAreaViewController : UITableViewDelegate, UITableViewDataSource {
     func numberOfSections(in tableView: UITableView) -> Int {
         return self.cmsRedemptionAreaModel?.content?.isEmpty ?? true ? 0 : (self.cmsRedemptionAreaModel?.content?.count)!
-//          return self.cmsRedemptionAreaModel?.content?.isEmpty ?? true ? 0 : 1
     }
     
     func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
@@ -84,26 +83,17 @@ extension RedemptionAreaViewController : UITableViewDelegate, UITableViewDataSou
             cell.cmsRedemptionAreaContent = cmsRedemptionAreaContent
             return cell
         case .specialOne?:
-            let cell = RedemptionAreaBannerTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+            let cell = RedemptionAreaSpecialOneTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+            cell.cmsRedemptionAreaContent = cmsRedemptionAreaContent
             return cell
         case .specialTwo?:
-            let cell = RedemptionAreaBannerTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+            let cell = RedemptionAreaSpecialTwoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+            cell.cmsRedemptionAreaContent = cmsRedemptionAreaContent
             return cell
         case .floor?:
             let cell = RedemptionAreaFloorTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
             cell.cmsRedemptionAreaContent = cmsRedemptionAreaContent
             return cell
-//        case "category":
-//            let cell = ShoppingMallCategoryTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-//            cell.cmsRuleModels = cmsSectionModel?.rule
-//            cell.frame = tableView.bounds
-//            cell.layoutIfNeeded()
-//            cell.reloadData()
-//            return cell
-//        case "special":
-//            let cell = ShoppingMallSepcialTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-//            cell.cmsRuleModels = cmsSectionModel?.rule
-//            return cell
         default:
             return UITableViewCell()
         }
@@ -120,18 +110,26 @@ extension RedemptionAreaViewController : UITableViewDelegate, UITableViewDataSou
                 return  (150 * kScaleWidth) + 105
             }
         case .specialOne?:
-            return 0
+            if cmsRedemptionAreaContent?.rule?.isEmpty ?? true {
+                return  0
+            }else {
+                return  (193 * kScaleWidth) + 30
+            }
         case .specialTwo?:
-            return 0
+            if cmsRedemptionAreaContent?.rule?.isEmpty ?? true {
+                return  0
+            }else {
+                return  (275 * kScaleWidth) + 30
+            }
         case .floor?:
             if cmsRedemptionAreaContent?.rule?.isEmpty ?? true {
                 return  0
             }else {
                 let count = Int((cmsRedemptionAreaContent?.rule?.count ?? 0) / 2)
                 if ((cmsRedemptionAreaContent?.rule?.count ?? 0) % 2) == 0 {
-                    return  CGFloat(CGFloat(count) * ((kScreenWidth-15)/2 + 116.0))
+                    return  CGFloat(CGFloat(count) * ((kScreenWidth-15)/2 + 116.0)) + CGFloat(5 * CGFloat(count))
                 }else {
-                    return  CGFloat(CGFloat(count) * ((kScreenWidth-15)/2 + 116.0)) + CGFloat((kScreenWidth-15)/2 + 116.0)
+                    return  CGFloat(CGFloat(count) * ((kScreenWidth-15)/2 + 116.0)) + CGFloat((kScreenWidth-15)/2 + 116.0) + CGFloat(5 * (CGFloat(count) + 1))
                 }
             }
         default:
@@ -172,10 +170,26 @@ extension RedemptionAreaViewController : UITableViewDelegate, UITableViewDataSou
     }
     
     func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
-        return 10
+        if self.cmsRedemptionAreaModel?.content?.isEmpty ?? true {
+            return 0.000001
+        }else {
+            return 10
+        }
     }
     func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
-        return nil
+        
+        if self.cmsRedemptionAreaModel?.content?.isEmpty ?? true {
+            return nil
+        }else {
+            if section ==  (self.cmsRedemptionAreaModel?.content?.count ?? 1) - 1 {
+                return nil
+            }else {
+                let view = UIView(frame: CGRect(x: 0, y: 0, width: kScreenWidth, height: 10))
+                view.backgroundColor = kf7f8faColor
+                return view
+            }
+        }
+        
     }
     
 }