| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- //
- // SettlementMethodVC.m
- // IBOSSmini
- //
- // Created by guan hong hou on 2018/4/8.
- // Copyright © 2018年 elongtian. All rights reserved.
- //
- #import "SettlementMethodVC.h"
- #import "SettlementMethodCell.h"
- @interface SettlementMethodVC ()
- @end
- @implementation SettlementMethodVC
- - (void)viewDidLoad {
- [super viewDidLoad];
- [self loadNavStyle];
- [self initUI];
- }
- /**
- 修改:2017-9-25
- 适配机型
- 安全区视图发生变化
- */
- -(void)viewSafeAreaInsetsDidChange{
- self.view.backgroundColor = [UIColor whiteColor];
- _vTableView.frame = CGRectMake(0,0, self.view.frame.size.width, self.view.safeAreaLayoutGuide.layoutFrame.size.height );
-
- [super viewSafeAreaInsetsDidChange];
- }
- -(void)loadNavStyle
- {
- self.navigationItem.title=@"请选择";
- //返回
- UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
- [button setBackgroundImage:[UIImage imageNamed:@"icon_back"]
- forState:UIControlStateNormal];
- [button addTarget:self action:@selector(goBack)
- forControlEvents:UIControlEventTouchUpInside];
- button.frame = CGRectMake(0, 0, 15, 18);
-
- UIBarButtonItem *menuButton = [[UIBarButtonItem alloc] initWithCustomView:button];
- self.navigationItem.leftBarButtonItem = menuButton;
- }
- -(void)initUI{
- _vTableView = [[UITableView alloc]
- initWithFrame:CGRectMake(0,
- 0,
- self.view.frame.size.width,
- self.view.frame.size.height)];
-
- _vTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
- _vTableView.autoresizingMask = UIViewAutoresizingFlexibleHeight;
- _vTableView.backgroundColor = [UIColor whiteColor];
- _vTableView.delegate = self;
- _vTableView.dataSource=self;
- [self.view addSubview:_vTableView];
-
- }
- #pragma mark - tableView回调
- /**
- 单元格cell个数
-
- @param tableView <#tableView description#>
- @param section <#section description#>
- @return <#return value description#>
- */
- -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- {
- return [_settlementMethodArray count];
- }
- /**
- <#Description#>
-
- @param tableView <#tableView description#>
- @return <#return value description#>
- */
- -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
- return 1;
- }
- /**
- 高度
-
- @param tableView <#tableView description#>
- @param indexPath <#indexPath description#>
- @return <#return value description#>
- */
- - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
-
- return 46;
-
- }
- /**
- 点击单元格事件
-
- @param tableView tableView description
- @param indexPath indexPath description
- */
- - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
- {
- CollecteAmountModel *collectAmountModel = [_settlementMethodArray objectAtIndex:indexPath.row];
-
- if([self.settlementDelegate respondsToSelector:@selector(callbackSettlementMethod:)])
- {
- [self.settlementDelegate callbackSettlementMethod:collectAmountModel];
- }
- [self.navigationController popViewControllerAnimated:YES];
-
- }
- /**
- 每个单元格cell
-
- @param tableView <#tableView description#>
- @param indexPath <#indexPath description#>
- @return <#return value description#>
- */
- -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- static NSString *cellIdentifier = @"SettlementMethodCell";
- SettlementMethodCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier ];
- cell=[[SettlementMethodCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
- cell.selectionStyle=UITableViewCellSelectionStyleNone;
- CollecteAmountModel *earnestModel = [_settlementMethodArray objectAtIndex:indexPath.row];
- [cell parseEarnestInfo:earnestModel];
- return cell;
- }
- @end
|