123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- //
- // JXVipTeQVc.m
- // shiku_im
- //
- // Created by 123 on 2020/5/16.
- // Copyright © 2020 Reese. All rights reserved.
- //
- #import "JXVipTeQVc.h"
- #import "JXVipDetailTopView.h"
- #import "JXVipDetailTcell.h"
- #import "JXVipBottomView.h"
- #import "JXMyModel.h"
- @interface JXVipTeQVc ()<UITableViewDataSource,UITableViewDelegate>
- @property (nonatomic,strong) UITableView *tableView;
- @property (nonatomic,strong) NSMutableArray *dataArr;
- @property (nonatomic,weak) JXVipDetailTopView *topView;
- @property (nonatomic,weak) JXVipBottomView *bottomView;
- @end
- @implementation JXVipTeQVc
- - (void)viewWillAppear:(BOOL)animated{
- [super viewWillAppear:animated];
- [self.navigationController setNavigationBarHidden:YES];
- }
- - (void)goback{
- [g_navigation dismissViewController:self animated:NO];
- }
- - (void)viewDidLoad {
- [super viewDidLoad];
- _dataArr=[NSMutableArray array];
- JXVipDetailTopView *topView=[JXVipDetailTopView XIBJXVipDetailTopView];
- topView.frame=CGRectMake(0, 0, JX_SCREEN_WIDTH, 250);
- [self.view addSubview:topView];
- self.topView=topView;
- [topView.gobackBt addTarget:self action:@selector(goback) forControlEvents:UIControlEventTouchUpInside];
-
- _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(topView.frame)+8, JX_SCREEN_WIDTH, JX_SCREEN_HEIGHT-JX_SCREEN_TOP)style:UITableViewStylePlain ];
- _tableView.delegate=self;
- _tableView.dataSource = self;
- _tableView.backgroundColor = [UIColor colorWithRed:250/255. green:250/255. blue:250/255. alpha:1.0];
- _tableView.separatorStyle=UITableViewCellSeparatorStyleNone;
- _tableView.contentInset=UIEdgeInsetsMake(0, 0, -60, 0);
- [self.view addSubview:_tableView];
-
- JXVipBottomView *bottomView=[JXVipBottomView XIBJJXVipBottomView];
- bottomView.frame=CGRectMake(0, CGRectGetMaxY(topView.frame), JX_SCREEN_WIDTH, 180);
- self.tableView.tableFooterView=bottomView;
- bottomView.autoresizingMask=UIViewAutoresizingNone;
- self.bottomView=bottomView;
-
- [_tableView reloadData];
-
- [SVProgressHUD show];
- //[g_server getAppResource:@"6" ToView:self];
-
- long time = (long)[[NSDate date] timeIntervalSince1970];
- time = (time *1000 + g_server.timeDifference);
- NSString *salt = [NSString stringWithFormat:@"%ld", time];
- ///user/vip/info /user/vip/info
- [g_server getact_act_userGradelistGrade:salt andToView:self];
-
-
- [g_server getUserVipInformation:salt andToView:self];
- }
- #pragma mark --- 请求成功
- -(void) didServerResultSucces:(JXConnection*)aDownload dict:(NSDictionary*)dict array:(NSArray*)array1{
- [SVProgressHUD dismiss];
-
- //NSLog(@"dict: %@ --- arry: %@",dict ,array1 );
- if([aDownload.action isEqualToString:act_userViplist]){
- _dataArr=[vipDetailModel mj_objectArrayWithKeyValuesArray:array1];
- vipDetailModel *model = [_dataArr firstObject];
- self.bottomView.moneyL.text=model.money;
-
- self.bottomView.packageL.text=model.upgradeCoin;
- [_tableView reloadData];
- }if([aDownload.action isEqualToString:act_GetUserVipInformation]){
-
- self.topView.dictInfo=dict;
-
- }
-
-
-
- }
-
- -(int) didServerResultFailed:(JXConnection*)aDownload dict:(NSDictionary*)dict{
- [SVProgressHUD dismiss];
- NSString * errorCode = [NSString stringWithFormat:@"%@",[dict objectForKey:@"resultMsg"]];
- if([errorCode isEqualToString:@"权限验证失败"])
- {
- if ([aDownload.action isEqualToString:act_userViplist])
- {
-
- }if([aDownload.action isEqualToString:actuservipinfo]){
-
- }
- }
-
- return [errorCode intValue];
- }
- -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
- return 130;
- }
- -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
-
-
- return 1;
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
-
- JXVipDetailTcell *cell=[JXVipDetailTcell cellWithTableView:tableView];
- if (_dataArr>0) {
- cell.dataArr=_dataArr;
- }
- return cell;
-
- }
- @end
|