Drew 7 yıl önce
ebeveyn
işleme
8dce824a13
100 değiştirilmiş dosya ile 4133 ekleme ve 1491 silme
  1. BIN
      .DS_Store
  2. 5 2
      .gitignore
  3. 2 0
      Podfile
  4. 9 1
      Podfile.lock
  5. 1 0
      Pods/Headers/Private/UICollectionViewLeftAlignedLayout/UICollectionViewLeftAlignedLayout.h
  6. 1 0
      Pods/Headers/Private/WZLBadge/CAAnimation+WAnimation.h
  7. 1 0
      Pods/Headers/Private/WZLBadge/UIBarButtonItem+WZLBadge.h
  8. 1 0
      Pods/Headers/Private/WZLBadge/UITabBarItem+WZLBadge.h
  9. 1 0
      Pods/Headers/Private/WZLBadge/UIView+WZLBadge.h
  10. 1 0
      Pods/Headers/Private/WZLBadge/WZLBadgeImport.h
  11. 1 0
      Pods/Headers/Private/WZLBadge/WZLBadgeProtocol.h
  12. 1 0
      Pods/Headers/Public/UICollectionViewLeftAlignedLayout/UICollectionViewLeftAlignedLayout.h
  13. 1 0
      Pods/Headers/Public/WZLBadge/CAAnimation+WAnimation.h
  14. 1 0
      Pods/Headers/Public/WZLBadge/UIBarButtonItem+WZLBadge.h
  15. 1 0
      Pods/Headers/Public/WZLBadge/UITabBarItem+WZLBadge.h
  16. 1 0
      Pods/Headers/Public/WZLBadge/UIView+WZLBadge.h
  17. 1 0
      Pods/Headers/Public/WZLBadge/WZLBadgeImport.h
  18. 1 0
      Pods/Headers/Public/WZLBadge/WZLBadgeProtocol.h
  19. 9 1
      Pods/Manifest.lock
  20. 570 521
      Pods/Pods.xcodeproj/project.pbxproj
  21. 49 0
      Pods/Target Support Files/Pods-model/Pods-model-acknowledgements.markdown
  22. 61 0
      Pods/Target Support Files/Pods-model/Pods-model-acknowledgements.plist
  23. 4 4
      Pods/Target Support Files/Pods-model/Pods-model.debug.xcconfig
  24. 4 4
      Pods/Target Support Files/Pods-model/Pods-model.release.xcconfig
  25. 5 0
      Pods/Target Support Files/UICollectionViewLeftAlignedLayout/UICollectionViewLeftAlignedLayout-dummy.m
  26. 12 0
      Pods/Target Support Files/UICollectionViewLeftAlignedLayout/UICollectionViewLeftAlignedLayout-prefix.pch
  27. 9 0
      Pods/Target Support Files/UICollectionViewLeftAlignedLayout/UICollectionViewLeftAlignedLayout.xcconfig
  28. 5 0
      Pods/Target Support Files/WZLBadge/WZLBadge-dummy.m
  29. 12 0
      Pods/Target Support Files/WZLBadge/WZLBadge-prefix.pch
  30. 10 0
      Pods/Target Support Files/WZLBadge/WZLBadge.xcconfig
  31. 20 0
      Pods/UICollectionViewLeftAlignedLayout/LICENSE
  32. 42 0
      Pods/UICollectionViewLeftAlignedLayout/README.md
  33. 40 0
      Pods/UICollectionViewLeftAlignedLayout/UICollectionViewLeftAlignedLayout/UICollectionViewLeftAlignedLayout.h
  34. 117 0
      Pods/UICollectionViewLeftAlignedLayout/UICollectionViewLeftAlignedLayout/UICollectionViewLeftAlignedLayout.m
  35. 21 0
      Pods/WZLBadge/LICENSE
  36. 176 0
      Pods/WZLBadge/README.md
  37. 44 0
      Pods/WZLBadge/WZLBadge/BarItem/UIBarButtonItem+WZLBadge.h
  38. 150 0
      Pods/WZLBadge/WZLBadge/BarItem/UIBarButtonItem+WZLBadge.m
  39. 43 0
      Pods/WZLBadge/WZLBadge/BarItem/UITabBarItem+WZLBadge.h
  40. 169 0
      Pods/WZLBadge/WZLBadge/BarItem/UITabBarItem+WZLBadge.m
  41. 88 0
      Pods/WZLBadge/WZLBadge/CategorySupport/CAAnimation+WAnimation.h
  42. 172 0
      Pods/WZLBadge/WZLBadge/CategorySupport/CAAnimation+WAnimation.m
  43. 101 0
      Pods/WZLBadge/WZLBadge/Protocol/WZLBadgeProtocol.h
  44. 45 0
      Pods/WZLBadge/WZLBadge/View/UIView+WZLBadge.h
  45. 374 0
      Pods/WZLBadge/WZLBadge/View/UIView+WZLBadge.m
  46. 20 0
      Pods/WZLBadge/WZLBadge/WZLBadgeImport.h
  47. 32 10
      model.xcodeproj/project.pbxproj
  48. 124 165
      model/AppDelegate.m
  49. 1 0
      model/Assets.xcassets/mine/jineng/tianjiajineng.imageset/Contents.json
  50. BIN
      model/Assets.xcassets/mine/jineng/tianjiajineng.imageset/tianjiajineng.png
  51. BIN
      model/Assets.xcassets/mine/jineng/tianjiajineng.imageset/tianjiajineng@2x.png
  52. BIN
      model/Assets.xcassets/mine/jineng/tianjiajineng.imageset/tianjiajineng@3x.png
  53. 21 0
      model/Assets.xcassets/share_icon.imageset/Contents.json
  54. BIN
      model/Assets.xcassets/share_icon.imageset/share_icon.png
  55. BIN
      model/Assets.xcassets/个人中心/.DS_Store
  56. 23 0
      model/Assets.xcassets/个人中心/btn_allow.imageset/Contents.json
  57. BIN
      model/Assets.xcassets/个人中心/btn_allow.imageset/btn_allow.png
  58. BIN
      model/Assets.xcassets/个人中心/btn_allow.imageset/btn_allow@2x.png
  59. BIN
      model/Assets.xcassets/个人中心/btn_allow.imageset/btn_allow@3x.png
  60. 23 0
      model/Assets.xcassets/个人中心/btn_allow_check.imageset/Contents.json
  61. BIN
      model/Assets.xcassets/个人中心/btn_allow_check.imageset/btn_allow_check.png
  62. BIN
      model/Assets.xcassets/个人中心/btn_allow_check.imageset/btn_allow_check@2x.png
  63. BIN
      model/Assets.xcassets/个人中心/btn_allow_check.imageset/btn_allow_check@3x.png
  64. 23 0
      model/Assets.xcassets/个人中心/icon_chenggong.imageset/Contents.json
  65. BIN
      model/Assets.xcassets/个人中心/icon_chenggong.imageset/icon_chenggong.png
  66. BIN
      model/Assets.xcassets/个人中心/icon_chenggong.imageset/icon_chenggong@2x.png
  67. BIN
      model/Assets.xcassets/个人中心/icon_chenggong.imageset/icon_chenggong@3x.png
  68. BIN
      model/Assets.xcassets/个人中心/icon_paihang.imageset/icon_paihang.png
  69. BIN
      model/Assets.xcassets/个人中心/icon_paihang.imageset/icon_paihang@2x.png
  70. BIN
      model/Assets.xcassets/个人中心/icon_paihang.imageset/icon_paihang@3x.png
  71. 23 0
      model/Assets.xcassets/个人中心/icon_tianjia.imageset/Contents.json
  72. BIN
      model/Assets.xcassets/个人中心/icon_tianjia.imageset/icon_tianjia.png
  73. BIN
      model/Assets.xcassets/个人中心/icon_tianjia.imageset/icon_tianjia@2x.png
  74. BIN
      model/Assets.xcassets/个人中心/icon_tianjia.imageset/icon_tianjia@3x.png
  75. 23 0
      model/Assets.xcassets/个人中心/icon_tianjia_xiao.imageset/Contents.json
  76. BIN
      model/Assets.xcassets/个人中心/icon_tianjia_xiao.imageset/icon_tianjia_xiao.png
  77. BIN
      model/Assets.xcassets/个人中心/icon_tianjia_xiao.imageset/icon_tianjia_xiao@2x.png
  78. BIN
      model/Assets.xcassets/个人中心/icon_tianjia_xiao.imageset/icon_tianjia_xiao@3x.png
  79. 23 0
      model/Assets.xcassets/个人中心/text_moteduan.imageset/Contents.json
  80. BIN
      model/Assets.xcassets/个人中心/text_moteduan.imageset/text_moteduan.png
  81. BIN
      model/Assets.xcassets/个人中心/text_moteduan.imageset/text_moteduan@2x.png
  82. BIN
      model/Assets.xcassets/个人中心/text_moteduan.imageset/text_moteduan@3x.png
  83. 41 36
      model/Classes/Controllers/Controller/AboutUsVC/AboutUsViewController.m
  84. 19 1
      model/Classes/Controllers/Controller/MessageVC/MessageListViewController.m
  85. 9 24
      model/Classes/Controllers/Controller/MessageVC/MessageViewController.m
  86. 102 65
      model/Classes/Controllers/Controller/MineVC/MineNewViewController.m
  87. 1 0
      model/Classes/Controllers/Controller/MineVC/MineNewViewController.xib
  88. 18 0
      model/Classes/Controllers/Controller/MineVC/View/ApplyRecommendView.h
  89. 149 0
      model/Classes/Controllers/Controller/MineVC/View/ApplyRecommendView.m
  90. 17 0
      model/Classes/Controllers/Controller/MyProfileVC/HobbyViewController.h
  91. 188 0
      model/Classes/Controllers/Controller/MyProfileVC/HobbyViewController.m
  92. 127 52
      model/Classes/Controllers/Controller/MyProfileVC/InfoEditViewController.m
  93. 161 130
      model/Classes/Controllers/Controller/MyProfileVC/ModelCardController.m
  94. 39 42
      model/Classes/Controllers/Controller/MyProfileVC/ModelHonorViewController.m
  95. 159 115
      model/Classes/Controllers/Controller/MyProfileVC/ModelPhotoViewController.m
  96. 35 34
      model/Classes/Controllers/Controller/MyProfileVC/ModelTagViewController.m
  97. 79 71
      model/Classes/Controllers/Controller/MySkillsVC/EditorSkillsController.m
  98. 84 68
      model/Classes/Controllers/Controller/MySkillsVC/MySkillsController.m
  99. 186 144
      model/Classes/Controllers/Controller/MySkillsVC/PostSkillsController.m
  100. 1 1
      model/Classes/Controllers/Controller/MyTeamVC/MyMemberController.m

BIN
.DS_Store


+ 5 - 2
.gitignore

@@ -68,8 +68,11 @@ fastlane/test_output
 # https://github.com/johnno1962/injectionforxcode
 
 iOSInjectionProject/
-.DS_Store
+
 ### Objective-C Patch ###
 
 
-# End of https://www.gitignore.io/api/objective-c
+# End of https://www.gitignore.io/api/objective-c
+
+.DS_Store
+.idea

+ 2 - 0
Podfile

@@ -16,5 +16,7 @@ pod 'UMCCommon'
 pod 'UMCPush'
 pod 'UMCSecurityPlugins'
 pod 'WechatOpenSDK'
+pod 'WZLBadge'
+pod 'UICollectionViewLeftAlignedLayout'
 end
 

+ 9 - 1
Podfile.lock

@@ -26,11 +26,13 @@ PODS:
   - SDWebImage/Core (4.3.3)
   - Toast (4.0.0)
   - TTGTagCollectionView (1.9.0)
+  - UICollectionViewLeftAlignedLayout (1.0.2)
   - UMCCommon (1.5.2)
   - UMCPush (3.2.3):
     - UMCCommon
   - UMCSecurityPlugins (1.0.6)
   - WechatOpenSDK (1.8.3)
+  - WZLBadge (1.2.6)
 
 DEPENDENCIES:
   - AFNetworking
@@ -44,10 +46,12 @@ DEPENDENCIES:
   - SDWebImage
   - Toast
   - TTGTagCollectionView
+  - UICollectionViewLeftAlignedLayout
   - UMCCommon
   - UMCPush
   - UMCSecurityPlugins
   - WechatOpenSDK
+  - WZLBadge
 
 SPEC REPOS:
   https://github.com/cocoapods/specs.git:
@@ -62,10 +66,12 @@ SPEC REPOS:
     - SDWebImage
     - Toast
     - TTGTagCollectionView
+    - UICollectionViewLeftAlignedLayout
     - UMCCommon
     - UMCPush
     - UMCSecurityPlugins
     - WechatOpenSDK
+    - WZLBadge
 
 SPEC CHECKSUMS:
   AFNetworking: b6f891fdfaed196b46c7a83cf209e09697b94057
@@ -79,11 +85,13 @@ SPEC CHECKSUMS:
   SDWebImage: de4d90b5bff3571eae7bd16202b1f43135409fa5
   Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
   TTGTagCollectionView: 958f20b946dee92a8ba20dc37d10a06737641ae9
+  UICollectionViewLeftAlignedLayout: 830bf6fa5bab9f9b464f62e3384f9d2e00b3c0f6
   UMCCommon: 4392868ac47ff1b101663106bb114ba616fabbad
   UMCPush: 628b5c61be5a5036cb31eb9b3a3ab8dce7521691
   UMCSecurityPlugins: 0831a08f3988f3cea9f1d3a7626cd9bee4fef150
   WechatOpenSDK: 3117412f8aafde4758cac1e8d20b93c67cafcfef
+  WZLBadge: 9ec779dcfd94c825518b395e8315fccaabff1bfa
 
-PODFILE CHECKSUM: 7e58839ffe157d2b6c5804b6e62aee87276e7548
+PODFILE CHECKSUM: 6ebc3ae8070ce9785966a1870b1ac59dcf6107d9
 
 COCOAPODS: 1.5.3

+ 1 - 0
Pods/Headers/Private/UICollectionViewLeftAlignedLayout/UICollectionViewLeftAlignedLayout.h

@@ -0,0 +1 @@
+../../../UICollectionViewLeftAlignedLayout/UICollectionViewLeftAlignedLayout/UICollectionViewLeftAlignedLayout.h

+ 1 - 0
Pods/Headers/Private/WZLBadge/CAAnimation+WAnimation.h

@@ -0,0 +1 @@
+../../../WZLBadge/WZLBadge/CategorySupport/CAAnimation+WAnimation.h

+ 1 - 0
Pods/Headers/Private/WZLBadge/UIBarButtonItem+WZLBadge.h

@@ -0,0 +1 @@
+../../../WZLBadge/WZLBadge/BarItem/UIBarButtonItem+WZLBadge.h

+ 1 - 0
Pods/Headers/Private/WZLBadge/UITabBarItem+WZLBadge.h

@@ -0,0 +1 @@
+../../../WZLBadge/WZLBadge/BarItem/UITabBarItem+WZLBadge.h

+ 1 - 0
Pods/Headers/Private/WZLBadge/UIView+WZLBadge.h

@@ -0,0 +1 @@
+../../../WZLBadge/WZLBadge/View/UIView+WZLBadge.h

+ 1 - 0
Pods/Headers/Private/WZLBadge/WZLBadgeImport.h

@@ -0,0 +1 @@
+../../../WZLBadge/WZLBadge/WZLBadgeImport.h

+ 1 - 0
Pods/Headers/Private/WZLBadge/WZLBadgeProtocol.h

@@ -0,0 +1 @@
+../../../WZLBadge/WZLBadge/Protocol/WZLBadgeProtocol.h

+ 1 - 0
Pods/Headers/Public/UICollectionViewLeftAlignedLayout/UICollectionViewLeftAlignedLayout.h

@@ -0,0 +1 @@
+../../../UICollectionViewLeftAlignedLayout/UICollectionViewLeftAlignedLayout/UICollectionViewLeftAlignedLayout.h

+ 1 - 0
Pods/Headers/Public/WZLBadge/CAAnimation+WAnimation.h

@@ -0,0 +1 @@
+../../../WZLBadge/WZLBadge/CategorySupport/CAAnimation+WAnimation.h

+ 1 - 0
Pods/Headers/Public/WZLBadge/UIBarButtonItem+WZLBadge.h

@@ -0,0 +1 @@
+../../../WZLBadge/WZLBadge/BarItem/UIBarButtonItem+WZLBadge.h

+ 1 - 0
Pods/Headers/Public/WZLBadge/UITabBarItem+WZLBadge.h

@@ -0,0 +1 @@
+../../../WZLBadge/WZLBadge/BarItem/UITabBarItem+WZLBadge.h

+ 1 - 0
Pods/Headers/Public/WZLBadge/UIView+WZLBadge.h

@@ -0,0 +1 @@
+../../../WZLBadge/WZLBadge/View/UIView+WZLBadge.h

+ 1 - 0
Pods/Headers/Public/WZLBadge/WZLBadgeImport.h

@@ -0,0 +1 @@
+../../../WZLBadge/WZLBadge/WZLBadgeImport.h

+ 1 - 0
Pods/Headers/Public/WZLBadge/WZLBadgeProtocol.h

@@ -0,0 +1 @@
+../../../WZLBadge/WZLBadge/Protocol/WZLBadgeProtocol.h

+ 9 - 1
Pods/Manifest.lock

@@ -26,11 +26,13 @@ PODS:
   - SDWebImage/Core (4.3.3)
   - Toast (4.0.0)
   - TTGTagCollectionView (1.9.0)
+  - UICollectionViewLeftAlignedLayout (1.0.2)
   - UMCCommon (1.5.2)
   - UMCPush (3.2.3):
     - UMCCommon
   - UMCSecurityPlugins (1.0.6)
   - WechatOpenSDK (1.8.3)
+  - WZLBadge (1.2.6)
 
 DEPENDENCIES:
   - AFNetworking
@@ -44,10 +46,12 @@ DEPENDENCIES:
   - SDWebImage
   - Toast
   - TTGTagCollectionView
+  - UICollectionViewLeftAlignedLayout
   - UMCCommon
   - UMCPush
   - UMCSecurityPlugins
   - WechatOpenSDK
+  - WZLBadge
 
 SPEC REPOS:
   https://github.com/cocoapods/specs.git:
@@ -62,10 +66,12 @@ SPEC REPOS:
     - SDWebImage
     - Toast
     - TTGTagCollectionView
+    - UICollectionViewLeftAlignedLayout
     - UMCCommon
     - UMCPush
     - UMCSecurityPlugins
     - WechatOpenSDK
+    - WZLBadge
 
 SPEC CHECKSUMS:
   AFNetworking: b6f891fdfaed196b46c7a83cf209e09697b94057
@@ -79,11 +85,13 @@ SPEC CHECKSUMS:
   SDWebImage: de4d90b5bff3571eae7bd16202b1f43135409fa5
   Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
   TTGTagCollectionView: 958f20b946dee92a8ba20dc37d10a06737641ae9
+  UICollectionViewLeftAlignedLayout: 830bf6fa5bab9f9b464f62e3384f9d2e00b3c0f6
   UMCCommon: 4392868ac47ff1b101663106bb114ba616fabbad
   UMCPush: 628b5c61be5a5036cb31eb9b3a3ab8dce7521691
   UMCSecurityPlugins: 0831a08f3988f3cea9f1d3a7626cd9bee4fef150
   WechatOpenSDK: 3117412f8aafde4758cac1e8d20b93c67cafcfef
+  WZLBadge: 9ec779dcfd94c825518b395e8315fccaabff1bfa
 
-PODFILE CHECKSUM: 7e58839ffe157d2b6c5804b6e62aee87276e7548
+PODFILE CHECKSUM: 6ebc3ae8070ce9785966a1870b1ac59dcf6107d9
 
 COCOAPODS: 1.5.3

Dosya farkı çok büyük olduğundan ihmal edildi
+ 570 - 521
Pods/Pods.xcodeproj/project.pbxproj


+ 49 - 0
Pods/Target Support Files/Pods-model/Pods-model-acknowledgements.markdown

@@ -420,6 +420,30 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 
+## UICollectionViewLeftAlignedLayout
+
+The MIT License (MIT)
+
+Copyright (c) 2014 Giovanni Lodi
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
 ## UMCCommon
 
 Copyright 2011 - 2018 umeng.com. All rights reserved.
@@ -435,6 +459,31 @@ Copyright 2011 - 2018 umeng.com. All rights reserved.
 Copyright 2011 - 2018 umeng.com. All rights reserved.
 
 
+## WZLBadge
+
+The MIT License (MIT)
+
+Copyright (c) 2015 Zilin Weng
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+
 ## WechatOpenSDK
 
 Copyright 2018 tencent.com. All rights reserved.

+ 61 - 0
Pods/Target Support Files/Pods-model/Pods-model-acknowledgements.plist

@@ -497,6 +497,36 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 			<key>Type</key>
 			<string>PSGroupSpecifier</string>
 		</dict>
+		<dict>
+			<key>FooterText</key>
+			<string>The MIT License (MIT)
+
+Copyright (c) 2014 Giovanni Lodi
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+</string>
+			<key>License</key>
+			<string>MIT</string>
+			<key>Title</key>
+			<string>UICollectionViewLeftAlignedLayout</string>
+			<key>Type</key>
+			<string>PSGroupSpecifier</string>
+		</dict>
 		<dict>
 			<key>FooterText</key>
 			<string>Copyright 2011 - 2018 umeng.com. All rights reserved.
@@ -530,6 +560,37 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 			<key>Type</key>
 			<string>PSGroupSpecifier</string>
 		</dict>
+		<dict>
+			<key>FooterText</key>
+			<string>The MIT License (MIT)
+
+Copyright (c) 2015 Zilin Weng
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+</string>
+			<key>License</key>
+			<string>None</string>
+			<key>Title</key>
+			<string>WZLBadge</string>
+			<key>Type</key>
+			<string>PSGroupSpecifier</string>
+		</dict>
 		<dict>
 			<key>FooterText</key>
 			<string>Copyright 2018 tencent.com. All rights reserved.

+ 4 - 4
Pods/Target Support Files/Pods-model/Pods-model.debug.xcconfig

@@ -1,9 +1,9 @@
 FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/NIMSDK/NIMSDK" "${PODS_ROOT}/NIMSDK/NIMAVChat" "${PODS_ROOT}/UMCCommon" "${PODS_ROOT}/UMCPush" "${PODS_ROOT}/UMCSecurityPlugins/thirdparties"
 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
-HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/BRPickerView" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/M80AttributedLabel" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/NIMSDK" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TTGTagCollectionView" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UMCCommon" "${PODS_ROOT}/Headers/Public/UMCPush" "${PODS_ROOT}/Headers/Public/UMCSecurityPlugins" "${PODS_ROOT}/Headers/Public/WechatOpenSDK"
-LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/BRPickerView" "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManager" "${PODS_CONFIGURATION_BUILD_DIR}/M80AttributedLabel" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/MJExtension" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh" "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage" "${PODS_CONFIGURATION_BUILD_DIR}/TTGTagCollectionView" "${PODS_CONFIGURATION_BUILD_DIR}/Toast" "${PODS_ROOT}/NIMSDK/NIMAVChat/Libs" "${PODS_ROOT}/NIMSDK/NIMSDK/Libs" "${PODS_ROOT}/WechatOpenSDK/WeChatSDK1.8.3"
-OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/BRPickerView" -isystem "${PODS_ROOT}/Headers/Public/IQKeyboardManager" -isystem "${PODS_ROOT}/Headers/Public/M80AttributedLabel" -isystem "${PODS_ROOT}/Headers/Public/MBProgressHUD" -isystem "${PODS_ROOT}/Headers/Public/MJExtension" -isystem "${PODS_ROOT}/Headers/Public/MJRefresh" -isystem "${PODS_ROOT}/Headers/Public/NIMSDK" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage" -isystem "${PODS_ROOT}/Headers/Public/TTGTagCollectionView" -isystem "${PODS_ROOT}/Headers/Public/Toast" -isystem "${PODS_ROOT}/Headers/Public/UMCCommon" -isystem "${PODS_ROOT}/Headers/Public/UMCPush" -isystem "${PODS_ROOT}/Headers/Public/UMCSecurityPlugins" -isystem "${PODS_ROOT}/Headers/Public/WechatOpenSDK"
-OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -l"BRPickerView" -l"GPUImage" -l"IQKeyboardManager" -l"M80AttributedLabel" -l"MBProgressHUD" -l"MJExtension" -l"MJRefresh" -l"NMCAudioModule" -l"NMCVideoModule" -l"SDWebImage" -l"TTGTagCollectionView" -l"Toast" -l"WeChatSDK" -l"aacplus" -l"c++" -l"crypto" -l"event" -l"nio" -l"nts" -l"nvs" -l"openh264" -l"opus" -l"sqlite3" -l"sqlite3.0" -l"ssl" -l"z" -framework "AVFoundation" -framework "AudioToolbox" -framework "CFNetwork" -framework "CoreGraphics" -framework "CoreMedia" -framework "CoreTelephony" -framework "CoreText" -framework "Foundation" -framework "ImageIO" -framework "MobileCoreServices" -framework "NIMAVChat" -framework "NIMSDK" -framework "QuartzCore" -framework "Security" -framework "SecurityEnvSDK" -framework "SystemConfiguration" -framework "UIKit" -framework "UMCommon" -framework "UMPush" -framework "UTDID" -framework "UserNotifications" -framework "VideoToolbox"
+HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/BRPickerView" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/M80AttributedLabel" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/NIMSDK" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TTGTagCollectionView" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICollectionViewLeftAlignedLayout" "${PODS_ROOT}/Headers/Public/UMCCommon" "${PODS_ROOT}/Headers/Public/UMCPush" "${PODS_ROOT}/Headers/Public/UMCSecurityPlugins" "${PODS_ROOT}/Headers/Public/WZLBadge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK"
+LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/BRPickerView" "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManager" "${PODS_CONFIGURATION_BUILD_DIR}/M80AttributedLabel" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/MJExtension" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh" "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage" "${PODS_CONFIGURATION_BUILD_DIR}/TTGTagCollectionView" "${PODS_CONFIGURATION_BUILD_DIR}/Toast" "${PODS_CONFIGURATION_BUILD_DIR}/UICollectionViewLeftAlignedLayout" "${PODS_CONFIGURATION_BUILD_DIR}/WZLBadge" "${PODS_ROOT}/NIMSDK/NIMAVChat/Libs" "${PODS_ROOT}/NIMSDK/NIMSDK/Libs" "${PODS_ROOT}/WechatOpenSDK/WeChatSDK1.8.3"
+OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/BRPickerView" -isystem "${PODS_ROOT}/Headers/Public/IQKeyboardManager" -isystem "${PODS_ROOT}/Headers/Public/M80AttributedLabel" -isystem "${PODS_ROOT}/Headers/Public/MBProgressHUD" -isystem "${PODS_ROOT}/Headers/Public/MJExtension" -isystem "${PODS_ROOT}/Headers/Public/MJRefresh" -isystem "${PODS_ROOT}/Headers/Public/NIMSDK" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage" -isystem "${PODS_ROOT}/Headers/Public/TTGTagCollectionView" -isystem "${PODS_ROOT}/Headers/Public/Toast" -isystem "${PODS_ROOT}/Headers/Public/UICollectionViewLeftAlignedLayout" -isystem "${PODS_ROOT}/Headers/Public/UMCCommon" -isystem "${PODS_ROOT}/Headers/Public/UMCPush" -isystem "${PODS_ROOT}/Headers/Public/UMCSecurityPlugins" -isystem "${PODS_ROOT}/Headers/Public/WZLBadge" -isystem "${PODS_ROOT}/Headers/Public/WechatOpenSDK"
+OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -l"BRPickerView" -l"GPUImage" -l"IQKeyboardManager" -l"M80AttributedLabel" -l"MBProgressHUD" -l"MJExtension" -l"MJRefresh" -l"NMCAudioModule" -l"NMCVideoModule" -l"SDWebImage" -l"TTGTagCollectionView" -l"Toast" -l"UICollectionViewLeftAlignedLayout" -l"WZLBadge" -l"WeChatSDK" -l"aacplus" -l"c++" -l"crypto" -l"event" -l"nio" -l"nts" -l"nvs" -l"openh264" -l"opus" -l"sqlite3" -l"sqlite3.0" -l"ssl" -l"z" -framework "AVFoundation" -framework "AudioToolbox" -framework "CFNetwork" -framework "CoreGraphics" -framework "CoreMedia" -framework "CoreTelephony" -framework "CoreText" -framework "Foundation" -framework "ImageIO" -framework "MobileCoreServices" -framework "NIMAVChat" -framework "NIMSDK" -framework "QuartzCore" -framework "Security" -framework "SecurityEnvSDK" -framework "SystemConfiguration" -framework "UIKit" -framework "UMCommon" -framework "UMPush" -framework "UTDID" -framework "UserNotifications" -framework "VideoToolbox"
 PODS_BUILD_DIR = ${BUILD_DIR}
 PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
 PODS_PODFILE_DIR_PATH = ${SRCROOT}/.

+ 4 - 4
Pods/Target Support Files/Pods-model/Pods-model.release.xcconfig

@@ -1,9 +1,9 @@
 FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/NIMSDK/NIMSDK" "${PODS_ROOT}/NIMSDK/NIMAVChat" "${PODS_ROOT}/UMCCommon" "${PODS_ROOT}/UMCPush" "${PODS_ROOT}/UMCSecurityPlugins/thirdparties"
 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
-HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/BRPickerView" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/M80AttributedLabel" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/NIMSDK" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TTGTagCollectionView" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UMCCommon" "${PODS_ROOT}/Headers/Public/UMCPush" "${PODS_ROOT}/Headers/Public/UMCSecurityPlugins" "${PODS_ROOT}/Headers/Public/WechatOpenSDK"
-LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/BRPickerView" "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManager" "${PODS_CONFIGURATION_BUILD_DIR}/M80AttributedLabel" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/MJExtension" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh" "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage" "${PODS_CONFIGURATION_BUILD_DIR}/TTGTagCollectionView" "${PODS_CONFIGURATION_BUILD_DIR}/Toast" "${PODS_ROOT}/NIMSDK/NIMAVChat/Libs" "${PODS_ROOT}/NIMSDK/NIMSDK/Libs" "${PODS_ROOT}/WechatOpenSDK/WeChatSDK1.8.3"
-OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/BRPickerView" -isystem "${PODS_ROOT}/Headers/Public/IQKeyboardManager" -isystem "${PODS_ROOT}/Headers/Public/M80AttributedLabel" -isystem "${PODS_ROOT}/Headers/Public/MBProgressHUD" -isystem "${PODS_ROOT}/Headers/Public/MJExtension" -isystem "${PODS_ROOT}/Headers/Public/MJRefresh" -isystem "${PODS_ROOT}/Headers/Public/NIMSDK" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage" -isystem "${PODS_ROOT}/Headers/Public/TTGTagCollectionView" -isystem "${PODS_ROOT}/Headers/Public/Toast" -isystem "${PODS_ROOT}/Headers/Public/UMCCommon" -isystem "${PODS_ROOT}/Headers/Public/UMCPush" -isystem "${PODS_ROOT}/Headers/Public/UMCSecurityPlugins" -isystem "${PODS_ROOT}/Headers/Public/WechatOpenSDK"
-OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -l"BRPickerView" -l"GPUImage" -l"IQKeyboardManager" -l"M80AttributedLabel" -l"MBProgressHUD" -l"MJExtension" -l"MJRefresh" -l"NMCAudioModule" -l"NMCVideoModule" -l"SDWebImage" -l"TTGTagCollectionView" -l"Toast" -l"WeChatSDK" -l"aacplus" -l"c++" -l"crypto" -l"event" -l"nio" -l"nts" -l"nvs" -l"openh264" -l"opus" -l"sqlite3" -l"sqlite3.0" -l"ssl" -l"z" -framework "AVFoundation" -framework "AudioToolbox" -framework "CFNetwork" -framework "CoreGraphics" -framework "CoreMedia" -framework "CoreTelephony" -framework "CoreText" -framework "Foundation" -framework "ImageIO" -framework "MobileCoreServices" -framework "NIMAVChat" -framework "NIMSDK" -framework "QuartzCore" -framework "Security" -framework "SecurityEnvSDK" -framework "SystemConfiguration" -framework "UIKit" -framework "UMCommon" -framework "UMPush" -framework "UTDID" -framework "UserNotifications" -framework "VideoToolbox"
+HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/BRPickerView" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/M80AttributedLabel" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/NIMSDK" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TTGTagCollectionView" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICollectionViewLeftAlignedLayout" "${PODS_ROOT}/Headers/Public/UMCCommon" "${PODS_ROOT}/Headers/Public/UMCPush" "${PODS_ROOT}/Headers/Public/UMCSecurityPlugins" "${PODS_ROOT}/Headers/Public/WZLBadge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK"
+LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/BRPickerView" "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManager" "${PODS_CONFIGURATION_BUILD_DIR}/M80AttributedLabel" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/MJExtension" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh" "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage" "${PODS_CONFIGURATION_BUILD_DIR}/TTGTagCollectionView" "${PODS_CONFIGURATION_BUILD_DIR}/Toast" "${PODS_CONFIGURATION_BUILD_DIR}/UICollectionViewLeftAlignedLayout" "${PODS_CONFIGURATION_BUILD_DIR}/WZLBadge" "${PODS_ROOT}/NIMSDK/NIMAVChat/Libs" "${PODS_ROOT}/NIMSDK/NIMSDK/Libs" "${PODS_ROOT}/WechatOpenSDK/WeChatSDK1.8.3"
+OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/BRPickerView" -isystem "${PODS_ROOT}/Headers/Public/IQKeyboardManager" -isystem "${PODS_ROOT}/Headers/Public/M80AttributedLabel" -isystem "${PODS_ROOT}/Headers/Public/MBProgressHUD" -isystem "${PODS_ROOT}/Headers/Public/MJExtension" -isystem "${PODS_ROOT}/Headers/Public/MJRefresh" -isystem "${PODS_ROOT}/Headers/Public/NIMSDK" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage" -isystem "${PODS_ROOT}/Headers/Public/TTGTagCollectionView" -isystem "${PODS_ROOT}/Headers/Public/Toast" -isystem "${PODS_ROOT}/Headers/Public/UICollectionViewLeftAlignedLayout" -isystem "${PODS_ROOT}/Headers/Public/UMCCommon" -isystem "${PODS_ROOT}/Headers/Public/UMCPush" -isystem "${PODS_ROOT}/Headers/Public/UMCSecurityPlugins" -isystem "${PODS_ROOT}/Headers/Public/WZLBadge" -isystem "${PODS_ROOT}/Headers/Public/WechatOpenSDK"
+OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -l"BRPickerView" -l"GPUImage" -l"IQKeyboardManager" -l"M80AttributedLabel" -l"MBProgressHUD" -l"MJExtension" -l"MJRefresh" -l"NMCAudioModule" -l"NMCVideoModule" -l"SDWebImage" -l"TTGTagCollectionView" -l"Toast" -l"UICollectionViewLeftAlignedLayout" -l"WZLBadge" -l"WeChatSDK" -l"aacplus" -l"c++" -l"crypto" -l"event" -l"nio" -l"nts" -l"nvs" -l"openh264" -l"opus" -l"sqlite3" -l"sqlite3.0" -l"ssl" -l"z" -framework "AVFoundation" -framework "AudioToolbox" -framework "CFNetwork" -framework "CoreGraphics" -framework "CoreMedia" -framework "CoreTelephony" -framework "CoreText" -framework "Foundation" -framework "ImageIO" -framework "MobileCoreServices" -framework "NIMAVChat" -framework "NIMSDK" -framework "QuartzCore" -framework "Security" -framework "SecurityEnvSDK" -framework "SystemConfiguration" -framework "UIKit" -framework "UMCommon" -framework "UMPush" -framework "UTDID" -framework "UserNotifications" -framework "VideoToolbox"
 PODS_BUILD_DIR = ${BUILD_DIR}
 PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
 PODS_PODFILE_DIR_PATH = ${SRCROOT}/.

+ 5 - 0
Pods/Target Support Files/UICollectionViewLeftAlignedLayout/UICollectionViewLeftAlignedLayout-dummy.m

@@ -0,0 +1,5 @@
+#import <Foundation/Foundation.h>
+@interface PodsDummy_UICollectionViewLeftAlignedLayout : NSObject
+@end
+@implementation PodsDummy_UICollectionViewLeftAlignedLayout
+@end

+ 12 - 0
Pods/Target Support Files/UICollectionViewLeftAlignedLayout/UICollectionViewLeftAlignedLayout-prefix.pch

@@ -0,0 +1,12 @@
+#ifdef __OBJC__
+#import <UIKit/UIKit.h>
+#else
+#ifndef FOUNDATION_EXPORT
+#if defined(__cplusplus)
+#define FOUNDATION_EXPORT extern "C"
+#else
+#define FOUNDATION_EXPORT extern
+#endif
+#endif
+#endif
+

+ 9 - 0
Pods/Target Support Files/UICollectionViewLeftAlignedLayout/UICollectionViewLeftAlignedLayout.xcconfig

@@ -0,0 +1,9 @@
+CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/UICollectionViewLeftAlignedLayout
+GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
+HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/UICollectionViewLeftAlignedLayout" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/UICollectionViewLeftAlignedLayout"
+PODS_BUILD_DIR = ${BUILD_DIR}
+PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
+PODS_ROOT = ${SRCROOT}
+PODS_TARGET_SRCROOT = ${PODS_ROOT}/UICollectionViewLeftAlignedLayout
+PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
+SKIP_INSTALL = YES

+ 5 - 0
Pods/Target Support Files/WZLBadge/WZLBadge-dummy.m

@@ -0,0 +1,5 @@
+#import <Foundation/Foundation.h>
+@interface PodsDummy_WZLBadge : NSObject
+@end
+@implementation PodsDummy_WZLBadge
+@end

+ 12 - 0
Pods/Target Support Files/WZLBadge/WZLBadge-prefix.pch

@@ -0,0 +1,12 @@
+#ifdef __OBJC__
+#import <UIKit/UIKit.h>
+#else
+#ifndef FOUNDATION_EXPORT
+#if defined(__cplusplus)
+#define FOUNDATION_EXPORT extern "C"
+#else
+#define FOUNDATION_EXPORT extern
+#endif
+#endif
+#endif
+

+ 10 - 0
Pods/Target Support Files/WZLBadge/WZLBadge.xcconfig

@@ -0,0 +1,10 @@
+CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/WZLBadge
+GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
+HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/WZLBadge" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/WZLBadge"
+OTHER_LDFLAGS = -framework "UIKit"
+PODS_BUILD_DIR = ${BUILD_DIR}
+PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
+PODS_ROOT = ${SRCROOT}
+PODS_TARGET_SRCROOT = ${PODS_ROOT}/WZLBadge
+PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
+SKIP_INSTALL = YES

+ 20 - 0
Pods/UICollectionViewLeftAlignedLayout/LICENSE

@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Giovanni Lodi
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 42 - 0
Pods/UICollectionViewLeftAlignedLayout/README.md

@@ -0,0 +1,42 @@
+UICollectionView Left Aligned Layout
+====================================
+
+A `UICollectionViewLayout` implementation that aligns the cells to the left. 
+
+<img src="https://raw.githubusercontent.com/mokagio/UICollectionViewLeftAlignedLayout/master/screenshot.png" />
+
+_Check out the twin project [`UICollectionViewRightAlignedLayout`](https://github.com/mokagio/UICollectionViewRightAlignedLayout)_
+
+## Installation with CocoaPods
+
+```ruby
+platform :ios, '6.0'
+
+pod 'UICollectionViewLeftAlignedLayout'
+```
+
+## Usage
+
+Simply set `UICollectionViewLeftAlignedLayout` as the layout object for your collection view either via code:
+
+```objc
+CGRect frame = ...
+UICollectionViewLeftAlignedLayout *layout = [UICollectionViewLeftAlignedLayout alloc] init];
+UICollectionView *leftAlignedCollectionView = [[UICollectionView alloc] initWithFrame:frame collectionViewLayout:layout];
+```
+
+or from Interface Builder:
+
+_img needed here_
+
+`UICollectionViewLeftAlignedLayout` is a subclass of `UICollectionViewFlowLayout`, so your collection view delegate can use all the delegate methods of [`UICollectionViewDelegateFlowLayout`](https://developer.apple.com/library/ios/documentation/uikit/reference/UICollectionViewDelegateFlowLayout_protocol/Reference/Reference.html).
+
+For those of you who like consistency there is an `UICollectionViewDelegateLeftAlignedLayout` protocol that your delegate object can conform to. Is nothing more than an empty extension of `UICollectionViewDelegateFlowLayout`.
+
+## License
+
+`UICollectionViewLeftAlignedLayout` is released under the [MIT license](https://github.com/mokagio/UICollectionViewLeftAlignedLayout/blob/master/LICENSE).
+
+---
+
+Hacked together with passion by [@mokagio](https://twitter.com/mokagio)

+ 40 - 0
Pods/UICollectionViewLeftAlignedLayout/UICollectionViewLeftAlignedLayout/UICollectionViewLeftAlignedLayout.h

@@ -0,0 +1,40 @@
+
+// Copyright (c) 2014 Giovanni Lodi
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy of
+// this software and associated documentation files (the "Software"), to deal in
+// the Software without restriction, including without limitation the rights to
+// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+// the Software, and to permit persons to whom the Software is furnished to do so,
+// subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+/**
+ *  Simple UICollectionViewFlowLayout that aligns the cells to the left rather than justify them
+ *
+ *  Based on http://stackoverflow.com/questions/13017257/how-do-you-determine-spacing-between-cells-in-uicollectionview-flowlayout
+ */
+
+#import <UIKit/UIKit.h>
+
+@interface UICollectionViewLeftAlignedLayout : UICollectionViewFlowLayout
+
+@end
+
+/**
+ *  Just a convenience protocol to keep things consistent.
+ *  Someone could find it confusing for a delegate object to conform to UICollectionViewDelegateFlowLayout
+ *  while using UICollectionViewLeftAlignedLayout.
+ */
+@protocol UICollectionViewDelegateLeftAlignedLayout <UICollectionViewDelegateFlowLayout>
+
+@end

+ 117 - 0
Pods/UICollectionViewLeftAlignedLayout/UICollectionViewLeftAlignedLayout/UICollectionViewLeftAlignedLayout.m

@@ -0,0 +1,117 @@
+
+// Copyright (c) 2014 Giovanni Lodi
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy of
+// this software and associated documentation files (the "Software"), to deal in
+// the Software without restriction, including without limitation the rights to
+// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+// the Software, and to permit persons to whom the Software is furnished to do so,
+// subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+#import "UICollectionViewLeftAlignedLayout.h"
+
+@interface UICollectionViewLayoutAttributes (LeftAligned)
+
+- (void)leftAlignFrameWithSectionInset:(UIEdgeInsets)sectionInset;
+
+@end
+
+@implementation UICollectionViewLayoutAttributes (LeftAligned)
+
+- (void)leftAlignFrameWithSectionInset:(UIEdgeInsets)sectionInset
+{
+    CGRect frame = self.frame;
+    frame.origin.x = sectionInset.left;
+    self.frame = frame;
+}
+
+@end
+
+#pragma mark -
+
+@implementation UICollectionViewLeftAlignedLayout
+
+#pragma mark - UICollectionViewLayout
+
+- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect {
+    NSArray *originalAttributes = [super layoutAttributesForElementsInRect:rect];
+    NSMutableArray *updatedAttributes = [NSMutableArray arrayWithArray:originalAttributes];
+    for (UICollectionViewLayoutAttributes *attributes in originalAttributes) {
+        if (!attributes.representedElementKind) {
+            NSUInteger index = [updatedAttributes indexOfObject:attributes];
+            updatedAttributes[index] = [self layoutAttributesForItemAtIndexPath:attributes.indexPath];
+        }
+    }
+
+    return updatedAttributes;
+}
+
+- (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath {
+    UICollectionViewLayoutAttributes* currentItemAttributes = [[super layoutAttributesForItemAtIndexPath:indexPath] copy];
+    UIEdgeInsets sectionInset = [self evaluatedSectionInsetForItemAtIndex:indexPath.section];
+
+    BOOL isFirstItemInSection = indexPath.item == 0;
+    CGFloat layoutWidth = CGRectGetWidth(self.collectionView.frame) - sectionInset.left - sectionInset.right;
+
+    if (isFirstItemInSection) {
+        [currentItemAttributes leftAlignFrameWithSectionInset:sectionInset];
+        return currentItemAttributes;
+    }
+
+    NSIndexPath* previousIndexPath = [NSIndexPath indexPathForItem:indexPath.item-1 inSection:indexPath.section];
+    CGRect previousFrame = [self layoutAttributesForItemAtIndexPath:previousIndexPath].frame;
+    CGFloat previousFrameRightPoint = previousFrame.origin.x + previousFrame.size.width;
+    CGRect currentFrame = currentItemAttributes.frame;
+    CGRect strecthedCurrentFrame = CGRectMake(sectionInset.left,
+                                              currentFrame.origin.y,
+                                              layoutWidth,
+                                              currentFrame.size.height);
+    // if the current frame, once left aligned to the left and stretched to the full collection view
+    // widht intersects the previous frame then they are on the same line
+    BOOL isFirstItemInRow = !CGRectIntersectsRect(previousFrame, strecthedCurrentFrame);
+
+    if (isFirstItemInRow) {
+        // make sure the first item on a line is left aligned
+        [currentItemAttributes leftAlignFrameWithSectionInset:sectionInset];
+        return currentItemAttributes;
+    }
+
+    CGRect frame = currentItemAttributes.frame;
+    frame.origin.x = previousFrameRightPoint + [self evaluatedMinimumInteritemSpacingForSectionAtIndex:indexPath.section];
+    currentItemAttributes.frame = frame;
+    return currentItemAttributes;
+}
+
+- (CGFloat)evaluatedMinimumInteritemSpacingForSectionAtIndex:(NSInteger)sectionIndex
+{
+    if ([self.collectionView.delegate respondsToSelector:@selector(collectionView:layout:minimumInteritemSpacingForSectionAtIndex:)]) {
+        id<UICollectionViewDelegateLeftAlignedLayout> delegate = (id<UICollectionViewDelegateLeftAlignedLayout>)self.collectionView.delegate;
+
+        return [delegate collectionView:self.collectionView layout:self minimumInteritemSpacingForSectionAtIndex:sectionIndex];
+    } else {
+        return self.minimumInteritemSpacing;
+    }
+}
+
+- (UIEdgeInsets)evaluatedSectionInsetForItemAtIndex:(NSInteger)index
+{
+    if ([self.collectionView.delegate respondsToSelector:@selector(collectionView:layout:insetForSectionAtIndex:)]) {
+        id<UICollectionViewDelegateLeftAlignedLayout> delegate = (id<UICollectionViewDelegateLeftAlignedLayout>)self.collectionView.delegate;
+
+        return [delegate collectionView:self.collectionView layout:self insetForSectionAtIndex:index];
+    } else {
+        return self.sectionInset;
+    }
+}
+
+@end

+ 21 - 0
Pods/WZLBadge/LICENSE

@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Zilin Weng
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

+ 176 - 0
Pods/WZLBadge/README.md

@@ -0,0 +1,176 @@
+一行代码实现Badge效果(iOS)
+BADGE IN ONE LINE(iOS)
+===================
+OVERVIEW
+===================
+WZLBadge is a tool to add or clear badge for **any UIViews**, which is written in Objective-C, **supporting iOS5 or above**, supporting **portrait and landscape device orientation**.
+
+> The code is implemented by the way of category for UIView, thus, 
+it is **very easy to use**.
+
+At this version, three badge style are supported:
+
+ - WBadgeStyleRedDot
+ - WBadgeStyleNumber
+ - WBadgeStyleNew
+
+Three animation types are supported:
+
+ - WBadgeAnimTypeNone(by default)
+ - WBadgeAnimTypeScale
+ - WBadgeAnimTypeShake
+ - WBadgeAnimTypeBreathe
+ - WBadgeAnimTypeBounce
+ 
+
+Here are examples for WZLBadge(just show static picture without gif here):
+![](https://ww2.sinaimg.cn/large/006tKfTcgy1fevi5smct4j30yi1pcn52.jpg)
+
+
+![](https://ww3.sinaimg.cn/large/006tKfTcgy1fevi5x1h2cj31kw0w0tdc.jpg)
+
+
+----------
+
+
+INSTALLTATION
+-------------
+Method1:
+Drag the 
+> WZLBadge
+
+ folder into your project.
+
+Method2:
+Use CocoaPods to install automaticlly:
+
+pod 'WZLBadge'
+
+----------
+
+REQUIREMENTS
+-------------------
+
+ - Xcode 6
+ - iOS5 or above
+ - ARC (or MRC, but project setting is necessary)
+
+----------
+
+
+USAGE
+-------------
+
+ 1. Add the following import to the top of the file:
+> import "WZLBadgeImport.h"
+
+ 2. Use the following to display badge easily:
+
+> [someView showBadgeWithStyle:**WBadgeStyleRedDot** value:0 animationType:**WBadgeAnimTypeShake**];
+> [someView showBadgeWithStyle:**WBadgeStyleNumber** value:99 animationType:**WBadgeAnimTypeShake**];
+
+or simply call interface:[- showBadge]
+ 
+3. Use the following to hide badge easily:
+ 
+
+> [someView clearBadge];
+
+4.Use the following to resume badge when it has been hidden:
+
+> [someView resumeBadge];
+
+----------
+
+
+BADGE CUSTOMIZATION
+--------------------
+Feel free to customize badge size, position, animation style or anything else.
+
+WZLBadge provides easy way to customize its style.:
+
+    //set background color. red color by default
+    view.badgeBgColor = [UIColor purpleColor];
+    
+    //set badge position. right-top corner of view by default
+    view.badgeCenterOffset = CGPointMake(-8, 0);
+
+	//set badge foreground color. white color by default
+	view.badgeTextColor = [UIColor whiteColor];
+
+	//...
+
+----------
+CONTACT
+--------------------
+Do you have any questions or idea? My email is: 
+
+> zilin_weng@163.com
+
+ Or you can find some more info at my blog in cnblogs.com:
+ 
+> http://www.cnblogs.com/wengzilin/
+
+如果你在天朝,可以查看中文博客地址:
+http://www.cnblogs.com/wengzilin/p/4633937.html
+
+----------
+NOTE
+--------------------
+This project will be update continually. Therefore, **fork** or **star** would be suggested.
+
+I wish it to be an ultimat solution for UIView badge in iOS.
+
+----------
+AUTHOR
+--------------------
+Zilin Weng(翁子林) https://github.com/weng1250
+
+
+----------
+CONTRIBUTE
+--------------------
+ - jfuellert https://github.com/jfuellert
+ - zhangao0086 https://github.com/zhangao0086
+
+Feel free to open an issue or pull request, if you need help or there is a bug.
+
+----------
+CHANGE LOG
+--------------------
+v1.2.6 2017.4.20
+ Bugs were fixed.
+ Enable setting badge properties before bage initialization.
+
+v.1.2.5 201.7.31
+ fix bug 'when showing TabbarItem bage, badge is covered by tabbarItem icon'
+
+v1.2.3 2016.2.15
+ 1.Enable resume badge when badge has been cleard(removed)
+
+V1.2.2  2015.12.18
+ 1.Enable badge font customization
+ 2.code warning removed
+
+V1.2  2015.09.25
+ 1.UITabBarItem badge is supproted;
+ 2.Enable change badge properties when badge is showing;
+ 3.Other code optimization.
+
+V1.1  2015.08.12
+
+ 1. UIBarButtonItem badge is supported. UIBarButtonItem is kind of NSObject and its displayed view is invisiable. This version makes usage of UIBarButtonItem badge as to UIView.
+ 2. Slight adjustment for code structure to fit future extension.
+ 3. Other code optimization.
+
+
+
+V1.0  at 2015.06.16
+
+Base functions are completed, which is able to meet most of requirements.
+
+----------
+----------
+LICENSE
+--------------------
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 44 - 0
Pods/WZLBadge/WZLBadge/BarItem/UIBarButtonItem+WZLBadge.h

@@ -0,0 +1,44 @@
+//
+//  UIBarButtonItem+WZLBadge.h
+//  WZLBadgeDemo
+//
+//  Created by zilin_weng on 15/8/10.
+//  Copyright (c) 2015年 Weng-Zilin. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "UIView+WZLBadge.h"
+#import "WZLBadgeProtocol.h"
+
+@interface UIBarButtonItem (WZLBadge)<WZLBadgeProtocol>
+
+/**
+ *  show badge with red dot style and WBadgeAnimTypeNone by default.
+ */
+- (void)showBadge;
+
+/**
+ *  showBadge
+ *
+ *  @param style WBadgeStyle type
+ *  @param value (if 'style' is WBadgeStyleRedDot or WBadgeStyleNew,
+ this value will be ignored. In this case, any value will be ok.)
+ *   @param aniType
+ */
+- (void)showBadgeWithStyle:(WBadgeStyle)style
+                     value:(NSInteger)value
+             animationType:(WBadgeAnimType)aniType;
+
+
+/**
+ *  clear badge(hide badge)
+ */
+- (void)clearBadge;
+
+/**
+ *  make bage(if existing) not hiden
+ */
+- (void)resumeBadge;
+
+
+@end

+ 150 - 0
Pods/WZLBadge/WZLBadge/BarItem/UIBarButtonItem+WZLBadge.m

@@ -0,0 +1,150 @@
+//
+//  UIBarButtonItem+WZLBadge.m
+//  WZLBadgeDemo
+//
+//  Created by zilin_weng on 15/8/10.
+//  Copyright (c) 2015年 Weng-Zilin. All rights reserved.
+//
+
+#import "UIBarButtonItem+WZLBadge.h"
+#import <objc/runtime.h>
+
+#define kActualView     [self getActualBadgeSuperView]
+
+
+@implementation UIBarButtonItem (WZLBadge)
+
+#pragma mark -- public methods
+
+/**
+ *  show badge with red dot style and WBadgeAnimTypeNone by default.
+ */
+- (void)showBadge
+{
+    [kActualView showBadge];
+}
+
+/**
+ *  showBadge
+ *
+ *  @param style WBadgeStyle type
+ *  @param value (if 'style' is WBadgeStyleRedDot or WBadgeStyleNew,
+            this value will be ignored. In this case, any value will be ok.)
+ *   @param aniType
+ */
+- (void)showBadgeWithStyle:(WBadgeStyle)style
+                     value:(NSInteger)value
+             animationType:(WBadgeAnimType)aniType
+{
+    [kActualView showBadgeWithStyle:style value:value animationType:aniType];
+}
+
+
+/**
+ *  clear badge
+ */
+- (void)clearBadge
+{
+    [kActualView clearBadge];
+}
+
+- (void)resumeBadge
+{
+    [kActualView resumeBadge];
+}
+
+#pragma mark -- private method
+
+/**
+ *  Because UIBarButtonItem is kind of NSObject, it is not able to directly attach badge.
+    This method is used to find actual view (non-nil) inside UIBarButtonItem instance.
+ *
+ *  @return view
+ */
+- (UIView *)getActualBadgeSuperView
+{
+    return [self valueForKeyPath:@"_view"];//use KVC to hack actual view
+}
+
+#pragma mark -- setter/getter
+- (UILabel *)badge
+{
+    return kActualView.badge;
+}
+
+- (void)setBadge:(UILabel *)label
+{
+    [kActualView setBadge:label];
+}
+
+- (UIFont *)badgeFont
+{
+	return kActualView.badgeFont;
+}
+
+- (void)setBadgeFont:(UIFont *)badgeFont
+{
+	[kActualView setBadgeFont:badgeFont];
+}
+
+- (UIColor *)badgeBgColor
+{
+    return [kActualView badgeBgColor];
+}
+
+- (void)setBadgeBgColor:(UIColor *)badgeBgColor
+{
+    [kActualView setBadgeBgColor:badgeBgColor];
+}
+
+- (UIColor *)badgeTextColor
+{
+    return [kActualView badgeTextColor];
+}
+
+- (void)setBadgeTextColor:(UIColor *)badgeTextColor
+{
+    [kActualView setBadgeTextColor:badgeTextColor];
+}
+
+- (WBadgeAnimType)aniType
+{
+    return [kActualView aniType];
+}
+
+- (void)setAniType:(WBadgeAnimType)aniType
+{
+    [kActualView setAniType:aniType];
+}
+
+- (CGRect)badgeFrame
+{
+    return [kActualView badgeFrame];
+}
+
+- (void)setBadgeFrame:(CGRect)badgeFrame
+{
+    [kActualView setBadgeFrame:badgeFrame];
+}
+
+- (CGPoint)badgeCenterOffset
+{
+    return [kActualView badgeCenterOffset];
+}
+
+- (void)setBadgeCenterOffset:(CGPoint)badgeCenterOffset
+{
+    [kActualView setBadgeCenterOffset:badgeCenterOffset];
+}
+
+- (NSInteger)badgeMaximumBadgeNumber
+{
+    return [kActualView badgeMaximumBadgeNumber];
+}
+
+- (void)setBadgeMaximumBadgeNumber:(NSInteger)badgeMaximumBadgeNumber
+{
+    [kActualView setBadgeMaximumBadgeNumber:badgeMaximumBadgeNumber];
+}
+
+@end

+ 43 - 0
Pods/WZLBadge/WZLBadge/BarItem/UITabBarItem+WZLBadge.h

@@ -0,0 +1,43 @@
+//
+//  UITabBarItem+WZLBadge.h
+//  WZLBadgeDemo
+//
+//  Created by zilin_weng on 15/9/24.
+//  Copyright (c) 2015年 Weng-Zilin. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "UIView+WZLBadge.h"
+#import "WZLBadgeProtocol.h"
+
+@interface UITabBarItem (WZLBadge)<WZLBadgeProtocol>
+
+/**
+ *  show badge with red dot style and WBadgeAnimTypeNone by default.
+ */
+- (void)showBadge;
+
+/**
+ *  showBadge
+ *
+ *  @param style WBadgeStyle type
+ *  @param value (if 'style' is WBadgeStyleRedDot or WBadgeStyleNew,
+ this value will be ignored. In this case, any value will be ok.)
+ *   @param aniType
+ */
+- (void)showBadgeWithStyle:(WBadgeStyle)style
+                     value:(NSInteger)value
+             animationType:(WBadgeAnimType)aniType;
+
+
+/**
+ *  clear badge(hide badge)
+ */
+- (void)clearBadge;
+
+/**
+ *  make bage(if existing) not hiden
+ */
+- (void)resumeBadge;
+
+@end

+ 169 - 0
Pods/WZLBadge/WZLBadge/BarItem/UITabBarItem+WZLBadge.m

@@ -0,0 +1,169 @@
+//
+//  UITabBarItem+WZLBadge.m
+//  WZLBadgeDemo
+//
+//  Created by zilin_weng on 15/9/24.
+//  Copyright (c) 2015年 Weng-Zilin. All rights reserved.
+//
+
+#import "UITabBarItem+WZLBadge.h"
+
+#define kActualView     [self getActualBadgeSuperView]
+
+@implementation UITabBarItem (WZLBadge)
+
+#pragma mark -- public methods
+
+/**
+ *  show badge with red dot style and WBadgeAnimTypeNone by default.
+ */
+- (void)showBadge
+{
+    [kActualView showBadge];
+}
+
+/**
+ *  showBadge
+ *
+ *  @param style WBadgeStyle type
+ *  @param value (if 'style' is WBadgeStyleRedDot or WBadgeStyleNew,
+ this value will be ignored. In this case, any value will be ok.)
+ *   @param aniType
+ */
+- (void)showBadgeWithStyle:(WBadgeStyle)style
+                     value:(NSInteger)value
+             animationType:(WBadgeAnimType)aniType
+{
+    [kActualView showBadgeWithStyle:style value:value animationType:aniType];
+}
+
+/**
+ *  clear badge
+ */
+- (void)clearBadge
+{
+    [kActualView clearBadge];
+}
+
+- (void)resumeBadge
+{
+    [kActualView resumeBadge];
+}
+
+#pragma mark -- private method
+
+/**
+ *  Because UIBarButtonItem is kind of NSObject, it is not able to directly attach badge.
+ This method is used to find actual view (non-nil) inside UIBarButtonItem instance.
+ *
+ *  @return view
+ */
+- (UIView *)getActualBadgeSuperView
+{
+    // 1.get UITabbarButtion
+    UIView *bottomView = [self valueForKeyPath:@"_view"];
+    
+    // 2.get imageView, to make sure badge front at anytime.
+    UIView *actualSuperView = nil;
+    if (bottomView) {
+        actualSuperView = [self find:bottomView firstSubviewWithClass:NSClassFromString(@"UITabBarSwappableImageView")];
+    }
+    
+    // badge label will be added onto imageView
+    return actualSuperView;
+}
+
+- (UIView *)find:(UIView *)view firstSubviewWithClass:(Class)cls
+{
+    __block UIView *targetView = nil;
+    [view.subviews enumerateObjectsUsingBlock:^(UIView *subview, NSUInteger idx, BOOL * _Nonnull stop) {
+        if ([subview isKindOfClass:cls]) {
+            targetView = subview;
+            *stop = YES;
+        }
+    }];
+    return targetView;
+}
+
+#pragma mark -- setter/getter
+- (UILabel *)badge
+{
+    return kActualView.badge;
+}
+
+- (void)setBadge:(UILabel *)label
+{
+    [kActualView setBadge:label];
+}
+
+- (UIFont *)badgeFont
+{
+	return kActualView.badgeFont;
+}
+
+- (void)setBadgeFont:(UIFont *)badgeFont
+{
+	[kActualView setBadgeFont:badgeFont];
+}
+
+- (UIColor *)badgeBgColor
+{
+    return [kActualView badgeBgColor];
+}
+
+- (void)setBadgeBgColor:(UIColor *)badgeBgColor
+{
+    [kActualView setBadgeBgColor:badgeBgColor];
+}
+
+- (UIColor *)badgeTextColor
+{
+    return [kActualView badgeTextColor];
+}
+
+- (void)setBadgeTextColor:(UIColor *)badgeTextColor
+{
+    [kActualView setBadgeTextColor:badgeTextColor];
+}
+
+- (WBadgeAnimType)aniType
+{
+    return [kActualView aniType];
+}
+
+- (void)setAniType:(WBadgeAnimType)aniType
+{
+    [kActualView setAniType:aniType];
+}
+
+- (CGRect)badgeFrame
+{
+    return [kActualView badgeFrame];
+}
+
+- (void)setBadgeFrame:(CGRect)badgeFrame
+{
+    [kActualView setBadgeFrame:badgeFrame];
+}
+
+- (CGPoint)badgeCenterOffset
+{
+    return [kActualView badgeCenterOffset];
+}
+
+- (void)setBadgeCenterOffset:(CGPoint)badgeCenterOffset
+{
+    [kActualView setBadgeCenterOffset:badgeCenterOffset];
+}
+
+- (NSInteger)badgeMaximumBadgeNumber
+{
+    return [kActualView badgeMaximumBadgeNumber];
+}
+
+- (void)setBadgeMaximumBadgeNumber:(NSInteger)badgeMaximumBadgeNumber
+{
+    [kActualView setBadgeMaximumBadgeNumber:badgeMaximumBadgeNumber];
+}
+
+@end

+ 88 - 0
Pods/WZLBadge/WZLBadge/CategorySupport/CAAnimation+WAnimation.h

@@ -0,0 +1,88 @@
+//
+//  NSObject+WAnimation.h
+//  WZLBadgeDemo
+//
+//  Created by zilin_weng on 15/6/26.
+//  Copyright (c) 2015年 Weng-Zilin. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+
+typedef NS_ENUM(NSUInteger, WAxis)
+{
+    WAxisX = 0,
+    WAxisY,
+    WAxisZ
+};
+
+// Degrees to radians
+#define DEGREES_TO_RADIANS(angle) ((angle) / 180.0 * M_PI)
+#define RADIANS_TO_DEGREES(radians) ((radians) * (180.0 / M_PI))
+
+@interface CAAnimation (WAnimation)
+
+/**
+ *  breathing forever
+ *
+ *  @param time duritaion, from clear to fully seen
+ *
+ *  @return animation obj
+ */
++(CABasicAnimation *)opacityForever_Animation:(float)time;
+
+/**
+ *  breathing with fixed repeated times
+ *
+ *  @param repeatTimes times
+ *  @param time        duritaion, from clear to fully seen
+ *
+ *  @return animation obj
+ */
++(CABasicAnimation *)opacityTimes_Animation:(float)repeatTimes durTimes:(float)time;
+
+/**
+ *  //rotate
+ *
+ *  @param dur         duration
+ *  @param degree      rotate degree in radian(弧度)
+ *  @param axis        axis
+ *  @param repeatCount repeat count
+ *
+ *  @return animation obj
+ */
++(CABasicAnimation *)rotation:(float)dur degree:(float)degree direction:(WAxis)axis repeatCount:(int)repeatCount;
+
+
+/**
+ *  scale animation
+ *
+ *  @param fromScale   the original scale value, 1.0 by default
+ *  @param toScale     target scale
+ *  @param time        duration
+ *  @param repeatTimes repeat counts
+ *
+ *  @return animaiton obj
+ */
++(CABasicAnimation *)scaleFrom:(CGFloat)fromScale toScale:(CGFloat)toScale durTimes:(float)time rep:(float)repeatTimes;
+/**
+ *  shake
+ *
+ *  @param repeatTimes time
+ *  @param time        duration
+ *  @param obj         always be CALayer at present
+ *  @return aniamtion obj
+ */
++(CAKeyframeAnimation *)shake_AnimationRepeatTimes:(float)repeatTimes durTimes:(float)time forObj:(id)obj;
+
+/**
+ *  bounce
+ *
+ *  @param repeatTimes time
+ *  @param time        duration
+ *  @param obj         always be CALayer at present
+ *  @return aniamtion obj
+ */
++(CAKeyframeAnimation *)bounce_AnimationRepeatTimes:(float)repeatTimes durTimes:(float)time forObj:(id)obj;
+
+@end

+ 172 - 0
Pods/WZLBadge/WZLBadge/CategorySupport/CAAnimation+WAnimation.m

@@ -0,0 +1,172 @@
+//
+//  NSObject+WAnimation.m
+//  WZLBadgeDemo
+//
+//  Created by zilin_weng on 15/6/26.
+//  Copyright (c) 2015年 Weng-Zilin. All rights reserved.
+//
+
+#import "CAAnimation+WAnimation.h"
+#import <QuartzCore/QuartzCore.h>
+
+@implementation CAAnimation (WAnimation)
+/**
+ *  breathing forever
+ *
+ *  @param time duritaion, from clear to fully seen
+ *
+ *  @return animation obj
+ */
++(CABasicAnimation *)opacityForever_Animation:(float)time
+{
+    CABasicAnimation *animation=[CABasicAnimation animationWithKeyPath:@"opacity"];
+    animation.fromValue=[NSNumber numberWithFloat:1.0];
+    animation.toValue=[NSNumber numberWithFloat:0.1];
+    animation.autoreverses=YES;
+    animation.duration=time;
+    animation.repeatCount=FLT_MAX;
+    animation.removedOnCompletion=NO;
+    animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
+    animation.fillMode=kCAFillModeForwards;
+    return animation;
+}
+
+/**
+ *  breathing with fixed repeated times
+ *
+ *  @param repeatTimes times
+ *  @param time        duritaion, from clear to fully seen
+ *
+ *  @return animation obj
+ */
++(CABasicAnimation *)opacityTimes_Animation:(float)repeatTimes durTimes:(float)time
+{
+    CABasicAnimation *animation=[CABasicAnimation animationWithKeyPath:@"opacity"];
+    animation.fromValue=[NSNumber numberWithFloat:1.0];
+    animation.toValue=[NSNumber numberWithFloat:0.4];
+    animation.repeatCount=repeatTimes;
+    animation.duration=time;
+    animation.removedOnCompletion=NO;
+    animation.fillMode=kCAFillModeForwards;
+    animation.timingFunction=[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
+    animation.autoreverses=YES;
+    return  animation;
+}
+
+/**
+ *  //rotate
+ *
+ *  @param dur         duration
+ *  @param degree      rotate degree in radian(弧度)
+ *  @param axis        axis
+ *  @param repeatCount repeat count
+ *
+ *  @return animation obj
+ */
++(CABasicAnimation *)rotation:(float)dur degree:(float)degree direction:(WAxis)axis repeatCount:(int)repeatCount
+{
+    CABasicAnimation* animation;
+    NSArray *axisArr = @[@"transform.rotation.x", @"transform.rotation.y", @"transform.rotation.z"];
+    animation = [CABasicAnimation animationWithKeyPath:axisArr[axis]];
+    animation.fromValue = [NSNumber numberWithFloat:0];
+    animation.toValue= [NSNumber numberWithFloat:degree];
+    animation.duration= dur;
+    animation.autoreverses= NO;
+    animation.cumulative= YES;
+    animation.removedOnCompletion=NO;
+    animation.fillMode=kCAFillModeForwards;
+    animation.repeatCount= repeatCount;
+    
+    return animation;
+}
+
+/**
+ *  scale animation
+ *
+ *  @param fromScale   the original scale value, 1.0 by default
+ *  @param toScale     target scale
+ *  @param time        duration
+ *  @param repeatTimes repeat counts
+ *
+ *  @return animaiton obj
+ */
++(CABasicAnimation *)scaleFrom:(CGFloat)fromScale toScale:(CGFloat)toScale durTimes:(float)time rep:(float)repeatTimes
+{
+    CABasicAnimation *animation=[CABasicAnimation animationWithKeyPath:@"transform.scale"];
+    animation.fromValue = @(fromScale);
+    animation.toValue = @(toScale);
+    animation.duration = time;
+    animation.autoreverses = YES;
+    animation.repeatCount = repeatTimes;
+    animation.removedOnCompletion = NO;
+    animation.fillMode = kCAFillModeForwards;
+    return animation;
+}
+
+/**
+ *  shake
+ *
+ *  @param repeatTimes time
+ *  @param time        duration
+ *  @param obj         always be CALayer
+ *  @return aniamtion obj
+ */
++(CAKeyframeAnimation *)shake_AnimationRepeatTimes:(float)repeatTimes durTimes:(float)time forObj:(id)obj
+{
+    NSAssert([obj isKindOfClass:[CALayer class]] , @"invalid target");
+    CGPoint originPos = CGPointZero;
+    CGSize originSize = CGSizeZero;
+    if ([obj isKindOfClass:[CALayer class]]) {
+        originPos = [(CALayer *)obj position];
+        originSize = [(CALayer *)obj bounds].size;
+    }
+    CGFloat hOffset = originSize.width / 4;
+    CAKeyframeAnimation* anim=[CAKeyframeAnimation animation];
+    anim.keyPath=@"position";
+    anim.values=@[
+                  [NSValue valueWithCGPoint:CGPointMake(originPos.x, originPos.y)],
+                  [NSValue valueWithCGPoint:CGPointMake(originPos.x-hOffset, originPos.y)],
+                  [NSValue valueWithCGPoint:CGPointMake(originPos.x, originPos.y)],
+                  [NSValue valueWithCGPoint:CGPointMake(originPos.x+hOffset, originPos.y)],
+                  [NSValue valueWithCGPoint:CGPointMake(originPos.x, originPos.y)]
+                  ];
+    anim.repeatCount = repeatTimes;
+    anim.duration = time;
+    anim.fillMode = kCAFillModeForwards;
+    return anim;
+}
+
+/**
+ *  bounce
+ *
+ *  @param repeatTimes time
+ *  @param time        duration
+ *  @param obj         always be CALayer
+ *  @return aniamtion obj
+ */
++(CAKeyframeAnimation *)bounce_AnimationRepeatTimes:(float)repeatTimes durTimes:(float)time forObj:(id)obj
+{
+    NSAssert([obj isKindOfClass:[CALayer class]] , @"invalid target");
+    CGPoint originPos = CGPointZero;
+    CGSize originSize = CGSizeZero;
+    if ([obj isKindOfClass:[CALayer class]]) {
+        originPos = [(CALayer *)obj position];
+        originSize = [(CALayer *)obj bounds].size;
+    }
+    CGFloat hOffset = originSize.height / 4;
+    CAKeyframeAnimation* anim=[CAKeyframeAnimation animation];
+    anim.keyPath=@"position";
+    anim.values=@[
+                  [NSValue valueWithCGPoint:CGPointMake(originPos.x, originPos.y)],
+                  [NSValue valueWithCGPoint:CGPointMake(originPos.x, originPos.y-hOffset)],
+                  [NSValue valueWithCGPoint:CGPointMake(originPos.x, originPos.y)],
+                  [NSValue valueWithCGPoint:CGPointMake(originPos.x, originPos.y+hOffset)],
+                  [NSValue valueWithCGPoint:CGPointMake(originPos.x, originPos.y)]
+                  ];
+    anim.repeatCount=repeatTimes;
+    anim.duration=time;
+    anim.fillMode = kCAFillModeForwards;
+    return anim;
+}
+
+@end

+ 101 - 0
Pods/WZLBadge/WZLBadge/Protocol/WZLBadgeProtocol.h

@@ -0,0 +1,101 @@
+//
+//  WZLBadgeProtocol.h
+//  WZLBadgeDemo
+//
+//  Created by zilin_weng on 15/8/12.
+//  Copyright (c) 2015年 Weng-Zilin. All rights reserved.
+//
+
+//WZLBadgeProtocol is a protocol which any Class supported (such UIView and UIBarButtonItem) should confirm
+//At present, there are two classes support WZLBadge(UIView and UIBarButtonItem). However, there may be more classes to support. Thus, it is necessary to abstract a protocol. 20150812.
+
+
+#ifndef WZLBadgeDemo_WZLBadgeProtocol_h
+#define WZLBadgeDemo_WZLBadgeProtocol_h
+
+#pragma mark -- types definition
+
+#define kBadgeBreatheAniKey     @"breathe"
+#define kBadgeRotateAniKey      @"rotate"
+#define kBadgeShakeAniKey       @"shake"
+#define kBadgeScaleAniKey       @"scale"
+#define kBadgeBounceAniKey      @"bounce"
+
+//key for associative methods during runtime
+static char badgeLabelKey;
+static char badgeBgColorKey;
+static char badgeFontKey;
+static char badgeTextColorKey;
+static char badgeAniTypeKey;
+static char badgeFrameKey;
+static char badgeCenterOffsetKey;
+static char badgeMaximumBadgeNumberKey;
+
+typedef NS_ENUM(NSUInteger, WBadgeStyle)
+{
+    WBadgeStyleRedDot = 0,          /* red dot style */
+    WBadgeStyleNumber,              /* badge with number */
+    WBadgeStyleNew                  /* badge with a fixed text "new" */
+};
+
+typedef NS_ENUM(NSUInteger, WBadgeAnimType)
+{
+    WBadgeAnimTypeNone = 0,         /* without animation, badge stays still */
+    WBadgeAnimTypeScale,            /* scale effect */
+    WBadgeAnimTypeShake,            /* shaking effect */
+    WBadgeAnimTypeBounce,           /* bouncing effect */
+    WBadgeAnimTypeBreathe           /* breathing light effect, which makes badge more attractive */
+};
+
+
+#pragma mark -- protocol definition
+
+@protocol WZLBadgeProtocol <NSObject>
+
+@required
+
+@property (nonatomic, strong) UILabel *badge;                       /* badge entity, which is adviced not to set manually */
+@property (nonatomic, strong) UIFont *badgeFont;                    /* [UIFont boldSystemFontOfSize:9] by default if not set */
+@property (nonatomic, strong) UIColor *badgeBgColor;                /* red color by default if not set */
+@property (nonatomic, strong) UIColor *badgeTextColor;              /* white color by default if not set */
+@property (nonatomic, assign) CGRect badgeFrame;                    /* we have optimized the badge frame and center.
+                                                                        This property is adviced not to set manually */
+
+@property (nonatomic, assign) CGPoint  badgeCenterOffset;           /* offset from right-top corner. {0,0} by default */
+                                                                    /* For x, negative number means left offset
+                                                                        For y, negative number means bottom offset */
+
+@property (nonatomic, assign) WBadgeAnimType aniType;               /* NOTE that this is not animation type of badge's
+                                                                        appearing, nor  hidding*/
+
+@property (nonatomic, assign) NSInteger badgeMaximumBadgeNumber;    /*for WBadgeStyleNumber style badge,
+                                                                     if badge value is above badgeMaximumBadgeNumber,
+                                                                     "badgeMaximumBadgeNumber+" will be printed. */
+
+/**
+ *  show badge with red dot style and WBadgeAnimTypeNone by default.
+ */
+- (void)showBadge;
+
+/**
+ *  showBadge
+ *
+ *  @param style WBadgeStyle type
+ *  @param value (if 'style' is WBadgeStyleRedDot or WBadgeStyleNew,
+            this value will be ignored. In this case, any value will be ok.)
+ *   @param aniType
+ */
+- (void)showBadgeWithStyle:(WBadgeStyle)style
+                     value:(NSInteger)value
+             animationType:(WBadgeAnimType)aniType;
+
+
+/**
+ *  clear badge
+ */
+- (void)clearBadge;
+
+
+@end
+
+#endif

+ 45 - 0
Pods/WZLBadge/WZLBadge/View/UIView+WZLBadge.h

@@ -0,0 +1,45 @@
+//
+//  UIView+WZLBadge.h
+//  WZLBadgeDemo
+//
+//  Created by zilin_weng on 15/6/24.
+//  Copyright (c) 2015年 Weng-Zilin. All rights reserved.
+//  Project description: this is a solution to enable any UIView to display badge
+
+#import <UIKit/UIKit.h>
+#import "WZLBadgeProtocol.h"
+
+#pragma mark -- badge apis
+
+@interface UIView (WZLBadge)<WZLBadgeProtocol>
+
+
+/**
+ *  show badge with red dot style and WBadgeAnimTypeNone by default.
+ */
+- (void)showBadge;
+
+/**
+ *  showBadge
+ *
+ *  @param style WBadgeStyle type
+ *  @param value (if 'style' is WBadgeStyleRedDot or WBadgeStyleNew,
+        this value will be ignored. In this case, any value will be ok.)
+*   @param aniType
+ */
+- (void)showBadgeWithStyle:(WBadgeStyle)style
+                     value:(NSInteger)value
+             animationType:(WBadgeAnimType)aniType;
+
+
+/**
+ *  clear badge(hide badge)
+ */
+- (void)clearBadge;
+
+/**
+ *  make bage(if existing) not hiden
+ */
+- (void)resumeBadge;
+
+@end

+ 374 - 0
Pods/WZLBadge/WZLBadge/View/UIView+WZLBadge.m

@@ -0,0 +1,374 @@
+//
+//  UIView+WZLBadge.m
+//  WZLBadgeDemo
+//
+//  Created by zilin_weng on 15/6/24.
+//  Copyright (c) 2015年 Weng-Zilin. All rights reserved.
+//
+
+#import "UIView+WZLBadge.h"
+#import <objc/runtime.h>
+#import "CAAnimation+WAnimation.h"
+
+#define kWZLBadgeDefaultFont				([UIFont boldSystemFontOfSize:9])
+
+#define kWZLBadgeDefaultMaximumBadgeNumber                     99
+
+@implementation UIView (WZLBadge)
+
+#pragma mark -- public methods
+/**
+ *  show badge with red dot style and WBadgeAnimTypeNone by default.
+ */
+- (void)showBadge
+{
+    [self showBadgeWithStyle:WBadgeStyleRedDot value:0 animationType:WBadgeAnimTypeNone];
+}
+
+/**
+ *  showBadge
+ *
+ *  @param style WBadgeStyle type
+ *  @param value (if 'style' is WBadgeStyleRedDot or WBadgeStyleNew, 
+ *                this value will be ignored. In this case, any value will be ok.)
+ */
+- (void)showBadgeWithStyle:(WBadgeStyle)style value:(NSInteger)value animationType:(WBadgeAnimType)aniType
+{
+    self.aniType = aniType;
+    switch (style) {
+        case WBadgeStyleRedDot:
+            [self showRedDotBadge];
+            break;
+        case WBadgeStyleNumber:
+            [self showNumberBadgeWithValue:value];
+            break;
+        case WBadgeStyleNew:
+            [self showNewBadge];
+            break;
+        default:
+            break;
+    }
+    if (aniType != WBadgeAnimTypeNone) {
+        [self beginAnimation];
+    }
+}
+
+/**
+ *  clear badge
+ */
+- (void)clearBadge
+{
+    self.badge.hidden = YES;
+}
+
+/**
+ *  make bage(if existing) not hiden
+ */
+- (void)resumeBadge
+{
+    if (self.badge && self.badge.hidden == YES) {
+        self.badge.hidden = NO;
+    }
+}
+
+#pragma mark -- private methods
+- (void)showRedDotBadge
+{
+    [self badgeInit];
+    //if badge has been displayed and, in addition, is was not red dot style, we must update UI.
+    if (self.badge.tag != WBadgeStyleRedDot) {
+        self.badge.text = @"";
+        self.badge.tag = WBadgeStyleRedDot;
+        self.badge.layer.cornerRadius = CGRectGetWidth(self.badge.frame) / 2;
+    }
+    self.badge.hidden = NO;
+}
+
+- (void)showNewBadge
+{
+    [self badgeInit];
+    //if badge has been displayed and, in addition, is not red dot style, we must update UI.
+    if (self.badge.tag != WBadgeStyleNew) {
+        self.badge.text = @"new";
+        self.badge.tag = WBadgeStyleNew;
+        
+        CGRect frame = self.badge.frame;
+        frame.size.width = 22;
+        frame.size.height = 13;
+        self.badge.frame = frame;
+        
+        self.badge.center = CGPointMake(CGRectGetWidth(self.frame) + 2 + self.badgeCenterOffset.x, self.badgeCenterOffset.y);
+        self.badge.font = kWZLBadgeDefaultFont;
+        self.badge.layer.cornerRadius = CGRectGetHeight(self.badge.frame) / 3;
+    }
+    self.badge.hidden = NO;
+}
+
+- (void)showNumberBadgeWithValue:(NSInteger)value
+{
+    if (value < 0) {
+        return;
+    }
+    [self badgeInit];
+    self.badge.hidden = (value == 0);
+    self.badge.tag = WBadgeStyleNumber;
+    self.badge.font = self.badgeFont;
+    self.badge.text = (value > self.badgeMaximumBadgeNumber ?
+                       [NSString stringWithFormat:@"%@+", @(self.badgeMaximumBadgeNumber)] :
+                       [NSString stringWithFormat:@"%@", @(value)]);
+    [self adjustLabelWidth:self.badge];
+    CGRect frame = self.badge.frame;
+    frame.size.width += 4;
+    frame.size.height += 4;
+    if(CGRectGetWidth(frame) < CGRectGetHeight(frame)) {
+        frame.size.width = CGRectGetHeight(frame);
+    }
+    self.badge.frame = frame;
+    self.badge.center = CGPointMake(CGRectGetWidth(self.frame) + 2 + self.badgeCenterOffset.x, self.badgeCenterOffset.y);
+    self.badge.layer.cornerRadius = CGRectGetHeight(self.badge.frame) / 2;
+}
+
+//lazy loading
+- (void)badgeInit
+{
+    if (self.badgeBgColor == nil) {
+        self.badgeBgColor = [UIColor redColor];
+    }
+    if (self.badgeTextColor == nil) {
+        self.badgeTextColor = [UIColor whiteColor];
+    }
+    
+    if (nil == self.badge) {
+        CGFloat redotWidth = 8;
+        CGRect frm = CGRectMake(CGRectGetWidth(self.frame), -redotWidth, redotWidth, redotWidth);
+        self.badge = [[UILabel alloc] initWithFrame:frm];
+        self.badge.textAlignment = NSTextAlignmentCenter;
+        self.badge.center = CGPointMake(CGRectGetWidth(self.frame) + 2 + self.badgeCenterOffset.x, self.badgeCenterOffset.y);
+        self.badge.backgroundColor = self.badgeBgColor;
+        self.badge.textColor = self.badgeTextColor;
+        self.badge.text = @"";
+        self.badge.tag = WBadgeStyleRedDot;//red dot by default
+        self.badge.layer.cornerRadius = CGRectGetWidth(self.badge.frame) / 2;
+        self.badge.layer.masksToBounds = YES;//very important
+        self.badge.hidden = NO;
+        [self addSubview:self.badge];
+        [self bringSubviewToFront:self.badge];
+    }
+}
+
+#pragma mark --  other private methods
+- (void)adjustLabelWidth:(UILabel *)label
+{
+    [label setNumberOfLines:0];
+    NSString *s = label.text;
+    UIFont *font = [label font];
+    CGSize size = CGSizeMake(320,2000);
+	CGSize labelsize;
+
+	if (![s respondsToSelector:@selector(boundingRectWithSize:options:attributes:context:)]) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+		labelsize = [s sizeWithFont:font constrainedToSize:size lineBreakMode:NSLineBreakByWordWrapping];
+#pragma clang diagnostic pop
+		
+	} else {
+		NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
+		[style setLineBreakMode:NSLineBreakByWordWrapping];
+		
+		labelsize = [s boundingRectWithSize:size
+									options:(NSStringDrawingUsesLineFragmentOrigin|NSStringDrawingUsesFontLeading)
+								 attributes:@{ NSFontAttributeName:font, NSParagraphStyleAttributeName : style}
+									context:nil].size;
+	}
+    CGRect frame = label.frame;
+	frame.size = CGSizeMake(ceilf(labelsize.width), ceilf(labelsize.height));
+    [label setFrame:frame];
+}
+
+#pragma mark -- animation
+
+//if u want to add badge animation type, follow steps bellow:
+//1. go to definition of WBadgeAnimType and add new type
+//2. go to category of CAAnimation+WAnimation to add new animation interface
+//3. call that new interface here
+- (void)beginAnimation
+{
+    switch(self.aniType) {
+        case WBadgeAnimTypeBreathe:
+            [self.badge.layer addAnimation:[CAAnimation opacityForever_Animation:1.4]
+                                    forKey:kBadgeBreatheAniKey];
+            break;
+        case WBadgeAnimTypeShake:
+            [self.badge.layer addAnimation:[CAAnimation shake_AnimationRepeatTimes:CGFLOAT_MAX
+                                                                          durTimes:1
+                                                                            forObj:self.badge.layer]
+                                    forKey:kBadgeShakeAniKey];
+            break;
+        case WBadgeAnimTypeScale:
+            [self.badge.layer addAnimation:[CAAnimation scaleFrom:1.4
+                                                          toScale:0.6
+                                                         durTimes:1
+                                                              rep:MAXFLOAT]
+                                    forKey:kBadgeScaleAniKey];
+            break;
+        case WBadgeAnimTypeBounce:
+            [self.badge.layer addAnimation:[CAAnimation bounce_AnimationRepeatTimes:CGFLOAT_MAX
+                                                                          durTimes:1
+                                                                            forObj:self.badge.layer]
+                                    forKey:kBadgeBounceAniKey];
+            break;
+        case WBadgeAnimTypeNone:
+        default:
+            break;
+    }
+}
+
+
+- (void)removeAnimation
+{
+    if (self.badge) {
+        [self.badge.layer removeAllAnimations];
+    }
+}
+
+
+#pragma mark -- setter/getter
+- (UILabel *)badge
+{
+    return objc_getAssociatedObject(self, &badgeLabelKey);
+}
+
+- (void)setBadge:(UILabel *)label
+{
+    objc_setAssociatedObject(self, &badgeLabelKey, label, OBJC_ASSOCIATION_RETAIN);
+}
+
+- (UIFont *)badgeFont
+{
+	id font = objc_getAssociatedObject(self, &badgeFontKey);
+	return font == nil ? kWZLBadgeDefaultFont : font;
+}
+
+- (void)setBadgeFont:(UIFont *)badgeFont
+{
+	objc_setAssociatedObject(self, &badgeFontKey, badgeFont, OBJC_ASSOCIATION_RETAIN);
+    if (!self.badge) {
+        [self badgeInit];
+    }
+    self.badge.font = badgeFont;
+}
+
+- (UIColor *)badgeBgColor
+{
+    return objc_getAssociatedObject(self, &badgeBgColorKey);
+}
+
+- (void)setBadgeBgColor:(UIColor *)badgeBgColor
+{
+    objc_setAssociatedObject(self, &badgeBgColorKey, badgeBgColor, OBJC_ASSOCIATION_RETAIN);
+    if (!self.badge) {
+        [self badgeInit];
+    }
+    self.badge.backgroundColor = badgeBgColor;
+}
+
+- (UIColor *)badgeTextColor
+{
+    return objc_getAssociatedObject(self, &badgeTextColorKey);
+}
+
+- (void)setBadgeTextColor:(UIColor *)badgeTextColor
+{
+    objc_setAssociatedObject(self, &badgeTextColorKey, badgeTextColor, OBJC_ASSOCIATION_RETAIN);
+    if (!self.badge) {
+        [self badgeInit];
+    }
+    self.badge.textColor = badgeTextColor;
+}
+
+- (WBadgeAnimType)aniType
+{
+    id obj = objc_getAssociatedObject(self, &badgeAniTypeKey);
+    if(obj != nil && [obj isKindOfClass:[NSNumber class]])
+    {
+        return [obj integerValue];
+    }
+    else
+        return WBadgeAnimTypeNone;
+}
+
+- (void)setAniType:(WBadgeAnimType)aniType
+{
+    NSNumber *numObj = @(aniType);
+    objc_setAssociatedObject(self, &badgeAniTypeKey, numObj, OBJC_ASSOCIATION_RETAIN);
+    if (!self.badge) {
+        [self badgeInit];
+    }
+    [self removeAnimation];
+    [self beginAnimation];
+}
+
+- (CGRect)badgeFrame
+{
+    id obj = objc_getAssociatedObject(self, &badgeFrameKey);
+    if (obj != nil && [obj isKindOfClass:[NSDictionary class]] && [obj count] == 4) {
+        CGFloat x = [obj[@"x"] floatValue];
+        CGFloat y = [obj[@"y"] floatValue];
+        CGFloat width = [obj[@"width"] floatValue];
+        CGFloat height = [obj[@"height"] floatValue];
+        return  CGRectMake(x, y, width, height);
+    } else
+        return CGRectZero;
+}
+
+- (void)setBadgeFrame:(CGRect)badgeFrame
+{
+    NSDictionary *frameInfo = @{@"x" : @(badgeFrame.origin.x), @"y" : @(badgeFrame.origin.y),
+                                @"width" : @(badgeFrame.size.width), @"height" : @(badgeFrame.size.height)};
+    objc_setAssociatedObject(self, &badgeFrameKey, frameInfo, OBJC_ASSOCIATION_RETAIN);
+    if (!self.badge) {
+        [self badgeInit];
+    }
+    self.badge.frame = badgeFrame;
+}
+
+- (CGPoint)badgeCenterOffset
+{
+    id obj = objc_getAssociatedObject(self, &badgeCenterOffsetKey);
+    if (obj != nil && [obj isKindOfClass:[NSDictionary class]] && [obj count] == 2) {
+        CGFloat x = [obj[@"x"] floatValue];
+        CGFloat y = [obj[@"y"] floatValue];
+        return CGPointMake(x, y);
+    } else
+        return CGPointZero;
+}
+
+- (void)setBadgeCenterOffset:(CGPoint)badgeCenterOff
+{
+    NSDictionary *cenerInfo = @{@"x" : @(badgeCenterOff.x), @"y" : @(badgeCenterOff.y)};
+    objc_setAssociatedObject(self, &badgeCenterOffsetKey, cenerInfo, OBJC_ASSOCIATION_RETAIN);
+    if (!self.badge) {
+        [self badgeInit];
+    }
+    self.badge.center = CGPointMake(CGRectGetWidth(self.frame) + 2 + badgeCenterOff.x, badgeCenterOff.y);
+}
+
+- (NSInteger)badgeMaximumBadgeNumber {
+    id obj = objc_getAssociatedObject(self, &badgeMaximumBadgeNumberKey);
+    if(obj != nil && [obj isKindOfClass:[NSNumber class]])
+    {
+        return [obj integerValue];
+    }
+    else
+        return kWZLBadgeDefaultMaximumBadgeNumber;
+}
+
+- (void)setBadgeMaximumBadgeNumber:(NSInteger)badgeMaximumBadgeNumber {
+    NSNumber *numObj = @(badgeMaximumBadgeNumber);
+    objc_setAssociatedObject(self, &badgeMaximumBadgeNumberKey, numObj, OBJC_ASSOCIATION_RETAIN);
+    if (!self.badge) {
+        [self badgeInit];
+    }
+}
+
+@end

+ 20 - 0
Pods/WZLBadge/WZLBadge/WZLBadgeImport.h

@@ -0,0 +1,20 @@
+//
+//  WZLBadgeImport.h
+//  WZLBadgeDemo
+//
+//  Created by zilin_weng on 15/8/10.
+//  Copyright (c) 2015年 Weng-Zilin. All rights reserved.
+//
+
+
+//  Only import this header file for your project is enough.
+//  WZLBadge now supports badge for UIView, all subclasses of UIView and UIBarButtonItem Class.
+
+#ifndef WZLBadgeDemo_WZLBadgeImport_h
+#define WZLBadgeDemo_WZLBadgeImport_h
+
+#import "UIView+WZLBadge.h"
+#import "UIBarButtonItem+WZLBadge.h"
+#import "UITabBarItem+WZLBadge.h"
+
+#endif

+ 32 - 10
model.xcodeproj/project.pbxproj

@@ -353,6 +353,8 @@
 		2FA1AF98212ACDEF005F12CA /* AgreementViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2FA1AF94212ACDEE005F12CA /* AgreementViewController.m */; };
 		2FA1AF99212ACDEF005F12CA /* AgreementViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2FA1AF95212ACDEE005F12CA /* AgreementViewController.xib */; };
 		2FA1AF9D212ACDFF005F12CA /* WYWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2FA1AF9C212ACDFF005F12CA /* WYWebView.m */; };
+		3A004A6D21917D4C009A989E /* HobbyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A004A6C21917D4C009A989E /* HobbyViewController.m */; };
+		3A2D2B792192D6420073D975 /* ApplyRecommendView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A2D2B782192D6420073D975 /* ApplyRecommendView.m */; };
 		3A44C12A218A0E7A0021DA3F /* MyModelController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A44C124218A0E790021DA3F /* MyModelController.m */; };
 		3A44C12B218A0E7A0021DA3F /* MyModelController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3A44C125218A0E790021DA3F /* MyModelController.xib */; };
 		3A44C12C218A0E7A0021DA3F /* MyMemberController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A44C126218A0E790021DA3F /* MyMemberController.m */; };
@@ -377,6 +379,8 @@
 		3AC5CA04218BDDC700D4ACAC /* RankCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3AC5CA02218BDDC700D4ACAC /* RankCell.xib */; };
 		3AC5CA07218BEB3E00D4ACAC /* RankHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 3AC5CA06218BEB3E00D4ACAC /* RankHeader.m */; };
 		3AC5CA09218BEB4B00D4ACAC /* RankHeader.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3AC5CA08218BEB4B00D4ACAC /* RankHeader.xib */; };
+		3ACF405621919448002C69D3 /* WithdrawController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3ACF405321919448002C69D3 /* WithdrawController.m */; };
+		3ACF405721919448002C69D3 /* WithdrawController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3ACF405521919448002C69D3 /* WithdrawController.xib */; };
 		3AE8C7AA218B2E550069D147 /* ModelCardController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3AE8C7A9218B2E550069D147 /* ModelCardController.m */; };
 		3AE8C7AD218B49890069D147 /* IntroView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3AE8C7AC218B49890069D147 /* IntroView.m */; };
 		3AE8C7AF218B49EC0069D147 /* IntroView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3AE8C7AE218B49EC0069D147 /* IntroView.xib */; };
@@ -1128,6 +1132,10 @@
 		2FA1AF96212ACDEF005F12CA /* privateViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = privateViewController.h; sourceTree = "<group>"; };
 		2FA1AF9B212ACDFF005F12CA /* WYWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WYWebView.h; sourceTree = "<group>"; };
 		2FA1AF9C212ACDFF005F12CA /* WYWebView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WYWebView.m; sourceTree = "<group>"; };
+		3A004A6B21917D4C009A989E /* HobbyViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HobbyViewController.h; sourceTree = "<group>"; };
+		3A004A6C21917D4C009A989E /* HobbyViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HobbyViewController.m; sourceTree = "<group>"; };
+		3A2D2B772192D6420073D975 /* ApplyRecommendView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ApplyRecommendView.h; sourceTree = "<group>"; };
+		3A2D2B782192D6420073D975 /* ApplyRecommendView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ApplyRecommendView.m; sourceTree = "<group>"; };
 		3A44C124218A0E790021DA3F /* MyModelController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyModelController.m; sourceTree = "<group>"; };
 		3A44C125218A0E790021DA3F /* MyModelController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MyModelController.xib; sourceTree = "<group>"; };
 		3A44C126218A0E790021DA3F /* MyMemberController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyMemberController.m; sourceTree = "<group>"; };
@@ -1164,6 +1172,9 @@
 		3AC5CA05218BEB3E00D4ACAC /* RankHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RankHeader.h; sourceTree = "<group>"; };
 		3AC5CA06218BEB3E00D4ACAC /* RankHeader.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RankHeader.m; sourceTree = "<group>"; };
 		3AC5CA08218BEB4B00D4ACAC /* RankHeader.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = RankHeader.xib; sourceTree = "<group>"; };
+		3ACF405321919448002C69D3 /* WithdrawController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WithdrawController.m; sourceTree = "<group>"; };
+		3ACF405421919448002C69D3 /* WithdrawController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WithdrawController.h; sourceTree = "<group>"; };
+		3ACF405521919448002C69D3 /* WithdrawController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = WithdrawController.xib; sourceTree = "<group>"; };
 		3AE8C7A8218B2E550069D147 /* ModelCardController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModelCardController.h; sourceTree = "<group>"; };
 		3AE8C7A9218B2E550069D147 /* ModelCardController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ModelCardController.m; sourceTree = "<group>"; };
 		3AE8C7AB218B49890069D147 /* IntroView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IntroView.h; sourceTree = "<group>"; };
@@ -2533,6 +2544,8 @@
 				3AE8C7AB218B49890069D147 /* IntroView.h */,
 				3AE8C7AC218B49890069D147 /* IntroView.m */,
 				3AE8C7AE218B49EC0069D147 /* IntroView.xib */,
+				3A2D2B772192D6420073D975 /* ApplyRecommendView.h */,
+				3A2D2B782192D6420073D975 /* ApplyRecommendView.m */,
 			);
 			path = View;
 			sourceTree = "<group>";
@@ -2644,25 +2657,25 @@
 		9EC8712C20FAE9FA0087746C /* Controller */ = {
 			isa = PBXGroup;
 			children = (
-				EF812F6920FEE30E004A6A35 /* ModelNewFeatureController.h */,
-				EF812F6A20FEE30E004A6A35 /* ModelNewFeatureController.m */,
 				EF4A657820FDC94C00FFCD3C /* MineController.h */,
+				EF812F6920FEE30E004A6A35 /* ModelNewFeatureController.h */,
 				EF4A657920FDC94C00FFCD3C /* MineController.m */,
-				3A5EC75C218707B100A9438E /* PromoteVC */,
-				3A5EC7492186F54E00A9438E /* MyTeamVC */,
-				3AF44FFF2185BD1A00ABEAEB /* SettingsVC */,
-				3AF44FEF21858F1600ABEAEB /* ShareVC */,
-				3AF44FDC21856E5C00ABEAEB /* MineVC */,
+				EF812F6A20FEE30E004A6A35 /* ModelNewFeatureController.m */,
+				2FA1AF8B212AA984005F12CA /* AboutUsVC */,
 				2F4A895C211D9F03006D7DD3 /* ActivityVC */,
-				2F8D24AA21131B3900CD7347 /* PrivateVC */,
 				EF7B0C0C20FC69EE0078781D /* CodeVC */,
+				3AF44FDC21856E5C00ABEAEB /* MineVC */,
 				EF7B0C0A20FC69EE0078781D /* MyOrderVC */,
 				EF7B0C0B20FC69EE0078781D /* MyProfileVC */,
 				EF7B0C1620FC69EF0078781D /* MyRedPacketsVC */,
 				EF7B0C0720FC69EE0078781D /* MySkillsVC */,
+				3A5EC7492186F54E00A9438E /* MyTeamVC */,
 				EF7B0C0D20FC69EF0078781D /* MyWalletVC */,
-				2FA1AF8B212AA984005F12CA /* AboutUsVC */,
+				2F8D24AA21131B3900CD7347 /* PrivateVC */,
+				3A5EC75C218707B100A9438E /* PromoteVC */,
 				3AE8C7B0218B65630069D147 /* RankVC */,
+				3AF44FFF2185BD1A00ABEAEB /* SettingsVC */,
+				3AF44FEF21858F1600ABEAEB /* ShareVC */,
 			);
 			path = Controller;
 			sourceTree = "<group>";
@@ -2869,6 +2882,8 @@
 				8848C65D21080FDD00EDB121 /* ModelPhotoViewController.m */,
 				8848C65F2108103600EDB121 /* ModelHonorViewController.h */,
 				8848C6602108103600EDB121 /* ModelHonorViewController.m */,
+				3A004A6B21917D4C009A989E /* HobbyViewController.h */,
+				3A004A6C21917D4C009A989E /* HobbyViewController.m */,
 			);
 			path = MyProfileVC;
 			sourceTree = "<group>";
@@ -2897,6 +2912,9 @@
 				9EA6D16A20FE356900953CE3 /* WalletDetailsController.m */,
 				2F8D25672114706400CD7347 /* WithdrawalDetailController.h */,
 				2F8D25682114706400CD7347 /* WithdrawalDetailController.m */,
+				3ACF405421919448002C69D3 /* WithdrawController.h */,
+				3ACF405321919448002C69D3 /* WithdrawController.m */,
+				3ACF405521919448002C69D3 /* WithdrawController.xib */,
 			);
 			path = MyWalletVC;
 			sourceTree = "<group>";
@@ -2990,6 +3008,7 @@
 				2F4A8945211ADB00006D7DD3 /* TwoImageCell.xib in Resources */,
 				3AF450032185BD2E00ABEAEB /* SettingsViewController.xib in Resources */,
 				2FA1AF99212ACDEF005F12CA /* AgreementViewController.xib in Resources */,
+				3ACF405721919448002C69D3 /* WithdrawController.xib in Resources */,
 				2F4A8924211ADACF006D7DD3 /* DetailOneImageViewController.xib in Resources */,
 				2F8D24B821131B3900CD7347 /* personalImage.xib in Resources */,
 				2F8D26C521183D7300CD7347 /* NIMKitEmoticon.bundle in Resources */,
@@ -3342,8 +3361,10 @@
 				2F8D273C21183D7400CD7347 /* NIMKitSwitcherCell.m in Sources */,
 				2F8D278421183D9000CD7347 /* renderer_rgb.c in Sources */,
 				EF812F7520FF1755004A6A35 /* MBProgressHUD+YanC.m in Sources */,
+				3A004A6D21917D4C009A989E /* HobbyViewController.m in Sources */,
 				8848C66A210813D300EDB121 /* PhotoCollectionViewCell.m in Sources */,
 				2F8D24A621131B0500CD7347 /* UIScreen+Sports.m in Sources */,
+				3A2D2B792192D6420073D975 /* ApplyRecommendView.m in Sources */,
 				2F8D270E21183D7400CD7347 /* NIMNotificationContentConfig.m in Sources */,
 				2F8D26DA21183D7300CD7347 /* NIMInputAudioRecordIndicatorView.m in Sources */,
 				2F8D253B2114691C00CD7347 /* PGDatePicker+MonthDayHourMinute.m in Sources */,
@@ -3461,6 +3482,7 @@
 				2F8D248C21131A7A00CD7347 /* JSONHTTPClient.m in Sources */,
 				2F8D26C821183D7300CD7347 /* NIMGroupedData.m in Sources */,
 				2F8D278F21183D9000CD7347 /* ijksdl_timer.c in Sources */,
+				3ACF405621919448002C69D3 /* WithdrawController.m in Sources */,
 				EF7B0C1D20FC6A810078781D /* IncreaseBalanceController.m in Sources */,
 				2F8D26FB21183D7400CD7347 /* NIMAdvancedTeamMemberCell.m in Sources */,
 				2F8D270121183D7400CD7347 /* NIMTimestampModel.m in Sources */,
@@ -3637,7 +3659,7 @@
 				PRODUCT_BUNDLE_IDENTIFIER = com.chmo.model;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE = "";
-				PROVISIONING_PROFILE_SPECIFIER = model;
+				PROVISIONING_PROFILE_SPECIFIER = modelTest;
 			};
 			name = Release;
 		};

+ 124 - 165
model/AppDelegate.m

@@ -20,7 +20,8 @@
 @import PushKit;
 
 NSString *NTESNotificationLogout = @"NTESNotificationLogout";
-@interface AppDelegate ()<NIMLoginManagerDelegate,PKPushRegistryDelegate,WXApiDelegate>
+
+@interface AppDelegate () <NIMLoginManagerDelegate, PKPushRegistryDelegate, WXApiDelegate>
 
 @end
 
@@ -31,59 +32,58 @@ NSString *NTESNotificationLogout = @"NTESNotificationLogout";
     // Override point for customization after application launch.
     self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
     self.window.backgroundColor = [UIColor whiteColor];
-    
-    
-    NSString *appKey        = @"c545b95fd20d5a20d0d1220dc6831e4d";
-    NIMSDKOption *option    = [NIMSDKOption optionWithAppKey:appKey];
-    option.apnsCername      = apnsCernameStr;
-    option.pkCername        = @"nil";
+
+
+    NSString *appKey = @"c545b95fd20d5a20d0d1220dc6831e4d";
+    NIMSDKOption *option = [NIMSDKOption optionWithAppKey:appKey];
+    option.apnsCername = apnsCernameStr;
+    option.pkCername = @"nil";
     [[NIMSDK sharedSDK] registerWithOption:option];
     [[NIMSDK sharedSDK].loginManager addDelegate:self];
     [[NIMKit sharedKit] registerLayoutConfig:[TestCellLayoutConfig new]];
-    
+
     [NIMSDKConfig sharedConfig].enabledHttpsForInfo = NO;
-    
-    //    [[NIMSDK sharedSDK] registerWithAppID:@"c545b95fd20d5a20d0d1220dc6831e4d"
-    //                                  cerName:@"push"];
-    
-    //    [self registerAPNs];
-    
+
+    // [[NIMSDK sharedSDK] registerWithAppID:@"c545b95fd20d5a20d0d1220dc6831e4d"
+    //                               cerName:@"push"];
+    //
+    // [self registerAPNs];
+
     [self setupServices];
     [self registerPushService];
-    
-    
-//    //判断更控制器
-//    NSString *key = @"CFBundleShortVersionString";
-//    // 获得当前软件的版本号
-//    NSString *currentVersion = [NSBundle mainBundle].infoDictionary[key];
-//    // 获得沙盒中存储的版本号
-//    NSString *sanboxVersion = [[NSUserDefaults standardUserDefaults] stringForKey:key];
-//    if (sanboxVersion == nil || ![sanboxVersion isEqualToString:currentVersion]) { //本地版本号不同, 显示新特性
-//
-//        ModelNewFeatureController *mineVc = [[ModelNewFeatureController alloc] init];
-//        ModelNavigationController *navVC = [[ModelNavigationController alloc] initWithRootViewController:mineVc];
-//        self.window.rootViewController = navVC;
-//
-//        // 将当前的版本号存进沙盒
-//        [[NSUserDefaults standardUserDefaults] setObject:currentVersion forKey:key];
-//        [[NSUserDefaults standardUserDefaults] synchronize];
-//
-//    }else { // 本地版本号相同
-//
-//        [self setupMainViewController];
-//    }
-    
+
+
+    // //判断更控制器
+    // NSString *key = @"CFBundleShortVersionString";
+    // // 获得当前软件的版本号
+    // NSString *currentVersion = [NSBundle mainBundle].infoDictionary[key];
+    // // 获得沙盒中存储的版本号
+    // NSString *sanboxVersion = [[NSUserDefaults standardUserDefaults] stringForKey:key];
+    // if (sanboxVersion == nil || ![sanboxVersion isEqualToString:currentVersion]) { //本地版本号不同, 显示新特性
+    //
+    //     ModelNewFeatureController *mineVc = [[ModelNewFeatureController alloc] init];
+    //     ModelNavigationController *navVC = [[ModelNavigationController alloc] initWithRootViewController:mineVc];
+    //     self.window.rootViewController = navVC;
+    //
+    //     // 将当前的版本号存进沙盒
+    //     [[NSUserDefaults standardUserDefaults] setObject:currentVersion forKey:key];
+    //     [[NSUserDefaults standardUserDefaults] synchronize];
+    //
+    // } else { // 本地版本号相同
+    //
+    //     [self setupMainViewController];
+    // }
+
     [self setupMainViewController];
     // 显示窗口
     [self.window makeKeyAndVisible];
-    
+
     [WXApi registerApp:@"wx2a873aba839dbb4b" enableMTA:YES];
-    
+
     return YES;
 }
 
-- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
-{
+- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
     return [WXApi handleOpenURL:url delegate:self];
 }
 
@@ -94,32 +94,29 @@ NSString *NTESNotificationLogout = @"NTESNotificationLogout";
     return [WXApi handleOpenURL:url delegate:self];
 }
 
-- (void)setupMainViewController
-{
+- (void)setupMainViewController {
     NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
     NSString *accid = [user objectForKey:@"accid"];
     NSString *token = [user objectForKey:@"token"];
 //    NSString *token = @"333";
 
     //如果有缓存用户名密码推荐使用自动登录
-    if ([accid length] && [token length])
-    {
+    if ([accid length] && [token length]) {
         NIMAutoLoginData *loginData = [[NIMAutoLoginData alloc] init];
         loginData.account = accid;
         loginData.token = token;
         [Helper sharedAccount].accid = accid;
         [Helper sharedAccount].token = token;
         [[[NIMSDK sharedSDK] loginManager] autoLogin:loginData];
-        
+
         ModelRootViewController *mineVc = [[ModelRootViewController alloc] init];
         self.window.rootViewController = mineVc;
-    }else{
+    } else {
         [self setupLoginViewController];
     }
 }
 
-- (void)setupLoginViewController
-{
+- (void)setupLoginViewController {
     [self.window.rootViewController dismissViewControllerAnimated:YES completion:nil];
     LoginViewController *loginController = [[LoginViewController alloc] init];
     UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:loginController];
@@ -128,20 +125,20 @@ NSString *NTESNotificationLogout = @"NTESNotificationLogout";
 
 
 #pragma mark - 注销
--(void)logout:(NSNotification *)note
-{
+
+- (void)logout:(NSNotification *)note {
     [self doLogout];
 }
 
-- (void)doLogout
-{
+- (void)doLogout {
     //    [[NTESLoginManager sharedManager] setCurrentLoginData:nil];
     //    [[NTESServiceManager sharedManager] destory];
     [self setupLoginViewController];
 }
 
 #pragma NIMLoginManagerDelegate
-- (void)onAutoLoginFailed:(NSError *)error{
+
+- (void)onAutoLoginFailed:(NSError *)error {
     NSLog(@"AutoLoginFailed");
     [self showAutoLoginErrorAlert:error];
 }
@@ -149,18 +146,17 @@ NSString *NTESNotificationLogout = @"NTESNotificationLogout";
 - (void)onLogin:(NIMLoginStep)step {
 }
 
-- (void)onMultiLoginClientsChanged{
-    
+- (void)onMultiLoginClientsChanged {
+
     NSLog(@"被t");
 }
 
--(void)onKick:(NIMKickReason)code clientType:(NIMLoginClientType)clientType
-{
+- (void)onKick:(NIMKickReason)code clientType:(NIMLoginClientType)clientType {
     NSLog(@"onCLick");
     NSString *reason = @"你被踢下线";
     switch (code) {
         case NIMKickReasonByClient:
-        case NIMKickReasonByClientManually:{
+        case NIMKickReasonByClientManually: {
             //            NSString *clientName = [NTESClientUtil clientName:clientType];
             //            reason = clientName.length ? [NSString stringWithFormat:@"你的帐号被%@端踢出下线,请注意帐号信息安全",clientName] : @"你的帐号被踢出下线,请注意帐号信息安全";
             reason = @"你的帐号被踢出下线,请注意帐号信息安全";
@@ -173,7 +169,7 @@ NSString *NTESNotificationLogout = @"NTESNotificationLogout";
             break;
     }
     [MBProgressHUD showTextHUD:@"超时" inView:self.window hideAfterDelay:1];
-    
+
     [[[NIMSDK sharedSDK] loginManager] logout:^(NSError *error) {
         [[NSNotificationCenter defaultCenter] postNotificationName:NTESNotificationLogout object:nil];
         UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"下线通知" message:reason delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
@@ -182,38 +178,32 @@ NSString *NTESNotificationLogout = @"NTESNotificationLogout";
     }];
 }
 
-- (void)setupServices
-{
+- (void)setupServices {
     //    [[NTESLogManager sharedManager] start];
     [[NTESNotificationCenter sharedCenter] start];
     //    [[NTESSubscribeManager sharedManager] start];
     //    [[NTESRedPacketManager sharedManager] start];
 }
 
-- (void)registerAPNs
-{
-    if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerForRemoteNotifications)])
-    {
-        UIUserNotificationType types = UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound |      UIRemoteNotificationTypeAlert;
+- (void)registerAPNs {
+    if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerForRemoteNotifications)]) {
+        UIUserNotificationType types = UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert;
         UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:types
                                                                                  categories:nil];
         [[UIApplication sharedApplication] registerUserNotificationSettings:settings];
         [[UIApplication sharedApplication] registerForRemoteNotifications];
-    }
-    else
-    {
-        UIRemoteNotificationType types = UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound |        UIRemoteNotificationTypeBadge;
+    } else {
+        UIRemoteNotificationType types = UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeBadge;
         [[UIApplication sharedApplication] registerForRemoteNotificationTypes:types];
     }
 }
 
-- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
-{
+- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
     [[NIMSDK sharedSDK] updateApnsToken:deviceToken];
-    NSLog(@"deviceToken=============%@",deviceToken);
+    NSLog(@"deviceToken=============%@", deviceToken);
 }
 
-- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{
+- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
     NSLog(@"receive remote notification:  %@", userInfo);
     //    [UIApplication sharedApplication].applicationIconBadgeNumber  =  0;
     //    completionHandler(UIBackgroundFetchResultNewData);
@@ -222,128 +212,114 @@ NSString *NTESNotificationLogout = @"NTESNotificationLogout";
 - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
     // Required, iOS 7 Support
     completionHandler(UIBackgroundFetchResultNewData);
-    if([UIApplication sharedApplication].applicationState == UIApplicationStateActive)
-    {  //此时app在前台运行,我的做法是弹出一个alert,告诉用户有一条推送,用户可以选择查看或者忽略
-//                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"推送消息"
-//                                                                 message:@"您有一条新的推送消息!"
-//                                                                delegate:self
-//                                                       cancelButtonTitle:@"取消"
-//                                                       otherButtonTitles:@"查看",nil];
-//                [alert show];
-        
+    if ([UIApplication sharedApplication].applicationState == UIApplicationStateActive) {
+        // 此时app在前台运行,我的做法是弹出一个alert,告诉用户有一条推送,用户可以选择查看或者忽略
+        // UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"推送消息"
+        //                                                 message:@"您有一条新的推送消息!"
+        //                                                delegate:self
+        //                                       cancelButtonTitle:@"取消"
+        //                                       otherButtonTitles:@"查看", nil];
+        // [alert show];
     } else {
-        
+
         //这里是app未运行或者在后台,通过点击手机通知栏的推送消息打开app时可以在这里进行处理,比如,拿到推送里的内容或者附加      字段(假设,推送里附加了一个url为 www.baidu.com),那么你就可以拿到这个url,然后进行跳转到相应店web页,当然,不一定必须是web页,也可以是你app里的任意一个controll,跳转的话用navigation或者模态视图都可以
     }
-    
+
     //这里设置app的图片的角标为0,红色但角标就会消失
-    [UIApplication sharedApplication].applicationIconBadgeNumber  =  0;
+    [UIApplication sharedApplication].applicationIconBadgeNumber = 0;
     completionHandler(UIBackgroundFetchResultNewData);
-    
+
 }
 
-- (void)application:(UIApplication *)app didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
-{
-    NSLog(@"fail to get apns token :%@",error);
+- (void)application:(UIApplication *)app didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
+    NSLog(@"fail to get apns token :%@", error);
 }
 
 #pragma mark PKPushRegistryDelegate
-- (void)pushRegistry:(PKPushRegistry *)registry didUpdatePushCredentials:(PKPushCredentials *)credentials forType:(NSString *)type
-{
-    if ([type isEqualToString:PKPushTypeVoIP])
-    {
+
+- (void)pushRegistry:(PKPushRegistry *)registry didUpdatePushCredentials:(PKPushCredentials *)credentials forType:(NSString *)type {
+    if ([type isEqualToString:PKPushTypeVoIP]) {
         [[NIMSDK sharedSDK] updatePushKitToken:credentials.token];
     }
 }
 
-- (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(NSString *)type
-{
-    NSLog(@"receive payload %@ type %@",payload.dictionaryPayload,type);
+- (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(NSString *)type {
+    NSLog(@"receive payload %@ type %@", payload.dictionaryPayload, type);
     NSNumber *badge = payload.dictionaryPayload[@"aps"][@"badge"];
-    if ([badge isKindOfClass:[NSNumber class]])
-    {
+    if ([badge isKindOfClass:[NSNumber class]]) {
         [UIApplication sharedApplication].applicationIconBadgeNumber = [badge integerValue];
     }
 }
 
-- (void)pushRegistry:(PKPushRegistry *)registry didInvalidatePushTokenForType:(NSString *)type
-{
-    NSLog(@"registry %@ invalidate %@",registry,type);
+- (void)pushRegistry:(PKPushRegistry *)registry didInvalidatePushTokenForType:(NSString *)type {
+    NSLog(@"registry %@ invalidate %@", registry, type);
 }
 
 
 #pragma mark - misc
-- (void)registerPushService
-{
-    if (@available(iOS 11.0, *))
-    {
+
+- (void)registerPushService {
+    if (@available(iOS 11.0, *)) {
         UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
-        [center requestAuthorizationWithOptions:(UNAuthorizationOptionBadge | UNAuthorizationOptionSound | UNAuthorizationOptionAlert) completionHandler:^(BOOL granted, NSError * _Nullable error) {
-            if (!granted)
-            {
+        [center requestAuthorizationWithOptions:(UNAuthorizationOptionBadge | UNAuthorizationOptionSound | UNAuthorizationOptionAlert) completionHandler:^(BOOL granted, NSError *_Nullable error) {
+            if (!granted) {
                 dispatch_async_main_safe(^{
                     [[UIApplication sharedApplication].keyWindow makeToast:@"请开启推送功能否则无法收到推送通知" duration:2.0 position:CSToastPositionCenter];
                 })
             }
         }];
-    }
-    else
-    {
+    } else {
         UIUserNotificationType types = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert;
         UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:types
                                                                                  categories:nil];
         [[UIApplication sharedApplication] registerUserNotificationSettings:settings];
     }
-    
+
     [[UIApplication sharedApplication] registerForRemoteNotifications];
-    
-    
+
     //pushkit
     PKPushRegistry *pushRegistry = [[PKPushRegistry alloc] initWithQueue:dispatch_get_main_queue()];
     pushRegistry.delegate = self;
     pushRegistry.desiredPushTypes = [NSSet setWithObject:PKPushTypeVoIP];
-    
 }
 
 #pragma mark - 登录错误回调
-- (void)showAutoLoginErrorAlert:(NSError *)error
-{
+
+- (void)showAutoLoginErrorAlert:(NSError *)error {
     NSString *message = [NTESSessionUtil formatAutoLoginMessage:error];
     UIAlertController *vc = [UIAlertController alertControllerWithTitle:@"自动登录失败"
                                                                 message:message
                                                          preferredStyle:UIAlertControllerStyleAlert];
-    
+
     if ([error.domain isEqualToString:NIMLocalErrorDomain] &&
-        error.code == NIMLocalErrorCodeAutoLoginRetryLimit)
-    {
-        UIAlertAction *retryAction = [UIAlertAction actionWithTitle:@"重试"
-                                                              style:UIAlertActionStyleCancel
-                                                            handler:^(UIAlertAction * _Nonnull action) {
-                                                                //                                                                NTESLoginData *data = [[NTESLoginManager sharedManager] currentLoginData];
-                                                                NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
-                                                                NSString *account = [user objectForKey:@"accid"];
-                                                                NSString *token = [user objectForKey:@"token"];
-                                                                //
-                                                                //                                                                NSString *account = [data account];
-                                                                //                                                                NSString *token = [data token];
-                                                                if ([account length] && [token length])
-                                                                {
-                                                                    NIMAutoLoginData *loginData = [[NIMAutoLoginData alloc] init];
-                                                                    loginData.account = account;
-                                                                    loginData.token = token;
-                                                                    
-                                                                    [[[NIMSDK sharedSDK] loginManager] autoLogin:loginData];
-                                                                }
-                                                            }];
+            error.code == NIMLocalErrorCodeAutoLoginRetryLimit) {
+        UIAlertAction *retryAction =
+                [UIAlertAction actionWithTitle:@"重试"
+                                         style:UIAlertActionStyleCancel
+                                       handler:^(UIAlertAction *_Nonnull action) {
+                                           // NTESLoginData *data = [[NTESLoginManager sharedManager] currentLoginData];
+                                           NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
+                                           NSString *account = [user objectForKey:@"accid"];
+                                           NSString *token = [user objectForKey:@"token"];
+                                           //
+                                           // NSString *account = [data account];
+                                           // NSString *token = [data token];
+                                           if ([account length] && [token length]) {
+                                               NIMAutoLoginData *loginData = [[NIMAutoLoginData alloc] init];
+                                               loginData.account = account;
+                                               loginData.token = token;
+
+                                               [[[NIMSDK sharedSDK] loginManager] autoLogin:loginData];
+                                           }
+                                       }];
         [vc addAction:retryAction];
     }
-    
-    LoginViewController *lVc = [[LoginViewController alloc]init];
-    
-    
+
+    LoginViewController *lVc = [[LoginViewController alloc] init];
+
     UIAlertAction *logoutAction = [UIAlertAction actionWithTitle:@"注销"
                                                            style:UIAlertActionStyleDestructive
-                                                         handler:^(UIAlertAction * _Nonnull action) {
+                                                         handler:^(UIAlertAction *_Nonnull action) {
                                                              [[[NIMSDK sharedSDK] loginManager] logout:^(NSError *error) {
                                                                  [[NSNotificationCenter defaultCenter] postNotificationName:NTESNotificationLogout object:nil];
                                                                  [self.window.rootViewController presentViewController:lVc
@@ -352,19 +328,13 @@ NSString *NTESNotificationLogout = @"NTESNotificationLogout";
                                                              }];
                                                          }];
     [vc addAction:logoutAction];
-    
-    
+
+
     [self.window.rootViewController presentViewController:vc
                                                  animated:YES
                                                completion:nil];
 }
 
-- (void)applicationWillResignActive:(UIApplication *)application {
-    // 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.
-    // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
-}
-
-
 - (void)applicationDidEnterBackground:(UIApplication *)application {
     NSInteger count = [[[NIMSDK sharedSDK] conversationManager] allUnreadCount];
     [[UIApplication sharedApplication] setApplicationIconBadgeNumber:count];
@@ -372,7 +342,6 @@ NSString *NTESNotificationLogout = @"NTESNotificationLogout";
     // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
 }
 
-
 - (void)applicationWillEnterForeground:(UIApplication *)application {
     [[NSNotificationCenter defaultCenter] postNotificationName:@"reloadUnRead" object:nil];
     [[NSNotificationCenter defaultCenter] postNotificationName:@"orderMsg" object:nil];
@@ -380,14 +349,4 @@ NSString *NTESNotificationLogout = @"NTESNotificationLogout";
     // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
 }
 
-
-- (void)applicationDidBecomeActive:(UIApplication *)application {
-    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
-}
-
-
-- (void)applicationWillTerminate:(UIApplication *)application {
-    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
-}
-
 @end

+ 1 - 0
model/Assets.xcassets/mine/jineng/tianjiajineng.imageset/Contents.json

@@ -2,6 +2,7 @@
   "images" : [
     {
       "idiom" : "universal",
+      "filename" : "tianjiajineng.png",
       "scale" : "1x"
     },
     {

BIN
model/Assets.xcassets/mine/jineng/tianjiajineng.imageset/tianjiajineng.png


BIN
model/Assets.xcassets/mine/jineng/tianjiajineng.imageset/tianjiajineng@2x.png


BIN
model/Assets.xcassets/mine/jineng/tianjiajineng.imageset/tianjiajineng@3x.png


+ 21 - 0
model/Assets.xcassets/share_icon.imageset/Contents.json

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

BIN
model/Assets.xcassets/share_icon.imageset/share_icon.png


BIN
model/Assets.xcassets/个人中心/.DS_Store


+ 23 - 0
model/Assets.xcassets/个人中心/btn_allow.imageset/Contents.json

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

BIN
model/Assets.xcassets/个人中心/btn_allow.imageset/btn_allow.png


BIN
model/Assets.xcassets/个人中心/btn_allow.imageset/btn_allow@2x.png


BIN
model/Assets.xcassets/个人中心/btn_allow.imageset/btn_allow@3x.png


+ 23 - 0
model/Assets.xcassets/个人中心/btn_allow_check.imageset/Contents.json

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

BIN
model/Assets.xcassets/个人中心/btn_allow_check.imageset/btn_allow_check.png


BIN
model/Assets.xcassets/个人中心/btn_allow_check.imageset/btn_allow_check@2x.png


BIN
model/Assets.xcassets/个人中心/btn_allow_check.imageset/btn_allow_check@3x.png


+ 23 - 0
model/Assets.xcassets/个人中心/icon_chenggong.imageset/Contents.json

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

BIN
model/Assets.xcassets/个人中心/icon_chenggong.imageset/icon_chenggong.png


BIN
model/Assets.xcassets/个人中心/icon_chenggong.imageset/icon_chenggong@2x.png


BIN
model/Assets.xcassets/个人中心/icon_chenggong.imageset/icon_chenggong@3x.png


BIN
model/Assets.xcassets/个人中心/icon_paihang.imageset/icon_paihang.png


BIN
model/Assets.xcassets/个人中心/icon_paihang.imageset/icon_paihang@2x.png


BIN
model/Assets.xcassets/个人中心/icon_paihang.imageset/icon_paihang@3x.png


+ 23 - 0
model/Assets.xcassets/个人中心/icon_tianjia.imageset/Contents.json

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

BIN
model/Assets.xcassets/个人中心/icon_tianjia.imageset/icon_tianjia.png


BIN
model/Assets.xcassets/个人中心/icon_tianjia.imageset/icon_tianjia@2x.png


BIN
model/Assets.xcassets/个人中心/icon_tianjia.imageset/icon_tianjia@3x.png


+ 23 - 0
model/Assets.xcassets/个人中心/icon_tianjia_xiao.imageset/Contents.json

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

BIN
model/Assets.xcassets/个人中心/icon_tianjia_xiao.imageset/icon_tianjia_xiao.png


BIN
model/Assets.xcassets/个人中心/icon_tianjia_xiao.imageset/icon_tianjia_xiao@2x.png


BIN
model/Assets.xcassets/个人中心/icon_tianjia_xiao.imageset/icon_tianjia_xiao@3x.png


+ 23 - 0
model/Assets.xcassets/个人中心/text_moteduan.imageset/Contents.json

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

BIN
model/Assets.xcassets/个人中心/text_moteduan.imageset/text_moteduan.png


BIN
model/Assets.xcassets/个人中心/text_moteduan.imageset/text_moteduan@2x.png


BIN
model/Assets.xcassets/个人中心/text_moteduan.imageset/text_moteduan@3x.png


+ 41 - 36
model/Classes/Controllers/Controller/AboutUsVC/AboutUsViewController.m

@@ -16,32 +16,37 @@
 
 - (void)viewDidLoad {
     [super viewDidLoad];
-    
+
     self.title = @"联系我们";
     self.view.backgroundColor = RGB(245, 245, 245);
-    
+
     self.extendedLayoutIncludesOpaqueBars = YES;
-    
-    UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom];
+
+    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
     btn.frame = CGRectMake(0, 0, 40, 40);
     [btn setImage:[UIImage imageNamed:@"fanhui2"] forState:UIControlStateNormal];
-    btn.imageEdgeInsets =  UIEdgeInsetsMake(0, -20, 0, 0);
+    btn.imageEdgeInsets = UIEdgeInsetsMake(0, -20, 0, 0);
     [btn addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
     UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
-    UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
+    UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
     nagetiveSpacer.width = -12;//这个值可以根据自己需要自己调整
     self.navigationItem.leftBarButtonItems = @[nagetiveSpacer, leftItem];
-    
+
     [self createSubviews];
 }
 
+- (void)viewWillAppear:(BOOL)animated {
+    [super viewWillAppear:animated];
+    [self.navigationController setNavigationBarHidden:NO animated:YES];
+}
+
 - (void)backClick {
     [self.navigationController popViewControllerAnimated:YES];
 }
 
--(void)createSubviews{
-    
-    UIImageView *iconImage = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"icon60"]];
+- (void)createSubviews {
+
+    UIImageView *iconImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon60"]];
     iconImage.layer.cornerRadius = 10;
     iconImage.layer.masksToBounds = YES;
     [self.view addSubview:iconImage];
@@ -51,19 +56,19 @@
         make.width.equalTo(@60);
         make.height.equalTo(@60);
     }];
-    
-    UIView *whiteBgView = [[UIView alloc]init];
+
+    UIView *whiteBgView = [[UIView alloc] init];
     whiteBgView.backgroundColor = [UIColor whiteColor];
     whiteBgView.layer.cornerRadius = 5;
     [self.view addSubview:whiteBgView];
     [whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.centerX.equalTo(self.view.mas_centerX);
         make.top.equalTo(iconImage.mas_bottom).offset(30);
-        make.width.equalTo(@(ScreenWidth-20));
+        make.width.equalTo(@(ScreenWidth - 20));
         make.height.equalTo(@200);
     }];
-    
-    UILabel *introduceLabel = [[UILabel alloc]init];
+
+    UILabel *introduceLabel = [[UILabel alloc] init];
     introduceLabel.numberOfLines = 0;
     introduceLabel.text = @"千模APP[80万模特的能量场]\n千模app南京千模信息科技有限公司集合多年对国内模特艺人商演行业现状及行业痛点,完善及创新整合的商业应用平台,模特艺人通过后台完善自己的模卡信息和技能信息,让用户第一时间找到适合的模特艺人,通过视频面试让模特足不出户能和雇主面对面沟通,促进订单的达成。\n千模平台以保障模特艺人的经济利益和安全为己任,搭建模特艺人与企业间的市场化桥梁,为中国模特艺人创造利益最大化和成为模特现实梦想的舞台。";
     introduceLabel.textColor = RGB(51, 51, 51);
@@ -75,15 +80,15 @@
         make.top.equalTo(whiteBgView.mas_top).offset(15);
         make.left.equalTo(whiteBgView.mas_left).offset(10);
     }];
-    
-    UIButton *telButton = [[UIButton alloc]init];
+
+    UIButton *telButton = [[UIButton alloc] init];
     telButton.layer.cornerRadius = 5;
     telButton.backgroundColor = [UIColor whiteColor];
     [telButton setTitle:@"客服电话:15805170379" forState:UIControlStateNormal];
     [telButton setTitleColor:RGB(51, 51, 51) forState:UIControlStateNormal];
     [telButton setImage:[UIImage imageNamed:@"youjiantou"] forState:UIControlStateNormal];
-    [telButton setTitleEdgeInsets:UIEdgeInsetsMake(5, 10, 5, ScreenWidth-200)];
-    [telButton setImageEdgeInsets:UIEdgeInsetsMake(5, ScreenWidth-40, 5, 10)];
+    [telButton setTitleEdgeInsets:UIEdgeInsetsMake(5, 10, 5, ScreenWidth - 200)];
+    [telButton setImageEdgeInsets:UIEdgeInsetsMake(5, ScreenWidth - 40, 5, 10)];
     telButton.titleLabel.font = [UIFont systemFontOfSize:14];
     [telButton addTarget:self action:@selector(clickTel) forControlEvents:UIControlEventTouchUpInside];
     [self.view addSubview:telButton];
@@ -93,15 +98,15 @@
         make.right.equalTo(whiteBgView.mas_right);
         make.height.equalTo(@40);
     }];
-    
-    UIButton *qqButton = [[UIButton alloc]init];
+
+    UIButton *qqButton = [[UIButton alloc] init];
     qqButton.layer.cornerRadius = 5;
     qqButton.backgroundColor = [UIColor whiteColor];
     [qqButton setTitle:@"客服QQ:1833193888" forState:UIControlStateNormal];
     [qqButton setTitleColor:RGB(51, 51, 51) forState:UIControlStateNormal];
     [qqButton setImage:[UIImage imageNamed:@"youjiantou"] forState:UIControlStateNormal];
-    [qqButton setTitleEdgeInsets:UIEdgeInsetsMake(5, 10, 5, ScreenWidth-187)];
-    [qqButton setImageEdgeInsets:UIEdgeInsetsMake(5, ScreenWidth-40, 5, 10)];
+    [qqButton setTitleEdgeInsets:UIEdgeInsetsMake(5, 10, 5, ScreenWidth - 187)];
+    [qqButton setImageEdgeInsets:UIEdgeInsetsMake(5, ScreenWidth - 40, 5, 10)];
     qqButton.titleLabel.font = [UIFont systemFontOfSize:14];
     qqButton.titleLabel.textAlignment = NSTextAlignmentLeft;
     [qqButton addTarget:self action:@selector(clickQQ) forControlEvents:UIControlEventTouchUpInside];
@@ -112,8 +117,8 @@
         make.right.equalTo(whiteBgView.mas_right);
         make.height.equalTo(@40);
     }];
-    
-    UILabel *companyLabel = [[UILabel alloc]init];
+
+    UILabel *companyLabel = [[UILabel alloc] init];
     companyLabel.text = @"南京千模信息科技有限公司 版权所有";
     companyLabel.textColor = RGB(51, 51, 51);
     companyLabel.font = [UIFont systemFontOfSize:14];
@@ -125,8 +130,8 @@
         make.right.equalTo(whiteBgView.mas_right);
         make.height.equalTo(@15);
     }];
-    
-    UILabel *dateLabel = [[UILabel alloc]init];
+
+    UILabel *dateLabel = [[UILabel alloc] init];
     dateLabel.text = @"©2018 chmo All Rights Reserved.";
     dateLabel.textColor = RGB(102, 102, 102);
     dateLabel.font = [UIFont systemFontOfSize:14];
@@ -140,14 +145,14 @@
     }];
 }
 
--(void)clickTel{
-    
-    NSString* PhoneStr = [NSString stringWithFormat:@"tel://%@",@"15805170379"];
-    UIApplication * app = [UIApplication sharedApplication];
+- (void)clickTel {
+
+    NSString *PhoneStr = [NSString stringWithFormat:@"tel://%@", @"15805170379"];
+    UIApplication *app = [UIApplication sharedApplication];
     if ([app canOpenURL:[NSURL URLWithString:PhoneStr]]) {
         [app openURL:[NSURL URLWithString:PhoneStr]];
     }
-    
+
 //    UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"联系客服\n15805170379" message: nil preferredStyle:UIAlertControllerStyleAlert];
 //    // 添加按钮
 //    [alert addAction:[UIAlertAction actionWithTitle:@"呼叫" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
@@ -163,14 +168,14 @@
 //    [self presentViewController:alert animated:YES completion:nil];
 }
 
--(void)clickQQ{
-    
+- (void)clickQQ {
+
     UIPasteboard *pboard = [UIPasteboard generalPasteboard];
     pboard.string = @"1833193888";
-    
+
     UIAlertController *alertDialog = [UIAlertController alertControllerWithTitle:@"提示" message:@"QQ号已复制" preferredStyle:UIAlertControllerStyleAlert];
     UIAlertAction *laterAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
-        
+
     }];
     [alertDialog addAction:laterAction];
     [self presentViewController:alertDialog animated:YES completion:nil];

+ 19 - 1
model/Classes/Controllers/Controller/MessageVC/MessageListViewController.m

@@ -47,7 +47,7 @@
 }
 
 - (void)viewWillAppear:(BOOL)animated{
-    [self changeLoginState:@"1"];
+    // [self changeLoginState:@"1"];
     NSInteger count = [[[NIMSDK sharedSDK] conversationManager] allUnreadCount];
     self.navigationController.tabBarItem.badgeValue = count ? [NSString stringWithFormat:@"%ld",count] : nil;
 }
@@ -79,6 +79,24 @@
     }];
 }
 
+- (NSInteger)findInsertPlace:(NIMRecentSession *)recentSession{
+    __block NSUInteger matchIdx = 0;
+    __block BOOL find = NO;
+    [self.recentSessions enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
+        NIMRecentSession *item = obj;
+        if (item.lastMessage.timestamp <= recentSession.lastMessage.timestamp && ![item.lastMessage.session.sessionId isEqualToString:@"system"]) {
+            *stop = YES;
+            find  = YES;
+            matchIdx = idx;
+        }
+    }];
+    if (find) {
+        return matchIdx;
+    }else{
+        return self.recentSessions.count;
+    }
+}
+
 - (void)didReceiveMemoryWarning {
     [super didReceiveMemoryWarning];
     // Dispose of any resources that can be recreated.

+ 9 - 24
model/Classes/Controllers/Controller/MessageVC/MessageViewController.m

@@ -23,6 +23,7 @@ NSString *const NIMDemoEventNameCloseSnapPicture = @"NIMDemoEventNameCloseSnapPi
 @property (nonatomic,strong) NTESSessionConfig       *sessionConfig;
 @property (nonatomic,strong) UIView                  * bgblackView;//黑色背景
 @property (nonatomic,strong) UIView                  * bgwhiteView;//下拉选项背景
+@property(nonatomic, assign) BOOL hideTabBarWhenPop;
 
 @end
 
@@ -60,23 +61,6 @@ NSString *const NIMDemoEventNameCloseSnapPicture = @"NIMDemoEventNameCloseSnapPi
     self.navigationItem.rightBarButtonItems = @[rightItem, nagetiveRightSpacer];
 }
 
-- (void)viewWillAppear:(BOOL)animated{
-    self.tabBarController.tabBar.hidden = YES;
-}
-
-- (void)viewWillDisappear:(BOOL)animated{
-    self.tabBarController.tabBar.hidden = NO;
-}
-
-
-- (void)viewDidLayoutSubviews {
-    [super viewDidLayoutSubviews];
-    if ([@"system" isEqualToString:self.session.sessionId]) {
-        self.sessionInputView.hidden = YES;
-        [self.tableView setFrame: CGRectMake(0, self.navigationController.navigationBar.frame.size.height, ScreenWidth, self.view.frame.size.height - self.navigationController.navigationBar.frame.size.height)];
-    }
-}
-
 -(void)rightBtnClick{
     
     if (!_bgblackView) {
@@ -470,13 +454,14 @@ NSString *const NIMDemoEventNameCloseSnapPicture = @"NIMDemoEventNameCloseSnapPi
     }
 }
 
-//- (void)viewWillAppear:(BOOL)animated{
-//    self.tabBarController.tabBar.hidden = YES;
-//}
-//
-//- (void)viewWillDisappear:(BOOL)animated{
-//    self.tabBarController.tabBar.hidden = NO;
-//}
+- (void)viewWillAppear:(BOOL)animated {
+    self.hideTabBarWhenPop = self.tabBarController.tabBar.isHidden;
+    self.tabBarController.tabBar.hidden = YES;
+}
+
+- (void)viewWillDisappear:(BOOL)animated {
+    self.tabBarController.tabBar.hidden = self.hideTabBarWhenPop;
+}
 
 - (void)didReceiveMemoryWarning {
     [super didReceiveMemoryWarning];

+ 102 - 65
model/Classes/Controllers/Controller/MineVC/MineNewViewController.m

@@ -20,26 +20,29 @@
 #import "IntroView.h"
 #import "ModelCardController.h"
 #import "RankController.h"
+#import "ApplyRecommendView.h"
+#import "WZLBadgeImport.h"
 
-@interface MineNewViewController (){
+@interface MineNewViewController () {
     BOOL online;
 }
 @property(weak, nonatomic) IBOutlet UIView *headView;
 @property(weak, nonatomic) IBOutlet UIView *bgView;
 @property(weak, nonatomic) IBOutlet UILabel *nameLabel;
-@property (weak, nonatomic) IBOutlet UIView *avatarBg;
+@property(weak, nonatomic) IBOutlet UIView *avatarBg;
 @property(weak, nonatomic) IBOutlet UIImageView *avatarView;
-@property (weak, nonatomic) IBOutlet UIView *container1;
-@property (weak, nonatomic) IBOutlet UIView *container2;
-@property (weak, nonatomic) IBOutlet UIView *incomeView;
-@property (weak, nonatomic) IBOutlet UILabel *incomeLabel;
-@property (weak, nonatomic) IBOutlet UISwitch *onlineSwitch;
-@property (weak, nonatomic) IBOutlet UIView *modelCardView;
-@property (weak, nonatomic) IBOutlet UIView *skillView;
+@property(weak, nonatomic) IBOutlet UIView *container1;
+@property(weak, nonatomic) IBOutlet UIView *container2;
+@property(weak, nonatomic) IBOutlet UIView *incomeView;
+@property(weak, nonatomic) IBOutlet UILabel *incomeLabel;
+@property(weak, nonatomic) IBOutlet UISwitch *onlineSwitch;
+@property(weak, nonatomic) IBOutlet UIView *modelCardView;
+@property(weak, nonatomic) IBOutlet UIView *skillView;
 
-@property (weak, nonatomic) IBOutlet UIView *switchView;
-@property (weak, nonatomic) IBOutlet UIView *switchIndicatorView;
-@property (weak, nonatomic) IBOutlet UIView *transformView;
+@property(weak, nonatomic) IBOutlet UIView *switchView;
+@property(weak, nonatomic) IBOutlet UIView *switchIndicatorView;
+@property(weak, nonatomic) IBOutlet UIView *transformView;
+@property(weak, nonatomic) IBOutlet UIImageView *orderIcon;
 @end
 
 @implementation MineNewViewController
@@ -56,9 +59,9 @@
     self.nameLabel.userInteractionEnabled = YES;
     self.avatarBg.layer.cornerRadius = 43;
     self.avatarView.layer.cornerRadius = 35;
-    self.avatarView.layer.masksToBounds = YES; 
+    self.avatarView.layer.masksToBounds = YES;
     self.avatarView.userInteractionEnabled = YES;
-    
+
     online = YES;
 }
 
@@ -67,7 +70,7 @@
     [self getDataFromNetworking];
 }
 
--(void)viewDidLayoutSubviews{
+- (void)viewDidLayoutSubviews {
     [super viewDidLayoutSubviews];
     CAGradientLayer *gl = [CAGradientLayer layer];
     gl.frame = CGRectMake(0, 0, self.headView.frame.size.width, 104 + [[UIApplication sharedApplication] statusBarFrame].size.height);
@@ -76,51 +79,52 @@
     gl.colors = @[(__bridge id) [UIColor colorWithRed:251 / 255.0 green:92 / 255.0 blue:163 / 255.0 alpha:1].CGColor, (__bridge id) [UIColor colorWithRed:253 / 255.0 green:127 / 255.0 blue:141 / 255.0 alpha:1].CGColor];
     gl.locations = @[@(0), @(1.0f)];
     [self.headView.layer addSublayer:gl];
-    
+
     UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.bgView.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(30, 30)];
     CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
     maskLayer.frame = self.bgView.bounds;
     maskLayer.path = maskPath.CGPath;
     self.bgView.layer.mask = maskLayer;
-    
+
     self.container1.layer.cornerRadius = 12;
-    self.container1.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.08].CGColor;
-    self.container1.layer.shadowOffset = CGSizeMake(0,6);
+    self.container1.layer.shadowColor = [UIColor colorWithRed:0 / 255.0 green:0 / 255.0 blue:0 / 255.0 alpha:0.08].CGColor;
+    self.container1.layer.shadowOffset = CGSizeMake(0, 6);
     self.container1.layer.shadowOpacity = 1;
     self.container1.layer.shadowRadius = 12;
-    
+
     self.container2.layer.cornerRadius = 12;
-    self.container2.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.08].CGColor;
-    self.container2.layer.shadowOffset = CGSizeMake(0,6);
+    self.container2.layer.shadowColor = [UIColor colorWithRed:0 / 255.0 green:0 / 255.0 blue:0 / 255.0 alpha:0.08].CGColor;
+    self.container2.layer.shadowOffset = CGSizeMake(0, 6);
     self.container2.layer.shadowOpacity = 1;
     self.container2.layer.shadowRadius = 12;
-    
+
     self.incomeView.layer.cornerRadius = 17;
-    self.incomeView.layer.shadowColor = [UIColor colorWithRed:255/255.0 green:64/255.0 blue:149/255.0 alpha:0.36].CGColor;
-    self.incomeView.layer.shadowOffset = CGSizeMake(0,8);
+    self.incomeView.layer.shadowColor = [UIColor colorWithRed:255 / 255.0 green:64 / 255.0 blue:149 / 255.0 alpha:0.36].CGColor;
+    self.incomeView.layer.shadowOffset = CGSizeMake(0, 8);
     self.incomeView.layer.shadowOpacity = 1;
     self.incomeView.layer.shadowRadius = 10;
 }
 
 - (void)viewDidAppear:(BOOL)animated {
     [super viewDidAppear:animated];
-    NSNumber* intro = [[NSUserDefaults standardUserDefaults] objectForKey:@"intro"];
+    NSNumber *intro = [[NSUserDefaults standardUserDefaults] objectForKey:@"intro"];
     if (!intro) {
         __weak MineNewViewController *this = self;
-        IntroView* introView = [[IntroView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height)
+        IntroView *introView = [[IntroView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height)
                                                         confirm:^{
                                                             ModelCardController *modelCardVC = [[ModelCardController alloc] init];
+                                                            modelCardVC.type = @"init";
                                                             modelCardVC.hidesBottomBarWhenPushed = YES;
                                                             [this.navigationController pushViewController:modelCardVC animated:YES];
                                                         }
                                                          cancel:^{
-                                                             
+
                                                          }];
-        UIWindow * window=[[[UIApplication sharedApplication] delegate] window];
-        CGRect rect1 = [self.modelCardView convertRect: self.modelCardView.bounds toView:window];
+        UIWindow *window = [[[UIApplication sharedApplication] delegate] window];
+        CGRect rect1 = [self.modelCardView convertRect:self.modelCardView.bounds toView:window];
         introView.icon1left.constant = rect1.origin.x + rect1.size.width / 2 - 43;
         introView.icon1top.constant = rect1.origin.y + rect1.size.height / 2 - 43 - [[UIApplication sharedApplication] statusBarFrame].size.height;
-        CGRect rect2 = [self.skillView convertRect: self.skillView.bounds toView:window];
+        CGRect rect2 = [self.skillView convertRect:self.skillView.bounds toView:window];
         introView.icon2left.constant = rect2.origin.x + rect2.size.width / 2 - 43;
         [window addSubview:introView];
         [introView updateConstraints];
@@ -135,10 +139,10 @@
 
 - (void)getDataFromNetworking {
 //    [MBProgressHUD showHUDAddedTo:self.view animated:YES];
-    NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:[ModelUser user].modelpk, @"modelpk", nil];
+    NSDictionary *dic = @{@"modelpk": [ModelUser user].modelpk};
     [YanCNetWorkManager requestPostWithURLStr:Url_refreshLogin(PublicUrl) parameters:dic finish:^(id dataDic) {
         [MBProgressHUD hideHUDForView:self.view animated:YES];
-        
+
         NSString *issuccess = dataDic[@"msg"];
         if ([issuccess isEqualToString:@"success"]) {
             ModelUser *user = [ModelUser modelUser];
@@ -149,38 +153,38 @@
             user.pk = dataDic[@"data"][@"pk"];
             user.qrcode = dataDic[@"data"][@"qrcode"];
             [ModelUser save:user];
-            
+
             self.nameLabel.text = [NSString stringWithFormat:@"%@", dataDic[@"data"][@"pet"]];
             [self.avatarView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/%@", PublicUrl, dataDic[@"data"][@"hphoto"]]] placeholderImage:[UIImage imageNamed:@"morentouxiang"]];
             online = user.is_a;
             [self setSwitchState:user.is_a];
-           
-//            if ([dataDic[@"data"][@"hasred"] isEqualToString:@"1"]) {
-//                self.notificationView.hidden = NO;
-//            }else{
-//                self.notificationView.hidden = YES;
-//            }
-            
+
+            if ([dataDic[@"data"][@"hasred"] isEqualToString:@"1"]) {
+                [self.orderIcon showBadge];
+            } else {
+                [self.orderIcon clearBadge];
+            }
+
             [self getIncomeFromNetworking];
         } else {
             [MBProgressHUD showInfo:@"请求失败!"];
         }
-    } enError:^(NSError *error) {
+    }                                 enError:^(NSError *error) {
         [MBProgressHUD hideHUDForView:self.view animated:YES];
     }];
 }
 
--(void)getIncomeFromNetworking{
-    
-    NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:[ModelUser modelUser].pk,@"memberpk", nil];
+- (void)getIncomeFromNetworking {
+
+    NSDictionary *dic = @{@"memberpk": [ModelUser modelUser].pk};
     [YanCNetWorkManager requestPostWithURLStr:Url_getIncomeToday(PublicUrl) parameters:dic finish:^(id dataDic) {
         NSString *issuccess = dataDic[@"msg"];
         if ([issuccess isEqualToString:@"success"]) {
             self.incomeLabel.text = [NSString stringWithFormat:@"今日收入 %@元", dataDic[@"count"]];
-        }else {
+        } else {
             [MBProgressHUD showInfo:@"请求失败!"];
         }
-    }enError:^(NSError *error) {
+    }                                 enError:^(NSError *error) {
         [MBProgressHUD hideHUDForView:self.view animated:YES];
     }];
 }
@@ -200,10 +204,8 @@
             break;
         }
         case 3: {
-            UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:@"确定申请首页推荐展示?" preferredStyle:UIAlertControllerStyleAlert];
-            [alert addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]];
-            [alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
-                NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:[ModelUser modelUser].modelpk,@"modelpk", nil];
+            [ApplyRecommendView showIntoView:[UIApplication sharedApplication].keyWindow confirm:^{
+                NSDictionary *dic = @{@"modelpk": [ModelUser modelUser].modelpk};
                 [YanCNetWorkManager requestPostWithURLStr:Url_applyRecommend(PublicUrl)
                                                parameters:dic
                                                    finish:^(id res) {
@@ -217,11 +219,30 @@
                                                   enError:^(NSError *error) {
                                                       [MBProgressHUD hideHUDForView:self.view animated:YES];
                                                   }];
-            }]];
-            [self presentViewController:alert animated:YES completion:nil];
+            }];
+            break;
+//            UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:@"确定申请首页推荐展示?" preferredStyle:UIAlertControllerStyleAlert];
+//            [alert addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]];
+//            [alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *_Nonnull action) {
+//                NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:[ModelUser modelUser].modelpk, @"modelpk", nil];
+//                [YanCNetWorkManager requestPostWithURLStr:Url_applyRecommend(PublicUrl)
+//                                               parameters:dic
+//                                                   finish:^(id res) {
+//                                                       BOOL success = [res[@"success"] intValue] == 1;
+//                                                       if (success) {
+//                                                           [MBProgressHUD showInfo:@"申请已提交"];
+//                                                       } else {
+//                                                           [MBProgressHUD showInfo:@"请求失败!"];
+//                                                       }
+//                                                   }
+//                                                  enError:^(NSError *error) {
+//                                                      [MBProgressHUD hideHUDForView:self.view animated:YES];
+//                                                  }];
+//            }]];
+//            [self presentViewController:alert animated:YES completion:nil];
         }
         case 4: {
-            PromoteController* vc = [[PromoteController alloc] init];
+            PromoteController *vc = [[PromoteController alloc] init];
             vc.hidesBottomBarWhenPushed = YES;
             [self.navigationController pushViewController:vc animated:YES];
             break;
@@ -239,21 +260,21 @@
             [self.navigationController pushViewController:myWalletVC animated:YES];
             break;
         }
-        case 7:{
+        case 7: {
             PlatformActivityController *activityVC = [[PlatformActivityController alloc] init];
             activityVC.hidesBottomBarWhenPushed = YES;
             [self.navigationController pushViewController:activityVC animated:YES];
             break;
         }
-        case 8:{
+        case 8: {
             AboutUsViewController *aboutUsVC = [[AboutUsViewController alloc] init];
             aboutUsVC.hidesBottomBarWhenPushed = YES;
             [self.navigationController pushViewController:aboutUsVC animated:YES];
             break;
         }
-        case 9:{
+        case 9: {
             [MBProgressHUD showHUDAddedTo:self.view animated:YES];
-            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
                 [MBProgressHUD hideHUDForView:self.view];
                 [MBProgressHUD showInfo:@"清理完成"];
             });
@@ -275,8 +296,8 @@
 }
 
 - (void)updateOnline:(BOOL)state {
-    __weak MineNewViewController* this = self;
-    NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:[ModelUser modelUser].modelpk, @"modelpk", @(state), @"state", nil];
+    __weak MineNewViewController *this = self;
+    NSDictionary *dic = @{@"modelpk": [ModelUser modelUser].modelpk, @"state": @(state)};
     [YanCNetWorkManager requestPostWithURLStr:Url_setOnline(PublicUrl)
                                    parameters:dic
                                        finish:^(id res) {
@@ -285,9 +306,25 @@
                                                online = state;
                                                [this setSwitchState:state];
                                                if (online) {
-                                                   [MBProgressHUD showInfo:@"您已开启在线模式"];
+                                                   MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:[UIApplication sharedApplication].keyWindow animated:YES];
+                                                   hud.mode = MBProgressHUDModeText;
+                                                   hud.detailsLabel.text = @"您已开启在线状态\n将优先排序获得更多商业订单";
+                                                   hud.detailsLabel.font = [UIFont boldSystemFontOfSize:16];
+                                                   hud.margin = 15.f;
+                                                   hud.removeFromSuperViewOnHide = YES;
+                                                   [hud.bezelView setBackgroundColor:[UIColor colorWithRed:0 / 255.0 green:0 / 255.0 blue:0 / 255.0 alpha:0.8]];
+                                                   hud.contentColor = [UIColor whiteColor];
+                                                   [hud hideAnimated:YES afterDelay:2];
                                                } else {
-                                                   [MBProgressHUD showInfo:@"您已开启离线模式,别人将无法呼叫您"];
+                                                   MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:[UIApplication sharedApplication].keyWindow animated:YES];
+                                                   hud.mode = MBProgressHUDModeText;
+                                                   hud.detailsLabel.text = @"您已开启离线状态\n客户无法及时联系您将造成经济损失";
+                                                   hud.detailsLabel.font = [UIFont boldSystemFontOfSize:16];
+                                                   hud.margin = 15.f;
+                                                   hud.removeFromSuperViewOnHide = YES;
+                                                   [hud.bezelView setBackgroundColor:[UIColor colorWithRed:0 / 255.0 green:0 / 255.0 blue:0 / 255.0 alpha:0.8]];
+                                                   hud.contentColor = [UIColor whiteColor];
+                                                   [hud hideAnimated:YES afterDelay:2];
                                                }
                                            } else {
                                                [MBProgressHUD showInfo:@"请求失败!"];
@@ -305,7 +342,7 @@
                             options:UIViewAnimationOptionCurveEaseOut
                          animations:^{
                              self.switchView.backgroundColor = [UIColor whiteColor];
-                             self.switchIndicatorView.backgroundColor = [UIColor colorWithRed:255/255.0 green:64/255.0 blue:149/255.0 alpha:1];
+                             self.switchIndicatorView.backgroundColor = [UIColor colorWithRed:255 / 255.0 green:64 / 255.0 blue:149 / 255.0 alpha:1];
                              self.transformView.transform = CGAffineTransformMakeTranslation(0, 0);
                          }
                          completion:nil];
@@ -314,7 +351,7 @@
                               delay:0
                             options:UIViewAnimationOptionCurveEaseOut
                          animations:^{
-                             self.switchView.backgroundColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.3];
+                             self.switchView.backgroundColor = [UIColor colorWithRed:0 / 255.0 green:0 / 255.0 blue:0 / 255.0 alpha:0.3];
                              self.switchIndicatorView.backgroundColor = [UIColor whiteColor];
                              self.transformView.transform = CGAffineTransformMakeTranslation(-32, 0);
                          }
@@ -323,7 +360,7 @@
 }
 
 - (IBAction)tapRank:(id)sender {
-    RankController* rankVC = [[RankController alloc] init];
+    RankController *rankVC = [[RankController alloc] init];
     rankVC.hidesBottomBarWhenPushed = YES;
     [self.navigationController pushViewController:rankVC animated:YES];
 }

+ 1 - 0
model/Classes/Controllers/Controller/MineVC/MineNewViewController.xib

@@ -22,6 +22,7 @@
                 <outlet property="incomeView" destination="kaC-Mh-u3w" id="kyJ-iN-iF8"/>
                 <outlet property="modelCardView" destination="etX-QK-1nU" id="EVQ-7h-fu5"/>
                 <outlet property="nameLabel" destination="tnV-pA-N5a" id="4Yj-BS-G5M"/>
+                <outlet property="orderIcon" destination="paS-9R-vth" id="ydq-Na-iLI"/>
                 <outlet property="skillView" destination="Ac7-NR-8Xp" id="Ven-w6-xmx"/>
                 <outlet property="switchIndicatorView" destination="ETZ-yN-c0i" id="4v1-LO-MNx"/>
                 <outlet property="switchView" destination="wPM-QM-mXD" id="2Et-Fe-rBA"/>

+ 18 - 0
model/Classes/Controllers/Controller/MineVC/View/ApplyRecommendView.h

@@ -0,0 +1,18 @@
+//
+//  ApplyRecommendView.h
+//  model
+//
+//  Created by Drew on 2018/11/7.
+//  Copyright © 2018 Mine. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ApplyRecommendView : UIView
++ (void)showIntoView:(UIView *)view confirm:(void(^)(void))confirmBlock;
+@property(nonatomic, copy) void (^confirmBlock)(void);
+@end
+
+NS_ASSUME_NONNULL_END

+ 149 - 0
model/Classes/Controllers/Controller/MineVC/View/ApplyRecommendView.m

@@ -0,0 +1,149 @@
+//
+//  ApplyRecommendView.m
+//  model
+//
+//  Created by Drew on 2018/11/7.
+//  Copyright © 2018 Mine. All rights reserved.
+//
+
+#import "ApplyRecommendView.h"
+#import "Masonry.h"
+
+@interface ApplyRecommendView ()
+@property(nonatomic, strong) UIView *mask;
+@property(nonatomic, strong) UIView *content;
+@end
+
+@implementation ApplyRecommendView
+- (instancetype)init {
+    if (self = [super init]) {
+        [self initView];
+    }
+    return self;
+}
+
+- (void)initView {
+    self.backgroundColor = [UIColor clearColor];
+    UIView *mask = [[UIView alloc] init];
+    mask.backgroundColor = [UIColor clearColor];
+    [self addSubview:mask];
+    [mask mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.edges.equalTo(self);
+    }];
+    self.mask = mask;
+
+    UIView *content = [[UIView alloc] init];
+    content.backgroundColor = [UIColor whiteColor];
+    content.layer.backgroundColor = [UIColor colorWithRed:255 / 255.0 green:255 / 255.0 blue:255 / 255.0 alpha:1].CGColor;
+    content.layer.cornerRadius = 12;
+    [self addSubview:content];
+    [content mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.equalTo(self.mas_left).offset(20);
+        make.right.equalTo(self.mas_right).offset(-20);
+        make.top.equalTo(self.mas_top).offset(68);
+        make.bottom.equalTo(self.mas_bottom).offset(-68);
+    }];
+    content.transform = CGAffineTransformMakeScale(0.3, 0.3);
+    content.alpha = 0;
+    self.content = content;
+
+    UILabel *title = [[UILabel alloc] init];
+    title.numberOfLines = 0;
+    title.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
+    title.textColor = [UIColor blackColor];
+    title.text = @"申请上推荐位";
+    [content addSubview:title];
+    [title mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.centerX.equalTo(content);
+        make.top.equalTo(content).offset(30);
+    }];
+
+    UILabel *detail = [[UILabel alloc] init];
+    detail.numberOfLines = 0;
+    detail.font = [UIFont systemFontOfSize:13];
+    detail.textColor = [UIColor blackColor];
+    detail.text = @"1、申请上推荐位可在客户端有更多展示机会和更好的展示位置,获取更多商演订单和视频面试订单的经济收益。\n2、申请上推荐位视为与平台签订协议,可额外获得更多现金奖励和境外旅游奖励等。\n3、千模官方商业活动优先推荐“推荐位”的模特参与。\n\n要求及奖励:\n1、每天在线不得低于60分钟或每月累计在线不低于30小时。\n2、每月更新动态不低于15天(次),接听率不低于65%。\n3、月收入超过10000元,额外奖励1000元。\n4、申请上推荐审核后,如时长及接单率未达到标注,平台扣款100元。\n5、每次申请上推荐位的协议周期为一个月,以自然月整月为准,可续签。";
+    [content addSubview:detail];
+    [detail mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.equalTo(content).offset(15);
+        make.right.equalTo(content).offset(-15);
+        make.top.equalTo(title.mas_bottom).offset(20);
+    }];
+
+    UIButton *confirmBtn = [[UIButton alloc] init];
+    [confirmBtn setTitle:@"确认申请" forState:UIControlStateNormal];
+    [confirmBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
+    confirmBtn.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
+    confirmBtn.layer.backgroundColor = [UIColor colorWithRed:255 / 255.0 green:64 / 255.0 blue:149 / 255.0 alpha:1].CGColor;
+    confirmBtn.layer.cornerRadius = 20;
+    confirmBtn.layer.shadowColor = [UIColor colorWithRed:255 / 255.0 green:64 / 255.0 blue:149 / 255.0 alpha:0.36].CGColor;
+    confirmBtn.layer.shadowOffset = CGSizeMake(0, 8);
+    confirmBtn.layer.shadowOpacity = 1;
+    confirmBtn.layer.shadowRadius = 10;
+    [content addSubview:confirmBtn];
+    [confirmBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.width.mas_equalTo(180);
+        make.height.mas_equalTo(40);
+        make.centerX.equalTo(content);
+        make.bottom.equalTo(content).offset(-55);
+    }];
+    [confirmBtn addTarget:self action:@selector(confirm) forControlEvents:UIControlEventTouchUpInside];
+
+    UIButton *cancel = [[UIButton alloc] init];
+    [cancel setTitle:@"取消" forState:UIControlStateNormal];
+    cancel.titleLabel.font = [UIFont systemFontOfSize:14];
+    [cancel setTitleColor:[UIColor colorWithHexString:@"333333"] forState:UIControlStateNormal];
+    [content addSubview:cancel];
+    [cancel mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.centerX.equalTo(content);
+        make.bottom.equalTo(content).offset(-20);
+        make.height.mas_equalTo(20);
+    }];
+    [cancel addTarget:self action:@selector(dismiss) forControlEvents:UIControlEventTouchUpInside];
+}
+
+- (void)show {
+    [UIView animateWithDuration:0.25
+                          delay:0
+                        options:UIViewAnimationOptionCurveEaseOut
+                     animations:^{
+                         self.mask.backgroundColor = [UIColor colorWithHexString:@"#000000" alpha:0.5];
+                         self.content.transform = CGAffineTransformMakeScale(1, 1);
+                         self.content.alpha = 1;
+                     }
+                     completion:^(BOOL finished) {
+
+                     }];
+}
+
+- (void)dismiss {
+    [UIView animateWithDuration:0.25
+                          delay:0
+                        options:UIViewAnimationOptionCurveEaseOut
+                     animations:^{
+                         self.mask.backgroundColor = [UIColor clearColor];
+                         self.content.transform = CGAffineTransformMakeScale(0.3, 0.3);
+                         self.content.alpha = 0;
+                     }
+                     completion:^(BOOL finished) {
+                         [self removeFromSuperview];
+                     }];
+}
+
+- (void)confirm {
+    [self dismiss];
+    if (self.confirmBlock) {
+        self.confirmBlock();
+    }
+}
+
++ (void)showIntoView:(UIView *)view confirm:(void (^)(void))confirmBlock {
+    ApplyRecommendView *recView = [[ApplyRecommendView alloc] init];
+    recView.confirmBlock = confirmBlock;
+    [view addSubview:recView];
+    [recView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.edges.equalTo(view);
+    }];
+    [recView show];
+}
+@end

+ 17 - 0
model/Classes/Controllers/Controller/MyProfileVC/HobbyViewController.h

@@ -0,0 +1,17 @@
+//
+//  HobbyViewController.h
+//  model
+//
+//  Created by Drew on 2018/11/6.
+//  Copyright © 2018 Mine. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface HobbyViewController : ModelBaseViewController
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 188 - 0
model/Classes/Controllers/Controller/MyProfileVC/HobbyViewController.m

@@ -0,0 +1,188 @@
+//
+//  HobbyViewController.m
+//  model
+//
+//  Created by Drew on 2018/11/6.
+//  Copyright © 2018 Mine. All rights reserved.
+//
+
+#import "HobbyViewController.h"
+#import "TagCollectionViewCell.h"
+#import <TTGTagCollectionView/TTGTagCollectionView.h>
+
+@interface HobbyViewController () <TTGTagCollectionViewDelegate, TTGTagCollectionViewDataSource>
+
+@property(nonatomic, strong) UILabel *infoLabel;
+@property(nonatomic, strong) TTGTagCollectionView *listTagView;
+@property(nonatomic, strong) NSMutableArray *dataSource;
+@property(strong, nonatomic) NSMutableArray <UIView *> *tagViews;
+@property(nonatomic, strong) NSMutableArray *selectTag;
+
+@end
+
+@implementation HobbyViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    [self configUI];
+}
+
+- (void)configUI {
+    self.view.backgroundColor = RGBValueColor(0xf7f7f7, 1.0);
+    self.title = @"兴趣爱好";
+    self.navigationController.navigationBar.tintColor = RGBValueColor(0x333333, 1);
+    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"保存" style:UIBarButtonItemStylePlain target:self action:@selector(handleSave)];
+    self.infoLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 20, ScreenWidth - 40, 20)];
+    self.infoLabel.font = [UIFont systemFontOfSize:14];
+    self.infoLabel.text = @"选择你的兴趣爱好(至多选6个)";
+    self.infoLabel.textColor = RGBValueColor(0x666666, 1);
+    [self.view addSubview:self.infoLabel];
+
+    self.listTagView = [[TTGTagCollectionView alloc] initWithFrame:CGRectMake(20, 60, ScreenWidth - 40, ScreenHeight - 60)];
+    self.listTagView.delegate = self;
+    self.listTagView.dataSource = self;
+    self.listTagView.verticalSpacing = 10;
+    self.listTagView.horizontalSpacing = 15;
+    [self.view addSubview:self.listTagView];
+    _tagViews = [NSMutableArray new];
+    NSArray *hobbyArray = @[@"网球", @"高尔夫球", @"桌球", @"滑板", @"跑步", @"瑜伽", @"游泳", @"健身", @"篮球", @"足球",
+            @"机车", @"看电影", @"话剧", @"逛街", @"葡萄酒", @"美食", @"蹦迪", @"唱歌", @"跳舞", @"宅女"];
+    [self.dataSource addObjectsFromArray:hobbyArray];
+    for (NSString *hobby in  hobbyArray) {
+        [_tagViews addObject:[self newButtonWithTitle:hobby]];
+    }
+    [self.listTagView reload];
+}
+
+#pragma mark - TTGTagCollectionViewDelegate
+
+- (CGSize)tagCollectionView:(TTGTagCollectionView *)tagCollectionView sizeForTagAtIndex:(NSUInteger)index {
+
+    return _tagViews[index].frame.size;
+}
+
+- (void)tagCollectionView:(TTGTagCollectionView *)tagCollectionView didSelectTag:(UIView *)tagView atIndex:(NSUInteger)index {
+
+}
+
+- (BOOL)tagCollectionView:(TTGTagCollectionView *)tagCollectionView shouldSelectTag:(UIView *)tagView atIndex:(NSUInteger)index {
+    return YES;
+}
+
+#pragma mark - TTGTagCollectionViewDataSource
+
+- (NSUInteger)numberOfTagsInTagCollectionView:(TTGTagCollectionView *)tagCollectionView {
+
+    return _tagViews.count;
+}
+
+- (UIView *)tagCollectionView:(TTGTagCollectionView *)tagCollectionView tagViewForIndex:(NSUInteger)index {
+
+    return _tagViews[index];
+}
+
+#pragma mark - Private methods
+
+- (UIButton *)newButtonWithTitle:(NSString *)title {
+    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
+    UIColor *selectColor = [self randomColors][arc4random() % 12];
+    button.titleLabel.font = [UIFont systemFontOfSize:14];
+    [button setTitle:title forState:UIControlStateNormal];
+    [button sizeToFit];
+    button.layer.masksToBounds = YES;
+    button.layer.cornerRadius = 15.0f;
+    [button setTitleColor:selectColor forState:UIControlStateNormal];
+    [button setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected];
+    button.layer.borderWidth = 1.f;
+    button.layer.borderColor = selectColor.CGColor;
+    [self expandSizeForView:button extraWidth:15 extraHeight:4];
+    [button addTarget:self action:@selector(onTap:) forControlEvents:UIControlEventTouchUpInside];
+    return button;
+}
+
+- (void)expandSizeForView:(UIView *)view extraWidth:(CGFloat)extraWidth extraHeight:(CGFloat)extraHeight {
+    CGRect frame = view.frame;
+    frame.size.width += extraWidth;
+    frame.size.height += extraHeight;
+    view.frame = frame;
+}
+
+- (void)onTap:(UIButton *)sender {
+    if (!sender.selected && self.selectTag.count == 6) {
+        [MBProgressHUD showOnlyText:@"最多选择6个"];
+    } else {
+        sender.selected = !sender.selected;
+        NSString *hobby = self.dataSource[[self.tagViews indexOfObject:sender]];
+
+        if (sender.selected) {
+            sender.backgroundColor = sender.titleLabel.textColor;
+            [self.selectTag addObject:hobby];
+        } else {
+            sender.backgroundColor = [UIColor whiteColor];
+            [self.selectTag removeObject:hobby];
+        }
+    }
+}
+
+- (void)handleSave {
+    if (self.selectTag.count == 0) {
+        [MBProgressHUD showOnlyText:@"最少选择一个"];
+        return;
+    }
+    [YanCNetWorkManager requestPostWithURLStr:Url_updateModelCard(PublicUrl)
+                                   parameters:@{@"modelpk": [ModelUser user].modelpk, @"hobby": [self.selectTag componentsJoinedByString:@" "]}
+                                       finish:^(id dataDic) {
+                                           if ([dataDic[@"msg"] isEqualToString:@"success"]) {
+                                               [self.navigationController popViewControllerAnimated:YES];
+                                           }
+                                       }
+                                      enError:^(NSError *error) {
+
+                                      }];
+}
+
+- (NSMutableArray *)dataSource {
+    if (!_dataSource) {
+        _dataSource = [NSMutableArray array];
+    }
+    return _dataSource;
+}
+
+- (NSMutableArray *)selectTag {
+    if (!_selectTag) {
+        _selectTag = [NSMutableArray array];
+    }
+    return _selectTag;
+}
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+
+/*
+ Text自适应
+ */
+- (CGFloat)calculateSizeWithFont:(NSInteger)Font Text:(NSString *)Text {
+    NSDictionary *attr = @{NSFontAttributeName: [UIFont systemFontOfSize:Font]};
+    CGRect rect = [Text boundingRectWithSize:CGSizeMake(MAXFLOAT, 20)
+                                     options:NSStringDrawingUsesLineFragmentOrigin
+                                  attributes:attr
+                                     context:nil];
+    return rect.size.width;
+}
+
+- (NSArray *)randomColors {
+    return @[RGBValueColor(0xfc7d77, 1), RGBValueColor(0x25e6b9, 1), RGBValueColor(0xd2adfb, 1), RGBValueColor(0xff9dbc, 1), RGBValueColor(0xff6b9e, 1), RGBValueColor(0x5cdee0, 1), RGBValueColor(0xf29a76, 1), RGBValueColor(0x49c9f0, 1), RGBValueColor(0xef87b4, 1), RGBValueColor(0xb3d465, 1), RGBValueColor(0xf8b551, 1), RGBValueColor(0xf80c269, 1)];
+}
+/*
+#pragma mark - Navigation
+
+// In a storyboard-based application, you will often want to do a little preparation before navigation
+- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
+    // Get the new view controller using [segue destinationViewController].
+    // Pass the selected object to the new view controller.
+}
+*/
+
+@end

+ 127 - 52
model/Classes/Controllers/Controller/MyProfileVC/InfoEditViewController.m

@@ -10,7 +10,8 @@
 
 @interface InfoEditViewController ()
 
-@property (nonatomic, strong) UITextField *infoTextField;
+@property(nonatomic, strong) UITextField *infoTextField;
+@property(nonatomic, strong) UIButton *btnAgree;
 
 @end
 
@@ -18,62 +19,148 @@
 
 - (void)viewDidLoad {
     [super viewDidLoad];
+
+    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
+    btn.frame = CGRectMake(0, 0, 40, 40);
+    [btn setImage:[UIImage imageNamed:@"fanhui2"] forState:UIControlStateNormal];
+    btn.imageEdgeInsets = UIEdgeInsetsMake(0, -20, 0, 0);
+    [btn addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
+    UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
+    UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
+    self.navigationItem.leftBarButtonItems = @[nagetiveSpacer, leftItem];
+
     [self configUI];
-    // Do any additional setup after loading the view.
+}
+
+- (void)viewWillAppear:(BOOL)animated {
+    [super viewWillAppear:animated];
+    [self.navigationController setNavigationBarHidden:NO animated:YES];
 }
 
 - (void)configUI {
-    
-    self.view.backgroundColor = RGBValueColor(0xf7f7f7, 1.0);
-    self.navigationController.navigationBar.tintColor = RGBValueColor(0x333333, 1);
-    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"保存" style:UIBarButtonItemStylePlain target:self action:@selector(handleSave)];
-    
-    self.infoTextField = [[UITextField alloc] initWithFrame:CGRectMake(0, 10, ScreenWidth, 40)];
-    self.infoTextField.leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 20, 40)];
-    self.infoTextField.leftViewMode = UITextFieldViewModeAlways;
+    self.view.backgroundColor = [UIColor colorWithHexString:@"#F2F4F5"];
+    self.navigationController.navigationBar.tintColor = [UIColor colorWithHexString:@"#F2F4F5"];
+    UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithTitle:@"保存" style:UIBarButtonItemStylePlain target:self action:@selector(handleSave)];
+    rightItem.tintColor = [UIColor blackColor];
+    self.navigationItem.rightBarButtonItem = rightItem;
+    UIView *container = [[UIView alloc] initWithFrame:CGRectMake(20, 10, ScreenWidth - 40, 60)];
+    container.layer.cornerRadius = 8;
+    container.clipsToBounds = YES;
+    container.backgroundColor = [UIColor whiteColor];
+    [self.view addSubview:container];
+
+    self.infoTextField = [[UITextField alloc] init];
     self.infoTextField.backgroundColor = [UIColor whiteColor];
-    [self.view addSubview:self.infoTextField];
-    
+    [container addSubview:self.infoTextField];
+    [self.infoTextField mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.centerY.equalTo(container);
+        make.height.equalTo(container);
+        make.leftMargin.equalTo(container).offset(15);
+        make.rightMargin.equalTo(container).offset(-15);
+    }];
+
     switch (_editType) {
         case InfoEditTypeName:
             self.title = @"用户名";
             self.infoTextField.placeholder = @"请输入用户名";
             self.infoTextField.text = [ModelUser modelUser].pet;
             break;
-            
         case InfoEditTypeAge:
             self.title = @"年龄";
             self.infoTextField.placeholder = @"请输入年龄";
             self.infoTextField.text = [ModelUser modelUser].age;
             self.infoTextField.keyboardType = UIKeyboardTypeNumberPad;
             break;
-            
         case InfoEditTypeHeight:
             self.title = @"身高";
             self.infoTextField.placeholder = @"请输入身高(cm)";
             self.infoTextField.text = [ModelUser modelUser].hei;
             self.infoTextField.keyboardType = UIKeyboardTypeDecimalPad;
             break;
-            
         case InfoEditTypeWeight:
             self.title = @"体重";
             self.infoTextField.placeholder = @"请输入体重(kg)";
             self.infoTextField.text = [ModelUser modelUser].wei;
             self.infoTextField.keyboardType = UIKeyboardTypeDecimalPad;
             break;
-            
         case InfoEditTypeSigature:
             self.title = @"个性签名";
             self.infoTextField.text = [ModelUser modelUser].lname;
             self.infoTextField.placeholder = @"请输入个性签名";
             break;
-            
-        case InfoEditTypeVprice:
+        case InfoEditTypeVprice: {
             self.title = @"视频单价";
             self.infoTextField.text = [ModelUser modelUser].vprice;
             self.infoTextField.placeholder = @"请输入视频单价(6--49)元";
             self.infoTextField.keyboardType = UIKeyboardTypeNumberPad;
+
+            UILabel *yuan = [[UILabel alloc] init];
+            yuan.textAlignment = NSTextAlignmentCenter;
+            yuan.text = @"元";
+            yuan.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
+            yuan.textColor = [UIColor blackColor];
+            [container addSubview:yuan];
+            [yuan mas_makeConstraints:^(MASConstraintMaker *make) {
+                make.centerY.equalTo(container);
+                make.rightMargin.equalTo(container);
+                make.height.equalTo(container);
+                make.width.mas_equalTo(60);
+            }];
+
+            UIView *border = [[UIView alloc] init];
+            border.backgroundColor = [UIColor colorWithHexString:@"#F2F4F5"];
+            [container addSubview:border];
+            [border mas_makeConstraints:^(MASConstraintMaker *make) {
+                make.height.equalTo(container);
+                make.centerY.equalTo(container);
+                make.width.mas_equalTo(1);
+                make.rightMargin.equalTo(container).offset(-60);
+            }];
+
+            UILabel *remark1 = [[UILabel alloc] init];
+            remark1.numberOfLines = 0;
+            remark1.text = @"1.面试视频定价区间为6元—49元每分钟,可自行定价;\n2.面试视频定价以个人获得荣誉为参考依据,荣誉越多,可适当提高视频定价;\n3.面试视频的收益,模特本人可提现的比例为定价金额的50%;";
+            remark1.font = [UIFont systemFontOfSize:13];
+            remark1.textColor = [UIColor blackColor];
+            [self.view addSubview:remark1];
+            [remark1 mas_makeConstraints:^(MASConstraintMaker *make) {
+                make.left.equalTo(self.view).offset(20);
+                make.right.equalTo(self.view.mas_right).offset(-20);
+                make.top.equalTo(container.mas_bottom).offset(15);
+            }];
+
+            UILabel *remark2 = [[UILabel alloc] init];
+            remark2.numberOfLines = 0;
+            remark2.text = @"说明:\n1.面试视频采用收费模式,为避免或降低用户对模特的打扰;\n2.面试视频是增加模特收益的一种形式。";
+            remark2.font = [UIFont systemFontOfSize:13];
+            remark2.textColor = [UIColor colorWithHexString:@"#808080"];
+            [self.view addSubview:remark2];
+            [remark2 mas_makeConstraints:^(MASConstraintMaker *make) {
+                make.left.equalTo(self.view).offset(20);
+                make.right.equalTo(self.view.mas_right).offset(-20);
+                make.top.equalTo(remark1.mas_bottom).offset(8);
+            }];
+
+            UIButton *btnAgree = [[UIButton alloc] init];
+            [btnAgree setImage:[UIImage imageNamed:@"btn_allow"] forState:UIControlStateNormal];
+            [btnAgree setImage:[UIImage imageNamed:@"btn_allow_check"] forState:UIControlStateSelected];
+            [btnAgree setTitle:@"我已知晓并同意" forState:UIControlStateNormal];
+            [btnAgree setTitleColor:[UIColor colorWithHexString:@"#FF4095"] forState:UIControlStateNormal];
+            btnAgree.titleLabel.font = [UIFont systemFontOfSize:13];
+            btnAgree.imageEdgeInsets = UIEdgeInsetsMake(0, -5, 0, 0);
+            btnAgree.titleEdgeInsets = UIEdgeInsetsMake(0, 0, 0, -5);
+            [btnAgree addTarget:self action:@selector(allow:) forControlEvents:UIControlEventTouchUpInside];
+            [self.view addSubview:btnAgree];
+            [btnAgree mas_makeConstraints:^(MASConstraintMaker *make) {
+                make.width.mas_equalTo(124);
+                make.height.mas_equalTo(20);
+                make.top.equalTo(remark2.mas_bottom).offset(15);
+                make.left.equalTo(self.view).offset(20);
+            }];
+            self.btnAgree = btnAgree;
+
             break;
+        }
         case InfoEditTypeHobby:
             self.title = @"兴趣爱好";
             self.infoTextField.text = [ModelUser modelUser].hobby;
@@ -99,22 +186,25 @@
     }
 }
 
-- (void)handleSave{
-    
+- (void)allow:(UIButton *)button {
+    button.selected = !button.selected;
+}
+
+- (void)handleSave {
     if (self.infoTextField.text.length != 0) {
         [self.infoTextField resignFirstResponder];
-        
         if (_editType == InfoEditTypeVprice) {
             NSInteger price = [self.infoTextField.text integerValue];
-            
             if (price < 6 || price > 49) {
                 [MBProgressHUD showOnlyText:@"视频单价不能小于6元或大于49元" controller:self];
                 return;
             }
         }
-        
+        if (self.editType == InfoEditTypeVprice && !self.btnAgree.isSelected) {
+            [MBProgressHUD showOnlyText:@"请选择同意" controller:self];
+            return;
+        }
         [self handleInfo:self.infoTextField.text];
-
     }
 }
 
@@ -130,10 +220,10 @@
         case InfoEditTypeHeight:
             paramterKey = @"hei";
             break;
-         case InfoEditTypeWeight:
+        case InfoEditTypeWeight:
             paramterKey = @"wei";
             break;
-         case InfoEditTypeSigature:
+        case InfoEditTypeSigature:
             paramterKey = @"lname";
             break;
         case InfoEditTypeVprice:
@@ -156,36 +246,21 @@
     }
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
 
-    [YanCNetWorkManager requestPostWithURLStr:Url_updateModelCard(PublicUrl) parameters:@{paramterKey:info,@"modelpk":[ModelUser user].modelpk} finish:^(id dataDic) {
-        
-        [MBProgressHUD hideHUDForView:self.view animated:YES];
-        if (self.complete) {
-            self.complete(info);
-        }
-        [self.navigationController popViewControllerAnimated:YES];
-    } enError:^(NSError *error) {
-        
-    }];
+    [YanCNetWorkManager requestPostWithURLStr:Url_updateModelCard(PublicUrl)
+                                   parameters:@{paramterKey: info, @"modelpk": [ModelUser user].modelpk}
+                                       finish:^(id dataDic) {
+                                           [MBProgressHUD hideHUDForView:self.view animated:YES];
+                                           if (self.complete) {
+                                               self.complete(info);
+                                           }
+                                           [self.navigationController popViewControllerAnimated:YES];
+                                       }
+                                      enError:^(NSError *error) {
+                                      }];
 }
 
 - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
     [super touchesBegan:touches withEvent:event];
     [self.infoTextField resignFirstResponder];
 }
-
-- (void)didReceiveMemoryWarning {
-    [super didReceiveMemoryWarning];
-    // Dispose of any resources that can be recreated.
-}
-
-/*
-#pragma mark - Navigation
-
-// In a storyboard-based application, you will often want to do a little preparation before navigation
-- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
-    // Get the new view controller using [segue destinationViewController].
-    // Pass the selected object to the new view controller.
-}
-*/
-
 @end

+ 161 - 130
model/Classes/Controllers/Controller/MyProfileVC/ModelCardController.m

@@ -15,32 +15,35 @@
 #import <BRPickerView.h>
 #import "MySkillsController.h"
 #import "ShareCardController.h"
+#import "HobbyViewController.h"
 
-@interface ModelCardController ()<UITableViewDelegate, UITableViewDataSource, UITextFieldDelegate> {
+@interface ModelCardController () <UITableViewDelegate, UITableViewDataSource, UITextFieldDelegate> {
     ModelUser *tempUser;
 }
 
-@property (nonatomic, strong) UITableView *tableView;
-@property (nonatomic, strong) NSArray *titlesArr;
-@property (nonatomic, strong) NSArray *conentArr;
-
-@property (nonatomic, strong) UITableViewCell *nameCell;
-@property (nonatomic, strong) UITableViewCell *ageCell;
-@property (nonatomic, strong) UITableViewCell *heiCell;
-@property (nonatomic, strong) UITableViewCell *weiCell;
-@property (nonatomic, strong) UITableViewCell *waiBustHipCell; // 三围
-@property (nonatomic, strong) UITableViewCell *photoCell;
-@property (nonatomic, strong) UITableViewCell *areaCell; //地区(int类型,可空)
-@property (nonatomic, strong) UITableViewCell *occupationCell; //职业
-@property (nonatomic, strong) UITableViewCell *spdjCell;//视频单价
-@property (nonatomic, strong) UITableViewCell *fgbqCell;//风格标签
-@property (nonatomic, strong) UITableViewCell *lnameCell; //个性签名
-@property (nonatomic, strong) UITableViewCell *wdryCell; // 我的荣誉
-@property (nonatomic, strong) UITableViewCell *constellationCell; // 星座
-@property (nonatomic, strong) UITableViewCell *collegeCell; // 学校
-@property (nonatomic, strong) UITableViewCell *hobbyCell; // 爱好
-
-@property (nonatomic, strong) NSMutableArray *areaArray;
+@property(nonatomic, strong) UITableView *tableView;
+@property(nonatomic, strong) NSArray *titlesArr;
+@property(nonatomic, strong) NSArray *conentArr;
+
+@property(nonatomic, strong) UITableViewCell *nameCell;
+@property(nonatomic, strong) UITableViewCell *ageCell;
+@property(nonatomic, strong) UITableViewCell *heiCell;
+@property(nonatomic, strong) UITableViewCell *weiCell;
+@property(nonatomic, strong) UITableViewCell *waiBustHipCell; // 三围
+@property(nonatomic, strong) UITableViewCell *photoCell;
+@property(nonatomic, strong) UITableViewCell *areaCell; //地区(int类型,可空)
+@property(nonatomic, strong) UITableViewCell *occupationCell; //职业
+@property(nonatomic, strong) UITableViewCell *spdjCell;//视频单价
+@property(nonatomic, strong) UITableViewCell *fgbqCell;//风格标签
+@property(nonatomic, strong) UITableViewCell *lnameCell; //个性签名
+@property(nonatomic, strong) UITableViewCell *wdryCell; // 我的荣誉
+@property(nonatomic, strong) UITableViewCell *constellationCell; // 星座
+@property(nonatomic, strong) UITableViewCell *collegeCell; // 学校
+@property(nonatomic, strong) UITableViewCell *hobbyCell; // 爱好
+
+@property(nonatomic, strong) NSMutableArray *areaArray;
+@property(nonatomic, strong) NSArray *jobArray;
+@property(nonatomic, strong) NSArray *constellationArray;
 
 @end
 
@@ -48,35 +51,35 @@
 
 - (void)viewDidLoad {
     [super viewDidLoad];
-    
+
     self.title = @"模卡资料";
-    UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom];
+    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
     btn.frame = CGRectMake(0, 0, 40, 40);
     [btn setImage:[UIImage imageNamed:@"fanhui2"] forState:UIControlStateNormal];
-    btn.imageEdgeInsets =  UIEdgeInsetsMake(0, -20, 0, 0);
+    btn.imageEdgeInsets = UIEdgeInsetsMake(0, -20, 0, 0);
     [btn addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
     UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
-    UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
+    UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
     self.navigationItem.leftBarButtonItems = @[nagetiveSpacer, leftItem];
-    
+
     self.titlesArr = @[@[@"照片"],
-                       @[@"姓名"],
-                       @[@"个性签名"],
-                       @[@"视频单价"],
-                       @[@"身高",@"体重",@"三围",@"地区",@"年龄",@"职业",@"星座",@"毕业院校",@"兴趣爱好"],
-                       @[@"我的标签"],
-                       @[@"我的荣誉"]];
+            @[@"姓名"],
+            @[@"个性签名"],
+            @[@"视频单价"],
+            @[@"身高", @"体重", @"三围", @"地区", @"年龄", @"职业", @"星座", @"毕业院校", @"兴趣爱好"],
+            @[@"我的标签"],
+            @[@"我的荣誉"]];
     self.conentArr = @[@[@""],
-                       @[@""],
-                       @[@""],
-                       @[@""],
-                       @[@"",@"",@"",@"",@"",@"",@"",@"",@""],
-                       @[@""],
-                       @[@""]];
-    
+            @[@""],
+            @[@""],
+            @[@""],
+            @[@"", @"", @"", @"", @"", @"", @"", @"", @""],
+            @[@""],
+            @[@""]];
     self.areaArray = [NSMutableArray array];
+    self.jobArray = @[@"空姐", @"职业模特", @"白领", @"演员", @"护士", @"学生", @"老师", @"品酒师", @"其他"];
+    self.constellationArray = @[@"水瓶座", @"双鱼座", @"白羊座", @"金牛座", @"双子座", @"巨蟹座", @"狮子座", @"处女座", @"天秤座", @"天蝎座", @"射手座", @"魔蝎座"];
 
-    
     UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 10)];
     headerView.backgroundColor = RGBValueColor(0xf7f7f7, 1.0);
     //
@@ -84,11 +87,11 @@
     footerView.backgroundColor = RGBValueColor(0xf7f7f7, 1.0);
     UIButton *bindingBtn = [UIButton buttonWithType:UIButtonTypeCustom];
     bindingBtn.frame = CGRectMake(20, 39, ScreenWidth - 40, 44);
-    
-    bindingBtn.layer.backgroundColor = [UIColor colorWithRed:255/255.0 green:64/255.0 blue:149/255.0 alpha:1].CGColor;
+
+    bindingBtn.layer.backgroundColor = [UIColor colorWithRed:255 / 255.0 green:64 / 255.0 blue:149 / 255.0 alpha:1].CGColor;
     bindingBtn.layer.cornerRadius = 22;
-    bindingBtn.layer.shadowColor = [UIColor colorWithRed:255/255.0 green:64/255.0 blue:149/255.0 alpha:0.36].CGColor;
-    bindingBtn.layer.shadowOffset = CGSizeMake(0,8);
+    bindingBtn.layer.shadowColor = [UIColor colorWithRed:255 / 255.0 green:64 / 255.0 blue:149 / 255.0 alpha:0.36].CGColor;
+    bindingBtn.layer.shadowOffset = CGSizeMake(0, 8);
     bindingBtn.layer.shadowOpacity = 1;
     bindingBtn.layer.shadowRadius = 10;
     if ([@"init" isEqualToString:self.type]) {
@@ -100,7 +103,7 @@
     [bindingBtn setTitleColor:RGBValueColor(0xffffff, 1.0) forState:UIControlStateNormal];
     [bindingBtn addTarget:self action:@selector(bindingBtnAction) forControlEvents:UIControlEventTouchUpInside];
     [footerView addSubview:bindingBtn];
-    
+
     self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight) style:UITableViewStylePlain];
     //    self.tableView.scrollEnabled = NO;
     self.tableView.backgroundColor = RGBValueColor(0xf7f7f7, 1.0);
@@ -111,21 +114,14 @@
     self.tableView.tableHeaderView = headerView;
     self.tableView.tableFooterView = footerView;
     [self.view addSubview:self.tableView];
-    self.view.backgroundColor = [UIColor colorWithRed:242/255.0 green:244/255.0 blue:245/255.0 alpha:1];
+    self.view.backgroundColor = [UIColor colorWithRed:242 / 255.0 green:244 / 255.0 blue:245 / 255.0 alpha:1];
     [self getAreaData];
 }
 
 - (void)viewWillAppear:(BOOL)animated {
     [super viewWillAppear:animated];
+    [self.navigationController setNavigationBarHidden:NO animated:YES];
     [self getModelData];
-//    [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
-//    [self.navigationController.navigationBar setShadowImage:[UIImage new]];
-}
-
-- (void)viewWillDisappear:(BOOL)animated {
-    [super viewWillDisappear:animated];
-//    [self.navigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
-//    [self.navigationController.navigationBar setShadowImage:nil];
 }
 
 - (void)didReceiveMemoryWarning {
@@ -137,18 +133,18 @@
     [YanCNetWorkManager requestGETWithURLStr:Url_getArea(PublicUrl) parameters:@{} finish:^(id dataDic) {
         [self.areaArray addObjectsFromArray:dataDic[@"data"]];
         [self.tableView reloadData];
-    } enError:^(NSError *error) {
-        
+    }                                enError:^(NSError *error) {
+
     }];
 }
 
 - (void)getModelData {
-    [YanCNetWorkManager requestGETWithURLStr:Url_getModelData(PublicUrl) parameters:@{@"modelpk":[ModelUser user].modelpk} finish:^(id dataDic) {
+    [YanCNetWorkManager requestGETWithURLStr:Url_getModelData(PublicUrl) parameters:@{@"modelpk": [ModelUser user].modelpk} finish:^(id dataDic) {
         [[ModelUser modelUser] setValuesForKeysWithDictionary:[dataDic[@"data"] firstObject]];
         tempUser = [ModelUser mj_objectWithKeyValues:[dataDic[@"data"] firstObject]];
         [self.tableView reloadData];
-    } enError:^(NSError *error) {
-        
+    }                                enError:^(NSError *error) {
+
     }];
 }
 
@@ -157,19 +153,20 @@
 }
 
 #pragma mark -- UITableViewDelegate, UITableViewDataSource
--(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
+
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
     return self.titlesArr.count;
 }
 
 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
-    return ((NSDictionary*)self.titlesArr[section]).count;
+    return ((NSDictionary *) self.titlesArr[section]).count;
 }
 
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
-    static NSString *reuseIdentifier=@"cellID";
+    static NSString *reuseIdentifier = @"cellID";
     UITableViewCell *modelCell = [tableView dequeueReusableCellWithIdentifier:reuseIdentifier];
     if (modelCell == nil) {
-        modelCell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:reuseIdentifier];
+        modelCell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:reuseIdentifier];
     }
     modelCell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
     modelCell.selectionStyle = UITableViewCellSelectionStyleNone;
@@ -178,11 +175,11 @@
     modelCell.textLabel.font = [UIFont systemFontOfSize:14.0];
     modelCell.detailTextLabel.font = [UIFont systemFontOfSize:14.0];
     modelCell.textLabel.text = self.titlesArr[indexPath.section][indexPath.row];
-    
+
     NSString *rowTitle = self.titlesArr[indexPath.section][indexPath.row];
     if ([@"照片" isEqualToString:rowTitle]) {
         self.photoCell = modelCell;
-        modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@张照片",tempUser.photocount];
+        modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@张照片", tempUser.photocount];
     } else if ([@"姓名" isEqualToString:rowTitle]) {
         self.nameCell = modelCell;
         modelCell.detailTextLabel.text = tempUser.pet;
@@ -191,16 +188,16 @@
         modelCell.detailTextLabel.text = tempUser.lname;
     } else if ([@"视频单价" isEqualToString:rowTitle]) {
         self.spdjCell = modelCell;
-        modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@元/分钟",tempUser.vprice];
+        modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@元/分钟", tempUser.vprice];
     } else if ([@"身高" isEqualToString:rowTitle]) {
         self.heiCell = modelCell;
-        modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@cm",tempUser.hei];
+        modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@cm", tempUser.hei];
     } else if ([@"体重" isEqualToString:rowTitle]) {
         self.weiCell = modelCell;
-        modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@kg",tempUser.wei];
+        modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@kg", tempUser.wei];
     } else if ([@"三围" isEqualToString:rowTitle]) {
         self.waiBustHipCell = modelCell;
-        modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@/%@/%@",tempUser.bust,tempUser.wai,tempUser.hip];
+        modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@/%@/%@", tempUser.bust, tempUser.wai, tempUser.hip];
     } else if ([@"地区" isEqualToString:rowTitle]) {
         self.areaCell = modelCell;
         modelCell.detailTextLabel.text = @"";
@@ -276,7 +273,7 @@
             for (NSDictionary *dic in self.areaArray) {
                 if ([dic[@"name"] isEqualToString:selectValue]) {
                     [YanCNetWorkManager requestPostWithURLStr:Url_updateModelCard(PublicUrl)
-                                                   parameters:@{@"area":dic[@"pk"],@"modelpk":[ModelUser user].modelpk}
+                                                   parameters:@{@"area": dic[@"pk"], @"modelpk": [ModelUser user].modelpk}
                                                        finish:^(id dataDic) {
                                                            if ([dataDic[@"msg"] isEqualToString:@"success"]) {
                                                                [MBProgressHUD showSuccess:@"修改成功"];
@@ -284,10 +281,10 @@
                                                            } else {
                                                                [MBProgressHUD showError:@"修改失败"];
                                                            }
-                                                           
+
                                                        }
                                                       enError:^(NSError *error) {
-                                                          
+
                                                       }];
                 }
             }
@@ -297,21 +294,51 @@
         infoVc.editType = InfoEditTypeAge;
         [self.navigationController pushViewController:infoVc animated:YES];
     } else if ([@"职业" isEqualToString:rowTitle]) {
-        InfoEditViewController *infoVc = [InfoEditViewController new];
-        infoVc.editType = InfoEditTypeOccupation;
-        [self.navigationController pushViewController:infoVc animated:YES];
+        // InfoEditViewController *infoVc = [InfoEditViewController new];
+        // infoVc.editType = InfoEditTypeOccupation;
+        // [self.navigationController pushViewController:infoVc animated:YES];
+        [BRStringPickerView showStringPickerWithTitle:@"请选择职业" dataSource:self.jobArray defaultSelValue:nil resultBlock:^(id selectValue) {
+            [YanCNetWorkManager requestPostWithURLStr:Url_updateModelCard(PublicUrl)
+                                           parameters:@{@"occupation": selectValue, @"modelpk": [ModelUser user].modelpk}
+                                               finish:^(id dataDic) {
+                                                   if ([dataDic[@"msg"] isEqualToString:@"success"]) {
+                                                       [MBProgressHUD showSuccess:@"修改成功"];
+                                                       cell.detailTextLabel.text = selectValue;
+                                                   } else {
+                                                       [MBProgressHUD showError:@"修改失败"];
+                                                   }
+
+                                               }
+                                              enError:^(NSError *error) {
+
+                                              }];
+        }];
     } else if ([@"星座" isEqualToString:rowTitle]) {
-        InfoEditViewController *infoVc = [InfoEditViewController new];
-        infoVc.editType = InfoEditTypeConstellation;
-        [self.navigationController pushViewController:infoVc animated:YES];
+        // InfoEditViewController *infoVc = [InfoEditViewController new];
+        // infoVc.editType = InfoEditTypeConstellation;
+        // [self.navigationController pushViewController:infoVc animated:YES];
+        [BRStringPickerView showStringPickerWithTitle:@"请选择星座" dataSource:self.constellationArray defaultSelValue:nil resultBlock:^(id selectValue) {
+            [YanCNetWorkManager requestPostWithURLStr:Url_updateModelCard(PublicUrl)
+                                           parameters:@{@"constellation": selectValue, @"modelpk": [ModelUser user].modelpk}
+                                               finish:^(id dataDic) {
+                                                   if ([dataDic[@"msg"] isEqualToString:@"success"]) {
+                                                       [MBProgressHUD showSuccess:@"修改成功"];
+                                                       cell.detailTextLabel.text = selectValue;
+                                                   } else {
+                                                       [MBProgressHUD showError:@"修改失败"];
+                                                   }
+                                               }
+                                              enError:^(NSError *error) {
+
+                                              }];
+        }];
     } else if ([@"毕业院校" isEqualToString:rowTitle]) {
         InfoEditViewController *infoVc = [InfoEditViewController new];
         infoVc.editType = InfoEditTypeCollege;
         [self.navigationController pushViewController:infoVc animated:YES];
     } else if ([@"兴趣爱好" isEqualToString:rowTitle]) {
-        InfoEditViewController *infoVc = [InfoEditViewController new];
-        infoVc.editType = InfoEditTypeHobby;
-        [self.navigationController pushViewController:infoVc animated:YES];
+        HobbyViewController *hobbyVC = [[HobbyViewController alloc] init];
+        [self.navigationController pushViewController:hobbyVC animated:YES];
     } else if ([@"我的标签" isEqualToString:rowTitle]) {
         ModelTagViewController *tagVC = [ModelTagViewController new];
         [self.navigationController pushViewController:tagVC animated:YES];
@@ -322,57 +349,59 @@
 }
 
 #pragma mark -- 保存按钮
+
 - (void)bindingBtnAction {
-    NSLog(@"name %@", self.nameCell.textLabel.text);
-    if (self.nameCell.textLabel.text.length == 0) {
-        [MBProgressHUD showOnlyText:@"请选择填写姓名" controller:self];
+    if ([tempUser.photocount intValue] < 5) {
+        [self.view makeToast:@"请至少上传5张照片" duration:2.0 position:CSToastPositionCenter];
         return;
     }
-    NSLog(@"age %@", self.ageCell.textLabel.text);
-    if (self.ageCell.textLabel.text.length == 0) {
-        [MBProgressHUD showOnlyText:@"请选择填写年龄" controller:self];
+    if (tempUser.pet.length == 0) {
+        [self.view makeToast:@"请填写姓名" duration:2.0 position:CSToastPositionCenter];
         return;
     }
-    NSLog(@"heiCell %@", self.heiCell.textLabel.text);
-    if (self.heiCell.textLabel.text.length == 0) {
-        [MBProgressHUD showOnlyText:@"请选择填写身高" controller:self];
+    if (tempUser.lname.length == 0) {
+        [self.view makeToast:@"请填写个性签名" duration:2.0 position:CSToastPositionCenter];
         return;
     }
-    NSLog(@"体重 %@", self.weiCell.textLabel.text);
-    if (self.weiCell.textLabel.text.length == 0) {
-        [MBProgressHUD showOnlyText:@"请选择填写体重" controller:self];
+    if (tempUser.vprice.length == 0) {
+        [self.view makeToast:@"请填写视频单价" duration:2.0 position:CSToastPositionCenter];
         return;
     }
-    NSLog(@"三围 %@", self.nameCell.textLabel.text);
-    if (self.nameCell.textLabel.text.length == 0) {
-        [MBProgressHUD showOnlyText:@"请选择填写三围" controller:self];
+    if (tempUser.hei.length == 0 || [@"0" isEqualToString:tempUser.hei]) {
+        [self.view makeToast:@"请填写身高" duration:2.0 position:CSToastPositionCenter];
         return;
     }
-    NSLog(@"地区 %@", self.areaCell.textLabel.text);
-    if (self.areaCell.textLabel.text.length == 0) {
-        [MBProgressHUD showOnlyText:@"请选择填写地区" controller:self];
+    if (tempUser.wei.length == 0 || [@"0" isEqualToString:tempUser.wei]) {
+        [self.view makeToast:@"请填写体重" duration:2.0 position:CSToastPositionCenter];
         return;
     }
-    if (![[ModelUser user].modelpk isEqualToString:@"51"]) {
-        NSLog(@"视频单价 %@", self.spdjCell.textLabel.text);
-        if (self.spdjCell.textLabel.text.length == 0) {
-            [MBProgressHUD showOnlyText:@"请选择填写视频单价" controller:self];
-            return;
-        }
+    if (tempUser.bust.length == 0) {
+        [self.view makeToast:@"请填写三围" duration:2.0 position:CSToastPositionCenter];
+        return;
+    }
+    if (tempUser.area.length == 0) {
+        [self.view makeToast:@"请填写地区" duration:2.0 position:CSToastPositionCenter];
+        return;
     }
-    NSLog(@"风格标签 %@", self.fgbqCell.textLabel.text);
-    if (self.fgbqCell.textLabel.text.length == 0) {
-        [MBProgressHUD showOnlyText:@"请选择填写标签" controller:self];
+    if (tempUser.age.length == 0) {
+        [self.view makeToast:@"请填写年龄" duration:2.0 position:CSToastPositionCenter];
         return;
     }
-    NSLog(@"个人签名 %@", self.lnameCell.textLabel.text);
-    if (self.lnameCell.textLabel.text.length == 0) {
-        [MBProgressHUD showOnlyText:@"请选择填写签名" controller:self];
+    if (tempUser.occupation.length == 0) {
+        [self.view makeToast:@"请填写职业" duration:2.0 position:CSToastPositionCenter];
         return;
     }
-//    [MBProgressHUD showSuccess:@"保存成功"];
-//    [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(backClick) userInfo:nil repeats:NO];
-    
+    if (tempUser.constellation.length == 0) {
+        [self.view makeToast:@"请填写星座" duration:2.0 position:CSToastPositionCenter];
+        return;
+    }
+    if (tempUser.college.length == 0) {
+        [self.view makeToast:@"请填写毕业院校" duration:2.0 position:CSToastPositionCenter];
+        return;
+    }
+    // [MBProgressHUD showSuccess:@"保存成功"];
+    // [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(backClick) userInfo:nil repeats:NO];
+
     if ([@"init" isEqualToString:self.type]) {
         MySkillsController *mySkillsVC = [[MySkillsController alloc] init];
         [self.navigationController pushViewController:mySkillsVC animated:YES];
@@ -383,24 +412,26 @@
 }
 
 #pragma mark -- 网络请求
+
 - (void)postDataFromNetworking {
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
     ModelUser *modelUser = [ModelUser user];
-    
-    NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:modelUser.modelpk,@"modelpk",self.lnameCell.textLabel.text,@"lname", nil];
-    
-    [YanCNetWorkManager requestPostWithURLStr:Url_updateModelCard(PublicUrl) parameters:dic finish:^(id dataDic) {
-        [MBProgressHUD hideHUDForView:self.view animated:YES];
-
-        NSString *issuccess = dataDic[@"msg"];
-        if ([issuccess isEqualToString:@"success"]) {
-           [MBProgressHUD showSuccess:@"保存成功"];
-        } else {
-    
-        }
-    } enError:^(NSError *error) {
-        [MBProgressHUD hideHUDForView:self.view animated:YES];
-    }];
+    NSDictionary *dic = @{@"modelpk": modelUser.modelpk, @"lname": self.lnameCell.textLabel.text};
+    [YanCNetWorkManager requestPostWithURLStr:Url_updateModelCard(PublicUrl)
+                                   parameters:dic
+                                       finish:^(id dataDic) {
+                                           [MBProgressHUD hideHUDForView:self.view animated:YES];
+
+                                           NSString *issuccess = dataDic[@"msg"];
+                                           if ([issuccess isEqualToString:@"success"]) {
+                                               [MBProgressHUD showSuccess:@"保存成功"];
+                                           } else {
+
+                                           }
+                                       }
+                                      enError:^(NSError *error) {
+                                          [MBProgressHUD hideHUDForView:self.view animated:YES];
+                                      }];
 }
 
 @end

+ 39 - 42
model/Classes/Controllers/Controller/MyProfileVC/ModelHonorViewController.m

@@ -9,10 +9,10 @@
 #import "ModelHonorViewController.h"
 #import "HonorTableViewCell.h"
 
-@interface ModelHonorViewController ()<UITableViewDelegate,UITableViewDataSource,UITextViewDelegate>
+@interface ModelHonorViewController () <UITableViewDelegate, UITableViewDataSource, UITextViewDelegate>
 
-@property (nonatomic, strong) UITableView *listView;
-@property (nonatomic, strong) NSMutableArray *dataSource;
+@property(nonatomic, strong) UITableView *listView;
+@property(nonatomic, strong) NSMutableArray *dataSource;
 
 @end
 
@@ -26,37 +26,33 @@
 }
 
 - (void)viewDidLoad {
-    
     [super viewDidLoad];
-    
     self.view.backgroundColor = RGBValueColor(0xf7f7f7, 1.0);
     self.title = @"我的荣誉";
     self.navigationController.navigationBar.tintColor = RGBValueColor(0x333333, 1);
     self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"添加" style:UIBarButtonItemStylePlain target:self action:@selector(addHonor)];
-    
+
     [self getHonorData];
 }
 
 - (void)getHonorData {
-    [YanCNetWorkManager requestGETWithURLStr:Url_getModelHonor(PublicUrl) parameters:@{@"ModelPK":[ModelUser user].modelpk} finish:^(id dataDic) {
-
-        if ([dataDic[@"msg"] isEqualToString:@"success"]) {
-            NSArray *array = dataDic[@"data"];
-            
-            for (int i=0; i<array.count; i++) {
-                NSDictionary *dic = [array objectAtIndex:i];
-                [self.dataSource addObject:[dic objectForKey:@"honor"]];
-            }
-            
-            [self configUI];
-        }
-    } enError:^(NSError *error) {
-        
-    }];
+    [YanCNetWorkManager requestGETWithURLStr:Url_getModelHonor(PublicUrl)
+                                  parameters:@{@"ModelPK": [ModelUser user].modelpk}
+                                      finish:^(id dataDic) {
+                                          if ([dataDic[@"msg"] isEqualToString:@"success"]) {
+                                              NSArray *array = dataDic[@"data"];
+                                              for (int i = 0; i < array.count; i++) {
+                                                  NSDictionary *dic = array[i];
+                                                  [self.dataSource addObject:dic[@"honor"]];
+                                              }
+                                              [self configUI];
+                                          }
+                                      }
+                                     enError:^(NSError *error) {
+                                     }];
 }
 
 - (void)configUI {
-    
     self.listView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
     self.listView.delegate = self;
     self.listView.dataSource = self;
@@ -67,33 +63,33 @@
     [self.view addSubview:self.listView];
 }
 
--(void)addHonor{
-    
+- (void)addHonor {
+
     [self.dataSource addObject:@""];
     [self.listView reloadData];
 }
 
 - (void)handleSave {
-    
-    NSMutableArray *arr = [[NSMutableArray alloc]init];
-    
+
+    NSMutableArray *arr = [[NSMutableArray alloc] init];
+
     for (NSString *str in self.dataSource) {
         if (str.length > 0) {
-            NSDictionary *dicc = @{@"honor":str};
+            NSDictionary *dicc = @{@"honor": str};
             [arr addObject:dicc];
         }
     }
-    
+
     NSString *jsonStr = [arr mj_JSONString];
-    NSDictionary *dic = @{@"ModelPK":[ModelUser user].modelpk,@"Honor":jsonStr};
-    [YanCNetWorkManager  requestPostWithURLStr:Url_addModelHonor(PublicUrl) parameters:dic finish:^(id dataDic) {
+    NSDictionary *dic = @{@"ModelPK": [ModelUser user].modelpk, @"Honor": jsonStr};
+    [YanCNetWorkManager requestPostWithURLStr:Url_addModelHonor(PublicUrl) parameters:dic finish:^(id dataDic) {
         if ([[dataDic objectForKey:@"msg"] isEqualToString:@"success"]) {
             [MBProgressHUD showSuccess:@"保存成功"];
             [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(backClick) userInfo:nil repeats:NO];
-        }else{
+        } else {
             [MBProgressHUD showSuccess:@"保存失败"];
         }
-    } enError:^(NSError *error) {
+    }                                 enError:^(NSError *error) {
 
     }];
 }
@@ -104,7 +100,7 @@
 
 - (UIView *)footView {
     UIView *footView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 120)];
-    UIButton *saveBtn = [[UIButton alloc] initWithFrame:CGRectMake(20,  40, ScreenWidth - 40, 48)];
+    UIButton *saveBtn = [[UIButton alloc] initWithFrame:CGRectMake(20, 40, ScreenWidth - 40, 48)];
     saveBtn.layer.cornerRadius = 24.f;
     saveBtn.layer.masksToBounds = YES;
     [saveBtn setTitle:@"保存" forState:UIControlStateNormal];
@@ -115,6 +111,7 @@
 }
 
 #pragma mark -
+
 - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
     return self.dataSource.count;
 }
@@ -124,20 +121,20 @@
 }
 
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
-    
+
     static NSString *cellid = @"HonorTableViewCell";
     HonorTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellid];
 
     if (!cell) {
         cell = [[HonorTableViewCell alloc] init];
     }
-    
+
 //    HonorTableViewCell *cell = [[HonorTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"HonorTableViewCell"];
-    
+
     if (self.dataSource.count > 0) {
         cell.honorTextView.text = self.dataSource[indexPath.section];
     }
-    cell.numberLabel.text = [NSString stringWithFormat:@"%zd",cell.honorTextView.text.length];
+    cell.numberLabel.text = [NSString stringWithFormat:@"%zd", cell.honorTextView.text.length];
     cell.honorTextView.tag = indexPath.section;
     cell.honorTextView.delegate = self;
     return cell;
@@ -157,16 +154,16 @@
 }
 
 - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
-    return section == 0 ? 40.f: 10.f;
+    return section == 0 ? 40.f : 10.f;
 }
 
-- (void)textViewDidEndEditing:(UITextView *)textView{
+- (void)textViewDidEndEditing:(UITextView *)textView {
 
     [self.listView reloadData];
 }
 
-- (void)textViewDidChange:(UITextView *)textView{
-    
+- (void)textViewDidChange:(UITextView *)textView {
+
     [self.dataSource replaceObjectAtIndex:textView.tag withObject:textView.text];
 }
 

+ 159 - 115
model/Classes/Controllers/Controller/MyProfileVC/ModelPhotoViewController.m

@@ -9,23 +9,17 @@
 #import "ModelPhotoViewController.h"
 #import "PhotoCollectionViewCell.h"
 #import "PhotoModel.h"
-
-@interface ModelPhotoViewController ()<UICollectionViewDelegate, UICollectionViewDataSource, UIImagePickerControllerDelegate, UINavigationControllerDelegate>
-{
-    UIImagePickerController *pickerVc ;
+#import "Masonry.h"
+#import "UICollectionViewLeftAlignedLayout.h"
+@interface ModelPhotoViewController () <UICollectionViewDelegateFlowLayout, UICollectionViewDataSource, UIImagePickerControllerDelegate, UINavigationControllerDelegate> {
+    UIImagePickerController *pickerVc;
 }
 
-@property (nonatomic, strong) UICollectionView *photoListView;
-
-@property (nonatomic, strong) NSMutableArray *dataSource;
-
-@property (nonatomic, strong) UIButton    *saveBtn;
-
-@property (nonatomic, strong) NSMutableArray *tempUrl;
-
-@property (nonatomic, strong) NSMutableArray *updateData;
-
-@property (nonatomic, strong) NSMutableArray *deleteData;
+@property(nonatomic, strong) UICollectionView *photoListView;
+@property(nonatomic, strong) NSMutableArray *dataSource;
+@property(nonatomic, strong) NSMutableArray *tempUrl;
+@property(nonatomic, strong) NSMutableArray *updateData;
+@property(nonatomic, strong) NSMutableArray *deleteData;
 
 @end
 
@@ -66,103 +60,145 @@
 }
 
 - (void)getModelPhoto {
-    
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
-    [YanCNetWorkManager requestGETWithURLStr:Url_getModelPhoto(PublicUrl) parameters:@{@"modelpk":[ModelUser user].modelpk} finish:^(id dataDic) {
-        [MBProgressHUD hideHUDForView:self.view animated:YES];
-        
-        if ([dataDic[@"msg"] isEqualToString:@"success"]) {
-            for (NSDictionary *dic in dataDic[@"data"]) {
-                PhotoModel *model = [PhotoModel mj_objectWithKeyValues:dic];
-                [self.dataSource addObject:model];
-            }
-            [self.photoListView reloadData];
-        }
-    } enError:^(NSError *error) {
-        
-    }];
+    [YanCNetWorkManager requestGETWithURLStr:Url_getModelPhoto(PublicUrl)
+                                  parameters:@{@"modelpk": [ModelUser user].modelpk}
+                                      finish:^(id dataDic) {
+                                          [MBProgressHUD hideHUDForView:self.view animated:YES];
+                                          if ([dataDic[@"msg"] isEqualToString:@"success"]) {
+                                              for (NSDictionary *dic in dataDic[@"data"]) {
+                                                  PhotoModel *model = [PhotoModel mj_objectWithKeyValues:dic];
+                                                  [self.dataSource addObject:model];
+                                              }
+                                              [self.photoListView reloadData];
+                                          }
+                                      }
+                                     enError:^(NSError *error) {
+
+                                     }];
 }
 
 - (void)configUI {
-    self.view.backgroundColor = RGBValueColor(0xf7f7f7, 1.0);
+    self.view.backgroundColor = [UIColor colorWithHexString:@"#F2F4F5"];
     self.title = @"照片";
     self.navigationController.navigationBar.tintColor = RGBValueColor(0x333333, 1);
-    //self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"保存" style:UIBarButtonItemStylePlain target:self action:@selector(handleSave)];
-    
-    UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
-    layout.sectionInset = UIEdgeInsetsMake(20, 20, 20, 20);
-    layout.itemSize = CGSizeMake(ScreenWidth/2 - 25, ScreenWidth/2 - 25);
-    layout.minimumLineSpacing = 10;
-    layout.minimumInteritemSpacing = 10;
-    
-    self.photoListView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenWidth) collectionViewLayout:layout];
+    UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithTitle:@"保存" style:UIBarButtonItemStylePlain target:self action:@selector(handleSave)];
+    rightItem.tintColor = [UIColor blackColor];
+    self.navigationItem.rightBarButtonItem = rightItem;
+
+    UICollectionViewFlowLayout *layout = [[UICollectionViewLeftAlignedLayout alloc] init];
+
+    self.photoListView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:layout];
     self.photoListView.delegate = self;
     self.photoListView.dataSource = self;
-    self.photoListView.backgroundColor = [UIColor whiteColor];
+    self.photoListView.backgroundColor = [UIColor clearColor];
     [self.photoListView registerNib:[UINib nibWithNibName:@"PhotoCollectionViewCell" bundle:nil] forCellWithReuseIdentifier:NSStringFromClass([PhotoCollectionViewCell class])];
+    [self.photoListView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"headerView"];
     [self.view addSubview:self.photoListView];
-    
-    UILabel *deleteLabel = [[UILabel alloc]initWithFrame:CGRectMake(20, CGRectGetMaxY(self.photoListView.frame), 200, 20)];
-    deleteLabel.text = @"点击可删除照片";
-    deleteLabel.textColor = RGB(102, 102, 102);
-    deleteLabel.font = [UIFont systemFontOfSize:14];
-    [self.view addSubview:deleteLabel];
-    
-    self.saveBtn = [[UIButton alloc] initWithFrame:CGRectMake(20,CGRectGetMaxY(self.photoListView.frame) + 40, ScreenWidth - 40, 48)];
-    self.saveBtn.layer.cornerRadius = 24.f;
-    self.saveBtn.layer.masksToBounds = YES;
-    [self.saveBtn setTitle:@"保存" forState:UIControlStateNormal];
-    [self.saveBtn addTarget:self action:@selector(handleSave) forControlEvents:UIControlEventTouchUpInside];
-    [self.saveBtn setBackgroundImage:[UIImage imageNamed:@"tixian-1"] forState:UIControlStateNormal];
-    [self.view addSubview:self.saveBtn];
+    [self.photoListView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(self.view);
+        make.bottom.equalTo(self.view);
+        make.left.right.equalTo(self.view);
+    }];
 }
 
 
-
 - (void)backClick {
     [self.navigationController popViewControllerAnimated:YES];
 }
 
 #pragma mark -collectionView
+
+- (CGSize)collectionView:(UICollectionView *)collectionView
+                  layout:(UICollectionViewLayout *)collectionViewLayout
+  sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
+    if (indexPath.row == 0) {
+        return CGSizeMake(ScreenWidth - 40, ScreenWidth - 40);
+    } else {
+        return CGSizeMake((ScreenWidth - 50) / 2, (ScreenWidth - 50) / 2);
+    }
+}
+
+- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView
+                        layout:(UICollectionViewLayout *)collectionViewLayout
+        insetForSectionAtIndex:(NSInteger)section {
+    return UIEdgeInsetsMake(10, 20, 20, 20);
+}
+
+- (CGFloat)          collectionView:(UICollectionView *)collectionView
+                             layout:(UICollectionViewLayout *)collectionViewLayout
+minimumLineSpacingForSectionAtIndex:(NSInteger)section {
+    return 10;
+}
+
+- (CGFloat)               collectionView:(UICollectionView *)collectionView
+                                  layout:(UICollectionViewLayout *)collectionViewLayout
+minimumInteritemSpacingForSectionAtIndex:(NSInteger)section {
+    return 10;
+}
+
 - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
-    
-    return self.dataSource.count+1;
+    return self.dataSource.count + 1;
+}
+
+- (CGSize)       collectionView:(UICollectionView *)collectionView
+                         layout:(UICollectionViewLayout *)collectionViewLayout
+referenceSizeForHeaderInSection:(NSInteger)section {
+    return CGSizeMake(ScreenWidth, 35);
+}
+
+- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView
+           viewForSupplementaryElementOfKind:(NSString *)kind
+                                 atIndexPath:(NSIndexPath *)indexPath {
+    if (kind == UICollectionElementKindSectionHeader) {
+        UICollectionReusableView *headerView = [collectionView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:@"headerView" forIndexPath:indexPath];
+        for (UIView *view in [headerView subviews]) {
+            [view removeFromSuperview];
+        }
+        UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(20, 15, ScreenWidth - 40, 20)];
+        label.text = @"点击可删除照片(最少上传5张)";
+        label.font = [UIFont systemFontOfSize:14];
+        label.textColor = [UIColor colorWithHexString:@"#666666"];
+        [headerView addSubview:label];
+        return headerView;
+    }
+    return nil;
 }
 
 - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
-    PhotoCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([PhotoCollectionViewCell class]) forIndexPath:indexPath];
-    
+    PhotoCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([PhotoCollectionViewCell class])
+                                                                              forIndexPath:indexPath];
+    cell.layer.cornerRadius = 8;
+    cell.clipsToBounds = YES;
     if (indexPath.item < self.dataSource.count) {
         PhotoModel *model = self.dataSource[indexPath.item];
-
         if (model.localImage) {
             cell.userImageView.image = model.localImage;
         } else {
-            [cell.userImageView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/%@", PublicUrl,model.photo]]];
+            [cell.userImageView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/%@", PublicUrl, model.photo]]];
         }
-    }else{
-        cell.userImageView.image = [UIImage imageNamed:@"photo_add"];
+    } else {
+        cell.userImageView.image = nil;
     }
-    
+
     return cell;
 }
 
-- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
-{
+- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
     if (self.dataSource.count == indexPath.item) {
         if (self.dataSource.count >= 9) {
             [MBProgressHUD showSuccess:@"最多不能超过9张"];
-        }else{
+        } else {
             UIAlertController *alertVc = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
             pickerVc = [[UIImagePickerController alloc] init];
             pickerVc.allowsEditing = YES;
             pickerVc.delegate = self;
-            UIAlertAction *library = [UIAlertAction actionWithTitle:@"从相册选择" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+            UIAlertAction *library = [UIAlertAction actionWithTitle:@"从相册选择" style:UIAlertActionStyleDefault handler:^(UIAlertAction *_Nonnull action) {
                 pickerVc.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
                 [self presentViewController:pickerVc animated:YES completion:nil];
-                
+
             }];
-            UIAlertAction *camera = [UIAlertAction actionWithTitle:@"拍照" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+            UIAlertAction *camera = [UIAlertAction actionWithTitle:@"拍照" style:UIAlertActionStyleDefault handler:^(UIAlertAction *_Nonnull action) {
                 pickerVc.sourceType = UIImagePickerControllerSourceTypeCamera;
                 [self presentViewController:pickerVc animated:YES completion:nil];
             }];
@@ -172,10 +208,10 @@
             [alertVc addAction:cancel];
             [self presentViewController:alertVc animated:YES completion:nil];
         }
-    }else{
+    } else {
         UIAlertController *alertVc = [UIAlertController alertControllerWithTitle:nil message:@"是否确定删除" preferredStyle:UIAlertControllerStyleAlert];
         UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];
-        UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+        UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *_Nonnull action) {
             [self deletePhoto:indexPath.item];
         }];
         [alertVc addAction:cancelAction];
@@ -185,45 +221,53 @@
 }
 
 #pragma mark -imagePickerController
-- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info {
-    UIImage *image = [info objectForKey:@"UIImagePickerControllerEditedImage"];
+
+- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *, id> *)info {
+    UIImage *image = info[@"UIImagePickerControllerEditedImage"];
     [picker dismissViewControllerAnimated:NO completion:nil];
     PhotoModel *model = [[PhotoModel alloc] init];
     model.localImage = image;
-    
+
     NSData *photoData = UIImageJPEGRepresentation(image, 0.5);
     NSInteger length = [photoData length] / 1000;
-    
-    NSLog(@"图片大小:%ld Kb",(long)length);
-    
+
+    NSLog(@"图片大小:%ld Kb", (long) length);
+
     [self.dataSource addObject:model];
     [self.updateData addObject:image];
     [self.photoListView reloadData];
-    
+
     [self uploadImage:image];
 }
 
 
--(void)uploadImage:(UIImage *)image{
-    
+- (void)uploadImage:(UIImage *)image {
+
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
-    
-    [YanCNetWorkManager requestPostWithURLStr:Url_uploadImage(PublicUrl) fileData:image name:@"img" fileName:@"file.jpg" mimeType:@"image/jpeg" parameters:nil finish:^(id dataDic) {
-        [MBProgressHUD hideHUDForView:self.view animated:YES];
-        [self.tempUrl addObject:dataDic[@"img"]];
-        
-    } enError:^(NSError *error) {
-        [MBProgressHUD hideHUDForView:self.view animated:YES];
-    }];
-    
+    [YanCNetWorkManager requestPostWithURLStr:Url_uploadImage(PublicUrl)
+                                     fileData:image
+                                         name:@"img"
+                                     fileName:@"file.jpg"
+                                     mimeType:@"image/jpeg"
+                                   parameters:nil
+                                       finish:^(id dataDic) {
+                                           [MBProgressHUD hideHUDForView:self.view animated:YES];
+                                           [self.tempUrl addObject:dataDic[@"img"]];
+
+                                       }
+                                      enError:^(NSError *error) {
+                                          [MBProgressHUD hideHUDForView:self.view animated:YES];
+                                      }];
+
 }
 
 
 #pragma mark -
+
 - (void)handleSave {
-    
+
     [self uploadImageThroughURLs:self.tempUrl];
-    
+
 //    [MBProgressHUD showHUDAddedTo:self.view animated:YES];
 //    dispatch_group_t group = dispatch_group_create();
 //
@@ -250,54 +294,54 @@
 //    });
 }
 
--(void)uploadImageThroughURLs:(NSMutableArray *)urls{
-    
+- (void)uploadImageThroughURLs:(NSMutableArray *)urls {
+
     NSString *urlStr = @"";
-    
+
     if (urls.count > 0) {
         urlStr = [urls firstObject];
-        
+
         if (urls.count > 1) {
-            for (int i=1; i<urls.count; i++) {
-                urlStr = [urlStr stringByAppendingFormat:@",%@",urls[i]];
+            for (int i = 1; i < urls.count; i++) {
+                urlStr = [urlStr stringByAppendingFormat:@",%@", urls[i]];
             }
         }
-        
-        NSDictionary *dic = @{@"modelpk":[ModelUser user].modelpk,@"photo":urlStr};
-        
+
+        NSDictionary *dic = @{@"modelpk": [ModelUser user].modelpk, @"photo": urlStr};
+
         [YanCNetWorkManager requestPostWithURLStr:Url_addModelPhoto(PublicUrl) parameters:dic finish:^(id dataDic) {
             if ([dataDic[@"msg"] isEqualToString:@"success"]) {
                 [MBProgressHUD showSuccess:@"保存成功"];
                 [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(backClick) userInfo:nil repeats:NO];
             }
-        } enError:^(NSError *error) {
-            
+        }                                 enError:^(NSError *error) {
+
         }];
-    }else{
+    } else {
         [MBProgressHUD showSuccess:@"保存成功"];
         [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(backClick) userInfo:nil repeats:NO];
     }
 }
 
--(void)deletePhoto:(NSInteger)index{
-    
-    PhotoModel *model = [self.dataSource objectAtIndex:index];
-    
+- (void)deletePhoto:(NSInteger)index {
+
+    PhotoModel *model = self.dataSource[index];
+
     if (model.localImage) {
-        for (UIImage *img in self.updateData ) {
+        for (UIImage *img in self.updateData) {
             if (img == model.localImage) {
                 [self.updateData removeObject:img];
             }
         }
-    }else{
-        NSDictionary *dic = @{@"modelpk":[ModelUser user].modelpk,@"modelphotopk":model.modelphotopk};
-        
+    } else {
+        NSDictionary *dic = @{@"modelpk": [ModelUser user].modelpk, @"modelphotopk": model.modelphotopk};
+
         [YanCNetWorkManager requestPostWithURLStr:Url_deleteModelPhoto(PublicUrl) parameters:dic finish:^(id dataDic) {
             if ([dataDic[@"msg"] isEqualToString:@"success"]) {
-                
+
             }
-        } enError:^(NSError *error) {
-            
+        }                                 enError:^(NSError *error) {
+
         }];
     }
     [self.dataSource removeObjectAtIndex:index];

+ 35 - 34
model/Classes/Controllers/Controller/MyProfileVC/ModelTagViewController.m

@@ -9,17 +9,18 @@
 #import "ModelTagViewController.h"
 #import "TagCollectionViewCell.h"
 #import <TTGTagCollectionView/TTGTagCollectionView.h>
-@interface ModelTagViewController ()<TTGTagCollectionViewDelegate, TTGTagCollectionViewDataSource>
 
-@property (nonatomic, strong) UILabel *infoLabel;
+@interface ModelTagViewController () <TTGTagCollectionViewDelegate, TTGTagCollectionViewDataSource>
 
-@property (nonatomic, strong) TTGTagCollectionView *listTagView;
+@property(nonatomic, strong) UILabel *infoLabel;
 
-@property (nonatomic, strong) NSMutableArray *dataSource;
+@property(nonatomic, strong) TTGTagCollectionView *listTagView;
 
-@property (strong, nonatomic) NSMutableArray <UIView *> *tagViews;
+@property(nonatomic, strong) NSMutableArray *dataSource;
 
-@property (nonatomic, strong) NSMutableArray *selectTag;
+@property(strong, nonatomic) NSMutableArray <UIView *> *tagViews;
+
+@property(nonatomic, strong) NSMutableArray *selectTag;
 
 
 @end
@@ -27,13 +28,13 @@
 @implementation ModelTagViewController
 
 - (void)viewDidLoad {
-    
+
     [super viewDidLoad];
     [self configUI];
     [self requestModelStyle];
 }
 
-- (void) configUI {
+- (void)configUI {
     self.view.backgroundColor = RGBValueColor(0xf7f7f7, 1.0);
     self.title = @"风格标签";
     self.navigationController.navigationBar.tintColor = RGBValueColor(0x333333, 1);
@@ -43,10 +44,10 @@
     self.infoLabel.text = @"选择符合你的风格标签 (至多选择3个)";
     self.infoLabel.textColor = RGBValueColor(0x666666, 1);
     [self.view addSubview:self.infoLabel];
-    
+
     self.listTagView = [[TTGTagCollectionView alloc] initWithFrame:CGRectMake(20, 60, ScreenWidth - 40, ScreenHeight - 60)];
     self.listTagView.delegate = self;
-    self.listTagView.dataSource =  self;
+    self.listTagView.dataSource = self;
     self.listTagView.verticalSpacing = 10;
     self.listTagView.horizontalSpacing = 15;
     [self.view addSubview:self.listTagView];
@@ -54,42 +55,42 @@
 }
 
 - (void)requestModelStyle {
-    
-    [YanCNetWorkManager requestGETWithURLStr:URl_getModelStyle(PublicUrl) parameters:@{@"modelpk":[ModelUser user].modelpk} finish:^(id dataDic) {
+
+    [YanCNetWorkManager requestGETWithURLStr:URl_getModelStyle(PublicUrl) parameters:@{@"modelpk": [ModelUser user].modelpk} finish:^(id dataDic) {
         for (NSDictionary *dic in dataDic[@"data"]) {
             TagStyleModel *model = [TagStyleModel mj_objectWithKeyValues:dic];
             [self.selectTag addObject:model.pk];
         }
         [self requestData];
-    } enError:^(NSError *error) {
-        
+    }                                enError:^(NSError *error) {
+
     }];
 }
 
 - (void)requestData {
-    
+
     [YanCNetWorkManager requestGETWithURLStr:Url_getStyle(PublicUrl) parameters:@{} finish:^(id dataDic) {
         for (NSDictionary *dic in dataDic[@"data"]) {
             TagStyleModel *model = [TagStyleModel mj_objectWithKeyValues:dic];
             [_tagViews addObject:[self newButtonWithTitle:model]];
             [self.dataSource addObject:model];
         }
-       [self.listTagView reload];
-       
-    } enError:^(NSError *error) {
-        
+        [self.listTagView reload];
+
+    }                                enError:^(NSError *error) {
+
     }];
 }
 
 #pragma mark - TTGTagCollectionViewDelegate
 
 - (CGSize)tagCollectionView:(TTGTagCollectionView *)tagCollectionView sizeForTagAtIndex:(NSUInteger)index {
-  
+
     return _tagViews[index].frame.size;
 }
 
 - (void)tagCollectionView:(TTGTagCollectionView *)tagCollectionView didSelectTag:(UIView *)tagView atIndex:(NSUInteger)index {
-    
+
 }
 
 - (BOOL)tagCollectionView:(TTGTagCollectionView *)tagCollectionView shouldSelectTag:(UIView *)tagView atIndex:(NSUInteger)index {
@@ -99,18 +100,18 @@
 #pragma mark - TTGTagCollectionViewDataSource
 
 - (NSUInteger)numberOfTagsInTagCollectionView:(TTGTagCollectionView *)tagCollectionView {
- 
+
     return _tagViews.count;
 }
 
 - (UIView *)tagCollectionView:(TTGTagCollectionView *)tagCollectionView tagViewForIndex:(NSUInteger)index {
-   
+
     return _tagViews[index];
 }
 
 #pragma mark - Private methods
 
-- (UIButton *)newButtonWithTitle:(TagStyleModel *)title  {
+- (UIButton *)newButtonWithTitle:(TagStyleModel *)title {
     UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
     UIColor *selectColor = [[self randomColors] objectAtIndex:arc4random() % 12];
     button.titleLabel.font = [UIFont systemFontOfSize:14];
@@ -122,7 +123,7 @@
     [button setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected];
     button.layer.borderWidth = 1.f;
     button.layer.borderColor = selectColor.CGColor;
-  
+
     for (NSString *pk in self.selectTag) {
         if ([pk isEqualToString:title.pk]) {
             button.backgroundColor = button.titleLabel.textColor;
@@ -130,9 +131,9 @@
         }
     }
     [self expandSizeForView:button extraWidth:15 extraHeight:4];
-    
+
     [button addTarget:self action:@selector(onTap:) forControlEvents:UIControlEventTouchUpInside];
-    
+
     return button;
 }
 
@@ -160,17 +161,17 @@
     }
 }
 
-- (void)handleSave{
+- (void)handleSave {
     if (self.selectTag.count == 0) {
         [MBProgressHUD showOnlyText:@"最少选择一个"];
         return;
     }
-    [YanCNetWorkManager requestPostWithURLStr:Url_SetStyle(PublicUrl) parameters:@{@"modelpk":[ModelUser user].modelpk, @"stylepks":[self.selectTag componentsJoinedByString:@","]} finish:^(id dataDic) {
+    [YanCNetWorkManager requestPostWithURLStr:Url_SetStyle(PublicUrl) parameters:@{@"modelpk": [ModelUser user].modelpk, @"stylepks": [self.selectTag componentsJoinedByString:@","]} finish:^(id dataDic) {
         if ([dataDic[@"msg"] isEqualToString:@"success"]) {
             [self.navigationController popViewControllerAnimated:YES];
         }
-    } enError:^(NSError *error) {
-        
+    }                                 enError:^(NSError *error) {
+
     }];
 }
 
@@ -196,8 +197,8 @@
 /*
  Text自适应
  */
--(CGFloat)calculateSizeWithFont:(NSInteger)Font Text:(NSString *)Text{
-    NSDictionary *attr = @{NSFontAttributeName : [UIFont systemFontOfSize:Font]};
+- (CGFloat)calculateSizeWithFont:(NSInteger)Font Text:(NSString *)Text {
+    NSDictionary *attr = @{NSFontAttributeName: [UIFont systemFontOfSize:Font]};
     CGRect rect = [Text boundingRectWithSize:CGSizeMake(MAXFLOAT, 20)
                                      options:NSStringDrawingUsesLineFragmentOrigin
                                   attributes:attr
@@ -206,7 +207,7 @@
 }
 
 - (NSArray *)randomColors {
-    return @[RGBValueColor(0xfc7d77, 1),RGBValueColor(0x25e6b9, 1),RGBValueColor(0xd2adfb, 1),RGBValueColor(0xff9dbc, 1),RGBValueColor(0xff6b9e, 1),RGBValueColor(0x5cdee0, 1),RGBValueColor(0xf29a76, 1),RGBValueColor(0x49c9f0, 1),RGBValueColor(0xef87b4, 1),RGBValueColor(0xb3d465, 1),RGBValueColor(0xf8b551, 1),RGBValueColor(0xf80c269, 1)];
+    return @[RGBValueColor(0xfc7d77, 1), RGBValueColor(0x25e6b9, 1), RGBValueColor(0xd2adfb, 1), RGBValueColor(0xff9dbc, 1), RGBValueColor(0xff6b9e, 1), RGBValueColor(0x5cdee0, 1), RGBValueColor(0xf29a76, 1), RGBValueColor(0x49c9f0, 1), RGBValueColor(0xef87b4, 1), RGBValueColor(0xb3d465, 1), RGBValueColor(0xf8b551, 1), RGBValueColor(0xf80c269, 1)];
 }
 /*
 #pragma mark - Navigation

+ 79 - 71
model/Classes/Controllers/Controller/MySkillsVC/EditorSkillsController.m

@@ -8,13 +8,13 @@
 
 #import "EditorSkillsController.h"
 
-@interface EditorSkillsController ()<UITextFieldDelegate, UIImagePickerControllerDelegate,UINavigationControllerDelegate>
-@property (nonatomic, strong) UIScrollView *bgScrollView;
-@property (nonatomic, strong) UITextField *workTypeTF;   //工作类型
-@property (nonatomic, strong) UIImageView *workPicView;  //工作照片
-@property (nonatomic, strong) UITextField *priceTF; //价格
+@interface EditorSkillsController () <UITextFieldDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate>
+@property(nonatomic, strong) UIScrollView *bgScrollView;
+@property(nonatomic, strong) UITextField *workTypeTF;   //工作类型
+@property(nonatomic, strong) UIImageView *workPicView;  //工作照片
+@property(nonatomic, strong) UITextField *priceTF; //价格
 //
-@property (nonatomic, copy) NSString *imageStr; //图片url
+@property(nonatomic, copy) NSString *imageStr; //图片url
 
 
 @end
@@ -23,21 +23,22 @@
 
 - (void)viewDidLoad {
     [super viewDidLoad];
-    // Do any additional setup after loading the view.
     self.view.backgroundColor = [UIColor whiteColor];
     UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(keyboardHide:)];
-    //设置成NO表示当前控件响应后会传播到其他控件上,默认为YES。
     tapGestureRecognizer.cancelsTouchesInView = NO;
-    //将触摸事件添加到当前view
     [self.view addGestureRecognizer:tapGestureRecognizer];
-    //设置导航条
     [self creatNavBar];
-    //设置子试图
     [self creatSubViews];
 }
 
+- (void)viewWillAppear:(BOOL)animated {
+    [super viewWillAppear:animated];
+    [self.navigationController setNavigationBarHidden:NO animated:YES];
+}
+
 #pragma mark -- 收起键盘
--(void)keyboardHide:(UITapGestureRecognizer*)tap{
+
+- (void)keyboardHide:(UITapGestureRecognizer *)tap {
     [self.view endEditing:YES];
 }
 
@@ -49,14 +50,14 @@
 - (void)creatNavBar {
     self.title = @"编辑技能";
     //
-    UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom];
+    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
     btn.frame = CGRectMake(0, 0, 40, 40);
     [btn setImage:[UIImage imageNamed:@"fanhui2"] forState:UIControlStateNormal];
-    btn.imageEdgeInsets =  UIEdgeInsetsMake(0, -20, 0, 0);
+    btn.imageEdgeInsets = UIEdgeInsetsMake(0, -20, 0, 0);
     [btn addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
     UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
-    UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
-    
+    UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
+
     //    nagetiveSpacer.width = -12;//这个值可以根据自己需要自己调整
     self.navigationItem.leftBarButtonItems = @[nagetiveSpacer, leftItem];
 }
@@ -81,7 +82,7 @@
     workTypeTitleLabel.font = [UIFont systemFontOfSize:15];
     workTypeTitleLabel.textColor = RGBValueColor(0x333333, 1.0);
     [scrollView addSubview:workTypeTitleLabel];
-    
+
     UITextField *workTypeTF = [[UITextField alloc] initWithFrame:CGRectMake(CGRectGetMaxX(workTypeTitleLabel.frame), 20, ScreenWidth / 2, 15)];
 //    workTypeTF.placeholder = @"选择您的工作类型";
     workTypeTF.text = self.skilldic[@"name"];
@@ -90,7 +91,7 @@
     workTypeTF.textColor = RGBValueColor(0x333333, 1.0);
     [scrollView addSubview:workTypeTF];
     self.workTypeTF = workTypeTF;
-        //
+    //
     UIView *upLineView = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(workTypeTitleLabel.frame) + 20, ScreenWidth, 0.5)];
     upLineView.backgroundColor = RGBValueColor(0xdfdfdf, 1.0);
     [scrollView addSubview:upLineView];
@@ -107,7 +108,7 @@
     } else {
         urlStr = [NSString stringWithFormat:@"%@/%@", PublicUrl, skillphoto];
     }
-   
+
     [self.workPicView sd_setImageWithURL:[NSURL URLWithString:urlStr] placeholderImage:[UIImage imageNamed:@"tianjiajineng"]];
     [scrollView addSubview:self.workPicView];
     UIButton *addPicBtn = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(workPicTitleLabel.frame), CGRectGetMaxY(upLineView.frame) + 20, 80, 80)];
@@ -117,14 +118,14 @@
     UIView *downLineView = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.workPicView.frame) + 20, ScreenWidth, 0.5)];
     downLineView.backgroundColor = RGBValueColor(0xdfdfdf, 1.0);
     [scrollView addSubview:downLineView];
-    
+
     //
     UILabel *priceTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, CGRectGetMaxY(downLineView.frame) + 20, 50, 15)];
     priceTitleLabel.text = @"价格:";
     priceTitleLabel.font = [UIFont systemFontOfSize:15];
     priceTitleLabel.textColor = RGBValueColor(0x333333, 1.0);
     [scrollView addSubview:priceTitleLabel];
-    
+
     UITextField *priceTF = [[UITextField alloc] initWithFrame:CGRectMake(CGRectGetMaxX(priceTitleLabel.frame), CGRectGetMaxY(downLineView.frame) + 20, 100, 15)];
     priceTF.textAlignment = NSTextAlignmentLeft;
     priceTF.keyboardType = UIKeyboardTypeDecimalPad;
@@ -157,7 +158,7 @@
     [deleteBtn setTitle:@"删除" forState:UIControlStateNormal];
     [deleteBtn setTitleColor:RGBValueColor(0xfe4086, 1.0) forState:UIControlStateNormal];
     [deleteBtn addTarget:self action:@selector(deleteBtnAction) forControlEvents:UIControlEventTouchUpInside];
-    [self.view addSubview:deleteBtn];
+    [scrollView addSubview:deleteBtn];
     //
     UILabel *instructionsLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, CGRectGetMaxY(deleteBtn.frame) + 16, ScreenWidth - 40, 12)];
     instructionsLabel.text = @"说明:请勿发布违反国家法规的内容";
@@ -167,10 +168,11 @@
 }
 
 #pragma mark -- 确认修改
+
 - (void)postBtnAction {
     NSLog(@"确认修改");
     //修改没有图片
-   
+
     [self updateSkillFromNetworking];
 }
 
@@ -180,15 +182,16 @@
 }
 
 #pragma mark --  确认修改
+
 - (void)updateSkillFromNetworking {
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
-    
+
     NSString *modelpk = self.skilldic[@"modelpk"];
     NSString *skillpk = self.skilldic[@"skillpk"];
     NSString *pk = self.skilldic[@"modelpricepk"];
-    
+
     NSString *price = [NSString stringWithFormat:@"%@", self.priceTF.text];
-    
+
     NSMutableDictionary *parameterDic = [NSMutableDictionary dictionaryWithCapacity:0];
     [parameterDic setObject:modelpk forKey:@"modelpk"];
     [parameterDic setObject:skillpk forKey:@"skillpk"];
@@ -208,21 +211,22 @@
         } else {
             [MBProgressHUD showInfo:@"请求失败!"];
         }
-    } enError:^(NSError *error) {
+    }                                 enError:^(NSError *error) {
         [MBProgressHUD hideHUDForView:self.view animated:YES];
     }];
 }
 
 #pragma mark -- 删除
+
 - (void)getRemoveModelSkillFromNetworking {
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
 //    ModelUser *modelUser = [ModelUser user];
-    
+
     NSString *modelpk = self.skilldic[@"modelpk"];
     NSString *skillpk = self.skilldic[@"modelpricepk"];
 
-    NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:modelpk,@"modelpk",skillpk,@"skillpk", nil];
-    
+    NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:modelpk, @"modelpk", skillpk, @"skillpk", nil];
+
     [YanCNetWorkManager requestPostWithURLStr:Url_removemodelskill(PublicUrl) parameters:dic finish:^(id dataDic) {
         [MBProgressHUD hideHUDForView:self.view animated:YES];
 
@@ -233,31 +237,32 @@
         } else {
             [MBProgressHUD showInfo:@"操作失败!"];
         }
-    } enError:^(NSError *error) {
+    }                                 enError:^(NSError *error) {
         [MBProgressHUD hideHUDForView:self.view animated:YES];
     }];
 }
 
 #pragma mark -- 添加工作照
+
 - (void)addPicBtnAction {
     NSLog(@"添加工作照");
     [self changeHeaderPicture];
 }
 
 - (void)changeHeaderPicture {
-    
+
     UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"温馨提示" message:nil preferredStyle:(UIAlertControllerStyleActionSheet)];
     // 设置按钮
-    UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"从相册中选择" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
+    UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"从相册中选择" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction *_Nonnull action) {
         NSLog(@"选择相册");
         [self pickerPictureFromPhotoLibrary];
     }];
-    
-    UIAlertAction *action2 = [UIAlertAction actionWithTitle:@"使用相机拍摄" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
+
+    UIAlertAction *action2 = [UIAlertAction actionWithTitle:@"使用相机拍摄" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction *_Nonnull action) {
         NSLog(@"请选择相机");
         [self pickerPictureFromCamera];
     }];
-    
+
     UIAlertAction *action3 = [UIAlertAction actionWithTitle:@"取消" style:(UIAlertActionStyleCancel) handler:nil];
     [alertController addAction:action1];
     [alertController addAction:action2];
@@ -275,7 +280,7 @@
     pickerVC.allowsEditing = YES;
     // 设置代理
     pickerVC.delegate = self;
-    
+
     [self presentViewController:pickerVC animated:YES completion:nil];
 }
 
@@ -295,18 +300,19 @@
     pickerVC.allowsEditing = YES;
     // 设置代理
     pickerVC.delegate = self;
-    
+
     [self presentViewController:pickerVC animated:YES completion:nil];
 }
 
 #pragma mark - UIImagePickerControllerDelegate的代理方法
-- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info {
+
+- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *, id> *)info {
     //    // info存储的是我们要的图片, 而图片是编辑后要得到的, 所以使用UIImagePickerControllerEditedImage
     //先要把头像上传,若上传成功了,就把这个图片给显示出来
-    
+
     //先要把头像上传,若上传成功了,就把这个图片给显示出来
     [self dismissViewControllerAnimated:YES completion:^{
-        
+
         NSString *mediaType = info[UIImagePickerControllerMediaType];
         if ([mediaType isEqualToString:@"public.image"]) {
             NSLog(@"image...");
@@ -318,8 +324,8 @@
             imagesize.height = 100;
             //对图片大小进行压缩
             UIImage *newImg = [self imageWithImage:original scaledToSize:imagesize];
-            NSData *imageData = UIImageJPEGRepresentation(newImg,1);
-            
+            NSData *imageData = UIImageJPEGRepresentation(newImg, 1);
+
 
             UIImage *selectImg = [UIImage imageWithData:imageData];
             //            NSLog(@"selectImg:%@",selectImg);
@@ -333,9 +339,9 @@
 //用户取消退出picker时候调用
 
 - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
-    NSLog(@"picker = %@",picker);
+    NSLog(@"picker = %@", picker);
     [self dismissViewControllerAnimated:YES completion:^{
-        
+
     }];
 }
 
@@ -343,25 +349,26 @@
 - (UIImage *)imageWithImage:(UIImage *)image scaledToSize:(CGSize)newSize {
     // Create a graphics image context
     UIGraphicsBeginImageContext(newSize);
-    
+
     // Tell the old image to draw in this new context, with the desired
     // new size
-    [image drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];
-    
+    [image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)];
+
     // Get the new image from the context
-    UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
-    
+    UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
+
     // End the context
     UIGraphicsEndImageContext();
-    
+
     // Return the new image.
     return newImage;
 }
 
 #pragma mark -- 上传图片
+
 - (void)postPicDataWithNetworkingWith:(UIImage *)image {
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
-    
+
     [YanCNetWorkManager requestPostWithURLStr:Url_skillphoto(PublicUrl) fileData:image name:@"img" fileName:@"111.png" mimeType:@"image/jpg/png" parameters:nil finish:^(id dataDic) {
         [MBProgressHUD hideHUDForView:self.view animated:YES];
 
@@ -371,7 +378,7 @@
         } else {
             [MBProgressHUD showInfo:@"请求失败!"];
         }
-    } enError:^(NSError *error) {
+    }                                 enError:^(NSError *error) {
         [MBProgressHUD hideHUDForView:self.view animated:YES];
     }];
 }
@@ -383,14 +390,15 @@
  }
  */
 #pragma mark ----- UITextFieldDelegate
+
 - (void)textFieldDidEndEditing:(UITextField *)textField {
     NSLog(@"textField.text = %@", textField.text);
 }
 
 - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
     if (textField.tag == 700) {
-        if(![self isValidAboutInputText:textField shouldChangeCharactersInRange:range replacementString:string decimalNumber:2]) {
-            
+        if (![self isValidAboutInputText:textField shouldChangeCharactersInRange:range replacementString:string decimalNumber:2]) {
+
             return NO;
         }
     }
@@ -400,46 +408,46 @@
 //输入框中只能输入数字和小数点,且小数点只能输入一位,参数number 可以设置小数的位数,该函数在-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string调用;
 
 - (BOOL)isValidAboutInputText:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string decimalNumber:(NSInteger)number {
-    
-    NSScanner      *scanner    = [NSScanner scannerWithString:string];
+
+    NSScanner *scanner = [NSScanner scannerWithString:string];
     NSCharacterSet *numbers;
-    NSRange         pointRange = [textField.text rangeOfString:@"."];
-    if ( (pointRange.length > 0) && (pointRange.location < range.location  || pointRange.location > range.location + range.length) ){
+    NSRange pointRange = [textField.text rangeOfString:@"."];
+    if ((pointRange.length > 0) && (pointRange.location < range.location || pointRange.location > range.location + range.length)) {
         numbers = [NSCharacterSet characterSetWithCharactersInString:@"0123456789"];
-    }else{
+    } else {
         numbers = [NSCharacterSet characterSetWithCharactersInString:@"0123456789."];
     }
-    if ( [textField.text isEqualToString:@""] && [string isEqualToString:@"."] ){
+    if ([textField.text isEqualToString:@""] && [string isEqualToString:@"."]) {
         return NO;
     }
     short remain = number; //保留 number位小数
     NSString *tempStr = [textField.text stringByAppendingString:string];
     NSUInteger strlen = [tempStr length];
-    if(pointRange.length > 0 && pointRange.location > 0){ //判断输入框内是否含有“.”。
-        if([string isEqualToString:@"."]){ //当输入框内已经含有“.”时,如果再输入“.”则被视为无效。
+    if (pointRange.length > 0 && pointRange.location > 0) { //判断输入框内是否含有“.”。
+        if ([string isEqualToString:@"."]) { //当输入框内已经含有“.”时,如果再输入“.”则被视为无效。
             return NO;
         }
-        if(strlen > 0 && (strlen - pointRange.location) > remain+1){ //当输入框内已经含有“.”,当字符串长度减去小数点前面的字符串长度大于需要要保留的小数点位数,则视当次输入无效。
+        if (strlen > 0 && (strlen - pointRange.location) > remain + 1) { //当输入框内已经含有“.”,当字符串长度减去小数点前面的字符串长度大于需要要保留的小数点位数,则视当次输入无效。
             return NO;
         }
     }
     NSRange zeroRange = [textField.text rangeOfString:@"0"];
-    if(zeroRange.length == 1 && zeroRange.location == 0){ //判断输入框第一个字符是否为“0”
-        if(![string isEqualToString:@"0"] && ![string isEqualToString:@"."] && [textField.text length] == 1){ //当输入框只有一个字符并且字符为“0”时,再输入不为“0”或者“.”的字符时,则将此输入替换输入框的这唯一字符。
+    if (zeroRange.length == 1 && zeroRange.location == 0) { //判断输入框第一个字符是否为“0”
+        if (![string isEqualToString:@"0"] && ![string isEqualToString:@"."] && [textField.text length] == 1) { //当输入框只有一个字符并且字符为“0”时,再输入不为“0”或者“.”的字符时,则将此输入替换输入框的这唯一字符。
             textField.text = string;
             return NO;
-        }else{
-            if(pointRange.length == 0 && pointRange.location > 0){ //当输入框第一个字符为“0”时,并且没有“.”字符时,如果当此输入的字符为“0”,则视当此输入无效。
-                if([string isEqualToString:@"0"]){
+        } else {
+            if (pointRange.length == 0 && pointRange.location > 0) { //当输入框第一个字符为“0”时,并且没有“.”字符时,如果当此输入的字符为“0”,则视当此输入无效。
+                if ([string isEqualToString:@"0"]) {
                     return NO;
                 }
             }
         }
     }
     NSString *buffer;
-    if ( ![scanner scanCharactersFromSet:numbers intoString:&buffer] && ([string length] != 0) ){
+    if (![scanner scanCharactersFromSet:numbers intoString:&buffer] && ([string length] != 0)) {
         return NO;
-    }else{
+    } else {
         return YES;
     }
 }

+ 84 - 68
model/Classes/Controllers/Controller/MySkillsVC/MySkillsController.m

@@ -10,47 +10,42 @@
 #import "PostSkillsController.h"
 #import "EditorSkillsController.h"
 #import "SkillsOrderCell.h"
-
-@interface MySkillsController ()<UITableViewDelegate, UITableViewDataSource>
-@property (nonatomic, strong) UITableView *tableView;
-@property (nonatomic, strong) UIView *remindView;    //提示view
-@property (nonatomic, strong) NSMutableArray *dataArr;
-
+#import "MineNewViewController.h"
+#import "Masonry.h"
+
+@interface MySkillsController () <UITableViewDelegate, UITableViewDataSource>
+@property(nonatomic, strong) UITableView *tableView;
+@property(nonatomic, strong) UIView *remindView;    //提示view
+@property(nonatomic, strong) NSMutableArray *dataArr;
+@property(nonatomic, strong) UIView *footerView;
 @end
 
 @implementation MySkillsController
 
 - (void)viewDidLoad {
     [super viewDidLoad];
-    // Do any additional setup after loading the view.
-    //设置导航条
     [self creatNavBar];
-    //设置子试图
     [self creatSubViews];
-    //设置没有技能时的背景图
     [self addRemindView];
 }
 
 - (void)viewWillAppear:(BOOL)animated {
     [super viewWillAppear:animated];
+    [self.navigationController setNavigationBarHidden:NO animated:YES];
     [self getDataFromNetworking];
 }
 
-- (void)didReceiveMemoryWarning {
-    [super didReceiveMemoryWarning];
-    // Dispose of any resources that can be recreated.
-}
-
 #pragma mark -- 网络请求
+
 - (void)getDataFromNetworking {
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
     ModelUser *modelUser = [ModelUser user];
-    
-    NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:modelUser.modelpk,@"modelpk", nil];
-    
+
+    NSDictionary *dic = @{@"modelpk": modelUser.modelpk};
+
     [YanCNetWorkManager requestPostWithURLStr:Url_getSkillData(PublicUrl) parameters:dic finish:^(id dataDic) {
         [MBProgressHUD hideHUDForView:self.view animated:YES];
-        
+
         NSString *issuccess = dataDic[@"msg"];
         if ([issuccess isEqualToString:@"success"]) {
             self.dataArr = dataDic[@"data"];
@@ -64,47 +59,30 @@
         } else {
             [MBProgressHUD showInfo:@"请求失败!"];
         }
-    } enError:^(NSError *error) {
+    }                                 enError:^(NSError *error) {
         [MBProgressHUD hideHUDForView:self.view animated:YES];
     }];
 }
 
-/*
- {
- lname = "\U4e16\U754c\U548c\U5e73";
- memberpk = 8;
- modelpk = 1;
- modelpricepk = 13;
- name = "\U5357\U4eac";
- pdate = "2018-07-16 10:42:53";
- price = "198.99";
- skillphoto = "upload/photo/2018-06-11/861537846612330270.png";
- skillpk = 1;
- unit = "\U5143";
- }
- */
 - (void)creatNavBar {
     self.title = @"我的技能";
 
-    //
     UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
     btn.frame = CGRectMake(0, 0, 40, 40);
     [btn setImage:[UIImage imageNamed:@"fanhui2"] forState:UIControlStateNormal];
-    btn.imageEdgeInsets =  UIEdgeInsetsMake(0, -20, 0, 0); // backBtn2
+    btn.imageEdgeInsets = UIEdgeInsetsMake(0, -20, 0, 0); // backBtn2
     [btn addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
     UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
-    UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
-    //    nagetiveSpacer.width = -12;//这个值可以根据自己需要自己调整
+    UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
     self.navigationItem.leftBarButtonItems = @[nagetiveSpacer, leftItem];
-    //
+
     UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
     rightBtn.frame = CGRectMake(0, 0, 40, 40);
     [rightBtn setImage:[UIImage imageNamed:@"tianjia-1"] forState:UIControlStateNormal];
-    rightBtn.imageEdgeInsets =  UIEdgeInsetsMake(0, 0, 0, -20);
+    rightBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, -20);
     [rightBtn addTarget:self action:@selector(rightBtnClick) forControlEvents:UIControlEventTouchUpInside];
     UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithCustomView:rightBtn];
-    UIBarButtonItem *nagetiveRightSpacer = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
-    //    nagetiveSpacer.width = -12;//这个值可以根据自己需要自己调整
+    UIBarButtonItem *nagetiveRightSpacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
     self.navigationItem.rightBarButtonItems = @[rightItem, nagetiveRightSpacer];
 }
 
@@ -118,41 +96,71 @@
 }
 
 - (void)creatSubViews {
-    
-    //设置列表
-    float height = Height_NaviBar;
-    self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight-height) style:UITableViewStylePlain];
+    self.tableView = [[UITableView alloc] init];
     self.tableView.backgroundColor = [UIColor whiteColor];
     self.tableView.delegate = self;
     self.tableView.dataSource = self;
     self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
+    self.tableView.tableFooterView = self.footerView;
     [self.view addSubview:self.tableView];
+    [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.right.equalTo(self.view);
+        make.top.equalTo(self.mas_topLayoutGuide);
+        make.bottom.equalTo(self.mas_bottomLayoutGuide);
+    }];
+}
+
+- (UIView *)footerView {
+    if (!_footerView) {
+        _footerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 74)];
+        UIButton *button = [[UIButton alloc] init];
+        [button setTitle:@"完成" forState:UIControlStateNormal];
+        button.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
+        button.layer.backgroundColor = [UIColor colorWithRed:255 / 255.0 green:64 / 255.0 blue:149 / 255.0 alpha:1].CGColor;
+        button.layer.cornerRadius = 22;
+        button.layer.shadowColor = [UIColor colorWithRed:255 / 255.0 green:64 / 255.0 blue:149 / 255.0 alpha:0.36].CGColor;
+        button.layer.shadowOffset = CGSizeMake(0, 8);
+        button.layer.shadowOpacity = 1;
+        button.layer.shadowRadius = 10;
+        [button addTarget:self action:@selector(finish) forControlEvents:UIControlEventTouchUpInside];
+        [_footerView addSubview:button];
+        [button mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.centerY.equalTo(_footerView);
+            make.leftMargin.equalTo(_footerView).offset(20);
+            make.right.equalTo(_footerView).offset(-20);
+            make.height.mas_equalTo(44);
+        }];
+    }
+    return _footerView;
+}
+
+- (void)finish {
+    for (UIViewController *temp in self.navigationController.viewControllers) {
+        if ([temp isKindOfClass:[MineNewViewController class]]) {
+            [self.navigationController popToViewController:temp animated:YES];
+        }
+    }
 }
 
 #pragma mark -- UITableViewDelegate, UITableViewDataSource
-//先要设Cell可编辑
+
 - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
     return YES;
 }
 
-//定义编辑样式
 - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
     return UITableViewCellEditingStyleDelete;
 }
 
-//修改编辑按钮文字
 - (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath {
     return @"删除";
 }
 
-- (BOOL)tableView: (UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath {
+- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath {
     return NO;
 }
 
-//点击删除
 - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
-    //在这里实现删除操作
-    //删除数据,和删除动画
     if (editingStyle == UITableViewCellEditingStyleDelete) {
         [self getRemoveModelSkillFromNetworkingWithIndex:indexPath];
     }
@@ -167,14 +175,14 @@
 }
 
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- 
+
     static NSString *cellid = @"cellid";
     SkillsOrderCell *cell = [tableView dequeueReusableCellWithIdentifier:cellid];
     if (!cell) {
         cell = [[SkillsOrderCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid];
     }
     NSDictionary *dic = self.dataArr[indexPath.section];
-    
+
     cell.smallLabel.hidden = YES;
     cell.lineView.hidden = YES;
     cell.completeBtn.hidden = YES;
@@ -187,7 +195,7 @@
     } else {
         urlStr = [NSString stringWithFormat:@"%@/%@", PublicUrl, skillphoto];
     }
-    
+
     [cell.iconImageView sd_setImageWithURL:[NSURL URLWithString:urlStr] placeholderImage:[UIImage imageNamed:@"tu"]];
     cell.titleLabel.text = dic[@"name"];
     cell.subTitleLabel.text = [NSString stringWithFormat:@"%@元/小时", dic[@"price"]];
@@ -232,16 +240,17 @@
 }
 
 #pragma mark -- 删除
+
 - (void)getRemoveModelSkillFromNetworkingWithIndex:(NSIndexPath *)indexPath {
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
 
     NSDictionary *dic = _dataArr[indexPath.section];
-    
+
     NSString *modelpk = dic[@"modelpk"];
     NSString *skillpk = dic[@"modelpricepk"];
-    
+
     NSLog(@"%@/%@", modelpk, skillpk);
-    NSDictionary *parameter = [[NSDictionary alloc] initWithObjectsAndKeys:modelpk,@"modelpk",skillpk,@"skillpk", nil];
+    NSDictionary *parameter = @{@"modelpk": modelpk, @"skillpk": skillpk};
     NSLog(@"%@/%@", modelpk, parameter);
     [YanCNetWorkManager requestPostWithURLStr:Url_removemodelskill(PublicUrl) parameters:parameter finish:^(id dataDic) {
         [MBProgressHUD hideHUDForView:self.view animated:YES];
@@ -254,23 +263,23 @@
         } else {
             [MBProgressHUD showInfo:@"操作失败!"];
         }
-    } enError:^(NSError *error) {
+    }                                 enError:^(NSError *error) {
         [MBProgressHUD hideHUDForView:self.view animated:YES];
     }];
 }
 
 - (void)addRemindView {
-    
+
     self.remindView = [[UIView alloc] initWithFrame:self.view.bounds];
     self.remindView.backgroundColor = RGBValueColor(0xf7f7f7, 1.0);
-    
+
     self.remindView.hidden = YES;
     [self.view addSubview:self.remindView];
     UIImageView *remindView = [[UIImageView alloc] init];
     remindView.frame = CGRectMake(ScreenWidth / 2 - 65.5, 75 * AutoSizeSalseX, 130.5, 90);
     remindView.image = [UIImage imageNamed:@"biaoqing"];
     [self.remindView addSubview:remindView];
-    
+
     UILabel *remindLabel = [[UILabel alloc] init];
     remindLabel.frame = CGRectMake(0, CGRectGetMaxY(remindView.frame) + 20, ScreenWidth, 15);
     remindLabel.textAlignment = NSTextAlignmentCenter;
@@ -278,7 +287,7 @@
     remindLabel.textColor = RGBValueColor(0xc5c5c7, 1.0);
     remindLabel.text = @"还没有发布过技能";
     [self.remindView addSubview:remindLabel];
-    
+
     //
     UILabel *subRemindLabel = [[UILabel alloc] init];
     subRemindLabel.frame = CGRectMake(0, CGRectGetMaxY(remindLabel.frame) + 20, ScreenWidth, 15);
@@ -287,10 +296,17 @@
     subRemindLabel.textColor = RGBValueColor(0xc5c5c7, 1.0);
     subRemindLabel.text = @"快去添加你的技能吧";
     [self.remindView addSubview:subRemindLabel];
-    
-    //
-    UIButton *addBtnAction = [[UIButton alloc] initWithFrame:CGRectMake(ScreenWidth / 2 - 50, CGRectGetMaxY(subRemindLabel.frame) + 60, 100, 100)];
-    [addBtnAction setImage:[UIImage imageNamed:@"tianjiajineng"] forState:UIControlStateNormal];
+
+    UIButton *addBtnAction = [[UIButton alloc] initWithFrame:CGRectMake(ScreenWidth / 2 - 110, CGRectGetMaxY(subRemindLabel.frame) + 60, 220, 44)];
+    [addBtnAction setTitle:@"立即添加" forState:UIControlStateNormal];
+    [addBtnAction setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
+    addBtnAction.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
+    addBtnAction.layer.backgroundColor = [UIColor colorWithRed:255/255.0 green:64/255.0 blue:149/255.0 alpha:1].CGColor;
+    addBtnAction.layer.cornerRadius = 22;
+    addBtnAction.layer.shadowColor = [UIColor colorWithRed:255/255.0 green:64/255.0 blue:149/255.0 alpha:0.36].CGColor;
+    addBtnAction.layer.shadowOffset = CGSizeMake(0,8);
+    addBtnAction.layer.shadowOpacity = 1;
+    addBtnAction.layer.shadowRadius = 10;
     [addBtnAction addTarget:self action:@selector(rightBtnClick) forControlEvents:UIControlEventTouchUpInside];
     [self.remindView addSubview:addBtnAction];
 }

+ 186 - 144
model/Classes/Controllers/Controller/MySkillsVC/PostSkillsController.m

@@ -7,20 +7,22 @@
 //  发布技能
 
 #import "PostSkillsController.h"
+#import "Masonry.h"
 
-@interface PostSkillsController ()<UITextFieldDelegate, UIImagePickerControllerDelegate,UINavigationControllerDelegate>
-{
+@interface PostSkillsController () <UITextFieldDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate> {
     NSString *skillPk;
 }
-@property (nonatomic, strong) UIScrollView *bgScrollView;
-@property (nonatomic, strong) UITextField *workTypeTF;   //工作类型
-@property (nonatomic, strong) UIImageView *workPicView;  //工作照片
-@property (nonatomic, strong) UITextField *priceTF; //价格
-@property (nonatomic, strong) UIButton *selectedWorkTypeBtn;  //选中支付方式按钮
+@property(nonatomic, strong) UIScrollView *bgScrollView;
+@property(nonatomic, strong) UITextField *workTypeTF;   //工作类型
+@property(nonatomic, strong) UIImageView *workPicView;  //工作照片
+@property(nonatomic, strong) UITextField *priceTF; //价格
+@property(nonatomic, strong) UIButton *btnAgree;
+@property(nonatomic, strong) UIButton *selectedWorkTypeBtn;  //选中支付方式按钮
+
 //
-@property (nonatomic, copy) NSString *imageStr; //图片url
-@property (nonatomic, strong) UIView      *bgSkillView;//技能标签背景
-@property (strong, nonatomic) NSMutableArray *skillArray;
+@property(nonatomic, copy) NSString *imageStr; //图片url
+@property(nonatomic, strong) UIView *bgSkillView;//技能标签背景
+@property(strong, nonatomic) NSMutableArray *skillArray;
 
 @end
 
@@ -41,29 +43,30 @@
     [self getSkillFromNetworking];
 }
 
-#pragma mark -- 收起键盘
--(void)keyboardHide:(UITapGestureRecognizer*)tap{
-    [self.view endEditing:YES];
+- (void)viewWillAppear:(BOOL)animated {
+    [super viewWillAppear:animated];
+    [self.navigationController setNavigationBarHidden:NO animated:YES];
 }
 
-- (void)didReceiveMemoryWarning {
-    [super didReceiveMemoryWarning];
-    // Dispose of any resources that can be recreated.
+#pragma mark -- 收起键盘
+
+- (void)keyboardHide:(UITapGestureRecognizer *)tap {
+    [self.view endEditing:YES];
 }
 
 - (void)creatNavBar {
     self.title = @"发布技能";
-    //
-    UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom];
+    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
     btn.frame = CGRectMake(0, 0, 40, 40);
     [btn setImage:[UIImage imageNamed:@"fanhui2"] forState:UIControlStateNormal];
-    btn.imageEdgeInsets =  UIEdgeInsetsMake(0, -20, 0, 0);
+    btn.imageEdgeInsets = UIEdgeInsetsMake(0, -20, 0, 0);
     [btn addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
     UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
-    UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
-    
-    //    nagetiveSpacer.width = -12;//这个值可以根据自己需要自己调整
+    UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
+
     self.navigationItem.leftBarButtonItems = @[nagetiveSpacer, leftItem];
+
+    self.view.backgroundColor = [UIColor colorWithHexString:@"#F2F4F5"];
 }
 
 - (void)backClick {
@@ -75,19 +78,17 @@
     UIScrollView *scrollView = [[UIScrollView alloc] init];
     scrollView.frame = self.view.bounds;
     scrollView.showsVerticalScrollIndicator = NO;
-    scrollView.backgroundColor = [UIColor whiteColor];
-    CGFloat height = ScreenHeight < 667 ? 697 : ScreenHeight;
-    scrollView.contentSize = CGSizeMake(ScreenWidth, height);
+    scrollView.backgroundColor = [UIColor clearColor];
     [self.view addSubview:scrollView];
     self.bgScrollView = scrollView;
-    
+
     //
     UILabel *workTypeTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 20, 80, 15)];
     workTypeTitleLabel.text = @"工作类型:";
     workTypeTitleLabel.font = [UIFont systemFontOfSize:15];
     workTypeTitleLabel.textColor = RGBValueColor(0x333333, 1.0);
     [scrollView addSubview:workTypeTitleLabel];
-    
+
     UITextField *workTypeTF = [[UITextField alloc] initWithFrame:CGRectMake(CGRectGetMaxX(workTypeTitleLabel.frame), 20, ScreenWidth / 2, 15)];
     workTypeTF.placeholder = @"选择您的工作类型";
     workTypeTF.userInteractionEnabled = NO;
@@ -95,19 +96,19 @@
     workTypeTF.textColor = RGBValueColor(0x333333, 1.0);
     [scrollView addSubview:workTypeTF];
     self.workTypeTF = workTypeTF;
-    
-    self.bgSkillView = [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(workTypeTitleLabel.frame) + 20, ScreenWidth, ((self.skillArray.count-1)/3+1)*50)];
-    self.bgSkillView.backgroundColor = [UIColor whiteColor];
+
+    self.bgSkillView = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(workTypeTitleLabel.frame) + 20, ScreenWidth, ((self.skillArray.count - 1) / 3 + 1) * 54)];
+    self.bgSkillView.backgroundColor = [UIColor clearColor];
     [scrollView addSubview:self.bgSkillView];
-    
-    int width = (ScreenWidth-120)/3;
-    
-    for (int i=0; i<self.skillArray.count; i++) {
-        
+
+    int width = (ScreenWidth - 70) / 3;
+
+    for (int i = 0; i < self.skillArray.count; i++) {
+
         int m = i % 3;
         int n = i / 3;
-        
-        UIButton *skillButton = [[UIButton alloc]initWithFrame:CGRectMake(20+(width+40)*m, 50*n, width, 35)];
+
+        UIButton *skillButton = [[UIButton alloc] initWithFrame:CGRectMake(20 + (width + 15) * m, 54 * n, width, 44)];
         skillButton.titleLabel.lineBreakMode = NSLineBreakByTruncatingTail;
         [skillButton setTitle:[self.skillArray[i] objectForKey:@"name"] forState:UIControlStateNormal];
         [skillButton setTitleColor:RGB(50, 50, 50) forState:UIControlStateNormal];
@@ -120,87 +121,117 @@
         [skillButton addTarget:self action:@selector(selectedAmountBtnAction:) forControlEvents:UIControlEventTouchUpInside];
         [self.bgSkillView addSubview:skillButton];
     }
-    
+
     scrollView.contentSize = CGSizeMake(ScreenWidth, self.bgSkillView.frame.size.height + 400);
-    
-    //
-    UIView *upLineView = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.bgSkillView.frame), ScreenWidth, 0.5)];
-    upLineView.backgroundColor = RGBValueColor(0xdfdfdf, 1.0);
-    [scrollView addSubview:upLineView];
-    
-    UILabel *workPicTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, CGRectGetMaxY(upLineView.frame) + 20, 80, 15)];
+
+    UILabel *workPicTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, CGRectGetMaxY(self.bgSkillView.frame) + 20, 80, 15)];
     workPicTitleLabel.text = @"工作照片:";
-    workPicTitleLabel.font = [UIFont systemFontOfSize:15];
-    workPicTitleLabel.textColor = RGBValueColor(0x333333, 1.0);
+    workPicTitleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
+    workPicTitleLabel.textColor = [UIColor blackColor];
     [scrollView addSubview:workPicTitleLabel];
-    
-    self.workPicView = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(workPicTitleLabel.frame), CGRectGetMaxY(upLineView.frame) + 20, 80, 80)];
+
+    self.workPicView = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(workPicTitleLabel.frame), CGRectGetMaxY(self.bgSkillView.frame) + 20, 80, 80)];
     self.workPicView.image = [UIImage imageNamed:@"tianjiajineng"];
     [scrollView addSubview:self.workPicView];
-    
-    UIButton *addPicBtn = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(workPicTitleLabel.frame), CGRectGetMaxY(upLineView.frame) + 20, 80, 80)];
+
+    UIButton *addPicBtn = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(workPicTitleLabel.frame), CGRectGetMaxY(self.bgSkillView.frame) + 20, 80, 80)];
     addPicBtn.backgroundColor = [UIColor clearColor];
     [addPicBtn addTarget:self action:@selector(addPicBtnAction) forControlEvents:UIControlEventTouchUpInside];
     [scrollView addSubview:addPicBtn];
-    
-    UIView *downLineView = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.workPicView.frame) + 20, ScreenWidth, 0.5)];
-    downLineView.backgroundColor = RGBValueColor(0xdfdfdf, 1.0);
-    [scrollView addSubview:downLineView];
-    
-    //
-    UILabel *priceTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, CGRectGetMaxY(downLineView.frame) + 20, 50, 15)];
-    priceTitleLabel.text = @"价格:";
-    priceTitleLabel.font = [UIFont systemFontOfSize:15];
-    priceTitleLabel.textColor = RGBValueColor(0x333333, 1.0);
-    [scrollView addSubview:priceTitleLabel];
-    
-    UITextField *priceTF = [[UITextField alloc] initWithFrame:CGRectMake(CGRectGetMaxX(priceTitleLabel.frame), CGRectGetMaxY(downLineView.frame) + 20, 100, 15)];
+
+
+    UIView *priceContainer = [[UIView alloc] initWithFrame:CGRectMake(20, CGRectGetMaxY(self.workPicView.frame) + 20, ScreenWidth - 40, 60)];
+    priceContainer.layer.backgroundColor = [UIColor colorWithRed:255 / 255.0 green:255 / 255.0 blue:255 / 255.0 alpha:1].CGColor;
+    priceContainer.layer.cornerRadius = 8;
+    [scrollView addSubview:priceContainer];
+
+
+    UITextField *priceTF = [[UITextField alloc] init];
     priceTF.textAlignment = NSTextAlignmentLeft;
     priceTF.keyboardType = UIKeyboardTypeDecimalPad;
-    priceTF.font = [UIFont systemFontOfSize:15];
-    priceTF.textColor = RGBValueColor(0x333333, 1.0);
-    priceTF.placeholder = @"请填写价格";
+    priceTF.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
+    priceTF.textColor = [UIColor blackColor];
+
+    NSAttributedString *attrString = [[NSAttributedString alloc] initWithString:@"请填写价格"
+                                                                     attributes:@{NSForegroundColorAttributeName: [UIColor colorWithHexString:@"#999999"], NSFontAttributeName: [UIFont systemFontOfSize:14]}];
+    priceTF.attributedPlaceholder = attrString;
     priceTF.tag = 700;
     priceTF.delegate = self;
-    [scrollView addSubview:priceTF];
+    [priceContainer addSubview:priceTF];
+    [priceTF mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.equalTo(priceContainer).offset(20);
+        make.right.equalTo(priceContainer).offset(-120);
+        make.centerY.equalTo(priceContainer);
+        make.height.equalTo(priceContainer);
+    }];
     self.priceTF = priceTF;
-    
-    UILabel *unitLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.priceTF.frame), CGRectGetMaxY(downLineView.frame) + 20, 100, 15)];
-    unitLabel.textAlignment = NSTextAlignmentLeft;
+
+    UILabel *unitLabel = [[UILabel alloc] init];
+    unitLabel.textAlignment = NSTextAlignmentCenter;
     unitLabel.text = @"元/小时";
-    unitLabel.font = [UIFont systemFontOfSize:15];
-    unitLabel.textColor = RGBValueColor(0x333333, 1.0);
-    [scrollView addSubview:unitLabel];
-    
-    //
-    UIButton *postBtn = [UIButton buttonWithType:UIButtonTypeCustom];
-    postBtn.frame = CGRectMake(20, CGRectGetMaxY(priceTitleLabel.frame) + 70, ScreenWidth - 40, 45);
-    [postBtn setBackgroundImage:[UIImage imageNamed:@"anniu"] forState:UIControlStateNormal];
+    unitLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
+    unitLabel.textColor = [UIColor blackColor];
+    [priceContainer addSubview:unitLabel];
+    [unitLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.right.equalTo(priceContainer);
+        make.centerY.equalTo(priceContainer);
+        make.width.mas_equalTo(100);
+    }];
+
+    UILabel *remark = [[UILabel alloc] initWithFrame:CGRectMake(20, CGRectGetMaxY(priceContainer.frame) + 20, ScreenWidth - 40, 144)];
+    remark.numberOfLines = 0;
+    remark.font = [UIFont systemFontOfSize:13];
+    remark.textColor = [UIColor colorWithHexString:@"#808080"];
+    remark.text = @"说明:\n模特技能价格自行定价,可通过与顾客视频面试协商后及时修改;\n商演结束,模特提取定价金额的70%;\n模特接单后,如用户出现临时取消或修改等,模特可得到订单金额的20%作为补偿。\n如出现商演迟到、未达到用户要求等争议问题,接受协商解决。";
+    [scrollView addSubview:remark];
+
+    UIButton *btnAgree = [[UIButton alloc] initWithFrame:CGRectMake(20, CGRectGetMaxY(remark.frame) + 15, 124, 20)];
+    [btnAgree setImage:[UIImage imageNamed:@"btn_allow"] forState:UIControlStateNormal];
+    [btnAgree setImage:[UIImage imageNamed:@"btn_allow_check"] forState:UIControlStateSelected];
+    [btnAgree setTitle:@"我已知晓并同意" forState:UIControlStateNormal];
+    [btnAgree setTitleColor:[UIColor colorWithHexString:@"#FF4095"] forState:UIControlStateNormal];
+    btnAgree.titleLabel.font = [UIFont systemFontOfSize:13];
+    btnAgree.imageEdgeInsets = UIEdgeInsetsMake(0, -5, 0, 0);
+    btnAgree.titleEdgeInsets = UIEdgeInsetsMake(0, 0, 0, -5);
+    [btnAgree addTarget:self action:@selector(allow:) forControlEvents:UIControlEventTouchUpInside];
+    [scrollView addSubview:btnAgree];
+    self.btnAgree = btnAgree;
+
+
+    UIButton *postBtn = [[UIButton alloc] initWithFrame:CGRectMake(20, CGRectGetMaxY(remark.frame) + 70, ScreenWidth - 40, 44)];
+    postBtn.layer.backgroundColor = [UIColor colorWithRed:255 / 255.0 green:64 / 255.0 blue:149 / 255.0 alpha:1].CGColor;
+    postBtn.layer.cornerRadius = 22;
+    postBtn.layer.shadowColor = [UIColor colorWithRed:255 / 255.0 green:64 / 255.0 blue:149 / 255.0 alpha:0.36].CGColor;
+    postBtn.layer.shadowOffset = CGSizeMake(0, 8);
+    postBtn.layer.shadowOpacity = 1;
+    postBtn.layer.shadowRadius = 10;
+    postBtn.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
     [postBtn setTitle:@"确认发布" forState:UIControlStateNormal];
     [postBtn setTitleColor:RGBValueColor(0xffffff, 1.0) forState:UIControlStateNormal];
     [postBtn addTarget:self action:@selector(postBtnAction) forControlEvents:UIControlEventTouchUpInside];
     [scrollView addSubview:postBtn];
-    
-    //
-    UILabel *instructionsLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, CGRectGetMaxY(postBtn.frame) + 16, ScreenWidth - 40, 12)];
-    instructionsLabel.text = @"说明:请勿发布违反国家法规的内容";
-    instructionsLabel.font = [UIFont systemFontOfSize:12];
-    instructionsLabel.textColor = RGBValueColor(0x333333, 1.0);
-    [scrollView addSubview:instructionsLabel];
+
+    scrollView.contentSize = CGSizeMake(ScreenWidth, 905);
+}
+
+- (void)allow:(UIButton *)button {
+    button.selected = !button.selected;
 }
 
 #pragma mark -- 选中的工作方式
+
 - (void)selectedAmountBtnAction:(UIButton *)sender {
-    
+
     skillPk = [self.skillArray[sender.tag] objectForKey:@"pk"];
     self.workTypeTF.text = sender.currentTitle;
-    
+
     self.selectedWorkTypeBtn.selected = NO;
     sender.selected = !sender.selected;
     self.selectedWorkTypeBtn = sender;
 }
 
 #pragma mark -- 确认发布
+
 - (void)postBtnAction {
     NSLog(@"确认发布");
     if (self.workTypeTF.text.length == 0) {
@@ -215,17 +246,22 @@
         [MBProgressHUD showOnlyText:@"请填写价格" controller:self];
         return;
     }
+    if (!self.btnAgree.isSelected) {
+        [MBProgressHUD showOnlyText:@"请选择同意" controller:self];
+        return;
+    }
     [self postDataFromNetworking];
 }
 
 #pragma mark -- 获取技能标签
--(void)getSkillFromNetworking{
+
+- (void)getSkillFromNetworking {
     // 获取技能标签
     [YanCNetWorkManager requestGETWithURLStr:Url_getSkill(PublicUrl) parameters:nil finish:^(id dataDic) {
-        
+
         NSString *issuccess = dataDic[@"msg"];
         if ([issuccess isEqualToString:@"success"]) {
-            
+
             self.skillArray = dataDic[@"data"];
             //设置子试图
             [self creatSubViews];
@@ -233,23 +269,24 @@
             [MBProgressHUD hideHUDForView:self.view animated:YES];
             [MBProgressHUD showInfo:@"请求失败!"];
         }
-    } enError:^(NSError *error) {
+    }                                enError:^(NSError *error) {
         [MBProgressHUD hideHUDForView:self.view animated:YES];
     }];
 }
 
 #pragma mark -- 发布技能
+
 - (void)postDataFromNetworking {
-    
+
     ModelUser *modelUser = [ModelUser user];
     NSString *price = [NSString stringWithFormat:@"%@", self.priceTF.text];
     NSMutableDictionary *parameterDic = [NSMutableDictionary dictionaryWithCapacity:0];
-    [parameterDic setObject:modelUser.modelpk forKey:@"modelpk"];
-    [parameterDic setObject:self.imageStr forKey:@"skillphoto"]; //返回的url
-    [parameterDic setObject:skillPk forKey:@"skillpk"];
-    [parameterDic setObject:price forKey:@"price"];
-    [parameterDic setObject:@"元/小时" forKey:@"unit"];
-    
+    parameterDic[@"modelpk"] = modelUser.modelpk;
+    parameterDic[@"skillphoto"] = self.imageStr; //返回的url
+    parameterDic[@"skillpk"] = skillPk;
+    parameterDic[@"price"] = price;
+    parameterDic[@"unit"] = @"元/小时";
+
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
     [YanCNetWorkManager requestPostWithURLStr:Url_addskill(PublicUrl) parameters:parameterDic finish:^(id dataDic) {
         [MBProgressHUD hideHUDForView:self.view animated:YES];
@@ -257,18 +294,19 @@
         NSString *issuccess = dataDic[@"msg"];
         if ([issuccess isEqualToString:@"success"]) {
             [MBProgressHUD showInfo:@"发布成功!"];
-            
+
             [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(backClick) userInfo:nil repeats:NO];
         } else {
             [MBProgressHUD showInfo:@"请求失败!"];
         }
-    } enError:^(NSError *error) {
+    }                                 enError:^(NSError *error) {
         [MBProgressHUD hideHUDForView:self.view animated:YES];
         NSLog(@"error = %@", error);
     }];
 }
 
 #pragma mark -- 添加工作照
+
 - (void)addPicBtnAction {
     NSLog(@"添加工作照");
     [self changeHeaderPicture];
@@ -276,20 +314,21 @@
 
 #pragma mark -- 获取图片
 #pragma mark - 更换头像的方法
+
 - (void)changeHeaderPicture {
-    
+
     UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"温馨提示" message:nil preferredStyle:(UIAlertControllerStyleActionSheet)];
     // 设置按钮
-    UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"从相册中选择" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
+    UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"从相册中选择" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction *_Nonnull action) {
         NSLog(@"选择相册");
         [self pickerPictureFromPhotoLibrary];
     }];
-    
-    UIAlertAction *action2 = [UIAlertAction actionWithTitle:@"使用相机拍摄" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
+
+    UIAlertAction *action2 = [UIAlertAction actionWithTitle:@"使用相机拍摄" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction *_Nonnull action) {
         NSLog(@"请选择相机");
         [self pickerPictureFromCamera];
     }];
-    
+
     UIAlertAction *action3 = [UIAlertAction actionWithTitle:@"取消" style:(UIAlertActionStyleCancel) handler:nil];
     [alertController addAction:action1];
     [alertController addAction:action2];
@@ -307,7 +346,7 @@
     pickerVC.allowsEditing = YES;
     // 设置代理
     pickerVC.delegate = self;
-    
+
     [self presentViewController:pickerVC animated:YES completion:nil];
 }
 
@@ -327,37 +366,38 @@
     pickerVC.allowsEditing = YES;
     // 设置代理
     pickerVC.delegate = self;
-    
+
     [self presentViewController:pickerVC animated:YES completion:nil];
 }
 
 #pragma mark - UIImagePickerControllerDelegate的代理方法
-- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info {
+
+- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *, id> *)info {
     //    // info存储的是我们要的图片, 而图片是编辑后要得到的, 所以使用UIImagePickerControllerEditedImage
     //先要把头像上传,若上传成功了,就把这个图片给显示出来
-    
+
     //先要把头像上传,若上传成功了,就把这个图片给显示出来
     [self dismissViewControllerAnimated:YES completion:^{
-        
+
         NSString *mediaType = info[UIImagePickerControllerMediaType];
         if ([mediaType isEqualToString:@"public.image"]) {
             NSLog(@"image...");
             //获取图片原图
-            UIImage *original = [info objectForKey:UIImagePickerControllerEditedImage];
+            UIImage *original = info[UIImagePickerControllerEditedImage];
             //设置压缩的image的尺寸
             CGSize imagesize = original.size;
             imagesize.width = 100;
             imagesize.height = 100;
             //对图片大小进行压缩
             UIImage *newImg = [self imageWithImage:original scaledToSize:imagesize];
-            NSData *imageData = UIImageJPEGRepresentation(newImg,1);
-            
+            NSData *imageData = UIImageJPEGRepresentation(newImg, 1);
+
 
             //            UIImage *selectImg = [[UIImage alloc] init];
             UIImage *selectImg = [UIImage imageWithData:imageData];
 //            NSLog(@"selectImg:%@",selectImg);
             self.workPicView.image = selectImg;
-     
+
             [self postPicDataWithNetworkingWith:newImg];
         }
     }];
@@ -366,9 +406,9 @@
 //用户取消退出picker时候调用
 
 - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
-    NSLog(@"picker = %@",picker);
+    NSLog(@"picker = %@", picker);
     [self dismissViewControllerAnimated:YES completion:^{
-        
+
     }];
 }
 
@@ -376,36 +416,37 @@
 - (UIImage *)imageWithImage:(UIImage *)image scaledToSize:(CGSize)newSize {
     // Create a graphics image context
     UIGraphicsBeginImageContext(newSize);
-    
+
     // Tell the old image to draw in this new context, with the desired
     // new size
-    [image drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];
-    
+    [image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)];
+
     // Get the new image from the context
-    UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
-    
+    UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
+
     // End the context
     UIGraphicsEndImageContext();
-    
+
     // Return the new image.
     return newImage;
 }
 
 #pragma mark -- 上传图片
+
 - (void)postPicDataWithNetworkingWith:(UIImage *)image {
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
-    
+
     [YanCNetWorkManager requestPostWithURLStr:Url_skillphoto(PublicUrl) fileData:image name:@"skillImage" fileName:@"111.png" mimeType:@"image/jpg/png" parameters:nil finish:^(id dataDic) {
         [MBProgressHUD hideHUDForView:self.view animated:YES];
 
         NSString *issuccess = dataDic[@"msg"];
         if ([issuccess isEqualToString:@"success"]) {
             self.imageStr = [NSString stringWithFormat:@"%@", dataDic[@"img"]];
-            
+
         } else {
             [MBProgressHUD showInfo:@"请求失败!"];
         }
-    } enError:^(NSError *error) {
+    }                                 enError:^(NSError *error) {
         [MBProgressHUD hideHUDForView:self.view animated:YES];
     }];
 }
@@ -417,14 +458,15 @@
  }
  */
 #pragma mark ----- UITextFieldDelegate
+
 - (void)textFieldDidEndEditing:(UITextField *)textField {
     NSLog(@"textField.text = %@", textField.text);
 }
 
 - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
     if (textField.tag == 700) {
-        if(![self isValidAboutInputText:textField shouldChangeCharactersInRange:range replacementString:string decimalNumber:2]) {
-            
+        if (![self isValidAboutInputText:textField shouldChangeCharactersInRange:range replacementString:string decimalNumber:2]) {
+
             return NO;
         }
     }
@@ -434,46 +476,46 @@
 //输入框中只能输入数字和小数点,且小数点只能输入一位,参数number 可以设置小数的位数,该函数在-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string调用;
 
 - (BOOL)isValidAboutInputText:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string decimalNumber:(NSInteger)number {
-    
-    NSScanner      *scanner    = [NSScanner scannerWithString:string];
+
+    NSScanner *scanner = [NSScanner scannerWithString:string];
     NSCharacterSet *numbers;
-    NSRange         pointRange = [textField.text rangeOfString:@"."];
-    if ( (pointRange.length > 0) && (pointRange.location < range.location  || pointRange.location > range.location + range.length) ){
+    NSRange pointRange = [textField.text rangeOfString:@"."];
+    if ((pointRange.length > 0) && (pointRange.location < range.location || pointRange.location > range.location + range.length)) {
         numbers = [NSCharacterSet characterSetWithCharactersInString:@"0123456789"];
-    }else{
+    } else {
         numbers = [NSCharacterSet characterSetWithCharactersInString:@"0123456789."];
     }
-    if ( [textField.text isEqualToString:@""] && [string isEqualToString:@"."] ){
+    if ([textField.text isEqualToString:@""] && [string isEqualToString:@"."]) {
         return NO;
     }
     short remain = number; //保留 number位小数
     NSString *tempStr = [textField.text stringByAppendingString:string];
     NSUInteger strlen = [tempStr length];
-    if(pointRange.length > 0 && pointRange.location > 0){ //判断输入框内是否含有“.”。
-        if([string isEqualToString:@"."]){ //当输入框内已经含有“.”时,如果再输入“.”则被视为无效。
+    if (pointRange.length > 0 && pointRange.location > 0) { //判断输入框内是否含有“.”。
+        if ([string isEqualToString:@"."]) { //当输入框内已经含有“.”时,如果再输入“.”则被视为无效。
             return NO;
         }
-        if(strlen > 0 && (strlen - pointRange.location) > remain+1){ //当输入框内已经含有“.”,当字符串长度减去小数点前面的字符串长度大于需要要保留的小数点位数,则视当次输入无效。
+        if (strlen > 0 && (strlen - pointRange.location) > remain + 1) { //当输入框内已经含有“.”,当字符串长度减去小数点前面的字符串长度大于需要要保留的小数点位数,则视当次输入无效。
             return NO;
         }
     }
     NSRange zeroRange = [textField.text rangeOfString:@"0"];
-    if(zeroRange.length == 1 && zeroRange.location == 0){ //判断输入框第一个字符是否为“0”
-        if(![string isEqualToString:@"0"] && ![string isEqualToString:@"."] && [textField.text length] == 1){ //当输入框只有一个字符并且字符为“0”时,再输入不为“0”或者“.”的字符时,则将此输入替换输入框的这唯一字符。
+    if (zeroRange.length == 1 && zeroRange.location == 0) { //判断输入框第一个字符是否为“0”
+        if (![string isEqualToString:@"0"] && ![string isEqualToString:@"."] && [textField.text length] == 1) { //当输入框只有一个字符并且字符为“0”时,再输入不为“0”或者“.”的字符时,则将此输入替换输入框的这唯一字符。
             textField.text = string;
             return NO;
-        }else{
-            if(pointRange.length == 0 && pointRange.location > 0){ //当输入框第一个字符为“0”时,并且没有“.”字符时,如果当此输入的字符为“0”,则视当此输入无效。
-                if([string isEqualToString:@"0"]){
+        } else {
+            if (pointRange.length == 0 && pointRange.location > 0) { //当输入框第一个字符为“0”时,并且没有“.”字符时,如果当此输入的字符为“0”,则视当此输入无效。
+                if ([string isEqualToString:@"0"]) {
                     return NO;
                 }
             }
         }
     }
     NSString *buffer;
-    if ( ![scanner scanCharactersFromSet:numbers intoString:&buffer] && ([string length] != 0) ){
+    if (![scanner scanCharactersFromSet:numbers intoString:&buffer] && ([string length] != 0)) {
         return NO;
-    }else{
+    } else {
         return YES;
     }
 }

+ 1 - 1
model/Classes/Controllers/Controller/MyTeamVC/MyMemberController.m

@@ -59,7 +59,7 @@ static NSString *cellId = @"MyTeamCell";
 - (UIView *)tableHeader {
     if(!_tableHeader){
         _tableHeader = [[MyTeamHeader alloc] init];
-        _tableHeader.frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 107);
+        _tableHeader.frame = CGRectMake(0, 0, ScreenWidth, 107);
     }
     return _tableHeader;
 }

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor