Prechádzať zdrojové kódy

专题页面待完善

南鑫林 6 rokov pred
rodič
commit
249c8d0d5c
34 zmenil súbory, kde vykonal 1559 pridanie a 90 odobranie
  1. 128 4
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  2. 1 0
      RainbowPlanet/RainbowPlanet/Macro/FontMacro.swift
  3. 0 1
      RainbowPlanet/RainbowPlanet/Modules/CommonModules/SearchModule/Search/View/SearchCollectionViewCell.swift
  4. 24 5
      RainbowPlanet/RainbowPlanet/Modules/CommonModules/SearchModule/Search/View/SearchNavigationbarView.swift
  5. 15 7
      RainbowPlanet/RainbowPlanet/Modules/CommonModules/SearchModule/Search/View/SearchView.swift
  6. 17 2
      RainbowPlanet/RainbowPlanet/Modules/CommonModules/SearchModule/Search/ViewController/SearchViewController.swift
  7. 22 5
      RainbowPlanet/RainbowPlanet/Modules/CommonModules/SearchModule/SearchResult/View/SearchResultNavigationbarView.swift
  8. 18 5
      RainbowPlanet/RainbowPlanet/Modules/CommonModules/SearchModule/SearchResult/View/SearchResultView.swift
  9. 41 5
      RainbowPlanet/RainbowPlanet/Modules/CommonModules/SearchModule/SearchResult/ViewController/SearchResultViewController.swift
  10. 6 4
      RainbowPlanet/RainbowPlanet/Modules/MineModule/ExpressAddressList/ViewController/ExpressAddressListViewController.swift
  11. 1 0
      RainbowPlanet/RainbowPlanet/Modules/RegisterLoginModule/BindPhoneNumber/View/BindPhoneNumberView.swift
  12. 120 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/View/CategorySearchView.swift
  13. 89 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/View/CategoryTableViewCell.swift
  14. 153 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/View/CategoryView.swift
  15. 123 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/ViewController/CategoryViewController.swift
  16. 165 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/ProductHBigTableViewCell.swift
  17. 48 32
      RainbowPlanet/RainbowPlanet/Modules/CommonModules/SearchModule/SearchResult/View/SearchResultTableViewCell.swift
  18. 1 2
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallNavigationBarView.swift
  19. 24 13
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/ViewController/ShoppingMallViewController.swift
  20. 18 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Special/SpecialViewController.swift
  21. 33 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Special/View/SpecialBannerView.swift
  22. 121 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Special/View/SpecialView.swift
  23. 49 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Special/ViewController/SpecialViewController.swift
  24. 58 0
      RainbowPlanet/RainbowPlanet/Service/Model/ProductModel/CategoryListModel.swift
  25. 27 0
      RainbowPlanet/RainbowPlanet/Service/Model/ProductModel/ProductSearchListModel.swift
  26. 71 0
      RainbowPlanet/RainbowPlanet/Service/Model/ProductModel/ProductSearchModel.swift
  27. 66 0
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceProduct/SwiftMoyaNetWorkServiceProduct.swift
  28. 93 0
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceProduct/SwiftMoyaServiceProductApi.swift
  29. 23 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/DefaultPage/pic_preload.imageset/Contents.json
  30. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/DefaultPage/pic_preload.imageset/pic_preload.png
  31. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/DefaultPage/pic_preload.imageset/pic_preload@2x.png
  32. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/DefaultPage/pic_preload.imageset/pic_preload@3x.png
  33. 2 2
      RainbowPlanet/RainbowPlanet/Tools/Extension/Extension+NSMutableAttributedString.swift
  34. 2 3
      RainbowPlanet/RainbowPlanet/Tools/Extension/Extension+UIView.swift

+ 128 - 4
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -32,7 +32,7 @@
 		A71AF0B6226EF99A001730FE /* SearchResultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A71AF0B5226EF99A001730FE /* SearchResultViewController.swift */; };
 		A71AF0B8226EF9EC001730FE /* SearchResultNavigationbarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A71AF0B7226EF9EC001730FE /* SearchResultNavigationbarView.swift */; };
 		A71AF0BA226F00F8001730FE /* SearchResultView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A71AF0B9226F00F8001730FE /* SearchResultView.swift */; };
-		A71AF0BC226F099B001730FE /* SearchResultTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A71AF0BB226F099B001730FE /* SearchResultTableViewCell.swift */; };
+		A71AF0BC226F099B001730FE /* ProductHBigTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A71AF0BB226F099B001730FE /* ProductHBigTableViewCell.swift */; };
 		A71AF0BE226F1792001730FE /* ShoppingMallModule.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A71AF0BD226F1792001730FE /* ShoppingMallModule.xcassets */; };
 		A71D2A602265673A00A55D16 /* RegisterLoginView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A71D2A5F2265673A00A55D16 /* RegisterLoginView.swift */; };
 		A72843FC224DB6B800F82F30 /* SwiftMoyaServiceUserApi.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72843FB224DB6B800F82F30 /* SwiftMoyaServiceUserApi.swift */; };
@@ -163,6 +163,19 @@
 		A7A97FDB2238FBAD0070F84D /* VerticalListCellModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7A97FD72238FBAC0070F84D /* VerticalListCellModel.swift */; };
 		A7A97FDC2238FBAD0070F84D /* VerticalListCellCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7A97FD82238FBAC0070F84D /* VerticalListCellCollectionViewCell.swift */; };
 		A7A97FDD2238FBAD0070F84D /* VerticalSectionHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7A97FD92238FBAD0070F84D /* VerticalSectionHeaderView.swift */; };
+		A7A98DFD227E84F4005306E9 /* SwiftMoyaServiceProductApi.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7A98DFC227E84F4005306E9 /* SwiftMoyaServiceProductApi.swift */; };
+		A7A98DFF227E8501005306E9 /* SwiftMoyaNetWorkServiceProduct.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7A98DFE227E8501005306E9 /* SwiftMoyaNetWorkServiceProduct.swift */; };
+		A7A98E02227E8900005306E9 /* ProductSearchListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7A98E01227E8900005306E9 /* ProductSearchListModel.swift */; };
+		A7A98E05227EB891005306E9 /* CategoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7A98E04227EB891005306E9 /* CategoryViewController.swift */; };
+		A7A98E09227EB8DD005306E9 /* CategoryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7A98E08227EB8DD005306E9 /* CategoryView.swift */; };
+		A7A98E0B227EBD04005306E9 /* CategorySearchView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7A98E0A227EBD04005306E9 /* CategorySearchView.swift */; };
+		A7A98E0E227EC0C6005306E9 /* CategoryTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7A98E0D227EC0C6005306E9 /* CategoryTableViewCell.swift */; };
+		A7A98E10227EC531005306E9 /* ProductHSmallTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7A98E0F227EC531005306E9 /* ProductHSmallTableViewCell.swift */; };
+		A7A98E12227ECA11005306E9 /* ProductSearchModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7A98E11227ECA11005306E9 /* ProductSearchModel.swift */; };
+		A7A98E14227ED0E2005306E9 /* CategoryListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7A98E13227ED0E2005306E9 /* CategoryListModel.swift */; };
+		A7A98E17227EED76005306E9 /* SpecialViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7A98E16227EED76005306E9 /* SpecialViewController.swift */; };
+		A7A98E1B227EEE49005306E9 /* SpecialView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7A98E1A227EEE49005306E9 /* SpecialView.swift */; };
+		A7A98E1D227EF1CB005306E9 /* SpecialBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7A98E1C227EF1CB005306E9 /* SpecialBannerView.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 */; };
@@ -257,7 +270,7 @@
 		A71AF0B5226EF99A001730FE /* SearchResultViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchResultViewController.swift; sourceTree = "<group>"; };
 		A71AF0B7226EF9EC001730FE /* SearchResultNavigationbarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchResultNavigationbarView.swift; sourceTree = "<group>"; };
 		A71AF0B9226F00F8001730FE /* SearchResultView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchResultView.swift; sourceTree = "<group>"; };
-		A71AF0BB226F099B001730FE /* SearchResultTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchResultTableViewCell.swift; sourceTree = "<group>"; };
+		A71AF0BB226F099B001730FE /* ProductHBigTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductHBigTableViewCell.swift; sourceTree = "<group>"; };
 		A71AF0BD226F1792001730FE /* ShoppingMallModule.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = ShoppingMallModule.xcassets; sourceTree = "<group>"; };
 		A71D2A5F2265673A00A55D16 /* RegisterLoginView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegisterLoginView.swift; sourceTree = "<group>"; };
 		A72843FB224DB6B800F82F30 /* SwiftMoyaServiceUserApi.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftMoyaServiceUserApi.swift; sourceTree = "<group>"; };
@@ -401,6 +414,19 @@
 		A7A97FD72238FBAC0070F84D /* VerticalListCellModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VerticalListCellModel.swift; sourceTree = "<group>"; };
 		A7A97FD82238FBAC0070F84D /* VerticalListCellCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VerticalListCellCollectionViewCell.swift; sourceTree = "<group>"; };
 		A7A97FD92238FBAD0070F84D /* VerticalSectionHeaderView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VerticalSectionHeaderView.swift; sourceTree = "<group>"; };
+		A7A98DFC227E84F4005306E9 /* SwiftMoyaServiceProductApi.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftMoyaServiceProductApi.swift; sourceTree = "<group>"; };
+		A7A98DFE227E8501005306E9 /* SwiftMoyaNetWorkServiceProduct.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftMoyaNetWorkServiceProduct.swift; sourceTree = "<group>"; };
+		A7A98E01227E8900005306E9 /* ProductSearchListModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProductSearchListModel.swift; sourceTree = "<group>"; };
+		A7A98E04227EB891005306E9 /* CategoryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CategoryViewController.swift; sourceTree = "<group>"; };
+		A7A98E08227EB8DD005306E9 /* CategoryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CategoryView.swift; sourceTree = "<group>"; };
+		A7A98E0A227EBD04005306E9 /* CategorySearchView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CategorySearchView.swift; sourceTree = "<group>"; };
+		A7A98E0D227EC0C6005306E9 /* CategoryTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CategoryTableViewCell.swift; sourceTree = "<group>"; };
+		A7A98E0F227EC531005306E9 /* ProductHSmallTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductHSmallTableViewCell.swift; sourceTree = "<group>"; };
+		A7A98E11227ECA11005306E9 /* ProductSearchModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductSearchModel.swift; sourceTree = "<group>"; };
+		A7A98E13227ED0E2005306E9 /* CategoryListModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CategoryListModel.swift; sourceTree = "<group>"; };
+		A7A98E16227EED76005306E9 /* SpecialViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpecialViewController.swift; sourceTree = "<group>"; };
+		A7A98E1A227EEE49005306E9 /* SpecialView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpecialView.swift; sourceTree = "<group>"; };
+		A7A98E1C227EF1CB005306E9 /* SpecialBannerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpecialBannerView.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>"; };
@@ -667,7 +693,6 @@
 			children = (
 				A71AF0B7226EF9EC001730FE /* SearchResultNavigationbarView.swift */,
 				A71AF0B9226F00F8001730FE /* SearchResultView.swift */,
-				A71AF0BB226F099B001730FE /* SearchResultTableViewCell.swift */,
 			);
 			path = View;
 			sourceTree = "<group>";
@@ -691,6 +716,7 @@
 		A71D2A612265756E00A55D16 /* SwiftMoyaServiceApi */ = {
 			isa = PBXGroup;
 			children = (
+				A7A98DFB227E84D0005306E9 /* SwiftMoyaServiceProduct */,
 				A71AA5242273202E008FF1A5 /* SwiftMoyaServiceConfig */,
 				A72843FD224DB79400F82F30 /* SwiftMoyaServiceUser */,
 				A7C3DD182264229900FA262E /* SwiftMoyaServiceSMS */,
@@ -1050,6 +1076,7 @@
 		A738D203225AEAD000EEE860 /* Model */ = {
 			isa = PBXGroup;
 			children = (
+				A7A98E00227E88E8005306E9 /* ProductModel */,
 				A72A73722233966800B21995 /* RootModel */,
 				A79057032276D5FE0037F823 /* ConfigModel */,
 				A7284402224DBE3500F82F30 /* UserModel */,
@@ -1389,7 +1416,10 @@
 		A77F2CA32232010F001BD3F6 /* ShoppingMallModule */ = {
 			isa = PBXGroup;
 			children = (
+				A7A98E0C227EBEE3005306E9 /* ProductView */,
 				A77F2CA42232010F001BD3F6 /* ShoppingMall */,
+				A7A98E03227EB7FD005306E9 /* Category */,
+				A7A98E15227EECEA005306E9 /* Special */,
 			);
 			path = ShoppingMallModule;
 			sourceTree = "<group>";
@@ -1576,6 +1606,87 @@
 			path = SwiftMoyaServiceManger;
 			sourceTree = "<group>";
 		};
+		A7A98DFB227E84D0005306E9 /* SwiftMoyaServiceProduct */ = {
+			isa = PBXGroup;
+			children = (
+				A7A98DFC227E84F4005306E9 /* SwiftMoyaServiceProductApi.swift */,
+				A7A98DFE227E8501005306E9 /* SwiftMoyaNetWorkServiceProduct.swift */,
+			);
+			path = SwiftMoyaServiceProduct;
+			sourceTree = "<group>";
+		};
+		A7A98E00227E88E8005306E9 /* ProductModel */ = {
+			isa = PBXGroup;
+			children = (
+				A7A98E13227ED0E2005306E9 /* CategoryListModel.swift */,
+				A7A98E01227E8900005306E9 /* ProductSearchListModel.swift */,
+				A7A98E11227ECA11005306E9 /* ProductSearchModel.swift */,
+			);
+			path = ProductModel;
+			sourceTree = "<group>";
+		};
+		A7A98E03227EB7FD005306E9 /* Category */ = {
+			isa = PBXGroup;
+			children = (
+				A7A98E07227EB8CC005306E9 /* View */,
+				A7A98E06227EB8C7005306E9 /* ViewController */,
+			);
+			path = Category;
+			sourceTree = "<group>";
+		};
+		A7A98E06227EB8C7005306E9 /* ViewController */ = {
+			isa = PBXGroup;
+			children = (
+				A7A98E04227EB891005306E9 /* CategoryViewController.swift */,
+			);
+			path = ViewController;
+			sourceTree = "<group>";
+		};
+		A7A98E07227EB8CC005306E9 /* View */ = {
+			isa = PBXGroup;
+			children = (
+				A7A98E08227EB8DD005306E9 /* CategoryView.swift */,
+				A7A98E0A227EBD04005306E9 /* CategorySearchView.swift */,
+				A7A98E0D227EC0C6005306E9 /* CategoryTableViewCell.swift */,
+			);
+			path = View;
+			sourceTree = "<group>";
+		};
+		A7A98E0C227EBEE3005306E9 /* ProductView */ = {
+			isa = PBXGroup;
+			children = (
+				A71AF0BB226F099B001730FE /* ProductHBigTableViewCell.swift */,
+				A7A98E0F227EC531005306E9 /* ProductHSmallTableViewCell.swift */,
+			);
+			path = ProductView;
+			sourceTree = "<group>";
+		};
+		A7A98E15227EECEA005306E9 /* Special */ = {
+			isa = PBXGroup;
+			children = (
+				A7A98E19227EEE30005306E9 /* View */,
+				A7A98E18227EEE06005306E9 /* ViewController */,
+			);
+			path = Special;
+			sourceTree = "<group>";
+		};
+		A7A98E18227EEE06005306E9 /* ViewController */ = {
+			isa = PBXGroup;
+			children = (
+				A7A98E16227EED76005306E9 /* SpecialViewController.swift */,
+			);
+			path = ViewController;
+			sourceTree = "<group>";
+		};
+		A7A98E19227EEE30005306E9 /* View */ = {
+			isa = PBXGroup;
+			children = (
+				A7A98E1A227EEE49005306E9 /* SpecialView.swift */,
+				A7A98E1C227EF1CB005306E9 /* SpecialBannerView.swift */,
+			);
+			path = View;
+			sourceTree = "<group>";
+		};
 		A7BB68512268DCF800AB07A2 /* SelfRecommendation */ = {
 			isa = PBXGroup;
 			children = (
@@ -2167,12 +2278,14 @@
 				A7BB6857226965C100AB07A2 /* SelfRecommendationHeaderCollectionReusableView.swift in Sources */,
 				A7BB68672269B1DD00AB07A2 /* AddressPOIViewController.swift in Sources */,
 				A7284A7322546460000BAEC4 /* SwiftMoyaServicePayApi.swift in Sources */,
+				A7A98DFF227E8501005306E9 /* SwiftMoyaNetWorkServiceProduct.swift in Sources */,
 				A7CC74DC2270352F003C4F38 /* MineOrderCollectionViewCell.swift in Sources */,
 				A7284404224DBFBD00F82F30 /* UserModel.swift in Sources */,
 				A7CC74D822700359003C4F38 /* MineTableViewHeaderView.swift in Sources */,
 				A71D2A602265673A00A55D16 /* RegisterLoginView.swift in Sources */,
 				A73D7C682268A032002A4CE3 /* SwiftyStarRatingView.swift in Sources */,
 				A71AA5102272156A008FF1A5 /* ExpressAddressListViewController.swift in Sources */,
+				A7A98E14227ED0E2005306E9 /* CategoryListModel.swift in Sources */,
 				A71AF0AE226EF0A3001730FE /* SearchHeaderCollectionReusableView.swift in Sources */,
 				A7636AC52268139C00374F9E /* LocationViewController.swift in Sources */,
 				A7D46090227617D200A5A54E /* SQLModel.swift in Sources */,
@@ -2180,7 +2293,9 @@
 				A7C3DD1C226422D200FA262E /* SwiftMoyaNetWorkServiceSMS.swift in Sources */,
 				A7A97FDC2238FBAD0070F84D /* VerticalListCellCollectionViewCell.swift in Sources */,
 				A72A7386223396CB00B21995 /* SwiftMoyaNetWorkManager.swift in Sources */,
+				A7A98E12227ECA11005306E9 /* ProductSearchModel.swift in Sources */,
 				A71AF0B0226EF185001730FE /* SearchCollectionViewCell.swift in Sources */,
+				A7A98E1D227EF1CB005306E9 /* SpecialBannerView.swift in Sources */,
 				A77F2CCA223209F2001BD3F6 /* BaseTabbarViewController.swift in Sources */,
 				A7CC75332271ABB0003C4F38 /* AddressManagerViewController.swift in Sources */,
 				A7CC750D227157DA003C4F38 /* MessageDetailesView.swift in Sources */,
@@ -2210,6 +2325,7 @@
 				A7824B062271F25400ABA381 /* EditAddressTableViewCell.swift in Sources */,
 				A70EBBC022561179000AD74F /* Extension+UITableView.swift in Sources */,
 				A72A72B022321DE000B21995 /* CGView.swift in Sources */,
+				A7A98E0B227EBD04005306E9 /* CategorySearchView.swift in Sources */,
 				A72A73142232475E00B21995 /* AlipayManager.swift in Sources */,
 				A7824B042271F10300ABA381 /* EditSelfMentionContactsView.swift in Sources */,
 				A71AF0B6226EF99A001730FE /* SearchResultViewController.swift in Sources */,
@@ -2247,9 +2363,12 @@
 				A77F2CB72232010F001BD3F6 /* MineViewController.swift in Sources */,
 				A7778CA92244904500C7C47A /* Extension+Gifu.GIFImageView.swift in Sources */,
 				A7A97FDD2238FBAD0070F84D /* VerticalSectionHeaderView.swift in Sources */,
+				A7A98E02227E8900005306E9 /* ProductSearchListModel.swift in Sources */,
+				A7A98E17227EED76005306E9 /* SpecialViewController.swift in Sources */,
 				A7778CB32244D73400C7C47A /* RegisterLoginViewController.swift in Sources */,
 				A7A97FDB2238FBAD0070F84D /* VerticalListCellModel.swift in Sources */,
 				A7CC752F2271A1F2003C4F38 /* SetPasswordView.swift in Sources */,
+				A7A98E09227EB8DD005306E9 /* CategoryView.swift in Sources */,
 				A7CC75362271AC14003C4F38 /* AddressManagerView.swift in Sources */,
 				A71901752275F71F00104A50 /* BaiduToCityModel.swift in Sources */,
 				A7BB685922696B9200AB07A2 /* SelfRecommendationCollectionViewCell.swift in Sources */,
@@ -2257,6 +2376,7 @@
 				A738D205225AF90D00EEE860 /* WeChatpayOrderModel.swift in Sources */,
 				A7CC7524227190FB003C4F38 /* AccountSecurityView.swift in Sources */,
 				A72A72BD22321DE000B21995 /* Extension+UIColor.swift in Sources */,
+				A7A98E05227EB891005306E9 /* CategoryViewController.swift in Sources */,
 				A77F2CC822320627001BD3F6 /* WRCustomNavigationBar.swift in Sources */,
 				A7CC74EF22706CCA003C4F38 /* MessageView.swift in Sources */,
 				A7CC74E0227042A4003C4F38 /* MineServiceTableViewCell.swift in Sources */,
@@ -2278,12 +2398,14 @@
 				A7CC74E222704429003C4F38 /* MineServiceCollectionViewCell.swift in Sources */,
 				A738D202225AD6AD00EEE860 /* Extension+UICollectionView.swift in Sources */,
 				A7CC74D6226FF421003C4F38 /* MineNavigationBarView.swift in Sources */,
-				A71AF0BC226F099B001730FE /* SearchResultTableViewCell.swift in Sources */,
+				A71AF0BC226F099B001730FE /* ProductHBigTableViewCell.swift in Sources */,
 				A71AF0AA226EDDF5001730FE /* SearchView.swift in Sources */,
+				A7A98E0E227EC0C6005306E9 /* CategoryTableViewCell.swift in Sources */,
 				A7284A542252FB5C000BAEC4 /* PaginationModel.swift in Sources */,
 				A72A72D022321E2700B21995 /* FontMacro.swift in Sources */,
 				A71AA52622732068008FF1A5 /* SwiftMoyaServiceConfigApi.swift in Sources */,
 				A77F2C982231FD25001BD3F6 /* BaseNavigationViewController.swift in Sources */,
+				A7A98E1B227EEE49005306E9 /* SpecialView.swift in Sources */,
 				A7824AFB2271EA2600ABA381 /* SelfMentionContactsListView.swift in Sources */,
 				A72A72AB22321DE000B21995 /* SwiftProgressHUD.swift in Sources */,
 				A7CC751C22716426003C4F38 /* SetLogoutTableViewCell.swift in Sources */,
@@ -2299,6 +2421,8 @@
 				A7CC75382271ADD6003C4F38 /* AddressManagerSelfMentionExpressHeaderView.swift in Sources */,
 				A738D66F225D9BD900EEE860 /* UMLoginModel.swift in Sources */,
 				A72A726722321DBD00B21995 /* LocationModel.swift in Sources */,
+				A7A98E10227EC531005306E9 /* ProductHSmallTableViewCell.swift in Sources */,
+				A7A98DFD227E84F4005306E9 /* SwiftMoyaServiceProductApi.swift in Sources */,
 				A72A72D222321E2700B21995 /* Common.swift in Sources */,
 				A71AF0A6226EDDC8001730FE /* SearchViewController.swift in Sources */,
 				A79057062276EA3D0037F823 /* OpenCityListModel.swift in Sources */,

+ 1 - 0
RainbowPlanet/RainbowPlanet/Macro/FontMacro.swift

@@ -85,6 +85,7 @@ let kScaleMediumFont27 = UIFont(name: "PingFang-SC-Medium", size: kScaleValue(va
 let kScaleMediumFont30 = UIFont(name: "PingFang-SC-Medium", size: kScaleValue(value: 30))
 let kScaleMediumFont35 = UIFont(name: "PingFang-SC-Medium", size: kScaleValue(value: 35))
 
+let kScaleRegularFont11 = UIFont(name: "PingFang-SC-Regular", size: kScaleValue(value: 11))
 let kScaleRegularFont12 = UIFont(name: "PingFang-SC-Regular", size: kScaleValue(value: 12))
 let kScaleRegularFont13 = UIFont(name: "PingFang-SC-Regular", size: kScaleValue(value: 13))
 let kScaleRegularFont14 = UIFont(name: "PingFang-SC-Regular", size: kScaleValue(value: 14))

+ 0 - 1
RainbowPlanet/RainbowPlanet/Modules/CommonModules/SearchModule/Search/View/SearchCollectionViewCell.swift

@@ -47,7 +47,6 @@ class SearchCollectionViewCell: UICollectionViewCell {
             make.bottom.equalToSuperview().offset(-8)
             make.left.equalToSuperview().offset(15)
             make.right.equalToSuperview().offset(-15)
-            make.height.equalTo(13)
         }
     }
     

+ 24 - 5
RainbowPlanet/RainbowPlanet/Modules/CommonModules/SearchModule/Search/View/SearchNavigationbarView.swift

@@ -14,7 +14,7 @@ class SearchNavigationbarView: BaseView {
     typealias CancelBlock = () -> Void
     var cancelBlock : CancelBlock?
     
-    typealias SearchBlock = () -> Void
+    typealias SearchBlock = (_ keyWord:String) -> Void
     var searchBlock : SearchBlock?
     
     override func setupViews() {
@@ -74,11 +74,30 @@ class SearchNavigationbarView: BaseView {
         searchTextField.returnKeyType = .search
         searchTextField.font = kScaleRegularFont14
         searchTextField.borderStyle = .none
-        searchTextField.rx.controlEvent([.editingDidEndOnExit]).asObservable().subscribe(onNext: {  [weak self](data) in
-            self?.endEditing(true)
-            if let searchBlock = self?.searchBlock {
-                searchBlock()
+        searchTextField.rx.controlEvent([.editingDidEndOnExit]).asObservable().subscribe(onNext: {
+            [weak self] (text) in
+            
+            if searchTextField.text?.count ?? 0 > 0 {
+                self?.endEditing(true)
+                
+                var searchHistoryArray = Array<String>()
+                
+                if UserDefaults.standard.array(forKey: "SearchHistoryArray")?.isEmpty ?? true {
+                    searchHistoryArray.append(searchTextField.text ?? "")
+                } else {
+                    searchHistoryArray = UserDefaults.standard.array(forKey: "SearchHistoryArray") as! [String]
+                    searchHistoryArray.append(searchTextField.text ?? "")
+                }
+                UserDefaults.standard.set(searchHistoryArray, forKey: "SearchHistoryArray")
+
+                if let searchBlock = self?.searchBlock {
+                    searchBlock(searchTextField.text ?? "")
+                }
+            }else {
+                SwiftProgressHUD.shared().showText("搜索商品不能为空")
             }
+            
+            
         }).disposed(by: disposeBag)
         return searchTextField
     }()

+ 15 - 7
RainbowPlanet/RainbowPlanet/Modules/CommonModules/SearchModule/Search/View/SearchView.swift

@@ -10,17 +10,16 @@ import UIKit
 
 class SearchView: BaseView {
     
-    typealias SearchCollectionViewDidSelectBlock = () -> Void
+    typealias SearchCollectionViewDidSelectBlock = (_ indexPath: IndexPath) -> Void
     var searchCollectionViewDidSelectBlock : SearchCollectionViewDidSelectBlock?
-    
-    let hotArray = ["手机分期","小龙虾","aj篮球鞋","西装外套","补水面膜","小白神奇","手机分期","小龙虾","aj篮球鞋","西装外套小白","补水面膜小白神奇","小白神奇"]
-    
+    var searchHistoryArray = Array<String>()
     override func setupViews() {
         addSubview(collectionView)
         let emptyView =  EmptyView.shared.diyCustomEmptyViewStyle3(titleStr: "没有历史搜索记录")
         emptyView.contentViewY = kScaleValue(value: 60)
         collectionView.ly_emptyView = emptyView
         collectionView.ly_startLoading()
+        setupData()
     }
     
     override func setupLayouts() {
@@ -29,6 +28,15 @@ class SearchView: BaseView {
         }
     }
     
+    func setupData() {
+        
+        guard UserDefaults.standard.array(forKey: "SearchHistoryArray")?.isEmpty ?? true else {
+            searchHistoryArray = UserDefaults.standard.array(forKey: "SearchHistoryArray") as! [String]
+            collectionView.reloadData()
+            return
+        }
+    }
+    
     
     //MARK: - lazy
     private lazy var collectionView: UICollectionView = {
@@ -57,18 +65,18 @@ extension SearchView : UICollectionViewDelegateFlowLayout ,UICollectionViewDataS
         return 1
     }
     func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
-        return 0
+        return searchHistoryArray.count
     }
     
     func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
         let cell = SearchCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
-        cell.hotArray = hotArray
+        cell.hotArray = searchHistoryArray
         return cell
     }
     
     func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
         if self.searchCollectionViewDidSelectBlock != nil {
-            self.searchCollectionViewDidSelectBlock!()
+            self.searchCollectionViewDidSelectBlock!(indexPath)
         }
     }
     

+ 17 - 2
RainbowPlanet/RainbowPlanet/Modules/CommonModules/SearchModule/Search/ViewController/SearchViewController.swift

@@ -43,15 +43,30 @@ class SearchViewController: BaseViewController {
             })
         }
         navigationBarView.searchBlock = {
-            [weak self] in
-            self?.navigationController?.pushViewController(SearchResultViewController(), animated: true)
+            [weak self] keyword in
+            self?.searchView.setupData()
+            self?.pushSearchResultVC(keyword: keyword)
+
         }
         return navigationBarView
     }()
     
     private lazy var searchView: SearchView = {
         let searchView = SearchView()
+        searchView.searchCollectionViewDidSelectBlock = {
+            [weak self] indexPath in
+             let searchHistoryArray = UserDefaults.standard.array(forKey: "SearchHistoryArray") as! [String]
+            let keyword = searchHistoryArray[indexPath.row]
+            self?.pushSearchResultVC(keyword: keyword)
+        }
         return searchView
     }()
     
+    /// 跳转到Push
+    func pushSearchResultVC(keyword:String) {
+        let vc = SearchResultViewController()
+        vc.keyWord = keyword
+        self.navigationController?.pushViewController(vc, animated: true)
+    }
+    
 }

+ 22 - 5
RainbowPlanet/RainbowPlanet/Modules/CommonModules/SearchModule/SearchResult/View/SearchResultNavigationbarView.swift

@@ -21,7 +21,7 @@ class SearchResultNavigationbarView: BaseView {
     var shoppingCarBlock : ShoppingCarBlock?
     
     /// 搜索
-    typealias SearchResultBlock = () -> Void
+    typealias SearchResultBlock = (_ keyWord:String) -> Void
     var searchResultBlock : SearchResultBlock?
      
     override func setupViews() {
@@ -92,7 +92,7 @@ class SearchResultNavigationbarView: BaseView {
         return searchIconImageView
     }()
     
-    private lazy var searchTextField: UITextField = {
+    lazy var searchTextField: UITextField = {
         let searchTextField = UITextField()
         searchTextField.placeholder = "请输入商品名称"
         searchTextField.tintColor = kFFA42FColor
@@ -101,10 +101,27 @@ class SearchResultNavigationbarView: BaseView {
         searchTextField.font = kScaleRegularFont14
         searchTextField.borderStyle = .none
         searchTextField.rx.controlEvent([.editingDidEndOnExit]).asObservable().subscribe(onNext: {  [weak self] (text) in
-            self?.endEditing(true)
-            if let searchResultBlock = self?.searchResultBlock {
-                searchResultBlock()
+            
+            if searchTextField.text?.count ?? 0 > 0 {
+                self?.endEditing(true)
+
+                var searchHistoryArray = Array<String>()
+                
+                if UserDefaults.standard.array(forKey: "SearchHistoryArray")?.isEmpty ?? true {
+                    searchHistoryArray.append(searchTextField.text ?? "")
+                } else {
+                    searchHistoryArray = UserDefaults.standard.array(forKey: "SearchHistoryArray") as! [String]
+                    searchHistoryArray.append(searchTextField.text ?? "")
+                }
+                UserDefaults.standard.set(searchHistoryArray, forKey: "SearchHistoryArray")
+                if let searchResultBlock = self?.searchResultBlock {
+                    searchResultBlock(searchTextField.text ?? "")
+                }
+            }else {
+                SwiftProgressHUD.shared().showText("搜索商品不能为空")
             }
+            
+           
         }).disposed(by: disposeBag)
         return searchTextField
     }()

+ 18 - 5
RainbowPlanet/RainbowPlanet/Modules/CommonModules/SearchModule/SearchResult/View/SearchResultView.swift

@@ -10,6 +10,18 @@ import UIKit
 
 class SearchResultView: BaseView {
     
+    var productSearchModelArray : Array<ProductSearchModel>? {
+        didSet {
+            if productSearchModelArray?.isEmpty ?? true {
+                tableView.isHiddenFooter(true)
+            }else {
+                tableView.isHiddenFooter(false)
+            }
+            tableView.reloadData()
+        }
+    }
+    
+
     override func setupViews() {
         backgroundColor = kf7f8faColor
         addSubview(tableView)
@@ -28,11 +40,11 @@ class SearchResultView: BaseView {
         }
     }
     
-    private lazy var tableView: UITableView = {
+    lazy var tableView: UITableView = {
         let tableView = UITableView(frame: CGRect.zero, style: UITableView.Style.plain)
         tableView.backgroundColor = UIColor.white
         tableView.separatorStyle = .none
-        tableView.rowHeight = kScaleValue(value: 140)
+        tableView.rowHeight = 140
         tableView.dataSource = self
         tableView.delegate = self
         tableView.cornerRadius = 10
@@ -45,15 +57,16 @@ extension SearchResultView :UITableViewDataSource,UITableViewDelegate  {
     
     
     func numberOfSections(in tableView: UITableView) -> Int {
-        return 1
+        return productSearchModelArray?.isEmpty ?? true ? 0 : 1
     }
     
     func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        return 10
+        return productSearchModelArray?.isEmpty ?? true ? 0 : productSearchModelArray?.count ?? 0
     }
     
     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-        let cell = SearchResultTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+        let cell = ProductHBigTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+        cell.productSearchModel = productSearchModelArray![indexPath.row]
         return cell
     }
     

+ 41 - 5
RainbowPlanet/RainbowPlanet/Modules/CommonModules/SearchModule/SearchResult/ViewController/SearchResultViewController.swift

@@ -10,15 +10,19 @@ import UIKit
 
 class SearchResultViewController: BaseViewController {
     
+    var keyWord : String!
+    
+    var productSearchModelArray = Array<ProductSearchModel>()
+    
     override func viewDidLoad() {
         super.viewDidLoad()
         setupViews()
         setupLayouts()
+        setupData()
     }
     
     override func setupViews() {
-        navigationBar.wr_setLeftButton(title: "", titleColor: UIColor.clear)
-        navigationBar.onClickLeftButton = nil
+        navigationBar.leftButton.isHidden = true
         navigationBar.addSubview(navigationBarView)
         view.addSubview(searchResultView)
         
@@ -35,18 +39,32 @@ class SearchResultViewController: BaseViewController {
         }
     }
     
-    private lazy var navigationBarView: SearchResultNavigationbarView = {
-        let navigationBarView = SearchResultNavigationbarView()
+    override func setupData() {
+        searchResultView.tableView.addHeaderWithHeader(withBeginRefresh: true, animation: false) {
+            [weak self] (page) in
+            self?.productSearchApi(page: page)
+        }
+        searchResultView.tableView.addFooterWithWithHeader(withAutomaticallyRefresh: true) {
+            [weak self] (page) in
+            self?.productSearchApi(page: page)
+        }
         navigationBarView.backBlock = {
             [weak self] in
             self?.navigationController?.popViewController(animated: true)
         }
         navigationBarView.searchResultBlock = {
-            
+            [weak self] keyword in
+            self?.keyWord = keyword
+            self?.productSearchApi(page: 1)
         }
         navigationBarView.shoppingCarBlock = {
             
         }
+    }
+    
+    private lazy var navigationBarView: SearchResultNavigationbarView = {
+        let navigationBarView = SearchResultNavigationbarView()
+        navigationBarView.searchTextField.text = keyWord
         return navigationBarView
     }()
     
@@ -54,4 +72,22 @@ class SearchResultViewController: BaseViewController {
         let searchResultView = SearchResultView()
         return searchResultView
     }()
+    
+    
+    /// 搜索结果
+    func productSearchApi(page:Int = 1) {
+        SwiftMoyaNetWorkServiceProduct.shared().productSearchApi(page:page ,keyword: self.keyWord) {
+            [weak self] (productSearchListModel) -> (Void) in
+            let productSearchListModel = productSearchListModel as? ProductSearchListModel
+            if productSearchListModel?.pagination?.currentPage ?? 1  <= productSearchListModel?.pagination?.totalPages ?? 1 {
+                if productSearchListModel?.pagination?.currentPage == 1{
+                    self?.productSearchModelArray.removeAll()
+                }
+                self?.productSearchModelArray = (self?.productSearchModelArray)! + (productSearchListModel?.data!)!
+                self?.searchResultView.productSearchModelArray = self?.productSearchModelArray
+            }else {
+                self?.searchResultView.tableView.endFooterNoMoreData()
+            }
+        }
+    }
 }

+ 6 - 4
RainbowPlanet/RainbowPlanet/Modules/MineModule/ExpressAddressList/ViewController/ExpressAddressListViewController.swift

@@ -63,7 +63,8 @@ class ExpressAddressListViewController: BaseViewController {
         expressAddressListView.didSelectRowClosure = {
             [weak self] indexPath in
              let expressAddresModel = self?.addressManagerListModel?.expressAddress![indexPath.row]
-            self?.userSetExpreesContactsDefaultApi(id: expressAddresModel?.id ?? 0)
+            self?.userAddressIsDefaultApi(id: expressAddresModel?.id ?? 0)
+            NotificationCenter.default.post(name: NSNotification.Name("editAddress"), object: nil)
         }
         return expressAddressListView
     }()
@@ -78,10 +79,11 @@ class ExpressAddressListViewController: BaseViewController {
         }
     }
     
-    /// 自提点收货人信息,设置默认
-    func userSetExpreesContactsDefaultApi(id:Int = 0) {
-        SwiftMoyaNetWorkServiceUser.shared().userSetExpreesContactsDefaultApi(id: id, completion: {
+    /// 快递,设置默认
+    func userAddressIsDefaultApi(id:Int = 0) {
+        SwiftMoyaNetWorkServiceUser.shared().userAddressIsDefaultApi(id: id, completion: {
             [weak self] (data) -> (Void) in
+            NotificationCenter.default.post(name: NSNotification.Name("editAddress"), object: nil)
             self?.userExpressAddressListApi()
         })
     }

+ 1 - 0
RainbowPlanet/RainbowPlanet/Modules/RegisterLoginModule/BindPhoneNumber/View/BindPhoneNumberView.swift

@@ -194,6 +194,7 @@ class BindPhoneNumberView: BaseView {
                 return
             }
             if let sendSmSBlock = self?.sendSmSBlock {
+                smsButton.countdown = true
                 sendSmSBlock(smsButton, (self?.phoneNumber)!)
             }
             

+ 120 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/View/CategorySearchView.swift

@@ -0,0 +1,120 @@
+//
+//  CategorySearchView.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/5/5.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import UIKit
+
+class CategorySearchView: BaseView {
+
+    /// 购物车
+    typealias ShoppingCarBlock = () -> Void
+    var shoppingCarBlock : ShoppingCarBlock?
+    
+    /// 搜索
+    typealias SearchResultBlock = (_ keyWord:String) -> Void
+    var searchResultBlock : SearchResultBlock?
+    
+    override func setupViews() {
+        addSubview(shoppingCarButton)
+        addSubview(searchbgView)
+        searchbgView.addSubview(searchIconImageView)
+        searchbgView.addSubview(searchTextField)
+    }
+    
+    override func setupLayouts() {
+        shoppingCarButton.snp.makeConstraints { (make) in
+            make.centerY.equalToSuperview()
+            make.right.equalToSuperview().offset(-14)
+            make.size.equalTo(24)
+            make.height.equalTo(21)
+        }
+        searchbgView.snp.makeConstraints { (make) in
+            make.centerY.equalToSuperview()
+            make.left.equalTo(14)
+            make.right.equalTo(shoppingCarButton.snp.left).offset(-10)
+            make.height.equalTo(30)
+        }
+        searchIconImageView.snp.makeConstraints { (make) in
+            make.centerY.equalToSuperview()
+            make.left.equalTo(12)
+            make.size.equalTo(18)
+        }
+        
+        searchTextField.snp.makeConstraints { (make) in
+            make.centerY.equalToSuperview()
+            make.left.equalTo(searchIconImageView.snp.right).offset(8)
+            make.right.equalToSuperview().offset(8)
+            make.height.equalTo(30)
+            
+        }
+    }
+    
+    private lazy var searchbgView: UIView = {
+        let searchbgView = UIView()
+        searchbgView.backgroundColor = kf7f8faColor
+        searchbgView.cornerRadius = 15
+        searchbgView.masksToBounds = true
+        return searchbgView
+    }()
+    
+    private lazy var searchIconImageView: UIImageView = {
+        let searchIconImageView = UIImageView()
+        searchIconImageView.image = kImage(name: "navbar_search")
+        return searchIconImageView
+    }()
+    
+    lazy var searchTextField: UITextField = {
+        let searchTextField = UITextField()
+        searchTextField.placeholder = "请输入商品名称"
+        searchTextField.tintColor = kFFA42FColor
+        searchTextField.textColor = k333333Color
+        searchTextField.returnKeyType = .search
+        searchTextField.font = kScaleRegularFont14
+        searchTextField.borderStyle = .none
+        searchTextField.rx.controlEvent([.editingDidEndOnExit]).asObservable().subscribe(onNext: {  [weak self] (text) in
+            
+            if searchTextField.text?.count ?? 0 > 0 {
+                self?.endEditing(true)
+                
+                var searchHistoryArray = Array<String>()
+                
+                if UserDefaults.standard.array(forKey: "SearchHistoryArray")?.isEmpty ?? true {
+                    searchHistoryArray.append(searchTextField.text ?? "")
+                } else {
+                    searchHistoryArray = UserDefaults.standard.array(forKey: "SearchHistoryArray") as! [String]
+                    searchHistoryArray.append(searchTextField.text ?? "")
+                }
+                UserDefaults.standard.set(searchHistoryArray, forKey: "SearchHistoryArray")
+                if let searchResultBlock = self?.searchResultBlock {
+                    searchResultBlock(searchTextField.text ?? "")
+                }
+            }else {
+                SwiftProgressHUD.shared().showText("搜索商品不能为空")
+            }
+            
+            
+        }).disposed(by: disposeBag)
+        return searchTextField
+    }()
+    
+    private lazy var shoppingCarButton: UIButton = {
+        let shoppingCarButton = UIButton(type: UIButton.ButtonType.custom)
+        shoppingCarButton.setImage(kImage(name: "navbar_shopping"), for: UIControl.State.normal)
+        shoppingCarButton.rx.tap.subscribe(onNext: { [weak self] (data) in
+            if let shoppingCarBlock = self?.shoppingCarBlock {
+                shoppingCarBlock()
+            }
+        }).disposed(by: disposeBag)
+        shoppingCarButton.pp.addBadge(number: 5)
+        //        shoppingCarButton.pp.setBadge(height: 14)
+        //        shoppingCarButton.pp.badgeView.font = kRegularFont10
+        shoppingCarButton.pp.badgeView.backgroundColor = kfe352bColor
+        shoppingCarButton.pp.moveBadge(x: -2, y: 2)
+        return shoppingCarButton
+    }()
+
+}

+ 89 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/View/CategoryTableViewCell.swift

@@ -0,0 +1,89 @@
+//
+//  CategoryTableViewCell.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/5/5.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import UIKit
+
+class CategoryTableViewCell: UITableViewCell {
+    
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> CategoryTableViewCell {
+        let ID = "CategoryTableViewCell"
+        tableView.register(CategoryTableViewCell.self, forCellReuseIdentifier: ID)
+        let cell : CategoryTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! CategoryTableViewCell
+        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 {
+            
+        }
+    }
+    
+    override func setSelected(_ selected: Bool, animated: Bool) {
+        super.setSelected(selected, animated: animated)
+        isHighlighted = selected
+        titleLable.isHighlighted = selected
+        h_Label.isHidden = !selected
+    }
+    
+    //MRAK: - 设置View
+    private func setupViews() {
+        self.selectionStyle = .none
+        backgroundColor = kf5f5f5Color
+        addSubview(h_Label)
+        addSubview(titleLable)
+    }
+    
+    private func setupLayouts() {
+        h_Label.snp.makeConstraints { (make) in
+            make.centerY.equalToSuperview()
+            make.left.equalToSuperview()
+            make.width.equalTo(4)
+            make.height.equalTo(14)
+        }
+        titleLable.snp.makeConstraints { (make) in
+            make.centerY.equalToSuperview()
+            make.left.equalTo(5)
+            make.right.equalTo(-5)
+        }
+    }
+    
+    lazy var h_Label: UILabel = {
+        let h_Label = UILabel()
+        h_Label.backgroundColor = kff724fColor
+        h_Label.cornerRadius = 2
+        h_Label.masksToBounds = true
+        return h_Label
+    }()
+    
+    lazy var titleLable: UILabel = {
+        let titleLable = UILabel()
+        titleLable.textColor = k333333Color
+        titleLable.highlightedTextColor = kff724fColor
+        titleLable.font = kRegularFont14
+        titleLable.textAlignment = .center
+        return titleLable
+    }()
+    
+    var categoryModel:CategoryModel? {
+        didSet {
+            titleLable.text = categoryModel?.name
+        }
+    }
+
+}

+ 153 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/View/CategoryView.swift

@@ -0,0 +1,153 @@
+//
+//  CategoryView.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/5/5.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import UIKit
+
+class CategoryView: BaseView {
+    
+    var productSearchModelArray : Array<ProductSearchModel>? {
+        didSet {
+            if productSearchModelArray?.isEmpty ?? true {
+                rightTableView.isHiddenFooter(true)
+            }else {
+                rightTableView.isHiddenFooter(false)
+            }
+            rightTableView.reloadData()
+        }
+    }
+    
+    var categoryModelArray : Array<CategoryModel>? {
+        didSet {
+            if categoryModelArray?.isEmpty ?? true {
+                leftTableView.isHiddenFooter(true)
+
+            }else {
+                leftTableView.isHiddenFooter(true)
+                leftTableView.reloadData()
+                leftTableView.selectRow(at: leftIndexPath, animated: true, scrollPosition: UITableView.ScrollPosition.none)
+
+            }
+            
+        }
+    }
+    
+    var leftIndexPath : IndexPath =  IndexPath(row: 0, section: 0)
+    
+    typealias LeftDidSelectRow = (_ indexPath: IndexPath) -> Void
+    var leftDidSelectRow : LeftDidSelectRow?
+    
+    typealias RightDidSelectRow = (_ indexPath: IndexPath) -> Void
+    var rightDidSelectRow : RightDidSelectRow?
+    
+    override func setupViews() {
+        addSubview(leftTableView)
+        addSubview(rightTableView)
+    }
+    
+    override func setupLayouts() {
+        leftTableView.snp.makeConstraints { (make) in
+            make.top.left.bottom.equalToSuperview()
+            make.width.equalTo(90)
+        }
+        rightTableView.snp.makeConstraints { (make) in
+            make.top.right.bottom.equalToSuperview()
+            make.left.equalTo(leftTableView.snp.right)
+        }
+    }
+    
+    //左侧表格
+    lazy var leftTableView : UITableView = {
+        let leftTableView = UITableView()
+        leftTableView.delegate = self
+        leftTableView.dataSource = self
+        leftTableView.rowHeight = 46
+        leftTableView.showsVerticalScrollIndicator = false
+        leftTableView.separatorColor = UIColor.clear
+        leftTableView.backgroundColor = kf5f5f5Color
+
+        return leftTableView
+    }()
+    
+    //右侧表格
+    lazy var rightTableView : UITableView = {
+        let rightTableView = UITableView()
+        rightTableView.delegate = self
+        rightTableView.dataSource = self
+        rightTableView.rowHeight = 106
+        rightTableView.showsVerticalScrollIndicator = false
+        rightTableView.separatorColor = UIColor.clear
+        rightTableView.backgroundColor = kffffffColor
+
+        return rightTableView
+    }()
+    
+}
+
+extension CategoryView : UITableViewDataSource, UITableViewDelegate {
+    //表格分区数
+    func numberOfSections(in tableView: UITableView) -> Int {
+        if leftTableView == tableView {
+            return categoryModelArray?.isEmpty ?? true ? 0 : 1
+        } else {
+            return productSearchModelArray?.isEmpty ?? true ? 0 : 1
+        }
+    }
+    
+    //分区下单元格数量
+    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+        if leftTableView == tableView {
+            return categoryModelArray?.isEmpty ?? true ? 0 : categoryModelArray?.count ?? 0
+        } else {
+            return productSearchModelArray?.isEmpty ?? true ? 0 : productSearchModelArray?.count ?? 0
+        }
+    }
+    
+    //返回自定义单元格
+    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath)
+        -> UITableViewCell {
+            if leftTableView == tableView {
+                let cell = CategoryTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                cell.categoryModel = categoryModelArray![indexPath.row]
+                return cell
+            } else {
+                let cell = ProductHSmallTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                cell.productSearchModel = productSearchModelArray![indexPath.row]
+                return cell
+            }
+    }
+    
+    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
+        if leftTableView == tableView {
+            self.leftIndexPath = indexPath
+            if let leftDidSelectRow = self.leftDidSelectRow {
+                leftDidSelectRow(indexPath)
+            }
+        } else {
+            if let rightDidSelectRow = self.rightDidSelectRow {
+                rightDidSelectRow(indexPath)
+            }
+        }
+    }
+    
+    //分区头高度(只有右侧表格有分区头)
+    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
+        if leftTableView == tableView {
+            return 0
+        }
+        return 0
+    }
+    
+    //返回自定义分区头(只有右侧表格有分区头)
+    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
+        if leftTableView == tableView {
+            return nil
+        }
+
+        return nil
+    }
+}

+ 123 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/ViewController/CategoryViewController.swift

@@ -0,0 +1,123 @@
+//
+//  CategoryViewController.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/5/5.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import UIKit
+
+class CategoryViewController: BaseViewController {
+    
+    var categoryModelArray = Array<CategoryModel>()
+    var productSearchModelArray = Array<ProductSearchModel>()
+    
+    var leftIndexPath : IndexPath =  IndexPath(row: 0, section: 0)
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        setupViews()
+        setupLayouts()
+        setupData()
+    }
+    
+    override func setupViews() {
+        view.addSubview(categorySearchView)
+        view.addSubview(categoryView)
+    }
+    
+    override func setupLayouts() {
+        categorySearchView.snp.makeConstraints { (make) in
+            make.top.equalTo(kNavBarTotalHeight)
+            make.left.right.equalToSuperview()
+            make.height.equalTo(44)
+        }
+        categoryView.snp.makeConstraints { (make) in
+            make.top.equalTo(categorySearchView.snp.bottom)
+            make.left.right.bottom.equalToSuperview()
+        }
+    }
+    
+    override func setupData() {
+        categoryView.leftTableView.addHeaderWithHeader(withBeginRefresh: true, animation: false) {
+            [weak self] (page) in
+            self?.productCategoryApi(page: page)
+        }
+        categoryView.leftTableView.addFooterWithWithHeader(withAutomaticallyRefresh: true) {
+            [weak self] (page) in
+            self?.productCategoryApi(page: page)
+        }
+        categoryView.leftDidSelectRow = {
+            [weak self] indexPath in
+            self?.leftIndexPath = indexPath
+            self?.productSearchApi(page: 1)
+        }
+        
+        categoryView.rightTableView.addHeaderWithHeader(withBeginRefresh: false, animation: false) {
+            [weak self] (page) in
+            self?.productSearchApi(page: page)
+        }
+        categoryView.rightTableView.addFooterWithWithHeader(withAutomaticallyRefresh: true) {
+            [weak self] (page) in
+            self?.productSearchApi(page: page)
+        }
+        
+        categoryView.rightDidSelectRow = {
+             [weak self] indexPath in
+        }
+    }
+
+    private lazy var categorySearchView: CategorySearchView = {
+        let categorySearchView = CategorySearchView()
+        return categorySearchView
+    }()
+    
+    private lazy var categoryView: CategoryView = {
+        let categoryView = CategoryView()
+        return categoryView
+    }()
+    
+    
+    /// 分类
+    ///
+    /// - Parameter page: 分页
+    func productCategoryApi(page:Int = 1) {
+        SwiftMoyaNetWorkServiceProduct.shared().productCategoryApi(page:page) {
+            [weak self] (categoryListModel) -> (Void) in
+            let categoryListModel = categoryListModel as? CategoryListModel
+            if categoryListModel?.pagination?.currentPage ?? 1  <= categoryListModel?.pagination?.totalPages ?? 1 {
+                if categoryListModel?.pagination?.currentPage == 1{
+                    self?.categoryModelArray.removeAll()
+                    self?.categoryModelArray = (self?.categoryModelArray)! + (categoryListModel?.data!)!
+                     self?.productSearchApi(page: page)
+                }else {
+                    self?.categoryModelArray = (self?.categoryModelArray)! + (categoryListModel?.data!)!
+                   
+                }
+                self?.categoryView.categoryModelArray = self?.categoryModelArray
+            }else {
+                self?.categoryView.rightTableView.endFooterNoMoreData()
+            }
+        }
+    }
+    
+    /// 商品结果
+    func productSearchApi(page:Int = 1) {
+        let categoryModel = categoryModelArray[leftIndexPath.row]
+
+        SwiftMoyaNetWorkServiceProduct.shared().productSearchApi(page:page ,categoryId:categoryModel.id ?? 0) {
+            [weak self] (productSearchListModel) -> (Void) in
+            let productSearchListModel = productSearchListModel as? ProductSearchListModel
+            if productSearchListModel?.pagination?.currentPage ?? 1  <= productSearchListModel?.pagination?.totalPages ?? 1 {
+                if productSearchListModel?.pagination?.currentPage == 1{
+                    self?.productSearchModelArray.removeAll()
+                }
+                self?.productSearchModelArray = (self?.productSearchModelArray)! + (productSearchListModel?.data!)!
+                self?.categoryView.productSearchModelArray = self?.productSearchModelArray
+            }else {
+                self?.categoryView.rightTableView.endFooterNoMoreData()
+            }
+        }
+    }
+}

+ 165 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/ProductHBigTableViewCell.swift

@@ -0,0 +1,165 @@
+//
+//  ProductHBigTableViewCell.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/4/23.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import UIKit
+
+class ProductHBigTableViewCell: UITableViewCell {
+    
+    override var frame: CGRect {
+        get {
+            return super.frame
+        }
+        set {
+            var frame = newValue
+            frame.origin.x += 15
+            frame.size.width -= 2 * 15
+            super.frame = frame
+        }
+    }
+    
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ProductHBigTableViewCell {
+        let ID = "ProductHBigTableViewCell"
+        tableView.register(ProductHBigTableViewCell.self, forCellReuseIdentifier: ID)
+        let cell : ProductHBigTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! ProductHBigTableViewCell
+        cell.indexPath = indexPath
+        return cell
+    }
+    
+    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
+        super.init(style: style, reuseIdentifier: reuseIdentifier)
+        setupViews()
+        setupLayouts()
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    var indexPath: IndexPath? {
+        didSet {
+            
+        }
+    }
+    //MRAK: - 设置View
+    private func setupViews() {
+        self.selectionStyle = .none
+        addSubview(iconImagView)
+        addSubview(titleLabel)
+        addSubview(detailTitleLabel)
+        addSubview(sellNumberLabel)
+        addSubview(sellPriceLabel)
+        addSubview(markPriceLabel)
+        addSubview(plusButton)
+    }
+    
+    private func setupLayouts() {
+        iconImagView.snp.makeConstraints { (make) in
+            make.top.equalTo(10)
+            make.left.equalTo(10)
+            make.size.equalTo(120)
+        }
+        titleLabel.snp.makeConstraints { (make) in
+            make.left.equalTo(iconImagView.snp.right).offset(10)
+            make.top.equalTo(iconImagView)
+            make.right.equalTo(-10)
+        }
+        detailTitleLabel.snp.makeConstraints { (make) in
+            make.top.equalTo(titleLabel.snp.bottom).offset(10)
+            make.right.left.equalTo(titleLabel)
+        }
+        sellNumberLabel.snp.makeConstraints { (make) in
+            make.top.equalTo(detailTitleLabel.snp.bottom).offset(10)
+            make.left.right.equalTo(detailTitleLabel)
+        }
+        sellPriceLabel.snp.remakeConstraints { (make) in
+            make.left.equalTo(titleLabel)
+            make.bottom.equalTo(iconImagView)
+        }
+        markPriceLabel.snp.remakeConstraints { (make) in
+            make.left.equalTo(sellPriceLabel.snp.right).offset(5)
+            make.bottom.equalTo(iconImagView)
+        }
+        plusButton.snp.makeConstraints { (make) in
+            make.bottom.equalTo(iconImagView)
+            make.right.equalToSuperview().offset(-10)
+            make.size.equalTo(25)
+        }
+
+    }
+    
+    private lazy var iconImagView: UIImageView = {
+        let iconImagView = UIImageView()
+        return iconImagView
+    }()
+    
+    private lazy var titleLabel: UILabel = {
+        let titleLabel = UILabel()
+        titleLabel.text = "海南冰糖心木瓜 1个装"
+        titleLabel.textColor = k333333Color
+        titleLabel.font = kScaleMediumFont18
+        titleLabel.textAlignment = .left
+        titleLabel.numberOfLines = 2
+        return titleLabel
+    }()
+    
+    private lazy var detailTitleLabel: UILabel = {
+        let detailTitleLabel = UILabel()
+        detailTitleLabel.text = "酸甜可口营养无限"
+        detailTitleLabel.textColor = k999999Color
+        detailTitleLabel.font = kScaleRegularFont13
+        detailTitleLabel.textAlignment = .left
+        return detailTitleLabel
+    }()
+    
+    private lazy var sellNumberLabel: UILabel = {
+        let sellNumberLabel = UILabel()
+        sellNumberLabel.text = "已售2400件"
+        sellNumberLabel.textColor = k333333Color
+        sellNumberLabel.font = kScaleRegularFont12
+        return sellNumberLabel
+    }()
+    
+    private lazy var sellPriceLabel: UILabel = {
+        let sellPriceLabel = UILabel()
+        sellPriceLabel.text = "¥11.8"
+        sellPriceLabel.textColor = kfe352bColor
+        sellPriceLabel.font = kScaleBoldFont20
+        sellPriceLabel.textAlignment = .left
+        return sellPriceLabel
+    }()
+    
+    private lazy var markPriceLabel: UILabel = {
+        let markPriceLabel = UILabel()
+        markPriceLabel.font = kScaleRegularFont13
+        let attributeString = NSMutableAttributedString(string:"¥24.4")
+        attributeString.changeStrikethrough(atAllStyle: NSUnderlineStyle(rawValue: NSUnderlineStyle.single.rawValue), color: kbbbbbbColor)
+        markPriceLabel.attributedText = attributeString
+        return markPriceLabel
+    }()
+    
+    private lazy var plusButton: UIButton = {
+        let plusButton = UIButton(type: UIButton.ButtonType.custom)
+        plusButton.setImage(kImage(name: "shopping_mall_plus"), for: UIControl.State.normal)
+        return plusButton
+    }()
+    
+    var productSearchModel: ProductSearchModel? {
+        didSet {
+            iconImagView.kf.setImage(with: kURLImage(name: productSearchModel?.img ?? "pic_preload"), placeholder: kImage(name: "pic_preload"))
+            titleLabel.text = productSearchModel?.nameSkuName
+            detailTitleLabel.text = productSearchModel?.saleName
+            sellNumberLabel.text = "已售\(productSearchModel?.totalCount ?? 0)件"
+            sellPriceLabel.text = "¥\(productSearchModel?.price ?? 0)"
+            let attributeString = NSMutableAttributedString(string:"¥\(productSearchModel?.originPrice ?? 0)")
+            attributeString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
+            markPriceLabel.attributedText = attributeString
+
+        }
+    }
+
+}

+ 48 - 32
RainbowPlanet/RainbowPlanet/Modules/CommonModules/SearchModule/SearchResult/View/SearchResultTableViewCell.swift

@@ -1,30 +1,19 @@
 //
-//  SearchResultTableViewCell.swift
+//  ProductHSmallTableViewCell.swift
 //  RainbowPlanet
 //
-//  Created by 南鑫林 on 2019/4/23.
+//  Created by 南鑫林 on 2019/5/5.
 //  Copyright © 2019 南鑫林. All rights reserved.
 //
 
 import UIKit
 
-class SearchResultTableViewCell: UITableViewCell {
+class ProductHSmallTableViewCell: UITableViewCell {
 
-    override func awakeFromNib() {
-        super.awakeFromNib()
-        // Initialization code
-    }
-
-    override func setSelected(_ selected: Bool, animated: Bool) {
-        super.setSelected(selected, animated: animated)
-
-        // Configure the view for the selected state
-    }
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> UITableViewCell {
-        let ID = "SearchResultTableViewCell"
-        tableView.register(SearchResultTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : SearchResultTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! SearchResultTableViewCell
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ProductHSmallTableViewCell {
+        let ID = "ProductHSmallTableViewCell"
+        tableView.register(ProductHSmallTableViewCell.self, forCellReuseIdentifier: ID)
+        let cell : ProductHSmallTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! ProductHSmallTableViewCell
         cell.indexPath = indexPath
         return cell
     }
@@ -50,6 +39,7 @@ class SearchResultTableViewCell: UITableViewCell {
         addSubview(iconImagView)
         addSubview(titleLabel)
         addSubview(detailTitleLabel)
+        addSubview(sellNumberLabel)
         addSubview(sellPriceLabel)
         addSubview(markPriceLabel)
         addSubview(plusButton)
@@ -57,38 +47,42 @@ class SearchResultTableViewCell: UITableViewCell {
     
     private func setupLayouts() {
         iconImagView.snp.makeConstraints { (make) in
-            make.top.equalTo(kScaleValue(value: 10))
-            make.left.equalTo(kScaleValue(value: 10))
-            make.size.equalTo(kScaleValue(value: 120))
+            make.top.equalTo(6)
+            make.left.equalTo(6)
+            make.size.equalTo(94)
         }
         titleLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(iconImagView.snp.right).offset(kScaleValue(value: 10))
+            make.left.equalTo(iconImagView.snp.right).offset(8)
             make.top.equalTo(iconImagView)
-            make.right.equalTo(kScaleValue(value: -10))
+            make.right.equalTo(-16)
         }
         detailTitleLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(titleLabel.snp.bottom).offset(kScaleValue(value: 10))
+            make.top.equalTo(titleLabel.snp.bottom).offset(4)
             make.right.left.equalTo(titleLabel)
         }
+        sellNumberLabel.snp.makeConstraints { (make) in
+            make.top.equalTo(detailTitleLabel.snp.bottom).offset(4)
+            make.left.right.equalTo(detailTitleLabel)
+        }
         sellPriceLabel.snp.remakeConstraints { (make) in
             make.left.equalTo(titleLabel)
             make.bottom.equalTo(iconImagView)
         }
         markPriceLabel.snp.remakeConstraints { (make) in
-            make.left.equalTo(sellPriceLabel.snp.right).offset(kScaleValue(value: 5))
+            make.left.equalTo(sellPriceLabel.snp.right).offset(2)
             make.bottom.equalTo(iconImagView)
         }
         plusButton.snp.makeConstraints { (make) in
             make.bottom.equalTo(iconImagView)
-            make.right.equalToSuperview().offset(kScaleValue(value: -10))
-            make.size.equalTo(kScaleValue(value: 25))
+            make.right.equalToSuperview().offset(-10)
+            make.size.equalTo(25)
         }
-
         
     }
     
     private lazy var iconImagView: UIImageView = {
         let iconImagView = UIImageView()
+        iconImagView.image = kImage(name: "iconImagView")
         return iconImagView
     }()
     
@@ -96,7 +90,7 @@ class SearchResultTableViewCell: UITableViewCell {
         let titleLabel = UILabel()
         titleLabel.text = "海南冰糖心木瓜 1个装"
         titleLabel.textColor = k333333Color
-        titleLabel.font = kScaleMediumFont18
+        titleLabel.font = kScaleMediumFont15
         titleLabel.textAlignment = .left
         titleLabel.numberOfLines = 2
         return titleLabel
@@ -106,16 +100,24 @@ class SearchResultTableViewCell: UITableViewCell {
         let detailTitleLabel = UILabel()
         detailTitleLabel.text = "酸甜可口营养无限"
         detailTitleLabel.textColor = k999999Color
-        detailTitleLabel.font = kScaleRegularFont13
+        detailTitleLabel.font = kScaleRegularFont12
         detailTitleLabel.textAlignment = .left
         return detailTitleLabel
     }()
     
+    private lazy var sellNumberLabel: UILabel = {
+        let sellNumberLabel = UILabel()
+        sellNumberLabel.text = "已售2400件"
+        sellNumberLabel.textColor = k333333Color
+        sellNumberLabel.font = kScaleRegularFont11
+        return sellNumberLabel
+    }()
+    
     private lazy var sellPriceLabel: UILabel = {
         let sellPriceLabel = UILabel()
         sellPriceLabel.text = "¥11.8"
         sellPriceLabel.textColor = kfe352bColor
-        sellPriceLabel.font = kScaleBoldFont20
+        sellPriceLabel.font = kScaleBoldFont15
         sellPriceLabel.textAlignment = .left
         return sellPriceLabel
     }()
@@ -137,5 +139,19 @@ class SearchResultTableViewCell: UITableViewCell {
         return plusButton
     }()
     
-    
+    var productSearchModel: ProductSearchModel? {
+        didSet {
+            iconImagView.kf.setImage(with: kURLImage(name: productSearchModel?.img ?? "pic_preload"), placeholder: kImage(name: "pic_preload"))
+            titleLabel.text = productSearchModel?.nameSkuName
+            detailTitleLabel.text = productSearchModel?.saleName
+            sellNumberLabel.text = "已售\(productSearchModel?.totalCount ?? 0)件"
+            sellPriceLabel.text = "¥\(productSearchModel?.price ?? 0)"
+            let attributeString = NSMutableAttributedString(string:"¥\(productSearchModel?.originPrice ?? 0)")
+            attributeString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
+            markPriceLabel.attributedText = attributeString
+            
+        }
+    }
+
+
 }

+ 1 - 2
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallNavigationBarView.swift

@@ -66,7 +66,6 @@ class ShoppingMallNavigationBarView: BaseView {
         searchTextField.snp.remakeConstraints { (make) in
             make.centerY.equalTo(searchButton.snp.centerY)
             make.left.equalTo(searchIconImageView.snp.right).offset(6)
-//            make.right.equalTo(searchButton.snp.right).offset(-9)
             make.height.equalTo(30)
         }
         
@@ -119,7 +118,7 @@ class ShoppingMallNavigationBarView: BaseView {
         return searchTextField
     }()
     
-    private lazy var categoryButton: UIButton = {
+    lazy var categoryButton: UIButton = {
         let categoryButton = UIButton(type: UIButton.ButtonType.custom)
         categoryButton.setImage(kImage(name: "navbar_class"), for: UIControl.State.normal)
         return categoryButton

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

@@ -13,7 +13,7 @@ class ShoppingMallViewController: BaseViewController {
         super.viewDidLoad()
         setupViews()
         setupLayouts()
-        
+        setupData()
         
     }
     override func setupViews() {
@@ -32,26 +32,37 @@ class ShoppingMallViewController: BaseViewController {
             make.top.equalTo(navigationBarView.snp.bottom)
         }
     }
-
-    private lazy var navigationBarView: ShoppingMallNavigationBarView = {
-        let navigationBarView = ShoppingMallNavigationBarView()
+    
+    override func setupData() {
+        //搜索
         navigationBarView.searchBlock = {
             [weak self] in
-//            let vc = SearchViewController()
-//            let nav = BaseNavigationViewController.init(rootViewController: vc)
-//            self?.present(nav, animated: true, completion: {
-//
-//            })
+            let vc = SearchViewController()
+            let nav = BaseNavigationViewController.init(rootViewController: vc)
+            self?.present(nav, animated: true, completion: {
+                
+            })
         }
+        //分类
+        navigationBarView.categoryButton.rx.tap.subscribe(onNext: {
+            [weak self] in
+//            let vc = CategoryViewController()
+//            vc.navigationBar.title = "团购分类"
+//            self?.navigationController?.pushViewController(vc, animated: true)
+            let vc = SpecialViewController()
+            vc.navigationBar.title = "专题页面"
+            self?.navigationController?.pushViewController(vc, animated: true)
+        }).disposed(by: disposeBag)
+    }
+
+    private lazy var navigationBarView: ShoppingMallNavigationBarView = {
+        let navigationBarView = ShoppingMallNavigationBarView()
+        
         return navigationBarView
     }()
 
     private lazy var shoppingMallView: ShoppingMallView = {
          let shoppingMallView = ShoppingMallView()
-        /// 分类
-        shoppingMallView.categoryActionBlock = {
-            
-        }
         return shoppingMallView
     }()
 

+ 18 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Special/SpecialViewController.swift

@@ -0,0 +1,18 @@
+//
+//  SpecialViewController.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/5/5.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import UIKit
+
+class SpecialViewController: BaseViewController {
+
+    override func viewDidLoad() {
+        super.viewDidLoad()
+
+        // Do any additional setup after loading the view.
+    }
+}

+ 33 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Special/View/SpecialBannerView.swift

@@ -0,0 +1,33 @@
+//
+//  SpecialBannerView.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/5/5.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import UIKit
+
+class SpecialBannerView: BaseView {
+    
+    override func setupViews() {
+        addSubview(bannerButton)
+    }
+    
+    override func setupLayouts() {
+        bannerButton.snp.makeConstraints { (make) in
+            make.top.equalTo(10)
+            make.left.equalTo(14)
+            make.bottom.equalTo(-10)
+            make.right.equalTo(-14)
+        }
+    }
+    
+    lazy var bannerButton: UIButton = {
+        let bannerButton = UIButton(type: UIButton.ButtonType.custom)
+        bannerButton.setBackgroundImage(kImage(name: "logo"), for: UIControl.State.normal)
+        bannerButton.cornerRadius = 4
+        bannerButton.masksToBounds = true
+        return bannerButton
+    }()
+}

+ 121 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Special/View/SpecialView.swift

@@ -0,0 +1,121 @@
+//
+//  SpecialView.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/5/5.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import UIKit
+
+class SpecialView: BaseView {
+
+    var productSearchModelArray : Array<ProductSearchModel>? {
+        didSet {
+            if productSearchModelArray?.isEmpty ?? true {
+                tableView.isHiddenFooter(true)
+            }else {
+                tableView.isHiddenFooter(false)
+            }
+            tableView.reloadData()
+        }
+    }
+    
+    typealias DidSelectRow = (_ indexPath: IndexPath) -> Void
+    var didSelectRow : DidSelectRow?
+    
+    
+    override func setupViews() {
+        addSubview(tableView)
+    }
+    
+    override func setupLayouts() {
+        tableView.snp.makeConstraints { (make) in
+            make.edges.equalToSuperview()
+        }
+    }
+    
+    //左侧表格
+    lazy var tableView : UITableView = {
+        let tableView = UITableView()
+        tableView.delegate = self
+        tableView.dataSource = self
+//        tableView.rowHeight = 140
+        tableView.showsVerticalScrollIndicator = false
+        tableView.separatorColor = UIColor.clear
+        tableView.backgroundColor = kf5f5f5Color
+        return tableView
+    }()
+
+}
+
+extension SpecialView : UITableViewDataSource, UITableViewDelegate {
+    //表格分区数
+    func numberOfSections(in tableView: UITableView) -> Int {
+//        return productSearchModelArray?.isEmpty ?? true ? 0 : 1
+        return 1
+    }
+    
+    //分区下单元格数量
+    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+//        return productSearchModelArray?.isEmpty ?? true ? 0 : productSearchModelArray?.count ?? 0
+        return 10
+    }
+    
+    //返回自定义单元格
+    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath)
+        -> UITableViewCell {
+        let cell = ProductHBigTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+            //圆角半径
+            let cornerRadius:CGFloat = 4
+            
+            //下面为设置圆角操作(通过遮罩实现)
+            let shapeLayer = CAShapeLayer()
+            cell.layer.mask = nil
+            switch indexPath.row {
+            //如果是第一行,左上、右上角为圆角
+            case 0:
+                var bounds = cell.bounds
+                bounds.origin.y += 1.0  //这样每一组首行顶部分割线不显示
+                let bezierPath = UIBezierPath(roundedRect: bounds,
+                                              byRoundingCorners: [.topLeft,.topRight],
+                                              cornerRadii: CGSize(width: cornerRadius,height: cornerRadius))
+                shapeLayer.path = bezierPath.cgPath
+                cell.layer.mask = shapeLayer
+            //如果是最后一行,左下、右下角为圆角
+            case 9:
+                var bounds = cell.bounds
+                bounds.size.height -= 1.0  //这样每一组尾行底部分割线不显示
+                let bezierPath = UIBezierPath(roundedRect: bounds,
+                                              byRoundingCorners: [.bottomLeft,.bottomRight],
+                                              cornerRadii: CGSize(width: cornerRadius,height: cornerRadius))
+                shapeLayer.path = bezierPath.cgPath
+                cell.layer.mask = shapeLayer
+            default:
+                break
+            }
+//        cell.productSearchModel = productSearchModelArray![indexPath.row]
+        return cell
+    }
+    
+    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
+            if let didSelectRow = self.didSelectRow {
+                didSelectRow(indexPath)
+            }
+    }
+    
+    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
+        return 140
+    }
+    
+    //分区头高度(只有右侧表格有分区头)
+    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
+        return 0
+    }
+    
+    //返回自定义分区头(只有右侧表格有分区头)
+    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
+        return nil
+    }
+}
+

+ 49 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Special/ViewController/SpecialViewController.swift

@@ -0,0 +1,49 @@
+//
+//  SpecialViewController.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/5/5.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import UIKit
+
+class SpecialViewController: BaseViewController {
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        setupViews()
+        setupLayouts()
+        setupData()
+    }
+    
+    override func setupViews() {
+        view.addSubview(categorySearchView)
+        view.addSubview(specialView)
+    }
+    
+    override func setupLayouts() {
+        categorySearchView.snp.makeConstraints { (make) in
+            make.top.equalTo(kNavBarTotalHeight)
+            make.left.right.equalToSuperview()
+            make.height.equalTo(44)
+        }
+        specialView.snp.makeConstraints { (make) in
+            make.top.equalTo(categorySearchView.snp.bottom)
+            make.left.right.bottom.equalToSuperview()
+        }
+    }
+    
+    override func setupData() {
+        
+    }
+    
+    private lazy var categorySearchView: CategorySearchView = {
+        let categorySearchView = CategorySearchView()
+        return categorySearchView
+    }()
+    private lazy var specialView: SpecialView = {
+        let specialView = SpecialView()
+        return specialView
+    }()
+}

+ 58 - 0
RainbowPlanet/RainbowPlanet/Service/Model/ProductModel/CategoryListModel.swift

@@ -0,0 +1,58 @@
+//
+//	CategoryListModel.swift
+//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport
+
+import Foundation 
+import ObjectMapper
+
+
+class CategoryListModel : NSObject, Mappable{
+
+	var data : [CategoryModel]?
+    var pagination : PaginationModel?
+
+	class func newInstance(map: Map) -> Mappable?{
+		return CategoryListModel()
+	}
+	required init?(map: Map){}
+	private override init(){}
+
+	func mapping(map: Map)
+	{
+		data <- map["data"]
+        pagination <- map["pagination"]
+	}
+
+}
+
+class CategoryModel : NSObject, Mappable{
+    
+    var desc : String?
+    var ico : String?
+    var id : Int?
+    var isOpen : Int?
+    var level : Int?
+    var name : String?
+    var sort : Int?
+    var isSelected : Bool?
+    
+    
+    class func newInstance(map: Map) -> Mappable?{
+        return CategoryModel()
+    }
+    required init?(map: Map){}
+    private override init(){}
+    
+    func mapping(map: Map)
+    {
+        desc <- map["desc"]
+        ico <- map["ico"]
+        id <- map["id"]
+        isOpen <- map["is_open"]
+        level <- map["level"]
+        name <- map["name"]
+        sort <- map["sort"]
+        
+    }
+    
+}

+ 27 - 0
RainbowPlanet/RainbowPlanet/Service/Model/ProductModel/ProductSearchListModel.swift

@@ -0,0 +1,27 @@
+//
+//	ProductSearchListModel.swift
+//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport
+
+import Foundation 
+import ObjectMapper
+
+
+class ProductSearchListModel : NSObject,Mappable{
+
+	var data : [ProductSearchModel]?
+	var pagination : PaginationModel?
+
+
+	class func newInstance(map: Map) -> Mappable?{
+		return ProductSearchListModel()
+	}
+	required init?(map: Map){}
+	private override init(){}
+
+	func mapping(map: Map)
+	{
+		data <- map["data"]
+		pagination <- map["pagination"]
+		
+	}
+}

+ 71 - 0
RainbowPlanet/RainbowPlanet/Service/Model/ProductModel/ProductSearchModel.swift

@@ -0,0 +1,71 @@
+//
+//  ProductSearchModel.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/5/5.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import UIKit
+import ObjectMapper
+
+class ProductSearchModel : NSObject, Mappable{
+    
+    var categoryName1 : String?
+    var categoryName2 : String?
+    var categoryName3 : String?
+    var cityId : Int?
+    var id : Int?
+    var img : String?
+    var isMain : Int?
+    var label : [String]?
+    var mainLabelName : String?
+    var nameSkuName : String?
+    var originPrice : Int?
+    var price : Int?
+    var saleName : String?
+    var skuCode : String?
+    var skuId : Int?
+    var skuName : String?
+    var spuCode : String?
+    var stock : Int?
+    var totalCount : Int?
+    var totalStock : Int?
+    var upStatus : Int?
+    
+    
+    class func newInstance(map: Map) -> Mappable?{
+        return ProductSearchModel()
+    }
+    required init?(map: Map){}
+    private override init(){}
+    
+    func mapping(map: Map)
+    {
+        categoryName1 <- map["category_name1"]
+        categoryName2 <- map["category_name2"]
+        categoryName3 <- map["category_name3"]
+        cityId <- map["city_id"]
+        id <- map["id"]
+        img <- map["img"]
+        isMain <- map["is_main"]
+        label <- map["label"]
+        mainLabelName <- map["main_label_name"]
+        nameSkuName <- map["name&sku_name"]
+        originPrice <- map["origin_price"]
+        price <- map["price"]
+        saleName <- map["sale_name"]
+        skuCode <- map["sku_code"]
+        skuId <- map["sku_id"]
+        skuName <- map["sku_name"]
+        spuCode <- map["spu_code"]
+        stock <- map["stock"]
+        totalCount <- map["total_count"]
+        totalStock <- map["total_stock"]
+        upStatus <- map["up_status"]
+        
+    }
+    
+}
+
+

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

@@ -0,0 +1,66 @@
+//
+//  SwiftMoyaNetWorkServiceProduct.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/5/5.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import Foundation
+import Moya
+import SwiftyJSON
+import ObjectMapper
+class SwiftMoyaNetWorkServiceProduct: NSObject {
+    private static let _sharedInstance = SwiftMoyaNetWorkServiceProduct()
+    
+    private override init() {} // 私有化init方法
+    
+    class func shared() -> SwiftMoyaNetWorkServiceProduct {
+        return _sharedInstance
+    }
+    /// 数据回调
+    typealias apiCallBack = (Any) -> (Void)
+    
+    /// 搜索、列表、热销
+    ///
+    /// - Parameters:
+    ///   - keyword: 关键字:商品名称、子标题、规格
+    ///   - category_id: 一级分类id
+    ///   - order: 排序字段:商品分类排序、商品排序、价格、销量、好评率
+    ///   - desc: 排序方式:desc、asc
+    ///   - completion: 回调
+    func productSearchApi(page:Int = 1, keyword:String = "",categoryId:Int = 0, order:String = "",desc:String = "",completion: @escaping apiCallBack) {
+        var parameters = Dictionary<String,Any>()
+        parameters.updateValue(page, forKey: "page")
+        parameters.updateValue(keyword, forKey: "keyword")
+        parameters.updateValue(categoryId, forKey: "category_id1")
+        parameters.updateValue(order, forKey: "order")
+        parameters.updateValue(desc, forKey: "desc")
+        parameters.updateValue(desc, forKey: "desc")
+
+        SwiftProgressHUD.shared().showWait()
+        SwiftMoyaNetWorkManager.shared()
+            .request(ProductSearchListModel.self,target: MultiTarget(SwiftMoyaServiceProductApi.productSearch(parameters: parameters))) {(productSearchListModel) in
+            SwiftProgressHUD.shared().hide()
+            completion(productSearchListModel)
+        }
+    }
+    
+    /// 商品分类
+    ///
+    /// - Parameters:
+    ///   - parentId: 分类父id
+    ///   - completion: 回调
+    func productCategoryApi(page:Int = 1,parentId:Int = 0,completion: @escaping apiCallBack) {
+        var parameters = Dictionary<String,Any>()
+        parameters.updateValue(parentId, forKey: "parent_id")
+        parameters.updateValue(page, forKey: "page")
+        
+        SwiftProgressHUD.shared().showWait()
+        SwiftMoyaNetWorkManager.shared()
+            .request(CategoryListModel.self,target: MultiTarget(SwiftMoyaServiceProductApi.productCategory(parameters: parameters))) {(categoryListModel) in
+                SwiftProgressHUD.shared().hide()
+                completion(categoryListModel)
+        }
+    }
+}

+ 93 - 0
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceProduct/SwiftMoyaServiceProductApi.swift

@@ -0,0 +1,93 @@
+//
+//  SwiftMoyaServiceProductApi.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/5/5.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import Foundation
+import Moya
+
+// MARK: - 搜索、列表、热销
+/// 搜索、列表、热销
+public let kProductSearchApi = "/product/search"
+
+// MARK: - 商品分类
+/// 商品分类
+public let kProductCategoryApi = "/product/categoryList"
+
+
+/// 商品
+///
+/// - productSearch: 搜索、列表、热销
+/// - productCategory: 商品分类
+public enum SwiftMoyaServiceProductApi {
+    case productSearch(parameters:Dictionary<String, Any>)
+    case productCategory(parameters:Dictionary<String, Any>)
+}
+
+extension SwiftMoyaServiceProductApi: TargetType {
+    
+    public var baseURL: URL {
+        switch self {
+        case .productSearch,
+             .productCategory
+            :
+            return URL(string: kApiDataPrefix())!
+        }
+    }
+    
+    public var path: String {
+        switch self {
+        case .productSearch:
+            return kProductSearchApi
+        case .productCategory:
+            return kProductCategoryApi
+        }
+    }
+    
+    public var method: Moya.Method {
+        switch self {
+        case .productSearch,
+             .productCategory
+            :
+            return .post
+        }
+    }
+    
+    // MARK: - 请求任务事件(这里附带上参数)
+    public var task: Task {
+        switch self {
+        case .productSearch(var parameters),
+             .productCategory(var parameters)
+            :
+            let sign = SwiftSign.shared().sign(signType:.AccessToken, parameters: parameters)
+            parameters.updateValue(sign, forKey: "sign")
+            return .requestParameters(parameters: parameters, encoding: URLEncoding.default)
+        }
+    }
+    
+    
+    // MARK: - 是否执行Alamofire验证
+    public var validate: Bool {
+        return false
+    }
+    
+    // MARK: - 这个就是做单元测试模拟的数据,只会在单元测试文件中有作用
+    public var sampleData: Data {
+        return "{}".data(using: String.Encoding.utf8)!
+    }
+    
+    // MARK: - 请求头
+    public var headers: [String : String]? {
+        //同task,具体选择看后台 有application/x-www-form-urlencoded 、application/json
+        switch self {
+        case .productSearch,
+             .productCategory
+            :
+            return (headerParameters(headerType: .tokenHeader) as! [String : String])
+        }
+    }
+    
+}

+ 23 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/DefaultPage/pic_preload.imageset/Contents.json

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

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/DefaultPage/pic_preload.imageset/pic_preload.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/DefaultPage/pic_preload.imageset/pic_preload@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/DefaultPage/pic_preload.imageset/pic_preload@3x.png


+ 2 - 2
RainbowPlanet/RainbowPlanet/Tools/Extension/Extension+NSMutableAttributedString.swift

@@ -76,7 +76,7 @@ extension NSMutableAttributedString {
 
     // MARK: 设置下划线样式:根据枚举选择
     public func change(_ style: NSUnderlineStyle, color: UIColor?, range: NSRange) {
-        addAttribute(.underlineStyle, value: style, range: range)
+        addAttribute(.underlineStyle, value: style.rawValue, range: range)
         addAttribute(.underlineColor, value: color ?? "", range: range)
     }
 
@@ -88,7 +88,7 @@ extension NSMutableAttributedString {
 
     // MARK: 设置删除线样式:根据枚举选择
     public func changeStrikethroughStyle(_ style: NSUnderlineStyle, color: UIColor?, range: NSRange) {
-        addAttribute(.strikethroughStyle, value: style, range: range)
+        addAttribute(.strikethroughStyle, value: style.rawValue, range: range)
         addAttribute(.strikethroughColor, value: color ?? "", range: range)
     }
 

+ 2 - 3
RainbowPlanet/RainbowPlanet/Tools/Extension/Extension+UIView.swift

@@ -178,14 +178,13 @@ public extension UIView {
     ///   - corner: 哪些圆角
     ///   - radii: 圆角半径
     /// - Returns: layer图层
-    func configRectCorner(corner: UIRectCorner, radii: CGSize) -> CALayer {
+    func configRectCorner(corner: UIRectCorner, radii: CGSize) {
 
         let maskPath = UIBezierPath.init(roundedRect: self.bounds, byRoundingCorners: corner, cornerRadii: radii)
         let maskLayer = CAShapeLayer.init()
         maskLayer.frame = self.bounds
         maskLayer.path = maskPath.cgPath
-
-        return maskLayer
+        self.layer.mask = maskLayer
     }