// // JXMyServiceVc.m // shiku_im // // Created by 123 on 2020/5/15. // Copyright © 2020 Reese. All rights reserved. // #import "JXMyServiceVc.h" #import "JXMyServiceCell.h" #import "JXServiceTopView.h" @interface JXMyServiceVc () @property (nonatomic, strong) UITableView * collectionView; @property (nonatomic,strong) NSMutableArray *dataArr; @property (nonatomic,strong) NSMutableArray *otherdataArr; @end @implementation JXMyServiceVc - (void)gobackBtnClcik{ [g_navigation dismissViewController:self animated:YES]; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [self.navigationController setNavigationBarHidden:YES]; } - (void)viewDidLoad { [super viewDidLoad]; _dataArr=[NSMutableArray array]; _otherdataArr=[NSMutableArray array]; _collectionView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, JX_SCREEN_WIDTH, JX_SCREEN_HEIGHT-10)]; _collectionView.delegate = self; _collectionView.dataSource = self; _collectionView.showsVerticalScrollIndicator = NO; _collectionView.showsHorizontalScrollIndicator = NO; _collectionView.backgroundColor = [UIColor colorWithRed:250/255. green:250/255. blue:250/255. alpha:1.0]; self.view.backgroundColor = [UIColor colorWithRed:207/255. green:250/255. blue:250/255. alpha:1.0]; _collectionView.separatorStyle=UITableViewCellSeparatorStyleNone; [self.view addSubview:_collectionView]; JXServiceTopView *bangve=[JXServiceTopView XIBJXServiceTopView]; bangve.frame=CGRectMake(0, 0,JX_SCREEN_WIDTH, 201); [bangve.gobackBtn addTarget:self action:@selector(gobackBtnClcik) forControlEvents:UIControlEventTouchUpInside]; self.collectionView.tableHeaderView=bangve; bangve.autoresizingMask=UIViewAutoresizingNone; bangve.autoresizingMask=UIViewAutoresizingFlexibleHeight; if (@available(iOS 11.0, *)) { self.collectionView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; } else { // Fallback on earlier versions } self.collectionView.estimatedSectionHeaderHeight = 0; self.collectionView.estimatedSectionFooterHeight = 0; self.collectionView.estimatedRowHeight = 0; NSDictionary *dict = @{ @"statuses" : @[ @{ @"image" : @"kefuback2", @"leftIMG" : @"kefuzuCall2", @"text" : @"主线客服", @"subtile" : @"Main Customer Support" , @"contet" : @"7*24小时专线服务 贴心至上" }, @{ @"image" : @"kefuback1", @"leftIMG" : @"kefuzuCall", @"text" : @"视频客服", @"subtile" : @"Live Customer Support", @"contet" : @"视频专线服务 尽我所能" } ] }; _dataArr = [StatusesModel mj_objectArrayWithKeyValuesArray:dict[@"statuses"]]; [_collectionView reloadData]; } -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ return 120; } -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ return _dataArr.count;; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ JXMyServiceCell *cell=[JXMyServiceCell cellWithTableView:tableView]; StatusesModel *model =_dataArr[indexPath.row]; cell.modeL=model; return cell; } @end