Procházet zdrojové kódy

上啦加载优化

南鑫林 před 5 roky
rodič
revize
d2038f487a
37 změnil soubory, kde provedl 181 přidání a 358 odebrání
  1. 6 8
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  2. 2 0
      RainbowPlanet/RainbowPlanet/Macro/FontMacro.swift
  3. 3 3
      RainbowPlanet/RainbowPlanet/Modules/CommonModules/LocationModule/SelfRecommendation/ViewController/SelfRecommendationViewController.swift
  4. 2 2
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Follow/CommunityFollowViewController.swift
  5. 5 2
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Main/CommunityViewController.swift
  6. 4 2
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Recommend/CommunityRecommnendViewController.swift
  7. 2 2
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityFeaturedTopics/ViewController/CommunityFeaturedTopicsViewController.swift
  8. 2 2
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityMyFollowTopic/ViewController/CommunityMyFollowTopicController.swift
  9. 2 2
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/Controller/CommunityRecommendController.swift
  10. 2 2
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunitySubComment/ViewController/CommunitySubCommentController.swift
  11. 2 2
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/View/CommunityAllCommentView.swift
  12. 2 2
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/ViewController/CommunityVideoListController.swift
  13. 2 2
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoSubCommentController/CommunityVideoSubCommentController.swift
  14. 2 2
      RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageList/ViewController/MessageListController.swift
  15. 2 2
      RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessagePlanetActivity/Controller/MessagePlanetActivityController.swift
  16. 2 2
      RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessagePlanetNotification/Controller/MessagePlanetNotiController.swift
  17. 2 2
      RainbowPlanet/RainbowPlanet/Modules/MineModule/MyFollowAndFan/ViewController/MyFollowAndFanViewController.swift
  18. 2 2
      RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/PersonalCenterView/PersonViewUserAndOtherListView.swift
  19. 2 2
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/ViewController/OrderListViewController.swift
  20. 4 2
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishViewController.swift
  21. 4 2
      RainbowPlanet/RainbowPlanet/Modules/RedemptionAreaModule/RedemptionArea/ViewController/RedemptionAreaViewController.swift
  22. 2 2
      RainbowPlanet/RainbowPlanet/Modules/SearchModule/SearchContentList/ViewController/SearchContentListViewController.swift
  23. 2 2
      RainbowPlanet/RainbowPlanet/Modules/SearchModule/SearchProduct/ViewController/SearchProductListViewController.swift
  24. 2 2
      RainbowPlanet/RainbowPlanet/Modules/SearchModule/SearchTopicList/ViewController/SearchTopicListViewController.swift
  25. 2 2
      RainbowPlanet/RainbowPlanet/Modules/SearchModule/SearchUser/ViewController/SearchUserListViewController.swift
  26. 4 4
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/ViewController/CategoryViewController.swift
  27. 5 3
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductAllComment/ViewController/ProductAllCommentViewController.swift
  28. 3 2
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Shop/ViewController/ShopViewController.swift
  29. 2 2
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceManger/SwiftMoyaNetWorkManager/ApiMacro.swift
  30. 0 5
      RainbowPlanet/RainbowPlanet/Tools/EmptyView/DIYEmptyView.swift
  31. 13 0
      RainbowPlanet/RainbowPlanet/Tools/Extension/UIViewController+Example.h
  32. 39 0
      RainbowPlanet/RainbowPlanet/Tools/Extension/UIViewController+Example.m
  33. 0 88
      RainbowPlanet/RainbowPlanet/Tools/MJRefreshEX/MJDIYAutoFooter.swift
  34. 0 84
      RainbowPlanet/RainbowPlanet/Tools/MJRefreshEX/MJDIYBackFooter.swift
  35. 25 62
      RainbowPlanet/RainbowPlanet/Tools/MJRefreshEX/MJDIYFullScreenHeader.swift
  36. 4 4
      RainbowPlanet/RainbowPlanet/Tools/MJRefreshEX/UIScrollView+MJRefreshEX.h
  37. 22 49
      RainbowPlanet/RainbowPlanet/Tools/MJRefreshEX/UIScrollView+MJRefreshEX.m

+ 6 - 8
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -9,6 +9,7 @@
 /* Begin PBXBuildFile section */
 		0A110C4CD931995B8E8BF7C5 /* Pods_RainbowPlanet.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D469F6C3768252BCB7001EDD /* Pods_RainbowPlanet.framework */; };
 		A7003EA3229192CC004E51FB /* PayManagerPay.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7003EA2229192CC004E51FB /* PayManagerPay.swift */; };
+		A701454322FA59AC0090E1BD /* UIViewController+Example.m in Sources */ = {isa = PBXBuildFile; fileRef = A701454122FA59AB0090E1BD /* UIViewController+Example.m */; };
 		A70B2C042283D06B00B2449F /* ProductFloorFullLeftHeaderCollectionReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70B2C032283D06B00B2449F /* ProductFloorFullLeftHeaderCollectionReusableView.swift */; };
 		A70B2C072284305400B2449F /* ProductModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70B2C062284305400B2449F /* ProductModel.swift */; };
 		A70B2C102286A3BC00B2449F /* ProductDetailModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70B2C0F2286A3BC00B2449F /* ProductDetailModel.swift */; };
@@ -220,8 +221,6 @@
 		A76068ED22E4A2B4008DF18F /* verywell.json in Resources */ = {isa = PBXBuildFile; fileRef = A76068EC22E4A2B4008DF18F /* verywell.json */; };
 		A76068F322E4B11B008DF18F /* UIImage+Gif.swift in Sources */ = {isa = PBXBuildFile; fileRef = A76068F222E4B11B008DF18F /* UIImage+Gif.swift */; };
 		A76068F522E4BCF4008DF18F /* MJDIYHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = A76068F422E4BCF4008DF18F /* MJDIYHeader.swift */; };
-		A76068F722E4C401008DF18F /* MJDIYAutoFooter.swift in Sources */ = {isa = PBXBuildFile; fileRef = A76068F622E4C401008DF18F /* MJDIYAutoFooter.swift */; };
-		A76068F922E4C566008DF18F /* MJDIYBackFooter.swift in Sources */ = {isa = PBXBuildFile; fileRef = A76068F822E4C566008DF18F /* MJDIYBackFooter.swift */; };
 		A7636AC52268139C00374F9E /* LocationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7636AC42268139C00374F9E /* LocationViewController.swift */; };
 		A7636AC822682BAF00374F9E /* LocationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7636AC722682BAF00374F9E /* LocationView.swift */; };
 		A76390EB2248E27A0067EEE0 /* UserNotifications.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A76390EA2248E27A0067EEE0 /* UserNotifications.framework */; };
@@ -716,6 +715,8 @@
 		57C497E128081597F165C771 /* Pods-RainbowPlanet.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RainbowPlanet.release.xcconfig"; path = "Pods/Target Support Files/Pods-RainbowPlanet/Pods-RainbowPlanet.release.xcconfig"; sourceTree = "<group>"; };
 		88DF1EFD2E202DA7C627E8A7 /* Pods_RainbowPlanetUITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RainbowPlanetUITests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		A7003EA2229192CC004E51FB /* PayManagerPay.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PayManagerPay.swift; sourceTree = "<group>"; };
+		A701454122FA59AB0090E1BD /* UIViewController+Example.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+Example.m"; sourceTree = "<group>"; };
+		A701454222FA59AB0090E1BD /* UIViewController+Example.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+Example.h"; sourceTree = "<group>"; };
 		A70B2C032283D06B00B2449F /* ProductFloorFullLeftHeaderCollectionReusableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductFloorFullLeftHeaderCollectionReusableView.swift; sourceTree = "<group>"; };
 		A70B2C062284305400B2449F /* ProductModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProductModel.swift; sourceTree = "<group>"; };
 		A70B2C0F2286A3BC00B2449F /* ProductDetailModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProductDetailModel.swift; sourceTree = "<group>"; };
@@ -934,8 +935,6 @@
 		A76068EC22E4A2B4008DF18F /* verywell.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = verywell.json; sourceTree = "<group>"; };
 		A76068F222E4B11B008DF18F /* UIImage+Gif.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImage+Gif.swift"; sourceTree = "<group>"; };
 		A76068F422E4BCF4008DF18F /* MJDIYHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MJDIYHeader.swift; sourceTree = "<group>"; };
-		A76068F622E4C401008DF18F /* MJDIYAutoFooter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MJDIYAutoFooter.swift; sourceTree = "<group>"; };
-		A76068F822E4C566008DF18F /* MJDIYBackFooter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MJDIYBackFooter.swift; sourceTree = "<group>"; };
 		A7636AC42268139C00374F9E /* LocationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationViewController.swift; sourceTree = "<group>"; };
 		A7636AC722682BAF00374F9E /* LocationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationView.swift; sourceTree = "<group>"; };
 		A76390EA2248E27A0067EEE0 /* UserNotifications.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UserNotifications.framework; path = System/Library/Frameworks/UserNotifications.framework; sourceTree = SDKROOT; };
@@ -2429,6 +2428,8 @@
 		A72A728B22321DE000B21995 /* Extension */ = {
 			isa = PBXGroup;
 			children = (
+				A701454222FA59AB0090E1BD /* UIViewController+Example.h */,
+				A701454122FA59AB0090E1BD /* UIViewController+Example.m */,
 				A72A728C22321DE000B21995 /* Extension+UIImage.swift */,
 				A72A728D22321DE000B21995 /* Extension+UITextView.swift */,
 				A72A729322321DE000B21995 /* Extension+UILabel.swift */,
@@ -2742,8 +2743,6 @@
 				A757C9332274882E00226355 /* UIScrollView+MJRefreshEX.h */,
 				A76068F422E4BCF4008DF18F /* MJDIYHeader.swift */,
 				A74DF74822EAAF17007FB505 /* MJDIYFullScreenHeader.swift */,
-				A76068F822E4C566008DF18F /* MJDIYBackFooter.swift */,
-				A76068F622E4C401008DF18F /* MJDIYAutoFooter.swift */,
 			);
 			path = MJRefreshEX;
 			sourceTree = "<group>";
@@ -6501,7 +6500,6 @@
 				A7274C5A228EE636000E3A07 /* LBXScanView.swift in Sources */,
 				A7FF1560228C693D00A85748 /* OrderViewController.swift in Sources */,
 				A729B5B42267254B004AE098 /* PasswordLoginViewController.swift in Sources */,
-				A76068F722E4C401008DF18F /* MJDIYAutoFooter.swift in Sources */,
 				A7B4E7582282897B0012914A /* ProductFloorLeftHeaderCollectionReusableView.swift in Sources */,
 				A7D4608E227616F800A5A54E /* SQLiteManager.swift in Sources */,
 				A70B2C6B2288815300B2449F /* PickHeaderView.swift in Sources */,
@@ -6573,8 +6571,8 @@
 				BDE376E922C22D4E0055E2EA /* AlivcUIConfig.m in Sources */,
 				A7C2567C22CD8EEE00420828 /* CommunityPostCommentsModel.swift in Sources */,
 				A7541502224C5ECB002480B5 /* BaiduMapManager.swift in Sources */,
-				A76068F922E4C566008DF18F /* MJDIYBackFooter.swift in Sources */,
 				A773D02F229FDC3B007A5751 /* DIYEmptyView.swift in Sources */,
+				A701454322FA59AC0090E1BD /* UIViewController+Example.m in Sources */,
 				BD6122B022C3638300D3F513 /* AliyunEffectInfo.m in Sources */,
 				A757C9342274882E00226355 /* UIScrollView+MJRefreshEX.m in Sources */,
 				A7F2D6C822B0E2F60093000B /* CommunityRecommendFollowTableViewCell.swift in Sources */,

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

@@ -37,6 +37,7 @@ let kMediumFont17 = UIFont(name: "PingFang-SC-Medium", size: 17)
 let kMediumFont18 = UIFont(name: "PingFang-SC-Medium", size: 18)
 let kMediumFont20 = UIFont(name: "PingFang-SC-Medium", size: 20)
 let kMediumFont21 = UIFont(name: "PingFang-SC-Medium", size: 21)
+let kMediumFont22 = UIFont(name: "PingFang-SC-Medium", size: 22)
 let kMediumFont23 = UIFont(name: "PingFang-SC-Medium", size: 23)
 let kMediumFont24 = UIFont(name: "PingFang-SC-Medium", size: 24)
 let kMediumFont25 = UIFont(name: "PingFang-SC-Medium", size: 25)
@@ -55,6 +56,7 @@ 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 kRegularFont18 = UIFont(name: "PingFang-SC-Regular", size: 18)
+let kRegularFont22 = UIFont(name: "PingFang-SC-Regular", size: 22)
 
 
 let kScaleBoldFont10 = UIFont.boldSystemFont(ofSize: kScaleValue(value: 10))

+ 3 - 3
RainbowPlanet/RainbowPlanet/Modules/CommonModules/LocationModule/SelfRecommendation/ViewController/SelfRecommendationViewController.swift

@@ -49,10 +49,10 @@ class SelfRecommendationViewController: BaseViewController {
             [weak self] (page) in
             self?.configPickupNodeIndexApi( page: page)
         }
-        self.selfRecommendationView.collectionView.addFooter(withAutomaticallyRefresh: true) {
-             [weak self] (page) in
+        self.selfRecommendationView.collectionView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
+            [weak self] (page) in
             self?.configPickupNodeIndexApi(page:page)
-        }
+        })
     }
     
     private lazy var selfRecommendationView: SelfRecommendationView = {

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Follow/CommunityFollowViewController.swift

@@ -72,10 +72,10 @@ class CommunityFollowViewController: UIViewController {
             [weak self] (page) in
             self?.loadData(page:page)
         }
-        tableView.addFooter(withAutomaticallyRefresh: false) {
+        tableView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
             [weak self] (page) in
             self?.communityFollowFeedApi(page: page)
-        }
+        })
         
         observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("followApi"), object: nil, queue: OperationQueue.main) { [weak self] (notification) in
             let followStatusModel = notification.object as? FollowStatusModel

+ 5 - 2
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Main/CommunityViewController.swift

@@ -365,6 +365,8 @@ class CommunityViewController: BaseViewController {
         segmentedView.indicators = [indicator]
         segmentedView.contentScrollView = listContainerView.scrollView
         segmentedView.defaultSelectedIndex = 1
+        segmentedView.contentEdgeInsetLeft = 100 * kScaleWidth
+        segmentedView.contentEdgeInsetRight = 100 * kScaleWidth
         return segmentedView
     }()
     
@@ -377,8 +379,9 @@ class CommunityViewController: BaseViewController {
         segmentedDataSource.isTitleZoomEnabled = true
         segmentedDataSource.titleNormalColor = kbbbbbbColor
         segmentedDataSource.titleSelectedColor = k333333Color
-        segmentedDataSource.titleNormalFont = kRegularFont14!
-        segmentedDataSource.titleSelectedFont = kBoldFont22
+        segmentedDataSource.titleNormalFont = kBoldFont16
+        segmentedDataSource.titleSelectedFont = kBoldFont20
+        segmentedDataSource.isTitleStrokeWidthEnabled = true
         
         //reloadData(selectedIndex:)方法一定要调用,方法内部会刷新数据源数组
         segmentedDataSource.reloadData(selectedIndex: 1)

+ 4 - 2
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Recommend/CommunityRecommnendViewController.swift

@@ -50,10 +50,12 @@ class CommunityRecommnendViewController: UIViewController {
             [weak self] (page) in
             self?.communityPostSuggestApi(page:page)
         }
-        tableView.addFooter(withAutomaticallyRefresh: false) {
+        tableView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
             [weak self] (page) in
             self?.communityPostSuggestApi(page:page)
-        }
+        })
+
+        
         observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("followApi"), object: nil, queue: OperationQueue.main) { [weak self] (notification) in
             let followStatusModel = notification.object as? FollowStatusModel
             if !(self?.communityRecommendDataModels.isEmpty ?? true) {

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityFeaturedTopics/ViewController/CommunityFeaturedTopicsViewController.swift

@@ -172,10 +172,10 @@ class CommunityFeaturedTopicsViewController: BaseViewController {
             self?.communityPostTopicApi(page: page)
             self?.communityTopicDetailApi()
         }
-        tableView.addFooter(withAutomaticallyRefresh: false) {
+        tableView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
             [weak self] (page) in
             self?.communityPostTopicApi(page: page)
-        }
+        })
         communityFeaturedTopicsHeaderView.followClosureName = {
             [weak self] in
             if self?.communityTopicDetailModel?.isFollow == 1 {

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityMyFollowTopic/ViewController/CommunityMyFollowTopicController.swift

@@ -45,10 +45,10 @@ class CommunityMyFollowTopicController: BaseViewController {
             [weak self] (page) in
             self?.communityMemberFollowTopicListApi(page: page)
         }
-        tableView.addFooter(withAutomaticallyRefresh: false) {
+        tableView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
             [weak self] (page) in
             self?.communityMemberFollowTopicListApi(page: page)
-        }
+        })
     }
     
     lazy var tableView: UITableView = {

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/Controller/CommunityRecommendController.swift

@@ -213,10 +213,10 @@ class CommunityRecommendController: BaseViewController {
             self?.communityPostDetailApi()
             self?.communityPostCommentApi(page: page)
         }
-        tableView.addFooter(withAutomaticallyRefresh: true) {
+        tableView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
             [weak self] (page) in
             self?.communityPostsApi(page: page)
-        }
+        })
         
         commentView.bottomClickClosure = {
             [weak self] (clickType) in

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunitySubComment/ViewController/CommunitySubCommentController.swift

@@ -70,10 +70,10 @@ class CommunitySubCommentController: BaseViewController {
         tableView.addHeader(withBeginRefresh: true, animation: true) { [weak self] (page) in
             self?.communityPostReplyApi(page: page)
         }
-        tableView.addFooter(withAutomaticallyRefresh: false) {
+        tableView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
             [weak self] (page) in
             self?.communityPostReplyApi(page: page)
-        }
+        })
         commentInputView.commentInputViewClosure = {
             [weak self]  in
             self?.showKeyBoardCommentView(placeholder:"添加评论...")

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/View/CommunityAllCommentView.swift

@@ -92,10 +92,10 @@ class CommunityAllCommentView: FWPopupView {
             [weak self] (page) in
             self?.communityPostCommentApi(page: page)
         }
-        tableView.addFooter(withAutomaticallyRefresh: true) {
+        tableView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
             [weak self] (page) in
             self?.communityPostCommentApi(page: page)
-        }
+        })
         commentInputView.commentInputViewClosure = {
             [weak self]  in
             self?.showKeyBoardCommentView(placeholder:"添加评论...")

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/ViewController/CommunityVideoListController.swift

@@ -128,11 +128,11 @@ class CommunityVideoListController: BaseViewController {
             self?.collectionView.mj_header.isHidden = true
         }
         
-        collectionView.addFooterPreload(withAutomaticallyRefresh: true) {
+        collectionView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
             [weak self] (page) in
 
             self?.communityVideoListApi(page:page)
-        }
+        })
     }
     
     private lazy var collectionView: UICollectionView = {

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoSubCommentController/CommunityVideoSubCommentController.swift

@@ -69,10 +69,10 @@ class CommunityVideoSubCommentController: BaseViewController {
         tableView.addHeader(withBeginRefresh: true, animation: false) { [weak self] (page) in
             self?.communityPostReplyApi(page: page)
         }
-        tableView.addFooter(withAutomaticallyRefresh: false) {
+        tableView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
             [weak self] (page) in
             self?.communityPostReplyApi(page: page)
-        }
+        })
         commentInputView.commentInputViewClosure = {
             [weak self]  in
             self?.showKeyBoardCommentView(placeholder: "添加评论...")

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageList/ViewController/MessageListController.swift

@@ -60,10 +60,10 @@ class MessageListController: BaseViewController {
             [weak self] (page) in
             self?.userMemberMessageList(page: page)
         }
-        tableView.addFooter(withAutomaticallyRefresh: false) {
+        tableView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
             [weak self] (page) in
             self?.userMemberMessageList(page: page)
-        }
+        })
     }
     
     lazy var tableView: UITableView = {

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessagePlanetActivity/Controller/MessagePlanetActivityController.swift

@@ -45,10 +45,10 @@ class MessagePlanetActivityController: BaseViewController {
             [weak self] (page) in
             self?.userMemberMessageList(page: page)
         }
-        tableView.addFooter(withAutomaticallyRefresh: false) {
+        tableView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
             [weak self] (page) in
             self?.userMemberMessageList(page: page)
-        }
+        })
     }
     
     lazy var tableView: UITableView = {

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessagePlanetNotification/Controller/MessagePlanetNotiController.swift

@@ -40,10 +40,10 @@ class MessagePlanetNotiController: BaseViewController {
             [weak self] (page) in
             self?.userMemberMessageList(page: page)
         }
-        tableView.addFooter(withAutomaticallyRefresh: false) {
+        tableView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
             [weak self] (page) in
             self?.userMemberMessageList(page: page)
-        }
+        })
     }
     
     lazy var tableView: UITableView = {

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/MineModule/MyFollowAndFan/ViewController/MyFollowAndFanViewController.swift

@@ -53,10 +53,10 @@ class MyFollowAndFanViewController: BaseViewController {
             self?.userFollowsFans(page:page)
         }
         /// 下拉加载
-        tableView.addFooter(withAutomaticallyRefresh: false) {
+        tableView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
             [weak self] (page) in
             self?.userFollowsFans(page:page)
-        }
+        })
         
     }
     

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/PersonalCenterView/PersonViewUserAndOtherListView.swift

@@ -46,10 +46,10 @@ class PersonViewUserAndOtherListView: BaseView {
         collectionView.addHeader(withBeginRefresh: true, animation: false, refreshBlock: { [weak self] (page) in
             self?.communityPostMyApi(page: page)
         })
-        collectionView.addFooter(withAutomaticallyRefresh: false) {
+        collectionView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
             [weak self] (page) in
             self?.communityPostMyApi(page: page)
-        }
+        })
         
         observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("communityDeletePostApi"), object: nil, queue: OperationQueue.main) { [weak self] (notification) in
             let postId = notification.object as? Int

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/ViewController/OrderListViewController.swift

@@ -71,10 +71,10 @@ class OrderListViewController: UIViewController {
             [weak self] (page) in
             self?.orderPurchaseOrderListApi(page: page)
         }
-        orderListView.tableView.addFooter(withAutomaticallyRefresh: true) {
+        orderListView.tableView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
             [weak self] (page) in
             self?.orderPurchaseOrderListApi(page: page)
-        }
+        })
         
         observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("OrderListVCAll"), object: nil, queue: OperationQueue.main) {[weak self] (notification) in
             self?.orderPurchaseOrderListApi(page: 1)

+ 4 - 2
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishViewController.swift

@@ -82,6 +82,7 @@ class PublishViewController: BaseViewController {
     //2.初始化dataSource
     private lazy var segmentedDataSourceAlbum: JXSegmentedTitleDataSource = {
         let segmentedDataSource = JXSegmentedTitleDataSource()
+        segmentedDataSource.titles = ["相册","拍视频","拍照"]
         segmentedDataSource.isTitleColorGradientEnabled = true
         segmentedDataSource.isItemSpacingAverageEnabled = true
         segmentedDataSource.isTitleZoomEnabled = true
@@ -89,7 +90,7 @@ class PublishViewController: BaseViewController {
         segmentedDataSource.titleSelectedColor = k333333Color
         segmentedDataSource.titleNormalFont = kRegularFont14!
         segmentedDataSource.titleSelectedFont = kBoldFont22
-        segmentedDataSource.titles = ["相册","拍视频","拍照"]
+        segmentedDataSource.isTitleStrokeWidthEnabled = true
         //reloadData(selectedIndex:)方法一定要调用,方法内部会刷新数据源数组
         segmentedDataSource.reloadData(selectedIndex: 0)
         
@@ -97,6 +98,7 @@ class PublishViewController: BaseViewController {
     }()
     private lazy var segmentedDataSourceVideo: JXSegmentedTitleDataSource = {
         let segmentedDataSource = JXSegmentedTitleDataSource()
+        segmentedDataSource.titles = ["相册","拍视频","拍照"]
         segmentedDataSource.isTitleColorGradientEnabled = true
         segmentedDataSource.isItemSpacingAverageEnabled = true
         segmentedDataSource.isTitleZoomEnabled = true
@@ -104,7 +106,7 @@ class PublishViewController: BaseViewController {
         segmentedDataSource.titleSelectedColor = kffffffColor
         segmentedDataSource.titleNormalFont = kRegularFont14!
         segmentedDataSource.titleSelectedFont = kBoldFont22
-        segmentedDataSource.titles = ["相册","拍视频","拍照"]
+        segmentedDataSource.isTitleStrokeWidthEnabled = true
         //reloadData(selectedIndex:)方法一定要调用,方法内部会刷新数据源数组
         
         return segmentedDataSource

+ 4 - 2
RainbowPlanet/RainbowPlanet/Modules/RedemptionAreaModule/RedemptionArea/ViewController/RedemptionAreaViewController.swift

@@ -30,9 +30,11 @@ class RedemptionAreaViewController: BaseViewController {
     }
     
     override func setupViews() {
-        self.navigationBar.title = "兑换商城"
-        view.addSubview(tableView)
+        navigationBar.title = "兑换商城"
         navigationBar.wr_setRightButton(image: kImage(name: "navbar_class_black")!)
+        view.addSubview(tableView)
+        view.insertSubview(navigationBar, aboveSubview: tableView)
+        
     }
     
     lazy var tableView: UITableView = {

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/SearchModule/SearchContentList/ViewController/SearchContentListViewController.swift

@@ -47,10 +47,10 @@ class SearchContentListViewController: UIViewController {
             [weak self] (page) in
             self?.communityPostsApi(page: page)
         }
-        collectionView.addFooter(withAutomaticallyRefresh: false) {
+        collectionView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
             [weak self] (page) in
             self?.communityPostsApi(page: page)
-        }
+        })
         observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("islikeApi"), object: nil, queue: OperationQueue.main) { [weak self] (notification) in
             let followStatusModel = notification.object as? FollowStatusModel
             if !(self?.communityPostDataModels.isEmpty ?? true) {

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/SearchModule/SearchProduct/ViewController/SearchProductListViewController.swift

@@ -43,10 +43,10 @@ class SearchProductListViewController: UIViewController {
             [weak self] (page) in
             self?.productSearchApi(page:page)
         }
-        tableView.addFooter(withAutomaticallyRefresh: true) {
+        tableView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
             [weak self] (page) in
             self?.productSearchApi(page:page)
-        }
+        })
     }
         
     lazy var tableView: UITableView = {

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/SearchModule/SearchTopicList/ViewController/SearchTopicListViewController.swift

@@ -42,10 +42,10 @@ class SearchTopicListViewController: BaseViewController {
             [weak self] (page) in
             self?.communityTopicsApi(page: page)
         }
-        tableView.addFooter(withAutomaticallyRefresh: false) {
+        tableView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
             [weak self] (page) in
             self?.communityTopicsApi(page: page)
-        }
+        })
     }
     
     lazy var tableView: UITableView = {

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/SearchModule/SearchUser/ViewController/SearchUserListViewController.swift

@@ -47,10 +47,10 @@ class SearchUserListViewController: BaseViewController {
             [weak self] (page) in
             self?.userMemberSearchMemberApi(page: page)
         }
-        tableView.addFooter(withAutomaticallyRefresh: false) {
+        tableView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
             [weak self] (page) in
             self?.userMemberSearchMemberApi(page: page)
-        }
+        })
         
         observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("followApi"), object: nil, queue: OperationQueue.main) { [weak self] (notification) in
             let followStatusModel = notification.object as? FollowStatusModel

+ 4 - 4
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/ViewController/CategoryViewController.swift

@@ -66,10 +66,10 @@ class CategoryViewController: BaseViewController {
             [weak self] (page) in
             self?.productCategoryApi(page: page)
         }
-        categoryView.leftTableView.addFooter(withAutomaticallyRefresh: true) {
+        categoryView.leftTableView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
             [weak self] (page) in
             self?.productCategoryApi(page: page)
-        }
+        })
         categoryView.leftDidSelectRow = {
             [weak self] indexPath in
             self?.leftIndexPath = indexPath
@@ -79,10 +79,10 @@ class CategoryViewController: BaseViewController {
             [weak self] (page) in
             self?.productSearchApi(page: page)
         }
-        categoryView.rightTableView.addFooter(withAutomaticallyRefresh: true) {
+        categoryView.rightTableView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
             [weak self] (page) in
             self?.productSearchApi(page: page)
-        }
+        })
         
         
         categoryView.rightDidSelectRow = {

+ 5 - 3
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductAllComment/ViewController/ProductAllCommentViewController.swift

@@ -41,12 +41,14 @@ class ProductAllCommentViewController: BaseViewController {
     }()
     
     override func setupData() {
-        productAllCommentView.tableView.addHeader(withBeginRefresh: true, animation: false) { [weak self] (page) in
+        productAllCommentView.tableView.addHeader(withBeginRefresh: true, animation: false) {
+            [weak self] (page) in
             self?.productCommentListApi(page:page)
         }
-        productAllCommentView.tableView.addFooter(withAutomaticallyRefresh: true) { [weak self] (page) in
+        productAllCommentView.tableView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
+            [weak self] (page) in
             self?.productCommentListApi(page:page)
-        }
+        })
         productAllCommentView.didSelectItemAtClosure = {
             [weak self] (images,indexPath) in
             let vc = BrowsePicturesViewController.init(imageStrs: images, index: indexPath.row)

+ 3 - 2
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Shop/ViewController/ShopViewController.swift

@@ -60,9 +60,10 @@ class ShopViewController: BaseViewController {
              self?.productListApi(page: page)
         }
         
-        shopView.tableView.addFooter(withAutomaticallyRefresh: true) { [weak self] (page) in
+        shopView.tableView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
+            [weak self] (page) in
             self?.productListApi(page: page)
-        }
+        })
         
         _ = NotificationCenter.default.rx
             .notification(NSNotification.Name("ShopVCDesc"))

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

@@ -22,7 +22,7 @@ public func kApiDataPrefix() -> String {
     } else if kBetaSever /** 接口前缀-测试服务器*/{
         return "https://api.dev.caihongxingqiu.com/beta"
     }else if kProductSever /** 接口前缀-生产服务器*/ {
-        return ""
+        return "https://api.uptoyo.com"
     }else {
         return ""
     }
@@ -42,7 +42,7 @@ public func kApiVirusPrefix() -> String {
     } else if kVirusBetaSever /** 接口前缀-测试服务器*/{
         return "https://api.dev.caihongxingqiu.com/beta/virus/v2"
     }else if kVirusProductSever /** 接口前缀-生产服务器*/ {
-        return "https://api.uptoyo.com"
+        return "https://api.virus.caihongxingqiu.net"
     }else {
         return ""
     }

+ 0 - 5
RainbowPlanet/RainbowPlanet/Tools/EmptyView/DIYEmptyView.swift

@@ -105,11 +105,6 @@ class DIYEmptyView: LYEmptyView {
         
     }
     
-    
-    /// tableView上的默认图 不带button
-    ///
-    /// - Parameter tableView: UITableView
-    
     /// tableView上的默认图
     ///
     /// - Parameters:

+ 13 - 0
RainbowPlanet/RainbowPlanet/Tools/Extension/UIViewController+Example.h

@@ -0,0 +1,13 @@
+//
+//  UIViewController+Example.h
+//  MJRefreshExample
+//
+//  Created by MJ Lee on 15/3/12.
+//  Copyright (c) 2015年 小码哥. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface UIViewController (Example)
+@property (copy, nonatomic) NSString *method;
+@end

+ 39 - 0
RainbowPlanet/RainbowPlanet/Tools/Extension/UIViewController+Example.m

@@ -0,0 +1,39 @@
+//
+//  UIViewController+Example.m
+//  MJRefreshExample
+//
+//  Created by MJ Lee on 15/3/12.
+//  Copyright (c) 2015年 小码哥. All rights reserved.
+//
+
+#import "UIViewController+Example.h"
+#import <objc/runtime.h>
+
+@implementation UIViewController (Example)
+
+#pragma mark - swizzle
++ (void)load
+{
+    Method method1 = class_getInstanceMethod([self class], NSSelectorFromString(@"dealloc"));
+    Method method2 = class_getInstanceMethod([self class], @selector(deallocSwizzle));
+    method_exchangeImplementations(method1, method2);
+}
+
+- (void)deallocSwizzle
+{
+    NSLog(@"%@被销毁了", self);
+
+    [self deallocSwizzle];
+}
+
+static char MethodKey;
+- (void)setMethod:(NSString *)method
+{
+    objc_setAssociatedObject(self, &MethodKey, method, OBJC_ASSOCIATION_COPY_NONATOMIC);
+}
+
+- (NSString *)method
+{
+    return objc_getAssociatedObject(self, &MethodKey);
+}
+@end

+ 0 - 88
RainbowPlanet/RainbowPlanet/Tools/MJRefreshEX/MJDIYAutoFooter.swift

@@ -1,88 +0,0 @@
-//
-//  MJDIYAutoFooter.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/7/22.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import Foundation
-import MJRefresh
-
-class MJDIYAutoFooter: MJRefreshAutoFooter {
-    var label:UILabel!
-    var loading:UIActivityIndicatorView!
-    
-    //在这里做一些初始化配置(比如添加子控件)
-    override func prepare()
-    {
-        super.prepare()
-        
-        // 设置控件的高度
-        self.mj_h = 44
-        
-        // 添加label
-        self.label =  UILabel()
-        self.label.textColor = k999999Color
-        self.label.font = kRegularFont12
-        self.label.textAlignment = .center
-        self.label.isHidden = true
-        self.label.text = "这是我的底线啦~"
-        self.addSubview(self.label)
-        
-        // loading
-        self.loading =  UIActivityIndicatorView(style: .gray)
-        self.loading.stopAnimating()
-        self.addSubview(self.loading)
-    }
-    
-    //在这里设置子控件的位置和尺寸
-    override func placeSubviews()
-    {
-        super.placeSubviews()
-        self.label.frame = self.bounds
-        self.loading.center = CGPoint(x:self.mj_w/2, y:self.mj_h/2)
-    }
-    
-    //监听控件的刷新状态
-    override var state: MJRefreshState{
-        didSet
-        {
-            switch (state) {
-            case .idle:
-                self.label.isHidden = true
-                self.loading.isHidden = false
-                self.loading.startAnimating()
-                break
-            case .refreshing:
-                self.label.isHidden = true
-                self.loading.isHidden = false
-
-                self.loading.startAnimating()
-                break
-            case .noMoreData:
-                self.label.isHidden = false
-                self.loading.isHidden = true
-                self.loading.stopAnimating()
-                break
-            default:
-                break
-            }
-        }
-    }
-    
-    //监听scrollView的contentOffset改变
-    override func scrollViewContentOffsetDidChange(_ change: [AnyHashable : Any]!) {
-        super.scrollViewContentOffsetDidChange(change)
-    }
-    
-    //监听scrollView的contentSize改变
-    override func scrollViewContentSizeDidChange(_ change: [AnyHashable : Any]!) {
-        super.scrollViewContentSizeDidChange(change)
-    }
-    
-    //监听scrollView的拖拽状态改变
-    override func scrollViewPanStateDidChange(_ change: [AnyHashable : Any]!) {
-        super.scrollViewPanStateDidChange(change)
-    }
-}

+ 0 - 84
RainbowPlanet/RainbowPlanet/Tools/MJRefreshEX/MJDIYBackFooter.swift

@@ -1,84 +0,0 @@
-//
-//  MJDIYFooter.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/7/22.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import Foundation
-import MJRefresh
-
-class MJDIYBackFooter: MJRefreshBackFooter {
-    var label:UILabel!
-    var loading:UIActivityIndicatorView!
-    
-    //在这里做一些初始化配置(比如添加子控件)
-    override func prepare()
-    {
-        super.prepare()
-        
-        // 设置控件的高度
-        self.mj_h = 44
-        
-        // 添加label
-        self.label =  UILabel()
-        self.label.textColor = k999999Color
-        self.label.font = kRegularFont12
-        self.label.textAlignment = .center
-        self.label.isHidden = true
-        self.label.text = "这是我的底线啦~"
-        self.addSubview(self.label)
-        
-        // loading
-        self.loading =  UIActivityIndicatorView(style: .gray)
-        self.addSubview(self.loading)
-    }
-    
-    //在这里设置子控件的位置和尺寸
-    override func placeSubviews()
-    {
-        super.placeSubviews()
-        self.label.frame = self.bounds
-        self.loading.center = CGPoint(x:self.mj_w/2, y:self.mj_h/2)
-    }
-    
-    //监听控件的刷新状态
-    override var state: MJRefreshState{
-        didSet
-        {
-            switch (state) {
-            case .idle:
-                self.label.isHidden = true
-                self.loading.startAnimating()
-                break
-            case .refreshing:
-                self.label.isHidden = true
-                
-                self.loading.startAnimating()
-                break
-            case .noMoreData:
-                self.label.isHidden = false
-                self.loading.stopAnimating()
-                break
-            default:
-                break
-            }
-        }
-    }
-    
-    //监听scrollView的contentOffset改变
-    override func scrollViewContentOffsetDidChange(_ change: [AnyHashable : Any]!) {
-        super.scrollViewContentOffsetDidChange(change)
-    }
-    
-    //监听scrollView的contentSize改变
-    override func scrollViewContentSizeDidChange(_ change: [AnyHashable : Any]!) {
-        super.scrollViewContentSizeDidChange(change)
-    }
-    
-    //监听scrollView的拖拽状态改变
-    override func scrollViewPanStateDidChange(_ change: [AnyHashable : Any]!) {
-        super.scrollViewPanStateDidChange(change)
-    }
-}

+ 25 - 62
RainbowPlanet/RainbowPlanet/Tools/MJRefreshEX/MJDIYFullScreenHeader.swift

@@ -9,79 +9,42 @@
 import Foundation
 import MJRefresh
 
-class MJDIYFullScreenHeader: MJRefreshHeader {
-    
-    var imageView : UIImageView!
+class MJDIYFullScreenHeader: MJRefreshGifHeader {
     
     //在这里做一些初始化配置(比如添加子控件)
     override func prepare()
     {
         super.prepare()
-        
         // 设置控件的高度
         self.mj_h = 44 + kSafeStatusBarHeight
+        self.stateLabel.isHidden = true
+        self.lastUpdatedTimeLabel.isHidden = true
         
-        let gifArray = gifImages(gifNameInBoundle: "loading")
+        /** 普通闲置状态 */
+        var idleImages: [AnyHashable] = []
+        for i in 0...24 {
+            let image = UIImage(named: String(format: "loading(down)_%zd", i))
+            if let image = image {
+                idleImages.append(image)
+            }
+        }
+        self.setImages(idleImages, for: MJRefreshState.idle)
         
-        self.imageView = UIImageView()
-        imageView.image = gifArray?[0]
-        imageView.animationImages = gifArray
-        imageView.animationRepeatCount = 0
-        imageView.animationDuration = 2
-        imageView.contentMode = .scaleAspectFill
         
-        self.addSubview(self.imageView)
-    }
-    
-    //在这里设置子控件的位置和尺寸
-    override func placeSubviews()
-    {
-        super.placeSubviews()
-        self.imageView.snp.makeConstraints { (make) in
-            make.top.equalTo(kSafeStatusBarHeight)
-            make.centerX.equalToSuperview()
-            make.size.equalTo(44)
-        }
-    }
-    
-    //监听控件的刷新状态
-    override var state: MJRefreshState{
-        didSet
-        {
-            switch (state) {
-            case .idle:
-                self.imageView.stopAnimating()
-                break
-            case .pulling:
-                self.imageView.stopAnimating()
-                break
-            case .refreshing:
-                self.imageView.startAnimating()
-                break
-            default:
-                break
+        /** 松开就可以进行刷新的状态 */
+        var pullingImages: [AnyHashable] = []
+        for i in 25...138 {
+            let image = UIImage(named: String(format: "loading(first)_%zd", i))
+            if let image = image {
+                pullingImages.append(image)
             }
         }
-    }
-    
-    //监听拖拽比例(控件被拖出来的比例)
-    override var pullingPercent: CGFloat {
-        didSet {
-        }
-    }
-    
-    //监听scrollView的contentOffset改变
-    override func scrollViewContentOffsetDidChange(_ change: [AnyHashable : Any]!) {
-        super.scrollViewContentOffsetDidChange(change)
-    }
-    
-    //监听scrollView的contentSize改变
-    override func scrollViewContentSizeDidChange(_ change: [AnyHashable : Any]!) {
-        super.scrollViewContentSizeDidChange(change)
-    }
-    
-    //监听scrollView的拖拽状态改变
-    override func scrollViewPanStateDidChange(_ change: [AnyHashable : Any]!) {
-        super.scrollViewPanStateDidChange(change)
+        self.setImages(pullingImages, duration: 4, for: MJRefreshState.pulling)
+        
+        /** 即将刷新的状态 */
+        self.setImages(pullingImages, duration: 4, for: MJRefreshState.willRefresh)
+        
+        /** 正在刷新中的状态 */
+        self.setImages(pullingImages, duration: 4, for: MJRefreshState.refreshing)
     }
 }

+ 4 - 4
RainbowPlanet/RainbowPlanet/Tools/MJRefreshEX/UIScrollView+MJRefreshEX.h

@@ -36,15 +36,15 @@
  @param automaticallyRefresh 是否自动加载
  @param loadMoreBlock 加载回调
  */
-- (void)addFooterWithAutomaticallyRefresh:(BOOL)automaticallyRefresh loadMoreBlock:(void(^)(NSInteger pageIndex))loadMoreBlock;
+- (void)addAutoNormalFooterWithAutomaticallyRefresh:(BOOL)automaticallyRefresh loadMoreBlock:(void(^)(NSInteger pageIndex))loadMoreBlock;
 
 /**
- 上啦加载预加载
+ 默认加载
  
- @param automaticallyRefresh 是否自动加载
  @param loadMoreBlock 加载回调
  */
-- (void)addFooterPreloadWithAutomaticallyRefresh:(BOOL)automaticallyRefresh loadMoreBlock:(void(^)(NSInteger pageIndex))loadMoreBlock;
+- (void)addBackNormalFooterWithLoadMoreBlock:(void(^)(NSInteger pageIndex))loadMoreBlock;
+
 
 /**
  普通请求结束刷新头部

+ 22 - 49
RainbowPlanet/RainbowPlanet/Tools/MJRefreshEX/UIScrollView+MJRefreshEX.m

@@ -40,6 +40,8 @@ typedef void(^LoadMoreBlock)(NSInteger pageIndex);
         }
 
     }];
+    
+    header.automaticallyChangeAlpha = true;
 
     if (beginRefresh && animation) {
         [header beginRefreshing];
@@ -63,6 +65,8 @@ typedef void(^LoadMoreBlock)(NSInteger pageIndex);
         
     }];
     
+    header.automaticallyChangeAlpha = true;
+    
     if (beginRefresh && animation) {
         [header beginRefreshing];
     }else if (beginRefresh && !animation){
@@ -71,68 +75,37 @@ typedef void(^LoadMoreBlock)(NSInteger pageIndex);
     self.mj_header = header;
 }
 
-- (void)addFooterWithAutomaticallyRefresh:(BOOL)automaticallyRefresh loadMoreBlock:(void(^)(NSInteger pageIndex))loadMoreBlock{
-    
-    __weak typeof(self) weakSelf = self;
-    self.loadMoreBlock = loadMoreBlock;
-    
-    if (automaticallyRefresh) {
-        MJRefreshAutoNormalFooter * footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
-            weakSelf.pageIndex += 1;
-            if (weakSelf.loadMoreBlock) {
-                weakSelf.loadMoreBlock(weakSelf.pageIndex);
-            }
-            [weakSelf endFooterRefresh];
-        }];
-
-        footer.automaticallyRefresh = automaticallyRefresh;
-        footer.triggerAutomaticallyRefreshPercent = 1;
-        footer.onlyRefreshPerDrag = YES;
-
-        footer.stateLabel.font = [UIFont systemFontOfSize:13.0];
-        footer.stateLabel.textColor = [UIColor colorWithWhite:0.400 alpha:1.000];
-        [footer setTitle:@"加载中…" forState:MJRefreshStateRefreshing];
-        [footer setTitle:@"这是我的底线啦~" forState:MJRefreshStateNoMoreData];
-
-        self.mj_footer = footer;
-    } else{
-        MJRefreshBackNormalFooter * footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
-            weakSelf.pageIndex += 1;
-            if (weakSelf.loadMoreBlock) {
-                weakSelf.loadMoreBlock(weakSelf.pageIndex);
-            }
-            [weakSelf endFooterRefresh];
-        }];
-        footer.stateLabel.font = [UIFont systemFontOfSize:13.0];
-        footer.stateLabel.textColor = [UIColor colorWithWhite:0.400 alpha:1.000];
-        [footer setTitle:@"加载中…" forState:MJRefreshStateRefreshing];
-        [footer setTitle:@"这是我的底线啦~" forState:MJRefreshStateNoMoreData];
-
-        footer.mj_h = 50.0;
-        self.mj_footer = footer;
-    }
-}
 
-- (void)addFooterPreloadWithAutomaticallyRefresh:(BOOL)automaticallyRefresh loadMoreBlock:(void(^)(NSInteger pageIndex))loadMoreBlock{
-    
+- (void)addAutoNormalFooterWithAutomaticallyRefresh:(BOOL)automaticallyRefresh loadMoreBlock:(void(^)(NSInteger pageIndex))loadMoreBlock {
     __weak typeof(self) weakSelf = self;
     self.loadMoreBlock = loadMoreBlock;
+    
     MJRefreshAutoNormalFooter * footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
         weakSelf.pageIndex += 1;
         if (weakSelf.loadMoreBlock) {
             weakSelf.loadMoreBlock(weakSelf.pageIndex);
         }
-        [weakSelf endFooterRefresh];
     }];
     
     footer.automaticallyRefresh = automaticallyRefresh;
-    footer.triggerAutomaticallyRefreshPercent = -70;
+    footer.triggerAutomaticallyRefreshPercent = 0.1;
     footer.onlyRefreshPerDrag = YES;
+    footer.automaticallyChangeAlpha = YES;
     
-    footer.stateLabel.font = [UIFont systemFontOfSize:13.0];
-    footer.stateLabel.textColor = [UIColor colorWithWhite:0.400 alpha:1.000];
-    [footer setTitle:@"加载中…" forState:MJRefreshStateRefreshing];
-    [footer setTitle:@"这是我的底线啦~" forState:MJRefreshStateNoMoreData];
+    self.mj_footer = footer;
+}
+
+- (void)addBackNormalFooterWithLoadMoreBlock:(void(^)(NSInteger pageIndex))loadMoreBlock {
+    __weak typeof(self) weakSelf = self;
+    self.loadMoreBlock = loadMoreBlock;
+    
+    MJRefreshBackNormalFooter * footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
+        weakSelf.pageIndex += 1;
+        if (weakSelf.loadMoreBlock) {
+            weakSelf.loadMoreBlock(weakSelf.pageIndex);
+        }
+    }];
+    footer.automaticallyChangeAlpha = YES;
     
     self.mj_footer = footer;
 }