Parcourir la source

首页基本完成

南鑫林 il y a 6 ans
Parent
commit
6ff1b2c90d
28 fichiers modifiés avec 1046 ajouts et 433 suppressions
  1. 59 31
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  2. 2 2
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallBanner/ShoppingMallBannerFSPagerViewCell.swift
  3. 7 4
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallBanner/ShoppingMallBannerTableViewCell.swift
  4. 7 1
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallCategory/ShoppingMallCategoryCollectionViewCell.swift
  5. 10 3
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallCategory/ShoppingMallCategoryTableViewCell.swift
  6. 225 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/Floor/ShoppingMallFloorTableViewCell.swift
  7. 0 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/FloorCell/ShoppingMallBarChart/ShoppingMallBarChartCollectionViewCell.swift
  8. 1 1
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/ShoppingMallRightSideleftPicture/ShoppingMallRightSideleftPictureCollectionViewCell.swift
  9. 21 52
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/ShoppingMallSlidingLeftRight/ShoppingMallSlidingLeftRightTableViewCell.swift
  10. 1 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/ShoppingMallSlidingLeftRight/ShoppingMallSlidingLeftRightCollectionViewCell.swift
  11. 2 2
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/TitleBanner/FloorBannerView.swift
  12. 80 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/ProductCollectionReusableView/ProductFloorCenterHeaderCollectionReusableView.swift
  13. 1 1
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/TitleBanner/FloorTitleCenterBaseView.swift
  14. 79 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/ProductCollectionReusableView/ProductFloorFullLeftHeaderCollectionReusableView.swift
  15. 86 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/ProductCollectionReusableView/ProductFloorLeftHeaderCollectionReusableView.swift
  16. 3 3
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/TitleBanner/FloorTitleView.swift
  17. 0 139
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/ShoppingMallBarChart/ShoppingMallBarChartTableViewCell.swift
  18. 0 139
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/ShoppingMallRightSideleftPicture/ShoppingMallRightSideleftPictureTableViewCell.swift
  19. 29 29
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallListView.swift
  20. 6 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallSepcial/ShoppingMallSepcialCollectionViewCell.swift
  21. 11 2
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallSepcial/ShoppingMallSepcialTableViewCell.swift
  22. 31 6
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallView.swift
  23. 29 1
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/ViewController/ShoppingMallListViewController.swift
  24. 18 13
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/ViewController/ShoppingMallViewController.swift
  25. 306 0
      RainbowPlanet/RainbowPlanet/Service/Model/ProductModel/ProductModel.swift
  26. 14 0
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceProduct/SwiftMoyaNetWorkServiceProduct.swift
  27. 16 4
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceProduct/SwiftMoyaServiceProductApi.swift
  28. 2 0
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceManger/SwiftMoyaNetWorkManager/SwiftMoyaNetWorkManager.swift

+ 59 - 31
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -8,6 +8,8 @@
 
 /* Begin PBXBuildFile section */
 		0A110C4CD931995B8E8BF7C5 /* Pods_RainbowPlanet.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D469F6C3768252BCB7001EDD /* Pods_RainbowPlanet.framework */; };
+		A70B2C042283D06B00B2449F /* ProductFloorFullLeftHeaderCollectionReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70B2C032283D06B00B2449F /* ProductFloorFullLeftHeaderCollectionReusableView.swift */; };
+		A70B2C072284305400B2449F /* ProductModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70B2C062284305400B2449F /* ProductModel.swift */; };
 		A70EBBC022561179000AD74F /* Extension+UITableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70EBBBF22561179000AD74F /* Extension+UITableView.swift */; };
 		A7190167227543DB00104A50 /* baidu_cityid_rel.json in Resources */ = {isa = PBXBuildFile; fileRef = A7190166227543DB00104A50 /* baidu_cityid_rel.json */; };
 		A71901692275464000104A50 /* ProvinceCityAreaView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A71901682275464000104A50 /* ProvinceCityAreaView.swift */; };
@@ -184,18 +186,19 @@
 		A7A98E4322804851005306E9 /* ShoppingMallSepcialFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7A98E4222804851005306E9 /* ShoppingMallSepcialFlowLayout.swift */; };
 		A7A98E4522804C63005306E9 /* ShoppingMallSepcialCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7A98E4422804C63005306E9 /* ShoppingMallSepcialCollectionViewCell.swift */; };
 		A7B4E71A22811F770012914A /* ShoppingCarModoule.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A7B4E71922811F770012914A /* ShoppingCarModoule.xcassets */; };
-		A7B4E71D22812DD70012914A /* ShoppingMallSlidingLeftRightTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E71C22812DD70012914A /* ShoppingMallSlidingLeftRightTableViewCell.swift */; };
 		A7B4E71F228131720012914A /* ShoppingMallSlidingLeftRightCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E71E228131720012914A /* ShoppingMallSlidingLeftRightCollectionViewCell.swift */; };
-		A7B4E721228151F40012914A /* FloorTitleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E720228151F40012914A /* FloorTitleView.swift */; };
-		A7B4E723228154750012914A /* FloorBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E722228154750012914A /* FloorBannerView.swift */; };
-		A7B4E72622815DA30012914A /* ShoppingMallRightSideleftPictureTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E72522815DA30012914A /* ShoppingMallRightSideleftPictureTableViewCell.swift */; };
+		A7B4E721228151F40012914A /* ProductFloorTitleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E720228151F40012914A /* ProductFloorTitleView.swift */; };
+		A7B4E723228154750012914A /* ProductFloorBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E722228154750012914A /* ProductFloorBannerView.swift */; };
 		A7B4E728228160BA0012914A /* ShoppingMallRightSideleftPictureCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E727228160BA0012914A /* ShoppingMallRightSideleftPictureCollectionViewCell.swift */; };
-		A7B4E72B2281752B0012914A /* ShoppingMallBarChartTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E72A2281752B0012914A /* ShoppingMallBarChartTableViewCell.swift */; };
 		A7B4E72D228176060012914A /* ShoppingMallBarChartCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E72C228176060012914A /* ShoppingMallBarChartCollectionViewCell.swift */; };
-		A7B4E72F2281773F0012914A /* FloorTitleCenterBaseView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E72E2281773F0012914A /* FloorTitleCenterBaseView.swift */; };
+		A7B4E72F2281773F0012914A /* ProductFloorCenterTitleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E72E2281773F0012914A /* ProductFloorCenterTitleView.swift */; };
 		A7B4E7352281907A0012914A /* CMSModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E7342281907A0012914A /* CMSModel.swift */; };
 		A7B4E738228191CC0012914A /* CommondModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E737228191CC0012914A /* CommondModel.swift */; };
 		A7B4E73A228192D20012914A /* CMSTemplateModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E739228192D10012914A /* CMSTemplateModel.swift */; };
+		A7B4E754228278320012914A /* ShoppingMallFloorTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E753228278320012914A /* ShoppingMallFloorTableViewCell.swift */; };
+		A7B4E756228281620012914A /* ShoppingMallSlidingLeftRightBgCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E755228281620012914A /* ShoppingMallSlidingLeftRightBgCollectionViewCell.swift */; };
+		A7B4E7582282897B0012914A /* ProductFloorLeftHeaderCollectionReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E7572282897B0012914A /* ProductFloorLeftHeaderCollectionReusableView.swift */; };
+		A7B4E75A228289BB0012914A /* ProductFloorCenterHeaderCollectionReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E759228289BB0012914A /* ProductFloorCenterHeaderCollectionReusableView.swift */; };
 		A7BB684F2268DCEC00AB07A2 /* SelfRecommendationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7BB684D2268DCEC00AB07A2 /* SelfRecommendationViewController.swift */; };
 		A7BB68552268DE8600AB07A2 /* SelfRecommendationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7BB68542268DE8600AB07A2 /* SelfRecommendationView.swift */; };
 		A7BB6857226965C100AB07A2 /* SelfRecommendationHeaderCollectionReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7BB6856226965C100AB07A2 /* SelfRecommendationHeaderCollectionReusableView.swift */; };
@@ -266,6 +269,8 @@
 /* Begin PBXFileReference section */
 		57C497E128081597F165C771 /* Pods-RainbowPlanet.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RainbowPlanet.release.xcconfig"; path = "Pods/Target Support Files/Pods-RainbowPlanet/Pods-RainbowPlanet.release.xcconfig"; sourceTree = "<group>"; };
 		88DF1EFD2E202DA7C627E8A7 /* Pods_RainbowPlanetUITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RainbowPlanetUITests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+		A70B2C032283D06B00B2449F /* ProductFloorFullLeftHeaderCollectionReusableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductFloorFullLeftHeaderCollectionReusableView.swift; sourceTree = "<group>"; };
+		A70B2C062284305400B2449F /* ProductModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProductModel.swift; sourceTree = "<group>"; };
 		A70EBBBF22561179000AD74F /* Extension+UITableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Extension+UITableView.swift"; sourceTree = "<group>"; };
 		A7190166227543DB00104A50 /* baidu_cityid_rel.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = baidu_cityid_rel.json; sourceTree = "<group>"; };
 		A71901682275464000104A50 /* ProvinceCityAreaView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProvinceCityAreaView.swift; sourceTree = "<group>"; };
@@ -455,18 +460,19 @@
 		A7A98E4222804851005306E9 /* ShoppingMallSepcialFlowLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingMallSepcialFlowLayout.swift; sourceTree = "<group>"; };
 		A7A98E4422804C63005306E9 /* ShoppingMallSepcialCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingMallSepcialCollectionViewCell.swift; sourceTree = "<group>"; };
 		A7B4E71922811F770012914A /* ShoppingCarModoule.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = ShoppingCarModoule.xcassets; sourceTree = "<group>"; };
-		A7B4E71C22812DD70012914A /* ShoppingMallSlidingLeftRightTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingMallSlidingLeftRightTableViewCell.swift; sourceTree = "<group>"; };
 		A7B4E71E228131720012914A /* ShoppingMallSlidingLeftRightCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingMallSlidingLeftRightCollectionViewCell.swift; sourceTree = "<group>"; };
-		A7B4E720228151F40012914A /* FloorTitleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FloorTitleView.swift; sourceTree = "<group>"; };
-		A7B4E722228154750012914A /* FloorBannerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FloorBannerView.swift; sourceTree = "<group>"; };
-		A7B4E72522815DA30012914A /* ShoppingMallRightSideleftPictureTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingMallRightSideleftPictureTableViewCell.swift; sourceTree = "<group>"; };
+		A7B4E720228151F40012914A /* ProductFloorTitleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductFloorTitleView.swift; sourceTree = "<group>"; };
+		A7B4E722228154750012914A /* ProductFloorBannerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductFloorBannerView.swift; sourceTree = "<group>"; };
 		A7B4E727228160BA0012914A /* ShoppingMallRightSideleftPictureCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingMallRightSideleftPictureCollectionViewCell.swift; sourceTree = "<group>"; };
-		A7B4E72A2281752B0012914A /* ShoppingMallBarChartTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingMallBarChartTableViewCell.swift; sourceTree = "<group>"; };
 		A7B4E72C228176060012914A /* ShoppingMallBarChartCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingMallBarChartCollectionViewCell.swift; sourceTree = "<group>"; };
-		A7B4E72E2281773F0012914A /* FloorTitleCenterBaseView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FloorTitleCenterBaseView.swift; sourceTree = "<group>"; };
+		A7B4E72E2281773F0012914A /* ProductFloorCenterTitleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductFloorCenterTitleView.swift; sourceTree = "<group>"; };
 		A7B4E7342281907A0012914A /* CMSModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CMSModel.swift; sourceTree = "<group>"; };
 		A7B4E737228191CC0012914A /* CommondModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommondModel.swift; sourceTree = "<group>"; };
 		A7B4E739228192D10012914A /* CMSTemplateModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CMSTemplateModel.swift; sourceTree = "<group>"; };
+		A7B4E753228278320012914A /* ShoppingMallFloorTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingMallFloorTableViewCell.swift; sourceTree = "<group>"; };
+		A7B4E755228281620012914A /* ShoppingMallSlidingLeftRightBgCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingMallSlidingLeftRightBgCollectionViewCell.swift; sourceTree = "<group>"; };
+		A7B4E7572282897B0012914A /* ProductFloorLeftHeaderCollectionReusableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductFloorLeftHeaderCollectionReusableView.swift; sourceTree = "<group>"; };
+		A7B4E759228289BB0012914A /* ProductFloorCenterHeaderCollectionReusableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductFloorCenterHeaderCollectionReusableView.swift; sourceTree = "<group>"; };
 		A7BB684D2268DCEC00AB07A2 /* SelfRecommendationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelfRecommendationViewController.swift; sourceTree = "<group>"; };
 		A7BB68542268DE8600AB07A2 /* SelfRecommendationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelfRecommendationView.swift; sourceTree = "<group>"; };
 		A7BB6856226965C100AB07A2 /* SelfRecommendationHeaderCollectionReusableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelfRecommendationHeaderCollectionReusableView.swift; sourceTree = "<group>"; };
@@ -569,6 +575,16 @@
 			name = Pods;
 			sourceTree = "<group>";
 		};
+		A70B2C0522841F1B00B2449F /* FloorCell */ = {
+			isa = PBXGroup;
+			children = (
+				A7B4E729228174E70012914A /* ShoppingMallBarChart */,
+				A7B4E72422815AFB0012914A /* ShoppingMallRightSideleftPicture */,
+				A7B4E71B22812D390012914A /* ShoppingMallSlidingLeftRight */,
+			);
+			path = FloorCell;
+			sourceTree = "<group>";
+		};
 		A71901622275411C00104A50 /* ProvinceCityArea */ = {
 			isa = PBXGroup;
 			children = (
@@ -1590,8 +1606,8 @@
 				A72A728B22321DE000B21995 /* Extension */,
 				A72A727122321DDE00B21995 /* NumberKeyboard */,
 				A72A727722321DDF00B21995 /* Regex */,
-				A72A729F22321DE000B21995 /* WKWebView */,
 				A77F2CC422320627001BD3F6 /* WRNavigationBar */,
+				A72A729F22321DE000B21995 /* WKWebView */,
 			);
 			path = Tools;
 			sourceTree = "<group>";
@@ -1666,6 +1682,7 @@
 				A7A98E13227ED0E2005306E9 /* CategoryListModel.swift */,
 				A7A98E01227E8900005306E9 /* ProductSearchListModel.swift */,
 				A7A98E11227ECA11005306E9 /* ProductSearchModel.swift */,
+				A70B2C062284305400B2449F /* ProductModel.swift */,
 			);
 			path = ProductModel;
 			sourceTree = "<group>";
@@ -1772,7 +1789,7 @@
 		A7B4E71B22812D390012914A /* ShoppingMallSlidingLeftRight */ = {
 			isa = PBXGroup;
 			children = (
-				A7B4E71C22812DD70012914A /* ShoppingMallSlidingLeftRightTableViewCell.swift */,
+				A7B4E755228281620012914A /* ShoppingMallSlidingLeftRightBgCollectionViewCell.swift */,
 				A7B4E71E228131720012914A /* ShoppingMallSlidingLeftRightCollectionViewCell.swift */,
 			);
 			path = ShoppingMallSlidingLeftRight;
@@ -1781,7 +1798,6 @@
 		A7B4E72422815AFB0012914A /* ShoppingMallRightSideleftPicture */ = {
 			isa = PBXGroup;
 			children = (
-				A7B4E72522815DA30012914A /* ShoppingMallRightSideleftPictureTableViewCell.swift */,
 				A7B4E727228160BA0012914A /* ShoppingMallRightSideleftPictureCollectionViewCell.swift */,
 			);
 			path = ShoppingMallRightSideleftPicture;
@@ -1790,7 +1806,6 @@
 		A7B4E729228174E70012914A /* ShoppingMallBarChart */ = {
 			isa = PBXGroup;
 			children = (
-				A7B4E72A2281752B0012914A /* ShoppingMallBarChartTableViewCell.swift */,
 				A7B4E72C228176060012914A /* ShoppingMallBarChartCollectionViewCell.swift */,
 			);
 			path = ShoppingMallBarChart;
@@ -1799,23 +1814,25 @@
 		A7B4E730228177A90012914A /* ShoppingMallFloor */ = {
 			isa = PBXGroup;
 			children = (
+				A7B4E752228276270012914A /* Floor */,
+				A70B2C0522841F1B00B2449F /* FloorCell */,
+				A7B4E732228177BC0012914A /* ProductCollectionReusableView */,
 				A7A98E0C227EBEE3005306E9 /* ProductView */,
-				A7B4E732228177BC0012914A /* TitleBanner */,
-				A7B4E729228174E70012914A /* ShoppingMallBarChart */,
-				A7B4E72422815AFB0012914A /* ShoppingMallRightSideleftPicture */,
-				A7B4E71B22812D390012914A /* ShoppingMallSlidingLeftRight */,
 			);
 			path = ShoppingMallFloor;
 			sourceTree = "<group>";
 		};
-		A7B4E732228177BC0012914A /* TitleBanner */ = {
+		A7B4E732228177BC0012914A /* ProductCollectionReusableView */ = {
 			isa = PBXGroup;
 			children = (
-				A7B4E720228151F40012914A /* FloorTitleView.swift */,
-				A7B4E722228154750012914A /* FloorBannerView.swift */,
-				A7B4E72E2281773F0012914A /* FloorTitleCenterBaseView.swift */,
+				A7B4E720228151F40012914A /* ProductFloorTitleView.swift */,
+				A7B4E722228154750012914A /* ProductFloorBannerView.swift */,
+				A7B4E72E2281773F0012914A /* ProductFloorCenterTitleView.swift */,
+				A70B2C032283D06B00B2449F /* ProductFloorFullLeftHeaderCollectionReusableView.swift */,
+				A7B4E7572282897B0012914A /* ProductFloorLeftHeaderCollectionReusableView.swift */,
+				A7B4E759228289BB0012914A /* ProductFloorCenterHeaderCollectionReusableView.swift */,
 			);
-			path = TitleBanner;
+			path = ProductCollectionReusableView;
 			sourceTree = "<group>";
 		};
 		A7B4E733228190630012914A /* CMSModel */ = {
@@ -1835,6 +1852,14 @@
 			path = CommonModel;
 			sourceTree = "<group>";
 		};
+		A7B4E752228276270012914A /* Floor */ = {
+			isa = PBXGroup;
+			children = (
+				A7B4E753228278320012914A /* ShoppingMallFloorTableViewCell.swift */,
+			);
+			path = Floor;
+			sourceTree = "<group>";
+		};
 		A7BB68512268DCF800AB07A2 /* SelfRecommendation */ = {
 			isa = PBXGroup;
 			children = (
@@ -2414,7 +2439,6 @@
 				A7284A75225465DD000BAEC4 /* SwiftMoyaNetWorkServicePay.swift in Sources */,
 				A77F2CC722320627001BD3F6 /* WRNavigationBar.swift in Sources */,
 				A7D46092227619CD00A5A54E /* BaiduToCityFactory.swift in Sources */,
-				A7B4E71D22812DD70012914A /* ShoppingMallSlidingLeftRightTableViewCell.swift in Sources */,
 				A71AA51C227219EF008FF1A5 /* EditExpressAddressView.swift in Sources */,
 				A7CC751122715AE3003C4F38 /* MessageDetailesTimeView.swift in Sources */,
 				A7BB684F2268DCEC00AB07A2 /* SelfRecommendationViewController.swift in Sources */,
@@ -2450,13 +2474,13 @@
 				A77F2CCA223209F2001BD3F6 /* BaseTabbarViewController.swift in Sources */,
 				A7CC75332271ABB0003C4F38 /* AddressManagerViewController.swift in Sources */,
 				A7CC750D227157DA003C4F38 /* MessageDetailesView.swift in Sources */,
-				A7B4E72B2281752B0012914A /* ShoppingMallBarChartTableViewCell.swift in Sources */,
 				A71AA519227219D7008FF1A5 /* EditExpressAddressViewController.swift in Sources */,
 				A729B5B022671310004AE098 /* MobileLoginView.swift in Sources */,
 				A71AA50C2272126A008FF1A5 /* EditAddressFooterView.swift in Sources */,
 				A7CC7528227196C4003C4F38 /* AccountSecuritySetTableViewCell.swift in Sources */,
 				A72A726822321DBD00B21995 /* UMManager.swift in Sources */,
-				A7B4E721228151F40012914A /* FloorTitleView.swift in Sources */,
+				A70B2C042283D06B00B2449F /* ProductFloorFullLeftHeaderCollectionReusableView.swift in Sources */,
+				A7B4E721228151F40012914A /* ProductFloorTitleView.swift in Sources */,
 				A729B5AD2266FF45004AE098 /* BindPhoneNumberView.swift in Sources */,
 				A7CC74E62270628B003C4F38 /* DeliveryMethodTypeModel.swift in Sources */,
 				A71AA51F22729F35008FF1A5 /* AuthorizationSwift.swift in Sources */,
@@ -2473,7 +2497,7 @@
 				A71AF0BA226F00F8001730FE /* SearchResultView.swift in Sources */,
 				A77F2CB52232010F001BD3F6 /* ShoppingMallViewController.swift in Sources */,
 				A71AA513227215B5008FF1A5 /* ExpressAddressListView.swift in Sources */,
-				A7B4E723228154750012914A /* FloorBannerView.swift in Sources */,
+				A7B4E723228154750012914A /* ProductFloorBannerView.swift in Sources */,
 				A7DC467F22783A47001F3EFC /* EditExpressAddressTableViewCell.swift in Sources */,
 				A7A98E4522804C63005306E9 /* ShoppingMallSepcialCollectionViewCell.swift in Sources */,
 				A7824B082271F53A00ABA381 /* EditSetDefaultTableViewCell.swift in Sources */,
@@ -2485,6 +2509,7 @@
 				A72A73142232475E00B21995 /* AlipayManager.swift in Sources */,
 				A7824B042271F10300ABA381 /* EditSelfMentionContactsView.swift in Sources */,
 				A7A98E332280272A005306E9 /* ShoppingMallBannerTableViewCell.swift in Sources */,
+				A7B4E754228278320012914A /* ShoppingMallFloorTableViewCell.swift in Sources */,
 				A71AF0B6226EF99A001730FE /* SearchResultViewController.swift in Sources */,
 				A757C9302274839900226355 /* SelfMentionAddressListModel.swift in Sources */,
 				A72A72D522321E2700B21995 /* ColorMacro.swift in Sources */,
@@ -2521,7 +2546,6 @@
 				A75414FD224B5F28002480B5 /* MobileLoginViewController.swift in Sources */,
 				A771F07C226D4E1C007999DB /* AddressPOITableViewCell.swift in Sources */,
 				A72A72AE22321DE000B21995 /* CountdownButton.swift in Sources */,
-				A7B4E72622815DA30012914A /* ShoppingMallRightSideleftPictureTableViewCell.swift in Sources */,
 				A7A98E28227FD6C6005306E9 /* ShoppingMallListViewController.swift in Sources */,
 				A7B4E71F228131720012914A /* ShoppingMallSlidingLeftRightCollectionViewCell.swift in Sources */,
 				A77F2CB72232010F001BD3F6 /* MineViewController.swift in Sources */,
@@ -2532,6 +2556,7 @@
 				A7CC752F2271A1F2003C4F38 /* SetPasswordView.swift in Sources */,
 				A7A98E09227EB8DD005306E9 /* CategoryView.swift in Sources */,
 				A7CC75362271AC14003C4F38 /* AddressManagerView.swift in Sources */,
+				A7B4E75A228289BB0012914A /* ProductFloorCenterHeaderCollectionReusableView.swift in Sources */,
 				A71901752275F71F00104A50 /* BaiduToCityModel.swift in Sources */,
 				A7BB685922696B9200AB07A2 /* SelfRecommendationCollectionViewCell.swift in Sources */,
 				A7636AC822682BAF00374F9E /* LocationView.swift in Sources */,
@@ -2541,6 +2566,7 @@
 				A7A98E05227EB891005306E9 /* CategoryViewController.swift in Sources */,
 				A77F2CC822320627001BD3F6 /* WRCustomNavigationBar.swift in Sources */,
 				A7CC74EF22706CCA003C4F38 /* MessageView.swift in Sources */,
+				A70B2C072284305400B2449F /* ProductModel.swift in Sources */,
 				A7CC74E0227042A4003C4F38 /* MineServiceTableViewCell.swift in Sources */,
 				A72A72BC22321DE000B21995 /* Extension+UIAlertController.swift in Sources */,
 				A7BB68662269B1DD00AB07A2 /* AddressPOIView.swift in Sources */,
@@ -2566,7 +2592,7 @@
 				A7A98E3C228036D7005306E9 /* ShoppingMallCategoryCollectionViewCell.swift in Sources */,
 				A71AF0AA226EDDF5001730FE /* SearchView.swift in Sources */,
 				A7A98E0E227EC0C6005306E9 /* CategoryTableViewCell.swift in Sources */,
-				A7B4E72F2281773F0012914A /* FloorTitleCenterBaseView.swift in Sources */,
+				A7B4E72F2281773F0012914A /* ProductFloorCenterTitleView.swift in Sources */,
 				A7284A542252FB5C000BAEC4 /* PaginationModel.swift in Sources */,
 				A72A72D022321E2700B21995 /* FontMacro.swift in Sources */,
 				A71AA52622732068008FF1A5 /* SwiftMoyaServiceConfigApi.swift in Sources */,
@@ -2581,6 +2607,7 @@
 				A71AF0B8226EF9EC001730FE /* SearchResultNavigationbarView.swift in Sources */,
 				A79057022276C9770037F823 /* SetPasswordModel.swift in Sources */,
 				A729B5B42267254B004AE098 /* PasswordLoginViewController.swift in Sources */,
+				A7B4E7582282897B0012914A /* ProductFloorLeftHeaderCollectionReusableView.swift in Sources */,
 				A7D4608E227616F800A5A54E /* SQLiteManager.swift in Sources */,
 				A77F2C612231FB49001BD3F6 /* AppDelegate.swift in Sources */,
 				A729B5A82266F2E0004AE098 /* AlertSheetView.swift in Sources */,
@@ -2597,6 +2624,7 @@
 				A7CC751F227190C5003C4F38 /* AccountSecurityViewController.swift in Sources */,
 				A7284440224DFACD00F82F30 /* InfoModel.swift in Sources */,
 				A72A72B522321DE000B21995 /* Extension+UITextView.swift in Sources */,
+				A7B4E756228281620012914A /* ShoppingMallSlidingLeftRightBgCollectionViewCell.swift in Sources */,
 				A757C92E22744ACE00226355 /* AddressManagerListModel.swift in Sources */,
 				A7541502224C5ECB002480B5 /* BaiduMapManager.swift in Sources */,
 				A757C9342274882E00226355 /* UIScrollView+MJRefreshEX.m in Sources */,

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallBanner/ShoppingMallBannerFSPagerViewCell.swift

@@ -52,9 +52,9 @@ class ShoppingMallBannerFSPagerViewCell: FSPagerViewCell {
         return bgImageView
     }()
     
-    var imageNames: Array<String>?{
+    var cmsRuleModel : CMSRuleModel? {
         didSet {
-            bgImageView.image = kImage(name: imageNames![index!])
+            bgImageView.kf.setImage(with: kURLImage(name: cmsRuleModel?.rule?.url ?? "pic_preload"), placeholder: kImage(name: "pic_preload"))
         }
     }
 }

+ 7 - 4
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallBanner/ShoppingMallBannerTableViewCell.swift

@@ -19,12 +19,15 @@ class ShoppingMallBannerTableViewCell: UITableViewCell {
             var frame = newValue
             frame.origin.x += 14 * kScaleWidth
             frame.size.width -= 14 * kScaleWidth * 2
-//            frame.origin.y += 10
             super.frame = frame
         }
     }
     
-     var imageNames = ["pic_preload","pic_preload","pic_preload"]
+    var cmsRuleModels : Array<CMSRuleModel>? {
+        didSet {
+            pagerView.reloadData()
+        }
+    }
     
     class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ShoppingMallBannerTableViewCell {
         let ID = "ShoppingMallBannerTableViewCell"
@@ -67,7 +70,7 @@ class ShoppingMallBannerTableViewCell: UITableViewCell {
         pagerView.delegate = self
         pagerView.dataSource = self
         pagerView.scrollDirection = .horizontal
-        pagerView.automaticSlidingInterval = 3.0
+        pagerView.automaticSlidingInterval = 0.0
         pagerView.isInfinite = true
         pagerView.cornerRadius = 4
         pagerView.masksToBounds = true
@@ -82,7 +85,7 @@ extension ShoppingMallBannerTableViewCell:FSPagerViewDataSource,FSPagerViewDeleg
     }
     func pagerView(_ pagerView: FSPagerView, cellForItemAt index: Int) -> FSPagerViewCell {
         let cell  = ShoppingMallBannerFSPagerViewCell.cellWith(collectionView: pagerView, index: index)
-        cell.imageNames = imageNames
+        cell.cmsRuleModel = (cmsRuleModels?[index])!
         return cell
     }
     

+ 7 - 1
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallCategory/ShoppingMallCategoryCollectionViewCell.swift

@@ -52,7 +52,6 @@ class ShoppingMallCategoryCollectionViewCell: UICollectionViewCell {
     
     lazy var iconImageView : UIImageView = {
         let iconImageView = UIImageView()
-        iconImageView.image = kImage(name: "pic_preload")
         return iconImageView
     }()
     
@@ -64,4 +63,11 @@ class ShoppingMallCategoryCollectionViewCell: UICollectionViewCell {
         titleLabel.textAlignment = .center
         return titleLabel
     }()
+    
+    var cmsRuleModel : CMSRuleModel? {
+        didSet {
+            iconImageView.kf.setImage(with: kURLImage(name: cmsRuleModel?.rule?.url ?? "pic_preload"), placeholder: kImage(name: "pic_preload"))
+            titleLabel.text = cmsRuleModel?.rule?.title ?? ""
+        }
+    }
 }

+ 10 - 3
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallCategory/ShoppingMallCategoryTableViewCell.swift

@@ -23,6 +23,12 @@ class ShoppingMallCategoryTableViewCell: UITableViewCell {
         }
     }
     
+    var cmsRuleModels : Array<CMSRuleModel>? {
+        didSet {
+            collectionView.reloadData()
+        }
+    }
+    
     class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ShoppingMallCategoryTableViewCell {
         let ID = "ShoppingMallCategoryTableViewCell"
         tableView.register(ShoppingMallCategoryTableViewCell.self, forCellReuseIdentifier: ID)
@@ -57,7 +63,7 @@ class ShoppingMallCategoryTableViewCell: UITableViewCell {
     private func setupLayouts() {
         collectionView.snp.remakeConstraints {(make) in
             make.top.left.right.equalToSuperview()
-            make.bottom.lessThanOrEqualTo(self)
+            make.height.equalTo(200)
         }
     }
     
@@ -99,15 +105,16 @@ class ShoppingMallCategoryTableViewCell: UITableViewCell {
 
 extension ShoppingMallCategoryTableViewCell: UICollectionViewDelegateFlowLayout,UICollectionViewDataSource {
     func numberOfSections(in collectionView: UICollectionView) -> Int {
-        return 1
+        return cmsRuleModels?.isEmpty ?? true ? 0 : 1
     }
     
     func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
-        return 10
+        return cmsRuleModels?.isEmpty ?? true ? 0 : cmsRuleModels?.count ?? 0
     }
     
     func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
         let cell = ShoppingMallCategoryCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
+         cell.cmsRuleModel = (cmsRuleModels?[indexPath.row])!
         return cell
         
     }

+ 225 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/Floor/ShoppingMallFloorTableViewCell.swift

@@ -0,0 +1,225 @@
+//
+//  ShoppingMallFloorTableViewCell.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/5/8.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import UIKit
+
+class ShoppingMallFloorTableViewCell: UITableViewCell {
+    
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ShoppingMallFloorTableViewCell {
+        let ID = "ShoppingMallFloorTableViewCell"
+        tableView.register(ShoppingMallFloorTableViewCell.self, forCellReuseIdentifier: ID)
+        let cell : ShoppingMallFloorTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! ShoppingMallFloorTableViewCell
+        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 {
+            
+        }
+    }
+    
+    var cmsRuleModels : Array<CMSRuleModel>? {
+        didSet {
+            collectionView.reloadData()
+        }
+    }
+    //MRAK: - 设置View
+    private func setupViews() {
+        self.selectionStyle = .none
+        addSubview(collectionView)
+    }
+    
+    private func setupLayouts() {
+        collectionView.snp.makeConstraints {(make) in
+           make.top.left.right.equalToSuperview()
+           make.height.equalTo(200)
+        }
+    }
+    
+    private lazy var collectionView: UICollectionView = {
+        let collectionView = UICollectionView.init(frame: CGRect.zero, collectionViewLayout: collectionViewLayout)
+        collectionView.backgroundColor = kf7f8faColor
+        collectionView.delegate = self;
+        collectionView.dataSource = self;
+        collectionView.showsVerticalScrollIndicator = false
+        collectionView.showsHorizontalScrollIndicator = false
+        collectionView.cornerRadius = 4
+        collectionView.masksToBounds = true
+        return collectionView
+    }()
+    
+    private lazy var collectionViewLayout: UICollectionViewFlowLayout = {
+        let collectionViewLayout = UICollectionViewFlowLayout.init()
+        return collectionViewLayout
+    }()
+    
+    //加载数据
+    func reloadData() {
+        
+        //collectionView重新加载数据
+        self.collectionView.reloadData()
+        //更新collectionView的高度约束
+        let contentSize = self.collectionView.collectionViewLayout.collectionViewContentSize
+        collectionView.snp.remakeConstraints { (make) in
+            make.top.left.right.equalToSuperview()
+            make.height.equalTo(contentSize.height)
+            make.bottom.equalToSuperview()
+        }
+        self.collectionView.collectionViewLayout.invalidateLayout()
+    }
+}
+
+extension ShoppingMallFloorTableViewCell: UICollectionViewDelegateFlowLayout,UICollectionViewDataSource {
+    func numberOfSections(in collectionView: UICollectionView) -> Int {
+        return cmsRuleModels?.isEmpty ?? true ? 0 : cmsRuleModels?.count ?? 0
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+        let cmsRuleModel = cmsRuleModels?[section]
+        switch cmsRuleModel?.showType {
+        case 0: // 0:左图右字;
+            return cmsRuleModel?.rule?.showNum ?? 0
+        case 1: // 1:通栏大图
+            return cmsRuleModel?.rule?.showNum ?? 0
+        case 2: //  2:左右滑动
+            return 1
+        default:
+            return 0
+        }
+        
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+        let cmsRuleModel = cmsRuleModels?[(indexPath.section)]
+        
+        switch cmsRuleModel?.showType {
+        case 0: // 0:左图右字;
+            let cell = ShoppingMallRightSideleftPictureCollectionViewCell.cellWith(
+                collectionView: collectionView, indexPath: indexPath)
+            if indexPath.row == 9 {
+                let shapeLayer = CAShapeLayer()
+                cell.layer.mask = nil
+                let bezierPath = UIBezierPath(roundedRect: cell.bounds,
+                                              byRoundingCorners: [.bottomLeft,.bottomRight],
+                                              cornerRadii: CGSize(width: 4,height: 4))
+                shapeLayer.path = bezierPath.cgPath
+                cell.layer.mask = shapeLayer
+            }
+            return cell
+        case 1: // 1:通栏大图
+            let cell = ShoppingMallBarChartCollectionViewCell.cellWith(
+                collectionView: collectionView, indexPath: indexPath)
+            return cell
+        case 2: //  2:左右滑动
+            let cell = ShoppingMallSlidingLeftRightBgCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
+            return cell
+        default:
+            return UICollectionViewCell()
+        }
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
+        
+        let cmsRuleModel = cmsRuleModels?[(indexPath.section)]
+        if cmsRuleModel?.showType == 0 {// 0:左图右字;
+            return CGSize(width:347 * kScaleWidth, height: 140)
+        }
+        if cmsRuleModel?.showType == 1 { // 1:通栏大图
+             return CGSize(width:347 * kScaleWidth, height: 150 * kScaleWidth + 109)
+        }
+        if cmsRuleModel?.showType == 2 { // 2:左右滑动
+            return CGSize(width:kScreenWidth, height: 200)
+        }
+        
+        return CGSize(width:0, height: 0)
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
+        
+        let cmsRuleModel = cmsRuleModels?[((indexPath?.section)!)]
+        switch cmsRuleModel?.showType {
+        case 0: // 0:左图右字;
+            return UIEdgeInsets(top: 0, left: 0, bottom: 10, right: 0)
+        case 1: // 1:通栏大图
+            return UIEdgeInsets(top: 10, left: 0, bottom: 10, right: 0)
+        case 2: //  2:左右滑动
+            return UIEdgeInsets(top: 0, left: 14 * kScaleWidth, bottom: 10, right: 14 * kScaleWidth)
+        default:
+            return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
+        }
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
+        if kind == UICollectionView.elementKindSectionHeader {
+            
+            let cmsRuleModel = cmsRuleModels?[((indexPath.section))]
+            switch cmsRuleModel?.showType {
+            case 0: // 0:左图右字;
+                let headerView = ProductFloorLeftHeaderCollectionReusableView.headerWith(collectionView: collectionView, kind:  UICollectionView.elementKindSectionHeader, indexPath: indexPath)
+                return headerView
+            case 1: // 1:通栏大图
+                let headerView = ProductFloorCenterHeaderCollectionReusableView.headerWith(collectionView: collectionView, kind:  UICollectionView.elementKindSectionHeader, indexPath: indexPath)
+                return headerView
+            case 2: //  2:左右滑动
+                let headerView = ProductFloorFullLeftHeaderCollectionReusableView.headerWith(collectionView: collectionView, kind:  UICollectionView.elementKindSectionHeader, indexPath: indexPath)
+                return headerView
+            default:
+                return UICollectionReusableView()
+            }
+        }
+        return UICollectionReusableView()
+    }
+    
+    
+    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
+        
+        let cmsRuleModel = cmsRuleModels?[section]
+        switch cmsRuleModel?.showType {
+        case 0: // 0:左图右字;
+           return CGSize(width:347 * kScaleWidth, height: 50 + kScaleWidth * 90)
+        case 1: // 1:通栏大图
+            return CGSize(width:347 * kScaleWidth, height: 73 + (kScaleWidth * 90))
+        case 2: //  2:左右滑动
+            return CGSize(width:kScreenWidth, height: 50 + kScaleWidth * 90)
+        default:
+            return CGSize(width:0, height: 0)
+        }
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
+        
+        let cmsRuleModel = cmsRuleModels?[section]
+        switch cmsRuleModel?.showType {
+        case 0: // 0:左图右字;
+             return 0
+        case 1: // 1:通栏大图
+             return 10
+        case 2: //  2:左右滑动
+            return 0
+        default:
+            return 0
+        }
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
+        return 7
+    }
+    
+}
+

RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/ShoppingMallBarChart/ShoppingMallBarChartCollectionViewCell.swift → RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/FloorCell/ShoppingMallBarChart/ShoppingMallBarChartCollectionViewCell.swift


+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/ShoppingMallRightSideleftPicture/ShoppingMallRightSideleftPictureCollectionViewCell.swift

@@ -19,12 +19,12 @@ class ShoppingMallRightSideleftPictureCollectionViewCell: UICollectionViewCell {
     //MARK: - indexPath
     var indexPath: IndexPath?{
         didSet {
-            
         }
     }
     //MARK: - 初始化
     override init(frame: CGRect) {
         super.init(frame: frame)
+        backgroundColor = UIColor.white
         setupViews()
         setupLayouts()
     }

+ 21 - 52
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/ShoppingMallSlidingLeftRight/ShoppingMallSlidingLeftRightTableViewCell.swift

@@ -1,83 +1,52 @@
 //
-//  ShoppingMallSlidingLeftRightOneTableViewCell.swift
+//  ShoppingMallRightSideleftPictureBgCollectionViewCell.swift
 //  RainbowPlanet
 //
-//  Created by 南鑫林 on 2019/5/7.
+//  Created by 南鑫林 on 2019/5/8.
 //  Copyright © 2019 南鑫林. All rights reserved.
 //
 
 import UIKit
 
-class ShoppingMallSlidingLeftRightTableViewCell: UITableViewCell {
-    override var frame: CGRect {
-        get {
-            return super.frame
-        }
-        set {
-            let frame = newValue
-//            frame.origin.y += 10
-            super.frame = frame
-        }
-    }
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ShoppingMallSlidingLeftRightTableViewCell {
-        let ID = "ShoppingMallSlidingLeftRightTableViewCell"
-        tableView.register(ShoppingMallSlidingLeftRightTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : ShoppingMallSlidingLeftRightTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! ShoppingMallSlidingLeftRightTableViewCell
+class ShoppingMallSlidingLeftRightBgCollectionViewCell: UICollectionViewCell {
+    class func cellWith(collectionView:UICollectionView,indexPath:IndexPath) -> ShoppingMallSlidingLeftRightBgCollectionViewCell {
+        let ID = "ShoppingMallSlidingLeftRightBgCollectionViewCell"
+        collectionView.register(ShoppingMallSlidingLeftRightBgCollectionViewCell.self, forCellWithReuseIdentifier: ID)
+        let cell : ShoppingMallSlidingLeftRightBgCollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: ID, for: indexPath) as! ShoppingMallSlidingLeftRightBgCollectionViewCell
         cell.indexPath = indexPath
         return cell
     }
+    //MARK: - indexPath
+    var indexPath: IndexPath?{
+        didSet {
+            
+        }
+    }
     
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
+    //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")
     }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
     //MRAK: - 设置View
     private func setupViews() {
-        self.selectionStyle = .none
         backgroundColor = kf7f8faColor
-        addSubview(floorTitleView)
-        addSubview(floorBannerView)
         addSubview(collectionView)
     }
     
     private func setupLayouts() {
-        floorTitleView.snp.remakeConstraints { (make) in
-            make.top.left.right.equalToSuperview()
-            make.height.equalTo(50)
-        }
-        floorBannerView.snp.remakeConstraints { (make) in
-            make.top.equalTo(50)
-            make.left.right.equalToSuperview()
-            make.height.equalTo(90 * kScaleWidth)
-        }
         collectionView.snp.remakeConstraints {(make) in
-            make.top.equalTo(50 + 90 * kScaleWidth)
-            make.left.right.equalToSuperview()
-            make.height.equalTo(200)
+            make.edges.equalToSuperview()
         }
     }
     
-    private lazy var floorTitleView: FloorTitleView = {
-        let floorTitleView = FloorTitleView()
-        return floorTitleView
-    }()
-    
-    lazy var floorBannerView: FloorBannerView = {
-        let floorBannerView = FloorBannerView()
-        return floorBannerView
-    }()
-    
     private lazy var collectionView: UICollectionView = {
         let collectionView = UICollectionView.init(frame: CGRect.zero, collectionViewLayout: collectionViewLayout)
         collectionView.backgroundColor = UIColor.white
@@ -92,7 +61,7 @@ class ShoppingMallSlidingLeftRightTableViewCell: UITableViewCell {
     
     private lazy var collectionViewLayout: UICollectionViewFlowLayout = {
         let collectionViewLayout = UICollectionViewFlowLayout.init()
-        collectionViewLayout.minimumLineSpacing = 7
+        collectionViewLayout.minimumLineSpacing = 0
         collectionViewLayout.minimumInteritemSpacing = 0
         collectionViewLayout.scrollDirection = .horizontal
         return collectionViewLayout
@@ -100,7 +69,7 @@ class ShoppingMallSlidingLeftRightTableViewCell: UITableViewCell {
     
 }
 
-extension ShoppingMallSlidingLeftRightTableViewCell: UICollectionViewDelegateFlowLayout,UICollectionViewDataSource {
+extension ShoppingMallSlidingLeftRightBgCollectionViewCell: UICollectionViewDelegateFlowLayout,UICollectionViewDataSource {
     func numberOfSections(in collectionView: UICollectionView) -> Int {
         return 1
     }

+ 1 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/ShoppingMallSlidingLeftRight/ShoppingMallSlidingLeftRightCollectionViewCell.swift

@@ -25,6 +25,7 @@ class ShoppingMallSlidingLeftRightCollectionViewCell: UICollectionViewCell {
     //MARK: - 初始化
     override init(frame: CGRect) {
         super.init(frame: frame)
+        backgroundColor = UIColor.white
         setupViews()
         setupLayouts()
     }

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/TitleBanner/FloorBannerView.swift

@@ -1,5 +1,5 @@
 //
-//  FloorBannerView.swift
+//  ProductFloorBannerView.swift
 //  RainbowPlanet
 //
 //  Created by 南鑫林 on 2019/5/7.
@@ -8,7 +8,7 @@
 
 import UIKit
 
-class FloorBannerView: BaseView {
+class ProductFloorBannerView: BaseView {
     
     override func setupViews() {
         backgroundColor = kffffffColor

+ 80 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/ProductCollectionReusableView/ProductFloorCenterHeaderCollectionReusableView.swift

@@ -0,0 +1,80 @@
+//
+//  ProductFloorCenterHeaderCollectionReusableView.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/5/8.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import UIKit
+
+class ProductFloorCenterHeaderCollectionReusableView: UICollectionReusableView {
+    class func headerWith(collectionView:UICollectionView,kind: String,indexPath: IndexPath) -> UICollectionReusableView {
+        let ID = "ProductFloorCenterHeaderCollectionReusableView"
+        collectionView.register(ProductFloorCenterHeaderCollectionReusableView.self, forSupplementaryViewOfKind: kind, withReuseIdentifier: ID)
+        let headerView : ProductFloorCenterHeaderCollectionReusableView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: ID, for: indexPath) as! ProductFloorCenterHeaderCollectionReusableView
+        headerView.indexPath = indexPath
+        return headerView
+    }
+    
+    var indexPath : IndexPath? {
+        didSet {
+            
+        }
+    }
+    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() {
+        backgroundColor = UIColor.clear
+        addSubview(bgView)
+        bgView.addSubview(floorTitleView)
+        bgView.addSubview(floorBannerView)
+        
+    }
+    
+    private func setupLayouts() {
+        bgView.snp.makeConstraints { (make) in
+            make.top.bottom.equalToSuperview()
+            make.right.equalTo(-14 * kScaleWidth)
+            make.left.equalTo(14 * kScaleWidth)
+        }
+        floorTitleView.snp.makeConstraints { (make) in
+            make.top.left.right.equalToSuperview()
+            make.height.equalTo(63)
+        }
+        floorBannerView.snp.makeConstraints { (make) in
+            make.top.equalTo(63)
+            make.left.right.equalToSuperview()
+            make.height.equalTo(90 * kScaleWidth)
+        }
+    }
+    
+    lazy var floorTitleView: ProductFloorCenterTitleView = {
+        let floorTitleView = ProductFloorCenterTitleView()
+        return floorTitleView
+    }()
+    
+    lazy var floorBannerView: ProductFloorBannerView = {
+        let floorBannerView = ProductFloorBannerView()
+        floorBannerView.cornerRadius = 4
+        floorBannerView.masksToBounds = true
+        return floorBannerView
+    }()
+    
+    private lazy var bgView: UIView = {
+        let bgView = UIView()
+        bgView.backgroundColor = UIColor.clear
+        return bgView
+    }()
+    
+    
+}

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/TitleBanner/FloorTitleCenterBaseView.swift

@@ -8,7 +8,7 @@
 
 import UIKit
 
-class FloorTitleCenterBaseView: BaseView {
+class ProductFloorCenterTitleView: BaseView {
     
     override func setupViews() {
         addSubview(titleLabel)

+ 79 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/ProductCollectionReusableView/ProductFloorFullLeftHeaderCollectionReusableView.swift

@@ -0,0 +1,79 @@
+//
+//  ProductFloorFullLeftHeaderCollectionReusableView.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/5/9.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import UIKit
+
+class ProductFloorFullLeftHeaderCollectionReusableView: UICollectionReusableView {
+    class func headerWith(collectionView:UICollectionView,kind: String,indexPath: IndexPath) -> UICollectionReusableView {
+        let ID = "ProductFloorFullLeftHeaderCollectionReusableView"
+        collectionView.register(ProductFloorFullLeftHeaderCollectionReusableView.self, forSupplementaryViewOfKind: kind, withReuseIdentifier: ID)
+        let headerView : ProductFloorFullLeftHeaderCollectionReusableView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: ID, for: indexPath) as! ProductFloorFullLeftHeaderCollectionReusableView
+        headerView.indexPath = indexPath
+        return headerView
+    }
+    
+    var indexPath : IndexPath? {
+        didSet {
+            
+        }
+    }
+    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() {
+        backgroundColor = UIColor.clear
+        addSubview(bgView)
+        bgView.addSubview(floorTitleView)
+        bgView.addSubview(floorBannerView)
+    }
+    
+    private func setupLayouts() {
+        bgView.snp.makeConstraints { (make) in
+            make.top.bottom.equalToSuperview()
+            make.right.equalTo(0)
+            make.left.equalTo(0)
+        }
+
+        floorTitleView.snp.makeConstraints { (make) in
+            make.top.equalToSuperview()
+            make.height.equalTo(50)
+            make.left.equalTo(14 * kScaleWidth)
+            make.right.equalTo(-14 * kScaleWidth)
+        }
+        floorBannerView.snp.makeConstraints { (make) in
+            make.top.equalTo(50)
+            make.left.equalTo(14 * kScaleWidth)
+            make.right.equalTo(-14 * kScaleWidth)
+            make.height.equalTo(90 * kScaleWidth)
+        }
+    }
+    
+    private lazy var floorTitleView: ProductFloorTitleView = {
+        let floorTitleView = ProductFloorTitleView()
+        return floorTitleView
+    }()
+    
+    private lazy var floorBannerView: ProductFloorBannerView = {
+        let floorBannerView = ProductFloorBannerView()
+        return floorBannerView
+    }()
+    
+    private lazy var bgView: UIView = {
+        let bgView = UIView()
+        bgView.backgroundColor = UIColor.white
+        return bgView
+    }()
+}

+ 86 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/ProductCollectionReusableView/ProductFloorLeftHeaderCollectionReusableView.swift

@@ -0,0 +1,86 @@
+//
+//  ProductFloorLeftHeaderCollectionReusableView.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/5/8.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import UIKit
+
+class ProductFloorLeftHeaderCollectionReusableView: UICollectionReusableView {
+    class func headerWith(collectionView:UICollectionView,kind: String,indexPath: IndexPath) -> ProductFloorLeftHeaderCollectionReusableView {
+        let ID = "ProductFloorLeftHeaderCollectionReusableView"
+        collectionView.register(ProductFloorLeftHeaderCollectionReusableView.self, forSupplementaryViewOfKind: kind, withReuseIdentifier: ID)
+        let headerView : ProductFloorLeftHeaderCollectionReusableView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: ID, for: indexPath) as! ProductFloorLeftHeaderCollectionReusableView
+        headerView.indexPath = indexPath
+        return headerView
+    }
+    
+    var indexPath : IndexPath? {
+        didSet {
+            
+        }
+    }
+    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() {
+        backgroundColor = UIColor.clear
+        addSubview(bgView)
+        bgView.addSubview(floorTitleView)
+        bgView.addSubview(floorBannerView)
+    }
+    
+    private func setupLayouts() {
+        bgView.snp.makeConstraints { (make) in
+            make.top.bottom.equalToSuperview()
+            make.left.equalTo(14 * kScaleWidth)
+            make.right.equalTo(-14 * kScaleWidth)
+        }
+        floorTitleView.snp.makeConstraints { (make) in
+            make.top.equalToSuperview()
+            make.height.equalTo(50)
+            make.right.equalTo(0)
+            make.left.equalTo(0)
+        }
+        floorBannerView.snp.makeConstraints { (make) in
+            make.top.equalTo(50)
+            make.right.equalTo(0)
+            make.left.equalTo(0)
+            make.height.equalTo(90 * kScaleWidth)
+        }
+    }
+    
+    private lazy var floorTitleView: ProductFloorTitleView = {
+        let floorTitleView = ProductFloorTitleView()
+        return floorTitleView
+    }()
+    
+    private lazy var floorBannerView: ProductFloorBannerView = {
+        let floorBannerView = ProductFloorBannerView()
+        return floorBannerView
+    }()
+    
+    lazy var bgView: UIView = {
+        let bgView = UIView()
+        bgView.backgroundColor = UIColor.white
+        let shapeLayer = CAShapeLayer()
+        bgView.layer.mask = nil
+        let rect = CGRect(x: 0, y: 0, width: kScaleWidth * 347, height: 50 + kScaleWidth * 90)
+        let bezierPath = UIBezierPath(roundedRect: rect,
+                                      byRoundingCorners: [.topLeft,.topRight],
+                                      cornerRadii: CGSize(width: 4,height: 4))
+        shapeLayer.path = bezierPath.cgPath
+        bgView.layer.mask = shapeLayer
+        return bgView
+    }()
+}

+ 3 - 3
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/TitleBanner/FloorTitleView.swift

@@ -1,5 +1,5 @@
 //
-//  FloorTitleView.swift
+//  ProductFloorTitleView.swift
 //  RainbowPlanet
 //
 //  Created by 南鑫林 on 2019/5/7.
@@ -8,7 +8,7 @@
 
 import UIKit
 
-class FloorTitleView: BaseView {
+class ProductFloorTitleView: BaseView {
     
     override func setupViews() {
         self.backgroundColor = kffffffColor
@@ -28,6 +28,7 @@ class FloorTitleView: BaseView {
             make.height.equalTo(25)
             make.left.equalTo(lineLabel.snp.right).offset(10)
         }
+        
     }
     
     private lazy var lineLabel: UILabel = {
@@ -44,5 +45,4 @@ class FloorTitleView: BaseView {
         return titleLabel
     }()
     
-
 }

+ 0 - 139
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/ShoppingMallBarChart/ShoppingMallBarChartTableViewCell.swift

@@ -1,139 +0,0 @@
-//
-//  ShoppingMallBarChartTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/7.
-//  Copyright © 2019 南鑫林. All rights reserved.
-//
-
-import UIKit
-
-class ShoppingMallBarChartTableViewCell: UITableViewCell {
-
-    override var frame: CGRect {
-        get {
-            return super.frame
-        }
-        set {
-            var frame = newValue
-            frame.origin.x += 14 * kScaleWidth
-            frame.size.width -= 14 * kScaleWidth * 2
-            super.frame = frame
-        }
-    }
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ShoppingMallBarChartTableViewCell {
-        let ID = "ShoppingMallBarChartTableViewCell"
-        tableView.register(ShoppingMallBarChartTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : ShoppingMallBarChartTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! ShoppingMallBarChartTableViewCell
-        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
-        cornerRadius = 4
-        masksToBounds = true
-        backgroundColor = kf7f8faColor
-        addSubview(floorTitleView)
-        addSubview(floorBannerView)
-        addSubview(collectionView)
-    }
-    
-    private func setupLayouts() {
-        floorTitleView.snp.remakeConstraints { (make) in
-            make.top.left.right.equalToSuperview()
-            make.height.equalTo(63)
-        }
-        floorBannerView.snp.remakeConstraints { (make) in
-            make.top.equalTo(63)
-            make.left.right.equalToSuperview()
-            make.height.equalTo(90 * kScaleWidth)
-        }
-    }
-    
-    private lazy var floorTitleView: FloorTitleCenterBaseView = {
-        let floorTitleView = FloorTitleCenterBaseView()
-        return floorTitleView
-    }()
-    
-    private lazy var floorBannerView: FloorBannerView = {
-        let floorBannerView = FloorBannerView()
-        return floorBannerView
-    }()
-    
-    private lazy var collectionView: UICollectionView = {
-        let collectionView = UICollectionView.init(frame: CGRect.zero, collectionViewLayout: collectionViewLayout)
-        collectionView.backgroundColor = kf7f8faColor
-        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
-        return collectionViewLayout
-    }()
-    
-    //加载数据
-    func reloadData() {
-        
-        //collectionView重新加载数据
-        self.collectionView.reloadData()
-        //更新collectionView的高度约束
-        let contentSize = self.collectionView.collectionViewLayout.collectionViewContentSize
-        collectionView.snp.remakeConstraints { (make) in
-            make.top.equalTo(63 + 90 * kScaleWidth)
-            make.left.right.equalToSuperview()
-            make.height.equalTo(contentSize.height)
-            make.bottom.equalToSuperview()
-        }
-        self.collectionView.collectionViewLayout.invalidateLayout()
-    }
-    
-}
-
-extension ShoppingMallBarChartTableViewCell: UICollectionViewDelegateFlowLayout,UICollectionViewDataSource {
-    func numberOfSections(in collectionView: UICollectionView) -> Int {
-        return 1
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
-        return 10
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
-        let cell = ShoppingMallBarChartCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
-        return cell
-        
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
-        return CGSize(width:347 * kScaleWidth, height: 150 * kScaleWidth + 109)
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
-        return UIEdgeInsets(top: 10, left: 0, bottom: 10, right: 0)
-    }
-    
-}

+ 0 - 139
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/ShoppingMallRightSideleftPicture/ShoppingMallRightSideleftPictureTableViewCell.swift

@@ -1,139 +0,0 @@
-//
-//  ShoppingMallRightSideleftPictureTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/7.
-//  Copyright © 2019 南鑫林. All rights reserved.
-//
-
-import UIKit
-
-class ShoppingMallRightSideleftPictureTableViewCell: UITableViewCell {
-    override var frame: CGRect {
-        get {
-            return super.frame
-        }
-        set {
-            var frame = newValue
-            frame.origin.x += 14 * kScaleWidth
-            frame.size.width -= 14 * kScaleWidth * 2
-            super.frame = frame
-        }
-    }
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ShoppingMallRightSideleftPictureTableViewCell {
-        let ID = "ShoppingMallRightSideleftPictureTableViewCell"
-        tableView.register(ShoppingMallRightSideleftPictureTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : ShoppingMallRightSideleftPictureTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! ShoppingMallRightSideleftPictureTableViewCell
-        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
-        cornerRadius = 4
-        masksToBounds = true
-        backgroundColor = kf7f8faColor
-        addSubview(floorTitleView)
-        addSubview(floorBannerView)
-        addSubview(collectionView)
-    }
-    
-    private func setupLayouts() {
-        floorTitleView.snp.remakeConstraints { (make) in
-            make.top.left.right.equalToSuperview()
-            make.height.equalTo(50)
-        }
-        floorBannerView.snp.remakeConstraints { (make) in
-            make.top.equalTo(50)
-            make.left.right.equalToSuperview()
-            make.height.equalTo(90 * kScaleWidth)
-        }
-    }
-    
-    private lazy var floorTitleView: FloorTitleView = {
-        let floorTitleView = FloorTitleView()
-        return floorTitleView
-    }()
-    
-    private lazy var floorBannerView: FloorBannerView = {
-        let floorBannerView = FloorBannerView()
-        return floorBannerView
-    }()
-    
-    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
-        return collectionView
-    }()
-    
-    private lazy var collectionViewLayout: UICollectionViewFlowLayout = {
-        let collectionViewLayout = UICollectionViewFlowLayout.init()
-        collectionViewLayout.minimumLineSpacing = 0
-        collectionViewLayout.minimumInteritemSpacing = 0
-        return collectionViewLayout
-    }()
-    
-    //加载数据
-    func reloadData() {
-        
-        //collectionView重新加载数据
-        self.collectionView.reloadData()
-        //更新collectionView的高度约束
-        let contentSize = self.collectionView.collectionViewLayout.collectionViewContentSize
-        collectionView.snp.remakeConstraints { (make) in
-            make.top.equalTo(50 + 90 * kScaleWidth)
-            make.left.right.equalToSuperview()
-            make.height.equalTo(contentSize.height)
-            make.bottom.equalToSuperview()
-        }
-        self.collectionView.collectionViewLayout.invalidateLayout()
-    }
-
-}
-
-extension ShoppingMallRightSideleftPictureTableViewCell: UICollectionViewDelegateFlowLayout,UICollectionViewDataSource {
-    func numberOfSections(in collectionView: UICollectionView) -> Int {
-        return 1
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
-        return 10
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
-        let cell = ShoppingMallRightSideleftPictureCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
-        return cell
-        
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
-        return CGSize(width:347 * kScaleWidth, height: 140)
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
-        return UIEdgeInsets(top: 10, left: 0, bottom: 10, right: 0)
-    }
-    
-}
-

+ 29 - 29
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallListView.swift

@@ -10,6 +10,12 @@ import UIKit
 
 class ShoppingMallListView: BaseView {
     
+    var cmsSectionModels : Array<CMSContentModel>? {
+        didSet {
+            tableView.reloadData()
+        }
+    }
+    
     override func setupViews() {
         addSubview(tableView)
         let emptyView =  EmptyView.shared.diyCustomEmptyViewStyle2(iconStr: "page04", titleStr: "当前暂无数据")
@@ -40,7 +46,7 @@ class ShoppingMallListView: BaseView {
 
 extension ShoppingMallListView : UITableViewDelegate, UITableViewDataSource {
     func numberOfSections(in tableView: UITableView) -> Int {
-        return 6
+        return cmsSectionModels?.isEmpty ?? true ? 0 : (cmsSectionModels?.count)!
     }
     
     func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
@@ -48,55 +54,49 @@ extension ShoppingMallListView : UITableViewDelegate, UITableViewDataSource {
     }
     
     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-        switch indexPath.section {
-        case 0:
+        
+        let cmsSectionModel = cmsSectionModels?[indexPath.section]
+        
+        switch cmsSectionModel?.areaType {
+        case "banner":
             let cell = ShoppingMallBannerTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+            cell.cmsRuleModels = cmsSectionModel?.rule
             return cell
-        case 1:
+        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 2:
+        case "special":
             let cell = ShoppingMallSepcialTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+            cell.cmsRuleModels = cmsSectionModel?.rule
             return cell
-        case 3:
-            let cell = ShoppingMallSlidingLeftRightTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-            return cell
-        case 4:
-            let cell = ShoppingMallRightSideleftPictureTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+        case "floor":
+            let cell = ShoppingMallFloorTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+            cell.cmsRuleModels = cmsSectionModel?.rule
             cell.frame = tableView.bounds
             cell.layoutIfNeeded()
             cell.reloadData()
             return cell
-        case 5:
-            let cell = ShoppingMallBarChartTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-            cell.frame = tableView.bounds
-            cell.layoutIfNeeded()
-            cell.reloadData()
-            return cell
-            
         default:
             return UITableViewCell()
         }
-       
+
     }
     
     func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
-        switch indexPath.section {
-        case 0:
-            return (160 * kScaleWidth)
-        case 1:
+        let cmsSectionModel = cmsSectionModels?[indexPath.section]
+        
+        switch cmsSectionModel?.areaType {
+        case "banner":
+           return (160 * kScaleWidth)
+        case "category":
             return  UITableView.automaticDimension
-        case 2:
+        case "special":
             return  (193 * kScaleWidth)
-        case 3:
-            return  200 + 50 + 90 * kScaleWidth
-        case 4:
-            return  UITableView.automaticDimension
-        case 5:
+        case "floor":
             return  UITableView.automaticDimension
         default:
             return 0

+ 6 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallSepcial/ShoppingMallSepcialCollectionViewCell.swift

@@ -55,5 +55,11 @@ class ShoppingMallSepcialCollectionViewCell: UICollectionViewCell {
         return iconImageView
     }()
     
+    var cmsRuleModel : CMSRuleModel? {
+        didSet {
+            iconImageView.kf.setImage(with: kURLImage(name: cmsRuleModel?.rule?.url ?? "pic_preload"), placeholder: kImage(name: "pic_preload"))
+        }
+    }
+    
     
 }

+ 11 - 2
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallSepcial/ShoppingMallSepcialTableViewCell.swift

@@ -21,6 +21,12 @@ class ShoppingMallSepcialTableViewCell: UITableViewCell {
             super.frame = frame
         }
     }
+    
+    var cmsRuleModels : Array<CMSRuleModel>? {
+        didSet {
+            collectionView.reloadData()
+        }
+    }
 
     class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ShoppingMallSepcialTableViewCell {
         let ID = "ShoppingMallSepcialTableViewCell"
@@ -76,16 +82,19 @@ class ShoppingMallSepcialTableViewCell: UITableViewCell {
 }
 
 extension ShoppingMallSepcialTableViewCell: UICollectionViewDelegateFlowLayout,UICollectionViewDataSource {
+    
     func numberOfSections(in collectionView: UICollectionView) -> Int {
-        return 1
+        return cmsRuleModels?.isEmpty ?? true ? 0 : 1
     }
     
     func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
-        return 3
+        return cmsRuleModels?.isEmpty ?? true ? 0 : cmsRuleModels?.count ?? 0
     }
     
     func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
         let cell = ShoppingMallSepcialCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
+        cell.cmsRuleModel = (cmsRuleModels?[indexPath.row])!
+
         return cell
     }
     

+ 31 - 6
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallView.swift

@@ -11,12 +11,32 @@ import JXSegmentedView
 
 class ShoppingMallView: BaseView {
     
-    override func setupViews() {
+    var cmsTemplateTitles = Array<String>()
+    
+    var cmsTemplateModels : Array<CMSTemplateModel>? {
+        didSet {
+            guard cmsTemplateModels?.isEmpty ?? true else {
+                for cmsTemplateModel in cmsTemplateModels! {
+                    cmsTemplateTitles.append(cmsTemplateModel.title!)
+                }
+                setupView()
+                setupLayout()
+                return
+            }
+            return
+        }
+    }
+    
+    func setupView() {
+       addSubview(scrollView)
        addSubview(segmentedView)
        addSubview(listContainerView)
     }
 
-    override func setupLayouts() {
+    func setupLayout() {
+        scrollView.snp.makeConstraints { (make) in
+            make.edges.equalToSuperview()
+        }
         segmentedView.snp.makeConstraints { (make) in
             make.top.left.right.equalToSuperview()
             if segmentedDataSource.titles.count > 1 {
@@ -35,6 +55,12 @@ class ShoppingMallView: BaseView {
         }
     }
     
+    lazy var scrollView : UIScrollView = {
+        let scrollView = UIScrollView()
+        scrollView.contentSize = self.bounds.size
+        return scrollView
+    }()
+    
     //1.初始化JXSegmentedView
     lazy var segmentedView: JXSegmentedView = {
         let segmentedView = JXSegmentedView()
@@ -48,7 +74,7 @@ class ShoppingMallView: BaseView {
     //2.初始化dataSource
     lazy var segmentedDataSource: JXSegmentedTitleDataSource = {
         let segmentedDataSource = JXSegmentedTitleDataSource()
-        segmentedDataSource.titles = ["今日团购","菜市场"]
+        segmentedDataSource.titles = cmsTemplateTitles
         segmentedDataSource.isTitleColorGradientEnabled = true
         segmentedDataSource.isItemSpacingAverageEnabled = true
         segmentedDataSource.titleNormalColor = k333333Color
@@ -76,8 +102,6 @@ class ShoppingMallView: BaseView {
         return listContainerView
     }()
     
-    
-
 }
 
 extension ShoppingMallView : JXSegmentedViewDelegate {
@@ -120,7 +144,8 @@ extension ShoppingMallView :JXSegmentedListContainerViewDataSource {
     }
     func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate {
         let vc = ShoppingMallListViewController()
-        vc.shoppingMallListVCType = index
+        let cmsTemplateModel = cmsTemplateModels![index]
+        vc.shoppingMallListVCType = cmsTemplateModel.applyType ?? 0
         return vc
     }
 }

+ 29 - 1
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/ViewController/ShoppingMallListViewController.swift

@@ -44,13 +44,41 @@ class ShoppingMallListViewController: UIViewController {
         return shoppingMallListView
     }()
     
+    
     /// 获取首页数据
     func cmsTemplateSetPreviewApi() {
         SwiftMoyaNetWorkServiceCMS.shared().cmsTemplateSetPreviewApi(type: shoppingMallListVCType) {
-            [weak self] (data) -> (Void) in
+            [weak self] (cmsModel) -> (Void) in
+            let cmsModel = cmsModel as! CMSModel
+            self?.shoppingMallListView.cmsSectionModels = cmsModel.content
+            self?.productHomeProductApi(cmsModel: cmsModel)
             
         }
     }
+    
+    
+    func productHomeProductApi(cmsModel:CMSModel?) {
+        var productModelsArray = Array<[ProductModel]>()
+        
+        if let model = cmsModel {
+            if !(model.content?.isEmpty ?? true) {
+                for cmsSectionModel in model.content! {
+                    if  cmsSectionModel.areaType == "floor" {
+
+                        
+                        if !(cmsSectionModel.rule?.isEmpty ?? true) {
+                            for cmsRuleModel in cmsSectionModel.rule! {
+                                SwiftMoyaNetWorkServiceProduct.shared().productHomeProductApi(ids: cmsRuleModel.productId ?? "", completion: { (productModels) -> (Void) in
+                                    productModelsArray.append(productModels as! [ProductModel])
+                                })
+                            }
+                           
+                        }
+                    }
+                }
+            }
+        }
+    }
 }
 
 extension ShoppingMallListViewController : JXSegmentedListContainerViewListDelegate {

+ 18 - 13
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/ViewController/ShoppingMallViewController.swift

@@ -19,6 +19,8 @@ class ShoppingMallViewController: BaseViewController {
     override func setupViews() {
         super.setupViews()
         navigationBar.addSubview(navigationBarView)
+        view.addSubview(shoppingMallView)
+        
     }
 
     override func setupLayouts() {
@@ -26,6 +28,10 @@ class ShoppingMallViewController: BaseViewController {
             make.top.equalToSuperview().offset(kSafeStatusBarHeight)
             make.left.right.bottom.equalToSuperview()
         }
+        shoppingMallView.snp.makeConstraints { (make) in
+            make.bottom.left.right.equalToSuperview()
+            make.top.equalTo(kNavBarTotalHeight)
+        }
     }
     
     override func setupData() {
@@ -49,19 +55,9 @@ class ShoppingMallViewController: BaseViewController {
             self?.navigationController?.pushViewController(vc, animated: true)
         }).disposed(by: disposeBag)
         
-        SwiftMoyaNetWorkServiceCMS.shared().cmsTemplateSetTemplateNameApi {
-            [weak self] (data) -> (Void) in
-            self?.setShoppingMallView()
-        }
-    }
-    
-    
-    /// 添加view
-    func setShoppingMallView() {
-        view.addSubview(shoppingMallView)
-        shoppingMallView.snp.makeConstraints { (make) in
-            make.bottom.left.right.equalToSuperview()
-            make.top.equalTo(kNavBarTotalHeight)
+        shoppingMallView.scrollView.addHeaderWithHeader(withBeginRefresh: true, animation: false) { (page) in
+            //请求模板
+            self.cmsTemplateSetTemplateNameApi()
         }
     }
 
@@ -75,6 +71,15 @@ class ShoppingMallViewController: BaseViewController {
          let shoppingMallView = ShoppingMallView()
         return shoppingMallView
     }()
+    
+    /// 请求模板
+     private func cmsTemplateSetTemplateNameApi() {
+        SwiftMoyaNetWorkServiceCMS.shared().cmsTemplateSetTemplateNameApi {
+            [weak self] (cmsTemplateModels) -> (Void) in
+            let cmsTemplateModels = cmsTemplateModels as! Array<CMSTemplateModel>
+            self?.shoppingMallView.cmsTemplateModels = cmsTemplateModels
+        }
+    }
 
 }
 

+ 306 - 0
RainbowPlanet/RainbowPlanet/Service/Model/ProductModel/ProductModel.swift

@@ -0,0 +1,306 @@
+//
+//	ProductModel.swift
+//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport
+
+import Foundation 
+import ObjectMapper
+
+
+class ProductModel : NSObject, NSCoding, Mappable{
+
+	var attributeCategoryId : Int?
+	var bigImg : String?
+	var categoryId1 : Int?
+	var categoryId2 : Int?
+	var categoryId3 : Int?
+	var cityId : Int?
+	var commentNumber : Int?
+	var commentScore : Int?
+	var commentStar : String?
+	var createdAt : String?
+	var deletedAt : String?
+	var deliverType : Int?
+	var desc : String?
+	var id : Int?
+	var img : String?
+	var isConfirmSale : Int?
+	var isMain : Int?
+	var limitNumber : Int?
+	var limitType : String?
+	var name : String?
+	var originPrice : Int?
+	var otherCode : String?
+	var price : Int?
+	var receiveTime : String?
+	var receiveType : Int?
+	var saleName : String?
+	var saleStatus : Int?
+	var shopId : Int?
+	var shopName : String?
+	var skuCode : String?
+	var skuId : Int?
+	var skuName : String?
+	var sort : Int?
+	var spuCode : String?
+	var status : Int?
+	var stock : Int?
+	var storeTypeIds : String?
+	var subtitle : String?
+	var totalCount : Int?
+	var totalStock : Int?
+	var upStatus : Int?
+	var updatedAt : String?
+	var video : String?
+	var wasteStatus : Int?
+
+
+	class func newInstance(map: Map) -> Mappable?{
+		return ProductModel()
+	}
+	required init?(map: Map){}
+	private override init(){}
+
+	func mapping(map: Map)
+	{
+		attributeCategoryId <- map["attribute_category_id"]
+		bigImg <- map["big_img"]
+		categoryId1 <- map["category_id1"]
+		categoryId2 <- map["category_id2"]
+		categoryId3 <- map["category_id3"]
+		cityId <- map["city_id"]
+		commentNumber <- map["comment_number"]
+		commentScore <- map["comment_score"]
+		commentStar <- map["comment_star"]
+		createdAt <- map["created_at"]
+		deletedAt <- map["deleted_at"]
+		deliverType <- map["deliver_type"]
+		desc <- map["desc"]
+		id <- map["id"]
+		img <- map["img"]
+		isConfirmSale <- map["is_confirm_sale"]
+		isMain <- map["is_main"]
+		limitNumber <- map["limit_number"]
+		limitType <- map["limit_type"]
+		name <- map["name"]
+		originPrice <- map["origin_price"]
+		otherCode <- map["other_code"]
+		price <- map["price"]
+		receiveTime <- map["receive_time"]
+		receiveType <- map["receive_type"]
+		saleName <- map["sale_name"]
+		saleStatus <- map["sale_status"]
+		shopId <- map["shop_id"]
+		shopName <- map["shop_name"]
+		skuCode <- map["sku_code"]
+		skuId <- map["sku_id"]
+		skuName <- map["sku_name"]
+		sort <- map["sort"]
+		spuCode <- map["spu_code"]
+		status <- map["status"]
+		stock <- map["stock"]
+		storeTypeIds <- map["store_type_ids"]
+		subtitle <- map["subtitle"]
+		totalCount <- map["total_count"]
+		totalStock <- map["total_stock"]
+		upStatus <- map["up_status"]
+		updatedAt <- map["updated_at"]
+		video <- map["video"]
+		wasteStatus <- map["waste_status"]
+		
+	}
+
+    /**
+    * NSCoding required initializer.
+    * Fills the data from the passed decoder
+    */
+    @objc required init(coder aDecoder: NSCoder)
+	{
+         attributeCategoryId = aDecoder.decodeObject(forKey: "attribute_category_id") as? Int
+         bigImg = aDecoder.decodeObject(forKey: "big_img") as? String
+         categoryId1 = aDecoder.decodeObject(forKey: "category_id1") as? Int
+         categoryId2 = aDecoder.decodeObject(forKey: "category_id2") as? Int
+         categoryId3 = aDecoder.decodeObject(forKey: "category_id3") as? Int
+         cityId = aDecoder.decodeObject(forKey: "city_id") as? Int
+         commentNumber = aDecoder.decodeObject(forKey: "comment_number") as? Int
+         commentScore = aDecoder.decodeObject(forKey: "comment_score") as? Int
+         commentStar = aDecoder.decodeObject(forKey: "comment_star") as? String
+         createdAt = aDecoder.decodeObject(forKey: "created_at") as? String
+         deletedAt = aDecoder.decodeObject(forKey: "deleted_at") as? String
+         deliverType = aDecoder.decodeObject(forKey: "deliver_type") as? Int
+         desc = aDecoder.decodeObject(forKey: "desc") as? String
+         id = aDecoder.decodeObject(forKey: "id") as? Int
+         img = aDecoder.decodeObject(forKey: "img") as? String
+         isConfirmSale = aDecoder.decodeObject(forKey: "is_confirm_sale") as? Int
+         isMain = aDecoder.decodeObject(forKey: "is_main") as? Int
+         limitNumber = aDecoder.decodeObject(forKey: "limit_number") as? Int
+         limitType = aDecoder.decodeObject(forKey: "limit_type") as? String
+         name = aDecoder.decodeObject(forKey: "name") as? String
+         originPrice = aDecoder.decodeObject(forKey: "origin_price") as? Int
+         otherCode = aDecoder.decodeObject(forKey: "other_code") as? String
+         price = aDecoder.decodeObject(forKey: "price") as? Int
+         receiveTime = aDecoder.decodeObject(forKey: "receive_time") as? String
+         receiveType = aDecoder.decodeObject(forKey: "receive_type") as? Int
+         saleName = aDecoder.decodeObject(forKey: "sale_name") as? String
+         saleStatus = aDecoder.decodeObject(forKey: "sale_status") as? Int
+         shopId = aDecoder.decodeObject(forKey: "shop_id") as? Int
+         shopName = aDecoder.decodeObject(forKey: "shop_name") as? String
+         skuCode = aDecoder.decodeObject(forKey: "sku_code") as? String
+         skuId = aDecoder.decodeObject(forKey: "sku_id") as? Int
+         skuName = aDecoder.decodeObject(forKey: "sku_name") as? String
+         sort = aDecoder.decodeObject(forKey: "sort") as? Int
+         spuCode = aDecoder.decodeObject(forKey: "spu_code") as? String
+         status = aDecoder.decodeObject(forKey: "status") as? Int
+         stock = aDecoder.decodeObject(forKey: "stock") as? Int
+         storeTypeIds = aDecoder.decodeObject(forKey: "store_type_ids") as? String
+         subtitle = aDecoder.decodeObject(forKey: "subtitle") as? String
+         totalCount = aDecoder.decodeObject(forKey: "total_count") as? Int
+         totalStock = aDecoder.decodeObject(forKey: "total_stock") as? Int
+         upStatus = aDecoder.decodeObject(forKey: "up_status") as? Int
+         updatedAt = aDecoder.decodeObject(forKey: "updated_at") as? String
+         video = aDecoder.decodeObject(forKey: "video") as? String
+         wasteStatus = aDecoder.decodeObject(forKey: "waste_status") as? Int
+
+	}
+
+    /**
+    * NSCoding required method.
+    * Encodes mode properties into the decoder
+    */
+    @objc func encode(with aCoder: NSCoder)
+	{
+		if attributeCategoryId != nil{
+			aCoder.encode(attributeCategoryId, forKey: "attribute_category_id")
+		}
+		if bigImg != nil{
+			aCoder.encode(bigImg, forKey: "big_img")
+		}
+		if categoryId1 != nil{
+			aCoder.encode(categoryId1, forKey: "category_id1")
+		}
+		if categoryId2 != nil{
+			aCoder.encode(categoryId2, forKey: "category_id2")
+		}
+		if categoryId3 != nil{
+			aCoder.encode(categoryId3, forKey: "category_id3")
+		}
+		if cityId != nil{
+			aCoder.encode(cityId, forKey: "city_id")
+		}
+		if commentNumber != nil{
+			aCoder.encode(commentNumber, forKey: "comment_number")
+		}
+		if commentScore != nil{
+			aCoder.encode(commentScore, forKey: "comment_score")
+		}
+		if commentStar != nil{
+			aCoder.encode(commentStar, forKey: "comment_star")
+		}
+		if createdAt != nil{
+			aCoder.encode(createdAt, forKey: "created_at")
+		}
+		if deletedAt != nil{
+			aCoder.encode(deletedAt, forKey: "deleted_at")
+		}
+		if deliverType != nil{
+			aCoder.encode(deliverType, forKey: "deliver_type")
+		}
+		if desc != nil{
+			aCoder.encode(desc, forKey: "desc")
+		}
+		if id != nil{
+			aCoder.encode(id, forKey: "id")
+		}
+		if img != nil{
+			aCoder.encode(img, forKey: "img")
+		}
+		if isConfirmSale != nil{
+			aCoder.encode(isConfirmSale, forKey: "is_confirm_sale")
+		}
+		if isMain != nil{
+			aCoder.encode(isMain, forKey: "is_main")
+		}
+		if limitNumber != nil{
+			aCoder.encode(limitNumber, forKey: "limit_number")
+		}
+		if limitType != nil{
+			aCoder.encode(limitType, forKey: "limit_type")
+		}
+		if name != nil{
+			aCoder.encode(name, forKey: "name")
+		}
+		if originPrice != nil{
+			aCoder.encode(originPrice, forKey: "origin_price")
+		}
+		if otherCode != nil{
+			aCoder.encode(otherCode, forKey: "other_code")
+		}
+		if price != nil{
+			aCoder.encode(price, forKey: "price")
+		}
+		if receiveTime != nil{
+			aCoder.encode(receiveTime, forKey: "receive_time")
+		}
+		if receiveType != nil{
+			aCoder.encode(receiveType, forKey: "receive_type")
+		}
+		if saleName != nil{
+			aCoder.encode(saleName, forKey: "sale_name")
+		}
+		if saleStatus != nil{
+			aCoder.encode(saleStatus, forKey: "sale_status")
+		}
+		if shopId != nil{
+			aCoder.encode(shopId, forKey: "shop_id")
+		}
+		if shopName != nil{
+			aCoder.encode(shopName, forKey: "shop_name")
+		}
+		if skuCode != nil{
+			aCoder.encode(skuCode, forKey: "sku_code")
+		}
+		if skuId != nil{
+			aCoder.encode(skuId, forKey: "sku_id")
+		}
+		if skuName != nil{
+			aCoder.encode(skuName, forKey: "sku_name")
+		}
+		if sort != nil{
+			aCoder.encode(sort, forKey: "sort")
+		}
+		if spuCode != nil{
+			aCoder.encode(spuCode, forKey: "spu_code")
+		}
+		if status != nil{
+			aCoder.encode(status, forKey: "status")
+		}
+		if stock != nil{
+			aCoder.encode(stock, forKey: "stock")
+		}
+		if storeTypeIds != nil{
+			aCoder.encode(storeTypeIds, forKey: "store_type_ids")
+		}
+		if subtitle != nil{
+			aCoder.encode(subtitle, forKey: "subtitle")
+		}
+		if totalCount != nil{
+			aCoder.encode(totalCount, forKey: "total_count")
+		}
+		if totalStock != nil{
+			aCoder.encode(totalStock, forKey: "total_stock")
+		}
+		if upStatus != nil{
+			aCoder.encode(upStatus, forKey: "up_status")
+		}
+		if updatedAt != nil{
+			aCoder.encode(updatedAt, forKey: "updated_at")
+		}
+		if video != nil{
+			aCoder.encode(video, forKey: "video")
+		}
+		if wasteStatus != nil{
+			aCoder.encode(wasteStatus, forKey: "waste_status")
+		}
+
+	}
+
+}

+ 14 - 0
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceProduct/SwiftMoyaNetWorkServiceProduct.swift

@@ -63,4 +63,18 @@ class SwiftMoyaNetWorkServiceProduct: NSObject {
                 completion(categoryListModel)
         }
     }
+    
+    /// 首页商品
+    ///
+    /// - Parameters:
+    ///   - ids:
+    ///   - completion: 回调
+    func productHomeProductApi(ids:String = "",completion: @escaping apiCallBack) {
+        var parameters = Dictionary<String,Any>()
+        parameters.updateValue(ids, forKey: "ids")
+                SwiftMoyaNetWorkManager.shared()
+            .requestArray(ProductModel.self,target: MultiTarget(SwiftMoyaServiceProductApi.productHomeProduct(parameters: parameters))) {(productModels) in
+                completion(productModels)
+        }
+    }
 }

+ 16 - 4
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceProduct/SwiftMoyaServiceProductApi.swift

@@ -17,14 +17,20 @@ public let kProductSearchApi = "/product/search"
 /// 商品分类
 public let kProductCategoryApi = "/product/categoryList"
 
+// MARK: - 首页商品
+/// 首页商品
+public let kProductHomeProductApi = "/product/honmeProduct"
+
 
 /// 商品
 ///
 /// - productSearch: 搜索、列表、热销
 /// - productCategory: 商品分类
+/// - productHomeProduct: 首页商品
 public enum SwiftMoyaServiceProductApi {
     case productSearch(parameters:Dictionary<String, Any>)
     case productCategory(parameters:Dictionary<String, Any>)
+    case productHomeProduct(parameters:Dictionary<String, Any>)
 }
 
 extension SwiftMoyaServiceProductApi: TargetType {
@@ -32,7 +38,8 @@ extension SwiftMoyaServiceProductApi: TargetType {
     public var baseURL: URL {
         switch self {
         case .productSearch,
-             .productCategory
+             .productCategory,
+             .productHomeProduct
             :
             return URL(string: kApiDataPrefix())!
         }
@@ -44,13 +51,16 @@ extension SwiftMoyaServiceProductApi: TargetType {
             return kProductSearchApi
         case .productCategory:
             return kProductCategoryApi
+        case .productHomeProduct:
+            return kProductHomeProductApi
         }
     }
     
     public var method: Moya.Method {
         switch self {
         case .productSearch,
-             .productCategory
+             .productCategory,
+             .productHomeProduct
             :
             return .post
         }
@@ -60,7 +70,8 @@ extension SwiftMoyaServiceProductApi: TargetType {
     public var task: Task {
         switch self {
         case .productSearch(var parameters),
-             .productCategory(var parameters)
+             .productCategory(var parameters),
+             .productHomeProduct(var parameters)
             :
             let sign = SwiftSign.shared().sign(signType:.AccessToken, parameters: parameters)
             parameters.updateValue(sign, forKey: "sign")
@@ -84,7 +95,8 @@ extension SwiftMoyaServiceProductApi: TargetType {
         //同task,具体选择看后台 有application/x-www-form-urlencoded 、application/json
         switch self {
         case .productSearch,
-             .productCategory
+             .productCategory,
+             .productHomeProduct
             :
             return (headerParameters(headerType: .tokenHeader) as! [String : String])
         }

+ 2 - 0
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceManger/SwiftMoyaNetWorkManager/SwiftMoyaNetWorkManager.swift

@@ -392,6 +392,8 @@ public class SwiftMoyaNetWorkManager: NSObject {
     
 }
 
+
+// MARK: - 泛型返回
 extension PrimitiveSequence where TraitType == SingleTrait, ElementType == Response {
     func map<T: BaseMappable>(_ type: T.Type) -> Single<T?> {
         return flatMap { response -> Single<T?> in