Browse Source

no message

nanxinlin 6 years ago
parent
commit
539e08bf7f
100 changed files with 3770 additions and 953 deletions
  1. 16 28
      RainbowPlanet/Podfile
  2. 29 5
      RainbowPlanet/Podfile.lock
  3. 741 619
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  4. 21 0
      RainbowPlanet/RainbowPlanet/AppDelegate/APPDelegate+Bugly.swift
  5. 19 0
      RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate+BaiduMap.swift
  6. 1 10
      RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate+IQKeyboardManagerSwift.swift
  7. 198 0
      RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate+UM.swift
  8. 17 17
      RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate+Window.swift
  9. 15 7
      RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate.swift
  10. 0 30
      RainbowPlanet/RainbowPlanet/Base/RootNavigationController/RootNavigationController.swift
  11. 89 0
      RainbowPlanet/RainbowPlanet/Base/RootNavigationViewController/RootNavigationController.swift
  12. 0 54
      RainbowPlanet/RainbowPlanet/Base/RootTabbarController/RootTabbarController.swift
  13. 52 0
      RainbowPlanet/RainbowPlanet/Base/RootTabbarController/RootTabbarViewController.swift
  14. 24 10
      RainbowPlanet/RainbowPlanet/Base/RootView/RootView.swift
  15. 122 12
      RainbowPlanet/RainbowPlanet/Base/RootViewController/RootViewController.swift
  16. 103 11
      RainbowPlanet/RainbowPlanet/Base/RootWebViewController/RootWebViewController.swift
  17. 12 0
      RainbowPlanet/RainbowPlanet/Define/CacheMacro.swift
  18. 63 0
      RainbowPlanet/RainbowPlanet/Define/ColorMacro.swift
  19. 158 0
      RainbowPlanet/RainbowPlanet/Define/Common.swift
  20. 32 0
      RainbowPlanet/RainbowPlanet/Define/CreaditPayment-Bridging-Header.h
  21. 9 0
      RainbowPlanet/RainbowPlanet/Define/EnumMacro.swift
  22. 150 0
      RainbowPlanet/RainbowPlanet/Define/FontMacro.swift
  23. 14 0
      RainbowPlanet/RainbowPlanet/Define/HTMLURLMacro.swift
  24. 19 0
      RainbowPlanet/RainbowPlanet/Define/NotificationCenterMacro.swift
  25. 32 0
      RainbowPlanet/RainbowPlanet/Define/ThirdPartyMacro.swift
  26. 0 13
      RainbowPlanet/RainbowPlanet/Macro/RainbowPlanet-Bridging-Header.h
  27. 91 0
      RainbowPlanet/RainbowPlanet/Manager/BaiduMapManager/BaiduMapManager.swift
  28. 112 0
      RainbowPlanet/RainbowPlanet/Manager/BaiduMapManager/LocationModel.swift
  29. 222 0
      RainbowPlanet/RainbowPlanet/Manager/UMManager/UMManager.swift
  30. 3 9
      RainbowPlanet/RainbowPlanet/Modules/MineModule/Mine/ViewController/MineViewController.swift
  31. 6 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/NavigationBarIcons/Contents.json
  32. 23 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/NavigationBarIcons/navigaitionbar_back_black.imageset/Contents.json
  33. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/NavigationBarIcons/navigaitionbar_back_black.imageset/navigaitionbar_back_black.png
  34. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/NavigationBarIcons/navigaitionbar_back_black.imageset/navigaitionbar_back_black@2x.png
  35. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/NavigationBarIcons/navigaitionbar_back_black.imageset/navigaitionbar_back_black@3x.png
  36. 23 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/NavigationBarIcons/navigaitionbar_back_blue.imageset/Contents.json
  37. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/NavigationBarIcons/navigaitionbar_back_blue.imageset/navigaitionbar_back_blue.png
  38. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/NavigationBarIcons/navigaitionbar_back_blue.imageset/navigaitionbar_back_blue@2x.png
  39. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/NavigationBarIcons/navigaitionbar_back_blue.imageset/navigaitionbar_back_blue@3x.png
  40. 23 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/NavigationBarIcons/navigaitionbar_back_white.imageset/Contents.json
  41. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/NavigationBarIcons/navigaitionbar_back_white.imageset/navigaitionbar_back_white.png
  42. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/NavigationBarIcons/navigaitionbar_back_white.imageset/navigaitionbar_back_white@2x.png
  43. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/NavigationBarIcons/navigaitionbar_back_white.imageset/navigaitionbar_back_white@3x.png
  44. 22 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/find.imageset/Contents.json
  45. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/find.imageset/find.png
  46. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/find.imageset/find@2x.png
  47. 22 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/find_1.imageset/Contents.json
  48. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/find_1.imageset/find_1.png
  49. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/find_1.imageset/find_1@2x.png
  50. 22 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/home.imageset/Contents.json
  51. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/home.imageset/home.png
  52. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/home.imageset/home@2x.png
  53. 22 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/home_1.imageset/Contents.json
  54. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/home_1.imageset/home_1.png
  55. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/home_1.imageset/home_1@2x.png
  56. 22 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/shop.imageset/Contents.json
  57. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/shop.imageset/shop.png
  58. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/shop.imageset/shop@2x.png
  59. 22 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/shop_1.imageset/Contents.json
  60. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/shop_1.imageset/shop_1.png
  61. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/shop_1.imageset/shop_1@2x.png
  62. 26 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_financialManagement_icon_normal.imageset/Contents.json
  63. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_financialManagement_icon_normal.imageset/tab_financialManagement_icon_normal.png
  64. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_financialManagement_icon_normal.imageset/tab_financialManagement_icon_normal@2x.png
  65. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_financialManagement_icon_normal.imageset/tab_financialManagement_icon_normal@3x.png
  66. 26 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_financialManagement_icon_selected.imageset/Contents.json
  67. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_financialManagement_icon_selected.imageset/tab_financialManagement_icon_selected.png
  68. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_financialManagement_icon_selected.imageset/tab_financialManagement_icon_selected@2x.png
  69. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_financialManagement_icon_selected.imageset/tab_financialManagement_icon_selected@3x.png
  70. 26 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_home_icon_normal.imageset/Contents.json
  71. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_home_icon_normal.imageset/tab_home_icon_normal.png
  72. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_home_icon_normal.imageset/tab_home_icon_normal@2x.png
  73. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_home_icon_normal.imageset/tab_home_icon_normal@3x.png
  74. 26 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_home_icon_selected.imageset/Contents.json
  75. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_home_icon_selected.imageset/tab_home_icon_selected.png
  76. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_home_icon_selected.imageset/tab_home_icon_selected@2x.png
  77. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_home_icon_selected.imageset/tab_home_icon_selected@3x.png
  78. 26 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_me_icon_normal.imageset/Contents.json
  79. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_me_icon_normal.imageset/tab_me_icon_normal.png
  80. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_me_icon_normal.imageset/tab_me_icon_normal@2x.png
  81. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_me_icon_normal.imageset/tab_me_icon_normal@3x.png
  82. 26 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_me_icon_selected.imageset/Contents.json
  83. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_me_icon_selected.imageset/tab_me_icon_selected.png
  84. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_me_icon_selected.imageset/tab_me_icon_selected@2x.png
  85. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_me_icon_selected.imageset/tab_me_icon_selected@3x.png
  86. 26 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_shopping_icon_normal.imageset/Contents.json
  87. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_shopping_icon_normal.imageset/tab_shopping_icon_normal.png
  88. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_shopping_icon_normal.imageset/tab_shopping_icon_normal@2x.png
  89. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_shopping_icon_normal.imageset/tab_shopping_icon_normal@3x.png
  90. 26 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_shopping_icon_selected.imageset/Contents.json
  91. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_shopping_icon_selected.imageset/tab_shopping_icon_selected.png
  92. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_shopping_icon_selected.imageset/tab_shopping_icon_selected@2x.png
  93. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_shopping_icon_selected.imageset/tab_shopping_icon_selected@3x.png
  94. 2 128
      RainbowPlanet/RainbowPlanet/Supporting Files/Info.plist
  95. 46 0
      RainbowPlanet/RainbowPlanet/Tools/AlertView/BAAlertController/BAAlertController.h
  96. 108 0
      RainbowPlanet/RainbowPlanet/Tools/AlertView/BAAlertController/NSObject+BARunTime.h
  97. 268 0
      RainbowPlanet/RainbowPlanet/Tools/AlertView/BAAlertController/NSObject+BARunTime.m
  98. 190 0
      RainbowPlanet/RainbowPlanet/Tools/AlertView/BAAlertController/UIAlertController+BAKit.h
  99. 377 0
      RainbowPlanet/RainbowPlanet/Tools/AlertView/BAAlertController/UIAlertController+BAKit.m
  100. 0 0
      RainbowPlanet/RainbowPlanet/Tools/AppInfo/AppInfo.swift

+ 16 - 28
RainbowPlanet/Podfile

@@ -1,7 +1,4 @@
-=begin
-这里写注释
-=end
-
+# Uncomment the next line to define a global platform for your project
 platform :ios, '9.0'
 inhibit_all_warnings!
 use_frameworks!
@@ -10,56 +7,49 @@ target 'RainbowPlanet' do
 # 网络请求
 pod 'Alamofire'
 pod 'Moya/RxSwift'
-
 # Rx
 pod 'RxSwift'
 pod 'RxCocoa'
-
 # json解析
 pod 'SwiftyJSON'
 pod 'ObjectMapper'
-
-# tabbar
-pod 'ESTabBarController-swift'
-
 # 图片加载
 pod 'Kingfisher'
-
 # 自动布局
 pod 'SnapKit'
-
 # 键盘
 pod 'IQKeyboardManagerSwift'
-
 # 加密
 pod 'CryptoSwift'
-
 # 弹框
 pod 'MBProgressHUD'
-
 # 下拉刷新
 pod 'MJRefresh'
-
 # 设备型号
 pod 'DeviceKit'
-
 # 轮播
 pod 'FSPagerView'
-
 # 分段导航栏
 pod 'XLPagerTabStrip'
-
 # 评分
 pod 'SwiftyStarRatingView'
-
+# NavigationBar过度动画
+pod 'KMNavigationBarTransition'
+pod 'UINavigation-SXFixSpace'
+# 二维码
+pod 'EFQRCode'
+# 内存检测
+pod 'MLeaksFinder'
+# 小红点
+pod 'PPBadgeViewSwift'
+# 占位图
+pod 'LYEmptyView'
 # 日期时间处理
 pod 'SwiftDate'
-
 # pop动画
 pod 'FWPopupView'
-
-# 小红点
-pod 'PPBadgeViewSwift'
+# 路由
+#pod 'MGJRouter'
 
 #======================第三方平台===========
 #======================友盟===========
@@ -86,10 +76,8 @@ pod 'UMCShare/Social/ReducedSina'
 pod 'Bugly'
 
 #=====================百度地图===========
-
 #百度地图定位SDK
 pod 'BMKLocationKit'
-#百度地图
-#pod 'BaiduMapKit'
 
-end 
+end
+

+ 29 - 5
RainbowPlanet/Podfile.lock

@@ -4,14 +4,20 @@ PODS:
   - Bugly (2.5.0)
   - CryptoSwift (0.14.0)
   - DeviceKit (1.11.0)
-  - ESTabBarController-swift (2.6.4)
+  - EFQRCode (4.5.0):
+    - swift_qrcodejs (~> 1.0.1)
+  - FBRetainCycleDetector (0.1.4)
   - FSPagerView (0.8.2)
   - FWPopupView (4.0.1):
     - SnapKit
   - IQKeyboardManagerSwift (6.2.0)
   - Kingfisher (4.10.1)
+  - KMNavigationBarTransition (1.1.5)
+  - LYEmptyView (1.2.3)
   - MBProgressHUD (1.1.0)
   - MJRefresh (3.1.15.7)
+  - MLeaksFinder (1.0.0):
+    - FBRetainCycleDetector
   - Moya/Core (12.0.1):
     - Alamofire (~> 4.1)
     - Result (~> 4.0)
@@ -27,9 +33,11 @@ PODS:
   - RxSwift (4.4.1):
     - RxAtomic (~> 4.4)
   - SnapKit (4.2.0)
+  - swift_qrcodejs (1.0.1)
   - SwiftDate (5.1.0)
   - SwiftyJSON (4.2.0)
   - SwiftyStarRatingView (1.0.4)
+  - UINavigation-SXFixSpace (1.0.9)
   - UMCAnalytics (6.0.2):
     - UMCCommon
   - UMCCommon (2.0.0)
@@ -63,13 +71,16 @@ DEPENDENCIES:
   - Bugly
   - CryptoSwift
   - DeviceKit
-  - ESTabBarController-swift
+  - EFQRCode
   - FSPagerView
   - FWPopupView
   - IQKeyboardManagerSwift
   - Kingfisher
+  - KMNavigationBarTransition
+  - LYEmptyView
   - MBProgressHUD
   - MJRefresh
+  - MLeaksFinder
   - Moya/RxSwift
   - ObjectMapper
   - PPBadgeViewSwift
@@ -79,6 +90,7 @@ DEPENDENCIES:
   - SwiftDate
   - SwiftyJSON
   - SwiftyStarRatingView
+  - UINavigation-SXFixSpace
   - UMCAnalytics
   - UMCCommon
   - UMCCommonLog
@@ -97,13 +109,17 @@ SPEC REPOS:
     - Bugly
     - CryptoSwift
     - DeviceKit
-    - ESTabBarController-swift
+    - EFQRCode
+    - FBRetainCycleDetector
     - FSPagerView
     - FWPopupView
     - IQKeyboardManagerSwift
     - Kingfisher
+    - KMNavigationBarTransition
+    - LYEmptyView
     - MBProgressHUD
     - MJRefresh
+    - MLeaksFinder
     - Moya
     - ObjectMapper
     - PPBadgeViewSwift
@@ -112,9 +128,11 @@ SPEC REPOS:
     - RxCocoa
     - RxSwift
     - SnapKit
+    - swift_qrcodejs
     - SwiftDate
     - SwiftyJSON
     - SwiftyStarRatingView
+    - UINavigation-SXFixSpace
     - UMCAnalytics
     - UMCCommon
     - UMCCommonLog
@@ -129,13 +147,17 @@ SPEC CHECKSUMS:
   Bugly: 3ca9f255c01025582df26f9222893b383c7e4b4e
   CryptoSwift: 35a10419f4dbf0619c13f8c1c180037e115323fa
   DeviceKit: a3a86f8dddbe1317a9a243cdf9646858bf135dce
-  ESTabBarController-swift: 58cca4ab7de980657d99a02181c1ff310983e975
+  EFQRCode: 842f431e660da841f518993af8f4cbd275601d84
+  FBRetainCycleDetector: 46f8179bbb1c587deee3ea838a1a3ee02acf5015
   FSPagerView: 816a18842306973cc7cc6df8a5332272f7815c30
   FWPopupView: a463a17aab606b0ef222a68784dbf32accba4711
   IQKeyboardManagerSwift: b07ccf9d8cafe993dcd6cb794eb4ba34611a0c4e
   Kingfisher: c148cd7b47ebde9989f6bc7c27dcaa79d81279a0
+  KMNavigationBarTransition: 7a52c9bc25b39b6e3343e980b453facee1591b82
+  LYEmptyView: ea5827f3f81fcbec427f990005501991477bdae8
   MBProgressHUD: e7baa36a220447d8aeb12769bf0585582f3866d9
   MJRefresh: 697f8ec75ebdbe9207767bb682cf0f51b0d8a41f
+  MLeaksFinder: 8c435bd2f6d070af18cff082b503b21adc130fc0
   Moya: cf730b3cd9e005401ef37a85143aa141a12fd38f
   ObjectMapper: 0d4402610f4e468903ae64629eec4784531e5c51
   PPBadgeViewSwift: 96a41852df7437e9d948565a1bc894f757c29933
@@ -144,9 +166,11 @@ SPEC CHECKSUMS:
   RxCocoa: 2f35a76bf8887872e28a1914112395b11b8e0e64
   RxSwift: 92fcf68dfef21f3e2ab1965363d9e7b3d787597e
   SnapKit: fe8a619752f3f27075cc9a90244d75c6c3f27e2a
+  swift_qrcodejs: c181fe5c849d30c699546a23762d7e3dd143ab37
   SwiftDate: 6329e58969a2de31cea7f1ee1143b247693196e7
   SwiftyJSON: c4bcba26dd9ec7a027fc8eade48e2c911f229e96
   SwiftyStarRatingView: a2b0057700e0adeb8e7442c55d99cb53b531d2f4
+  UINavigation-SXFixSpace: d5cf69960794667c1315167d53658a89193ccba4
   UMCAnalytics: 901960ede5a8a85f208bd37689ad3e607b433930
   UMCCommon: 79b5a614c958db367113eed5740109d9a98e1223
   UMCCommonLog: 05a2d5de21858e3d870551562cff405c1366d244
@@ -155,6 +179,6 @@ SPEC CHECKSUMS:
   UMCShare: 552b29753f1b4da87b51d96545ed19e6263df397
   XLPagerTabStrip: 22d4c58200d7c105e0e407ab6bfd01a5d85014be
 
-PODFILE CHECKSUM: 9e73bf265c1f41125de8f9b50930ad56395b600a
+PODFILE CHECKSUM: 0fefd559effd28dce31e7e0f5cfbfc0b04a3dce9
 
 COCOAPODS: 1.5.3

File diff suppressed because it is too large
+ 741 - 619
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj


+ 21 - 0
RainbowPlanet/RainbowPlanet/AppDelegate/APPDelegate+Bugly.swift

@@ -0,0 +1,21 @@
+//
+//  APPDelegate+Bugly.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2018/7/13.
+//  Copyright © 2018年 南鑫林. All rights reserved.
+//
+
+import Foundation
+
+extension AppDelegate {
+    
+    func initBugly() {
+        let config = BuglyConfig.init()
+        // 设置自定义日志上报的级别,默认不上报自定义日志
+        config.reportLogLevel = BuglyLogLevel.warn
+        config.blockMonitorEnable = true
+        Bugly.start(withAppId: kBuglyAppId, config: config)
+        BuglyLog.initLogger(BuglyLogLevel.debug, consolePrint: true)
+    }
+}

+ 19 - 0
RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate+BaiduMap.swift

@@ -0,0 +1,19 @@
+//
+//  AppDelegate+BaiduMapKit.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2018/8/1.
+//  Copyright © 2018年 南鑫林. All rights reserved.
+//
+
+import Foundation
+
+
+extension AppDelegate {
+    func initBaiduMap() -> Void {
+        BMKLocationAuth.sharedInstance()?.checkPermision(withKey: kBaiduMapAppKey, authDelegate: BaiduMapManager.getSharedInstance())
+        //定位
+        BaiduMapManager.getSharedInstance().initLocation()
+    }
+}
+

+ 1 - 10
RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate+IQKeyboardManagerSwift.swift

@@ -1,6 +1,6 @@
 //
 //  AppDelegate+IQKeyboardManagerSwift.swift
-//  CreaditPayment
+//  RainbowPlanet
 //
 //  Created by 南鑫林 on 2018/7/2.
 //  Copyright © 2018年 南鑫林. All rights reserved.
@@ -10,18 +10,9 @@ import UIKit
 import IQKeyboardManagerSwift
 
 extension AppDelegate {
-
-    /// 初始化键盘
     func initIQKeyboard() {
-        // 控制整个功能是否启用
         IQKeyboardManager.shared.enable = true
-        // 控制是否显示键盘上的自动工具条,当需要支持内联编辑(Inline Editing), 这就需要隐藏键盘上的工具条(默认打开)
         IQKeyboardManager.shared.enableAutoToolbar = false
-        // 启用手势触摸:控制点击背景是否收起键盘。
         IQKeyboardManager.shared.shouldResignOnTouchOutside = true
-        // 是否显示提示文字
-        IQKeyboardManager.shared.shouldShowToolbarPlaceholder = false;
-        // 控制键盘上的工具条文字颜色是否用户自定义,(使用TextField的tintColor属性IQToolbar,否则色调的颜色是黑色 )
-        IQKeyboardManager.shared.shouldToolbarUsesTextFieldTintColor = false;
     }
 }

+ 198 - 0
RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate+UM.swift

@@ -0,0 +1,198 @@
+//
+//  AppDelegate+UM.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2018/8/1.
+//  Copyright © 2018年 南鑫林. All rights reserved.
+//
+
+import Foundation
+import AVFoundation
+
+var _entity : UMessageRegisterEntity?
+
+extension AppDelegate {
+    
+    /// 友盟初始化
+    func initUM(launchOptions:[UIApplication.LaunchOptionsKey: Any]?) -> Void {
+        
+        //公共
+        common()
+        //推送
+        push(launchOptions: launchOptions)
+        //分享
+        UMManager.shared().share()
+        
+    }
+    
+    ///公共
+    func common() -> Void {
+        UMCommonLogManager.setUp() //开发者需要显式的调用此函数,日志系统才能工作
+        UMConfigure.setEncryptEnabled(true) //打开加密传输
+        UMConfigure.setLogEnabled(true)  //设置打开日志
+        UMConfigure.initWithAppkey(kUMengAppKey, channel: "App Store") //设置Key
+//        MobClick.setAutoPageEnabled(true) //将自动采集页面信息
+        MobClick.setCrashReportEnabled(true) //开启Crash收集
+        
+        //获得集成测试需要device_id
+        let deice_id = UMConfigure.deviceIDForIntegration()
+        if deice_id != nil {
+            print("服务器端成功返回deviceID:\(deice_id!)");
+        }else {
+            print("服务器端还没有返回deviceID");
+        }
+    }
+    
+    ///推送
+    func push(launchOptions:[UIApplication.LaunchOptionsKey: Any]?) -> Void {
+        
+        _entity = UMessageRegisterEntity.init()
+        //type是对推送的几个参数的选择,可以选择一个或者多个。默认是三个全部打开,即:声音,弹窗,角标
+        _entity?.types = Int(UInt8(UMessageAuthorizationOptions.badge.rawValue)|UInt8(UMessageAuthorizationOptions.alert.rawValue)|UInt8(UMessageAuthorizationOptions.sound.rawValue))
+        
+        if #available(iOS 8.0, *) {
+            if #available(iOS 10.0, *) {
+                
+                let action1_ios10 = UNNotificationAction(identifier: "action1_identifier", title: "打开应用", options: UNNotificationActionOptions.foreground)
+                let action2_ios10 = UNNotificationAction(identifier: "action2_identifier", title: "忽略", options: UNNotificationActionOptions.foreground)
+                
+                let category1_ios10 = UNNotificationCategory(identifier: "category1", actions: [action1_ios10,action2_ios10], intentIdentifiers: [], options: UNNotificationCategoryOptions.customDismissAction)
+                //UNNotificationCategoryOptionNone
+                //UNNotificationCategoryOptionCustomDismissAction  清除通知被触发会走通知的代理方法
+                //UNNotificationCategoryOptionAllowInCarPlay       适用于行车模式
+                let categories = NSSet(objects: category1_ios10)
+                _entity?.categories = (categories as! Set<AnyHashable>)
+                UNUserNotificationCenter.current().delegate = self
+                
+            } else {
+                let action1 = UIMutableUserNotificationAction.init()
+                action1.identifier = "action1_identifier"
+                action1.title = "打开应用"
+                action1.activationMode = UIUserNotificationActivationMode.foreground;//当点击的时候启动程序
+                
+                let action2 = UIMutableUserNotificationAction.init()
+                action2.identifier = "action2_identifier"
+                action2.title = "忽略"
+                action2.activationMode = UIUserNotificationActivationMode.background;//当点击的时候不启动程序,在后台处理
+                action2.isAuthenticationRequired = true;//需要解锁才能处理,如果action.activationMode = UIUserNotificationActivationModeForeground;则这个属性被忽略;
+                action2.isDestructive = true;
+                
+                let actionCategory1 = UIMutableUserNotificationCategory.init()
+                actionCategory1.identifier = "category1"//这组动作的唯一标示
+                actionCategory1.setActions([action1,action2], for: UIUserNotificationActionContext.default)
+                let categories = NSSet(objects: actionCategory1)
+                _entity?.categories = (categories as! Set<AnyHashable>)
+
+            }
+        }
+
+        UMessage.registerForRemoteNotifications(launchOptions: launchOptions, entity: _entity) { (granted, error) in
+
+            if granted {
+                
+            }else {
+                
+            }
+        }
+        UMessage.setBadgeClear(true)//设置是否允许SDK自动清空角标
+    }
+}
+
+
+@available(iOS 10.0, *)
+
+// MARK: - UNUserNotificationCenterDelegate
+extension AppDelegate:UNUserNotificationCenterDelegate {
+    func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
+        let userInfo = notification.request.content.userInfo
+        
+        if (notification.request.trigger?.isKind(of: UNPushNotificationTrigger.self))! {
+            UMessage.setAutoAlert(true)
+            //应用处于前台时的远程推送接受
+            //必须加这句代码
+            UMessage.didReceiveRemoteNotification(userInfo)
+
+        }else {
+            //应用处于前台时的本地推送接受
+        }
+        completionHandler(UNNotificationPresentationOptions(rawValue: UNNotificationPresentationOptions.sound.rawValue|UNNotificationPresentationOptions.alert.rawValue|UNNotificationPresentationOptions.badge.rawValue))
+    }
+    
+    func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
+        let userInfo = response.notification.request.content.userInfo
+        if (response.notification.request.trigger?.isKind(of: UNPushNotificationTrigger.self))! {
+            UMessage.setAutoAlert(true)
+            //应用处于前台时的远程推送接受
+            //必须加这句代码
+            UMessage.didReceiveRemoteNotification(userInfo)
+        }else {
+            //应用处于前台时的本地推送接受
+        }
+
+
+    }
+
+}
+
+// MARK: - 接受通知
+extension AppDelegate {
+    
+    //iOS10以下使用这两个方法接收通知,
+    func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
+        //关闭友盟自带的弹出框
+        UMessage.setAutoAlert(true)
+        if #available(iOS 8.0, *)  {
+            if #available(iOS 10.0, *){
+            }else {
+                UMessage.didReceiveRemoteNotification(userInfo)
+                completionHandler(UIBackgroundFetchResult.newData);
+            }
+        }
+    }
+    
+    func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) {
+        //关闭友盟自带的弹出框
+        UMessage.setAutoAlert(true)
+        if #available(iOS 8.0, *)  {
+            if #available(iOS 10.0, *){
+            }else {
+                UMessage.didReceiveRemoteNotification(userInfo)
+            }
+        }
+    }
+
+    /// 获取设备的 DeviceToken
+    func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
+        NXLLog(deviceToken.description.replacingOccurrences(of: "<", with: "").replacingOccurrences(of: ">", with: "").replacingOccurrences(of: " ", with: ""))
+    }
+}
+//MARK: - 设置系统回调
+extension AppDelegate {
+    //注:此方法在swift4.1(Xcode 9.3)已废弃,Objective-C项目不影响。 新浪 平台外的其他平台可在swift项目中使用下面两种回调方法。
+    func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
+        //6.3的新的API调用,是为了兼容国外平台(例如:新版facebookSDK,VK等)的调用[如果用6.2的api调用会没有回调],对国内平台没有影响
+        let result = UMSocialManager.default().handleOpen(url, sourceApplication: sourceApplication, annotation: annotation)
+        if (!result) {
+            // 其他如支付等SDK的回调
+        }
+        return result;
+    }
+    //仅支持iOS9以上系统,iOS8及以下系统不会回调
+    func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
+        //6.3的新的API调用,是为了兼容国外平台(例如:新版facebookSDK,VK等)的调用[如果用6.2的api调用会没有回调],对国内平台没有影响
+        let result = UMSocialManager.default().handleOpen(url, options: options)
+        if (!result) {
+            // 其他如支付等SDK的回调
+        }
+        return result;
+    }
+    //支持目前所有iOS系统
+    func application(_ application: UIApplication, handleOpen url: URL) -> Bool {
+        let result = UMSocialManager.default().handleOpen(url)
+        if (!result) {
+            // 其他如支付等SDK的回调
+        }
+        return result;
+    }
+}
+

+ 17 - 17
RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate+Window.swift

@@ -2,32 +2,34 @@
 //  AppDelegate+Window.swift
 //  RainbowPlanet
 //
-//  Created by 南鑫林 on 2019/3/6.
-//  Copyright © 2019 南鑫林. All rights reserved.
+//  Created by 南鑫林 on 2018/6/30.
+//  Copyright © 2018年 南鑫林. All rights reserved.
 //
 
 import UIKit
 
 extension AppDelegate {
 
-    /// 初始化window
     func initWindow() {
+        
         window = UIWindow.init(frame: UIScreen.main.bounds)
         window?.backgroundColor = UIColor.white
         window?.makeKeyAndVisible()
-        /// 设置Tabbar
-        setTabbarController()
-        /// 设置全局的TableView/ScrollView
-        setTableViewAppearance()
+        
         /// 设置全局的tabbar
         setTabbarAppearence()
-        /// 设置引导页
+        /// 设置全局的TableView/ScrollView
+        setTableViewAppearance()
+        /// 设置Tabbar
+        setTabbarController()
+        //引导页
         setGuidePageView()
     }
-
+    
     /// 设置Tabbar
     func setTabbarController() {
-        window?.rootViewController = RootTabbarController.shared().tabBarController
+        
+        self.window?.rootViewController = RootTabbarController.shared().tabBarController
     }
 
     ///设置全局的Tabbar
@@ -37,19 +39,17 @@ extension AppDelegate {
         UITabBar.appearance().backgroundColor = UIColor.white
         UITabBar.appearance().shadowImage = UIImage(named: "tab_top_line")
     }
-
+    
     /// UITableView全局
     func setTableViewAppearance() {
         UITableView.appearance().estimatedRowHeight = 0
         UITableView.appearance().estimatedSectionHeaderHeight = 0
         UITableView.appearance().estimatedSectionFooterHeight = 0
     }
-
-    ///设置引导页
+    
+    //设置引导页
     func setGuidePageView() {
-        _ = GuidePageView.init(images: ["ceshi","ceshi","ceshi"]) {
-
-        }
+        
     }
+    
 }
-

+ 15 - 7
RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate.swift

@@ -1,25 +1,35 @@
-//
+
 //  AppDelegate.swift
 //  RainbowPlanet
 //
-//  Created by 南鑫林 on 2019/3/5.
-//  Copyright © 2019 南鑫林. All rights reserved.
+//  Created by 南鑫林 on 2018/6/30.
+//  Copyright © 2018年 南鑫林. All rights reserved.
 //
 
 import UIKit
+import AVFoundation
+
 
 @UIApplicationMain
 class AppDelegate: UIResponder, UIApplicationDelegate {
 
     var window: UIWindow?
 
-
     func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
-        // Override point for customization after application launch.
+        //初始化地图
+        initBaiduMap()
+        //异常上报
+        initBugly()
+        //初始化键盘
+        initIQKeyboard()
+        //初始化友盟
+        initUM(launchOptions: launchOptions)
         //初始化窗口
         initWindow()
+
         return true
     }
+    
 
     func applicationWillResignActive(_ application: UIApplication) {
         // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
@@ -43,6 +53,4 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
     }
 
-
 }
-

+ 0 - 30
RainbowPlanet/RainbowPlanet/Base/RootNavigationController/RootNavigationController.swift

@@ -1,30 +0,0 @@
-//
-//  RootNavigationController.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/3/5.
-//  Copyright © 2019 南鑫林. All rights reserved.
-//
-
-import UIKit
-
-class RootNavigationController: UINavigationController {
-
-    override func viewDidLoad() {
-        super.viewDidLoad()
-
-        // Do any additional setup after loading the view.
-    }
-    
-
-    /*
-    // MARK: - Navigation
-
-    // In a storyboard-based application, you will often want to do a little preparation before navigation
-    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
-        // Get the new view controller using segue.destination.
-        // Pass the selected object to the new view controller.
-    }
-    */
-
-}

+ 89 - 0
RainbowPlanet/RainbowPlanet/Base/RootNavigationViewController/RootNavigationController.swift

@@ -0,0 +1,89 @@
+//
+//  RootNavigationController.swift
+//  CreaditPayment
+//
+//  Created by 南鑫林 on 2018/6/30.
+//  Copyright © 2018年 南鑫林. All rights reserved.
+//
+
+import UIKit
+
+class RootNavigationController: UINavigationController {
+
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        navigationBar.isTranslucent = false
+        //启用滑动返回(swipe back)
+        interactivePopGestureRecognizer!.delegate = self
+
+    }
+
+    override func didReceiveMemoryWarning() {
+        super.didReceiveMemoryWarning()
+        // Dispose of any resources that can be recreated.
+    }
+    
+    override func pushViewController(_ viewController: UIViewController, animated: Bool) {
+        if (self.children.count > 0) {
+            viewController.navigationItem.leftBarButtonItem = UIBarButtonItem(target: self, action: #selector(backAction), image: kImage(name: "navigaitionbar_back_blue"), imageEdgeInsets: UIEdgeInsets(top: 0, left: 12, bottom: 0, right: 0))
+            viewController.hidesBottomBarWhenPushed = true
+        }
+        super.pushViewController(viewController, animated: animated)
+    }
+    
+    override var shouldAutorotate: Bool {
+        return true
+    }
+    
+    override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
+        return (self.viewControllers.last?.supportedInterfaceOrientations)!
+    }
+    override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
+        return (self.viewControllers.last?.preferredInterfaceOrientationForPresentation)!
+    }
+    override var childForStatusBarStyle: UIViewController? {
+        return self.topViewController
+    }
+    
+    // back按钮返回的事件
+    @objc func backAction() {
+        if ((self.presentingViewController) != nil) {
+            //判断1
+            self.dismiss(animated: true, completion: {
+
+            })
+        } else {
+            //判断2
+            self.popViewController(animated: true)
+        }
+    }
+}
+
+// MARK - UINavigationController
+extension UINavigationController {
+
+    /// pop到指定的页面
+    ///
+    /// - Parameter type: 控制器
+    /// - Returns: 失败
+    func popToClass<T: UIViewController>(type:T.Type) {
+        for viewController in self.viewControllers {
+            guard let _ = viewController as? T else {
+                continue
+            }
+            self.popToViewController(viewController, animated: true)
+        }
+    }
+
+}
+
+extension RootNavigationController: UIGestureRecognizerDelegate {
+    //是否允许手势
+    func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
+        if (gestureRecognizer == self.navigationController?.interactivePopGestureRecognizer) {
+            //只有二级以及以下的页面允许手势返回
+            return self.navigationController!.viewControllers.count > 1
+        }
+        return true
+    }
+}

+ 0 - 54
RainbowPlanet/RainbowPlanet/Base/RootTabbarController/RootTabbarController.swift

@@ -1,54 +0,0 @@
-//
-//  RootTabbarController.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/3/5.
-//  Copyright © 2019 南鑫林. All rights reserved.
-//
-
-import UIKit
-import ESTabBarController_swift
-
-class RootTabbarController: NSObject {
-
-    private static let _sharedInstance = RootTabbarController()
-
-    private override init() {} // 私有化init方法
-
-    class func shared() -> RootTabbarController {
-        return _sharedInstance
-    }
-
-    public lazy var tabBarController: ESTabBarController = {
-        let tabBarController = ESTabBarController()
-        let v1 = ShoppingViewController()
-        let v2 = ShoppingCartViewController()
-        let v3 = MineViewController()
-        v1.tabBarItem = ESTabBarItem.init(TabBarItemContentView(),title: "商城", image: UIImage(named: ""), selectedImage: UIImage(named: ""))
-        v2.tabBarItem = ESTabBarItem.init(TabBarItemContentView(),title: "购物车", image: UIImage(named: ""), selectedImage: UIImage(named: ""))
-        v3.tabBarItem = ESTabBarItem.init(TabBarItemContentView(),title: "我的", image: UIImage(named: ""), selectedImage: UIImage(named: ""))
-
-        let n1 = RootNavigationController.init(rootViewController: v1)
-        let n2 = RootNavigationController.init(rootViewController: v2)
-        let n3 = RootNavigationController.init(rootViewController: v3)
-
-        tabBarController.viewControllers = [n1, n2, n3]
-
-        return tabBarController
-    }()
-}
-
-class TabBarItemContentView: ESTabBarItemContentView {
-
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        textColor = UIColor.init(white: 175.0 / 255.0, alpha: 1.0)
-        highlightTextColor = UIColor.init(red: 254/255.0, green: 73/255.0, blue: 42/255.0, alpha: 1.0)
-//        iconColor = UIColor.init(white: 175.0 / 255.0, alpha: 1.0)
-//        highlightIconColor = UIColor.init(red: 254/255.0, green: 73/255.0, blue: 42/255.0, alpha: 1.0)
-    }
-
-    public required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 52 - 0
RainbowPlanet/RainbowPlanet/Base/RootTabbarController/RootTabbarViewController.swift

@@ -0,0 +1,52 @@
+//
+//  RootTabbarViewController.swift
+//  CreaditPayment
+//
+//  Created by 南鑫林 on 2018/6/30.
+//  Copyright © 2018年 南鑫林. All rights reserved.
+//
+
+import UIKit
+
+
+class RootTabbarController: NSObject {
+
+    private static let _sharedInstance = RootTabbarController()
+
+    private override init() {} // 私有化init方法
+
+    class func shared() -> RootTabbarController {
+        return _sharedInstance
+    }
+
+    //MARK: - lazy
+    public lazy var tabBarController: UITabBarController = {
+
+        let tabBarController = UITabBarController()
+
+        let v1 = ShoppingViewController()
+        let v2 = ShoppingCartViewController()
+        let v3 = MineViewController()
+
+        let n1 = RootNavigationController.init(rootViewController: v1)
+        let n2 = RootNavigationController.init(rootViewController: v2)
+        let n3 = RootNavigationController.init(rootViewController: v3)
+
+        tabBarItemStyle(navc: n1, normalImg: "tab_home_icon_normal", selectorImg: "tab_home_icon_selected", title: "首页")
+        tabBarItemStyle(navc: n2, normalImg: "tab_shopping_icon_normal", selectorImg: "tab_shopping_icon_selected", title: "逛街")
+        tabBarItemStyle(navc: n3, normalImg: "tab_me_icon_normal", selectorImg: "tab_me_icon_selected", title: "我的")
+
+        tabBarController.viewControllers = [n1, n2, n3]
+
+        return tabBarController
+
+    }()
+
+    private func tabBarItemStyle(navc : UINavigationController, normalImg : String, selectorImg : String, title : String){
+        navc.tabBarItem = UITabBarItem.init(title: title, image: UIImage(named:normalImg), selectedImage: UIImage(named:selectorImg))
+        navc.tabBarItem.setTitleTextAttributes([NSAttributedString.Key.foregroundColor:kTabbarSelectColor], for: UIControl.State.selected)
+        navc.tabBarItem.setTitleTextAttributes([NSAttributedString.Key.foregroundColor:kTabbarNormalColor], for: UIControl.State.normal)
+
+    }
+
+}

+ 24 - 10
RainbowPlanet/RainbowPlanet/Base/RootView/RootView.swift

@@ -1,21 +1,35 @@
 //
 //  RootView.swift
-//  RainbowPlanet
+//  CreaditPayment
 //
-//  Created by 南鑫林 on 2019/3/5.
-//  Copyright © 2019 南鑫林. All rights reserved.
+//  Created by 南鑫林 on 2018/7/10.
+//  Copyright © 2018年 南鑫林. All rights reserved.
 //
 
 import UIKit
+import RxSwift
+import RxCocoa
+import RxAtomic
 
 class RootView: 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() {
+        self.backgroundColor = UIColor.white
+    }
+    
+    func setupLayouts() {
+        
+    }
+    
 }

+ 122 - 12
RainbowPlanet/RainbowPlanet/Base/RootViewController/RootViewController.swift

@@ -1,9 +1,9 @@
-//
+  //
 //  RootViewController.swift
-//  RainbowPlanet
+//  CreaditPayment
 //
-//  Created by 南鑫林 on 2019/3/5.
-//  Copyright © 2019 南鑫林. All rights reserved.
+//  Created by 南鑫林 on 2018/6/30.
+//  Copyright © 2018年 南鑫林. All rights reserved.
 //
 
 import UIKit
@@ -12,19 +12,129 @@ class RootViewController: UIViewController {
 
     override func viewDidLoad() {
         super.viewDidLoad()
+        self.navigationController?.navigationBar.isTranslucent = false
+        if #available(iOS 11.0, *) {
+            UIScrollView.appearance().contentInsetAdjustmentBehavior =  .automatic
+        } else {
+            if self.responds(to: #selector(setter: self.automaticallyAdjustsScrollViewInsets)) {
+                self.automaticallyAdjustsScrollViewInsets = true
+            }
+        }
+
+        //设置字体大小
+        setNavigationItemTitle()
+        setupData()
+        setupViews()
+        setupLayouts()
+        setupAutoViews()
+
+    }
+
+
+    /// 设置字体大小
+    public func setNavigationItemTitle() {
+        
+        if navigationItem.title != nil {
+            let count = (self.navigationItem.title?.count)!
+            if count <= 6 {
+                setTitleTextAttributesFont(fontSize: 17);
+            }else if count == 7 {
+                setTitleTextAttributesFont(fontSize: 16);
+            }else if count >= 8 {
+                setTitleTextAttributesFont(fontSize: 15);
+            }
+        }
+    }
 
-        // Do any additional setup after loading the view.
+    /// 设置动态字体大小
+    ///
+    /// - Parameter fontSize: 设置字体大小
+    private func setTitleTextAttributesFont(fontSize: CGFloat) {
+        let dict:NSDictionary = [NSAttributedString.Key.font : UIFont.boldSystemFont(ofSize: fontSize)]
+        //
+        self.navigationController?.navigationBar.titleTextAttributes = dict as? [NSAttributedString.Key : AnyObject]
+    }
+    override func didReceiveMemoryWarning() {
+        super.didReceiveMemoryWarning()
+        // Dispose of any resources that can be recreated.
+    }
+    
+    // MARK: - 设置view
+    func setupViews() {
+        view.backgroundColor = UIColor.white
+    }
+    
+    func setupLayouts() {
+        
     }
     
+    func setupData() {
+        
+    }
+    
+    func setupAutoViews() {
+        
+    }
+    
+    override var preferredStatusBarStyle: UIStatusBarStyle {
+        return .default
+    }
 
-    /*
-    // MARK: - Navigation
+    // MARK: - 导航栏设置
+    /**
+     导航栏添加左边图片
+     
+     @param ImageName 图片名
+     @param target 目标
+     @param action 点击方法
+     */
+    public func addLeftNavigationItem(imageName:String,target:Any,action:Selector) {
+        self.navigationItem.leftBarButtonItem = UIBarButtonItem(target: target, action: action, image: kImage(name: imageName), imageEdgeInsets: UIEdgeInsets(top: 0, left: 12, bottom: 0, right: -12))
+    }
+    
+    /**
+     导航栏添加右边图片
+     
+     @param ImageName 图片名
+     @param target 目标
+     @param action 点击方法
+     */
+    public func addRightNavigationItem(imageName:String,target:Any,action:Selector) {
+        self.navigationItem.rightBarButtonItem = UIBarButtonItem(target: target, action: action, image: kImage(name: imageName), imageEdgeInsets: UIEdgeInsets(top: 0, left: -12, bottom: 0, right: 12))
+    }
+    /**
+     导航栏添加左边title
+     
+     @param Title 标题
+     @param target 目标
+     @param action 点击方法
+     */
+    public func addLeftNavigationItem(title:String,target:Any,action:Selector) {
+        self.navigationItem.leftBarButtonItem = UIBarButtonItem(target: target, action: action, title: title)
+    }
+    /**
+     导航栏添加右边title
+     
+     @param Title 标题
+     @param target 目标
+     @param action 点击方法
+     */
+    public func addRightNavigationItem(title:String,target:Any,action:Selector) {
+        self.navigationItem.rightBarButtonItem = UIBarButtonItem(target: target, action: action, title: title)
+    }
 
-    // In a storyboard-based application, you will often want to do a little preparation before navigation
-    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
-        // Get the new view controller using segue.destination.
-        // Pass the selected object to the new view controller.
+    //MARK: - 屏幕旋转
+    ///是否支持旋转
+    override var shouldAutorotate: Bool {
+        return false
+    }
+    ///当前支持的旋转类型
+    override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
+        return .portrait
+    }
+    ///默认进去类型
+    override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
+        return .portrait
     }
-    */
 
 }

+ 103 - 11
RainbowPlanet/RainbowPlanet/Base/RootWebViewController/RootWebViewController.swift

@@ -1,30 +1,122 @@
 //
 //  RootWebViewController.swift
-//  RainbowPlanet
+//  CreaditPayment
 //
-//  Created by 南鑫林 on 2019/3/5.
-//  Copyright © 2019 南鑫林. All rights reserved.
+//  Created by 南鑫林 on 2018/7/13.
+//  Copyright © 2018年 南鑫林. All rights reserved.
 //
 
 import UIKit
+import WebKit
 
 class RootWebViewController: RootViewController {
 
+    
     override func viewDidLoad() {
         super.viewDidLoad()
+    }
+
+    override func didReceiveMemoryWarning() {
+        super.didReceiveMemoryWarning()
+        // Dispose of any resources that can be recreated.
+    }
+
+    //加载普通URL
+    var URLString : String?
+    //加载本地URL
+    var HTMLName : String?
+    //加载本地的js
+    var scriptMessageHandlerArray : Array<Any>?
+    //POST加载字典
+    var parameters = [String : Any]()
 
-        // Do any additional setup after loading the view.
+    //MARK: - view
+    override func setupViews() {
+        super.setupViews()
+        view.addSubview(wkWebView)
+        self.navigationItem.leftBarButtonItem = UIBarButtonItem(target: self, action: #selector(backAction), image: kImage(name: "navigaitionbar_back_blue"), imageEdgeInsets: UIEdgeInsets(top: 0, left: 12, bottom: 0, right: 0))
+    }
+     override func setupLayouts() {
+        super.setupLayouts()
+    }
+    
+    //MARK: -  action
+    @objc private func backAction() {
+        
+        self.wkWebView.webView.stopLoading()
+        if self.wkWebView.webView.canGoBack {
+            self.wkWebView.webView.goBack()
+        }else {
+            self.navigationController?.popViewController(animated: true)
+        }
     }
     
 
-    /*
-    // MARK: - Navigation
+    //MARK: - lazy
+
+    lazy var wkWebView: WebView = {
+        let wkWebView = WebView.init(frame: view.frame)
+        wkWebView.delegate = self
+        wkWebView.webConfig = webConfig
+        //// 加载普通URL
+        if (URLString != nil) {
+            wkWebView.webloadType(self, .URLString(url: URLString!))
+        }
+
+        // 加载本地URL
+        if (HTMLName != nil && scriptMessageHandlerArray != nil) {
+            webConfig.scriptMessageHandlerArray = scriptMessageHandlerArray as! [String]
+            wkWebView.webloadType(self, .HTMLName(name: HTMLName!))
+        }
+
+        // POST加载
+        if !parameters.isEmpty &&  URLString != nil {
+            wkWebView.webloadType(self, .POST(url: URLString!, parameters: parameters))
+        }
+
+        return wkWebView
+    }()
+
+    lazy var webConfig: WKWebViewConfig = {
+        var webConfig = WKWebViewConfig()
+        return webConfig
+    }()
+
+}
+
+extension RootWebViewController:WKWebViewDelegate{
+    /// 服务器开始请求的时候调用
+    func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void){
 
-    // In a storyboard-based application, you will often want to do a little preparation before navigation
-    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
-        // Get the new view controller using segue.destination.
-        // Pass the selected object to the new view controller.
     }
-    */
 
+    /// 页面开始加载
+    func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!){
+
+    }
+
+    /// 页面加载完成
+    func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!){
+
+    }
+
+    /// 跳转失败的时候调用
+    func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error){
+
+    }
+
+    /// 内容加载失败
+    func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error){
+
+    }
+
+    /// 执行JS注入方法
+    func webViewUserContentController(_ scriptMessageHandlerArray:[String], didReceive message: WKScriptMessage){
+
+    }
+
+    /// JS执行回调方法
+    func webViewEvaluateJavaScript(_ result:Any?,error:Error?){
+
+    }
 }

+ 12 - 0
RainbowPlanet/RainbowPlanet/Define/CacheMacro.swift

@@ -0,0 +1,12 @@
+//
+//  CacheMacro.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/1/5.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import Foundation
+
+let kLocationModelCache = "LocationModel"
+

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

@@ -0,0 +1,63 @@
+//
+//  ColorMacro.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2018/6/30.
+//  Copyright © 2018年 南鑫林. All rights reserved.
+//
+
+import UIKit
+//主题色 导航栏颜色 
+let kNavBgColor = UIColor(hexString: "2d96ee")
+
+let kTabbarSelectColor = UIColor(hexString: "2d96ee")
+
+let kTabbarNormalColor = UIColor(hexString: "b1d3f1")
+
+let kDisabledButtonColor = UIColor(hexString: "b1d3f1")
+//按钮蓝色
+let kEnabledButtonColor = UIColor(hexString: "2d96ee")
+
+let k333333Color = UIColor(hexString: "333333")
+
+let k666666Color = UIColor(hexString: "666666")
+
+let k999999Color = UIColor(hexString: "999999")
+
+let keeeeeeColor = UIColor(hexString: "eeeeee")
+
+let kcececeColor = UIColor(hexString: "cecece")
+
+let k457ffdColor = UIColor(hexString: "457ffd")
+
+let kd8d8d8Color = UIColor(hexString: "d8d8d8")
+
+let kd9d9d9Color = UIColor(hexString: "d9d9d9")
+
+let kff630fColor = UIColor(hexString: "ff630f")
+
+let kff8400Color = UIColor(hexString: "ff8400")
+
+let kff481bColor = UIColor(hexString: "ff481b")
+
+let kffeae5Color = UIColor(hexString: "ffeae5")
+
+let kf82323Color = UIColor(hexString: "f82323")
+
+let kf1f1f1Color = UIColor(hexString: "f1f1f1")
+
+let kf2f2f2Color = UIColor(hexString: "f2f2f2")
+
+let kf3f3f3Color = UIColor(hexString: "f3f3f3")
+
+let kf6f6f6Color = UIColor(hexString: "f6f6f6")
+
+let kf9f9f9Color = UIColor(hexString: "f9f9f9")
+
+let kfd6031Color = UIColor(hexString: "fd6031")
+
+let kffa500Color = UIColor(hexString: "ffa500")
+
+let kff724fColor = UIColor(hexString: "ff724f")
+
+let kbfbfbfColor = UIColor(hexString: "bfbfbf")

+ 158 - 0
RainbowPlanet/RainbowPlanet/Define/Common.swift

@@ -0,0 +1,158 @@
+//
+//  Common.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2018/7/1.
+//  Copyright © 2018年 南鑫林. All rights reserved.
+//
+
+import UIKit
+import DeviceKit
+import SnapKit
+import SwiftyJSON
+import ObjectMapper
+import RxAtomic
+import RxCocoa
+import RxSwift
+import Kingfisher
+
+
+//MARK: - 屏幕的高度
+
+///屏幕宽度
+let kScreenWidth = UIScreen.main.bounds.size.width
+///屏幕高度
+let kScreenHeight = UIScreen.main.bounds.size.height
+
+/// 屏幕宽比例
+let kScaleWidth = kScreenWidth/375.0
+/// 屏幕高比例
+let kScaleHeight = kScreenHeight/667.0
+/// 比例值
+func kScaleValue(value:CGFloat) -> CGFloat {
+    return kScreenWidth / 375.0 * value
+}
+
+///状态栏高度
+let kStatusBarHeight = UIApplication.shared.statusBarFrame.size.height
+///navigation高度
+let kNavBarHeight = 44.0;
+///状态栏顶部的高度
+let kStatusBarTopHeight = statusBarTopHeight()
+///kNavBar高度
+let kNavBarBottom  =  navBarBottom()
+///tabbar高度
+let kTabBarHeight  =  tabBarHeight()
+///tabbar安全高度
+let kSafeTabBarHeight = safeTabBarHeight()
+///视图的内容高度包含tabbar
+let kContentTabbarHeight = kScreenHeight - kNavBarBottom
+///视图的内容安全高度包含tabbar
+let kContentSafeTabbarHeight = kScreenHeight - kNavBarBottom - kSafeTabBarHeight
+///视图的内容高度不包含tabbar
+let kContentHeight = kScreenHeight - kNavBarBottom - kTabBarHeight
+///navBar的高度
+func navBarBottom() -> CGFloat {
+    return isIphoneX() ? 88.0 : 64.0
+}
+///tabBar高度
+func tabBarHeight() -> CGFloat {
+    return isIphoneX() ? 83.0 : 49.0
+}
+///tabbar安全高度
+func safeTabBarHeight() -> CGFloat {
+    return isIphoneX() ? 34.0 : 0.0
+}
+///状态栏顶部的高度
+private func statusBarTopHeight() -> CGFloat {
+    return isIphoneX() ? kStatusBarHeight : 0.0
+}
+///是不是.iPhoneX,.iPhoneXr,.iPhoneXs,.iPhoneXsMax
+private func isIphoneX() -> Bool {
+    
+    let groupOfAllowedDevices: [Device] = [.iPhoneX,.iPhoneXr,.iPhoneXs,.iPhoneXsMax,.simulator(.iPhoneX),.simulator(.iPhoneXr),.simulator(.iPhoneXs),.simulator(.iPhoneXsMax)]
+    let device = Device()
+    if device.isOneOf(groupOfAllowedDevices) {
+        return true
+    }else {
+        return false
+    }
+}
+
+//MARK: - 返回本地图片
+/// 返回本地图片
+///
+/// - Parameter name: 图片名字
+/// - Returns: 图片
+func kImage(name :String) -> UIImage? {
+    return UIImage(named: name)
+}
+
+//MARK: - 返回url图片
+/// 返回url图片
+///
+/// - Parameter name: 图片url
+/// - Returns: 图片
+func kURLImage(name :String) -> URL? {
+    return URL(string: name)
+}
+
+//MARK: - 返回一个颜色
+/// 返回一个颜色
+///
+/// - Parameters:
+///   - r: 红色
+///   - g: 黄
+///   - b: 蓝色
+/// - Returns: 颜色
+func kRGBColor(r:Float , g:Float , b:Float) -> UIColor {
+    return UIColor(red: (CGFloat(r/255.0)), green: (CGFloat(g/255.0)), blue: (CGFloat(b/255.0)), alpha: 1.0)
+}
+
+//MARK: - 返回一个颜色
+/// 返回一个颜色
+///
+/// - Parameters:
+///   - r: 红色
+///   - g: 黄
+///   - b: 蓝色
+///   - a: 透明度
+/// - Returns: 颜色
+func kRGBAColor(r:Float , g:Float , b:Float, a:Float) -> UIColor {
+    return UIColor(red: (CGFloat(r/255.0)), green: (CGFloat(g/255.0)), blue: (CGFloat(b/255.0)), alpha: CGFloat(a))
+}
+
+
+
+/// 代码延迟运行
+///
+/// - Parameters:
+///   - delayTime: 延时时间。比如:.seconds(5)、.milliseconds(500)
+///   - qosClass: 要使用的全局QOS类(默认为 nil,表示主线程)
+///   - closure: 延迟运行的代码
+func delay(by delayTime: TimeInterval, qosClass: DispatchQoS.QoSClass? = nil,
+           _ closure: @escaping () -> Void) {
+    let dispatchQueue = qosClass != nil ? DispatchQueue.global(qos: qosClass!) : .main
+    dispatchQueue.asyncAfter(deadline: DispatchTime.now() + delayTime, execute: closure)
+}
+
+func getCurrentVC() -> UIViewController {
+    let keywindow = (UIApplication.shared.delegate as! AppDelegate).window//UIApplication.shared.keyWindow使用此有时会崩溃
+    let firstView: UIView = (keywindow?.subviews.first)!
+    let secondView: UIView = firstView.subviews.first!
+    var vc = viewForController(view: secondView)!
+    vc = ((vc as! UITabBarController).selectedViewController! as! UINavigationController).visibleViewController!
+
+    return vc
+}
+
+private func viewForController(view:UIView)->UIViewController?{
+    var next:UIView? = view
+    repeat{
+        if let nextResponder = next?.next, nextResponder is UIViewController {
+            return (nextResponder as! UIViewController)
+        }
+        next = next?.superview
+    }while next != nil
+    return nil
+}

+ 32 - 0
RainbowPlanet/RainbowPlanet/Define/CreaditPayment-Bridging-Header.h

@@ -0,0 +1,32 @@
+//
+//  RainbowPlanet-Bridging-Header.h
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/3/7.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+#ifndef RainbowPlanet_Bridging_Header_h
+#define RainbowPlanet_Bridging_Header_h
+
+//提示框
+#import <MBProgressHUD/MBProgressHUD.h>
+#import "UIBarButtonItem+SXCreate.h"
+
+
+//友盟
+#import <UMCommon/UMCommon.h>
+#import <UMPush/UMessage.h>
+#import <UMShare/UMShare.h>
+#import <UMAnalytics/MobClick.h>
+#import <UMCommonLog/UMCommonLogHeaders.h>
+#import <UMShare/UMShare.h>
+#import <UShareUI/UShareUI.h>
+
+//百度定位
+#import <BMKLocationkit/BMKLocationComponent.h>
+
+//异常上报
+#import <Bugly/Bugly.h>
+
+#endif /* RainbowPlanet_Bridging_Header_h */

+ 9 - 0
RainbowPlanet/RainbowPlanet/Define/EnumMacro.swift

@@ -0,0 +1,9 @@
+//
+//  EnumMacro.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2018/11/17.
+//  Copyright © 2018 南鑫林. All rights reserved.
+//
+
+import Foundation

+ 150 - 0
RainbowPlanet/RainbowPlanet/Define/FontMacro.swift

@@ -0,0 +1,150 @@
+//
+//  FontMacro.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2018/12/11.
+//  Copyright © 2018 南鑫林. All rights reserved.
+//
+
+import UIKit
+
+let kBoldFont10 = UIFont.boldSystemFont(ofSize: 10)
+let kBoldFont11 = UIFont.boldSystemFont(ofSize: 11)
+let kBoldFont12 = UIFont.boldSystemFont(ofSize: 12)
+let kBoldFont13 = UIFont.boldSystemFont(ofSize: 13)
+let kBoldFont14 = UIFont.boldSystemFont(ofSize: 14)
+let kBoldFont15 = UIFont.boldSystemFont(ofSize: 15)
+let kBoldFont16 = UIFont.boldSystemFont(ofSize: 16)
+let kBoldFont17 = UIFont.boldSystemFont(ofSize: 17)
+let kBoldFont18 = UIFont.boldSystemFont(ofSize: 18)
+let kBoldFont19 = UIFont.boldSystemFont(ofSize: 19)
+let kBoldFont20 = UIFont.boldSystemFont(ofSize: 20)
+let kBoldFont21 = UIFont.boldSystemFont(ofSize: 21)
+let kBoldFont30 = UIFont.boldSystemFont(ofSize: 30)
+let kBoldFont36 = UIFont.boldSystemFont(ofSize: 36)
+let kBoldFont40 = UIFont.boldSystemFont(ofSize: 40)
+
+let kMediumFont10 = UIFont(name: "PingFang-SC-Medium", size: 10)
+let kMediumFont11 = UIFont(name: "PingFang-SC-Medium", size: 11)
+let kMediumFont12 = UIFont(name: "PingFang-SC-Medium", size: 12)
+let kMediumFont13 = UIFont(name: "PingFang-SC-Medium", size: 13)
+let kMediumFont14 = UIFont(name: "PingFang-SC-Medium", size: 14)
+let kMediumFont15 = UIFont(name: "PingFang-SC-Medium", size: 15)
+let kMediumFont16 = UIFont(name: "PingFang-SC-Medium", size: 16)
+let kMediumFont17 = UIFont(name: "PingFang-SC-Medium", size: 17)
+let kMediumFont18 = UIFont(name: "PingFang-SC-Medium", size: 18)
+let kMediumFont24 = UIFont(name: "PingFang-SC-Medium", size: 24)
+let kMediumFont25 = UIFont(name: "PingFang-SC-Medium", size: 25)
+let kMediumFont27 = UIFont(name: "PingFang-SC-Medium", size: 27)
+let kMediumFont30 = UIFont(name: "PingFang-SC-Medium", size: 30)
+let kMediumFont35 = UIFont(name: "PingFang-SC-Medium", size: 35)
+
+let kRegularFont12 = UIFont(name: "PingFang-SC-Regular", size: 12)
+let kRegularFont13 = UIFont(name: "PingFang-SC-Regular", size: 13)
+let kRegularFont14 = UIFont(name: "PingFang-SC-Regular", size: 14)
+let kRegularFont15 = UIFont(name: "PingFang-SC-Regular", size: 15)
+let kRegularFont16 = UIFont(name: "PingFang-SC-Regular", size: 16)
+let kRegularFont17 = UIFont(name: "PingFang-SC-Regular", size: 17)
+
+let kDINMEDIUMFont10 = UIFont(name: "DIN-MEDIUM", size: 10)
+let kDINMEDIUMFont11 = UIFont(name: "DIN-MEDIUM", size: 11)
+let kDINMEDIUMFont12 = UIFont(name: "DIN-MEDIUM", size: 12)
+let kDINMEDIUMFont13 = UIFont(name: "DIN-MEDIUM", size: 13)
+let kDINMEDIUMFont14 = UIFont(name: "DIN-MEDIUM", size: 14)
+let kDINMEDIUMFont15 = UIFont(name: "DIN-MEDIUM", size: 15)
+let kDINMEDIUMFont16 = UIFont(name: "DIN-MEDIUM", size: 16)
+let kDINMEDIUMFont17 = UIFont(name: "DIN-MEDIUM", size: 17)
+let kDINMEDIUMFont18 = UIFont(name: "DIN-MEDIUM", size: 18)
+let kDINMEDIUMFont19 = UIFont(name: "DIN-MEDIUM", size: 19)
+let kDINMEDIUMFont20 = UIFont(name: "DIN-MEDIUM", size: 20)
+let kDINMEDIUMFont21 = UIFont(name: "DIN-MEDIUM", size: 21)
+let kDINMEDIUMFont22 = UIFont(name: "DIN-MEDIUM", size: 22)
+let kDINMEDIUMFont23 = UIFont(name: "DIN-MEDIUM", size: 23)
+let kDINMEDIUMFont24 = UIFont(name: "DIN-MEDIUM", size: 24)
+let kDINMEDIUMFont25 = UIFont(name: "DIN-MEDIUM", size: 25)
+let kDINMEDIUMFont26 = UIFont(name: "DIN-MEDIUM", size: 26)
+let kDINMEDIUMFont27 = UIFont(name: "DIN-MEDIUM", size: 27)
+let kDINMEDIUMFont28 = UIFont(name: "DIN-MEDIUM", size: 28)
+let kDINMEDIUMFont29 = UIFont(name: "DIN-MEDIUM", size: 29)
+let kDINMEDIUMFont30 = UIFont(name: "DIN-MEDIUM", size: 30)
+let kDINMEDIUMFont31 = UIFont(name: "DIN-MEDIUM", size: 31)
+let kDINMEDIUMFont32 = UIFont(name: "DIN-MEDIUM", size: 32)
+let kDINMEDIUMFont33 = UIFont(name: "DIN-MEDIUM", size: 33)
+let kDINMEDIUMFont34 = UIFont(name: "DIN-MEDIUM", size: 34)
+let kDINMEDIUMFont35 = UIFont(name: "DIN-MEDIUM", size: 35)
+let kDINMEDIUMFont36 = UIFont(name: "DIN-MEDIUM", size: 36)
+let kDINMEDIUMFont37 = UIFont(name: "DIN-MEDIUM", size: 37)
+let kDINMEDIUMFont38 = UIFont(name: "DIN-MEDIUM", size: 38)
+let kDINMEDIUMFont39 = UIFont(name: "DIN-MEDIUM", size: 39)
+let kDINMEDIUMFont40 = UIFont(name: "DIN-MEDIUM", size: 40)
+
+let kScaleBoldFont10 = UIFont.boldSystemFont(ofSize: kScaleValue(value: 10))
+let kScaleBoldFont11 = UIFont.boldSystemFont(ofSize: kScaleValue(value: 11))
+let kScaleBoldFont12 = UIFont.boldSystemFont(ofSize: kScaleValue(value: 12))
+let kScaleBoldFont13 = UIFont.boldSystemFont(ofSize: kScaleValue(value: 13))
+let kScaleBoldFont14 = UIFont.boldSystemFont(ofSize: kScaleValue(value: 14))
+let kScaleBoldFont15 = UIFont.boldSystemFont(ofSize: kScaleValue(value: 15))
+let kScaleBoldFont16 = UIFont.boldSystemFont(ofSize: kScaleValue(value: 16))
+let kScaleBoldFont17 = UIFont.boldSystemFont(ofSize: kScaleValue(value: 17))
+let kScaleBoldFont18 = UIFont.boldSystemFont(ofSize: kScaleValue(value: 18))
+let kScaleBoldFont19 = UIFont.boldSystemFont(ofSize: kScaleValue(value: 19))
+let kScaleBoldFont20 = UIFont.boldSystemFont(ofSize: kScaleValue(value: 20))
+let kScaleBoldFont21 = UIFont.boldSystemFont(ofSize: kScaleValue(value: 21))
+let kScaleBoldFont30 = UIFont.boldSystemFont(ofSize: kScaleValue(value: 30))
+let kScaleBoldFont36 = UIFont.boldSystemFont(ofSize: kScaleValue(value: 36))
+let kScaleBoldFont40 = UIFont.boldSystemFont(ofSize: kScaleValue(value: 40))
+
+let kScaleMediumFont10 = UIFont(name: "PingFang-SC-Medium", size: kScaleValue(value: 10))
+let kScaleMediumFont11 = UIFont(name: "PingFang-SC-Medium", size: kScaleValue(value: 11))
+let kScaleMediumFont12 = UIFont(name: "PingFang-SC-Medium", size: kScaleValue(value: 12))
+let kScaleMediumFont13 = UIFont(name: "PingFang-SC-Medium", size: kScaleValue(value: 13))
+let kScaleMediumFont14 = UIFont(name: "PingFang-SC-Medium", size: kScaleValue(value: 14))
+let kScaleMediumFont15 = UIFont(name: "PingFang-SC-Medium", size: kScaleValue(value: 15))
+let kScaleMediumFont16 = UIFont(name: "PingFang-SC-Medium", size: kScaleValue(value: 16))
+let kScaleMediumFont17 = UIFont(name: "PingFang-SC-Medium", size: kScaleValue(value: 17))
+let kScaleMediumFont18 = UIFont(name: "PingFang-SC-Medium", size: kScaleValue(value: 18))
+let kScaleMediumFont24 = UIFont(name: "PingFang-SC-Medium", size: kScaleValue(value: 24))
+let kScaleMediumFont25 = UIFont(name: "PingFang-SC-Medium", size: kScaleValue(value: 25))
+let kScaleMediumFont27 = UIFont(name: "PingFang-SC-Medium", size: kScaleValue(value: 27))
+let kScaleMediumFont30 = UIFont(name: "PingFang-SC-Medium", size: kScaleValue(value: 30))
+let kScaleMediumFont35 = UIFont(name: "PingFang-SC-Medium", size: kScaleValue(value: 35))
+
+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))
+let kScaleRegularFont15 = UIFont(name: "PingFang-SC-Regular", size: kScaleValue(value: 15))
+let kScaleRegularFont16 = UIFont(name: "PingFang-SC-Regular", size: kScaleValue(value: 16))
+let kScaleRegularFont17 = UIFont(name: "PingFang-SC-Regular", size: kScaleValue(value: 17))
+let kScaleRegularFont19 = UIFont(name: "PingFang-SC-Regular", size: kScaleValue(value: 19))
+
+let kScaleDINMEDIUMFont10 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 10))
+let kScaleDINMEDIUMFont11 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 11))
+let kScaleDINMEDIUMFont12 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 12))
+let kScaleDINMEDIUMFont13 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 13))
+let kScaleDINMEDIUMFont14 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 14))
+let kScaleDINMEDIUMFont15 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 15))
+let kScaleDINMEDIUMFont16 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 16))
+let kScaleDINMEDIUMFont17 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 17))
+let kScaleDINMEDIUMFont18 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 18))
+let kScaleDINMEDIUMFont19 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 19))
+let kScaleDINMEDIUMFont20 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 20))
+let kScaleDINMEDIUMFont21 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 21))
+let kScaleDINMEDIUMFont22 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 22))
+let kScaleDINMEDIUMFont23 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 23))
+let kScaleDINMEDIUMFont24 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 24))
+let kScaleDINMEDIUMFont25 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 25))
+let kScaleDINMEDIUMFont26 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 26))
+let kScaleDINMEDIUMFont27 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 27))
+let kScaleDINMEDIUMFont28 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 28))
+let kScaleDINMEDIUMFont29 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 29))
+let kScaleDINMEDIUMFont30 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 30))
+let kScaleDINMEDIUMFont31 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 31))
+let kScaleDINMEDIUMFont32 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 32))
+let kScaleDINMEDIUMFont33 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 33))
+let kScaleDINMEDIUMFont34 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 34))
+let kScaleDINMEDIUMFont35 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 35))
+let kScaleDINMEDIUMFont36 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 36))
+let kScaleDINMEDIUMFont37 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 37))
+let kScaleDINMEDIUMFont38 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 38))
+let kScaleDINMEDIUMFont39 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 39))
+let kScaleDINMEDIUMFont40 = UIFont(name: "DIN-MEDIUM", size: kScaleValue(value: 40))

+ 14 - 0
RainbowPlanet/RainbowPlanet/Define/HTMLURLMacro.swift

@@ -0,0 +1,14 @@
+//
+//  HTMLURLMacro.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2018/10/17.
+//  Copyright © 2018 南鑫林. All rights reserved.
+//
+
+import Foundation
+
+/// 给我们我们评分
+let kAppStoreReview = "https://itunes.apple.com/cn/app/1166892045?action=write-review"
+
+

+ 19 - 0
RainbowPlanet/RainbowPlanet/Define/NotificationCenterMacro.swift

@@ -0,0 +1,19 @@
+//
+//  NotificationCenterMacro.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/1/4.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import Foundation
+
+
+/// 定位
+let kLocationModelChangeNotificationName = Notification.Name(rawValue: "LocationModelChange")
+
+/// 我的页面监听数据改变
+let kMineUserQueryModelTokenModelChangeNotificationName = Notification.Name(rawValue: "kMineUserQueryModelTokenModelChangeNotificationName")
+
+/// 银行卡列表页面
+let kBankCardListViewControllerNotificationName = Notification.Name(rawValue: "kBankCardListViewControllerNotificationName")

+ 32 - 0
RainbowPlanet/RainbowPlanet/Define/ThirdPartyMacro.swift

@@ -0,0 +1,32 @@
+//
+//  ThirdPartyMacro.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2018/7/13.
+//  Copyright © 2018年 南鑫林. All rights reserved.
+//
+
+import Foundation
+
+//MARK: -  bugly
+let kBuglyAppId  = "dea0c63442"
+let kBuglyAppKey  = "475526b6-2b02-4810-972b-1bdbf853d8fe"
+
+//MARK: - UMeng
+let kUMengAppKey  = "5b3dbd078f4a9d5c100000c1"
+
+//MARK: - QQ跟安卓用同一个
+let kQQAppKey =  "1105803948"
+let kQQAppSecret = "aUosPQs1khVAcmB7"
+
+//MARK: - 微信
+let kWeiXinAppKey  = "wx647d93490caf548f"
+let kWeiXinAppSecret = "c5dc884f79a1bb00e96d76a3e16da39a"
+
+//MARK: - 微博
+let kWeiboAppKey  = "2824278574"
+let kWeiboAppSecret  = "0be988a21b045ecf948ba5838b72f689"
+
+//MARK: - 百度地图
+let kBaiduMapAppKey  = "UhUyWpGF9ZGUn8uo4vOpyoO7GRjk1Q70"
+

+ 0 - 13
RainbowPlanet/RainbowPlanet/Macro/RainbowPlanet-Bridging-Header.h

@@ -1,13 +0,0 @@
-//
-//  RainbowPlanet-Bridging-Header.h
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/3/6.
-//  Copyright © 2019 南鑫林. All rights reserved.
-//
-
-#ifndef RainbowPlanet_Bridging_Header_h
-#define RainbowPlanet_Bridging_Header_h
-
-
-#endif /* RainbowPlanet_Bridging_Header_h */

+ 91 - 0
RainbowPlanet/RainbowPlanet/Manager/BaiduMapManager/BaiduMapManager.swift

@@ -0,0 +1,91 @@
+//
+//  BaiduMapManager.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2018/10/17.
+//  Copyright © 2018 南鑫林. All rights reserved.
+//
+
+import UIKit
+
+class BaiduMapManager: NSObject {
+    private static let _sharedInstance = BaiduMapManager()
+
+    var completionBlock : BMKLocatingCompletionBlock?
+
+    class func getSharedInstance() -> BaiduMapManager {
+        return _sharedInstance
+    }
+
+    private override init() {} // 私有化init方法
+
+    func initLocation() -> Void {
+        initBlock()
+        self.locationManager.requestLocation(withReGeocode: true, withNetworkState: true, completionBlock: self.completionBlock!)
+
+    }
+
+    func initBlock() -> Void {
+        completionBlock = { location, state, error in
+            if error != nil {
+                LocationModel.setLocationModel(locationModel: LocationModel.getLocationModel()!)
+            } else {
+                let locationModel = LocationModel.init(latitude: String(describing: location!.location!.coordinate.latitude), longitude: String(describing: location!.location!.coordinate.longitude), cityCode: location!.rgcData!.cityCode ?? "", province: location!.rgcData!.province ?? "", city: location!.rgcData!.city ?? "", district: location!.rgcData!.district ?? "", street: location!.rgcData!.street ?? "", locationDescribe: location!.rgcData!.locationDescribe ?? "")
+                LocationModel.setLocationModel(locationModel: locationModel)
+            }
+        }
+    }
+
+    lazy var locationManager: BMKLocationManager = {
+        let locationManager = BMKLocationManager.init()
+        //设置delegate
+        locationManager.delegate = self
+        //设置返回位置的坐标系类型
+        locationManager.coordinateType = BMKLocationCoordinateType.BMK09LL
+        //设置距离过滤参数
+        locationManager.distanceFilter = kCLDistanceFilterNone
+        //设置预期精度参数
+        locationManager.desiredAccuracy = kCLLocationAccuracyBest
+        //设置应用位置类型
+        locationManager.activityType = CLActivityType.automotiveNavigation
+        //设置是否自动停止位置更新
+        locationManager.pausesLocationUpdatesAutomatically = false
+        //设置是否允许后台定位
+        locationManager.allowsBackgroundLocationUpdates = true
+        //设置位置获取超时时间
+        locationManager.locationTimeout = 10
+        //设置获取地址信息超时时间
+        locationManager.reGeocodeTimeout = 10
+        return locationManager
+    }()
+
+
+}
+
+extension BaiduMapManager:BMKLocationManagerDelegate {
+
+    ///  当定位发生错误时,会调用代理的此方法。
+    func bmkLocationManager(_ manager: BMKLocationManager, didFailWithError error: Error?) {
+        NXLLog("定位错误");
+        LocationModel.setLocationModel(locationModel: LocationModel.getLocationModel()!)
+
+    }
+
+    /// 定位权限状态改变时回调函数
+    func bmkLocationManager(_ manager: BMKLocationManager, didChange status: CLAuthorizationStatus) {
+        NXLLog("定位权限改变时候的回调");
+    }
+}
+
+extension BaiduMapManager: BMKLocationAuthDelegate {
+
+    func onCheckPermissionState(_ iError: BMKLocationAuthErrorCode) {
+        if (0 == iError.rawValue) {
+            NXLLog("授权成功");
+        } else {
+            NXLLog("授权失败 \(iError)");
+            LocationModel.setLocationModel(locationModel: LocationModel.getLocationModel()!)
+
+        }
+    }
+}

+ 112 - 0
RainbowPlanet/RainbowPlanet/Manager/BaiduMapManager/LocationModel.swift

@@ -0,0 +1,112 @@
+//
+//  LocationModel.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2018/10/17.
+//  Copyright © 2018 南鑫林. All rights reserved.
+//
+
+import UIKit
+
+class LocationModel: NSObject,NSCoding {
+
+    /// 纬度
+    var latitude : String? = ""
+    /// 经度
+    var longitude : String? = ""
+    /// 城市code
+    var cityCode : String? = ""
+    /// 省
+    var province : String? = ""
+    /// 城市
+    var city : String? = ""
+    /// 区
+    var district : String? = ""
+    /// 街道
+    var street : String? = ""
+    /// 详细描述
+    var locationDescribe : String? = ""
+
+
+    /// 构造方法
+    ///
+    /// - Parameters:
+    ///   - latitude: 纬度
+    ///   - longitude: 经度
+    ///   - city: 城市
+    ///   - cityCode: 城市code
+    required init(latitude:String="", longitude:String="",cityCode:String="",province:String="",city:String="",district : String = "",street : String = "",locationDescribe : String = "" ) {
+        self.latitude = latitude
+        self.longitude = longitude
+        self.cityCode = cityCode
+        self.province = province
+        self.city = city
+        self.district = district
+        self.street = street
+        self.locationDescribe = locationDescribe
+    }
+
+
+    /// 反归档
+    ///
+    /// - Parameter decoder: 反编码值
+    required init(coder decoder: NSCoder) {
+        self.latitude = decoder.decodeObject(forKey: "latitude") as? String ?? ""
+        self.longitude = decoder.decodeObject(forKey: "longitude") as? String ?? ""
+        self.cityCode = decoder.decodeObject(forKey: "cityCode") as? String ?? ""
+        self.province = decoder.decodeObject(forKey: "province") as? String ?? ""
+        self.city = decoder.decodeObject(forKey: "city") as? String ?? ""
+        self.district = decoder.decodeObject(forKey: "district") as? String ?? ""
+        self.street = decoder.decodeObject(forKey: "street") as? String ?? ""
+        self.locationDescribe = decoder.decodeObject(forKey: "locationDescribe") as? String ?? ""
+    }
+
+
+    /// 归档
+    ///
+    /// - Parameter aCoder: 归档值
+    func encode(with aCoder: NSCoder) {
+        aCoder.encode(self.latitude, forKey:"latitude")
+        aCoder.encode(self.longitude, forKey:"longitude")
+        aCoder.encode(self.cityCode, forKey:"cityCode")
+        aCoder.encode(self.province, forKey:"province")
+        aCoder.encode(self.city, forKey:"city")
+        aCoder.encode(self.district, forKey:"district")
+        aCoder.encode(self.street, forKey:"street")
+        aCoder.encode(self.locationDescribe, forKey:"locationDescribe")
+
+    }
+
+
+    /// 存储定位信息
+    ///
+    /// - Parameter locationModel: 定位模型
+    class func setLocationModel(locationModel:LocationModel) -> Void {
+        //实例对象转换成Data
+        let modelData = NSKeyedArchiver.archivedData(withRootObject: locationModel)
+        //存储Data对象
+        UserDefaults.standard.set(modelData, forKey: "LocationModel")
+    }
+
+
+    /// 获取定位信息
+    ///
+    /// - Returns: 定位模型
+    class func getLocationModel() -> LocationModel? {
+        //自定义对象读取
+        let modelData = UserDefaults.standard.data(forKey: "LocationModel")
+        let locationModel : LocationModel?
+        if modelData != nil {
+            locationModel = NSKeyedUnarchiver.unarchiveObject(with: modelData!) as? LocationModel
+        }else {
+            locationModel = self.init(latitude: "36.20630464252636", longitude: "113.07274820385199", cityCode: "140411", province: "山西省", city: "长治市", district: "郊区", street: "西外环路", locationDescribe: "在暴马村新兴小区附近")
+        }
+        NXLLog(locationModel?.toString()) 
+         return locationModel
+    }
+
+    func toString() -> String {
+        return self.province!+self.city!+self.district!+self.street!+self.locationDescribe!
+    }
+
+}

+ 222 - 0
RainbowPlanet/RainbowPlanet/Manager/UMManager/UMManager.swift

@@ -0,0 +1,222 @@
+//
+//  UMManager.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/3/7.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import UIKit
+
+enum ShareType {
+    case text
+    case image
+    case webPage
+}
+
+class UMManager: NSObject {
+    private static let sharedInstance = UMManager()
+
+    /// 单例
+    ///
+    /// - Returns: UMShareManager对象
+    class func shared() -> UMManager {
+        return sharedInstance
+    }
+
+    private override init() {} // 私有化init方法
+
+
+    /// 分享设置
+    func share() -> Void {
+        /*
+         设置微信的appKey和appSecret
+         [微信平台从U-Share 4/5升级说明]http://dev.umeng.com/social/ios/%E8%BF%9B%E9%98%B6%E6%96%87%E6%A1%A3#1_1
+         */
+        UMSocialManager.default().setPlaform(UMSocialPlatformType.wechatSession, appKey: kWeiXinAppKey, appSecret: kWeiXinAppSecret, redirectURL: nil)
+
+        /*
+         * 移除相应平台的分享,如微信收藏
+         */
+        UMSocialManager.default().removePlatformProvider(with: UMSocialPlatformType(rawValue: UMSocialPlatformType.RawValue(UInt8(UMSocialPlatformType.wechatFavorite.rawValue)|UInt8(UMSocialPlatformType.qzone.rawValue)))!)
+        /* 设置分享到QQ互联的appID
+         * U-Share SDK为了兼容大部分平台命名,统一用appKey和appSecret进行参数设置,而QQ平台仅需将appID作为U-Share的appKey参数传进即可。
+         100424468.no permission of union id
+         [QQ/QZone平台集成说明]http://dev.umeng.com/social/ios/%E8%BF%9B%E9%98%B6%E6%96%87%E6%A1%A3#1_3
+         */
+        UMSocialManager.default().setPlaform(UMSocialPlatformType.QQ, appKey: kQQAppKey, appSecret: kQQAppSecret, redirectURL: nil)
+        /*
+         设置新浪的appKey和appSecret
+         [新浪微博集成说明]http://dev.umeng.com/social/ios/%E8%BF%9B%E9%98%B6%E6%96%87%E6%A1%A3#1_2
+         */
+        UMSocialManager.default().setPlaform(UMSocialPlatformType.sina, appKey: kQQAppKey, appSecret: kQQAppSecret, redirectURL: "https://sns.whalecloud.com/sina2/callback")
+    }
+
+    /// 分享面板
+    ///
+    /// - Parameters:
+    ///   - shareType: 平台
+    ///   - viewController: 控制器
+    ///   - text: 分享文本
+    ///   - thumbImage: 缩略图
+    ///   - shareImage: 分享图
+    ///   - title: 标题
+    ///   - descr: 内容描述
+    ///   - webpageUrl: 链接地址
+    func UMSocialUI(shareType:ShareType, viewController:UIViewController,text:String,thumbImage:Any,shareImage:Any,title:String,descr:String,webpageUrl:String) -> Void {
+
+        UMSocialUIManager.showShareMenuViewInWindow(platformSelectionBlock: {[weak self] platformType, userInfo in
+            switch shareType {
+            case .text:
+                self?.shareText(to: platformType, viewController: viewController,text: text)
+                break
+            case .image:
+                self?.shareImage(to: platformType, viewController: viewController,thumbImage: thumbImage,shareImage: shareImage)
+                break
+            case .webPage:
+                self?.shareWebPage(to: platformType, viewController: viewController,title: title,descr: descr, thumbImage: thumbImage,webpageUrl: webpageUrl)
+                break
+            }
+        })
+    }
+
+    /// 分享文本
+    ///
+    /// - Parameters:
+    ///   - platformType: 平台
+    ///   - viewController: 控制器
+    ///   - text: 分享文本
+    func shareText(to platformType: UMSocialPlatformType,viewController:UIViewController,text:String) {
+        //创建分享消息对象
+        let messageObject = UMSocialMessageObject()
+        //设置文本
+        messageObject.text = text
+
+        //调用分享接口
+        UMSocialManager.default().share(to: platformType, messageObject: messageObject, currentViewController: viewController) { data, error in
+            if error != nil {
+                if let anError = error {
+                    print("************Share fail with error \(anError)*********")
+                }
+            } else {
+                if let aData = data {
+                    print("response data is \(aData)")
+                }
+            }
+        }
+    }
+
+    /// 分享图片
+    ///
+    /// - Parameters:
+    ///   - platformType: 平台
+    ///   - viewController: 控制器
+    ///   - thumbImage: 缩略图
+    ///   - shareImage: 分享图
+    func shareImage(to platformType: UMSocialPlatformType,viewController:UIViewController,thumbImage:Any,shareImage:Any) {
+        //创建分享消息对象
+        let messageObject = UMSocialMessageObject()
+
+        //创建图片内容对象
+        let shareObject = UMShareImageObject()
+        //如果有缩略图,则设置缩略图
+        shareObject.thumbImage = thumbImage
+        shareObject.shareImage = shareImage
+
+        //分享消息对象设置分享内容对象
+        messageObject.shareObject = shareObject
+
+        //调用分享接口
+        UMSocialManager.default().share(to: platformType, messageObject: messageObject, currentViewController: viewController) { data, error in
+            if error != nil {
+                if let anError = error {
+                    print("************Share fail with error \(anError)*********")
+                }
+            } else {
+                if let aData = data {
+                    print("response data is \(aData)")
+                }
+            }
+        }
+    }
+
+    /// 分享网页
+    ///
+    /// - Parameters:
+    ///   - platformType: 平台
+    ///   - viewController: 控制器
+    ///   - title: 标题
+    ///   - descr: 内容描述
+    ///   - thumbImage: 缩略图
+    ///   - webpageUrl: 链接地址
+    func shareWebPage(to platformType: UMSocialPlatformType,viewController:UIViewController,title:String,descr:String,thumbImage:Any,webpageUrl:String) {
+        //创建分享消息对象
+        let messageObject = UMSocialMessageObject()
+
+        //创建网页内容对象
+        let shareObject = UMShareWebpageObject.shareObject(withTitle: title, descr: descr, thumImage: thumbImage)
+        //设置网页地址
+        shareObject!.webpageUrl = webpageUrl
+
+        //分享消息对象设置分享内容对象
+        messageObject.shareObject = shareObject
+
+        //调用分享接口
+        UMSocialManager.default().share(to: platformType, messageObject: messageObject, currentViewController: viewController) { data, error in
+            if error != nil {
+                if let anError = error {
+                    print("************Share fail with error \(anError)*********")
+                }
+            } else {
+                if let aData = data {
+                    print("response data is \(aData)")
+                }
+            }
+        }
+    }
+
+    /// 第三方登录
+    ///
+    /// - Parameter platformType: 平台
+    func loginGetUserInfo(platformType: UMSocialPlatformType) {
+        UMSocialManager.default().getUserInfo(with: platformType, currentViewController: nil) { result, error in
+
+            let resp = result as? UMSocialUserInfoResponse
+
+            // 第三方登录数据(为空表示平台未提供)
+            // 授权数据
+            if let anUid = resp?.uid {
+                print(" uid: \(anUid)")
+            }
+            if let anOpenid = resp?.openid {
+                print(" openid: \(anOpenid)")
+            }
+            if let aToken = resp?.accessToken {
+                print(" accessToken: \(aToken)")
+            }
+            if let aToken = resp?.refreshToken {
+                print(" refreshToken: \(aToken)")
+            }
+            if let anExpiration = resp?.expiration {
+                print(" expiration: \(anExpiration)")
+            }
+
+            // 用户数据
+            if let aName = resp?.name {
+                print(" name: \(aName)")
+            }
+            if let anIconurl = resp?.iconurl {
+                print(" iconurl: \(anIconurl)")
+            }
+            if let aGender = resp?.unionGender {
+                print(" gender: \(aGender)")
+            }
+
+            // 第三方平台SDK原始数据
+            if let aResponse = resp?.originalResponse {
+                print(" originalResponse: \(aResponse)")
+            }
+        }
+    }
+}
+

+ 3 - 9
RainbowPlanet/RainbowPlanet/Modules/MineModule/Mine/ViewController/MineViewController.swift

@@ -16,15 +16,9 @@ class MineViewController: RootViewController {
         // Do any additional setup after loading the view.
     }
 
-
-    /*
-    // MARK: - Navigation
-
-    // In a storyboard-based application, you will often want to do a little preparation before navigation
-    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
-        // Get the new view controller using segue.destination.
-        // Pass the selected object to the new view controller.
+    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
+        let v = ShoppingCartViewController()
+        self.navigationController?.pushViewController(v, animated: true)
     }
-    */
 
 }

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

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

+ 23 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/NavigationBarIcons/navigaitionbar_back_black.imageset/Contents.json

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

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/NavigationBarIcons/navigaitionbar_back_black.imageset/navigaitionbar_back_black.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/NavigationBarIcons/navigaitionbar_back_black.imageset/navigaitionbar_back_black@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/NavigationBarIcons/navigaitionbar_back_black.imageset/navigaitionbar_back_black@3x.png


+ 23 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/NavigationBarIcons/navigaitionbar_back_blue.imageset/Contents.json

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

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/NavigationBarIcons/navigaitionbar_back_blue.imageset/navigaitionbar_back_blue.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/NavigationBarIcons/navigaitionbar_back_blue.imageset/navigaitionbar_back_blue@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/NavigationBarIcons/navigaitionbar_back_blue.imageset/navigaitionbar_back_blue@3x.png


+ 23 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/NavigationBarIcons/navigaitionbar_back_white.imageset/Contents.json

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

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/NavigationBarIcons/navigaitionbar_back_white.imageset/navigaitionbar_back_white.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/NavigationBarIcons/navigaitionbar_back_white.imageset/navigaitionbar_back_white@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/NavigationBarIcons/navigaitionbar_back_white.imageset/navigaitionbar_back_white@3x.png


+ 22 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/find.imageset/Contents.json

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

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/find.imageset/find.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/find.imageset/find@2x.png


+ 22 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/find_1.imageset/Contents.json

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

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/find_1.imageset/find_1.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/find_1.imageset/find_1@2x.png


+ 22 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/home.imageset/Contents.json

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

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/home.imageset/home.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/home.imageset/home@2x.png


+ 22 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/home_1.imageset/Contents.json

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

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/home_1.imageset/home_1.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/home_1.imageset/home_1@2x.png


+ 22 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/shop.imageset/Contents.json

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

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/shop.imageset/shop.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/shop.imageset/shop@2x.png


+ 22 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/shop_1.imageset/Contents.json

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

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/shop_1.imageset/shop_1.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/shop_1.imageset/shop_1@2x.png


+ 26 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_financialManagement_icon_normal.imageset/Contents.json

@@ -0,0 +1,26 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "tab_financialManagement_icon_normal.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "tab_financialManagement_icon_normal@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "tab_financialManagement_icon_normal@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  },
+  "properties" : {
+    "template-rendering-intent" : "original"
+  }
+}

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_financialManagement_icon_normal.imageset/tab_financialManagement_icon_normal.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_financialManagement_icon_normal.imageset/tab_financialManagement_icon_normal@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_financialManagement_icon_normal.imageset/tab_financialManagement_icon_normal@3x.png


+ 26 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_financialManagement_icon_selected.imageset/Contents.json

@@ -0,0 +1,26 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "tab_financialManagement_icon_selected.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "tab_financialManagement_icon_selected@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "tab_financialManagement_icon_selected@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  },
+  "properties" : {
+    "template-rendering-intent" : "original"
+  }
+}

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_financialManagement_icon_selected.imageset/tab_financialManagement_icon_selected.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_financialManagement_icon_selected.imageset/tab_financialManagement_icon_selected@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_financialManagement_icon_selected.imageset/tab_financialManagement_icon_selected@3x.png


+ 26 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_home_icon_normal.imageset/Contents.json

@@ -0,0 +1,26 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "tab_home_icon_normal.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "tab_home_icon_normal@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "tab_home_icon_normal@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  },
+  "properties" : {
+    "template-rendering-intent" : "original"
+  }
+}

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_home_icon_normal.imageset/tab_home_icon_normal.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_home_icon_normal.imageset/tab_home_icon_normal@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_home_icon_normal.imageset/tab_home_icon_normal@3x.png


+ 26 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_home_icon_selected.imageset/Contents.json

@@ -0,0 +1,26 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "tab_home_icon_selected.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "tab_home_icon_selected@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "tab_home_icon_selected@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  },
+  "properties" : {
+    "template-rendering-intent" : "original"
+  }
+}

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_home_icon_selected.imageset/tab_home_icon_selected.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_home_icon_selected.imageset/tab_home_icon_selected@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_home_icon_selected.imageset/tab_home_icon_selected@3x.png


+ 26 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_me_icon_normal.imageset/Contents.json

@@ -0,0 +1,26 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "tab_me_icon_normal.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "tab_me_icon_normal@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "tab_me_icon_normal@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  },
+  "properties" : {
+    "template-rendering-intent" : "original"
+  }
+}

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_me_icon_normal.imageset/tab_me_icon_normal.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_me_icon_normal.imageset/tab_me_icon_normal@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_me_icon_normal.imageset/tab_me_icon_normal@3x.png


+ 26 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_me_icon_selected.imageset/Contents.json

@@ -0,0 +1,26 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "tab_me_icon_selected.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "tab_me_icon_selected@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "tab_me_icon_selected@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  },
+  "properties" : {
+    "template-rendering-intent" : "original"
+  }
+}

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_me_icon_selected.imageset/tab_me_icon_selected.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_me_icon_selected.imageset/tab_me_icon_selected@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_me_icon_selected.imageset/tab_me_icon_selected@3x.png


+ 26 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_shopping_icon_normal.imageset/Contents.json

@@ -0,0 +1,26 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "tab_shopping_icon_normal.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "tab_shopping_icon_normal@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "tab_shopping_icon_normal@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  },
+  "properties" : {
+    "template-rendering-intent" : "original"
+  }
+}

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_shopping_icon_normal.imageset/tab_shopping_icon_normal.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_shopping_icon_normal.imageset/tab_shopping_icon_normal@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_shopping_icon_normal.imageset/tab_shopping_icon_normal@3x.png


+ 26 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_shopping_icon_selected.imageset/Contents.json

@@ -0,0 +1,26 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "tab_shopping_icon_selected.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "tab_shopping_icon_selected@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "tab_shopping_icon_selected@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  },
+  "properties" : {
+    "template-rendering-intent" : "original"
+  }
+}

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_shopping_icon_selected.imageset/tab_shopping_icon_selected.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_shopping_icon_selected.imageset/tab_shopping_icon_selected@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/TabbarIcons/tab_shopping_icon_selected.imageset/tab_shopping_icon_selected@3x.png


+ 2 - 128
RainbowPlanet/RainbowPlanet/Supporting Files/Info.plist

@@ -4,6 +4,8 @@
 <dict>
 	<key>CFBundleDevelopmentRegion</key>
 	<string>$(DEVELOPMENT_LANGUAGE)</string>
+	<key>CFBundleDisplayName</key>
+	<string>彩虹星球</string>
 	<key>CFBundleExecutable</key>
 	<string>$(EXECUTABLE_NAME)</string>
 	<key>CFBundleIdentifier</key>
@@ -16,138 +18,10 @@
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
 	<string>1.0</string>
-	<key>CFBundleURLTypes</key>
-	<array>
-		<dict>
-			<key>CFBundleTypeRole</key>
-			<string>Editor</string>
-			<key>CFBundleURLSchemes</key>
-			<array>
-				<string>rainbowplanet</string>
-			</array>
-		</dict>
-	</array>
 	<key>CFBundleVersion</key>
 	<string>1</string>
-	<key>LSApplicationQueriesSchemes</key>
-	<array>
-		<string>wechat</string>
-		<string>weixin</string>
-		<string>sinaweibohd</string>
-		<string>sinaweibo</string>
-		<string>sinaweibosso</string>
-		<string>weibosdk</string>
-		<string>weibosdk2.5</string>
-		<string>mqqapi</string>
-		<string>mqq</string>
-		<string>mqqOpensdkSSoLogin</string>
-		<string>mqqconnect</string>
-		<string>mqqopensdkdataline</string>
-		<string>mqqopensdkgrouptribeshare</string>
-		<string>mqqopensdkfriend</string>
-		<string>mqqopensdkapi</string>
-		<string>mqqopensdkapiV2</string>
-		<string>mqqopensdkapiV3</string>
-		<string>mqqopensdkapiV4</string>
-		<string>mqzoneopensdk</string>
-		<string>wtloginmqq</string>
-		<string>wtloginmqq2</string>
-		<string>mqqwpa</string>
-		<string>mqzone</string>
-		<string>mqzonev2</string>
-		<string>mqzoneshare</string>
-		<string>wtloginqzone</string>
-		<string>mqzonewx</string>
-		<string>mqzoneopensdkapiV2</string>
-		<string>mqzoneopensdkapi19</string>
-		<string>mqzoneopensdkapi</string>
-		<string>mqqbrowser</string>
-		<string>mttbrowser</string>
-		<string>tim</string>
-		<string>timapi</string>
-		<string>timopensdkfriend</string>
-		<string>timwpa</string>
-		<string>timgamebindinggroup</string>
-		<string>timapiwallet</string>
-		<string>timOpensdkSSoLogin</string>
-		<string>wtlogintim</string>
-		<string>timopensdkgrouptribeshare</string>
-		<string>timopensdkapiV4</string>
-		<string>timgamebindinggroup</string>
-		<string>timopensdkdataline</string>
-		<string>wtlogintimV1</string>
-		<string>timapiV1</string>
-		<string>alipay</string>
-		<string>alipayshare</string>
-	</array>
 	<key>LSRequiresIPhoneOS</key>
 	<true/>
-	<key>NSAppTransportSecurity</key>
-	<dict>
-		<key>NSAllowsArbitraryLoads</key>
-		<true/>
-		<key>NSExceptionDomains</key>
-		<dict>
-			<key>sina.cn</key>
-			<dict>
-				<key>NSExceptionMinimumTLSVersion</key>
-				<string>TLSv1.0</string>
-				<key>NSIncludesSubdomains</key>
-				<true/>
-				<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
-				<false/>
-			</dict>
-			<key>sina.com.cn</key>
-			<dict>
-				<key>NSIncludesSubdomains</key>
-				<true/>
-				<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
-				<true/>
-				<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
-				<false/>
-			</dict>
-			<key>sinaimg.cn</key>
-			<dict>
-				<key>NSIncludesSubdomains</key>
-				<true/>
-				<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
-				<true/>
-				<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
-				<false/>
-			</dict>
-			<key>sinajs.cn</key>
-			<dict>
-				<key>NSIncludesSubdomains</key>
-				<true/>
-				<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
-				<true/>
-				<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
-				<false/>
-			</dict>
-			<key>weibo.cn</key>
-			<dict>
-				<key>NSExceptionMinimumTLSVersion</key>
-				<string>TLSv1.0</string>
-				<key>NSIncludesSubdomains</key>
-				<true/>
-				<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
-				<false/>
-			</dict>
-			<key>weibo.com</key>
-			<dict>
-				<key>NSExceptionMinimumTLSVersion</key>
-				<string>TLSv1.0</string>
-				<key>NSIncludesSubdomains</key>
-				<true/>
-				<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
-				<true/>
-				<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
-				<false/>
-			</dict>
-		</dict>
-	</dict>
-	<key>NSPhotoLibraryUsageDescription</key>
-	<string>App需要您的同意,才能访问相册</string>
 	<key>UIRequiredDeviceCapabilities</key>
 	<array>
 		<string>armv7</string>

+ 46 - 0
RainbowPlanet/RainbowPlanet/Tools/AlertView/BAAlertController/BAAlertController.h

@@ -0,0 +1,46 @@
+//
+//  BAAlertController.h
+//  BAAlertController
+//
+//  Created by boai on 2017/6/5.
+//  Copyright © 2017年 boai. All rights reserved.
+//
+
+#ifndef BAAlertController_h
+#define BAAlertController_h
+
+#import "UIAlertController+BAKit.h"
+#import "NSObject+BARunTime.h"
+#import "NSMutableAttributedString+BAKit.h"
+
+/*!
+ *********************************************************************************
+ ************************************ 更新说明 ************************************
+ *********************************************************************************
+ 
+ 欢迎使用 BAHome 系列开源代码 !
+ 如有更多需求,请前往:https://github.com/BAHome
+ 
+ 项目源码地址:
+ OC 版 :https://github.com/BAHome/BAAlertController
+ 
+ 最新更新时间:2017-06-24 【倒叙】<br>
+ 最新Version:【Version:1.0.1】<br>
+ 更新内容:<br>
+ 1.0.0.1、更换方法名,原:ba_alert2ShowInViewController 替换为:ba_alertTextFieldShowInViewController<br>
+ 
+ 最新更新时间:2017-06-05 【倒叙】
+ 最新Version:【Version:1.0.0】
+ 更新内容:
+ 1.0.0.1、普通的 UIAlertController-alert,可以自由设置按钮数量、按钮颜色
+ 1.0.0.2、普通的 UIAlertController-alert,可以自由设置按钮数量、按钮颜色【多按钮样式,颜色数组和title数组个数不等】
+ 1.0.0.3、普通的 带 textField 的 UIAlertController-alert,可添加一个或者多个 textField
+ 1.0.0.4、NSMutableAttributedString 的UIAlertController-alert,可以自由设置 NSMutableAttributedString(title、message)按钮数量、按钮颜色
+ 1.0.0.5、普通的 UIAlertController-actionSheet,可以自由设置按钮数量、按钮颜色
+ 1.0.0.6、NSMutableAttributedString 的UIAlertController-actionSheet,可以自由设置 NSMutableAttributedString(title、message)按钮数量、按钮颜色
+ 1.0.0.7、完美适配 iPhone 和 iPad 版本
+ 1.0.0.8、理论完全兼容现有 iOS 8 以上系统版本
+ 
+ */
+
+#endif /* BAAlertController_h */

+ 108 - 0
RainbowPlanet/RainbowPlanet/Tools/AlertView/BAAlertController/NSObject+BARunTime.h

@@ -0,0 +1,108 @@
+
+/*!
+ *  @header BAKit.h
+ *          BABaseProject
+ *
+ *  @brief  BAKit
+ *
+ *  @author 博爱
+ *  @copyright    Copyright © 2016年 博爱. All rights reserved.
+ *  @version    V1.0
+ */
+
+//                            _ooOoo_
+//                           o8888888o
+//                           88" . "88
+//                           (| -_- |)
+//                            O\ = /O
+//                        ____/`---'\____
+//                      .   ' \\| |// `.
+//                       / \\||| : |||// \
+//                     / _||||| -:- |||||- \
+//                       | | \\\ - /// | |
+//                     | \_| ''\---/'' | |
+//                      \ .-\__ `-` ___/-. /
+//                   ___`. .' /--.--\ `. . __
+//                ."" '< `.___\_<|>_/___.' >'"".
+//               | | : `- \`.;`\ _ /`;.`/ - ` : | |
+//                 \ \ `-. \_ __\ /__ _/ .-` / /
+//         ======`-.____`-.___\_____/___.-`____.-'======
+//                            `=---='
+//
+//         .............................................
+//                  佛祖镇楼                  BUG辟易
+//          佛曰:
+//                  写字楼里写字间,写字间里程序员;
+//                  程序人员写程序,又拿程序换酒钱。
+//                  酒醒只在网上坐,酒醉还来网下眠;
+//                  酒醉酒醒日复日,网上网下年复年。
+//                  但愿老死电脑间,不愿鞠躬老板前;
+//                  奔驰宝马贵者趣,公交自行程序员。
+//                  别人笑我忒疯癫,我笑自己命太贱;
+//                  不见满街漂亮妹,哪个归得程序员?
+
+/*
+ 
+ *********************************************************************************
+ *
+ * 在使用BAKit的过程中如果出现bug请及时以以下任意一种方式联系我,我会及时修复bug
+ *
+ * QQ     : 可以添加ios开发技术群 479663605 在这里找到我(博爱1616【137361770】)
+ * 微博    : 博爱1616
+ * Email  : 137361770@qq.com
+ * GitHub : https://github.com/boai
+ * 博客    : http://boaihome.com
+ 
+ *********************************************************************************
+ 
+ */
+
+/**
+ *  - 添加运行时分类方法
+ *  - 用于运行时动态获取当前类的属性列表、方法列表、成员变量列表、协议列表
+ *  - 性能优化
+ */
+#import <Foundation/Foundation.h>
+
+@interface NSObject (BARunTime)
+
+/**
+ *  将 ‘字典数组‘ 转换成当前模型的对象数组
+ *
+ *  @param array 字典数组
+ *
+ *  @return 返回模型对象的数组
+ */
++ (NSArray *)ba_objectsWithArray:(NSArray *)array;
+
+/**
+ *  返回当前类的所有属性列表
+ *
+ *  @return 属性名称
+ */
++ (NSArray *)ba_propertysList;
+
+/**
+ *  返回当前类的所有成员变量数组
+ *
+ *  @return 当前类的所有成员变量! 
+ *
+ *  Tips:用于调试, 可以尝试查看所有不开源的类的ivar
+ */
++ (NSArray *)ba_ivarList;
+
+/**
+ *  返回当前类的所有方法
+ *
+ *  @return 当前类的所有成员变量!
+ */
++ (NSArray *)ba_methodList;
+
+/**
+ *  返回当前类的所有协议
+ *
+ *  @return 当前类的所有协议!
+ */
++ (NSArray *)ba_protocolList;
+
+@end

+ 268 - 0
RainbowPlanet/RainbowPlanet/Tools/AlertView/BAAlertController/NSObject+BARunTime.m

@@ -0,0 +1,268 @@
+
+/*!
+ *  @header BAKit.h
+ *          BABaseProject
+ *
+ *  @brief  BAKit
+ *
+ *  @author 博爱
+ *  @copyright    Copyright © 2016年 博爱. All rights reserved.
+ *  @version    V1.0
+ */
+
+//                            _ooOoo_
+//                           o8888888o
+//                           88" . "88
+//                           (| -_- |)
+//                            O\ = /O
+//                        ____/`---'\____
+//                      .   ' \\| |// `.
+//                       / \\||| : |||// \
+//                     / _||||| -:- |||||- \
+//                       | | \\\ - /// | |
+//                     | \_| ''\---/'' | |
+//                      \ .-\__ `-` ___/-. /
+//                   ___`. .' /--.--\ `. . __
+//                ."" '< `.___\_<|>_/___.' >'"".
+//               | | : `- \`.;`\ _ /`;.`/ - ` : | |
+//                 \ \ `-. \_ __\ /__ _/ .-` / /
+//         ======`-.____`-.___\_____/___.-`____.-'======
+//                            `=---='
+//
+//         .............................................
+//                  佛祖镇楼                  BUG辟易
+//          佛曰:
+//                  写字楼里写字间,写字间里程序员;
+//                  程序人员写程序,又拿程序换酒钱。
+//                  酒醒只在网上坐,酒醉还来网下眠;
+//                  酒醉酒醒日复日,网上网下年复年。
+//                  但愿老死电脑间,不愿鞠躬老板前;
+//                  奔驰宝马贵者趣,公交自行程序员。
+//                  别人笑我忒疯癫,我笑自己命太贱;
+//                  不见满街漂亮妹,哪个归得程序员?
+
+/*
+ 
+ *********************************************************************************
+ *
+ * 在使用BAKit的过程中如果出现bug请及时以以下任意一种方式联系我,我会及时修复bug
+ *
+ * QQ     : 可以添加ios开发技术群 479663605 在这里找到我(博爱1616【137361770】)
+ * 微博    : 博爱1616
+ * Email  : 137361770@qq.com
+ * GitHub : https://github.com/boai
+ * 博客园  : http://www.cnblogs.com/boai/
+ * 博客    : http://boai.github.io
+ * 简书    : http://www.jianshu.com/users/95c9800fdf47/latest_articles
+ * 简书专题 : http://www.jianshu.com/collection/072d578bf782
+ 
+ *********************************************************************************
+ 
+ */
+
+
+#import "NSObject+BARunTime.h"
+#import <objc/runtime.h>
+
+@implementation NSObject (BARunTime)
+
+#pragma mark - 根据传递进来的所有字典数组 字典转模型
++ (NSArray *)ba_objectsWithArray:(NSArray *)array
+{
+    if (array.count == 0)
+    {
+        return nil;
+    }
+    
+    // 判断是否是字典数组
+    NSAssert([array[0] isKindOfClass:[NSDictionary class]], @"必须传入字典数组");
+    
+    // 获取属性列表数组
+    NSArray *propertyList = [self ba_propertysList];
+    
+    NSMutableArray *arrayM = [NSMutableArray array];
+  
+    for (NSDictionary *dict in array)
+    {
+        // 创建模型
+        id model = [self new];
+        
+        // 遍历数组
+        for (NSString *key in dict)
+        {
+            // 判断属性列表数组中是否包含当前key 如果有, 意味着属性存在
+            if ([propertyList containsObject:key]) {
+                // 字典转模型
+                [model setValue:dict[key] forKey:key];
+            }
+        }
+        // 添加到可变数组中
+        [arrayM addObject:model];
+    }
+    return arrayM.copy;
+}
+
+#pragma mark - 获取本类所有 ‘属性‘ 的数组
+/** 程序运行的时候动态的获取当前类的属性列表 
+ *  程序运行的时候,类的属性不会变化
+ */
+const void *ba_propertyListKey = @"ba_propertyListKey";
++ (NSArray *)ba_propertysList
+{
+    NSArray *result = objc_getAssociatedObject(self, ba_propertyListKey);
+    
+    if (result != nil)
+    {
+        return result;
+    }
+    
+    NSMutableArray *arrayM = [NSMutableArray array];
+    // 获取当前类的属性数组
+    // count -> 属性的数量
+    unsigned int count = 0;
+   objc_property_t *list = class_copyPropertyList([self class], &count);
+    
+    for (unsigned int i = 0; i < count; i++) {
+        // 根据下标获取属性
+        objc_property_t property = list[i];
+        
+        // 获取属性的名字
+        const char *cName = property_getName(property);
+        
+        // 转换成OC字符串
+        NSString *name = [NSString stringWithUTF8String:cName];
+        [arrayM addObject:name];
+    }
+    
+    /*! ⚠️注意: 一定要释放数组 class_copyPropertyList底层为C语言,所以我们一定要记得释放properties */
+    free(list);
+    
+    // ---保存属性数组对象---
+    objc_setAssociatedObject(self, ba_propertyListKey, arrayM, OBJC_ASSOCIATION_COPY_NONATOMIC);
+    
+    return objc_getAssociatedObject(self, ba_propertyListKey);
+}
+
+#pragma mark - 获取本类所有 ‘方法‘ 的数组
+const void *ba_methodListKey = "ba_methodListKey";
++ (NSArray *)ba_methodList
+{
+    // 1. 使用运行时动态添加属性
+    NSArray *methodsList = objc_getAssociatedObject(self, ba_methodListKey);
+    
+    // 2. 如果数组中直接返回方法数组
+    if (methodsList != nil)
+    {
+        return methodsList;
+    }
+    
+    // 3. 获取当前类的方法数组
+    unsigned int count = 0;
+    Method *list = class_copyMethodList([self class], &count);
+    
+    NSMutableArray *arrayM = [NSMutableArray array];
+    for (unsigned int i = 0; i < count; i++)
+    {
+        // 根据下标获取方法
+        Method method = list[i];
+        
+       SEL methodName = method_getName(method);
+        
+        NSString *methodName_OC = NSStringFromSelector(methodName);
+        
+//        IMP imp = method_getImplementation(method);
+        const char *name_s =sel_getName(method_getName(method));
+        int arguments = method_getNumberOfArguments(method);
+        const char* encoding =method_getTypeEncoding(method);
+        NSLog(@"方法名:%@,参数个数:%d,编码方式:%@",[NSString stringWithUTF8String:name_s],
+              arguments,
+              [NSString stringWithUTF8String:encoding]);
+        
+        [arrayM addObject:methodName_OC];
+    }
+    
+    // 4. 释放数组
+    free(list);
+    
+    // 5. 保存方法的数组对象
+    objc_setAssociatedObject(self, ba_methodListKey, arrayM, OBJC_ASSOCIATION_COPY_NONATOMIC);
+    
+    return objc_getAssociatedObject(self, ba_methodListKey);
+}
+
+
+#pragma mark - 获取本类所有 ‘成员变量‘ 的数组 <用来调试>
+/** 获取当前类的所有成员变量 */
+const char *ba_ivarListKey = "ba_ivarListKey";
++ (NSArray *)ba_ivarList
+{
+   
+    // 1. 查询根据key 保存的成员变量数组
+    NSArray *ivarList = objc_getAssociatedObject(self, ba_ivarListKey);
+    
+    // 2. 判断数组中是否有值, 如果有直接返回
+    if (ivarList != nil)
+    {
+        return ivarList;
+    }
+    
+    // 3. 如果数组中没有, 则根据当前类,获取当前类的所有 ‘成员变量‘
+    unsigned int count = 0;
+    Ivar *ivars = class_copyIvarList([self class], &count);
+    
+    // 4. 遍历 成员变量 数组, 获取成员变量的名
+    NSMutableArray *arrayM = [NSMutableArray array];
+    for (unsigned int i = 0; i < count; i++) {
+        Ivar ivar = ivars[i];
+        // - C语言的字符串都是 ‘char *‘ 类型的
+        const char *ivarName_C = ivar_getName(ivar);
+        
+        // - 将 C语言的字符串 转换成 OC字符串
+        NSString *ivarName_OC = [NSString stringWithUTF8String:ivarName_C];
+        // - 将本类 ‘成员变量名‘ 添加到数组
+        [arrayM addObject:ivarName_OC];
+    }
+    
+    // 5. 释放ivars
+    free(ivars);
+    
+    // 6. 根据key 动态获取保存在关联对象中的数组
+    objc_setAssociatedObject(self, ba_ivarListKey, arrayM, OBJC_ASSOCIATION_COPY_NONATOMIC);
+    
+    return objc_getAssociatedObject(self, ba_ivarListKey);
+}
+
+#pragma mark - 获取本类所有 ‘协议‘ 的数组
+/** 用来获取动态保存在关联对象中的协议数组 |运行时的关联对象根据key动态取值| */
+const char *ba_protocolListKey = "ba_protocolListKey";
+
++ (NSArray *)ba_protocolList {
+    NSArray *protocolList = objc_getAssociatedObject(self, ba_protocolListKey);
+    if (protocolList != nil)
+    {
+        return protocolList;
+    }
+    
+    unsigned int count = 0;
+    Protocol * __unsafe_unretained *protocolLists = class_copyProtocolList([self class], &count);
+    
+    NSMutableArray *arrayM = [NSMutableArray array];
+    for (unsigned int i = 0; i < count; i++) {
+        // 获取 协议名
+        Protocol *protocol = protocolLists[i];
+        const char *protocolName_C = protocol_getName(protocol);
+        NSString *protocolName_OC = [NSString stringWithUTF8String:protocolName_C];
+        
+        // 将 协议名 添加到数组
+        [arrayM addObject:protocolName_OC];
+    }
+    
+    // 释放数组
+    free(protocolLists);
+    // 将保存 协议的数组动态添加到 关联对象
+    objc_setAssociatedObject(self, ba_protocolListKey, arrayM, OBJC_ASSOCIATION_COPY_NONATOMIC);
+    
+    return objc_getAssociatedObject(self, ba_protocolListKey);
+}
+
+@end

+ 190 - 0
RainbowPlanet/RainbowPlanet/Tools/AlertView/BAAlertController/UIAlertController+BAKit.h

@@ -0,0 +1,190 @@
+
+/*!
+ *  @header BAKit.h
+ *          BABaseProject
+ *
+ *  @brief  BAKit
+ *
+ *  @author 博爱
+ *  @copyright    Copyright © 2016年 博爱. All rights reserved.
+ *  @version    V1.0
+ */
+
+//                            _ooOoo_
+//                           o8888888o
+//                           88" . "88
+//                           (| -_- |)
+//                            O\ = /O
+//                        ____/`---'\____
+//                      .   ' \\| |// `.
+//                       / \\||| : |||// \
+//                     / _||||| -:- |||||- \
+//                       | | \\\ - /// | |
+//                     | \_| ''\---/'' | |
+//                      \ .-\__ `-` ___/-. /
+//                   ___`. .' /--.--\ `. . __
+//                ."" '< `.___\_<|>_/___.' >'"".
+//               | | : `- \`.;`\ _ /`;.`/ - ` : | |
+//                 \ \ `-. \_ __\ /__ _/ .-` / /
+//         ======`-.____`-.___\_____/___.-`____.-'======
+//                            `=---='
+//
+//         .............................................
+//                  佛祖镇楼                  BUG辟易
+//          佛曰:
+//                  写字楼里写字间,写字间里程序员;
+//                  程序人员写程序,又拿程序换酒钱。
+//                  酒醒只在网上坐,酒醉还来网下眠;
+//                  酒醉酒醒日复日,网上网下年复年。
+//                  但愿老死电脑间,不愿鞠躬老板前;
+//                  奔驰宝马贵者趣,公交自行程序员。
+//                  别人笑我忒疯癫,我笑自己命太贱;
+//                  不见满街漂亮妹,哪个归得程序员?
+
+/*
+ 
+ *********************************************************************************
+ *
+ * 在使用BAKit的过程中如果出现bug请及时以以下任意一种方式联系我,我会及时修复bug
+ *
+ * QQ     : 可以添加ios开发技术群 479663605 在这里找到我(博爱1616【137361770】)
+ * 微博    : 博爱1616
+ * Email  : 137361770@qq.com
+ * GitHub : https://github.com/boai
+ * 博客    : http://boaihome.com
+ 
+ *********************************************************************************
+ 
+ */
+
+#import <UIKit/UIKit.h>
+
+#if TARGET_OS_IOS
+typedef void (^UIAlertControllerPopoverPresentationControllerBlock) (UIPopoverPresentationController * __nonnull popover);
+#endif
+
+/**
+ 按钮点击事件 block
+
+ @param alertController alertController
+ @param action UIAlertAction
+ @param buttonIndex buttonIndex
+ */
+typedef void (^BAKit_AlertControllerButtonActionBlock) (UIAlertController * __nonnull alertController, UIAlertAction * __nonnull action, NSInteger buttonIndex);
+
+/**
+ textField 配置信息 block
+
+ @param textField textField
+ @param index index
+ */
+typedef void (^BAKit_AlertControllerTextFieldConfigurationActionBlock)(UITextField * _Nullable textField, NSInteger index);
+
+@interface UIAlertController (BAKit)
+
+/**
+ 快速创建一个系统 普通 UIAlertController-Alert
+ 
+ @param viewController 显示的VC
+ @param title title
+ @param message message
+ @param buttonTitleArray 按钮数组
+ @param buttonTitleColorArray 按钮颜色数组,默认:系统蓝色,如果颜色数组个数小于title数组个数,则全部为默认蓝色
+ @param block block
+ @return UIAlertController-Alert
+ */
++ (nonnull instancetype)ba_alertShowInViewController:(nonnull UIViewController *)viewController
+                                               title:(nullable NSString *)title
+                                             message:(nullable NSString *)message
+                                    buttonTitleArray:(nullable NSArray *)buttonTitleArray
+                               buttonTitleColorArray:(nullable NSArray <UIColor *>*)buttonTitleColorArray
+                                               block:(nullable BAKit_AlertControllerButtonActionBlock)block;
+
+/**
+ 快速创建一个系统 普通 带 textField 的 UIAlertController-Alert
+ 
+ @param viewController 显示的VC
+ @param title title
+ @param message message
+ @param buttonTitleArray 按钮数组
+ @param buttonTitleColorArray 按钮颜色数组,默认:系统蓝色,如果颜色数组个数小于title数组个数,则全部为默认蓝色
+ @param buttonEnabledNoWithTitleArray 初始化的时候按钮为 EnabledNo 状态 的 title 数组
+ @param textFieldPlaceholderArray textFieldPlaceholderArray 需要添加的 textField placeholder 数组
+ @param textFieldConfigurationActionBlock textField 配置信息 block
+ @param block block
+ @return 普通 带 textField 的 UIAlertController-Alert
+ */
++ (nonnull instancetype)ba_alertTextFieldShowInViewController:(nonnull UIViewController *)viewController
+                                                        title:(nullable NSString *)title
+                                                      message:(nullable NSString *)message
+                                             buttonTitleArray:(nullable NSArray *)buttonTitleArray
+                                        buttonTitleColorArray:(nullable NSArray <UIColor *> *)buttonTitleColorArray
+                                buttonEnabledNoWithTitleArray:(NSArray <NSString *> *_Nullable)buttonEnabledNoWithTitleArray
+                                    textFieldPlaceholderArray:(NSArray <NSString *> *_Nullable)textFieldPlaceholderArray
+                            textFieldConfigurationActionBlock:(nullable BAKit_AlertControllerTextFieldConfigurationActionBlock)textFieldConfigurationActionBlock
+                                                        block:(nullable BAKit_AlertControllerButtonActionBlock)block;
+
+/**
+ 快速创建一个系统 attributedTitle UIAlertController-Alert
+ 
+ @param viewController 显示的VC
+ @param attributedTitle attributedTitle
+ @param attributedMessage attributedMessage
+ @param buttonTitleArray 按钮数组
+ @param buttonTitleColorArray 按钮颜色数组,默认:系统蓝色,如果颜色数组个数小于title数组个数,则全部为默认蓝色
+ @param block block
+ @return UIAlertController-Alert
+ */
++ (nonnull instancetype)ba_alertAttributedShowInViewController:(nonnull UIViewController *)viewController
+                                               attributedTitle:(nullable NSMutableAttributedString *)attributedTitle
+                                             attributedMessage:(nullable NSMutableAttributedString *)attributedMessage
+                                              buttonTitleArray:(nullable NSArray *)buttonTitleArray
+                                         buttonTitleColorArray:(nullable NSArray <UIColor *>*)buttonTitleColorArray
+                                                         block:(nullable BAKit_AlertControllerButtonActionBlock)block;
+
+
+/**
+ 快速创建一个系统 普通 UIAlertController-ActionSheet
+ 
+ @param viewController 显示的VC
+ @param title title
+ @param message message
+ @param buttonTitleArray 按钮数组
+ @param buttonTitleColorArray 按钮颜色数组,默认:系统蓝色,如果颜色数组个数小于title数组个数,则全部为默认蓝色
+ @param popoverPresentationControllerBlock popoverPresentationControllerBlock description
+ @param block block
+ @return UIAlertController-ActionSheet
+ */
++ (nonnull instancetype)ba_actionSheetShowInViewController:(nonnull UIViewController *)viewController
+                                                                title:(nullable NSString *)title
+                                                                  message:(nullable NSString *)message
+                                                        buttonTitleArray:(nullable NSArray *)buttonTitleArray
+                                                    buttonTitleColorArray:(nullable NSArray <UIColor *>*)buttonTitleColorArray
+#if TARGET_OS_IOS
+                                       popoverPresentationControllerBlock:(nullable UIAlertControllerPopoverPresentationControllerBlock)popoverPresentationControllerBlock
+#endif
+                                                                block:(nullable BAKit_AlertControllerButtonActionBlock)block;
+
+/**
+ 快速创建一个系统 attributedTitle UIAlertController-ActionSheet
+ 
+ @param viewController 显示的VC
+ @param attributedTitle attributedTitle
+ @param attributedMessage attributedMessage
+ @param buttonTitleArray 按钮数组
+ @param buttonTitleColorArray 按钮颜色数组,默认:系统蓝色,如果颜色数组个数小于title数组个数,则全部为默认蓝色
+ @param popoverPresentationControllerBlock popoverPresentationControllerBlock description
+ @param block block
+ @return UIAlertController-ActionSheet
+ */
++ (nonnull instancetype)ba_actionSheetAttributedShowInViewController:(nonnull UIViewController *)viewController
+                                                     attributedTitle:(nullable NSMutableAttributedString *)attributedTitle
+                                                   attributedMessage:(nullable NSMutableAttributedString *)attributedMessage
+                                                    buttonTitleArray:(nullable NSArray *)buttonTitleArray
+                                               buttonTitleColorArray:(nullable NSArray <UIColor *>*)buttonTitleColorArray
+#if TARGET_OS_IOS
+                                  popoverPresentationControllerBlock:(nullable UIAlertControllerPopoverPresentationControllerBlock)popoverPresentationControllerBlock
+#endif
+                                                               block:(nullable BAKit_AlertControllerButtonActionBlock)block;
+
+@end

+ 377 - 0
RainbowPlanet/RainbowPlanet/Tools/AlertView/BAAlertController/UIAlertController+BAKit.m

@@ -0,0 +1,377 @@
+
+//
+//  BAAlertController.h
+//  BAAlertController
+//
+//  Created by boai on 2017/6/5.
+//  Copyright © 2017年 boai. All rights reserved.
+//
+
+#import "UIAlertController+BAKit.h"
+#import <Foundation/Foundation.h>
+#import "NSObject+BARunTime.h"
+
+#import "BAAlertController.h"
+
+@interface UIViewController (BAKit)
+
+- (UIViewController *)ba_currentViewController;
+
+@end
+
+@implementation UIAlertController (BAKit)
+
+
+/**
+ 快速创建一个系统 普通 UIAlertController-Alert
+ 
+ @param viewController 显示的VC
+ @param title title
+ @param message message
+ @param buttonTitleArray 按钮数组
+ @param buttonTitleColorArray 按钮颜色数组,默认:系统蓝色,如果颜色数组个数小于title数组个数,则全部为默认蓝色
+ @param block block
+ @return UIAlertController-Alert
+ */
++ (nonnull instancetype)ba_alertShowInViewController:(nonnull UIViewController *)viewController
+                                               title:(nullable NSString *)title
+                                             message:(nullable NSString *)message
+                                    buttonTitleArray:(nullable NSArray *)buttonTitleArray
+                               buttonTitleColorArray:(nullable NSArray <UIColor *>*)buttonTitleColorArray
+                                               block:(nullable BAKit_AlertControllerButtonActionBlock)block
+{
+    return [self ba_alertControllerShowInViewController:viewController
+                                                  title:title
+                                        attributedTitle:nil
+                                                message:message
+                                      attributedMessage:nil
+                                         preferredStyle:UIAlertControllerStyleAlert
+                                       buttonTitleArray:buttonTitleArray
+                                  buttonTitleColorArray:buttonTitleColorArray
+                          buttonEnabledNoWithTitleArray:nil
+                              textFieldPlaceholderArray:nil
+                      textFieldConfigurationActionBlock:nil
+#if TARGET_OS_IOS
+                     popoverPresentationControllerBlock:nil
+#endif
+                                                  block:block];
+}
+
+/**
+ 快速创建一个系统 普通 带 textField 的 UIAlertController-Alert
+ 
+ @param viewController 显示的VC
+ @param title title
+ @param message message
+ @param buttonTitleArray 按钮数组
+ @param buttonTitleColorArray 按钮颜色数组,默认:系统蓝色,如果颜色数组个数小于title数组个数,则全部为默认蓝色
+ @param buttonEnabledNoWithTitleArray 初始化的时候按钮为 EnabledNo 状态 的 title 数组
+ @param textFieldPlaceholderArray textFieldPlaceholderArray 需要添加的 textField placeholder 数组
+ @param textFieldConfigurationActionBlock textField 配置信息 block
+ @param block block
+ @return 普通 带 textField 的 UIAlertController-Alert
+ */
++ (nonnull instancetype)ba_alertTextFieldShowInViewController:(nonnull UIViewController *)viewController
+                                                        title:(nullable NSString *)title
+                                                      message:(nullable NSString *)message
+                                             buttonTitleArray:(nullable NSArray *)buttonTitleArray
+                                        buttonTitleColorArray:(nullable NSArray <UIColor *> *)buttonTitleColorArray
+                                buttonEnabledNoWithTitleArray:(NSArray <NSString *> *_Nullable)buttonEnabledNoWithTitleArray
+                                    textFieldPlaceholderArray:(NSArray <NSString *> *_Nullable)textFieldPlaceholderArray
+                            textFieldConfigurationActionBlock:(nullable BAKit_AlertControllerTextFieldConfigurationActionBlock)textFieldConfigurationActionBlock
+                                                        block:(nullable BAKit_AlertControllerButtonActionBlock)block
+{
+    return [self ba_alertControllerShowInViewController:viewController
+                                                  title:title
+                                        attributedTitle:nil
+                                                message:message
+                                      attributedMessage:nil
+                                         preferredStyle:UIAlertControllerStyleAlert
+                                       buttonTitleArray:buttonTitleArray
+                                  buttonTitleColorArray:buttonTitleColorArray
+                          buttonEnabledNoWithTitleArray:buttonEnabledNoWithTitleArray
+                              textFieldPlaceholderArray:textFieldPlaceholderArray
+                      textFieldConfigurationActionBlock:textFieldConfigurationActionBlock
+#if TARGET_OS_IOS
+                     popoverPresentationControllerBlock:nil
+#endif
+                                                  block:block];
+}
+
+/**
+ 快速创建一个系统 attributedTitle UIAlertController-Alert
+ 
+ @param viewController 显示的VC
+ @param attributedTitle attributedTitle
+ @param attributedMessage attributedMessage
+ @param buttonTitleArray 按钮数组
+ @param buttonTitleColorArray 按钮颜色数组,默认:系统蓝色,如果颜色数组个数小于title数组个数,则全部为默认蓝色
+ @param block block
+ @return UIAlertController-Alert
+ */
++ (nonnull instancetype)ba_alertAttributedShowInViewController:(nonnull UIViewController *)viewController
+                                               attributedTitle:(nullable NSMutableAttributedString *)attributedTitle
+                                             attributedMessage:(nullable NSMutableAttributedString *)attributedMessage
+                                              buttonTitleArray:(nullable NSArray *)buttonTitleArray
+                                         buttonTitleColorArray:(nullable NSArray <UIColor *>*)buttonTitleColorArray
+                                                         block:(nullable BAKit_AlertControllerButtonActionBlock)block
+{
+    return [self ba_alertControllerShowInViewController:viewController
+                                                  title:nil
+                                        attributedTitle:attributedTitle
+                                                message:nil
+                                      attributedMessage:attributedMessage
+                                         preferredStyle:UIAlertControllerStyleAlert
+                                       buttonTitleArray:buttonTitleArray
+                                  buttonTitleColorArray:buttonTitleColorArray
+                          buttonEnabledNoWithTitleArray:nil
+                              textFieldPlaceholderArray:nil
+                      textFieldConfigurationActionBlock:nil
+#if TARGET_OS_IOS
+                     popoverPresentationControllerBlock:nil
+#endif
+                                                  block:block];
+}
+
+
+/**
+ 快速创建一个系统 普通 UIAlertController-ActionSheet
+ 
+ @param viewController 显示的VC
+ @param title title
+ @param message message
+ @param buttonTitleArray 按钮数组
+ @param buttonTitleColorArray 按钮颜色数组,默认:系统蓝色,如果颜色数组个数小于title数组个数,则全部为默认蓝色
+ @param popoverPresentationControllerBlock popoverPresentationControllerBlock description
+ @param block block
+ @return UIAlertController-ActionSheet
+ */
++ (nonnull instancetype)ba_actionSheetShowInViewController:(nonnull UIViewController *)viewController
+                                                     title:(nullable NSString *)title
+                                                   message:(nullable NSString *)message
+                                          buttonTitleArray:(nullable NSArray *)buttonTitleArray
+                                     buttonTitleColorArray:(nullable NSArray <UIColor *>*)buttonTitleColorArray
+#if TARGET_OS_IOS
+                        popoverPresentationControllerBlock:(nullable UIAlertControllerPopoverPresentationControllerBlock)popoverPresentationControllerBlock
+#endif
+                                                     block:(nullable BAKit_AlertControllerButtonActionBlock)block
+{
+    return [self ba_alertControllerShowInViewController:viewController
+                                                  title:title
+                                        attributedTitle:nil
+                                                message:message
+                                      attributedMessage:nil
+                                         preferredStyle:UIAlertControllerStyleActionSheet
+                                       buttonTitleArray:buttonTitleArray
+                                  buttonTitleColorArray:buttonTitleColorArray
+                          buttonEnabledNoWithTitleArray:nil
+                              textFieldPlaceholderArray:nil
+                      textFieldConfigurationActionBlock:nil
+#if TARGET_OS_IOS
+                     popoverPresentationControllerBlock:popoverPresentationControllerBlock
+#endif
+                                                  block:block];
+}
+
+/**
+ 快速创建一个系统 attributedTitle UIAlertController-ActionSheet
+ 
+ @param viewController 显示的VC
+ @param attributedTitle attributedTitle
+ @param attributedMessage attributedMessage
+ @param buttonTitleArray 按钮数组
+ @param buttonTitleColorArray 按钮颜色数组,默认:系统蓝色,如果颜色数组个数小于title数组个数,则全部为默认蓝色
+ @param popoverPresentationControllerBlock popoverPresentationControllerBlock description
+ @param block block
+ @return UIAlertController-ActionSheet
+ */
++ (nonnull instancetype)ba_actionSheetAttributedShowInViewController:(nonnull UIViewController *)viewController
+                                                     attributedTitle:(nullable NSMutableAttributedString *)attributedTitle
+                                                   attributedMessage:(nullable NSMutableAttributedString *)attributedMessage
+                                                    buttonTitleArray:(nullable NSArray *)buttonTitleArray
+                                               buttonTitleColorArray:(nullable NSArray <UIColor *>*)buttonTitleColorArray
+#if TARGET_OS_IOS
+                                  popoverPresentationControllerBlock:(nullable UIAlertControllerPopoverPresentationControllerBlock)popoverPresentationControllerBlock
+#endif
+                                                               block:(nullable BAKit_AlertControllerButtonActionBlock)block
+{
+    return [self ba_alertControllerShowInViewController:viewController
+                                                  title:nil
+                                        attributedTitle:attributedTitle
+                                                message:nil
+                                      attributedMessage:attributedMessage
+                                         preferredStyle:UIAlertControllerStyleActionSheet
+                                       buttonTitleArray:buttonTitleArray
+                                  buttonTitleColorArray:buttonTitleColorArray
+                          buttonEnabledNoWithTitleArray:nil
+                              textFieldPlaceholderArray:nil
+                      textFieldConfigurationActionBlock:nil
+#if TARGET_OS_IOS
+                     popoverPresentationControllerBlock:popoverPresentationControllerBlock
+#endif
+                                                  block:block];
+}
+
+
++ (instancetype)ba_alertControllerShowInViewController:(UIViewController *)viewController
+                                                 title:(NSString *)title
+                                       attributedTitle:(nullable NSMutableAttributedString *)attributedTitle
+                                               message:(NSString *)message
+                                     attributedMessage:(nullable NSMutableAttributedString *)attributedMessage
+                                        preferredStyle:(UIAlertControllerStyle)preferredStyle
+                                      buttonTitleArray:(nullable NSArray *)buttonTitleArray
+                                 buttonTitleColorArray:(nullable NSArray <UIColor *>*)buttonTitleColorArray
+                         buttonEnabledNoWithTitleArray:(NSArray <NSString *> *_Nullable)buttonEnabledNoWithTitleArray
+                             textFieldPlaceholderArray:(NSArray <NSString *> *_Nullable)textFieldPlaceholderArray
+                     textFieldConfigurationActionBlock:(nullable BAKit_AlertControllerTextFieldConfigurationActionBlock)textFieldConfigurationActionBlock
+#if TARGET_OS_IOS
+                    popoverPresentationControllerBlock:(void(^)(UIPopoverPresentationController *popover))popoverPresentationControllerBlock
+#endif
+                                                 block:(BAKit_AlertControllerButtonActionBlock)block
+{
+    UIAlertController *strongController = [self alertControllerWithTitle:title
+                                                                 message:message
+                                                          preferredStyle:preferredStyle];
+    
+    __weak UIAlertController *alertController = strongController;
+    
+    if (buttonTitleArray)
+    {
+        for (NSUInteger i = 0; i < buttonTitleArray.count; i++)
+        {
+            NSString *buttonTitle = buttonTitleArray[i];
+            
+            UIAlertAction *action = [UIAlertAction actionWithTitle:buttonTitle
+                                                             style:UIAlertActionStyleDefault
+                                                           handler:^(UIAlertAction *action){
+                                                                    if (block)
+                                                                    {
+                                                                        block(alertController, action, i);
+                                                                    }
+                                                                }];
+            [alertController addAction:action];
+            
+            for (NSInteger j = 0; j < buttonEnabledNoWithTitleArray.count; j ++)
+            {
+                if ([buttonEnabledNoWithTitleArray[j] isEqualToString:buttonTitle])
+                {
+                    action.enabled = NO;
+                }
+            }
+            
+            if (!buttonTitleColorArray || buttonTitleColorArray.count == 0 ||
+                buttonTitleColorArray.count < buttonTitleArray.count)
+            {
+                NSMutableArray *mutArr = [NSMutableArray array];
+                for (NSInteger i = 0; i < buttonTitleArray.count; i ++)
+                {
+                    [mutArr addObject:[UIColor colorWithRed:45.0f/255.0f green:148.0f/255.0f blue:238.0f/255.0f alpha:1.0f]];
+                }
+                buttonTitleColorArray = [mutArr mutableCopy];
+            }
+            if (buttonTitleColorArray)
+            {
+                [strongController setAlertWithAlert:strongController
+                             mutableAttributedTitle:attributedTitle
+                           mutableAttributedMessage:attributedMessage
+                                             Action:action
+                                   buttonTitleColor:buttonTitleColorArray[i]];
+            }
+        }
+    }
+    if (textFieldPlaceholderArray)
+    {
+        for (NSInteger i = 0; i < textFieldPlaceholderArray.count; i++)
+        {
+            [alertController addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
+                
+                textField.placeholder = textFieldPlaceholderArray[i];
+                if (textFieldConfigurationActionBlock)
+                {
+                    textFieldConfigurationActionBlock(textField, i);
+                }
+            }];
+        }
+    }
+    
+    if (preferredStyle == UIAlertControllerStyleActionSheet)
+    {
+        UIAlertAction *action = [UIAlertAction actionWithTitle:@"取消"
+                                                         style:UIAlertActionStyleCancel
+                                                       handler:nil];
+        //修改按钮
+        [action setValue:[UIColor colorWithRed:51.0f/255.0f green:51.0f/255.0f blue:51.0f/255.0f alpha:1.0f] forKey:@"titleTextColor"];
+        [alertController addAction:action];
+    }
+    
+#if TARGET_OS_IOS
+    if (popoverPresentationControllerBlock)
+    {
+        popoverPresentationControllerBlock(alertController.popoverPresentationController);
+    }
+#endif
+    
+    [viewController.ba_currentViewController presentViewController:alertController animated:YES completion:nil];
+    
+    return alertController;
+}
+
+#pragma mark - setter / getter
+
+- (void)setAlertWithAlert:(UIAlertController * __nonnull )alert
+   mutableAttributedTitle:(NSMutableAttributedString *)mutableAttributedTitle
+ mutableAttributedMessage:(nullable NSMutableAttributedString *)mutableAttributedMessage
+                   Action:(UIAlertAction * __nonnull )action
+         buttonTitleColor:(UIColor *)buttonTitleColor
+{
+    /*! 1、首先获得对应的属性 */
+//    NSArray *propertysListArray = [[UIAlertController class] ba_propertysList];
+//    NSLog(@"1、获取【UIAlertController】所有的属性名:%@", propertysListArray);
+    
+    /*! 2、获得成员变量 */
+    NSArray *ivarListArray = [[UIAlertAction class] ba_ivarList];
+//    NSLog(@"2、获取【UIAlertController】所有的成员变量:%@", ivarListArray);
+    
+    for (NSInteger i = 0; i < ivarListArray.count; i++)
+    {
+        NSString *ivarName = ivarListArray[i];
+        if ([ivarName isEqualToString:@"_titleTextColor"])
+        {
+            [action setValue:buttonTitleColor forKey:@"titleTextColor"];
+        }
+    }
+    
+    /*! 3、改变显示提示字体颜色 */
+    NSArray *propertysListArray2 = [[UIAlertController class] ba_ivarList];
+//    NSLog(@"3、获取【UIAlertController】所有的成员变量:%@", propertysListArray2);
+    for (NSInteger i = 0; i < propertysListArray2.count; i++)
+    {
+        NSString *ivarName = propertysListArray2[i];
+        if ([ivarName isEqualToString:@"_attributedTitle"])
+        {
+            [alert setValue:mutableAttributedTitle forKey:@"attributedTitle"];
+        }
+        if ([ivarName isEqualToString:@"_attributedMessage"])
+        {
+            [alert setValue:mutableAttributedMessage forKey:@"attributedMessage"];
+        }
+    }
+}
+
+@end
+
+@implementation UIViewController (BAKit)
+
+- (UIViewController *)ba_currentViewController
+{
+    UIViewController *topVC = self;
+    
+    UIViewController *above;
+    while ((above = topVC.presentedViewController)) {
+        topVC = above;
+    }
+    
+    return topVC;
+}
+
+@end

+ 0 - 0
RainbowPlanet/RainbowPlanet/Tools/AppInfo/AppInfo.swift


Some files were not shown because too many files changed in this diff