JXMyServiceVc.m 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. //
  2. // JXMyServiceVc.m
  3. // shiku_im
  4. //
  5. // Created by 123 on 2020/5/15.
  6. // Copyright © 2020 Reese. All rights reserved.
  7. //
  8. #import "JXMyServiceVc.h"
  9. #import "JXMyServiceCell.h"
  10. #import "JXServiceTopView.h"
  11. @interface JXMyServiceVc ()<UITableViewDelegate, UITableViewDataSource>
  12. @property (nonatomic, strong) UITableView * collectionView;
  13. @property (nonatomic,strong) NSMutableArray *dataArr;
  14. @property (nonatomic,strong) NSMutableArray *otherdataArr;
  15. @end
  16. @implementation JXMyServiceVc
  17. - (void)gobackBtnClcik{
  18. [g_navigation dismissViewController:self animated:YES];
  19. }
  20. - (void)viewWillAppear:(BOOL)animated {
  21. [super viewWillAppear:animated];
  22. [self.navigationController setNavigationBarHidden:YES];
  23. }
  24. - (void)viewDidLoad {
  25. [super viewDidLoad];
  26. _dataArr=[NSMutableArray array];
  27. _otherdataArr=[NSMutableArray array];
  28. _collectionView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, JX_SCREEN_WIDTH, JX_SCREEN_HEIGHT-10)];
  29. _collectionView.delegate = self;
  30. _collectionView.dataSource = self;
  31. _collectionView.showsVerticalScrollIndicator = NO;
  32. _collectionView.showsHorizontalScrollIndicator = NO;
  33. _collectionView.backgroundColor = [UIColor colorWithRed:250/255. green:250/255. blue:250/255. alpha:1.0];
  34. self.view.backgroundColor = [UIColor colorWithRed:207/255. green:250/255. blue:250/255. alpha:1.0];
  35. _collectionView.separatorStyle=UITableViewCellSeparatorStyleNone;
  36. [self.view addSubview:_collectionView];
  37. JXServiceTopView *bangve=[JXServiceTopView XIBJXServiceTopView];
  38. bangve.frame=CGRectMake(0, 0,JX_SCREEN_WIDTH, 201);
  39. [bangve.gobackBtn addTarget:self action:@selector(gobackBtnClcik) forControlEvents:UIControlEventTouchUpInside];
  40. self.collectionView.tableHeaderView=bangve;
  41. bangve.autoresizingMask=UIViewAutoresizingNone;
  42. bangve.autoresizingMask=UIViewAutoresizingFlexibleHeight;
  43. if (@available(iOS 11.0, *)) {
  44. self.collectionView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
  45. } else {
  46. // Fallback on earlier versions
  47. }
  48. self.collectionView.estimatedSectionHeaderHeight = 0;
  49. self.collectionView.estimatedSectionFooterHeight = 0;
  50. self.collectionView.estimatedRowHeight = 0;
  51. NSDictionary *dict = @{
  52. @"statuses" : @[
  53. @{
  54. @"image" : @"kefuback2",
  55. @"leftIMG" : @"kefuzuCall2",
  56. @"text" : @"主线客服",
  57. @"subtile" : @"Main Customer Support" ,
  58. @"contet" : @"7*24小时专线服务 贴心至上"
  59. },
  60. @{
  61. @"image" : @"kefuback1",
  62. @"leftIMG" : @"kefuzuCall",
  63. @"text" : @"视频客服",
  64. @"subtile" : @"Live Customer Support",
  65. @"contet" : @"视频专线服务 尽我所能"
  66. }
  67. ]
  68. };
  69. _dataArr = [StatusesModel mj_objectArrayWithKeyValuesArray:dict[@"statuses"]];
  70. [_collectionView reloadData];
  71. }
  72. -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  73. return 120;
  74. }
  75. -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  76. return _dataArr.count;;
  77. }
  78. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  79. JXMyServiceCell *cell=[JXMyServiceCell cellWithTableView:tableView];
  80. StatusesModel *model =_dataArr[indexPath.row];
  81. cell.modeL=model;
  82. return cell;
  83. }
  84. @end