145 lines
4.9 KiB
Objective-C
145 lines
4.9 KiB
Objective-C
//
|
|
// DDMyAuthorStatusViewController.m
|
|
// DingDangApp
|
|
//
|
|
// Created by apple on 2023/6/20.
|
|
//
|
|
|
|
#import "DDMyAuthorStatusViewController.h"
|
|
#import "DDAuthorStatusTableViewCell.h"
|
|
#import "DDAuthorButtonTableViewCell.h"
|
|
#import "DDAuthorNameCardTableViewCell.h"
|
|
#import "DDMyAuthorViewController.h"
|
|
@interface DDMyAuthorStatusViewController ()
|
|
|
|
|
|
@end
|
|
|
|
@implementation DDMyAuthorStatusViewController
|
|
|
|
- (void)viewDidLoad {
|
|
[super viewDidLoad];
|
|
// Do any additional setup after loading the view.
|
|
[self initNav];
|
|
[self creatV];
|
|
}
|
|
- (void)initNav {
|
|
[self defaultNavTitle:@"实名认证" hideLine:YES];
|
|
self.view.backgroundColor = [UIColor whiteColor];
|
|
|
|
WeakSelf(weakSelf)
|
|
self.customNavBar.onClickLeftButton = ^{
|
|
if (weakSelf.isPopRoot){
|
|
[weakSelf.navigationController popToRootViewControllerAnimated:YES];
|
|
}else{
|
|
[weakSelf.navigationController popViewControllerAnimated:YES];
|
|
}
|
|
};
|
|
}
|
|
- (void)creatV {
|
|
[self.view addSubview:self.listTableView];
|
|
[self.listTableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.right.bottom.left.equalTo(self.view);
|
|
make.top.equalTo(self.view).offset(DDNavigationBarHeight());
|
|
}];
|
|
}
|
|
|
|
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
|
|
{
|
|
return 1;
|
|
}
|
|
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
|
|
{
|
|
if (indexPath.row == 0) {
|
|
return 292;
|
|
}
|
|
if (indexPath.row == 1) {
|
|
return 80;
|
|
}
|
|
return 100 ;
|
|
}
|
|
|
|
- (nullable UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
|
|
return [[UIView alloc] init];
|
|
}
|
|
|
|
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
|
return CGFLOAT_MIN;
|
|
}
|
|
|
|
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
|
{
|
|
if (self.authenType == DDMyAuthorStatusType_Fail) {
|
|
return 3;
|
|
}
|
|
return 2;
|
|
}
|
|
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
|
if (indexPath.row == 0) {
|
|
DDAuthorStatusTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"DDAuthorStatusTableViewCell"];
|
|
if (cell == nil) {
|
|
cell = [[DDAuthorStatusTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"DDAuthorStatusTableViewCell"];
|
|
}
|
|
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
|
if (![ToolsObject IsNullWithObject:self.realNameModel.reason]){
|
|
cell.remark = self.realNameModel.reason;
|
|
}else if (![ToolsObject IsNullWithObject:self.realNameModel.remark]){
|
|
cell.remark = self.realNameModel.remark;
|
|
}else{
|
|
cell.remark = @"";
|
|
}
|
|
cell.authenType = self.authenType;
|
|
return cell ;
|
|
}
|
|
if (indexPath.row == 1) {
|
|
DDAuthorNameCardTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"DDAuthorNameCardTableViewCell"];
|
|
if (cell == nil) {
|
|
cell = [[DDAuthorNameCardTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"DDAuthorNameCardTableViewCell"];
|
|
}
|
|
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
|
cell.realNameModel = self.realNameModel;
|
|
return cell ;
|
|
}
|
|
DDAuthorButtonTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"DDAuthorButtonTableViewCell"];
|
|
if (cell == nil) {
|
|
cell = [[DDAuthorButtonTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"DDAuthorButtonTableViewCell"];
|
|
}
|
|
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
|
WeakSelf(weakSelf)
|
|
cell.authClickBlock = ^{
|
|
if (weakSelf.isPopRoot){
|
|
[weakSelf.navigationController popViewControllerAnimated:YES];
|
|
}else{
|
|
DDMyAuthorViewController *vc = [[DDMyAuthorViewController alloc]init];
|
|
[weakSelf.navigationController pushViewController:vc animated:YES];
|
|
}
|
|
};
|
|
return cell ;
|
|
}
|
|
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
|
|
|
}
|
|
- (UITableView *)listTableView
|
|
{
|
|
if (!_listTableView) {
|
|
_listTableView = [[UITableView alloc]initWithFrame:CGRectZero style:UITableViewStylePlain];
|
|
_listTableView.backgroundColor = [UIColor clearColor];
|
|
_listTableView.delegate =self;
|
|
_listTableView.dataSource =self;
|
|
_listTableView.showsVerticalScrollIndicator = NO;
|
|
_listTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
|
}
|
|
return _listTableView ;
|
|
}
|
|
/*
|
|
#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
|