JXPaiHangBangTopView.m 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. //
  2. // JXPaiHangBangTopView.m
  3. // shiku_im
  4. //
  5. // Created by 123 on 2020/5/23.
  6. // Copyright © 2020 Reese. All rights reserved.
  7. //
  8. #import "JXPaiHangBangTopView.h"
  9. @interface JXPaiHangBangTopView()
  10. @property (weak, nonatomic) IBOutlet UILabel *userNameL;
  11. @property (weak, nonatomic) IBOutlet UILabel *yinliL;
  12. @property (weak, nonatomic) IBOutlet UILabel *userName1;
  13. @property (weak, nonatomic) IBOutlet UILabel *userName2;
  14. @property (weak, nonatomic) IBOutlet UILabel *totalL;
  15. @property (weak, nonatomic) IBOutlet UILabel *daML;
  16. @property (weak, nonatomic) IBOutlet UIImageView *oneIMG;
  17. @property (weak, nonatomic) IBOutlet UIImageView *chongIMG;
  18. @property (weak, nonatomic) IBOutlet UIImageView *damaIMG;
  19. @end
  20. @implementation JXPaiHangBangTopView
  21. -(void)awakeFromNib{
  22. self.backgroundColor = kRGBColor(181, 27, 35);
  23. _damaIMG.layer.cornerRadius=35;
  24. _damaIMG.layer.masksToBounds=YES;
  25. _oneIMG.layer.cornerRadius=35;
  26. _oneIMG.layer.masksToBounds=YES;
  27. _chongIMG.layer.cornerRadius=35;
  28. _chongIMG.layer.masksToBounds=YES;
  29. [g_server delHeadImage:g_server.myself.userId];
  30. [g_server getHeadImageSmall:g_server.myself.userId userName:g_server.myself.userNickname imageView:_oneIMG];
  31. [g_server getHeadImageSmall:g_server.myself.userId userName:g_server.myself.userNickname imageView:_chongIMG];
  32. [g_server getHeadImageSmall:g_server.myself.userId userName:g_server.myself.userNickname imageView:_damaIMG];
  33. long time = (long)[[NSDate date] timeIntervalSince1970];
  34. time = (time *1000 + g_server.timeDifference);
  35. NSString *salt = [NSString stringWithFormat:@"%ld", time];
  36. [SVProgressHUD show];
  37. [g_server getMyPaihangBang:salt andType:@"4" andToView:self];
  38. [super awakeFromNib];
  39. }
  40. +(instancetype)XIBJXPaiHangBangTopView{
  41. return [[NSBundle mainBundle]loadNibNamed:@"JXPaiHangBangTopView" owner:self options:nil].firstObject;
  42. }
  43. - (IBAction)yiinLIAndChongzhiAndDaMaBtn:(UIButton *)sender {
  44. if (_jxpaiHangBangTopViewBlockBtn) {
  45. _jxpaiHangBangTopViewBlockBtn(sender);
  46. }
  47. }
  48. #pragma mark --- 请求成功
  49. -(void) didServerResultSucces:(JXConnection*)aDownload dict:(NSDictionary*)dict array:(NSArray*)array1{
  50. [SVProgressHUD dismiss];
  51. if([aDownload.action isEqualToString:act_usertopPHBall])
  52. {
  53. [array1 enumerateObjectsUsingBlock:^(NSDictionary * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
  54. if ([obj[@"type"] intValue]==1) {
  55. self.yinliL.text=[NSString stringWithFormat:@"盈利奖金%@",obj[@"money"]];
  56. self.userNameL.text=[NSString stringWithFormat:@"%@",obj[@"membershipAccount"]];
  57. }else if([obj[@"type"] intValue]==2){
  58. self.userName1.text=[NSString stringWithFormat:@"%@",obj[@"membershipAccount"]];
  59. self.totalL.text=[NSString stringWithFormat:@"充值榜%@",obj[@"money"]];
  60. }else if([obj[@"type"] intValue]==3){
  61. self.userName2.text=[NSString stringWithFormat:@"%@",obj[@"membershipAccount"]];
  62. self.daML.text=[NSString stringWithFormat:@"打码榜%@",obj[@"money"]];
  63. }
  64. }];
  65. }
  66. }
  67. -(int) didServerResultFailed:(JXConnection*)aDownload dict:(NSDictionary*)dict{
  68. [SVProgressHUD dismiss];
  69. NSString * errorCode = [NSString stringWithFormat:@"%@",[dict objectForKey:@"resultMsg"]];
  70. if([errorCode isEqualToString:@"权限验证失败"])
  71. {
  72. if ([aDownload.action isEqualToString:act_GetBalanceRedTimes])
  73. {
  74. }
  75. }
  76. }
  77. @end