User.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. //
  2. // User.h
  3. // NIMDemo
  4. //
  5. // Created by Fenix Wang on 2017/5/24.
  6. // Copyright © 2017年 Netease. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "GiftInputContainer.h"
  10. #import "NIMSDK/NIMSDK.h"
  11. @interface User : NSObject
  12. + (instancetype _Nonnull ) sharedInfo;
  13. @property int userId;
  14. @property (nonatomic, nullable) NSString *nick;
  15. @property (nonatomic, nullable) NSString *mobile;
  16. @property (nonatomic, nullable) NSString *token;
  17. @property int coin;
  18. @property double latitude;
  19. @property double longitude;
  20. @property (nonatomic, nullable) NSString *province;
  21. @property (nonatomic, nullable) NSString *city;
  22. @property (nonatomic, nullable) NSString *district;
  23. //chat
  24. @property (nonatomic, nullable) NSString *countryRoomId;
  25. @property (nonatomic, nullable) NSString *provinceRoomId;
  26. @property (nonatomic, nullable) NSString *cityRoomId;
  27. @property (nonatomic, nullable) NSString *districtRoomId;
  28. @property (nonatomic, assign) int newCreateTeamId;
  29. @property (nonatomic, assign) BOOL firstTimeJoin;
  30. @property (nonatomic, assign) BOOL hasNewSocial;
  31. @property (nonatomic, nullable, strong) NSString *currentChatRoomId;
  32. @property (nonatomic, strong, nonnull) NSMutableDictionary * giftGotDict;
  33. @property (nonatomic, strong, nonnull) NSMutableDictionary * tradeGotDict;
  34. //social
  35. @property (nonatomic, strong, nonnull) NSMutableArray *picArr;
  36. @property (nonatomic, strong, nonnull) NSMutableArray *thumbArr;
  37. //trade
  38. @property (nonatomic, strong, nonnull) NSMutableArray *tradePriorityItemArr;
  39. + (UIColor *_Nonnull)greenColor;
  40. + (UIColor *_Nonnull)orangeColor;
  41. + (UIColor *_Nonnull)tinyGrayColor;
  42. + (UIColor *_Nonnull)blueColor;
  43. //gift utils
  44. - (void)requestGiftList:(void (^_Nullable)(NSMutableArray * _Nullable list))success
  45. failure:(void (^_Nullable)(NSError * _Nullable error))failure;
  46. - (void)sendGif:(GiftData *_Nullable)giftData
  47. count:(int)count
  48. teamId:(NSString *_Nullable)teamId
  49. targetId:(NSString *_Nullable)targetId
  50. msg:(NSString *_Nullable)msg
  51. success:(void (^_Nullable)(NSString * _Nullable giftId, NSString * _Nullable info))sucCallBack
  52. failure:(void (^_Nullable)(NSError * _Nullable error))failCallBack;
  53. - (void)requestGif:(NSString *_Nullable)senderId
  54. targetId:(NSString *_Nullable)targetId
  55. teamId:(NSString *_Nullable)teamId
  56. success:(void (^_Nullable)(NSMutableArray * _Nonnull giftArr))sucCallBack
  57. failure:(void (^_Nullable)(NSError * _Nullable error))failCallBack;
  58. - (BOOL)isNewGiftGot:(NSString *_Nonnull)key dataId:(NSString *_Nullable)dataId;
  59. - (void)initGiftGot:(NSString *_Nullable)key dataId:(NSString *_Nullable)dataId;
  60. - (GiftData *_Nullable)getGiftData:(NSString *_Nonnull)giftId;
  61. //trade utils
  62. - (BOOL)isNewTradeGot:(NSString *_Nullable)key dataId:(NSString *_Nullable)dataId;
  63. //user info utils
  64. + (NSString *_Nonnull)distance:(double)originLat originLng:(double)originLng targetLat:(double)targetLat targetLng:(double)targetLng;
  65. + (void)showUserInfo:(NSString *_Nullable)userId;
  66. - (BOOL)isTeamOwner:(NIMTeam *_Nullable)team;
  67. - (NSAttributedString *_Nonnull)getUserNameStr:(NIMUser *_Nullable)user;
  68. - (BOOL)isSystemTeam:(NSString *_Nonnull)teamId;
  69. + (UIImage *_Nonnull)defaultUserAvatar;
  70. + (UIImage *_Nonnull)defaultTeamAvatar;
  71. + (UIImage *_Nonnull)defaultPlaceHolderImage;
  72. @end