AccompanyDetailViewController.m 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. //
  2. // AccompanyDetailViewController.m
  3. // KulexiuForTeacher
  4. //
  5. // Created by 王智 on 2022/4/6.
  6. //
  7. #import "AccompanyDetailViewController.h"
  8. #import "AccompanyNavView.h"
  9. #import "AccompanyAlertView.h"
  10. #import "AccompanyCourseInfoCell.h"
  11. #import "AccompanyEvaluateCell.h"
  12. #import "AccompanyStudentEvaCell.h"
  13. #import "AccompanyArrangeCell.h"
  14. #import "AccompanyHomeworkCell.h"
  15. #import "AccompanyRemarkCell.h"
  16. @interface AccompanyDetailViewController ()<UITableViewDelegate,UITableViewDataSource>
  17. @property (nonatomic, strong) AccompanyNavView *navView;
  18. @property (nonatomic, strong) UITableView *tableView;
  19. @end
  20. @implementation AccompanyDetailViewController
  21. - (void)viewDidLoad {
  22. [super viewDidLoad];
  23. // Do any additional setup after loading the view.
  24. self.ks_prefersNavigationBarHidden = YES;
  25. [self configUI];
  26. [self requestMessage];
  27. }
  28. - (void)requestMessage {
  29. }
  30. - (void)requestHomeworkMessage {
  31. }
  32. //- (void)request
  33. - (void)configUI {
  34. [self.scrollView removeFromSuperview];
  35. [self.view addSubview:self.navView];
  36. CGFloat height = [self.navView getViewHeight];
  37. [self.navView mas_makeConstraints:^(MASConstraintMaker *make) {
  38. make.left.right.top.mas_equalTo(self);
  39. make.height.mas_equalTo(height);
  40. }];
  41. [self.view addSubview:self.tableView];
  42. [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
  43. make.left.right.mas_equalTo(self.view);
  44. make.top.mas_equalTo(self.view.mas_top).offset(kNaviBarHeight);
  45. make.bottom.mas_equalTo(self.view.mas_bottom).offset(-iPhoneXSafeBottomMargin);
  46. }];
  47. }
  48. #pragma mark --- table data source
  49. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  50. return 6;
  51. }
  52. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  53. if (indexPath.row == 0) {
  54. AccompanyCourseInfoCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AccompanyCourseInfoCell"];
  55. return cell;
  56. }
  57. else if (indexPath.row == 1) {
  58. AccompanyEvaluateCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AccompanyEvaluateCell"];
  59. return cell;
  60. }
  61. else if (indexPath.row == 2) {
  62. AccompanyStudentEvaCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AccompanyStudentEvaCell"];
  63. return cell;
  64. }
  65. else if (indexPath.row == 3) {
  66. AccompanyArrangeCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AccompanyArrangeCell"];
  67. return cell;
  68. }
  69. else if (indexPath.row == 4) {
  70. AccompanyHomeworkCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AccompanyHomeworkCell"];
  71. return cell;
  72. }
  73. else {
  74. AccompanyRemarkCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AccompanyRemarkCell"];
  75. return cell;
  76. }
  77. }
  78. #pragma mark --- lazying
  79. - (UITableView *)tableView {
  80. if (!_tableView) {
  81. _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
  82. _tableView.delegate = self;
  83. _tableView.dataSource = self;
  84. _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
  85. _tableView.showsVerticalScrollIndicator = NO;
  86. _tableView.showsHorizontalScrollIndicator = NO;
  87. _tableView.backgroundColor = [UIColor clearColor];
  88. _tableView.rowHeight = UITableViewAutomaticDimension;
  89. _tableView.estimatedRowHeight = 136.0f;
  90. UIView *bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 10)];
  91. bottomView.backgroundColor = [UIColor clearColor];
  92. _tableView.tableFooterView = bottomView;
  93. }
  94. return _tableView;
  95. }
  96. - (AccompanyNavView *)navView {
  97. if (!_navView) {
  98. _navView = [AccompanyNavView shareInstance];
  99. MJWeakSelf;
  100. [_navView navCallback:^{
  101. [weakSelf backAction];
  102. }];
  103. }
  104. return _navView;
  105. }
  106. /*
  107. #pragma mark - Navigation
  108. // In a storyboard-based application, you will often want to do a little preparation before navigation
  109. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  110. // Get the new view controller using [segue destinationViewController].
  111. // Pass the selected object to the new view controller.
  112. }
  113. */
  114. @end