Parcourir la source

Merge branch 'feature/nanxinlin' into develop

南鑫林 il y a 6 ans
Parent
commit
411d148342

+ 24 - 12
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -18,9 +18,9 @@
 		A70B2C272286C5D600B2449F /* ProductDetailFSPagerViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70B2C262286C5D600B2449F /* ProductDetailFSPagerViewCell.swift */; };
 		A70B2C292286D77200B2449F /* ProductDetailProductInfoTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70B2C282286D77200B2449F /* ProductDetailProductInfoTableViewCell.swift */; };
 		A70B2C2D2286E29900B2449F /* ProductModule.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A70B2C2C2286E29900B2449F /* ProductModule.xcassets */; };
-		A70B2C3322880BB700B2449F /* ProductDetailProductSkuTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70B2C3222880BB700B2449F /* ProductDetailProductSkuTableViewCell.swift */; };
+		A70B2C3322880BB700B2449F /* ProductDetailProductLabelTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70B2C3222880BB700B2449F /* ProductDetailProductLabelTableViewCell.swift */; };
 		A70B2C35228815F700B2449F /* ProductDetailProductSkuLabelCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70B2C34228815F700B2449F /* ProductDetailProductSkuLabelCollectionViewCell.swift */; };
-		A70B2C372288177300B2449F /* ProductDetailProductSkuIconCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70B2C362288177300B2449F /* ProductDetailProductSkuIconCollectionViewCell.swift */; };
+		A70B2C372288177300B2449F /* ProductDetailProductLabelIconCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70B2C362288177300B2449F /* ProductDetailProductLabelIconCollectionViewCell.swift */; };
 		A70B2C3E228825B100B2449F /* ProductDetailEvaluationTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70B2C3D228825B100B2449F /* ProductDetailEvaluationTableViewCell.swift */; };
 		A70B2C402288312900B2449F /* ProductDetailSectionHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70B2C3F2288312900B2449F /* ProductDetailSectionHeader.swift */; };
 		A70B2C4322883B4E00B2449F /* ProductDetailShopTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70B2C4222883B4E00B2449F /* ProductDetailShopTableViewCell.swift */; };
@@ -40,6 +40,7 @@
 		A70B2C6D2288815E00B2449F /* PickViewOneComponentsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70B2C6C2288815E00B2449F /* PickViewOneComponentsView.swift */; };
 		A70B2C732289019200B2449F /* ProductDetailSkuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70B2C722289019200B2449F /* ProductDetailSkuView.swift */; };
 		A70B2C75228920BA00B2449F /* ProductDetailSkuSectionHeaerCollectionReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70B2C74228920BA00B2449F /* ProductDetailSkuSectionHeaerCollectionReusableView.swift */; };
+		A70B842E228F97EC00882BC5 /* ProcuctDetailSelectSkuTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70B842D228F97EC00882BC5 /* ProcuctDetailSelectSkuTableViewCell.swift */; };
 		A70EBBC022561179000AD74F /* Extension+UITableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70EBBBF22561179000AD74F /* Extension+UITableView.swift */; };
 		A7146349228EFCE20066099B /* ORSKUDataFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = A7146347228EFCE20066099B /* ORSKUDataFilter.m */; };
 		A714634E228F020A0066099B /* ORSKUDataFilterSwift.swift in Sources */ = {isa = PBXBuildFile; fileRef = A714634D228F020A0066099B /* ORSKUDataFilterSwift.swift */; };
@@ -394,9 +395,9 @@
 		A70B2C262286C5D600B2449F /* ProductDetailFSPagerViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductDetailFSPagerViewCell.swift; sourceTree = "<group>"; };
 		A70B2C282286D77200B2449F /* ProductDetailProductInfoTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductDetailProductInfoTableViewCell.swift; sourceTree = "<group>"; };
 		A70B2C2C2286E29900B2449F /* ProductModule.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = ProductModule.xcassets; sourceTree = "<group>"; };
-		A70B2C3222880BB700B2449F /* ProductDetailProductSkuTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductDetailProductSkuTableViewCell.swift; sourceTree = "<group>"; };
+		A70B2C3222880BB700B2449F /* ProductDetailProductLabelTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductDetailProductLabelTableViewCell.swift; sourceTree = "<group>"; };
 		A70B2C34228815F700B2449F /* ProductDetailProductSkuLabelCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductDetailProductSkuLabelCollectionViewCell.swift; sourceTree = "<group>"; };
-		A70B2C362288177300B2449F /* ProductDetailProductSkuIconCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductDetailProductSkuIconCollectionViewCell.swift; sourceTree = "<group>"; };
+		A70B2C362288177300B2449F /* ProductDetailProductLabelIconCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductDetailProductLabelIconCollectionViewCell.swift; sourceTree = "<group>"; };
 		A70B2C3D228825B100B2449F /* ProductDetailEvaluationTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductDetailEvaluationTableViewCell.swift; sourceTree = "<group>"; };
 		A70B2C3F2288312900B2449F /* ProductDetailSectionHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductDetailSectionHeader.swift; sourceTree = "<group>"; };
 		A70B2C4222883B4E00B2449F /* ProductDetailShopTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductDetailShopTableViewCell.swift; sourceTree = "<group>"; };
@@ -416,6 +417,7 @@
 		A70B2C6C2288815E00B2449F /* PickViewOneComponentsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PickViewOneComponentsView.swift; sourceTree = "<group>"; };
 		A70B2C722289019200B2449F /* ProductDetailSkuView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductDetailSkuView.swift; sourceTree = "<group>"; };
 		A70B2C74228920BA00B2449F /* ProductDetailSkuSectionHeaerCollectionReusableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductDetailSkuSectionHeaerCollectionReusableView.swift; sourceTree = "<group>"; };
+		A70B842D228F97EC00882BC5 /* ProcuctDetailSelectSkuTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProcuctDetailSelectSkuTableViewCell.swift; sourceTree = "<group>"; };
 		A70EBBBF22561179000AD74F /* Extension+UITableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Extension+UITableView.swift"; sourceTree = "<group>"; };
 		A7146347228EFCE20066099B /* ORSKUDataFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORSKUDataFilter.m; sourceTree = "<group>"; };
 		A7146348228EFCE20066099B /* ORSKUDataFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORSKUDataFilter.h; sourceTree = "<group>"; };
@@ -912,21 +914,21 @@
 			path = NXLPageControl;
 			sourceTree = "<group>";
 		};
-		A70B2C38228819B500B2449F /* ProductDetailProductSku */ = {
+		A70B2C38228819B500B2449F /* ProductDetailProductLabel */ = {
 			isa = PBXGroup;
 			children = (
-				A70B2C3222880BB700B2449F /* ProductDetailProductSkuTableViewCell.swift */,
-				A70B2C362288177300B2449F /* ProductDetailProductSkuIconCollectionViewCell.swift */,
-				A70B2C34228815F700B2449F /* ProductDetailProductSkuLabelCollectionViewCell.swift */,
+				A70B2C3222880BB700B2449F /* ProductDetailProductLabelTableViewCell.swift */,
+				A70B2C362288177300B2449F /* ProductDetailProductLabelIconCollectionViewCell.swift */,
 			);
-			path = ProductDetailProductSku;
+			path = ProductDetailProductLabel;
 			sourceTree = "<group>";
 		};
 		A70B2C39228819CA00B2449F /* Cell */ = {
 			isa = PBXGroup;
 			children = (
+				A70B842C228F97AE00882BC5 /* ProcuctDetailSelectSku */,
 				A70B2C3A228819DC00B2449F /* ProductDetailProductInfo */,
-				A70B2C38228819B500B2449F /* ProductDetailProductSku */,
+				A70B2C38228819B500B2449F /* ProductDetailProductLabel */,
 				A70B2C3C2288259200B2449F /* ProductDetailEvaluation */,
 				A70B2C4122883B2F00B2449F /* ProductDetailShop */,
 				A70B2C442288408E00B2449F /* ProductDetailHotSell */,
@@ -1061,11 +1063,20 @@
 			children = (
 				A70B2C722289019200B2449F /* ProductDetailSkuView.swift */,
 				A70B2C74228920BA00B2449F /* ProductDetailSkuSectionHeaerCollectionReusableView.swift */,
+				A70B2C34228815F700B2449F /* ProductDetailProductSkuLabelCollectionViewCell.swift */,
 				A70B2C3B228819E900B2449F /* ProductDetailHeader */,
 			);
 			path = ProductDetailSkuView;
 			sourceTree = "<group>";
 		};
+		A70B842C228F97AE00882BC5 /* ProcuctDetailSelectSku */ = {
+			isa = PBXGroup;
+			children = (
+				A70B842D228F97EC00882BC5 /* ProcuctDetailSelectSkuTableViewCell.swift */,
+			);
+			path = ProcuctDetailSelectSku;
+			sourceTree = "<group>";
+		};
 		A7146346228EFCE20066099B /* SKUDataFilter */ = {
 			isa = PBXGroup;
 			children = (
@@ -3290,7 +3301,7 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				A70B2C3322880BB700B2449F /* ProductDetailProductSkuTableViewCell.swift in Sources */,
+				A70B2C3322880BB700B2449F /* ProductDetailProductLabelTableViewCell.swift in Sources */,
 				BDF45F0D228C00B8004E2682 /* DefaultContactInfoModel.swift in Sources */,
 				A72A72BA22321DE000B21995 /* Extension+String.swift in Sources */,
 				A77F2CA02231FE45001BD3F6 /* BaseWebViewController.swift in Sources */,
@@ -3299,7 +3310,7 @@
 				BD7AB83A2284288D0030646A /* ShoppingCartPayOrderFooter.swift in Sources */,
 				A72A72C522321DE000B21995 /* WKWebViewConfig.swift in Sources */,
 				A72A72BB22321DE000B21995 /* Extension+UILabel.swift in Sources */,
-				A70B2C372288177300B2449F /* ProductDetailProductSkuIconCollectionViewCell.swift in Sources */,
+				A70B2C372288177300B2449F /* ProductDetailProductLabelIconCollectionViewCell.swift in Sources */,
 				A77F2C9E2231FDDC001BD3F6 /* BaseViewController.swift in Sources */,
 				A7284A75225465DD000BAEC4 /* SwiftMoyaNetWorkServicePay.swift in Sources */,
 				A77F2CC722320627001BD3F6 /* WRNavigationBar.swift in Sources */,
@@ -3471,6 +3482,7 @@
 				A72A72B622321DE000B21995 /* Extension+NSRange.swift in Sources */,
 				A75414FD224B5F28002480B5 /* MobileLoginViewController.swift in Sources */,
 				A771F07C226D4E1C007999DB /* AddressPOITableViewCell.swift in Sources */,
+				A70B842E228F97EC00882BC5 /* ProcuctDetailSelectSkuTableViewCell.swift in Sources */,
 				A72A72AE22321DE000B21995 /* CountdownButton.swift in Sources */,
 				A71738AD228AB7B2000AEA6A /* ProductCommentListModel.swift in Sources */,
 				A7A98E28227FD6C6005306E9 /* ShoppingMallListViewController.swift in Sources */,

+ 90 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/Cell/ProcuctDetailSelectSku/ProcuctDetailSelectSkuTableViewCell.swift

@@ -0,0 +1,90 @@
+//
+//  ProcuctDetailSelectSkuTableViewCell.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/5/18.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class ProcuctDetailSelectSkuTableViewCell: UITableViewCell {
+    
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> UITableViewCell {
+        let ID = "ProcuctDetailSelectSkuTableViewCell"
+        tableView.register(ProcuctDetailSelectSkuTableViewCell.self, forCellReuseIdentifier: ID)
+        let cell : ProcuctDetailSelectSkuTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! ProcuctDetailSelectSkuTableViewCell
+        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(selectedLabel)
+        addSubview(goImageView)
+        addSubview(skuLabel)
+    }
+    
+    private func setupLayouts() {
+        
+        selectedLabel.snp.remakeConstraints { (make) in
+            make.top.equalTo(13)
+            make.left.equalTo(14)
+            make.width.greaterThanOrEqualTo(10)
+            make.height.equalTo(20)
+        }
+        
+        goImageView.snp.makeConstraints { (make) in
+            make.centerY.equalToSuperview()
+            make.right.equalTo(-14)
+            make.width.equalTo(6)
+            make.height.equalTo(11)
+        }
+        
+        skuLabel.snp.makeConstraints { (make) in
+            make.top.equalTo(13)
+            make.left.equalTo(selectedLabel.snp.right).offset(27)
+            make.right.equalTo(-14)
+            make.bottom.equalTo(-13)
+        }
+    }
+    
+    lazy var skuLabel: UILabel = {
+        let skuLabel = UILabel()
+        skuLabel.text = "请选择规格"
+        skuLabel.textColor = k333333Color
+        skuLabel.font = kRegularFont13
+        return skuLabel
+    }()
+    
+    private lazy var selectedLabel : UILabel = {
+        let selectedLabel = UILabel()
+        selectedLabel.text = "选择"
+        selectedLabel.textColor = k999999Color
+        selectedLabel.font = kScaleRegularFont13
+        return selectedLabel
+    }()
+    
+    lazy var goImageView: UIImageView = {
+        let goImageView = UIImageView()
+        goImageView.image = kImage(name: "my_arrows_unfold")
+        return goImageView
+    }()
+
+}

+ 5 - 5
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/Cell/ProductDetailProductSku/ProductDetailProductSkuIconCollectionViewCell.swift

@@ -8,11 +8,11 @@
 
 import UIKit
 
-class ProductDetailProductSkuIconCollectionViewCell: UICollectionViewCell {
-    class func cellWith(collectionView:UICollectionView,indexPath:IndexPath) -> ProductDetailProductSkuIconCollectionViewCell {
-        let ID = "ProductDetailProductSkuIconCollectionViewCell"
-        collectionView.register(ProductDetailProductSkuIconCollectionViewCell.self, forCellWithReuseIdentifier: ID)
-        let cell : ProductDetailProductSkuIconCollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: ID, for: indexPath) as! ProductDetailProductSkuIconCollectionViewCell
+class ProductDetailProductLabelIconCollectionViewCell: UICollectionViewCell {
+    class func cellWith(collectionView:UICollectionView,indexPath:IndexPath) -> ProductDetailProductLabelIconCollectionViewCell {
+        let ID = "ProductDetailProductLabelIconCollectionViewCell"
+        collectionView.register(ProductDetailProductLabelIconCollectionViewCell.self, forCellWithReuseIdentifier: ID)
+        let cell : ProductDetailProductLabelIconCollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: ID, for: indexPath) as! ProductDetailProductLabelIconCollectionViewCell
         cell.indexPath = indexPath
         return cell
     }

+ 43 - 78
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/Cell/ProductDetailProductSku/ProductDetailProductSkuTableViewCell.swift

@@ -9,24 +9,12 @@
 import UIKit
 import SwiftyJSON
 
-class ProductDetailProductSkuTableViewCell: UITableViewCell {
+class ProductDetailProductLabelTableViewCell: UITableViewCell {
     
-    var productDetailModel : ProductDetailModel? {
-        didSet {
-            if productDetailModel?.report?.isEmpty ?? true {
-                iconImageView.isHidden = true
-                titleLabel.isHidden = true
-            }else {
-                iconImageView.isHidden = false
-                titleLabel.isHidden = false
-            }
-        }
-    }
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ProductDetailProductSkuTableViewCell {
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ProductDetailProductLabelTableViewCell {
         let ID = "ProductDetailProductSkuTableViewCell"
-        tableView.register(ProductDetailProductSkuTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : ProductDetailProductSkuTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! ProductDetailProductSkuTableViewCell
+        tableView.register(ProductDetailProductLabelTableViewCell.self, forCellReuseIdentifier: ID)
+        let cell : ProductDetailProductLabelTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! ProductDetailProductLabelTableViewCell
         cell.indexPath = indexPath
         return cell
     }
@@ -49,55 +37,41 @@ class ProductDetailProductSkuTableViewCell: UITableViewCell {
     //MRAK: - 设置View
     private func setupViews() {
         self.selectionStyle = .none
-        addSubview(bgView)
-        bgView.addSubview(skuLabel)
-        bgView.addSubview(goImageView)
-        bgView.addSubview(selectedLabel)
-        
         addSubview(iconCollectionView)
-        addSubview(iconImageView)
-        addSubview(titleLabel)
+        addSubview(bgView)
+        bgView.addSubview(iconImageView)
+        bgView.addSubview(titleLabel)
+
 
     }
     
     private func setupLayouts() {
-        bgView.snp.makeConstraints { (make) in
-            make.top.left.right.equalToSuperview()
-            make.bottom.equalTo(iconCollectionView.snp.top)
-        }
+//        bgView.snp.makeConstraints { (make) in
+//            make.top.left.right.equalToSuperview()
+//            make.bottom.equalTo(iconCollectionView.snp.top)
+//        }
 
-
-        goImageView.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.right.equalTo(-14)
-        }
-        
-        selectedLabel.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.left.equalTo(14)
-        }
-        
-        skuLabel.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.left.equalTo(selectedLabel.snp.right).offset(27)
-            make.right.equalTo(-14)
-            make.bottom.equalToSuperview()
-        }
         
         iconCollectionView.snp.makeConstraints { (make) in
-            make.top.equalTo(bgView.snp.bottom)
-            make.height.equalTo(75)
+            make.top.equalToSuperview()
+            make.height.equalTo(65 * kScaleWidth)
             make.left.equalTo(0)
             make.width.equalTo(4*(kScreenWidth/5))
         }
-        iconImageView.snp.remakeConstraints { (make) in
-            make.top.equalTo(bgView.snp.bottom).offset(10)
-            make.left.equalTo(iconCollectionView.snp.right).offset(((kScreenWidth/5)-(32*kScaleWidth))/2)
-            make.size.equalTo(32*kScaleWidth)
+        bgView.snp.makeConstraints { (make) in
+            make.top.equalTo(10)
+            make.bottom.equalTo(10)
+            make.right.equalToSuperview()
+            make.width.equalTo(kScreenWidth/5)
+        }
+        iconImageView.snp.makeConstraints { (make) in
+            make.top.centerX.equalToSuperview()
+            make.size.equalTo(32 * kScaleWidth)
         }
-        titleLabel.snp.remakeConstraints { (make) in
+        titleLabel.snp.makeConstraints { (make) in
             make.top.equalTo(iconImageView.snp.bottom).offset(5)
-            make.centerX.equalTo(iconImageView)
+            make.centerX.equalToSuperview()
+            make.bottom.equalToSuperview()
         }
     }
     
@@ -111,28 +85,6 @@ class ProductDetailProductSkuTableViewCell: UITableViewCell {
         ProductDetailSkuView.productDetailSkuView(productDetailModel: productDetailModel!)
     }
     
-    lazy var skuLabel: UILabel = {
-        let skuLabel = UILabel()
-        skuLabel.text = "请选择规格"
-        skuLabel.textColor = k333333Color
-        skuLabel.font = kRegularFont13
-        return skuLabel
-    }()
-    
-    private lazy var selectedLabel : UILabel = {
-        let selectedLabel = UILabel()
-        selectedLabel.text = "选择"
-        selectedLabel.textColor = k999999Color
-        selectedLabel.font = kScaleRegularFont13
-        return selectedLabel
-    }()
-    
-    lazy var goImageView: UIImageView = {
-        let goImageView = UIImageView()
-        goImageView.image = kImage(name: "my_arrows_unfold")
-        return goImageView
-    }()
-    
     
     private lazy var iconCollectionView: UICollectionView = {
         let iconCollectionView = UICollectionView.init(frame: CGRect.zero, collectionViewLayout: iconCollectionViewLayout)
@@ -144,6 +96,7 @@ class ProductDetailProductSkuTableViewCell: UITableViewCell {
         iconCollectionView.cornerRadius = 4
         iconCollectionView.masksToBounds = true
         return iconCollectionView
+        
     }()
     
     private lazy var iconCollectionViewLayout: UICollectionViewFlowLayout = {
@@ -151,7 +104,7 @@ class ProductDetailProductSkuTableViewCell: UITableViewCell {
         iconCollectionViewLayout.minimumLineSpacing = 0
         iconCollectionViewLayout.minimumInteritemSpacing = 0
         iconCollectionViewLayout.itemSize = CGSize(width: kScreenWidth/5, height: kScaleWidth * 55)
-//        iconCollectionViewLayout.scrollDirection = .horizontal
+        iconCollectionViewLayout.scrollDirection = .horizontal
         return iconCollectionViewLayout
     }()
     lazy var iconImageView : UIImageView = {
@@ -168,6 +121,18 @@ class ProductDetailProductSkuTableViewCell: UITableViewCell {
         return titleLabel
     }()
     
+    var productDetailModel : ProductDetailModel? {
+        didSet {
+            if productDetailModel?.report?.isEmpty ?? true {
+                iconImageView.isHidden = true
+                titleLabel.isHidden = true
+            }else {
+                iconImageView.isHidden = false
+                titleLabel.isHidden = false
+            }
+        }
+    }
+    
     
     //加载数据
     func reloadData() {
@@ -177,7 +142,7 @@ class ProductDetailProductSkuTableViewCell: UITableViewCell {
         //更新collectionView的高度约束
         let contentSize1 = self.iconCollectionView.collectionViewLayout.collectionViewContentSize
         iconCollectionView.snp.remakeConstraints { (make) in
-            make.top.equalTo(bgView.snp.bottom)
+            make.top.equalToSuperview()
             make.height.equalTo(contentSize1.height)
             make.left.equalTo(0)
             make.width.equalTo(4*(kScreenWidth/5))
@@ -188,7 +153,7 @@ class ProductDetailProductSkuTableViewCell: UITableViewCell {
 
 }
 
-extension ProductDetailProductSkuTableViewCell: UICollectionViewDelegateFlowLayout,UICollectionViewDataSource {
+extension ProductDetailProductLabelTableViewCell: UICollectionViewDelegateFlowLayout,UICollectionViewDataSource {
     func numberOfSections(in collectionView: UICollectionView) -> Int {
         return 1
     }
@@ -198,7 +163,7 @@ extension ProductDetailProductSkuTableViewCell: UICollectionViewDelegateFlowLayo
     }
     
     func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
-            let cell = ProductDetailProductSkuIconCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
+            let cell = ProductDetailProductLabelIconCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
             return cell
        
     }

RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/Cell/ProductDetailProductSku/ProductDetailProductSkuLabelCollectionViewCell.swift → RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailSkuView/ProductDetailProductSkuLabelCollectionViewCell.swift


+ 60 - 6
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailView.swift

@@ -196,6 +196,21 @@ extension ProductDetailView : UITableViewDelegate, UITableViewDataSource {
     
     func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
         switch section {
+        case 1:
+            
+            if !(productDetailModel?.spec?.isEmpty ?? true) && !(productDetailModel?.label?.isEmpty ?? true) {
+                return 2
+            }
+            
+            if (productDetailModel?.spec?.isEmpty ?? true) && !(productDetailModel?.label?.isEmpty ?? true) {
+                return 1
+            }
+            
+            if !(productDetailModel?.spec?.isEmpty ?? true) && (productDetailModel?.label?.isEmpty ?? true) {
+                return 1
+            }
+            return 0
+            
         case 2:
             if productCommentListModel != nil {
                 return productCommentListModel?.data?.isEmpty ?? true ? 0 :  1
@@ -218,12 +233,34 @@ extension ProductDetailView : UITableViewDelegate, UITableViewDataSource {
             cell.productDetailModel = productDetailModel
             return cell
         case 1:
-            let cell = ProductDetailProductSkuTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-            cell.productDetailModel = productDetailModel
-            cell.frame = tableView.bounds
-            cell.layoutIfNeeded()
-            cell.reloadData()
-            return cell
+            if !(productDetailModel?.spec?.isEmpty ?? true) && !(productDetailModel?.label?.isEmpty ?? true) {
+                if indexPath.row == 0 {
+                    let cell = ProcuctDetailSelectSkuTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    return cell
+                }else {
+                    let cell = ProductDetailProductLabelTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.productDetailModel = productDetailModel
+                    cell.frame = tableView.bounds
+                    cell.layoutIfNeeded()
+                    cell.reloadData()
+                    return cell
+                }
+            }
+            
+            if (productDetailModel?.spec?.isEmpty ?? true) && !(productDetailModel?.label?.isEmpty ?? true) {
+                let cell = ProductDetailProductLabelTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                cell.productDetailModel = productDetailModel
+                cell.frame = tableView.bounds
+                cell.layoutIfNeeded()
+                cell.reloadData()
+                return cell
+            }
+            
+            if !(productDetailModel?.spec?.isEmpty ?? true) && (productDetailModel?.label?.isEmpty ?? true) {
+                let cell = ProcuctDetailSelectSkuTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                return cell
+            }
+            return UITableViewCell()
         case 2:
             let cell = ProductDetailEvaluationTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
             cell.productCommentModel = productCommentListModel?.data?[indexPath.row]
@@ -255,6 +292,23 @@ extension ProductDetailView : UITableViewDelegate, UITableViewDataSource {
     
     func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
         switch indexPath.section {
+        case 1:
+            if !(productDetailModel?.spec?.isEmpty ?? true) && !(productDetailModel?.label?.isEmpty ?? true) {
+                if indexPath.row == 0 {
+                    return UITableView.automaticDimension
+                }else {
+                    return 65 * kScaleWidth
+                }
+            }
+            
+            if (productDetailModel?.spec?.isEmpty ?? true) && !(productDetailModel?.label?.isEmpty ?? true) {
+                return 65 * kScaleWidth
+            }
+            
+            if !(productDetailModel?.spec?.isEmpty ?? true) && (productDetailModel?.label?.isEmpty ?? true) {
+                return UITableView.automaticDimension
+            }
+            return 0
         case 4:
             return 173
         default:

+ 4 - 0
RainbowPlanet/RainbowPlanet/Service/Model/ProductModel/ProductDetailModel.swift

@@ -94,8 +94,10 @@ class ProductDetailModel : NSObject, Mappable{
 /// 检测标签
 class ProductDetailLabelModel : NSObject, Mappable{
     
+    var img : String?
     var isMain : Int?
     var labelId : Int?
+    var name : String?
     
     
     class func newInstance(map: Map) -> Mappable?{
@@ -106,8 +108,10 @@ class ProductDetailLabelModel : NSObject, Mappable{
     
     func mapping(map: Map)
     {
+        img <- map["img"]
         isMain <- map["is_main"]
         labelId <- map["label_id"]
+        name <- map["name"]
         
     }
     

+ 1 - 0
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceManger/SwiftMoyaNetWorkManager/ApiMacro.swift

@@ -12,6 +12,7 @@ let kDevelopSever = true
 let kTestSever = false
 let kProductSever = false
 
+
 // MARK: - 数据服务器
 public func kApiDataPrefix() -> String {
     if kDevelopSever /** 接口前缀-开发服务器*/ {

+ 127 - 37
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceManger/SwiftMoyaNetWorkManager/SwiftMoyaNetWorkManager.swift

@@ -90,6 +90,8 @@ private var isNetworkConnect: Bool {
 }
 
 
+
+
 public class SwiftMoyaNetWorkManager: NSObject {
 
     private let disposeBag = DisposeBag()
@@ -105,16 +107,21 @@ public class SwiftMoyaNetWorkManager: NSObject {
         return _sharedInstance
     }
 
-    /// 成功回调
+    /// 成功回调 对象
     typealias successCallback = (_ data: Any) -> Void
-    /// 成功回调带泛型
-    typealias successCallTBack = (_ T: BaseMappable) -> Void
+    /// 成功回调带泛型 数组
+    typealias successCallArrayback = (_ data: [Any]) -> Void
     
+    /// 成功回调带泛型 对象
+    typealias successCallTBack = (_ T: BaseMappable) -> Void
+    /// 成功回调带泛型 数组
     typealias successCallArrayTback = (_ T: [BaseMappable]) -> Void
 
     typealias falseCallback = () -> Void
     var falseCallback : falseCallback?
 
+    // MARK: 泛型网络请求返回对象
+    /// 泛型网络请求返回对象
     /// 网络请求
     ///
     /// - Parameters:
@@ -152,8 +159,8 @@ public class SwiftMoyaNetWorkManager: NSObject {
             }
             .disposed(by: disposeBag)
     }
-    
-    /// 网络请求
+    // MARK: 泛型网络请求返回数组对象
+    /// 泛型网络请求返回数组对象
     ///
     /// - Parameters:
     ///   - type: 模型
@@ -238,8 +245,8 @@ public class SwiftMoyaNetWorkManager: NSObject {
 //
 //    }
 
-    // MARK: - 网络请求
-    /// 网络请求
+    // MARK: 网络请求返回RootModel
+    /// 网络请求返回RootModel
     ///
     /// - Parameters:
     ///   - target: 请求地址加参数
@@ -267,6 +274,37 @@ public class SwiftMoyaNetWorkManager: NSObject {
             }
             .disposed(by: disposeBag)
     }
+    
+    // MARK: 网络请求返回数组
+    /// 网络请求返回数组
+    ///
+    /// - Parameters:
+    ///   - target: 请求地址加参数
+    ///   - completion: 请求成功回调
+    func requestArray(target: MultiTarget,isCustomAlert:Bool = false,completion: @escaping successCallArrayback) -> Void {
+        //判断是否链接网络
+        if !isNetworkConnect{
+            SwiftProgressHUD.shared().showText("网络链接失败,请检查网络")
+            
+            return
+        }
+        
+        provider.rx
+            .request(target)
+            .subscribeOn(ConcurrentDispatchQueueScheduler(qos: .userInitiated))
+            .observeOn(MainScheduler.instance)
+            .subscribe(onSuccess: { [weak self] response in
+                
+                self?.getResponseArrayStatusCode(response: response, isCustomAlert: isCustomAlert, completion: completion)
+            }) {
+                [weak self] (error) in
+                SwiftProgressHUD.shared().showText(error.localizedDescription)
+                if let falseCallback = self?.falseCallback  {
+                    falseCallback()
+                }
+            }
+            .disposed(by: disposeBag)
+    }
 
 
     /// 缓存请求
@@ -315,9 +353,37 @@ public class SwiftMoyaNetWorkManager: NSObject {
 //
 //    }
 
+    // MARK: 取消所有请求
+    /// 取消所有请求
+    func cancelAllRequest() {
+        provider.manager.session.getTasksWithCompletionHandler { dataTasks, uploadTasks, downloadTasks in
+            dataTasks.forEach { $0.cancel() }
+            uploadTasks.forEach { $0.cancel() }
+            downloadTasks.forEach { $0.cancel() }
+        }
+    }
 
-    // MARK: - 获取状态码
-    /// 获取状态码
+    // MARK: 取消指定请求
+    /// 取消指定请求
+    ///
+    /// - Parameter url: 指定的网络请求地址
+    func cancelDesignationRequest(url:String) {
+        provider.manager.session.getTasksWithCompletionHandler {
+            (sessionDataTask, uploadData, downloadData) in
+            sessionDataTask.forEach {
+                //只取消指定url的请求
+                if ($0.originalRequest?.url?.absoluteString == url) {
+                    $0.cancel()
+                }
+            }
+        }
+    }
+    
+}
+// MARK: - StatusCode
+extension SwiftMoyaNetWorkManager {
+    // MARK: 返回RootModel
+    /// 获取状态码返回RootModel
     ///
     /// - Parameters:
     ///   - response: 响应结果
@@ -331,10 +397,10 @@ public class SwiftMoyaNetWorkManager: NSObject {
             let data = JSON(json["data"]).description
             rootModel?.data = data
             if rootModel!.code == 0 {
-                 completion(rootModel as Any)
+                completion(rootModel as Any)
             }else if rootModel!.code  == 1 {
                 if !isCustomAlert {
-                     SwiftProgressHUD.shared().showText(rootModel!.msg ?? "信息有误!!!", textAlignment: .left)
+                    SwiftProgressHUD.shared().showText(rootModel!.msg ?? "信息有误!!!", textAlignment: .left)
                 }
                 if let falseCallback = self.falseCallback  {
                     falseCallback()
@@ -351,52 +417,75 @@ public class SwiftMoyaNetWorkManager: NSObject {
             let infoModel = InfoModel(JSONString: json?.description ?? "")
             kAppDelegate.setLoginController()
             SwiftProgressHUD.shared().showText(infoModel!.message ?? "登录过期,请重新登录")
-
+            
             if let falseCallback = self.falseCallback  {
                 falseCallback()
             }
         } else {
             NXLLog("\nstatusCode=\(response.statusCode)\nerror=\n\(response.description)");
             SwiftProgressHUD.shared().showText(response.description)
-
+            
             if let falseCallback = self.falseCallback  {
                 falseCallback()
             }
         }
     }
-
-
-    // MARK: - 取消所有请求
-    /// 取消所有请求
-    func cancelAllRequest() {
-        provider.manager.session.getTasksWithCompletionHandler { dataTasks, uploadTasks, downloadTasks in
-            dataTasks.forEach { $0.cancel() }
-            uploadTasks.forEach { $0.cancel() }
-            downloadTasks.forEach { $0.cancel() }
-        }
-    }
-
-    // MARK: - 取消指定请求
-    /// 取消指定请求
+    
+    // MARK: 返回数组
+    /// 获取状态码返回数组
     ///
-    /// - Parameter url: 指定的网络请求地址
-    func cancelDesignationRequest(url:String) {
-        provider.manager.session.getTasksWithCompletionHandler {
-            (sessionDataTask, uploadData, downloadData) in
-            sessionDataTask.forEach {
-                //只取消指定url的请求
-                if ($0.originalRequest?.url?.absoluteString == url) {
-                    $0.cancel()
+    /// - Parameters:
+    ///   - response: 响应结果 数组
+    ///   - completion: 回调
+    private func getResponseArrayStatusCode(response:Response, isCustomAlert:Bool , completion: @escaping successCallArrayback) -> Void {
+        let json = try? JSON(response.mapJSON())
+        if response.statusCode == 200 {
+            NXLLog("\nstatusCode=\(response.statusCode)\njson=\n\(json!.description)");
+            let json = JSON(parseJSON: json!.description)
+            let rootModel = RootModel(JSONString: json.description)
+            let data = JSON(json["data"]).description
+            rootModel?.data = data
+            if rootModel!.code == 0 {
+                let array = JSON(parseJSON: rootModel?.data ?? "").arrayObject ?? Array<Any>()
+                completion(array)
+            }else if rootModel!.code  == 1 {
+                if !isCustomAlert {
+                    SwiftProgressHUD.shared().showText(rootModel!.msg ?? "信息有误!!!", textAlignment: .left)
+                }
+                if let falseCallback = self.falseCallback  {
+                    falseCallback()
+                }
+                
+            }else {
+                SwiftProgressHUD.shared().showError(rootModel!.msg ?? "信息有误!!!")
+                if let falseCallback = self.falseCallback  {
+                    falseCallback()
                 }
             }
+        }else if response.statusCode == 401 {
+            NXLLog("\nstatusCode=\(response.statusCode)\njson=\n\(json!.description)");
+            let infoModel = InfoModel(JSONString: json?.description ?? "")
+            kAppDelegate.setLoginController()
+            SwiftProgressHUD.shared().showText(infoModel!.message ?? "登录过期,请重新登录")
+            
+            if let falseCallback = self.falseCallback  {
+                falseCallback()
+            }
+        } else {
+            NXLLog("\nstatusCode=\(response.statusCode)\nerror=\n\(response.description)");
+            SwiftProgressHUD.shared().showText(response.description)
+            
+            if let falseCallback = self.falseCallback  {
+                falseCallback()
+            }
         }
     }
-    
 }
 
 
-// MARK: - 泛型返回
+// MARK: - 泛型
 extension PrimitiveSequence where TraitType == SingleTrait, ElementType == Response {
+    // MARK: 泛型返回对象
     func map<T: BaseMappable>(_ type: T.Type) -> Single<T?> {
         return flatMap { response -> Single<T?> in
             do {
@@ -438,6 +527,7 @@ extension PrimitiveSequence where TraitType == SingleTrait, ElementType == Respo
         }
     }
     
+    // MARK: 泛型返回对象数组
     func mapArray<T: BaseMappable>(_ type: T.Type) -> Single<[T]?> {
         return flatMap { response -> Single<[T]?> in
             do {