nanxinlin 6 år sedan
förälder
incheckning
6a55cf18dd
23 ändrade filer med 820 tillägg och 136 borttagningar
  1. 2 4
      RainbowPlanet/Podfile
  2. 5 5
      RainbowPlanet/Podfile.lock
  3. 43 11
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  4. 2 1
      RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate+Window.swift
  5. 18 6
      RainbowPlanet/RainbowPlanet/Base/BaseView/BaseView.swift
  6. 3 1
      RainbowPlanet/RainbowPlanet/Base/BaseViewController/BaseViewController.swift
  7. 2 0
      RainbowPlanet/RainbowPlanet/Define/ColorMacro.swift
  8. 3 0
      RainbowPlanet/RainbowPlanet/Define/RainbowPlanet-Bridging-Header.h
  9. 101 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallCategoryCollectionViewCell.swift
  10. 60 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallHeaderCollectionReusableView.swift
  11. 177 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallNavigationBarView.swift
  12. 221 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallView.swift
  13. 77 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/ViewController/ShoppingMallViewController.swift
  14. 0 86
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/ViewController/ShoppingViewController.swift
  15. 0 22
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/ViewController/ShoppingViewController.xib
  16. 6 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/empty_image/Contents.json
  17. 21 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/empty_image/empty_jd.imageset/Contents.json
  18. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/empty_image/empty_jd.imageset/empty_jd@2x.png
  19. 21 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/empty_image/empty_nodata.imageset/Contents.json
  20. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/empty_image/empty_nodata.imageset/empty_nodata@2x.png
  21. 21 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/empty_image/empty_nonetwork.imageset/Contents.json
  22. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/empty_image/empty_nonetwork.imageset/empty_nonetwork@2x.png
  23. 37 0
      RainbowPlanet/RainbowPlanet/Tools/EmptyView/EmptyView.swift

+ 2 - 4
RainbowPlanet/Podfile

@@ -22,8 +22,6 @@ target 'RainbowPlanet' do
   pod 'Kingfisher'
   # 自动布局
   pod 'SnapKit'
-  # 自动布局
-  pod 'TangramKit'
   # 键盘
   pod 'IQKeyboardManagerSwift'
   # 加密
@@ -36,6 +34,8 @@ target 'RainbowPlanet' do
   pod 'DeviceKit'
   # 内存检测
   pod 'MLeaksFinder'
+  # 占位图
+  pod 'LYEmptyView'
   # 轮播
 #  pod 'FSPagerView'
   # 分段导航栏
@@ -46,8 +46,6 @@ target 'RainbowPlanet' do
 #  pod 'EFQRCode'
   # 小红点
 #  pod 'PPBadgeViewSwift'
-  # 占位图
-#  pod 'LYEmptyView'
   # 日期时间处理
 #  pod 'SwiftDate'
   # pop动画

+ 5 - 5
RainbowPlanet/Podfile.lock

@@ -6,6 +6,7 @@ PODS:
   - FBRetainCycleDetector (0.1.4)
   - IQKeyboardManagerSwift (6.2.0)
   - Kingfisher (4.10.1)
+  - LYEmptyView (1.2.3)
   - MBProgressHUD (1.1.0)
   - MJRefresh (3.1.15.7)
   - MLeaksFinder (1.0.0):
@@ -30,7 +31,6 @@ PODS:
     - RxAtomic (>= 4.4.2, ~> 4.4)
   - SnapKit (4.2.0)
   - SwiftyJSON (4.2.0)
-  - TangramKit (1.3.1)
   - UMCAnalytics (6.0.2):
     - UMCCommon
   - UMCCommon (2.0.0)
@@ -60,6 +60,7 @@ DEPENDENCIES:
   - DeviceKit
   - IQKeyboardManagerSwift
   - Kingfisher
+  - LYEmptyView
   - MBProgressHUD
   - MJRefresh
   - MLeaksFinder
@@ -70,7 +71,6 @@ DEPENDENCIES:
   - RxSwift
   - SnapKit
   - SwiftyJSON
-  - TangramKit
   - UMCAnalytics
   - UMCCommon
   - UMCCommonLog
@@ -90,6 +90,7 @@ SPEC REPOS:
     - FBRetainCycleDetector
     - IQKeyboardManagerSwift
     - Kingfisher
+    - LYEmptyView
     - MBProgressHUD
     - MJRefresh
     - MLeaksFinder
@@ -103,7 +104,6 @@ SPEC REPOS:
     - RxSwift
     - SnapKit
     - SwiftyJSON
-    - TangramKit
     - UMCAnalytics
     - UMCCommon
     - UMCCommonLog
@@ -119,6 +119,7 @@ SPEC CHECKSUMS:
   FBRetainCycleDetector: 46f8179bbb1c587deee3ea838a1a3ee02acf5015
   IQKeyboardManagerSwift: b07ccf9d8cafe993dcd6cb794eb4ba34611a0c4e
   Kingfisher: c148cd7b47ebde9989f6bc7c27dcaa79d81279a0
+  LYEmptyView: ea5827f3f81fcbec427f990005501991477bdae8
   MBProgressHUD: e7baa36a220447d8aeb12769bf0585582f3866d9
   MJRefresh: 697f8ec75ebdbe9207767bb682cf0f51b0d8a41f
   MLeaksFinder: 8c435bd2f6d070af18cff082b503b21adc130fc0
@@ -132,7 +133,6 @@ SPEC CHECKSUMS:
   RxSwift: 74c29b693c8e42b0f64400e8b06564575742d649
   SnapKit: fe8a619752f3f27075cc9a90244d75c6c3f27e2a
   SwiftyJSON: c4bcba26dd9ec7a027fc8eade48e2c911f229e96
-  TangramKit: 1b4ee065845919057bdbe930ba39deecbbff181e
   UMCAnalytics: 901960ede5a8a85f208bd37689ad3e607b433930
   UMCCommon: 79b5a614c958db367113eed5740109d9a98e1223
   UMCCommonLog: 05a2d5de21858e3d870551562cff405c1366d244
@@ -140,6 +140,6 @@ SPEC CHECKSUMS:
   UMCSecurityPlugins: 0831a08f3988f3cea9f1d3a7626cd9bee4fef150
   UMCShare: 552b29753f1b4da87b51d96545ed19e6263df397
 
-PODFILE CHECKSUM: 05251c9a8b8212b41a266957c2e10072ff6f5b64
+PODFILE CHECKSUM: a4d53eeb91931bb1e29f62d510d184baf7b4b365
 
 COCOAPODS: 1.5.3

+ 43 - 11
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -105,6 +105,11 @@
 		A72A738F2233B2DE00B21995 /* RealmUtility.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72A738C2233B2DE00B21995 /* RealmUtility.swift */; };
 		A72A73912233B55400B21995 /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72A73902233B55400B21995 /* Dog.swift */; };
 		A72A73932233BFCD00B21995 /* SwiftMoyaNetWorkCacheModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72A73922233BFCD00B21995 /* SwiftMoyaNetWorkCacheModel.swift */; };
+		A775CBFE2237493600EBDCF8 /* ShoppingMallNavigationBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A775CBFD2237493600EBDCF8 /* ShoppingMallNavigationBarView.swift */; };
+		A775CC00223774A300EBDCF8 /* ShoppingMallView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A775CBFF223774A300EBDCF8 /* ShoppingMallView.swift */; };
+		A775CC0322377C6500EBDCF8 /* EmptyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A775CC0222377C6500EBDCF8 /* EmptyView.swift */; };
+		A775CC05223798F000EBDCF8 /* ShoppingMallCategoryCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A775CC04223798F000EBDCF8 /* ShoppingMallCategoryCollectionViewCell.swift */; };
+		A775CC072237A69D00EBDCF8 /* ShoppingMallHeaderCollectionReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A775CC062237A69D00EBDCF8 /* ShoppingMallHeaderCollectionReusableView.swift */; };
 		A77F2C612231FB49001BD3F6 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A77F2C602231FB49001BD3F6 /* AppDelegate.swift */; };
 		A77F2C682231FB4A001BD3F6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A77F2C672231FB4A001BD3F6 /* Assets.xcassets */; };
 		A77F2C762231FB4A001BD3F6 /* RainbowPlanetTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A77F2C752231FB4A001BD3F6 /* RainbowPlanetTests.swift */; };
@@ -113,8 +118,7 @@
 		A77F2C9C2231FDCF001BD3F6 /* BaseView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A77F2C9B2231FDCF001BD3F6 /* BaseView.swift */; };
 		A77F2C9E2231FDDC001BD3F6 /* BaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A77F2C9D2231FDDC001BD3F6 /* BaseViewController.swift */; };
 		A77F2CA02231FE45001BD3F6 /* BaseWebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A77F2C9F2231FE45001BD3F6 /* BaseWebViewController.swift */; };
-		A77F2CB42232010F001BD3F6 /* ShoppingViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A77F2CA62232010F001BD3F6 /* ShoppingViewController.xib */; };
-		A77F2CB52232010F001BD3F6 /* ShoppingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A77F2CA72232010F001BD3F6 /* ShoppingViewController.swift */; };
+		A77F2CB52232010F001BD3F6 /* ShoppingMallViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A77F2CA72232010F001BD3F6 /* ShoppingMallViewController.swift */; };
 		A77F2CB62232010F001BD3F6 /* MineViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A77F2CAC2232010F001BD3F6 /* MineViewController.xib */; };
 		A77F2CB72232010F001BD3F6 /* MineViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A77F2CAD2232010F001BD3F6 /* MineViewController.swift */; };
 		A77F2CB82232010F001BD3F6 /* ShoppingCartViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A77F2CB22232010F001BD3F6 /* ShoppingCartViewController.xib */; };
@@ -251,6 +255,11 @@
 		A72A738C2233B2DE00B21995 /* RealmUtility.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RealmUtility.swift; sourceTree = "<group>"; };
 		A72A73902233B55400B21995 /* Dog.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = "<group>"; };
 		A72A73922233BFCD00B21995 /* SwiftMoyaNetWorkCacheModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftMoyaNetWorkCacheModel.swift; sourceTree = "<group>"; };
+		A775CBFD2237493600EBDCF8 /* ShoppingMallNavigationBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingMallNavigationBarView.swift; sourceTree = "<group>"; };
+		A775CBFF223774A300EBDCF8 /* ShoppingMallView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingMallView.swift; sourceTree = "<group>"; };
+		A775CC0222377C6500EBDCF8 /* EmptyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyView.swift; sourceTree = "<group>"; };
+		A775CC04223798F000EBDCF8 /* ShoppingMallCategoryCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingMallCategoryCollectionViewCell.swift; sourceTree = "<group>"; };
+		A775CC062237A69D00EBDCF8 /* ShoppingMallHeaderCollectionReusableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingMallHeaderCollectionReusableView.swift; sourceTree = "<group>"; };
 		A77F2C5D2231FB49001BD3F6 /* RainbowPlanet.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RainbowPlanet.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		A77F2C602231FB49001BD3F6 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
 		A77F2C672231FB4A001BD3F6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
@@ -265,8 +274,7 @@
 		A77F2C9B2231FDCF001BD3F6 /* BaseView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseView.swift; sourceTree = "<group>"; };
 		A77F2C9D2231FDDC001BD3F6 /* BaseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseViewController.swift; sourceTree = "<group>"; };
 		A77F2C9F2231FE45001BD3F6 /* BaseWebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseWebViewController.swift; sourceTree = "<group>"; };
-		A77F2CA62232010F001BD3F6 /* ShoppingViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ShoppingViewController.xib; sourceTree = "<group>"; };
-		A77F2CA72232010F001BD3F6 /* ShoppingViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShoppingViewController.swift; sourceTree = "<group>"; };
+		A77F2CA72232010F001BD3F6 /* ShoppingMallViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShoppingMallViewController.swift; sourceTree = "<group>"; };
 		A77F2CAC2232010F001BD3F6 /* MineViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MineViewController.xib; sourceTree = "<group>"; };
 		A77F2CAD2232010F001BD3F6 /* MineViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MineViewController.swift; sourceTree = "<group>"; };
 		A77F2CB22232010F001BD3F6 /* ShoppingCartViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ShoppingCartViewController.xib; sourceTree = "<group>"; };
@@ -655,6 +663,25 @@
 			path = RealmUtility;
 			sourceTree = "<group>";
 		};
+		A775CBFC2237483E00EBDCF8 /* View */ = {
+			isa = PBXGroup;
+			children = (
+				A775CBFD2237493600EBDCF8 /* ShoppingMallNavigationBarView.swift */,
+				A775CBFF223774A300EBDCF8 /* ShoppingMallView.swift */,
+				A775CC04223798F000EBDCF8 /* ShoppingMallCategoryCollectionViewCell.swift */,
+				A775CC062237A69D00EBDCF8 /* ShoppingMallHeaderCollectionReusableView.swift */,
+			);
+			path = View;
+			sourceTree = "<group>";
+		};
+		A775CC0122377AB700EBDCF8 /* EmptyView */ = {
+			isa = PBXGroup;
+			children = (
+				A775CC0222377C6500EBDCF8 /* EmptyView.swift */,
+			);
+			path = EmptyView;
+			sourceTree = "<group>";
+		};
 		A77F2C542231FB49001BD3F6 = {
 			isa = PBXGroup;
 			children = (
@@ -781,8 +808,8 @@
 		A77F2CA22232010F001BD3F6 /* Modules */ = {
 			isa = PBXGroup;
 			children = (
-				A77F2CA82232010F001BD3F6 /* CommonModule */,
 				A77F2CA32232010F001BD3F6 /* ShoppingMallModule */,
+				A77F2CA82232010F001BD3F6 /* CommonModule */,
 				A77F2CAE2232010F001BD3F6 /* RegisterLoginModule */,
 				A77F2CAF2232010F001BD3F6 /* ShoppingCartModule */,
 				A77F2CA92232010F001BD3F6 /* MineModule */,
@@ -801,6 +828,7 @@
 		A77F2CA42232010F001BD3F6 /* ShoppingMall */ = {
 			isa = PBXGroup;
 			children = (
+				A775CBFC2237483E00EBDCF8 /* View */,
 				A77F2CA52232010F001BD3F6 /* ViewController */,
 			);
 			path = ShoppingMall;
@@ -809,8 +837,7 @@
 		A77F2CA52232010F001BD3F6 /* ViewController */ = {
 			isa = PBXGroup;
 			children = (
-				A77F2CA72232010F001BD3F6 /* ShoppingViewController.swift */,
-				A77F2CA62232010F001BD3F6 /* ShoppingViewController.xib */,
+				A77F2CA72232010F001BD3F6 /* ShoppingMallViewController.swift */,
 			);
 			path = ViewController;
 			sourceTree = "<group>";
@@ -892,6 +919,7 @@
 		A77F2CBC2232022A001BD3F6 /* Tools */ = {
 			isa = PBXGroup;
 			children = (
+				A775CC0122377AB700EBDCF8 /* EmptyView */,
 				A72A73892233B2DE00B21995 /* RealmUtility */,
 				A72A728422321DE000B21995 /* AlertView */,
 				A72A727D22321DDF00B21995 /* AppInfo */,
@@ -1066,7 +1094,6 @@
 				A72A73532233541100B21995 /* TYRZResource.bundle in Resources */,
 				A72A73522233541100B21995 /* uni_account_login_sdk_res.bundle in Resources */,
 				A77F2C682231FB4A001BD3F6 /* Assets.xcassets in Resources */,
-				A77F2CB42232010F001BD3F6 /* ShoppingViewController.xib in Resources */,
 				A72A73562233541100B21995 /* HTMLResource.bundle in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -1149,6 +1176,7 @@
 				"${BUILT_PRODUCTS_DIR}/FBRetainCycleDetector/FBRetainCycleDetector.framework",
 				"${BUILT_PRODUCTS_DIR}/IQKeyboardManagerSwift/IQKeyboardManagerSwift.framework",
 				"${BUILT_PRODUCTS_DIR}/Kingfisher/Kingfisher.framework",
+				"${BUILT_PRODUCTS_DIR}/LYEmptyView/LYEmptyView.framework",
 				"${BUILT_PRODUCTS_DIR}/MBProgressHUD/MBProgressHUD.framework",
 				"${BUILT_PRODUCTS_DIR}/MJRefresh/MJRefresh.framework",
 				"${BUILT_PRODUCTS_DIR}/MLeaksFinder/MLeaksFinder.framework",
@@ -1162,7 +1190,6 @@
 				"${BUILT_PRODUCTS_DIR}/RxSwift/RxSwift.framework",
 				"${BUILT_PRODUCTS_DIR}/SnapKit/SnapKit.framework",
 				"${BUILT_PRODUCTS_DIR}/SwiftyJSON/SwiftyJSON.framework",
-				"${BUILT_PRODUCTS_DIR}/TangramKit/TangramKit.framework",
 			);
 			name = "[CP] Embed Pods Frameworks";
 			outputFileListPaths = (
@@ -1174,6 +1201,7 @@
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBRetainCycleDetector.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/IQKeyboardManagerSwift.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Kingfisher.framework",
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/LYEmptyView.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MBProgressHUD.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MJRefresh.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MLeaksFinder.framework",
@@ -1187,7 +1215,6 @@
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxSwift.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SnapKit.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyJSON.framework",
-				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TangramKit.framework",
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
@@ -1271,7 +1298,7 @@
 				A72A72A222321DE000B21995 /* LBXScanNetAnimation.swift in Sources */,
 				A72A72D322321E2700B21995 /* CacheMacro.swift in Sources */,
 				A72A72A422321DE000B21995 /* LBXScanViewController.swift in Sources */,
-				A77F2CB52232010F001BD3F6 /* ShoppingViewController.swift in Sources */,
+				A77F2CB52232010F001BD3F6 /* ShoppingMallViewController.swift in Sources */,
 				A77F2CC3223203BA001BD3F6 /* AppDelegate+Window.swift in Sources */,
 				A72A72B022321DE000B21995 /* CGView.swift in Sources */,
 				A72A73142232475E00B21995 /* AlipayManager.swift in Sources */,
@@ -1279,18 +1306,22 @@
 				A72A726622321DBD00B21995 /* BaiduMapManager.swift in Sources */,
 				A72A737E2233966800B21995 /* RootInfoModel.swift in Sources */,
 				A72A7333223256E100B21995 /* PayManager.swift in Sources */,
+				A775CC00223774A300EBDCF8 /* ShoppingMallView.swift in Sources */,
 				A72A738F2233B2DE00B21995 /* RealmUtility.swift in Sources */,
 				A72A72D622321E2700B21995 /* ThirdPartyMacro.swift in Sources */,
 				A72A72A622321DE000B21995 /* LBXScanViewStyle.swift in Sources */,
 				A72A72B422321DE000B21995 /* Extension+UIImage.swift in Sources */,
 				A72A72AF22321DE000B21995 /* AppInfo.swift in Sources */,
+				A775CC072237A69D00EBDCF8 /* ShoppingMallHeaderCollectionReusableView.swift in Sources */,
 				A72A72D422321E2700B21995 /* EnumMacro.swift in Sources */,
+				A775CC0322377C6500EBDCF8 /* EmptyView.swift in Sources */,
 				A72A72B322321DE000B21995 /* UIAlertController+BAKit.m in Sources */,
 				A72A72A922321DE000B21995 /* NumberKeyboard.swift in Sources */,
 				A72A72AA22321DE000B21995 /* Log.swift in Sources */,
 				A72A72B622321DE000B21995 /* Extension+NSRange.swift in Sources */,
 				A72A72A722321DE000B21995 /* LBXPermissions.swift in Sources */,
 				A72A72AE22321DE000B21995 /* CountdownButton.swift in Sources */,
+				A775CC05223798F000EBDCF8 /* ShoppingMallCategoryCollectionViewCell.swift in Sources */,
 				A77F2CB72232010F001BD3F6 /* MineViewController.swift in Sources */,
 				A72A7385223396CB00B21995 /* SwiftMoyaNetWorkService.swift in Sources */,
 				A72A7346223350ED00B21995 /* ShanYanManager.swift in Sources */,
@@ -1306,6 +1337,7 @@
 				A72A72C322321DE000B21995 /* Extension+Date.swift in Sources */,
 				A72A72B222321DE000B21995 /* NSObject+BARunTime.m in Sources */,
 				A72A73912233B55400B21995 /* Dog.swift in Sources */,
+				A775CBFE2237493600EBDCF8 /* ShoppingMallNavigationBarView.swift in Sources */,
 				A72A72C622321DE000B21995 /* WebView.swift in Sources */,
 				A72A72D122321E2700B21995 /* HTMLURLMacro.swift in Sources */,
 				A72A73162232481600B21995 /* WeChatpayManager.swift in Sources */,

+ 2 - 1
RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate+Window.swift

@@ -36,11 +36,12 @@ extension AppDelegate {
 
      /// 设置全局的navigation
     func setNavBarAppearence() {
-        WRNavigationBar.defaultStatusBarStyle = .lightContent
+        WRNavigationBar.defaultStatusBarStyle = .default
     }
 
     ///设置全局的Tabbar
     func setTabbarAppearence() {
+        UITabBar.appearance().isTranslucent = false
         UITabBar.appearance().backgroundImage = UIImage();
         UITabBar.appearance().backgroundColor = UIColor.white
         UITabBar.appearance().shadowImage = UIImage(named: "tab_top_line")

+ 18 - 6
RainbowPlanet/RainbowPlanet/Base/BaseView/BaseView.swift

@@ -7,15 +7,27 @@
 //
 
 import UIKit
+import RxSwift
 
 class BaseView: UIView {
 
-    /*
-    // Only override draw() if you perform custom drawing.
-    // An empty implementation adversely affects performance during animation.
-    override func draw(_ rect: CGRect) {
-        // Drawing code
+    let disposeBag = DisposeBag()
+
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+        self.setupViews()
+        self.setupLayouts()
+    }
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+
+    func setupViews() {
+        backgroundColor = UIColor.white
+    }
+
+    func setupLayouts() {
+
     }
-    */
 
 }

+ 3 - 1
RainbowPlanet/RainbowPlanet/Base/BaseViewController/BaseViewController.swift

@@ -24,6 +24,7 @@ class BaseViewController: UIViewController {
                 self.automaticallyAdjustsScrollViewInsets = true
             }
         }
+        view.backgroundColor = kf7f7f9Color
         setupNavigationBar()
     }
 
@@ -43,7 +44,8 @@ class BaseViewController: UIViewController {
         navigationController?.popViewController(animated: true)
     }
 
-    func setupViews() {}
+    func setupViews() {
+    }
 
     func setupLayouts() {}
 

+ 2 - 0
RainbowPlanet/RainbowPlanet/Define/ColorMacro.swift

@@ -46,6 +46,8 @@ let kf82323Color = UIColor(hexString: "f82323")
 
 let kf1f1f1Color = UIColor(hexString: "f1f1f1")
 
+let kf7f7f9Color = UIColor(hexString: "f7f7f9")
+
 let kf2f2f2Color = UIColor(hexString: "f2f2f2")
 
 let kf3f3f3Color = UIColor(hexString: "f3f3f3")

+ 3 - 0
RainbowPlanet/RainbowPlanet/Define/RainbowPlanet-Bridging-Header.h

@@ -20,6 +20,9 @@
 //闪验
 #import <CL_ShanYanSDK/CL_ShanYanSDK.h>
 
+//空白页面占位图
+#import <LYEmptyView/LYEmptyViewHeader.h>
+
 //友盟
 #import <UMCommon/UMCommon.h>
 #import <UMPush/UMessage.h>

+ 101 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallCategoryCollectionViewCell.swift

@@ -0,0 +1,101 @@
+//
+//  ShoppingMallCategoryCollectionViewCell.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/3/12.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import UIKit
+
+class ShoppingMallCategoryCollectionViewCell: UICollectionViewCell {
+    class func cellWith(collectionView:UICollectionView,indexPath:IndexPath) -> ShoppingMallCategoryCollectionViewCell {
+        let ID = "ShoppingMallCategoryCollectionViewCell"
+        collectionView.register(ShoppingMallCategoryCollectionViewCell.self, forCellWithReuseIdentifier: ID)
+        let cell : ShoppingMallCategoryCollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: ID, for: indexPath) as! ShoppingMallCategoryCollectionViewCell
+        cell.indexPath = indexPath
+        return cell
+    }
+    //MARK: - indexPath
+    var indexPath: IndexPath?{
+        didSet {
+
+        }
+    }
+    //MARK: - 初始化
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+        setupViews()
+        setupLayouts()
+    }
+
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+
+    //MARK: - 设置view
+    private func setupViews() {
+        addSubview(titleLabel)
+        addSubview(underLineLabel)
+    }
+
+    private func setupLayouts() {
+
+        titleLabel.snp.makeConstraints { (make) in
+            make.edges.equalToSuperview()
+        }
+
+        underLineLabel.snp.makeConstraints { (make) in
+            make.left.right.equalTo(titleLabel)
+            make.bottom.equalToSuperview()
+            make.height.equalTo(2)
+        }
+    }
+
+    private lazy var titleLabel: UILabel = {
+        let titleLabel = UILabel()
+        titleLabel.textColor = UIColor.black
+        titleLabel.highlightedTextColor = UIColor.green
+        titleLabel.textAlignment = .center
+        titleLabel.font = kBoldFont15
+        titleLabel.isHighlighted = false
+        return titleLabel
+    }()
+
+    private lazy var underLineLabel: UILabel = {
+        let underLineLabel = UILabel()
+        underLineLabel.backgroundColor = UIColor.green
+        underLineLabel.textAlignment = .center
+
+        underLineLabel.isHidden = true
+        return underLineLabel
+    }()
+
+    var categoryArray: Array<String>? {
+        didSet {
+            titleLabel.text = categoryArray![(indexPath?.row)!]
+        }
+    }
+
+    override var isSelected: Bool {
+        didSet {
+            isHighlighted = isSelected
+            if isHighlighted {
+                titleLabel.font = kBoldFont15
+            }else {
+                titleLabel.font = kBoldFont15
+            }
+            titleLabel.isHighlighted = isSelected
+            underLineLabel.isHidden = !isSelected
+
+            titleLabel.snp.updateConstraints { (make) in
+                make.edges.equalToSuperview()
+            }
+            underLineLabel.snp.updateConstraints { (make) in
+                make.left.right.equalTo(titleLabel)
+                make.bottom.equalToSuperview()
+                make.height.equalTo(2)
+            }
+        }
+    }
+}

+ 60 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallHeaderCollectionReusableView.swift

@@ -0,0 +1,60 @@
+//
+//  ShoppingMallHeaderCollectionReusableView.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/3/12.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import UIKit
+
+class ShoppingMallHeaderCollectionReusableView: UICollectionReusableView {
+    class func headerWith(collectionView:UICollectionView,kind: String,indexPath: IndexPath) -> ShoppingMallHeaderCollectionReusableView {
+        let ID = "ShoppingMallHeaderCollectionReusableView"
+        collectionView.register(ShoppingMallHeaderCollectionReusableView.self, forSupplementaryViewOfKind: kind, withReuseIdentifier: ID)
+        let headerView : ShoppingMallHeaderCollectionReusableView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: ID, for: indexPath) as! ShoppingMallHeaderCollectionReusableView
+        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() {
+        addSubview(titleLabel)
+    }
+
+    private func setupLayouts() {
+        titleLabel.snp.makeConstraints { (make) in
+            make.edges.equalToSuperview()
+        }
+    }
+
+    private lazy var titleLabel: UILabel = {
+        let titleLabel = UILabel()
+        titleLabel.backgroundColor = UIColor.cyan
+        titleLabel.textColor = UIColor.green
+        titleLabel.textAlignment = .center
+        titleLabel.font = kRegularFont13
+        return titleLabel
+    }()
+
+    var categoryArray: Array<String>? {
+        didSet {
+            titleLabel.text = categoryArray![(indexPath?.row)!]
+        }
+    }
+}

+ 177 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallNavigationBarView.swift

@@ -0,0 +1,177 @@
+//
+//  ShoppingMallNavigationBarView.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/3/12.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import UIKit
+import RxSwift
+import RxCocoa
+class ShoppingMallNavigationBarView: BaseView {
+
+
+    /// 头像
+    typealias AvatarActionBlock = () -> Void
+    var avatarActionBlock : AvatarActionBlock?
+
+    /// 地址
+    typealias AddressActionBlock = () -> Void
+    var addressActionBlock : AddressActionBlock?
+
+    /// 搜索
+    typealias SearchActionBlock = () -> Void
+    var searchActionBlock : SearchActionBlock?
+
+    /// 搜索
+    typealias MessageActionBlock = () -> Void
+    var messageActionBlock : MessageActionBlock?
+
+
+    override func setupViews() {
+        backgroundColor = .white
+        addSubview(avatarButton)
+        addSubview(addressButton)
+        addressButton.addSubview(addressLabel)
+        addressButton.addSubview(goImageView)
+        addSubview(searchButton)
+        addSubview(messageButton)
+        searchButton.addSubview(searchIconImageView)
+        searchButton.addSubview(searchTitleLabel)
+
+    }
+
+    override func setupLayouts() {
+        avatarButton.snp.makeConstraints { (make) in
+            make.top.equalToSuperview().offset(kStatusBarHeight)
+            make.leading.equalToSuperview().offset(10)
+            make.size.equalTo(20)
+        }
+        addressButton.snp.makeConstraints { (make) in
+            make.top.bottom.equalTo(avatarButton)
+            make.left.equalTo(avatarButton.snp.right).offset(5)
+            make.right.equalToSuperview()
+        }
+        addressLabel.snp.makeConstraints { (make) in
+            make.centerY.equalToSuperview()
+            make.left.equalToSuperview()
+            make.width.lessThanOrEqualTo(kScreenWidth-65)
+        }
+        goImageView.snp.makeConstraints { (make) in
+            make.left.equalTo(addressLabel.snp.right).offset(5)
+            make.centerY.equalToSuperview()
+            make.size.equalTo(15)
+        }
+        searchButton.snp.makeConstraints { (make) in
+            make.left.equalTo(avatarButton)
+            make.bottom.equalToSuperview().offset(-2)
+            make.width.equalTo(kScreenWidth-45)
+            make.top.equalTo(goImageView.snp.bottom).offset(2)
+        }
+
+        searchIconImageView.snp.makeConstraints { (make) in
+            make.left.equalToSuperview().offset(10)
+            make.size.equalTo(10)
+            make.centerY.equalToSuperview()
+        }
+
+        searchTitleLabel.snp.makeConstraints { (make) in
+            make.left.equalTo(searchIconImageView.snp.right).offset(5)
+            make.right.equalToSuperview().offset(-5)
+            make.centerY.equalToSuperview()
+        }
+
+        messageButton.snp.makeConstraints { (make) in
+            make.right.equalToSuperview().offset(-10)
+            make.centerY.equalTo(searchButton)
+            make.size.equalTo(15)
+        }
+
+
+    }
+
+    private lazy var avatarButton: UIButton = {
+        let avatarButton = UIButton(type: .custom)
+        avatarButton.setImage(kImage(name: "shop"), for: UIControl.State.normal)
+        avatarButton.rx.tap.subscribe(onNext: {
+            [weak self] in
+            if let avatarActionBlock = self?.avatarActionBlock {
+                avatarActionBlock()
+            }
+        }).disposed(by: disposeBag)
+        return avatarButton
+    }()
+
+    private lazy var addressButton: UIButton = {
+        let addressButton = UIButton(type: .custom)
+        addressButton.rx.tap.subscribe(onNext: {
+            [weak self] in
+            if let addressActionBlock = self?.addressActionBlock {
+                addressActionBlock()
+            }
+        }).disposed(by: disposeBag)
+        return addressButton
+    }()
+
+    private lazy var addressLabel: UILabel = {
+        let addressLabel = UILabel()
+        addressLabel.textColor = UIColor.black
+        addressLabel.font = kMediumFont14
+        addressLabel.lineBreakMode = .byTruncatingTail
+        addressLabel.numberOfLines = 1
+        addressLabel.text = "正在定位"
+        BaiduMapManager.getSharedInstance().initLocation { (locationModel) in
+            addressLabel.text = locationModel.toString()
+        }
+        return addressLabel
+    }()
+
+    private lazy var goImageView: UIImageView = {
+        let goImageView = UIImageView(image: kImage(name: "shop"))
+        return goImageView
+    }()
+
+    private lazy var messageButton: UIButton = {
+        let messageButton = UIButton(type: .custom)
+        messageButton.setImage(kImage(name: "shop"), for: UIControl.State.normal)
+        messageButton.rx.tap.subscribe(onNext: {
+            [weak self] in
+            if let messageActionBlock = self?.messageActionBlock {
+                messageActionBlock()
+            }
+        }).disposed(by: disposeBag)
+        return messageButton
+    }()
+
+    private lazy var searchButton: UIButton = {
+        let searchButton = UIButton(type: .custom)
+        searchButton.layer.borderColor = UIColor.lightGray.cgColor
+        searchButton.layer.borderWidth = 1
+        searchButton.layer.cornerRadius = 12
+        searchButton.layer.masksToBounds = true
+        searchButton.rx.tap.subscribe(onNext: {
+            [weak self] in
+            if let searchActionBlock = self?.searchActionBlock {
+                searchActionBlock()
+            }
+        }).disposed(by: disposeBag)
+        return searchButton
+    }()
+
+    private lazy var searchIconImageView: UIImageView = {
+        let searchIconImageView = UIImageView(image: kImage(name: "navigaitionbar_back_blue"))
+        return searchIconImageView
+    }()
+
+    private lazy var searchTitleLabel: UILabel = {
+        let searchTitleLabel = UILabel()
+        searchTitleLabel.textColor = UIColor.black
+        searchTitleLabel.font = kMediumFont14
+        searchTitleLabel.lineBreakMode = .byTruncatingTail
+        searchTitleLabel.numberOfLines = 1
+        searchTitleLabel.text = "搜索商品"
+        return searchTitleLabel
+    }()
+
+}

+ 221 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallView.swift

@@ -0,0 +1,221 @@
+//
+//  ShoppingMallView.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/3/12.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import UIKit
+
+class ShoppingMallView: BaseView {
+
+
+    typealias CategoryActionBlock = () -> Void
+    var categoryActionBlock : CategoryActionBlock?
+
+    let categoryArray = ["今日爆款","限量秒杀","萌娃专区萌娃专区","乳饮烘焙","新鲜水果","海鲜水产","方便食品","生活服务","休息食品","美妆日化","家用电器","萌娃专区萌娃专区","乳饮烘焙","新鲜水果","海鲜水产","方便食品","生活服务","休息食品","美妆日化","家用电器"]
+
+    fileprivate var selectIndex = 0
+    fileprivate var isScrollDown = true
+    fileprivate var lastOffsetY : CGFloat = 0.0
+
+    override func setupViews() {
+        super.setupViews()
+        addSubview(categoryButton)
+        addSubview(categorycollectionView)
+        addSubview(allCollectionView)
+
+    }
+
+    override func setupLayouts() {
+        categoryButton.snp.makeConstraints { (make) in
+            make.top.equalToSuperview().offset(2)
+            make.right.equalToSuperview().offset(-10)
+            make.size.equalTo(30)
+        }
+        categorycollectionView.snp.makeConstraints { (make) in
+            make.top.equalToSuperview().offset(2)
+            make.right.equalTo(categoryButton.snp.left)
+            make.left.equalToSuperview().offset(10)
+            make.height.equalTo(30)
+        }
+        allCollectionView.snp.makeConstraints { (make) in
+            make.top.equalTo(categorycollectionView.snp.bottom)
+            make.left.right.bottom.equalToSuperview()
+        }
+        categorycollectionView.selectItem(at: IndexPath(item: 0, section: 0), animated: false, scrollPosition: UICollectionView.ScrollPosition.top)
+
+    }
+
+    private lazy var categoryButton: UIButton = {
+        let categoryButton = UIButton(type: UIButton.ButtonType.custom)
+        categoryButton.setImage(kImage(name: "shop"), for: UIControl.State.normal)
+        categoryButton.rx.tap.subscribe(onNext: {
+            [weak self] in
+            if let categoryActionBlock = self?.categoryActionBlock {
+                categoryActionBlock()
+            }
+        }).disposed(by: disposeBag)
+        return categoryButton
+    }()
+
+    private lazy var categorycollectionView: UICollectionView = {
+        let categorycollectionView = UICollectionView.init(frame: CGRect.zero, collectionViewLayout: categoryCollectionViewLayout)
+        categorycollectionView.backgroundColor = UIColor.white;
+        categorycollectionView.showsVerticalScrollIndicator = false
+        categorycollectionView.showsHorizontalScrollIndicator = false
+        categorycollectionView.delegate = self;
+        categorycollectionView.dataSource = self;
+        return categorycollectionView
+    }()
+
+    private lazy var categoryCollectionViewLayout: UICollectionViewFlowLayout = {
+        let categoryCollectionViewLayout = UICollectionViewFlowLayout.init()
+        categoryCollectionViewLayout.scrollDirection = UICollectionView.ScrollDirection.horizontal
+        categoryCollectionViewLayout.estimatedItemSize = CGSize(width: (kScreenWidth-50)/5, height:30)
+        return categoryCollectionViewLayout
+    }()
+
+    private lazy var allCollectionView: UICollectionView = {
+        let allCollectionView = UICollectionView.init(frame: CGRect.zero, collectionViewLayout: allCollectionViewLayout)
+        allCollectionView.backgroundColor = UIColor.white;
+        allCollectionView.delegate = self;
+        allCollectionView.dataSource = self;
+        return allCollectionView
+    }()
+
+    private lazy var allCollectionViewLayout: UICollectionViewFlowLayout = {
+        let allCollectionViewLayout = UICollectionViewFlowLayout.init()
+        allCollectionViewLayout.scrollDirection = UICollectionView.ScrollDirection.vertical
+        //分组头悬停
+        allCollectionViewLayout.sectionHeadersPinToVisibleBounds = true
+        allCollectionViewLayout.itemSize = CGSize(width: kScreenWidth, height:30)
+        return allCollectionViewLayout
+    }()
+
+}
+
+extension ShoppingMallView : UICollectionViewDelegateFlowLayout,UICollectionViewDataSource {
+    func numberOfSections(in collectionView: UICollectionView) -> Int {
+        if collectionView == categorycollectionView {
+            return 1
+        }else {
+            return categoryArray.count
+        }
+    }
+    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+
+        if collectionView == categorycollectionView {
+            return categoryArray.count
+        }else {
+            return categoryArray.count
+        }
+    }
+
+    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+        if collectionView == categorycollectionView {
+            let cell = ShoppingMallCategoryCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
+            cell.categoryArray = categoryArray
+            return cell
+        }else {
+            let cell = ShoppingMallCategoryCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
+            cell.categoryArray = categoryArray
+            return cell
+        }
+    }
+
+    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
+        if collectionView == categorycollectionView {
+            selectIndex = indexPath.row
+             //右侧collection自动滚动到对应的分区
+            collectionViewScrollToTop(section: selectIndex, animated: true)
+             //左侧tableView将该单元格滚动到顶部
+            categorycollectionView.scrollToItem(at: IndexPath(row: selectIndex, section: 0), at: .centeredHorizontally, animated: true)
+        }
+    }
+
+    //将右侧colletionView的指定分区自动滚动到最顶端
+    func collectionViewScrollToTop(section: Int, animated: Bool) {
+        let headerRect = collectionViewHeaderFrame(section: section)
+        let topOfHeader = CGPoint(x: 0, y: headerRect.origin.y
+            - allCollectionView.contentInset.top)
+        allCollectionView.setContentOffset(topOfHeader, animated: animated)
+    }
+
+    //后获colletionView的指定分区头的高度
+    func collectionViewHeaderFrame(section: Int) -> CGRect {
+        let indexPath = IndexPath(item: 0, section: section)
+        let attributes = allCollectionView.collectionViewLayout
+            .layoutAttributesForSupplementaryView(ofKind:
+                UICollectionView.elementKindSectionHeader, at: indexPath)
+        guard let frameForFirstCell = attributes?.frame else {
+            return .zero
+        }
+        return frameForFirstCell;
+    }
+
+
+    func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
+        if collectionView == categorycollectionView {
+            let shoppingMallHeaderCollectionReusableView = ShoppingMallHeaderCollectionReusableView.headerWith(collectionView: collectionView, kind: UICollectionView.elementKindSectionHeader, indexPath: indexPath)
+            shoppingMallHeaderCollectionReusableView.categoryArray = categoryArray
+            return shoppingMallHeaderCollectionReusableView
+        }else {
+            if kind == UICollectionView.elementKindSectionHeader {
+                let shoppingMallHeaderCollectionReusableView = ShoppingMallHeaderCollectionReusableView.headerWith(collectionView: collectionView, kind: UICollectionView.elementKindSectionHeader, indexPath: indexPath)
+                shoppingMallHeaderCollectionReusableView.categoryArray = categoryArray
+                return shoppingMallHeaderCollectionReusableView
+            }else {
+                return UICollectionReusableView()
+            }
+        }
+
+    }
+
+    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
+        if collectionView == categorycollectionView {
+            return CGSize(width: 0, height: 0)
+        }else {
+            return CGSize(width: kScreenWidth, height: 30)
+        }
+    }
+
+    // CollectionView 分区标题即将展示
+    func collectionView(_ collectionView: UICollectionView, willDisplaySupplementaryView view: UICollectionReusableView, forElementKind elementKind: String, at indexPath: IndexPath) {
+        // 当前 CollectionView 滚动的方向向上,CollectionView 是用户拖拽而产生滚动的(主要是判断 CollectionView 是用户拖拽而滚动的,还是点击 TableView 而滚动的)
+        if collectionView == allCollectionView {
+            if !isScrollDown && (collectionView.isDragging || collectionView.isDecelerating) {
+                selectRow(index: indexPath.section)
+            }
+        }
+    }
+
+    //分区头即将要消失时调用
+    func collectionView(_ collectionView: UICollectionView,
+                        didEndDisplayingSupplementaryView view: UICollectionReusableView,
+                        forElementOfKind elementKind: String, at indexPath: IndexPath) {
+        //如果是由用户手动滑动屏幕造成的向下滚动,那么左侧表格自动选中该分区对应的下一个分区的分类
+        if collectionView == allCollectionView {
+            if isScrollDown && (collectionView.isDragging || collectionView.isDecelerating) {
+                selectRow(index: indexPath.section + 1)
+            }
+        }
+    }
+
+
+    // 当拖动 CollectionView 的时候,处理 categorycollectionView
+    private func selectRow(index : Int) {
+        categorycollectionView.selectItem(at: IndexPath(row: index, section: 0), animated: true, scrollPosition: UICollectionView.ScrollPosition.centeredHorizontally)
+
+    }
+
+     // 标记一下 CollectionView 的滚动方向,是向上还是向下
+    func scrollViewDidScroll(_ scrollView: UIScrollView) {
+
+        if allCollectionView == scrollView {
+            isScrollDown = lastOffsetY < scrollView.contentOffset.y
+            lastOffsetY = scrollView.contentOffset.y
+        }
+    }
+}

+ 77 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/ViewController/ShoppingMallViewController.swift

@@ -0,0 +1,77 @@
+//
+//  ShoppingMallViewController.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/3/7.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import UIKit
+
+class ShoppingMallViewController: BaseViewController {
+
+    override func viewWillAppear(_ animated: Bool) {
+        super.viewWillAppear(animated)
+        MobClick.beginLogPageView("ShoppingMallViewController:商城页面")
+    }
+
+    override func viewWillDisappear(_ animated: Bool) {
+        super.viewWillDisappear(animated)
+        MobClick.endLogPageView("ShoppingMallViewController:商城页面")
+    }
+
+
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        setupViews()
+        setupLayouts()
+    }
+
+    override func setupViews() {
+        super.setupViews()
+        navigationBar.addSubview(navigationBarView)
+        view.addSubview(shoppingMallView)
+    }
+
+    override func setupLayouts() {
+        navigationBarView.snp.makeConstraints { (make) in
+            make.edges.equalToSuperview()
+        }
+        shoppingMallView.snp.makeConstraints { (make) in
+            make.bottom.left.right.equalToSuperview()
+            make.top.equalTo(navigationBarView.snp.bottom)
+        }
+    }
+
+    private lazy var navigationBarView: ShoppingMallNavigationBarView = {
+        let navigationBarView = ShoppingMallNavigationBarView()
+        /// 头像
+        navigationBarView.avatarActionBlock = {
+            
+        }
+        /// 地址
+        navigationBarView.addressActionBlock = {
+
+        }
+        /// 搜索列表
+        navigationBarView.searchActionBlock = {
+
+        }
+        /// 消息
+        navigationBarView.messageActionBlock = {
+
+        }
+        return navigationBarView
+    }()
+
+    private lazy var shoppingMallView: ShoppingMallView = {
+         let shoppingMallView = ShoppingMallView()
+        /// 分类
+        shoppingMallView.categoryActionBlock = {
+
+        }
+        return shoppingMallView
+    }()
+
+}
+

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 86
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/ViewController/ShoppingViewController.swift


+ 0 - 22
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/ViewController/ShoppingViewController.xib

@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
-    <dependencies>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
-        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <objects>
-        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ShoppingMallViewController" customModuleProvider="target">
-            <connections>
-                <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
-            </connections>
-        </placeholder>
-        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
-        <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
-            <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
-            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-            <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-            <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
-        </view>
-    </objects>
-</document>

+ 6 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/empty_image/Contents.json

@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

+ 21 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/empty_image/empty_jd.imageset/Contents.json

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

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/empty_image/empty_jd.imageset/empty_jd@2x.png


+ 21 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/empty_image/empty_nodata.imageset/Contents.json

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

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/empty_image/empty_nodata.imageset/empty_nodata@2x.png


+ 21 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/empty_image/empty_nonetwork.imageset/Contents.json

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

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/empty_image/empty_nonetwork.imageset/empty_nonetwork@2x.png


+ 37 - 0
RainbowPlanet/RainbowPlanet/Tools/EmptyView/EmptyView.swift

@@ -0,0 +1,37 @@
+//
+//  EmptyView.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/3/12.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import UIKit
+
+class EmptyView: LYEmptyView {
+
+    class func diyEmptyViewStyle1() -> LYEmptyView {
+       return EmptyView.empty(withImageStr: "empty_nodata", titleStr: "暂无数据", detailStr: "")
+    }
+
+    class func diyEmptyViewStyle2(tapContentViewBlock:@escaping LYActionTapBlock) -> LYEmptyView {
+        let emptyView = EmptyView.empty(withImageStr: "empty_nodata", titleStr: "暂无数据,点击重新加载", detailStr: "")
+        emptyView?.tapContentViewBlock = {
+            tapContentViewBlock()
+        }
+        return emptyView!
+    }
+
+    class func diyEmptyViewStyle3(tapContentViewBlock:@escaping LYActionTapBlock) -> LYEmptyView {
+        let emptyView = EmptyView.empty(with: kImage(name: "empty_nodata"), titleStr: "暂无数据", detailStr: "")
+        return emptyView!
+    }
+
+    class func diyEmptyViewStyle4(tapContentViewBlock:@escaping LYActionTapBlock) -> LYEmptyView {
+        let emptyView = EmptyView.empty(with: kImage(name: "empty_nodata"), titleStr: "暂无数据,点击重新加载", detailStr: "")
+        emptyView?.tapContentViewBlock = {
+            tapContentViewBlock()
+        }
+        return emptyView!
+    }
+}