123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- //
- // AccompanyDetailViewController.m
- // KulexiuForTeacher
- //
- // Created by 王智 on 2022/4/6.
- //
- #import "AccompanyDetailViewController.h"
- #import "AccompanyNavView.h"
- #import "AccompanyAlertView.h"
- #import "AccompanyCourseInfoCell.h"
- #import "AccompanyEvaluateCell.h"
- #import "AccompanyStudentEvaCell.h"
- #import "AccompanyArrangeCell.h"
- #import "AccompanyHomeworkCell.h"
- #import "AccompanyRemarkCell.h"
- @interface AccompanyDetailViewController ()<UITableViewDelegate,UITableViewDataSource>
- @property (nonatomic, strong) AccompanyNavView *navView;
- @property (nonatomic, strong) UITableView *tableView;
- @end
- @implementation AccompanyDetailViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view.
- self.ks_prefersNavigationBarHidden = YES;
- [self configUI];
- [self requestMessage];
- }
- - (void)requestMessage {
-
- }
- - (void)requestHomeworkMessage {
-
- }
- //- (void)request
- - (void)configUI {
- [self.scrollView removeFromSuperview];
- [self.view addSubview:self.navView];
- CGFloat height = [self.navView getViewHeight];
- [self.navView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.right.top.mas_equalTo(self);
- make.height.mas_equalTo(height);
- }];
- [self.view addSubview:self.tableView];
- [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.right.mas_equalTo(self.view);
- make.top.mas_equalTo(self.view.mas_top).offset(kNaviBarHeight);
- make.bottom.mas_equalTo(self.view.mas_bottom).offset(-iPhoneXSafeBottomMargin);
- }];
- }
- #pragma mark --- table data source
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
- return 6;
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- if (indexPath.row == 0) {
- AccompanyCourseInfoCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AccompanyCourseInfoCell"];
- return cell;
- }
- else if (indexPath.row == 1) {
- AccompanyEvaluateCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AccompanyEvaluateCell"];
- return cell;
- }
- else if (indexPath.row == 2) {
- AccompanyStudentEvaCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AccompanyStudentEvaCell"];
- return cell;
- }
- else if (indexPath.row == 3) {
- AccompanyArrangeCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AccompanyArrangeCell"];
-
- return cell;
- }
- else if (indexPath.row == 4) {
- AccompanyHomeworkCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AccompanyHomeworkCell"];
- return cell;
- }
- else {
- AccompanyRemarkCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AccompanyRemarkCell"];
- return cell;
- }
- }
- #pragma mark --- lazying
- - (UITableView *)tableView {
- if (!_tableView) {
- _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
- _tableView.delegate = self;
- _tableView.dataSource = self;
- _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
- _tableView.showsVerticalScrollIndicator = NO;
- _tableView.showsHorizontalScrollIndicator = NO;
- _tableView.backgroundColor = [UIColor clearColor];
- _tableView.rowHeight = UITableViewAutomaticDimension;
- _tableView.estimatedRowHeight = 136.0f;
- UIView *bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 10)];
- bottomView.backgroundColor = [UIColor clearColor];
- _tableView.tableFooterView = bottomView;
- }
- return _tableView;
- }
- - (AccompanyNavView *)navView {
- if (!_navView) {
- _navView = [AccompanyNavView shareInstance];
- MJWeakSelf;
- [_navView navCallback:^{
- [weakSelf backAction];
- }];
- }
- return _navView;
- }
- /*
- #pragma mark - Navigation
- // In a storyboard-based application, you will often want to do a little preparation before navigation
- - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
- // Get the new view controller using [segue destinationViewController].
- // Pass the selected object to the new view controller.
- }
- */
- @end
|