Fenix Wang il y a 8 ans
Parent
commit
66f2847b98
47 fichiers modifiés avec 2209 ajouts et 63 suppressions
  1. BIN
      NIMDemo/NIM.xcworkspace/xcuserdata/Fenix.xcuserdatad/UserInterfaceState.xcuserstate
  2. 0 16
      NIMDemo/NIM.xcworkspace/xcuserdata/Fenix.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  3. 80 0
      NIMDemo/NIMDemo.xcodeproj/project.pbxproj
  4. 28 0
      NIMDemo/NIMDemo/Base.lproj/Main.storyboard
  5. 1 1
      NIMDemo/NIMDemo/Classes/Sections/Session/Model/Object/NTESGiftAttachment.m
  6. 9 1
      NIMDemo/NIMDemo/Classes/Sections/Session/ViewController/NTESSessionViewController.m
  7. 16 0
      NIMDemo/NIMDemo/GroupInfoViewController.h
  8. 401 0
      NIMDemo/NIMDemo/GroupInfoViewController.m
  9. 4 4
      NIMDemo/NIMDemo/HttpRequest/HttpRequest.h
  10. 14 8
      NIMDemo/NIMDemo/HttpRequest/HttpRequest.m
  11. 16 0
      NIMDemo/NIMDemo/SectionGroup/GroupDescTableViewCell.h
  12. 61 0
      NIMDemo/NIMDemo/SectionGroup/GroupDescTableViewCell.m
  13. 15 0
      NIMDemo/NIMDemo/SectionGroup/GroupIntroViewController.h
  14. 52 0
      NIMDemo/NIMDemo/SectionGroup/GroupIntroViewController.m
  15. 16 0
      NIMDemo/NIMDemo/SectionGroup/GroupMenberCountTableViewCell.h
  16. 59 0
      NIMDemo/NIMDemo/SectionGroup/GroupMenberCountTableViewCell.m
  17. 16 0
      NIMDemo/NIMDemo/SectionGroup/GroupMenberIcon.h
  18. 55 0
      NIMDemo/NIMDemo/SectionGroup/GroupMenberIcon.m
  19. 16 0
      NIMDemo/NIMDemo/SectionGroup/GroupMenberTableViewCell.h
  20. 68 0
      NIMDemo/NIMDemo/SectionGroup/GroupMenberTableViewCell.m
  21. 16 0
      NIMDemo/NIMDemo/SectionGroup/GroupNameTableViewCell.h
  22. 50 0
      NIMDemo/NIMDemo/SectionGroup/GroupNameTableViewCell.m
  23. 16 0
      NIMDemo/NIMDemo/SectionGroup/GroupToogleTableViewCell.h
  24. 93 0
      NIMDemo/NIMDemo/SectionGroup/GroupToogleTableViewCell.m
  25. 33 0
      NIMDemo/NIMDemo/SectionTrade/MyTradeTableViewCell.m
  26. 2 0
      NIMDemo/NIMDemo/SectionTrade/MyTradeViewController.m
  27. 1 0
      NIMDemo/NIMDemo/SectionTrade/TradeData.h
  28. 1 0
      NIMDemo/NIMDemo/SectionTrade/TradeData.m
  29. 16 0
      NIMDemo/NIMDemo/SectionTrade/TradeDetailViewController.h
  30. 229 0
      NIMDemo/NIMDemo/SectionTrade/TradeDetailViewController.m
  31. 27 0
      NIMDemo/NIMDemo/SectionTrade/TradeModifyImageView.h
  32. 39 0
      NIMDemo/NIMDemo/SectionTrade/TradeModifyImageView.m
  33. 16 0
      NIMDemo/NIMDemo/SectionTrade/TradeModifyViewController.h
  34. 396 0
      NIMDemo/NIMDemo/SectionTrade/TradeModifyViewController.m
  35. 7 0
      NIMDemo/NIMDemo/SectionTrade/TradePublishManager.h
  36. 93 2
      NIMDemo/NIMDemo/SectionTrade/TradePublishManager.m
  37. 12 2
      NIMDemo/NIMDemo/SectionTrade/TradeTableViewCell.m
  38. 17 0
      NIMDemo/NIMDemo/SectionTrade/TradeUtil.h
  39. 59 0
      NIMDemo/NIMDemo/SectionTrade/TradeUtil.m
  40. 1 1
      NIMDemo/NIMDemo/SectionTrade/TradeViewController.m
  41. 42 21
      NIMDemo/NIMDemo/SocialDetailTableViewCell.m
  42. 4 2
      NIMDemo/NIMDemo/SocialTableViewCell.m
  43. 22 1
      NIMDemo/NIMDemo/User.h
  44. 85 1
      NIMDemo/NIMDemo/User.m
  45. 3 0
      NIMKit/NIMKit/Classes/Sections/Input/GiftInputContainer.h
  46. 1 2
      NIMKit/NIMKit/Classes/Sections/Input/GiftInputContainer.m
  47. 1 1
      NIMKit/NIMKit/Classes/Sections/Input/TradeInputContainer.m

BIN
NIMDemo/NIM.xcworkspace/xcuserdata/Fenix.xcuserdatad/UserInterfaceState.xcuserstate


+ 0 - 16
NIMDemo/NIM.xcworkspace/xcuserdata/Fenix.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -6,22 +6,6 @@
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "../../../../Fenix/XCode_Project/NIM_iOS_Demo_v3/NIMDemo/NIMDemo/Classes/Sections/Session/Config/NTESSessionConfig.m"
-            timestampString = "520852838.293649"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "87"
-            endingLineNumber = "87"
-            landmarkName = "-shouldHandleReceiptForMessage:"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"

+ 80 - 0
NIMDemo/NIMDemo.xcodeproj/project.pbxproj

@@ -212,6 +212,18 @@
 		C482C3101F0CAE7300EF2B71 /* TradeTopBarItem.m in Sources */ = {isa = PBXBuildFile; fileRef = C482C30F1F0CAE7300EF2B71 /* TradeTopBarItem.m */; };
 		C482C3131F0CD37E00EF2B71 /* SocialTopTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C482C3121F0CD37E00EF2B71 /* SocialTopTableViewCell.m */; };
 		C482C3161F0DD21500EF2B71 /* GroupCardViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C482C3151F0DD21500EF2B71 /* GroupCardViewController.m */; };
+		C482C3191F10A00900EF2B71 /* GroupInfoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C482C3181F10A00900EF2B71 /* GroupInfoViewController.m */; };
+		C482C31D1F13354600EF2B71 /* GroupNameTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C482C31C1F13354600EF2B71 /* GroupNameTableViewCell.m */; };
+		C482C3201F13534700EF2B71 /* GroupDescTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C482C31F1F13534700EF2B71 /* GroupDescTableViewCell.m */; };
+		C482C3231F13577200EF2B71 /* GroupIntroViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C482C3221F13577200EF2B71 /* GroupIntroViewController.m */; };
+		C482C3261F135D0600EF2B71 /* GroupMenberCountTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C482C3251F135D0600EF2B71 /* GroupMenberCountTableViewCell.m */; };
+		C482C3291F13652C00EF2B71 /* GroupMenberTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C482C3281F13652C00EF2B71 /* GroupMenberTableViewCell.m */; };
+		C482C32C1F13686A00EF2B71 /* GroupMenberIcon.m in Sources */ = {isa = PBXBuildFile; fileRef = C482C32B1F13686A00EF2B71 /* GroupMenberIcon.m */; };
+		C482C32F1F13716A00EF2B71 /* GroupToogleTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C482C32E1F13716A00EF2B71 /* GroupToogleTableViewCell.m */; };
+		C482C3321F14749800EF2B71 /* TradeUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = C482C3311F14749800EF2B71 /* TradeUtil.m */; };
+		C482C3351F14817500EF2B71 /* TradeDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C482C3341F14817500EF2B71 /* TradeDetailViewController.m */; };
+		C482C3381F14B32300EF2B71 /* TradeModifyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C482C3371F14B32300EF2B71 /* TradeModifyViewController.m */; };
+		C482C33B1F14B43A00EF2B71 /* TradeModifyImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = C482C33A1F14B43A00EF2B71 /* TradeModifyImageView.m */; };
 		C4A734601EE6BBD300D6489D /* GroupMoreTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C4A7345F1EE6BBD300D6489D /* GroupMoreTableViewController.m */; };
 		C4A734631EE6D4DE00D6489D /* GroupMoreTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C4A734621EE6D4DE00D6489D /* GroupMoreTableViewCell.m */; };
 		C4A7D3661EE803E7009B5849 /* FriendViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C4A7D3651EE803E6009B5849 /* FriendViewController.m */; };
@@ -638,6 +650,30 @@
 		C482C3121F0CD37E00EF2B71 /* SocialTopTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SocialTopTableViewCell.m; sourceTree = "<group>"; };
 		C482C3141F0DD21500EF2B71 /* GroupCardViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupCardViewController.h; sourceTree = "<group>"; };
 		C482C3151F0DD21500EF2B71 /* GroupCardViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GroupCardViewController.m; sourceTree = "<group>"; };
+		C482C3171F10A00900EF2B71 /* GroupInfoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupInfoViewController.h; sourceTree = "<group>"; };
+		C482C3181F10A00900EF2B71 /* GroupInfoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GroupInfoViewController.m; sourceTree = "<group>"; };
+		C482C31B1F13354600EF2B71 /* GroupNameTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GroupNameTableViewCell.h; path = ../../../../../fenix/XCode_Project/NIM_iOS_Demo_v3/NIMDemo/NIMDemo/SectionGroup/GroupNameTableViewCell.h; sourceTree = "<group>"; };
+		C482C31C1F13354600EF2B71 /* GroupNameTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GroupNameTableViewCell.m; path = ../../../../../fenix/XCode_Project/NIM_iOS_Demo_v3/NIMDemo/NIMDemo/SectionGroup/GroupNameTableViewCell.m; sourceTree = "<group>"; };
+		C482C31E1F13534700EF2B71 /* GroupDescTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GroupDescTableViewCell.h; path = ../../../../../fenix/XCode_Project/NIM_iOS_Demo_v3/NIMDemo/NIMDemo/SectionGroup/GroupDescTableViewCell.h; sourceTree = "<group>"; };
+		C482C31F1F13534700EF2B71 /* GroupDescTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GroupDescTableViewCell.m; path = ../../../../../fenix/XCode_Project/NIM_iOS_Demo_v3/NIMDemo/NIMDemo/SectionGroup/GroupDescTableViewCell.m; sourceTree = "<group>"; };
+		C482C3211F13577200EF2B71 /* GroupIntroViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GroupIntroViewController.h; path = ../../../../../fenix/XCode_Project/NIM_iOS_Demo_v3/NIMDemo/NIMDemo/SectionGroup/GroupIntroViewController.h; sourceTree = "<group>"; };
+		C482C3221F13577200EF2B71 /* GroupIntroViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GroupIntroViewController.m; path = ../../../../../fenix/XCode_Project/NIM_iOS_Demo_v3/NIMDemo/NIMDemo/SectionGroup/GroupIntroViewController.m; sourceTree = "<group>"; };
+		C482C3241F135D0600EF2B71 /* GroupMenberCountTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GroupMenberCountTableViewCell.h; path = ../../../../../fenix/XCode_Project/NIM_iOS_Demo_v3/NIMDemo/NIMDemo/SectionGroup/GroupMenberCountTableViewCell.h; sourceTree = "<group>"; };
+		C482C3251F135D0600EF2B71 /* GroupMenberCountTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GroupMenberCountTableViewCell.m; path = ../../../../../fenix/XCode_Project/NIM_iOS_Demo_v3/NIMDemo/NIMDemo/SectionGroup/GroupMenberCountTableViewCell.m; sourceTree = "<group>"; };
+		C482C3271F13652C00EF2B71 /* GroupMenberTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GroupMenberTableViewCell.h; path = ../../../../../fenix/XCode_Project/NIM_iOS_Demo_v3/NIMDemo/NIMDemo/SectionGroup/GroupMenberTableViewCell.h; sourceTree = "<group>"; };
+		C482C3281F13652C00EF2B71 /* GroupMenberTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GroupMenberTableViewCell.m; path = ../../../../../fenix/XCode_Project/NIM_iOS_Demo_v3/NIMDemo/NIMDemo/SectionGroup/GroupMenberTableViewCell.m; sourceTree = "<group>"; };
+		C482C32A1F13686A00EF2B71 /* GroupMenberIcon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GroupMenberIcon.h; path = ../../../../../fenix/XCode_Project/NIM_iOS_Demo_v3/NIMDemo/NIMDemo/SectionGroup/GroupMenberIcon.h; sourceTree = "<group>"; };
+		C482C32B1F13686A00EF2B71 /* GroupMenberIcon.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GroupMenberIcon.m; path = ../../../../../fenix/XCode_Project/NIM_iOS_Demo_v3/NIMDemo/NIMDemo/SectionGroup/GroupMenberIcon.m; sourceTree = "<group>"; };
+		C482C32D1F13716A00EF2B71 /* GroupToogleTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GroupToogleTableViewCell.h; path = ../../../../../fenix/XCode_Project/NIM_iOS_Demo_v3/NIMDemo/NIMDemo/SectionGroup/GroupToogleTableViewCell.h; sourceTree = "<group>"; };
+		C482C32E1F13716A00EF2B71 /* GroupToogleTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GroupToogleTableViewCell.m; path = ../../../../../fenix/XCode_Project/NIM_iOS_Demo_v3/NIMDemo/NIMDemo/SectionGroup/GroupToogleTableViewCell.m; sourceTree = "<group>"; };
+		C482C3301F14749800EF2B71 /* TradeUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TradeUtil.h; path = ../../../../../fenix/XCode_Project/NIM_iOS_Demo_v3/NIMDemo/NIMDemo/SectionTrade/TradeUtil.h; sourceTree = "<group>"; };
+		C482C3311F14749800EF2B71 /* TradeUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TradeUtil.m; path = ../../../../../fenix/XCode_Project/NIM_iOS_Demo_v3/NIMDemo/NIMDemo/SectionTrade/TradeUtil.m; sourceTree = "<group>"; };
+		C482C3331F14817500EF2B71 /* TradeDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TradeDetailViewController.h; path = ../../../../../fenix/XCode_Project/NIM_iOS_Demo_v3/NIMDemo/NIMDemo/SectionTrade/TradeDetailViewController.h; sourceTree = "<group>"; };
+		C482C3341F14817500EF2B71 /* TradeDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TradeDetailViewController.m; path = ../../../../../fenix/XCode_Project/NIM_iOS_Demo_v3/NIMDemo/NIMDemo/SectionTrade/TradeDetailViewController.m; sourceTree = "<group>"; };
+		C482C3361F14B32300EF2B71 /* TradeModifyViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TradeModifyViewController.h; path = ../../../../../fenix/XCode_Project/NIM_iOS_Demo_v3/NIMDemo/NIMDemo/SectionTrade/TradeModifyViewController.h; sourceTree = "<group>"; };
+		C482C3371F14B32300EF2B71 /* TradeModifyViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TradeModifyViewController.m; path = ../../../../../fenix/XCode_Project/NIM_iOS_Demo_v3/NIMDemo/NIMDemo/SectionTrade/TradeModifyViewController.m; sourceTree = "<group>"; };
+		C482C3391F14B43A00EF2B71 /* TradeModifyImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TradeModifyImageView.h; path = ../../../../../fenix/XCode_Project/NIM_iOS_Demo_v3/NIMDemo/NIMDemo/SectionTrade/TradeModifyImageView.h; sourceTree = "<group>"; };
+		C482C33A1F14B43A00EF2B71 /* TradeModifyImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TradeModifyImageView.m; path = ../../../../../fenix/XCode_Project/NIM_iOS_Demo_v3/NIMDemo/NIMDemo/SectionTrade/TradeModifyImageView.m; sourceTree = "<group>"; };
 		C4A7345E1EE6BBD300D6489D /* GroupMoreTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupMoreTableViewController.h; sourceTree = "<group>"; };
 		C4A7345F1EE6BBD300D6489D /* GroupMoreTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GroupMoreTableViewController.m; sourceTree = "<group>"; };
 		C4A734611EE6D4DE00D6489D /* GroupMoreTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupMoreTableViewCell.h; sourceTree = "<group>"; };
@@ -1717,10 +1753,37 @@
 				C482C3031F0A7E8400EF2B71 /* MyTradeViewController.m */,
 				C482C3051F0B389400EF2B71 /* MyTradeTableViewCell.h */,
 				C482C3061F0B389400EF2B71 /* MyTradeTableViewCell.m */,
+				C482C3301F14749800EF2B71 /* TradeUtil.h */,
+				C482C3311F14749800EF2B71 /* TradeUtil.m */,
+				C482C3331F14817500EF2B71 /* TradeDetailViewController.h */,
+				C482C3341F14817500EF2B71 /* TradeDetailViewController.m */,
+				C482C3361F14B32300EF2B71 /* TradeModifyViewController.h */,
+				C482C3371F14B32300EF2B71 /* TradeModifyViewController.m */,
+				C482C3391F14B43A00EF2B71 /* TradeModifyImageView.h */,
+				C482C33A1F14B43A00EF2B71 /* TradeModifyImageView.m */,
 			);
 			name = SectionTrade;
 			sourceTree = "<group>";
 		};
+		C482C31A1F13349700EF2B71 /* GroupCell */ = {
+			isa = PBXGroup;
+			children = (
+				C482C31B1F13354600EF2B71 /* GroupNameTableViewCell.h */,
+				C482C31C1F13354600EF2B71 /* GroupNameTableViewCell.m */,
+				C482C31E1F13534700EF2B71 /* GroupDescTableViewCell.h */,
+				C482C31F1F13534700EF2B71 /* GroupDescTableViewCell.m */,
+				C482C3241F135D0600EF2B71 /* GroupMenberCountTableViewCell.h */,
+				C482C3251F135D0600EF2B71 /* GroupMenberCountTableViewCell.m */,
+				C482C3271F13652C00EF2B71 /* GroupMenberTableViewCell.h */,
+				C482C3281F13652C00EF2B71 /* GroupMenberTableViewCell.m */,
+				C482C32A1F13686A00EF2B71 /* GroupMenberIcon.h */,
+				C482C32B1F13686A00EF2B71 /* GroupMenberIcon.m */,
+				C482C32D1F13716A00EF2B71 /* GroupToogleTableViewCell.h */,
+				C482C32E1F13716A00EF2B71 /* GroupToogleTableViewCell.m */,
+			);
+			name = GroupCell;
+			sourceTree = "<group>";
+		};
 		C4A7D3631EE80338009B5849 /* SectionFriend */ = {
 			isa = PBXGroup;
 			children = (
@@ -1791,6 +1854,7 @@
 		C4D8F14A1ED486F2002F9F3A /* SectionGroup */ = {
 			isa = PBXGroup;
 			children = (
+				C482C31A1F13349700EF2B71 /* GroupCell */,
 				C4D4C9381ED7C3DE00ADD7B7 /* CreateGroupViewController.h */,
 				C4D4C9391ED7C3DE00ADD7B7 /* CreateGroupViewController.m */,
 				C4D4C93A1ED7C3DE00ADD7B7 /* GroupTableController.h */,
@@ -1805,6 +1869,10 @@
 				C4A734621EE6D4DE00D6489D /* GroupMoreTableViewCell.m */,
 				C482C3141F0DD21500EF2B71 /* GroupCardViewController.h */,
 				C482C3151F0DD21500EF2B71 /* GroupCardViewController.m */,
+				C482C3171F10A00900EF2B71 /* GroupInfoViewController.h */,
+				C482C3181F10A00900EF2B71 /* GroupInfoViewController.m */,
+				C482C3211F13577200EF2B71 /* GroupIntroViewController.h */,
+				C482C3221F13577200EF2B71 /* GroupIntroViewController.m */,
 			);
 			name = SectionGroup;
 			sourceTree = "<group>";
@@ -2055,6 +2123,7 @@
 				6118F5A71C5A0FC1009AF01E /* UINavigationController+Swizzling.m in Sources */,
 				C4D4C9321ED7C37F00ADD7B7 /* AppDelegate.m in Sources */,
 				C4F1D0FE1F010E1D00A04B28 /* SocialCommentData.m in Sources */,
+				C482C3191F10A00900EF2B71 /* GroupInfoViewController.m in Sources */,
 				61E4719C1B7D9C8300F4A1BF /* NTESSessionViewController.m in Sources */,
 				61E4712F1B7D963E00F4A1BF /* NTESChartletAttachment.m in Sources */,
 				8351CB721E977D9000DF4866 /* NTESContactDataCell.m in Sources */,
@@ -2066,6 +2135,7 @@
 				6195CD201A8C4D3C00F3E239 /* NSString+NTES.m in Sources */,
 				61E4712A1B7D963E00F4A1BF /* NTESLoginViewController.m in Sources */,
 				61E471111B7D963E00F4A1BF /* NTESCustomSysNotificationSender.m in Sources */,
+				C482C3261F135D0600EF2B71 /* GroupMenberCountTableViewCell.m in Sources */,
 				61E471451B7D963E00F4A1BF /* NTESGalleryViewController.m in Sources */,
 				61E4715D1B7D963E00F4A1BF /* NTESClientsTableViewController.m in Sources */,
 				C4A734601EE6BBD300D6489D /* GroupMoreTableViewController.m in Sources */,
@@ -2082,6 +2152,7 @@
 				61E471941B7D96AA00F4A1BF /* NTESService.m in Sources */,
 				61E470F61B7D963E00F4A1BF /* NTESColorButtonCell.m in Sources */,
 				61518A561CA233BB0061C4A9 /* NTESDemoService.m in Sources */,
+				C482C32C1F13686A00EF2B71 /* GroupMenberIcon.m in Sources */,
 				C4D4C9361ED7C37F00ADD7B7 /* TabBarController.m in Sources */,
 				6110D8B51C24009D00805BA4 /* UIScrollView+NTESPullToRefresh.m in Sources */,
 				61EAD9151B82FEE9005DC715 /* NTESPersonalCardViewController.m in Sources */,
@@ -2098,6 +2169,7 @@
 				610B5FBF1BADCCCD001F7EFB /* NTESBirthPickerView.m in Sources */,
 				6173AEDB1BAAD03900854D49 /* NTESUserUtil.m in Sources */,
 				61E4714E1B7D963E00F4A1BF /* NTESWhiteboardDrawView.m in Sources */,
+				C482C31D1F13354600EF2B71 /* GroupNameTableViewCell.m in Sources */,
 				C4D8F12C1ED48657002F9F3A /* AFHTTPSessionManager.m in Sources */,
 				61DA56FF1B53E33F00828B8A /* UIImage+NTES.m in Sources */,
 				C4D8F12E1ED48657002F9F3A /* AFSecurityPolicy.m in Sources */,
@@ -2122,11 +2194,13 @@
 				BDB02D261E09172F00262A50 /* NTESNetDetectViewController.m in Sources */,
 				61AEC12A1BD69C6E00B00F02 /* NTESSessionCardViewController.m in Sources */,
 				61AF8CE11C55170900BFC84F /* UIScrollView+NTESDirection.m in Sources */,
+				C482C32F1F13716A00EF2B71 /* GroupToogleTableViewCell.m in Sources */,
 				6118F5A81C5A0FC1009AF01E /* UINavigationItem+Swizzling.m in Sources */,
 				C4A734631EE6D4DE00D6489D /* GroupMoreTableViewCell.m in Sources */,
 				C482C3041F0A7E8400EF2B71 /* MyTradeViewController.m in Sources */,
 				61E471231B7D963E00F4A1BF /* NTESSystemNotificationCell.m in Sources */,
 				61206EE71C1E607B009E4C78 /* NTESChatroomListCell.m in Sources */,
+				C482C3201F13534700EF2B71 /* GroupDescTableViewCell.m in Sources */,
 				61E471191B7D963E00F4A1BF /* NTESContactUtilCell.m in Sources */,
 				61E471661B7D963E00F4A1BF /* NTESSettingPortraitCell.m in Sources */,
 				C482C3161F0DD21500EF2B71 /* GroupCardViewController.m in Sources */,
@@ -2149,6 +2223,7 @@
 				61E471341B7D963E00F4A1BF /* NTESSessionMsgConverter.m in Sources */,
 				61EAD9121B82F275005DC715 /* NTESContactAddFriendViewController.m in Sources */,
 				61C2CE521C489F0D00D76104 /* NTESChatroomManager.m in Sources */,
+				C482C3231F13577200EF2B71 /* GroupIntroViewController.m in Sources */,
 				61E4713C1B7D963E00F4A1BF /* NTESSessionJankenponContentView.m in Sources */,
 				61E471971B7D96AA00F4A1BF /* NTESPinyinConverter.m in Sources */,
 				C4246CF41F075D58008CD291 /* TradeTableViewCell.m in Sources */,
@@ -2160,12 +2235,14 @@
 				C482C3071F0B389400EF2B71 /* MyTradeTableViewCell.m in Sources */,
 				61E4712C1B7D963E00F4A1BF /* NTESRegisterViewController.m in Sources */,
 				619087091BABE5D400F3A0C7 /* NTESDevice.m in Sources */,
+				C482C3321F14749800EF2B71 /* TradeUtil.m in Sources */,
 				61B5D7EB1C21331600B52DBF /* NTESPageView.m in Sources */,
 				C4D4C93D1ED7C3DE00ADD7B7 /* GroupTableController.m in Sources */,
 				C4F1D1571F0389AA00A04B28 /* ImagePagerViewController.m in Sources */,
 				61E4713D1B7D963E00F4A1BF /* NTESSessionSnapchatContentView.m in Sources */,
 				61E471281B7D963E00F4A1BF /* NTESLoginManager.m in Sources */,
 				612CACEE1BB1484C00C348B5 /* NTESContactDataMember.m in Sources */,
+				C482C3291F13652C00EF2B71 /* GroupMenberTableViewCell.m in Sources */,
 				61E471391B7D963E00F4A1BF /* NTESSearchMessageContentCell.m in Sources */,
 				6173AEC91BAAC6CB00854D49 /* NTESGenderSettingViewController.m in Sources */,
 				C482C3101F0CAE7300EF2B71 /* TradeTopBarItem.m in Sources */,
@@ -2233,6 +2310,7 @@
 				E48988EB1DE42391001CF6C5 /* NTESSessionCustomContentConfig.m in Sources */,
 				61E471211B7D963E00F4A1BF /* NTESCustomSysNotificationViewController.m in Sources */,
 				61E471311B7D963E00F4A1BF /* NTESJanKenPonAttachment.m in Sources */,
+				C482C3381F14B32300EF2B71 /* TradeModifyViewController.m in Sources */,
 				61E471981B7D96AA00F4A1BF /* NTESSpellingCenter.m in Sources */,
 				61FB27711C4E70AA0086E0EB /* NTESChatroomMaker.m in Sources */,
 				C482C30D1F0B923300EF2B71 /* NTESSessionGiftContentView.m in Sources */,
@@ -2245,7 +2323,9 @@
 				61EEE7731C22917400022315 /* NTESChatroomMemberListViewController.m in Sources */,
 				617D015D1AEDE03900C6DB77 /* UIImage+NTESColor.m in Sources */,
 				61EAD9081B82D0A2005DC715 /* NTESTextSettingCell.m in Sources */,
+				C482C33B1F14B43A00EF2B71 /* TradeModifyImageView.m in Sources */,
 				61E471361B7D963E00F4A1BF /* NTESWhiteboardAttachment.m in Sources */,
+				C482C3351F14817500EF2B71 /* TradeDetailViewController.m in Sources */,
 				E45E17811CA8CBA500C4ED69 /* NTESLogViewController.m in Sources */,
 				907DBE851E5C777300317C36 /* NTESRecordSelectView.m in Sources */,
 				61E471151B7D963E00F4A1BF /* NTESGroupedUsrInfo.m in Sources */,

+ 28 - 0
NIMDemo/NIMDemo/Base.lproj/Main.storyboard

@@ -972,6 +972,34 @@
             </objects>
             <point key="canvasLocation" x="4879" y="-1686"/>
         </scene>
+        <!--Table View Controller-->
+        <scene sceneID="aeJ-JQ-l2F">
+            <objects>
+                <tableViewController id="EER-gL-gm5" sceneMemberID="viewController">
+                    <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="18" sectionFooterHeight="18" id="kv1-6D-SLS">
+                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
+                        <prototypes>
+                            <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="ada-wC-g6w">
+                                <rect key="frame" x="0.0" y="55.5" width="375" height="44"/>
+                                <autoresizingMask key="autoresizingMask"/>
+                                <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="ada-wC-g6w" id="Ahm-0q-uMh">
+                                    <rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
+                                    <autoresizingMask key="autoresizingMask"/>
+                                </tableViewCellContentView>
+                            </tableViewCell>
+                        </prototypes>
+                        <connections>
+                            <outlet property="dataSource" destination="EER-gL-gm5" id="iX7-No-XyW"/>
+                            <outlet property="delegate" destination="EER-gL-gm5" id="f63-0V-YLR"/>
+                        </connections>
+                    </tableView>
+                </tableViewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="cNn-bw-ujk" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="5614" y="-1991"/>
+        </scene>
         <!--Tab Bar Controller-->
         <scene sceneID="ncA-6i-C8L">
             <objects>

+ 1 - 1
NIMDemo/NIMDemo/Classes/Sections/Session/Model/Object/NTESGiftAttachment.m

@@ -96,7 +96,7 @@
     AppDelegate *appdelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
     UINavigationController* navController = (UINavigationController *)appdelegate.window.rootViewController;
     UIViewController *topViewController = navController.topViewController;
-    NSLog(@"%@", topViewController);
+//    NSLog(@"%@", topViewController);
     
     if([topViewController isKindOfClass:[NTESSessionViewController class]])
     {

+ 9 - 1
NIMDemo/NIMDemo/Classes/Sections/Session/ViewController/NTESSessionViewController.m

@@ -58,6 +58,7 @@
 #import "TradePublishManager.h"
 #import "TradeInputContainer.h"
 #import "NIMMessageMaker.h"
+#import "GroupInfoViewController.h"
 
 
 @interface NTESSessionViewController ()
@@ -188,13 +189,19 @@ TradeInputDelegate>
     User *user = [User sharedInfo];
     GiftInputContainer *giftInput = [self.sessionInputView giftContainer];
     [giftInput setBalance:user.coin];
+    
     if(self.session.sessionType == NIMSessionTypeTeam)
     {
         [giftInput setTeamId:self.session.sessionId];
+        BOOL isSystemTeam = [[User sharedInfo] isSystemTeam:self.session.sessionId];
+        giftInput.supplyBtn.hidden = !isSystemTeam;
+        giftInput.demandBtn.hidden = !isSystemTeam;
     }
     else if(self.session.sessionType == NIMSessionTypeP2P)
     {
         [giftInput setTeamId:nil];
+        giftInput.supplyBtn.hidden = YES;
+        giftInput.demandBtn.hidden = YES;
     }
 }
 
@@ -640,7 +647,8 @@ TradeInputDelegate>
     if (team.type == NIMTeamTypeNormal) {
         vc = [[NIMNormalTeamCardViewController alloc] initWithTeam:team];
     }else if(team.type == NIMTeamTypeAdvanced){
-        vc = [[NIMAdvancedTeamCardViewController alloc] initWithTeam:team];
+        //vc = [[NIMAdvancedTeamCardViewController alloc] initWithTeam:team];
+        vc = [[GroupInfoViewController alloc] initWithTeam:team];
     }
     [self.navigationController pushViewController:vc animated:YES];
 }

+ 16 - 0
NIMDemo/NIMDemo/GroupInfoViewController.h

@@ -0,0 +1,16 @@
+//
+//  GroupInfoViewController.h
+//  NIMDemo
+//
+//  Created by Fenix Wang on 2017/7/8.
+//  Copyright © 2017年 Netease. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import <NIMSDK/NIMSDK.h>
+
+@interface GroupInfoViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>
+
+- (instancetype)initWithTeam:(NIMTeam *)team;
+
+@end

+ 401 - 0
NIMDemo/NIMDemo/GroupInfoViewController.m

@@ -0,0 +1,401 @@
+//
+//  GroupInfoViewController.m
+//  NIMDemo
+//
+//  Created by Fenix Wang on 2017/7/8.
+//  Copyright © 2017年 Netease. All rights reserved.
+//
+
+#import "GroupInfoViewController.h"
+#import "UIView+NTES.h"
+#import "UIView+Toast.h"
+#import "NIMCardMemberItem.h"
+#import "GroupNameTableViewCell.h"
+#import "GroupDescTableViewCell.h"
+#import "GroupMenberCountTableViewCell.h"
+#import "GroupMenberTableViewCell.h"
+#import "GroupToogleTableViewCell.h"
+#import "User.h"
+
+
+@interface GroupInfoViewController () <UIAlertViewDelegate>
+
+@property (nonatomic, strong) UITableView           *tableView;
+@property (nonatomic, strong) NIMTeam               *team;
+@property (nonatomic, strong) NSMutableArray        *sectionArr;
+
+@property(nonatomic,strong) NIMTeamMember *myTeamInfo;
+@property(nonatomic,copy) NSArray *bodyData;
+@property(nonatomic,copy) NSArray *memberData;
+@property(nonatomic,copy) NSArray *teamMembers;
+
+
+@property (nonatomic, strong) UIButton              *quitBtn;
+
+@property (nonatomic, strong) UIAlertView           *quitTeamAlertView;
+@property (nonatomic, strong) UIAlertView           *dismissTeamAlertView;
+
+
+@end
+
+@implementation GroupInfoViewController
+
+- (instancetype)initWithTeam:(NIMTeam *)team{
+    self = [super initWithNibName:nil bundle:nil];
+    if (self) {
+        _team = team;
+    }
+    return self;
+}
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+    
+    self.view.backgroundColor = User.tinyGrayColor;
+    
+    [self.view addSubview:self.tableView];
+    [self setUpSectionData];
+}
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+
+
+- (void)setUpSectionData{
+    
+    _sectionArr = [[NSMutableArray alloc] init];
+    
+    NSMutableArray *infoArr = [[NSMutableArray alloc] init];
+    [infoArr addObject:@{@"key":@"name",
+                         @"value":_team.teamName ? _team.teamName : @"",
+                         @"title":@"群聊名称",
+                         @"height":@(44)}];
+    [infoArr addObject:@{@"key":@"intro",
+                         @"value":_team,
+                         @"title":@"群公告",
+                         @"height":@(132)}];
+    [_sectionArr addObject:infoArr];
+    
+    
+    
+    NSMutableArray *memberArr = [[NSMutableArray alloc] init];
+    [memberArr addObject:@{@"key":@"menberCount",
+                           @"value":[NSString stringWithFormat:@"%ld人", (long)_team.memberNumber],
+                           @"title":@"群聊成员",
+                           @"height":@(44)}];
+    
+    NSMutableDictionary *menberDict = [[NSMutableDictionary alloc] init];
+    [menberDict setValue:@"member" forKey:@"key"];
+    [menberDict setValue:@"群聊成员" forKey:@"title"];
+    [menberDict setValue:@(88) forKey:@"height"];
+    
+    __weak typeof(self) wself = self;
+    [self requestData:^(NSError *error, NSArray *data) {
+        [menberDict setValue:data forKey:@"list"];
+        [wself.tableView reloadData];
+    }];
+    [memberArr addObject:menberDict];
+    
+    [_sectionArr addObject:memberArr];
+
+    
+    
+    NSMutableArray *actionArr = [[NSMutableArray alloc] init];
+    [actionArr addObject:@{@"key":@"disturb",
+                           @"title":@"消息免打扰",
+                           @"team":_team,
+                           @"height":@(44)}];
+    
+    [actionArr addObject:@{@"key":@"stick",
+                           @"title":@"置顶聊天",
+                           @"team":_team,
+                           @"height":@(44)}];
+    
+    [actionArr addObject:@{@"key":@"record",
+                           @"title":@"查看聊天记录",
+                           @"value":@"",
+                           @"height":@(44)}];
+    
+    [actionArr addObject:@{@"key":@"clear",
+                           @"title":@"清空聊天记录",
+                           @"value":@"",
+                           @"height":@(44)}];
+    
+    [_sectionArr addObject:actionArr];
+    
+    
+}
+
+- (void)requestData:(void(^)(NSError *error,NSArray *data)) handler{
+    __weak typeof(self) wself = self;
+    [[NIMSDK sharedSDK].teamManager fetchTeamMembers:self.team.teamId completion:^(NSError *error, NSArray *members) {
+        NSMutableArray *array = nil;
+        if (!error) {
+            NSString *myAccount = [[NIMSDK sharedSDK].loginManager currentAccount];
+            for (NIMTeamMember *item in members) {
+                if ([item.userId isEqualToString:myAccount]) {
+                    wself.myTeamInfo = item;
+                }
+            }
+            array = [[NSMutableArray alloc]init];
+            for (NIMTeamMember *member in members) {
+                NIMTeamCardMemberItem *item = [[NIMTeamCardMemberItem alloc] initWithMember:member];
+                [array addObject:item];
+            }
+            wself.teamMembers = members;
+        }else if(error.code == NIMRemoteErrorCodeTeamNotMember){
+            [wself.view makeToast:@"你已经不在讨论组里"];
+        }else{
+            [wself.view makeToast:@"拉好友失败"];
+        }
+        wself.memberData = array;
+        handler(error,array);
+    }];
+}
+
+
+
+- (void)viewWillAppear:(BOOL)animated{
+    [super viewWillAppear:animated];
+    
+    [self.navigationItem setTitle:@"群聊设置"];
+}
+
+
+
+- (UITableView *)tableView
+{
+    if (!self.isViewLoaded) {
+        return nil;
+    }
+    if (!_tableView) {
+        float startY = [[UIApplication sharedApplication] statusBarFrame].size.height + self.navigationController.navigationBar.frame.size.height;
+        startY = 0;
+        float tabbarHeight = self.tabBarController.tabBar.frame.size.height;
+        _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, startY, self.view.width, self.view.height-tabbarHeight) style:UITableViewStyleGrouped];
+        _tableView.contentInset = UIEdgeInsetsMake(0, 0, 50, 0);
+        _tableView.backgroundColor  = [UIColor clearColor];
+        _tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+        //_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
+        _tableView.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0);
+        _tableView.dataSource = self;
+        _tableView.delegate   = self;
+        
+        _tableView.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, CGFLOAT_MIN)];
+        
+        
+        //add footer btn
+        UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.width, 54)];
+        _quitBtn = [UIButton buttonWithType:UIButtonTypeCustom];
+        _quitBtn.frame = CGRectMake(0, 0, footer.width * 2 / 3, 44);
+        _quitBtn.centerX = footer.width/2;
+        _quitBtn.centerY = footer.height/2;
+        _quitBtn.layer.cornerRadius = 22;
+        _quitBtn.backgroundColor = User.orangeColor;
+        _quitBtn.titleLabel.textColor = UIColor.whiteColor;
+        [_quitBtn addTarget:self action:@selector(onTouchQuit:) forControlEvents:UIControlEventTouchUpInside];
+        
+        if([[User sharedInfo] isTeamOwner:_team])
+            [_quitBtn setTitle:@"退出该房间" forState:UIControlStateNormal];
+        else
+            [_quitBtn setTitle:@"解散本群" forState:UIControlStateNormal];
+        
+        [footer addSubview:_quitBtn];
+        
+        [_tableView setTableFooterView:footer];
+        
+        
+        [self.view addSubview:_tableView];
+    }
+    return _tableView;
+}
+
+
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
+    return _sectionArr.count;
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+    if(_sectionArr)
+    {
+        NSMutableArray *arr = [_sectionArr objectAtIndex:section];
+        if(arr)
+        {
+            return arr.count;
+        }
+    }
+    return 0;
+}
+
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+    
+    NSMutableArray *arr = [_sectionArr objectAtIndex:indexPath.section];
+    NSDictionary *dataObj = [arr objectAtIndex:indexPath.row];
+    NSString *key = [dataObj objectForKey:@"key"];
+    float height = [[dataObj objectForKey:@"height"] floatValue];
+    
+    UITableViewCell *baseCell = nil;
+    
+    
+    if([key isEqualToString:@"name"] || [key isEqualToString:@"clear"])
+    {
+        GroupNameTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"name"];
+        if(!cell)
+        {
+            cell = [[GroupNameTableViewCell alloc] init];
+            [cell initWidth:self.view.width];
+            [cell setData:dataObj];
+        }
+        baseCell = cell;
+    }
+    else if([key isEqualToString:@"intro"])
+    {
+        GroupDescTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"intro"];
+        if(!cell)
+        {
+            cell = [[GroupDescTableViewCell alloc] init];
+            [cell initSize:self.view.width height:height];
+            [cell setData:dataObj];
+        }
+        baseCell = cell;
+    }
+    else if([key isEqualToString:@"menberCount"] || [key isEqualToString:@"record"])
+    {
+        GroupMenberCountTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"count"];
+        if(!cell)
+        {
+            cell = [[GroupMenberCountTableViewCell alloc] init];
+            [cell initSize:self.view.width height:height];
+            [cell setData:dataObj];
+        }
+        baseCell = cell;
+    }
+    else if([key isEqualToString:@"member"])
+    {
+        GroupMenberTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"member"];
+        if(!cell)
+        {
+            cell = [[GroupMenberTableViewCell alloc] init];
+            [cell initSize:self.view.width height:height];
+            [cell setData:dataObj];
+        }
+        baseCell = cell;
+    }
+    else if([key isEqualToString:@"disturb"] || [key isEqualToString:@"stick"])
+    {
+        GroupToogleTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"disturb"];
+        if(!cell)
+        {
+            cell = [[GroupToogleTableViewCell alloc] init];
+            [cell initSize:self.view.width height:height];
+            [cell setData:dataObj];
+        }
+        baseCell = cell;
+    }
+    
+    return baseCell;
+}
+
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
+    
+    NSMutableArray *arr = [_sectionArr objectAtIndex:indexPath.section];
+    NSDictionary *dataObj = [arr objectAtIndex:indexPath.row];
+    float height = [[dataObj objectForKey:@"height"] floatValue];
+    
+    return height;
+}
+
+-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
+{
+	return CGFLOAT_MIN;//如果设置section的header高度,不设置footer高度,footer默认等于header高度
+}
+
+-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
+{
+	return 10;//这个方法不写,或者return 0跟return 12的效果一样
+    return 0.01;//把高度设置很小,效果可以看成footer的高度等于0
+}
+
+
+- (void)onTouchQuit:(id)sender{
+    
+    if([[User sharedInfo] isTeamOwner:_team])
+    {
+        [self dismissTeam];
+    }
+    else
+    {
+        [self quitTeam];
+    }
+    
+}
+
+- (void)quitTeam{
+    _quitTeamAlertView = [[UIAlertView alloc] initWithTitle:@"" message:@"确认退出群聊?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确认", nil];
+    [_quitTeamAlertView show];
+}
+
+- (void)dismissTeam{
+    _dismissTeamAlertView = [[UIAlertView alloc] initWithTitle:@"" message:@"确认解散群聊?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确认", nil];
+    [_dismissTeamAlertView show];
+}
+
+- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex{
+    if (alertView == _quitTeamAlertView) {
+        [self quitTeamAlert:buttonIndex];
+    }
+    else if (alertView == _dismissTeamAlertView) {
+        [self dismissTeamAlert:buttonIndex];
+    }
+}
+
+- (void)quitTeamAlert:(NSInteger)index{
+    switch (index) {
+        case 0://取消
+            break;
+        case 1:{
+            [[NIMSDK sharedSDK].teamManager quitTeam:self.team.teamId completion:^(NSError *error) {
+                if (!error) {
+                    UIStoryboard *board = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
+                    UIViewController *next = [board instantiateViewControllerWithIdentifier:@"TabBarView"];
+                    [self.navigationController pushViewController:next animated:YES];
+                }else{
+                    [self.view makeToast:[NSString stringWithFormat:@"退出失败 code:%zd",error.code]];
+                }
+            }];
+            break;
+        }
+        default:
+            break;
+    }
+    
+}
+
+- (void)dismissTeamAlert:(NSInteger)index{
+    switch (index) {
+        case 0://取消
+            break;
+        case 1:{
+            [[NIMSDK sharedSDK].teamManager dismissTeam:self.team.teamId completion:^(NSError *error) {
+                if (!error) {
+                    UIStoryboard *board = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
+                    UIViewController *next = [board instantiateViewControllerWithIdentifier:@"TabBarView"];
+                    [NIMKit sharedKit].deleteTeamId = self.team.teamId;
+                    [self.navigationController pushViewController:next animated:YES];
+                }else{
+                    [self.view makeToast:[NSString stringWithFormat:@"解散失败 code:%zd",error.code]];
+                }
+            }];
+            break;
+        }
+        default:
+            break;
+    }
+}
+
+
+@end

+ 4 - 4
NIMDemo/NIMDemo/HttpRequest/HttpRequest.h

@@ -35,13 +35,13 @@
          failure:(void (^_Nullable)(NSError * _Nullable error))failure;
 
 
-
+//social
 - (void)getSocialDataList:(NSString *_Nullable)lastId
                   success:(void (^_Nullable)(NSMutableArray * _Nullable dataList))success
                   failure:(void (^_Nullable)())failure;
 
 - (void)socialLike:(NSString *_Nullable)socialId
-           success:(void (^_Nullable)(NSString * _Nullable socialId, int currentLikes))success
+           success:(void (^_Nullable)(NSString * _Nullable socialId, int currentLikes, NSMutableArray *_Nullable likeList))success
            failure:(void (^_Nullable)())failure;
 
 - (void)socialLikeList:(NSString *_Nullable)socialId
@@ -60,7 +60,7 @@
                   failure:(void (^_Nullable)())failure;
 
 
-
+//trade
 - (void)tradePublish:(NSString *_Nullable)msg
               picArr:(NSMutableArray *_Nullable)picArr
                 type:(int)type
@@ -72,7 +72,7 @@
               msg:(NSString *_Nullable)msg
            picArr:(NSMutableArray *_Nullable)picArr
          priority:(int)priority
-          success:(void (^_Nullable)())success
+          success:(void (^_Nullable)(NSString *_Nullable tradeId, NSMutableArray *_Nullable pics, NSMutableArray *_Nullable thumbs, NSMutableArray *_Nullable picIds, int priority))success
           failure:(void (^_Nullable)())failure;
 
 - (void)tradeDelete:(NSString *_Nullable)tradeId

+ 14 - 8
NIMDemo/NIMDemo/HttpRequest/HttpRequest.m

@@ -301,7 +301,7 @@
 }
 
 - (void)socialLike:(NSString *)socialId
-           success:(void (^_Nullable)(NSString *socialId, int currentLikes))success
+           success:(void (^_Nullable)(NSString * _Nullable socialId, int currentLikes, NSMutableArray *_Nullable likeList))success
            failure:(void (^_Nullable)())failure{
     
     NSString *userId = [NSString stringWithFormat:@"%d", [User sharedInfo].userId];
@@ -311,9 +311,10 @@
         
         NSString *sid = [jsonData objectForKey:@"social_id"];
         int likes = [[jsonData objectForKey:@"likes"] intValue];
+        NSMutableArray *likeList = [jsonData objectForKey:@"like_users"];
         
         if(success)
-            success(sid, likes);
+            success(sid, likes, likeList);
         
     } failure:^{
         if(failure)
@@ -463,22 +464,27 @@
               msg:(NSString *)msg
            picArr:(NSMutableArray *)picArr
          priority:(int)priority
-          success:(void (^_Nullable)())success
+          success:(void (^_Nullable)(NSString *_Nullable tradeId, NSMutableArray *_Nullable pics, NSMutableArray *_Nullable thumbs, NSMutableArray *_Nullable picIds, int priority))success
           failure:(void (^_Nullable)())failure{
     
     NSMutableDictionary *parameters = [[NSMutableDictionary alloc] init];
     [parameters setValue:tradeId forKey:@"id"];
     if(msg)
         [parameters setValue:msg forKey:@"msg"];
-    if(picArr)
-        [parameters setValue:picArr forKey:@"pic"];
-    if(priority)
-        [parameters setValue:[NSString stringWithFormat:@"%d", priority] forKey:@"priority"];
+    
+    [parameters setValue:picArr forKey:@"pic"];
+    [parameters setValue:[NSString stringWithFormat:@"%d", priority] forKey:@"priority"];
     
     [self request:_urlTradeEdit parameters:parameters progress:nil success:^(id jsonData) {
         
+        NSString *tradeId = [jsonData objectForKey:@"id"];
+        NSMutableArray *thumbArr = [jsonData objectForKey:@"thumbs"];
+        NSMutableArray *picArr = [jsonData objectForKey:@"pics"];
+        NSMutableArray *picIdArr = [jsonData objectForKey:@"pic_ids"];
+        int priority = [[jsonData objectForKey:@"priority"] intValue];
+        
         if(success)
-            success();
+            success(tradeId, picArr, thumbArr, picIdArr, priority);
         
     } failure:^{
         

+ 16 - 0
NIMDemo/NIMDemo/SectionGroup/GroupDescTableViewCell.h

@@ -0,0 +1,16 @@
+//
+//  GroupDescTableViewCell.h
+//  NIMDemo
+//
+//  Created by Fenix Wang on 2017/7/10.
+//  Copyright © 2017年 Netease. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface GroupDescTableViewCell : UITableViewCell
+
+- (void)initSize:(CGFloat)width height:(CGFloat)height;
+- (void)setData:(NSDictionary *)data;
+
+@end

+ 61 - 0
NIMDemo/NIMDemo/SectionGroup/GroupDescTableViewCell.m

@@ -0,0 +1,61 @@
+//
+//  GroupDescTableViewCell.m
+//  NIMDemo
+//
+//  Created by Fenix Wang on 2017/7/10.
+//  Copyright © 2017年 Netease. All rights reserved.
+//
+
+#import "GroupDescTableViewCell.h"
+#import "UIView+NTES.h"
+#import "GroupIntroViewController.h"
+
+@interface GroupDescTableViewCell()
+
+@property (nonatomic, strong) UILabel           *titleLabel;
+@property (nonatomic, strong) UITextView        *descTextView;
+
+@end
+
+@implementation GroupDescTableViewCell
+
+- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
+    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
+    if(self)
+    {
+        [self setSelectionStyle:UITableViewCellSelectionStyleNone];
+    }
+    return self;
+}
+
+- (void)initSize:(CGFloat)width height:(CGFloat)height{
+    
+    _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 7, width - 20, 30)];
+    _titleLabel.textColor = UIColor.blackColor;
+    [self addSubview:_titleLabel];
+    
+    _descTextView = [[UITextView alloc] initWithFrame:CGRectMake(10, _titleLabel.bottom+7, width-20-50, 60)];
+    _descTextView.textColor = UIColor.lightGrayColor;
+    _descTextView.editable = NO;
+    [self addSubview:_descTextView];
+    
+    UIImageView *arrow = [[UIImageView alloc] init];
+    arrow.width = 8;
+    arrow.height = 16;
+    arrow.centerY = height/2;
+    arrow.right = width - 10;
+    [arrow setImage:[UIImage imageNamed:@"设置_03"]];
+    [self addSubview:arrow];
+}
+
+- (void)setData:(NSDictionary *)data{
+    
+    _titleLabel.text = [data objectForKey:@"title"];
+    NIMTeam *team = [data objectForKey:@"value"];
+    _descTextView.text = [data objectForKey:team.intro ? team.intro : @""];
+    
+}
+
+
+
+@end

+ 15 - 0
NIMDemo/NIMDemo/SectionGroup/GroupIntroViewController.h

@@ -0,0 +1,15 @@
+//
+//  GroupIntroViewController.h
+//  NIMDemo
+//
+//  Created by Fenix Wang on 2017/7/10.
+//  Copyright © 2017年 Netease. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface GroupIntroViewController : UIViewController
+
+- (instancetype) initWidthTeam:(NIMTeam *)team;
+
+@end

+ 52 - 0
NIMDemo/NIMDemo/SectionGroup/GroupIntroViewController.m

@@ -0,0 +1,52 @@
+//
+//  GroupIntroViewController.m
+//  NIMDemo
+//
+//  Created by Fenix Wang on 2017/7/10.
+//  Copyright © 2017年 Netease. All rights reserved.
+//
+
+#import "GroupIntroViewController.h"
+#import "UIView+NTES.h"
+#import "NIMSDK/NIMSDK.h"
+
+@interface GroupIntroViewController ()
+
+@property (nonatomic, strong) UITextView            *textView;
+@property (nonatomic, strong) NIMTeam               *team;
+
+@end
+
+@implementation GroupIntroViewController
+
+- (instancetype) initWidthTeam:(NIMTeam *)team{
+    
+    self = [super init];
+    if(self)
+    {
+        self.team = team;
+    }
+    return self;
+}
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+    
+    _textView = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, self.view.width, self.view.height)];
+    _textView.text = _team.intro;
+}
+
+- (void)viewWillAppear:(BOOL)animated{
+    [super viewWillAppear:animated];
+    [self.navigationItem setTitle:@"群公告"];
+}
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+
+
+
+@end

+ 16 - 0
NIMDemo/NIMDemo/SectionGroup/GroupMenberCountTableViewCell.h

@@ -0,0 +1,16 @@
+//
+//  GroupMenberCountTableViewCell.h
+//  NIMDemo
+//
+//  Created by Fenix Wang on 2017/7/10.
+//  Copyright © 2017年 Netease. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface GroupMenberCountTableViewCell : UITableViewCell
+
+- (void)initSize:(CGFloat)width height:(CGFloat)height;
+- (void)setData:(NSDictionary *)data;
+
+@end

+ 59 - 0
NIMDemo/NIMDemo/SectionGroup/GroupMenberCountTableViewCell.m

@@ -0,0 +1,59 @@
+//
+//  GroupMenberCountTableViewCell.m
+//  NIMDemo
+//
+//  Created by Fenix Wang on 2017/7/10.
+//  Copyright © 2017年 Netease. All rights reserved.
+//
+
+#import "GroupMenberCountTableViewCell.h"
+#import "UIView+NTES.h"
+
+@interface GroupMenberCountTableViewCell()
+
+@property (nonatomic, strong) UILabel           *titleLabel;
+@property (nonatomic, strong) UILabel           *menberLabel;
+
+@end
+
+@implementation GroupMenberCountTableViewCell
+
+- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
+    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
+    if(self)
+    {
+        [self setSelectionStyle:UITableViewCellSelectionStyleNone];
+    }
+    return self;
+}
+
+- (void)initSize:(CGFloat)width height:(CGFloat)height{
+    
+    _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 7, 150, 30)];
+    _titleLabel.textColor = UIColor.blackColor;
+    [self addSubview:_titleLabel];
+    
+    _menberLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 7, width-80, 30)];
+    _menberLabel.textColor = UIColor.grayColor;
+    _menberLabel.right = width - 20;
+    _menberLabel.textAlignment = NSTextAlignmentRight;
+    [self addSubview:_menberLabel];
+    
+    UIImageView *arrow = [[UIImageView alloc] init];
+    arrow.width = 8;
+    arrow.height = 16;
+    arrow.centerY = height/2;
+    arrow.right = width - 10;
+    [arrow setImage:[UIImage imageNamed:@"设置_03"]];
+    [self addSubview:arrow];
+}
+
+- (void)setData:(NSDictionary *)data{
+    
+    _titleLabel.text = [data objectForKey:@"title"];
+    _menberLabel.text = [data objectForKey:@"value"];
+    
+}
+
+
+@end

+ 16 - 0
NIMDemo/NIMDemo/SectionGroup/GroupMenberIcon.h

@@ -0,0 +1,16 @@
+//
+//  GroupMenberIcon.h
+//  NIMDemo
+//
+//  Created by Fenix Wang on 2017/7/10.
+//  Copyright © 2017年 Netease. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "NIMSDK/NIMSDK.h"
+
+@interface GroupMenberIcon : UIView
+
+- (void)setMenber:(NIMTeamMember *)member;
+
+@end

+ 55 - 0
NIMDemo/NIMDemo/SectionGroup/GroupMenberIcon.m

@@ -0,0 +1,55 @@
+//
+//  GroupMenberIcon.m
+//  NIMDemo
+//
+//  Created by Fenix Wang on 2017/7/10.
+//  Copyright © 2017年 Netease. All rights reserved.
+//
+
+#import "GroupMenberIcon.h"
+#import "NIMAvatarImageView.h"
+#import "NIMKit.h"
+#import "User.h"
+
+@interface GroupMenberIcon()
+
+@property (nonatomic, strong) NIMAvatarImageView            *avatarView;
+@property (nonatomic, strong) NSString                      *teamId;
+
+@end
+
+@implementation GroupMenberIcon
+
+- (instancetype)initWithFrame:(CGRect)frame{
+    self = [super initWithFrame:frame];
+    if(self){
+        [self setUpComponent];
+    }
+    return self;
+}
+
+- (void)setUpComponent{
+    
+    _avatarView = [[NIMAvatarImageView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
+    [_avatarView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onTouchAvatar:)]];
+    [self addSubview:_avatarView];
+
+}
+
+- (void)setMenber:(NIMTeamMember *)member{
+    
+    NIMKitInfo *info = [[NIMKit sharedKit] infoByUser:member.userId option:nil];
+    NSURL *url = info.avatarUrlString ? [NSURL URLWithString:info.avatarUrlString] : nil;
+    [_avatarView nim_setImageWithURL:url placeholderImage:info.avatarImage];
+    
+    _teamId = member.userId;
+}
+
+- (void)onTouchAvatar:(UITapGestureRecognizer *)gestureRecognizer{
+    
+    UIView *viewClicked = [gestureRecognizer view];
+    [User showUserInfo:_teamId];
+    
+}
+
+@end

+ 16 - 0
NIMDemo/NIMDemo/SectionGroup/GroupMenberTableViewCell.h

@@ -0,0 +1,16 @@
+//
+//  GroupMenberTableViewCell.h
+//  NIMDemo
+//
+//  Created by Fenix Wang on 2017/7/10.
+//  Copyright © 2017年 Netease. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface GroupMenberTableViewCell : UITableViewCell
+
+- (void)initSize:(CGFloat)width height:(CGFloat)height;
+- (void)setData:(NSDictionary *)data;
+
+@end

+ 68 - 0
NIMDemo/NIMDemo/SectionGroup/GroupMenberTableViewCell.m

@@ -0,0 +1,68 @@
+//
+//  GroupMenberTableViewCell.m
+//  NIMDemo
+//
+//  Created by Fenix Wang on 2017/7/10.
+//  Copyright © 2017年 Netease. All rights reserved.
+//
+
+#import "GroupMenberTableViewCell.h"
+#import "NIMSDK/NIMSDK.h"
+#import "GroupMenberIcon.h"
+#import "UIView+NTES.h"
+
+@interface GroupMenberTableViewCell()
+
+@property (nonatomic, strong) UIView            *container;
+
+@end
+
+@implementation GroupMenberTableViewCell
+
+
+- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
+    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
+    if(self)
+    {
+        [self setSelectionStyle:UITableViewCellSelectionStyleNone];
+    }
+    return self;
+}
+
+
+- (void)initSize:(CGFloat)width height:(CGFloat)height{
+    
+    _container = [[UIView alloc] initWithFrame:CGRectMake(10, 0, width-20, height)];
+    [self addSubview:_container];
+    
+}
+
+
+- (void)setData:(NSDictionary *)data{
+    
+    int numInRow = 6;
+    float space = 5;
+    float size = (_container.width - space * (numInRow - 1)) / numInRow;
+    
+    NSArray *list = [data objectForKey:@"list"];
+    for(int i=0; i<list.count; i++)
+    {
+        float startX = (size + space) * i;
+        NIMTeamMember *member = [list objectAtIndex:i];
+        
+        GroupMenberIcon *icon = [[GroupMenberIcon alloc] initWithFrame:CGRectMake(startX, _container.centerY-size/2, size, size)];
+        [icon setMenber:member];
+        [_container addSubview:icon];
+        
+        if(i >= numInRow)
+        {
+            break;
+        }
+    }
+    
+}
+
+
+
+
+@end

+ 16 - 0
NIMDemo/NIMDemo/SectionGroup/GroupNameTableViewCell.h

@@ -0,0 +1,16 @@
+//
+//  GroupNameTableViewCell.h
+//  NIMDemo
+//
+//  Created by Fenix Wang on 2017/7/10.
+//  Copyright © 2017年 Netease. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface GroupNameTableViewCell : UITableViewCell
+
+- (void)initWidth:(CGFloat)width;
+- (void)setData:(NSDictionary *)data;
+
+@end

+ 50 - 0
NIMDemo/NIMDemo/SectionGroup/GroupNameTableViewCell.m

@@ -0,0 +1,50 @@
+//
+//  GroupNameTableViewCell.m
+//  NIMDemo
+//
+//  Created by Fenix Wang on 2017/7/10.
+//  Copyright © 2017年 Netease. All rights reserved.
+//
+
+#import "GroupNameTableViewCell.h"
+
+@interface GroupNameTableViewCell()
+
+@property (nonatomic, strong) UILabel           *titleLabel;
+@property (nonatomic, strong) UILabel           *nameLabel;
+
+@end
+
+@implementation GroupNameTableViewCell
+
+- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
+    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
+    if(self)
+    {
+        [self setSelectionStyle:UITableViewCellSelectionStyleNone];
+    }
+    return self;
+}
+
+
+- (void)initWidth:(CGFloat)width{
+    
+    _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 7, 120, 30)];
+    _titleLabel.textColor = UIColor.blackColor;
+    [self addSubview:_titleLabel];
+    
+    _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(width/3, 7, (width - width/3) - 10, 30)];
+    _nameLabel.textColor = UIColor.lightGrayColor;
+    _nameLabel.textAlignment = NSTextAlignmentRight;
+    [self addSubview:_nameLabel];
+    
+}
+
+- (void)setData:(NSDictionary *)data{
+    
+    _titleLabel.text = [data objectForKey:@"title"];
+    _nameLabel.text = [data objectForKey:@"value"];
+    
+}
+
+@end

+ 16 - 0
NIMDemo/NIMDemo/SectionGroup/GroupToogleTableViewCell.h

@@ -0,0 +1,16 @@
+//
+//  GroupToogleTableViewCell.h
+//  NIMDemo
+//
+//  Created by Fenix Wang on 2017/7/10.
+//  Copyright © 2017年 Netease. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface GroupToogleTableViewCell : UITableViewCell
+
+- (void)initSize:(CGFloat)width height:(CGFloat)height;
+- (void)setData:(NSDictionary *)data;
+
+@end

+ 93 - 0
NIMDemo/NIMDemo/SectionGroup/GroupToogleTableViewCell.m

@@ -0,0 +1,93 @@
+//
+//  GroupToogleTableViewCell.m
+//  NIMDemo
+//
+//  Created by Fenix Wang on 2017/7/10.
+//  Copyright © 2017年 Netease. All rights reserved.
+//
+
+#import "GroupToogleTableViewCell.h"
+#import "UIView+NTES.h"
+#import "NIMKit.h"
+
+@interface GroupToogleTableViewCell()
+
+@property (nonatomic, strong) UILabel           *titleLabel;
+@property (nonatomic, strong) UISwitch          *toggleSwitch;
+@property (nonatomic, strong) NSString          *teamId;
+@property (nonatomic, strong) NSDictionary      *data;
+
+@end
+
+@implementation GroupToogleTableViewCell
+
+
+- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
+    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
+    if(self)
+    {
+        [self setSelectionStyle:UITableViewCellSelectionStyleNone];
+    }
+    return self;
+}
+
+
+- (void)initSize:(CGFloat)width height:(CGFloat)height{
+    
+    _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 7, 120, 30)];
+    _titleLabel.textColor = UIColor.blackColor;
+    [self addSubview:_titleLabel];
+    
+    _toggleSwitch = [[UISwitch alloc] init];
+    _toggleSwitch.right = width - 10;
+    _toggleSwitch.centerY = height / 2;
+    [_toggleSwitch addTarget:self action:@selector(swichChanged:) forControlEvents:UIControlEventValueChanged];
+    [self addSubview:_toggleSwitch];
+    
+}
+
+
+- (void)setData:(NSDictionary *)data{
+    
+    _data = data;
+    
+    _titleLabel.text = [data objectForKey:@"title"];
+    
+    NIMTeam *team = [data objectForKey:@"team"];
+    _teamId = team.teamId;
+    
+    
+    NSString *key = [data objectForKey:@"key"];
+    
+    if([key isEqualToString:@"disturb"])
+        [_toggleSwitch setOn:!team.notifyForNewMsg];
+    else if([key isEqualToString:@"stick"])
+        NSLog(@"stick toggle");
+}
+
+
+- (void)swichChanged:(id)sender{
+    
+    UISwitch *toggle = (UISwitch *)sender;
+    BOOL notifyForNewMsg = !toggle.isOn;
+    
+    NSString *key = [_data objectForKey:@"key"];
+    if([key isEqualToString:@"disturb"])
+    {
+        if(notifyForNewMsg != [[[NIMSDK sharedSDK] teamManager] notifyForNewMsg:self.teamId])
+        {
+            [[[NIMSDK sharedSDK] teamManager] updateNotifyState:notifyForNewMsg
+                                                         inTeam:self.teamId
+                                                     completion:^(NSError *error) {
+                                                         
+                                                     }];
+        }
+    }
+    else if([key isEqualToString:@"stick"])
+    {
+    
+    }
+}
+
+
+@end

+ 33 - 0
NIMDemo/NIMDemo/SectionTrade/MyTradeTableViewCell.m

@@ -14,6 +14,8 @@
 #import "User.h"
 #import "ImagePagerViewController.h"
 #import "HttpRequest.h"
+#import "TradeDetailViewController.h"
+#import "TradeModifyViewController.h"
 
 @interface MyTradeTableViewCell() <UITextViewDelegate>
 
@@ -28,6 +30,8 @@
 @property (nonatomic, strong) UIButton                      *priorityBtn;
 @property (nonatomic, strong) UILabel                       *followCountLabel;
 
+@property (nonatomic, strong) UIButton                      *modifyBtn;
+
 @property (nonatomic, strong) TradeData                     *data;
 
 @end
@@ -84,10 +88,22 @@
     [_followContainer addSubview:_followLabel];
     
     
+    _modifyBtn = [UIButton buttonWithType:UIButtonTypeCustom];
+    _modifyBtn.titleLabel.font = [UIFont systemFontOfSize:14];
+    _modifyBtn.titleLabel.textAlignment = NSTextAlignmentRight;
+    [_modifyBtn setTitleColor:UIColor.lightGrayColor forState:UIControlStateNormal];
+    _modifyBtn.frame = CGRectMake(cellWidth-padding-80, padding, 80, 20);
+    [_modifyBtn setTitle:@"修改图片" forState:UIControlStateNormal];
+    [_modifyBtn sizeToFit];
+    [_modifyBtn addTarget:self action:@selector(onTouchModifyImage:) forControlEvents:UIControlEventTouchUpInside];
+    [self.contentView addSubview:_modifyBtn];
+    
     //message
     _msgTextView = [[UITextView alloc] initWithFrame:CGRectMake(padding, _avatarView.bottom+5, cellWidth - padding * 2, 0)];
+    [_msgTextView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onTouchContent:)]];
     _msgTextView.font = [UIFont systemFontOfSize:15];
     _msgTextView.textContainerInset = UIEdgeInsetsMake(0, 0, 0, 0);
+    _msgTextView.editable = NO;
     [self.contentView addSubview:_msgTextView];
     
     //image container
@@ -207,6 +223,10 @@
     
     data.cellHeight = _actionContainer.bottom;
     
+    
+    _modifyBtn.hidden = data.userId != [[NIMSDK sharedSDK] loginManager].currentAccount;
+    
+    
     [self setNeedsLayout];
     
 }
@@ -274,6 +294,12 @@
     [self.viewController.navigationController pushViewController:imagePageVC animated:YES];
 }
 
+- (void)onTouchContent:(UITapGestureRecognizer *)gestureRecognizer{
+    
+    TradeDetailViewController *detailVC = [[TradeDetailViewController alloc] initWithTradeData:_data];
+    [self.viewController.navigationController pushViewController:detailVC animated:YES];
+    
+}
 
 
 - (void)layoutSubviews
@@ -284,9 +310,16 @@
     _followContainer.right = self.contentView.width - padding;
     _followCountLabel.right = self.contentView.width - padding;
     _imgContainer.width = self.contentView.width - padding * 2;
+    _modifyBtn.right = self.contentView.width - padding;
     
 }
 
 
+- (void)onTouchModifyImage:(id)sender{
+    
+    TradeModifyViewController *vc = [[TradeModifyViewController alloc] initWithTradeData:_data];
+    [self.viewController.navigationController pushViewController:vc animated:YES];
+    
+}
 
 @end

+ 2 - 0
NIMDemo/NIMDemo/SectionTrade/MyTradeViewController.m

@@ -93,6 +93,8 @@
     UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithCustomView:_editBtn];
     
     [navItem setRightBarButtonItems:@[rightItem]];
+    
+    [self.tableView reloadData];
 }
 
 

+ 1 - 0
NIMDemo/NIMDemo/SectionTrade/TradeData.h

@@ -34,6 +34,7 @@ typedef NS_ENUM(NSInteger, TradeSort) {
 @property (nonatomic, strong) NSString              *msg;
 @property (nonatomic, strong) NSMutableArray        *picArr;
 @property (nonatomic, strong) NSMutableArray        *thumbArr;
+@property (nonatomic, strong) NSMutableArray        *picIdArr;
 @property (nonatomic, assign) int                   priority;
 @property (nonatomic, strong) NSString              *time;
 @property (nonatomic, assign) BOOL                  followed;

+ 1 - 0
NIMDemo/NIMDemo/SectionTrade/TradeData.m

@@ -19,6 +19,7 @@
     
     _picArr = [data objectForKey:@"pics"];
     _thumbArr = [data objectForKey:@"thumbs"];
+    _picIdArr = [data objectForKey:@"pic_ids"];
     
     _priority = [[data objectForKey:@"priority"] intValue];
     _time = [data objectForKey:@"inputtime"];

+ 16 - 0
NIMDemo/NIMDemo/SectionTrade/TradeDetailViewController.h

@@ -0,0 +1,16 @@
+//
+//  TradeDetailViewController.h
+//  NIMDemo
+//
+//  Created by Fenix Wang on 2017/7/11.
+//  Copyright © 2017年 Netease. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "TradeData.h"
+
+@interface TradeDetailViewController : UIViewController
+
+- (instancetype)initWithTradeData:(TradeData *)tradeData;
+
+@end

+ 229 - 0
NIMDemo/NIMDemo/SectionTrade/TradeDetailViewController.m

@@ -0,0 +1,229 @@
+//
+//  TradeDetailViewController.m
+//  NIMDemo
+//
+//  Created by Fenix Wang on 2017/7/11.
+//  Copyright © 2017年 Netease. All rights reserved.
+//
+
+#import "TradeDetailViewController.h"
+#import "NIMAvatarImageView.h"
+#import "User.h"
+#import "UIView+NTES.h"
+#import "ImagePagerViewController.h"
+#import "NIMKit.h"
+#import "TradeUtil.h"
+#import "UIImageView+WebCache.h"
+
+@interface TradeDetailViewController ()<UITextViewDelegate>
+
+@property (nonatomic, strong) TradeData                     *data;
+
+@property (nonatomic, strong) UIScrollView                  *scrollView;
+@property (nonatomic, strong) NIMAvatarImageView            *avatarView;
+@property (nonatomic, strong) UITextView                    *nickTextView;
+@property (nonatomic, strong) UILabel                       *timeLabel;
+@property (nonatomic, strong) UILabel                       *localLabel;
+@property (nonatomic, strong) UITextView                    *msgTextView;
+@property (nonatomic, strong) UIView                        *imgContainer;
+@property (nonatomic, strong) UIButton                      *priorityBtn;
+
+@end
+
+@implementation TradeDetailViewController
+
+- (instancetype)initWithTradeData:(TradeData *)tradeData{
+    
+    self = [super init];
+    if(self)
+    {
+        _data = tradeData;
+    }
+    return self;
+    
+}
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    [self setUpComponent];
+    [self updateContent];
+}
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+
+
+- (void)setUpComponent{
+    
+    self.view.backgroundColor = UIColor.whiteColor;
+    
+    float padding = 10;
+    float width = self.view.width;
+    
+    
+    _scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.width, self.view.height)];
+    _scrollView.showsVerticalScrollIndicator = YES;
+    [self.view addSubview:_scrollView];
+    
+    
+    //avatar
+    _avatarView = [[NIMAvatarImageView alloc] initWithFrame:CGRectMake(padding, padding, 40, 40)];
+    [_avatarView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onTouchAvatar:)]];
+    [_scrollView addSubview:_avatarView];
+    
+    //nick name
+    _nickTextView = [[UITextView alloc] initWithFrame:CGRectMake(_avatarView.right + 5, padding, 200, 25)];
+    _nickTextView.backgroundColor = UIColor.clearColor;
+    _nickTextView.scrollEnabled = NO;
+    _nickTextView.editable = NO;
+    _nickTextView.textContainerInset = UIEdgeInsetsMake(0, 0, 0, 0);
+    _nickTextView.delegate = self;
+    _nickTextView.textAlignment = NSTextAlignmentLeft;
+    [_scrollView addSubview:_nickTextView];
+    
+    //time
+    _timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(width-200-padding, padding, 200, 15)];
+    _timeLabel.font = [UIFont systemFontOfSize:14];
+    _timeLabel.textColor = UIColor.lightGrayColor;
+    _timeLabel.textAlignment = NSTextAlignmentRight;
+    [_scrollView addSubview:_timeLabel];
+    
+    //local
+    _localLabel = [[UILabel alloc] initWithFrame:CGRectMake(_avatarView.right + 5, _nickTextView.bottom+5, 200, 25)];
+    _localLabel.font = [UIFont systemFontOfSize:14];
+    _localLabel.textColor = UIColor.lightGrayColor;
+    [_scrollView addSubview:_localLabel];
+    
+    //priority
+    _priorityBtn = [UIButton buttonWithType:UIButtonTypeCustom];
+    _priorityBtn.frame = CGRectMake(width-80-padding, _timeLabel.bottom+5, 80, 24);
+    _priorityBtn.titleLabel.font = [UIFont systemFontOfSize:14];
+    _priorityBtn.layer.cornerRadius = 12;
+    _priorityBtn.layer.borderWidth = 1;
+    _priorityBtn.layer.borderColor = UIColor.lightGrayColor.CGColor;
+    [_priorityBtn setTitleColor:User.greenColor forState:UIControlStateNormal];
+    [_scrollView addSubview:_priorityBtn];
+    
+    //message
+    _msgTextView = [[UITextView alloc] initWithFrame:CGRectMake(padding, _avatarView.bottom+padding, self.view.width - padding * 2, 0)];
+    _msgTextView.font = [UIFont systemFontOfSize:15];
+    _msgTextView.textContainerInset = UIEdgeInsetsMake(0, 0, 0, 0);
+    _msgTextView.editable = NO;
+    [_scrollView addSubview:_msgTextView];
+    
+    //image container
+    _imgContainer = [[UIView alloc] initWithFrame:CGRectMake(padding, _msgTextView.bottom, self.view.width - padding * 2, 0)];
+    [_scrollView addSubview:_imgContainer];
+    
+}
+
+
+- (void)updateContent{
+    
+    NIMUser *user = [[[NIMSDK sharedSDK] userManager] userInfo:_data.userId];
+    NSURL *avatarURL = user && user.userInfo.thumbAvatarUrl ? [NSURL URLWithString:user.userInfo.thumbAvatarUrl] : nil;
+    [_avatarView nim_setImageWithURL:avatarURL placeholderImage:User.defaultUserAvatar];
+    
+    _nickTextView.attributedText = [[User sharedInfo] getUserNameStr:user];
+    _localLabel.text = _data.district;
+    
+    _timeLabel.text = _data.time;
+    [_priorityBtn setTitle:[NSString stringWithFormat:@"置顶%d", _data.priority] forState:UIControlStateNormal];
+    
+    _msgTextView.attributedText = [[TradeUtil shared] tradeMsg:_data.msg tradeType:_data.type];
+    [_msgTextView sizeToFit];
+    
+    [self updateImages];
+}
+
+- (void)updateImages{
+    
+    _imgContainer.top = _msgTextView.bottom + 5;
+    
+    float imgWidth = _imgContainer.width;
+    
+    __weak typeof(self) wself = self;
+    for(int i=0; i<_data.picArr.count; i++)
+    {
+        NSURL *url = [NSURL URLWithString:[_data.picArr objectAtIndex:i]];
+        UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, _imgContainer.width, 0)];
+        [imgView setContentScaleFactor:[[UIScreen mainScreen] scale]];
+        imgView.contentMode =  UIViewContentModeScaleToFill;
+        
+        NSLog(@"load image url %@", url.absoluteString);
+        [imgView sd_setImageWithURL:url placeholderImage:nil options:0 completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
+            
+            CGSize size = image.size;
+            
+            float width = size.width;
+            float height = size.height;
+            float s = imgWidth / size.width;
+            width = width * s;
+            height = height * s;
+            imgView.width = width;
+            imgView.height = height;
+            
+            [wself updateImageLayout];
+        }];
+        
+        [_imgContainer addSubview:imgView];
+    }
+    
+}
+
+- (void)updateImageLayout{
+    
+    float startY = 0;
+    float space = 10;
+    
+    for(int i=0; i<_imgContainer.subviews.count; i++)
+    {
+        UIImageView *imgView = [_imgContainer.subviews objectAtIndex:i];
+        NSLog(@"image view width %f height %f", imgView.width, imgView.height);
+        
+        imgView.top = startY;
+        startY = imgView.bottom + space;
+    }
+    
+    _imgContainer.height = startY;
+    _scrollView.contentSize = CGSizeMake(_scrollView.width, _imgContainer.bottom);
+}
+
+
+- (void)viewWillAppear:(BOOL)animated{
+    [super viewWillAppear:animated];
+    
+    [self.navigationItem setTitle:@"详情"];
+}
+
+
+
+- (void)onTouchAvatar:(UITapGestureRecognizer *)gestureRecognizer{
+    
+    UIView *viewClicked = [gestureRecognizer view];
+    [User showUserInfo:[NSString stringWithFormat:@"%ld", (long)viewClicked.tag]];
+    
+}
+
+- (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)url inRange:(NSRange)characterRange
+{
+    [User showUserInfo:url.absoluteString];
+    return NO;
+}
+
+- (void)onTouchImage:(UITapGestureRecognizer *)gestureRecognizer{
+    
+    UIView *viewClicked = [gestureRecognizer view];
+    
+    NSLog(@"show image %ld", (long)viewClicked.tag);
+    
+    ImagePagerViewController *imagePageVC = [[ImagePagerViewController alloc] init];
+    [imagePageVC setImages:_data.picArr thumbs:_data.thumbArr startIndex:(int)viewClicked.tag];
+    
+    [self.navigationController pushViewController:imagePageVC animated:YES];
+}
+
+
+@end

+ 27 - 0
NIMDemo/NIMDemo/SectionTrade/TradeModifyImageView.h

@@ -0,0 +1,27 @@
+//
+//  TradeModifyImageView.h
+//  NIMDemo
+//
+//  Created by Fenix Wang on 2017/7/11.
+//  Copyright © 2017年 Netease. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@protocol TradeModifyImageDelegate <NSObject>
+
+- (void)tradeImageDelete:(int)index;
+
+@end
+
+
+@interface TradeModifyImageView : UIImageView
+
+@property (nonatomic, weak) id<TradeModifyImageDelegate>        delegate;
+
+@property (nonatomic, assign) int               index;
+@property (nonatomic, strong) NSString          *picPath;
+@property (nonatomic, strong) NSString          *thumbPath;
+@property (nonatomic, strong) NSString          *picId;
+
+@end

+ 39 - 0
NIMDemo/NIMDemo/SectionTrade/TradeModifyImageView.m

@@ -0,0 +1,39 @@
+//
+//  TradeModifyImageView.m
+//  NIMDemo
+//
+//  Created by Fenix Wang on 2017/7/11.
+//  Copyright © 2017年 Netease. All rights reserved.
+//
+
+#import "TradeModifyImageView.h"
+
+@implementation TradeModifyImageView
+
+- (instancetype)initWithFrame:(CGRect)frame{
+    self = [super initWithFrame:frame];
+    if(self)
+    {
+        UIButton *deleteBtn = [[UIButton alloc] initWithFrame:CGRectMake((frame.size.width-20)/2, 5, 20, 20)];
+        [deleteBtn setImage:[UIImage imageNamed:@"编辑照片--取消_03"] forState:UIControlStateNormal];
+        [deleteBtn addTarget:self action:@selector(onTouchDelete:) forControlEvents:UIControlEventTouchUpInside];
+        [self addSubview:deleteBtn];
+        
+        [self setUserInteractionEnabled:YES];
+    }
+    return self;
+}
+
+
+- (void)onTouchDelete:(id)sender{
+    
+    if (self.delegate && [self.delegate respondsToSelector:@selector(tradeImageDelete:)]) {
+        
+        [self.delegate tradeImageDelete:_index];
+        
+    }
+    
+}
+
+
+@end

+ 16 - 0
NIMDemo/NIMDemo/SectionTrade/TradeModifyViewController.h

@@ -0,0 +1,16 @@
+//
+//  TradeModifyViewController.h
+//  NIMDemo
+//
+//  Created by Fenix Wang on 2017/7/11.
+//  Copyright © 2017年 Netease. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "TradeData.h"
+
+@interface TradeModifyViewController : UIViewController
+
+- (instancetype)initWithTradeData:(TradeData *)tradeData;
+
+@end

+ 396 - 0
NIMDemo/NIMDemo/SectionTrade/TradeModifyViewController.m

@@ -0,0 +1,396 @@
+//
+//  TradeModifyViewController.m
+//  NIMDemo
+//
+//  Created by Fenix Wang on 2017/7/11.
+//  Copyright © 2017年 Netease. All rights reserved.
+//
+
+#import "TradeModifyViewController.h"
+#import "UIView+NTES.h"
+#import "UIView+Toast.h"
+#import "UIImageView+WebCache.h"
+#import "TradeModifyImageView.h"
+#import "User.h"
+#import "NIMKitMediaFetcher.h"
+#import "TradePublishManager.h"
+
+@interface TradeModifyViewController ()<TradeModifyImageDelegate, TradePublishDelegate>
+
+@property (nonatomic, strong) TradeData             *data;
+@property (nonatomic, strong) NSMutableArray        *imgArr;
+@property (nonatomic, strong) NSMutableArray        *imgReuseArr;
+
+@property (nonatomic, strong) NSMutableArray        *imgIdArr;
+@property (nonatomic, strong) UIScrollView          *scrollView;
+
+@property (nonatomic, strong) UIView                *addImgView;
+@property (nonatomic, strong) NIMKitMediaFetcher    *mediaFetcher;
+
+
+@property (nonatomic, strong) UILabel               *countLabel;
+@property (nonatomic, strong) UIButton              *countBtn;
+@property (nonatomic, strong) UISlider              *slider;
+
+
+@property (nonatomic, assign) float                 imgSize;
+@property (nonatomic, assign) float                 imgSpace;
+@property (nonatomic, assign) int                   imgColumns;
+@property (nonatomic, assign) int                   maxImgs;
+
+@end
+
+@implementation TradeModifyViewController
+
+- (instancetype)initWithTradeData:(TradeData *)tradeData{
+    
+    self = [super init];
+    if(self){
+        _data = tradeData;
+        _imgArr = [[NSMutableArray alloc] init];
+        _imgReuseArr = [[NSMutableArray alloc] init];
+        _imgIdArr = [[NSMutableArray alloc] init];
+    }
+    return self;
+    
+}
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    
+    [self setUpComponent];
+}
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+
+- (void)viewWillAppear:(BOOL)animated
+{
+    [super viewWillAppear:animated];
+    
+    [self.navigationItem setTitle:@"修改图片"];
+    
+    UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
+    [rightBtn setTitle:@"修改" forState:UIControlStateNormal];
+    [rightBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
+    [rightBtn addTarget:self action:@selector(tradeEdit:) forControlEvents:UIControlEventTouchUpInside];
+    [rightBtn sizeToFit];
+    
+    UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithCustomView:rightBtn];
+    [self.navigationItem setRightBarButtonItems:@[rightItem]];
+}
+
+
+- (void)setUpComponent{
+    
+    self.view.backgroundColor = UIColor.whiteColor;
+    
+    float width = self.view.width;
+    
+    _scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, width, self.view.height)];
+    _scrollView.showsVerticalScrollIndicator = YES;
+    [self.view addSubview:_scrollView];
+    
+    _imgSpace = 2;
+    _imgColumns = 3;
+    _imgSize = (width - _imgSpace * 2) / _imgColumns;
+    _maxImgs = 9;
+    
+    for(int i=0; i<_data.thumbArr.count; i++)
+    {
+        NSString *picId = [_data.picIdArr objectAtIndex:i];
+        NSString *pic = [_data.picArr objectAtIndex:i];
+        NSString *thumb = [_data.thumbArr objectAtIndex:i];
+
+        [self createTradeImage:thumb pic:pic index:i picId:picId];
+    }
+    
+    _addImgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, _imgSize, _imgSize)];
+    _addImgView.backgroundColor = User.tinyGrayColor;
+    [_addImgView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onTouchAddImg:)]];
+    [_scrollView addSubview:_addImgView];
+    
+    UIImageView *addIcon = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, _imgSize/4, _imgSize/4)];
+    addIcon.centerX = _imgSize / 2;
+    addIcon.bottom = _imgSize / 2;
+    [addIcon setImage:[UIImage imageNamed:@"编辑照片_03"]];
+    [_addImgView addSubview:addIcon];
+    
+    UILabel *addLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, _imgSize/2+10, _imgSize, 30)];
+    addLabel.text = @"添加照片";
+    addLabel.textColor = User.greenColor;
+    addLabel.textAlignment = NSTextAlignmentCenter;
+    [_addImgView addSubview:addLabel];
+    
+    [self layoutImages:NO];
+    
+    
+    
+    
+    
+    UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, _imgSize * 3 + 40, 100, 40)];
+    titleLabel.text = @"添加置顶";
+    [_scrollView addSubview:titleLabel];
+    
+    _countLabel = [[UILabel alloc] initWithFrame:CGRectMake(_scrollView.width - 150, titleLabel.top, 100, 40)];
+    _countLabel.textAlignment = NSTextAlignmentRight;
+    [_scrollView addSubview:_countLabel];
+    
+    UIButton *countBtn = [UIButton buttonWithType:UIButtonTypeCustom];
+    countBtn.frame = CGRectMake(_scrollView.width - 50, titleLabel.top, 30, 30);
+    [countBtn setImage:[UIImage imageNamed:@"箭头_下"] forState:UIControlStateNormal];
+    //[countBtn addTarget:self action:@selector(toggleSlider:) forControlEvents:UIControlEventTouchUpInside];
+    [_scrollView addSubview:countBtn];
+    
+    _slider = [[UISlider alloc] initWithFrame:CGRectMake(50, titleLabel.bottom, _scrollView.width-70, 40)];
+    _slider.minimumValue = 0;
+    _slider.maximumValue = 100;
+    _slider.value = 0;
+    [_slider addTarget:self action:@selector(sliderValueChanged) forControlEvents:UIControlEventValueChanged];
+    [self sliderValueChanged];
+    [_scrollView addSubview:_slider];
+    
+    _scrollView.contentSize = CGSizeMake(_scrollView.width, _slider.bottom);
+    
+}
+
+
+- (TradeModifyImageView *)createTradeImage:(NSString *)thumb pic:(NSString *)pic index:(int)index picId:(NSString *)picId{
+    
+    TradeModifyImageView *imgView = nil;
+    
+    if(_imgReuseArr.count > 0)
+    {
+        imgView = [_imgReuseArr objectAtIndex:0];
+        [_imgReuseArr removeObjectAtIndex:0];
+        [imgView setHidden:NO];
+    }
+    else
+    {
+        imgView = [[TradeModifyImageView alloc] initWithFrame:CGRectMake(0, 0, _imgSize, _imgSize)];
+        imgView.delegate = self;
+        [_scrollView addSubview:imgView];
+    }
+    
+    NSURL *url = [NSURL URLWithString:thumb];
+    [imgView sd_setImageWithURL:url placeholderImage:User.defaultPlaceHolderImage];
+    
+    imgView.index = index;
+    imgView.thumbPath = thumb;
+    imgView.picPath = pic;
+    imgView.picId = picId;
+    
+    [_imgArr addObject:imgView];
+    
+    return imgView;
+}
+
+- (TradeModifyImageView *)createTradeImage:(UIImage *)img{
+    
+    TradeModifyImageView *imgView = nil;
+    
+    if(_imgReuseArr.count > 0)
+    {
+        imgView = [_imgReuseArr objectAtIndex:0];
+        [_imgReuseArr removeObjectAtIndex:0];
+        [imgView setHidden:NO];
+    }
+    else
+    {
+        imgView = [[TradeModifyImageView alloc] initWithFrame:CGRectMake(0, 0, _imgSize, _imgSize)];
+        imgView.delegate = self;
+        [_scrollView addSubview:imgView];
+    }
+    
+    [imgView setImage:img];
+    
+    imgView.index = 0;
+    imgView.thumbPath = nil;
+    imgView.picPath = nil;
+    imgView.picId = nil;
+    
+    [_imgArr addObject:imgView];
+    
+    return imgView;
+}
+
+- (void)layoutImages:(BOOL)animated{
+    
+    float width = self.view.width;
+    float space = 2;
+    int columns = 3;
+    float size = (width - space * 2) / columns;
+    int count = (int)_imgArr.count;
+    
+    float startX = 0;
+    float startY = 0;
+    
+    if(animated)
+    {
+        for(int i=0; i<count; i++)
+        {
+            startX = (i%columns) * (size + space);
+            startY = floorf(i/columns) * (size + space);
+            
+            TradeModifyImageView *img = [_imgArr objectAtIndex:i];
+            img.index = i;
+            
+            [UIView animateWithDuration:0.5 animations:^{
+                img.top = startY;
+                img.left = startX;
+            }];
+        }
+        
+        startX = (count%columns) * (size + space);
+        startY = floorf(count/columns) * (size + space);
+        
+        [UIView animateWithDuration:0.3 animations:^{
+            _addImgView.top = startY;
+            _addImgView.left = startX;
+        }];
+        
+    }
+    else
+    {
+        for(int i=0; i<count; i++)
+        {
+            startX = (i%columns) * (size + space);
+            startY = floorf(i/columns) * (size + space);
+            
+            TradeModifyImageView *img = [_imgArr objectAtIndex:i];
+            img.top = startY;
+            img.left = startX;
+        }
+        
+        startX = (count%columns) * (size + space);
+        startY = floorf(count/columns) * (size + space);
+        
+        _addImgView.top = startY;
+        _addImgView.left = startX;
+    }
+    
+    
+    _addImgView.hidden = count >= 9;
+}
+
+
+- (void)onTouchAddImg:(id)sender{
+    
+    [self showImagePicker:UIImagePickerControllerSourceTypePhotoLibrary];
+    
+}
+
+
+- (NIMKitMediaFetcher *)mediaFetcher
+{
+    if (!_mediaFetcher) {
+        _mediaFetcher = [[NIMKitMediaFetcher alloc] init];
+    }
+    return _mediaFetcher;
+}
+
+- (void)showImagePicker:(UIImagePickerControllerSourceType)type{
+    
+    __weak typeof(self) weakSelf = self;
+    self.mediaFetcher.limit = _maxImgs - _imgArr.count;
+    [self.mediaFetcher fetchPhotoFromLibrary:^(NSArray *images, NSString *path, PHAssetMediaType type) {
+        
+        switch (type) {
+            case PHAssetMediaTypeImage:
+            {
+                for (UIImage *image in images) {
+                    [weakSelf createTradeImage:image];
+                }
+                [weakSelf layoutImages:YES];
+            }
+                break;
+            case PHAssetMediaTypeVideo:
+            {
+            }
+                break;
+            default:
+                return;
+        }
+        
+    }];
+}
+
+
+- (void)tradeImageDelete:(int)index{
+    
+    TradeModifyImageView *tradeImage = [_imgArr objectAtIndex:index];
+    [_imgArr removeObjectAtIndex:index];
+    
+    tradeImage.hidden = YES;
+    [_imgReuseArr addObject:tradeImage];
+    
+    [self layoutImages:YES];
+    
+}
+
+
+
+- (void)sliderValueChanged{
+    _countLabel.text = [NSString stringWithFormat:@"x%d(+%.0f)", _data.priority, roundf(_slider.value)];
+}
+
+
+
+- (void)tradeEdit:(id)sender{
+    
+    BOOL hasModify = NO;
+    
+    for(int i=0; i<_imgArr.count; i++)
+    {
+        TradeModifyImageView *tradeImg = [_imgArr objectAtIndex:i];
+        if(!tradeImg.picId)
+        {
+            hasModify = YES;
+            break;
+        }
+    }
+    
+    int priorityModify = (int)roundf(_slider.value);
+    if(priorityModify > 0)
+    {
+        hasModify = YES;
+    }
+    
+    if(hasModify)
+    {
+        TradePublishManager *tradePublishManager = [[TradePublishManager alloc] init];
+        tradePublishManager.delegate = self;
+        [tradePublishManager tradeEdit:_data.tradeId picArr:_imgArr priority:priorityModify];
+    }
+    else
+    {
+        [self.view makeToast:@"没有任何改动" duration:2 position:CSToastPositionCenter];
+    }
+}
+
+
+- (void)tradeEditResult:(BOOL)success tradeData:(TradeData *)tradeData{
+    
+    if(success)
+    {
+        if([_data.tradeId isEqualToString:tradeData.tradeId])
+        {
+            _data.picIdArr = tradeData.picIdArr;
+            _data.picArr = tradeData.picArr;
+            _data.thumbArr = tradeData.thumbArr;
+            _data.priority = tradeData.priority;
+        }
+        
+        [self.view makeToast:@"修改成功" duration:2 position:CSToastPositionCenter];
+    }
+    else
+    {
+        [self.view makeToast:@"修改失败" duration:2 position:CSToastPositionCenter];
+    }
+}
+
+
+
+@end

+ 7 - 0
NIMDemo/NIMDemo/SectionTrade/TradePublishManager.h

@@ -8,10 +8,13 @@
 
 #import <Foundation/Foundation.h>
 #import "NIMInputView.h"
+#import "TradeData.h"
 
 @protocol TradePublishDelegate <NSObject>
 
+@optional
 - (void)tradePublishResult:(BOOL)success;
+- (void)tradeEditResult:(BOOL)success tradeData:(TradeData *_Nullable)tradeData;
 
 @end
 
@@ -25,4 +28,8 @@
             priority:(int)priority
            tradeType:(int)tradeType;
 
+- (void)tradeEdit:(NSString *_Nullable)msg
+              picArr:(NSMutableArray *_Nullable)picArr
+            priority:(int)priority;
+
 @end

+ 93 - 2
NIMDemo/NIMDemo/SectionTrade/TradePublishManager.m

@@ -12,9 +12,11 @@
 #import "SVProgressHUD.h"
 #import "UIView+Toast.h"
 #import "HttpRequest.h"
+#import "TradeModifyImageView.h"
 
 @interface TradePublishManager()
 
+@property (nonatomic, strong) NSString              *tradeId;
 @property (nonatomic, strong) NSString              *msg;
 @property (nonatomic, strong) NSMutableArray        *picArr;
 @property (nonatomic, strong) NSMutableArray        *picDataArr;
@@ -22,6 +24,8 @@
 @property (nonatomic, assign) int                   priority;
 @property (nonatomic, assign) int                   tradeType;
 
+@property (nonatomic, assign) BOOL                  isEdit;
+
 @end
 
 @implementation TradePublishManager
@@ -38,6 +42,7 @@
     
     self.picDataArr = [[NSMutableArray alloc] init];
     self.uploadIndex = 0;
+    self.isEdit = NO;
     
     [SVProgressHUD show];
     
@@ -49,11 +54,42 @@
     
     if(_uploadIndex >= _picArr.count)
     {
-        [self publish];
+        if(_isEdit)
+            [self edit];
+        else
+            [self publish];
         return;
     }
     
-    UIImage *image = [_picArr objectAtIndex:_uploadIndex];
+    UIImage *image = nil;
+    if(_isEdit)
+    {
+        TradeModifyImageView *modifyImg = [_picArr objectAtIndex:_uploadIndex];
+        if(modifyImg.picId)
+        {
+            if(_uploadIndex >= _picDataArr.count)
+            {
+                [_picDataArr addObject:modifyImg.picId];
+            }
+            else
+            {
+                [_picDataArr setObject:modifyImg.picId atIndexedSubscript:_uploadIndex];
+            }
+            
+            _uploadIndex++;
+            [self uploadPicture];
+            return;
+        }
+        else
+        {
+            image = modifyImg.image;
+        }
+    }
+    else
+    {
+        image = [_picArr objectAtIndex:_uploadIndex];
+    }
+    
     NSString *userId = [NSString stringWithFormat:@"%d", [User sharedInfo].userId];
     NSDictionary *dict = @{@"user_id":userId};
     
@@ -153,4 +189,59 @@
 }
 
 
+
+
+
+
+//edit
+- (void)tradeEdit:(NSString *_Nullable)tradeId
+           picArr:(NSMutableArray *_Nullable)picArr
+         priority:(int)priority{
+    
+    self.tradeId = tradeId;
+    self.msg = nil;
+    self.picArr = picArr;
+    self.priority = priority;
+    
+    self.picDataArr = [[NSMutableArray alloc] init];
+    self.uploadIndex = 0;
+    self.isEdit = YES;
+    
+    [SVProgressHUD show];
+    
+    [self uploadPicture];
+    
+}
+
+
+- (void)edit{
+    
+    [[HttpRequest shared] tradeEdit:_tradeId msg:nil picArr:_picDataArr priority:_priority success:^(NSString * _Nullable tradeId, NSMutableArray * _Nullable pics, NSMutableArray * _Nullable thumbs, NSMutableArray * _Nullable picIds, int priority) {
+        
+        if ([_delegate respondsToSelector:@selector(tradeEditResult:tradeData:)]){
+            
+            TradeData *tradeData = [[TradeData alloc] init];
+            tradeData.tradeId = tradeId;
+            tradeData.picArr = pics;
+            tradeData.thumbArr = thumbs;
+            tradeData.picIdArr = picIds;
+            tradeData.priority = priority;
+            
+            [SVProgressHUD dismiss];
+            
+            if ([_delegate respondsToSelector:@selector(tradeEditResult:tradeData:)]){
+                [_delegate tradeEditResult:YES tradeData:tradeData];
+            }
+        }
+        
+    } failure:^{
+        [SVProgressHUD dismiss];
+
+        if ([_delegate respondsToSelector:@selector(tradeEditResult:tradeData:)]){
+            [_delegate tradeEditResult:NO tradeData:nil];
+        }
+    }];
+    
+}
+
 @end

+ 12 - 2
NIMDemo/NIMDemo/SectionTrade/TradeTableViewCell.m

@@ -14,6 +14,8 @@
 #import "User.h"
 #import "ImagePagerViewController.h"
 #import "HttpRequest.h"
+#import "TradeUtil.h"
+#import "TradeDetailViewController.h"
 
 
 @interface TradeTableViewCell() <UITextViewDelegate>
@@ -86,9 +88,11 @@ return self;
     
     
     //message
-    _msgTextView = [[UITextView alloc] initWithFrame:CGRectMake(padding, _avatarView.bottom+5, cellWidth - padding * 2, 0)];
+    _msgTextView = [[UITextView alloc] initWithFrame:CGRectMake(padding, _avatarView.bottom+10, cellWidth - padding * 2, 0)];
     _msgTextView.font = [UIFont systemFontOfSize:15];
     _msgTextView.textContainerInset = UIEdgeInsetsMake(0, 0, 0, 0);
+    _msgTextView.editable = NO;
+    [_msgTextView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onTouchContent:)]];
     [self addSubview:_msgTextView];
     
     //image container
@@ -141,7 +145,7 @@ return self;
     
     
     _timeLabel.text = data.time;
-    _msgTextView.text = data.msg;
+    _msgTextView.attributedText = [[TradeUtil shared] tradeMsg:data.msg tradeType:data.type];
     
     _msgTextView.height = _msgTextView.contentSize.height;
     
@@ -259,6 +263,12 @@ return self;
     [self.viewController.navigationController pushViewController:imagePageVC animated:YES];
 }
 
+- (void)onTouchContent:(UITapGestureRecognizer *)gestureRecognizer{
+    
+    TradeDetailViewController *detailVC = [[TradeDetailViewController alloc] initWithTradeData:_data];
+    [self.viewController.navigationController pushViewController:detailVC animated:YES];
+    
+}
 
 
 

+ 17 - 0
NIMDemo/NIMDemo/SectionTrade/TradeUtil.h

@@ -0,0 +1,17 @@
+//
+//  TradeUtil.h
+//  NIMDemo
+//
+//  Created by Fenix Wang on 2017/7/11.
+//  Copyright © 2017年 Netease. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "TradeData.h"
+
+@interface TradeUtil : NSObject
+
++ (instancetype)shared;
+- (NSMutableAttributedString *)tradeMsg:(NSString *)msg tradeType:(int)tradeType;
+
+@end

+ 59 - 0
NIMDemo/NIMDemo/SectionTrade/TradeUtil.m

@@ -0,0 +1,59 @@
+//
+//  TradeUtil.m
+//  NIMDemo
+//
+//  Created by Fenix Wang on 2017/7/11.
+//  Copyright © 2017年 Netease. All rights reserved.
+//
+
+#import "TradeUtil.h"
+#import "User.h"
+
+@implementation TradeUtil
+
++ (instancetype)shared
+{
+    static TradeUtil *shared = nil;
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        shared = [[TradeUtil alloc] init];
+    });
+    return shared;
+}
+
+- (NSMutableAttributedString *)tradeMsg:(NSString *)msg tradeType:(int)tradeType{
+    
+    NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] init];
+    
+    UIColor *tipColor = nil;
+    NSString *tipText = nil;
+    
+    if(tradeType == TradeTypeDemand)
+    {
+        tipColor = User.greenColor;
+        tipText = @"[需求] ";
+    }
+    else
+    {
+        tipColor = User.blueColor;
+        tipText = @"[供求] ";
+    }
+    
+    NSDictionary *attrs = [NSDictionary dictionaryWithObjectsAndKeys:
+                           [UIFont systemFontOfSize:15.0], NSFontAttributeName,
+                           tipColor, NSForegroundColorAttributeName, nil];
+    NSMutableAttributedString *appendString = [[NSMutableAttributedString alloc] initWithString:tipText attributes:attrs];
+    [attrString appendAttributedString:appendString];
+    
+    
+    attrs = [NSDictionary dictionaryWithObjectsAndKeys:
+             [UIFont systemFontOfSize:15.0], NSFontAttributeName, nil];
+    appendString = [[NSMutableAttributedString alloc] initWithString:msg attributes:attrs];
+    [attrString appendAttributedString:appendString];
+    
+    return attrString;
+}
+
+
+
+@end

+ 1 - 1
NIMDemo/NIMDemo/SectionTrade/TradeViewController.m

@@ -158,7 +158,7 @@ float postHeight = 30;
     _tradeItem2.hidden = YES;
     [self.view addSubview:_tradeItem2];
     
-    _timer = [NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(requestLastTradeDataList) userInfo:nil repeats:YES];
+    _timer = [NSTimer scheduledTimerWithTimeInterval:8.0 target:self selector:@selector(requestLastTradeDataList) userInfo:nil repeats:YES];
     
     
     

+ 42 - 21
NIMDemo/NIMDemo/SocialDetailTableViewCell.m

@@ -265,39 +265,55 @@
 - (void)fetchLikes{
     
     if(_likeArr)
+    {
+        [self updateLikeAvatars];
         return;
+    }
     
     [[HttpRequest shared] socialLikeList:_data.socialId success:^(NSMutableArray * _Nullable dataList) {
         
         _likeArr = dataList;
+        [self updateLikeAvatars];
         
-        float likeSize = _likeContainer.width / 8;
-        float likePadding = 2;
+    } failure:^{
         
-        for(int i=0; i<dataList.count; i++)
+    }];
+    
+}
+
+
+- (void)updateLikeAvatars{
+    float likeSize = _likeContainer.width / 8;
+    float likePadding = 2;
+    
+    for(int i=0; i<_likeArr.count; i++)
+    {
+        NSString *userId = [_likeArr objectAtIndex:i];
+        NIMUser *user = [[NIMSDK sharedSDK].userManager userInfo:userId];
+        
+        float startX = (i % 8) * likeSize;
+        float startY = floorf(i / 8) * likeSize;
+        
+        NIMAvatarImageView *avatar = nil;
+        if(i < _likeContainer.subviews.count)
         {
-            NSString *userId = [dataList objectAtIndex:i];
-            NIMUser *user = [[NIMSDK sharedSDK].userManager userInfo:userId];
-            
-            float startX = (i % 8) * likeSize;
-            float startY = floorf(i / 8) * likeSize;
-            
-            NIMAvatarImageView *avatar = [[NIMAvatarImageView alloc] initWithFrame:CGRectMake(startX+likePadding, startY+likePadding, likeSize-likePadding*2, likeSize-likePadding*2)];
-            
-            avatar.tag = [userId intValue];
-            [avatar addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onTouchAvatar:)]];
-            
-            NSURL *url = user && user.userInfo.avatarUrl ? [NSURL URLWithString:user.userInfo.avatarUrl] : nil;
-            [avatar nim_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"avatar_user2"]];
+            avatar = [_likeContainer.subviews objectAtIndex:i];
+        }
+        else
+        {
+            avatar = [[NIMAvatarImageView alloc] initWithFrame:CGRectMake(startX+likePadding, startY+likePadding, likeSize-likePadding*2, likeSize-likePadding*2)];
             [_likeContainer addSubview:avatar];
         }
         
-    } failure:^{
+        avatar.tag = [userId intValue];
+        [avatar addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onTouchAvatar:)]];
         
-    }];
-    
+        NSURL *url = user && user.userInfo.avatarUrl ? [NSURL URLWithString:user.userInfo.avatarUrl] : nil;
+        [avatar nim_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"avatar_user2"]];
+    }
 }
 
+
 - (void)onTouchAvatar:(UITapGestureRecognizer *)gestureRecognizer{
     
     UIView *viewClicked = [gestureRecognizer view];
@@ -336,9 +352,14 @@
 
 - (void)onTouchLike:(int)sender{
     
-    [[HttpRequest shared] socialLike:_data.socialId success:^(NSString * _Nullable socialId, int currentLikes) {
+    __weak typeof(self) wself = self;
+    [[HttpRequest shared] socialLike:_data.socialId success:^(NSString * _Nullable socialId, int currentLikes, NSMutableArray *likeList) {
+        
+        wself.data.likes = currentLikes;
+        wself.data.likeArr = likeList;
+        wself.likeArr = likeList;
         
-        _data.likes = currentLikes;
+        [wself setSocialData:_data];
         
     } failure:^{
         

+ 4 - 2
NIMDemo/NIMDemo/SocialTableViewCell.m

@@ -79,8 +79,9 @@
     [self addSubview:_nickTextView];
     
     _msgTxtView = [[UITextView alloc] initWithFrame:CGRectMake(contentX-5, 35, cellWidth - 10 - contentX, 100)];
+    [_msgTxtView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showAllComments:)]];
     _msgTxtView.font = [UIFont systemFontOfSize:15];
-    _msgTxtView.userInteractionEnabled = NO;
+    _msgTxtView.editable = NO;
     [self addSubview:_msgTxtView];
     
     _picContainer = [[UIView alloc] initWithFrame:CGRectMake(contentX, _msgTxtView.bottom, cellWidth - 40 - contentX, 0)];
@@ -488,11 +489,12 @@
 
 - (void)onTouchLike:(int)sender{
     
-    [[HttpRequest shared] socialLike:_data.socialId success:^(NSString * _Nullable socialId, int currentLikes) {
+    [[HttpRequest shared] socialLike:_data.socialId success:^(NSString * _Nullable socialId, int currentLikes, NSMutableArray *likeList) {
         
         if([_data.socialId isEqualToString:socialId])
         {
             _data.likes = currentLikes;
+            _data.likeArr = likeList;
             [self setData:_data];
         }
         

+ 22 - 1
NIMDemo/NIMDemo/User.h

@@ -8,6 +8,7 @@
 
 #import <Foundation/Foundation.h>
 #import "GiftInputContainer.h"
+#import "NIMSDK/NIMSDK.h"
 
 @interface User : NSObject
 
@@ -49,8 +50,11 @@
 
 + (UIColor *_Nonnull)greenColor;
 + (UIColor *_Nonnull)orangeColor;
++ (UIColor *_Nonnull)tinyGrayColor;
++ (UIColor *_Nonnull)blueColor;
 
 
+//gift utils
 - (void)requestGiftList:(void (^_Nullable)(NSMutableArray * _Nullable list))success
                 failure:(void (^_Nullable)(NSError * _Nullable error))failure;
 
@@ -75,13 +79,30 @@
 - (GiftData *_Nullable)getGiftData:(NSString *_Nonnull)giftId;
 
 
-
+//trade utils
 - (BOOL)isNewTradeGot:(NSString *_Nullable)key dataId:(NSString *_Nullable)dataId;
 
 
 
+
+//user info utils
 + (NSString *_Nonnull)distance:(double)originLat originLng:(double)originLng targetLat:(double)targetLat targetLng:(double)targetLng;
 
 + (void)showUserInfo:(NSString *_Nullable)userId;
+- (BOOL)isTeamOwner:(NIMTeam *_Nullable)team;
+- (NSAttributedString *_Nonnull)getUserNameStr:(NIMUser *_Nullable)user;
+
+- (BOOL)isSystemTeam:(NSString *_Nonnull)teamId;
+
++ (UIImage *_Nonnull)defaultUserAvatar;
++ (UIImage *_Nonnull)defaultTeamAvatar;
++ (UIImage *_Nonnull)defaultPlaceHolderImage;
+    
+    
+
+
+
+
+
 
 @end

+ 85 - 1
NIMDemo/NIMDemo/User.m

@@ -9,7 +9,7 @@
 #import "User.h"
 #import "AFHTTPSessionManager.h"
 #import "GiftInputContainer.h"
-#import "NIMSDK/NIMSDK.h"
+
 
 @interface User()
 
@@ -40,6 +40,24 @@ int newCreateTeamId;
     return orangeColor;
 }
 
++ (UIColor *)tinyGrayColor{
+    static UIColor *tinyGrayColor = nil;
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        tinyGrayColor = [UIColor colorWithRed:0.95 green:0.95 blue:0.95 alpha:1.0];
+    });
+    return tinyGrayColor;
+}
+
++ (UIColor *)blueColor{
+    static UIColor *blueColor = nil;
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        blueColor = UIColorFromRGB(0x4c82b0);
+    });
+    return blueColor;
+}
+
 + (instancetype)sharedInfo
 {
     static User *sharedInfo = nil;
@@ -292,4 +310,70 @@ int newCreateTeamId;
 
 
 
+- (BOOL)isTeamOwner:(NIMTeam *)team{
+    
+    NSString *myUserId = [[NIMSDK sharedSDK] loginManager].currentAccount;
+    if(team.owner && [team.owner isEqualToString:myUserId])
+    {
+        return YES;
+    }
+    return NO;
+    
+}
+
+- (NSAttributedString *)getUserNameStr:(NIMUser *)user{
+    
+    NSDictionary *attrs = [NSDictionary dictionaryWithObjectsAndKeys:
+                           [UIFont systemFontOfSize:15.0], NSFontAttributeName,
+                           UIColorFromRGB(0x4c82b0), NSForegroundColorAttributeName, nil];
+    
+    if(user)
+    {
+        NSString *nick = user && user.userInfo.nickName ? user.userInfo.nickName : user.userId;
+        NSMutableAttributedString *appendString = [[NSMutableAttributedString alloc] initWithString:nick attributes:attrs];
+        NSRange range = NSMakeRange(0, appendString.length);
+        [appendString addAttribute:NSLinkAttributeName value:user.userId range:range];
+        return appendString;
+    }
+    
+    return [[NSMutableAttributedString alloc] initWithString:@"" attributes:attrs];
+}
+
+- (BOOL)isSystemTeam:(NSString *_Nonnull)teamId{
+    
+    NIMTeam *team = [[NIMSDK sharedSDK].teamManager teamById:teamId];
+    if([team.owner isEqualToString:@"10000"])
+    {
+        return YES;
+    }
+    return NO;
+}
+
++ (UIImage *_Nonnull)defaultUserAvatar{
+    static UIImage *userAvatar = nil;
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        userAvatar = [UIImage imageNamed:@"avatar_user2"];
+    });
+    return userAvatar;
+}
+
++ (UIImage *_Nonnull)defaultTeamAvatar{
+    static UIImage *teamAvatar = nil;
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        teamAvatar = [UIImage imageNamed:@"avatar_team"];
+    });
+    return teamAvatar;
+}
+
++ (UIImage *_Nonnull)defaultPlaceHolderImage{
+    static UIImage *placeHolderImage = nil;
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        placeHolderImage = [UIImage imageNamed:@"聊天-_17"];
+    });
+    return placeHolderImage;
+}
+
 @end

+ 3 - 0
NIMKit/NIMKit/Classes/Sections/Input/GiftInputContainer.h

@@ -35,6 +35,9 @@
 @property (nonatomic, strong)  UILabel          *balanceLabel;
 @property (nonatomic, weak) id<GiftDataSourceDelegate> delegate;
 
+
+@property (nonatomic, strong) UIButton                      *supplyBtn;
+@property (nonatomic, strong) UIButton                      *demandBtn;
 @property (nonatomic, strong) TradeInputContainer           *tradeContainer;
 
 @property (nonatomic, assign)  BOOL             layoutHold;

+ 1 - 2
NIMKit/NIMKit/Classes/Sections/Input/GiftInputContainer.m

@@ -46,8 +46,7 @@ NSInteger TradeTypeDemand = 2;
 @property (nonatomic, assign) int                           currentBalance;
 
 
-@property (nonatomic, strong) UIButton                      *supplyBtn;
-@property (nonatomic, strong) UIButton                      *demandBtn;
+
 
 @end
 

+ 1 - 1
NIMKit/NIMKit/Classes/Sections/Input/TradeInputContainer.m

@@ -71,7 +71,7 @@
     [countBtn addTarget:self action:@selector(toggleSlider:) forControlEvents:UIControlEventTouchUpInside];
     [self addSubview:countBtn];
     
-    _slider = [[UISlider alloc] initWithFrame:CGRectMake(10, 40, self.nim_width-20, 40)];
+    _slider = [[UISlider alloc] initWithFrame:CGRectMake(20, 40, self.nim_width-40, 40)];
     _slider.minimumValue = 1;
     _slider.maximumValue = 100;
     _slider.value = 1;