JXVipTeQVc.m 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. //
  2. // JXVipTeQVc.m
  3. // shiku_im
  4. //
  5. // Created by 123 on 2020/5/16.
  6. // Copyright © 2020 Reese. All rights reserved.
  7. //
  8. #import "JXVipTeQVc.h"
  9. #import "JXVipDetailTopView.h"
  10. #import "JXVipDetailTcell.h"
  11. #import "JXVipBottomView.h"
  12. #import "JXMyModel.h"
  13. @interface JXVipTeQVc ()<UITableViewDataSource,UITableViewDelegate>
  14. @property (nonatomic,strong) UITableView *tableView;
  15. @property (nonatomic,strong) NSMutableArray *dataArr;
  16. @property (nonatomic,weak) JXVipDetailTopView *topView;
  17. @property (nonatomic,weak) JXVipBottomView *bottomView;
  18. @end
  19. @implementation JXVipTeQVc
  20. - (void)viewWillAppear:(BOOL)animated{
  21. [super viewWillAppear:animated];
  22. [self.navigationController setNavigationBarHidden:YES];
  23. }
  24. - (void)goback{
  25. [g_navigation dismissViewController:self animated:NO];
  26. }
  27. - (void)viewDidLoad {
  28. [super viewDidLoad];
  29. _dataArr=[NSMutableArray array];
  30. JXVipDetailTopView *topView=[JXVipDetailTopView XIBJXVipDetailTopView];
  31. topView.frame=CGRectMake(0, 0, JX_SCREEN_WIDTH, 250);
  32. [self.view addSubview:topView];
  33. self.topView=topView;
  34. [topView.gobackBt addTarget:self action:@selector(goback) forControlEvents:UIControlEventTouchUpInside];
  35. _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(topView.frame)+8, JX_SCREEN_WIDTH, JX_SCREEN_HEIGHT-JX_SCREEN_TOP)style:UITableViewStylePlain ];
  36. _tableView.delegate=self;
  37. _tableView.dataSource = self;
  38. _tableView.backgroundColor = [UIColor colorWithRed:250/255. green:250/255. blue:250/255. alpha:1.0];
  39. _tableView.separatorStyle=UITableViewCellSeparatorStyleNone;
  40. _tableView.contentInset=UIEdgeInsetsMake(0, 0, -60, 0);
  41. [self.view addSubview:_tableView];
  42. JXVipBottomView *bottomView=[JXVipBottomView XIBJJXVipBottomView];
  43. bottomView.frame=CGRectMake(0, CGRectGetMaxY(topView.frame), JX_SCREEN_WIDTH, 180);
  44. self.tableView.tableFooterView=bottomView;
  45. bottomView.autoresizingMask=UIViewAutoresizingNone;
  46. self.bottomView=bottomView;
  47. [_tableView reloadData];
  48. [SVProgressHUD show];
  49. //[g_server getAppResource:@"6" ToView:self];
  50. long time = (long)[[NSDate date] timeIntervalSince1970];
  51. time = (time *1000 + g_server.timeDifference);
  52. NSString *salt = [NSString stringWithFormat:@"%ld", time];
  53. ///user/vip/info /user/vip/info
  54. [g_server getact_act_userGradelistGrade:salt andToView:self];
  55. [g_server getUserVipInformation:salt andToView:self];
  56. }
  57. #pragma mark --- 请求成功
  58. -(void) didServerResultSucces:(JXConnection*)aDownload dict:(NSDictionary*)dict array:(NSArray*)array1{
  59. [SVProgressHUD dismiss];
  60. //NSLog(@"dict: %@ --- arry: %@",dict ,array1 );
  61. if([aDownload.action isEqualToString:act_userViplist]){
  62. _dataArr=[vipDetailModel mj_objectArrayWithKeyValuesArray:array1];
  63. vipDetailModel *model = [_dataArr firstObject];
  64. self.bottomView.moneyL.text=model.money;
  65. self.bottomView.packageL.text=model.upgradeCoin;
  66. [_tableView reloadData];
  67. }if([aDownload.action isEqualToString:act_GetUserVipInformation]){
  68. self.topView.dictInfo=dict;
  69. }
  70. }
  71. -(int) didServerResultFailed:(JXConnection*)aDownload dict:(NSDictionary*)dict{
  72. [SVProgressHUD dismiss];
  73. NSString * errorCode = [NSString stringWithFormat:@"%@",[dict objectForKey:@"resultMsg"]];
  74. if([errorCode isEqualToString:@"权限验证失败"])
  75. {
  76. if ([aDownload.action isEqualToString:act_userViplist])
  77. {
  78. }if([aDownload.action isEqualToString:actuservipinfo]){
  79. }
  80. }
  81. return [errorCode intValue];
  82. }
  83. -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  84. return 130;
  85. }
  86. -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  87. return 1;
  88. }
  89. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  90. JXVipDetailTcell *cell=[JXVipDetailTcell cellWithTableView:tableView];
  91. if (_dataArr>0) {
  92. cell.dataArr=_dataArr;
  93. }
  94. return cell;
  95. }
  96. @end