// // ShopCertificationIntroduceController.m // Ifish // // Created by imac on 16/8/16. // Copyright © 2016年 lianxiang. All rights reserved. // #import "ShopCertificationIntroduceController.h" #import "CertificationViewThirdCell.h" #import "CertificationViewFourthCell.h" #include "CertificationViewSecondCell.h" #import "certificationViewFirstCell.h" #import "ShopCertificationViewController.h" #import "IfishShopCerNewViewController.h" @interface ShopCertificationIntroduceController () @property(nonatomic,strong)UITableView *tableView; @end @implementation ShopCertificationIntroduceController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. [self addTitleViewWithTitle:@"商户认证"]; [self setUI]; } -(void)setUI{ self.tableView = [[UITableView alloc] init ]; self.tableView.frame =CGRectMake(0,0, self.view.frame.size.width,self.view.frame.size.height); self.tableView.delegate = self; self.tableView.dataSource = self; self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; self.tableView.showsVerticalScrollIndicator = NO; self.tableView.backgroundColor = TABLE_HEADER_COLOR; [self.view addSubview:self.tableView]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ return 4; } -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ return 1; } -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ if (indexPath.row == 0 ) { certificationViewFirstCell *cell=[tableView dequeueReusableCellWithIdentifier:@"certificationViewFirstCell"]; if (!cell) { cell = [[[NSBundle mainBundle]loadNibNamed:@"certificationViewFirstCell" owner:self options:nil]lastObject]; } cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.backgroundColor = [UIColor redColor]; return cell; }else if (indexPath.row == 1){ CertificationViewSecondCell *cell=[tableView dequeueReusableCellWithIdentifier:@"CertificationViewSecondCell"]; if (!cell) { cell = [[[NSBundle mainBundle]loadNibNamed:@"CertificationViewSecondCell" owner:self options:nil]lastObject]; } cell.selectionStyle = UITableViewCellSelectionStyleNone; return cell; }else if (indexPath.row == 2) { CertificationViewThirdCell *cell=[tableView dequeueReusableCellWithIdentifier:@"CertificationViewThirdCell"]; if (!cell) { cell = [[[NSBundle mainBundle]loadNibNamed:@"CertificationViewThirdCell" owner:self options:nil]lastObject]; } cell.selectionStyle = UITableViewCellSelectionStyleNone; return cell; }else if (indexPath.row == 3){ CertificationViewFourthCell *cell=[tableView dequeueReusableCellWithIdentifier:@"CertificationViewFourthCell"]; if (!cell) { cell = [[[NSBundle mainBundle]loadNibNamed:@"CertificationViewFourthCell" owner:self options:nil]lastObject]; } cell.selectionStyle = UITableViewCellSelectionStyleNone; return cell; } return nil; } -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ CGFloat headerImgH= self.view.frame.size.width * 0.37; CGFloat ImgH= self.view.frame.size.width * 0.35; //CGFloat QianWH= 49; if (indexPath.row == 0){ return headerImgH; }else if (indexPath.row == 1){ return 120; }else if (indexPath.row == 2){ return ImgH + 120 + 70; }else if (indexPath.row == 3){ return 60 ; } return 1; } -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ if (indexPath.row == 3) { self.hidesBottomBarWhenPushed = YES; IfishShopCerNewViewController *cerVC = [[IfishShopCerNewViewController alloc] init]; //ShopCertificationViewController *cerVC=[[ShopCertificationViewController alloc] init]; [self.navigationController pushViewController:cerVC animated:YES]; } } @end