SignUpViewController.m 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //
  2. // SignUpViewController.m
  3. // 千模
  4. //
  5. // Created by MUMEI on 2018/5/18.
  6. // Copyright © 2018年 MUMEI. All rights reserved.
  7. //
  8. #import "SignUpViewController.h"
  9. #import "SignViewCell.h"
  10. #import "ActivityDetailViewController.h"
  11. @interface SignUpViewController ()
  12. @property (weak, nonatomic) IBOutlet UITableView *tableView;
  13. @end
  14. @implementation SignUpViewController
  15. - (void)viewDidLoad {
  16. [super viewDidLoad];
  17. self.tableView.tableHeaderView = self.headView;
  18. self.navigationItem.title = @"活动详情";
  19. UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom];
  20. btn.frame = CGRectMake(0, 0, 40, 40);
  21. [btn setImage:[UIImage imageNamed:@"fanhui2"] forState:UIControlStateNormal];
  22. btn.imageEdgeInsets = UIEdgeInsetsMake(0, -20, 0, 0);
  23. [btn addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
  24. UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
  25. UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
  26. nagetiveSpacer.width = -12;//这个值可以根据自己需要自己调整
  27. self.navigationItem.leftBarButtonItems = @[nagetiveSpacer, leftItem];
  28. _tableView.showsVerticalScrollIndicator = NO;
  29. [_headView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",imageURl,_model.pic]] placeholderImage:[UIImage imageNamed:@"jiazai"]];
  30. // Do any additional setup after loading the view.
  31. }
  32. -(void)backClick{
  33. [self.navigationController popViewControllerAnimated:YES];
  34. }
  35. //- (void)viewWillAppear:(BOOL)animated{
  36. // [self.navigationController setNavigationBarHidden:YES animated:YES];
  37. //}
  38. //
  39. //- (void)viewWillDisappear:(BOOL)animated{
  40. // [self.navigationController setNavigationBarHidden:NO animated:YES];
  41. //
  42. //}
  43. #pragma mark - deleDate
  44. -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  45. return 1;
  46. }
  47. -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  48. SignViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"SignViewCell"];
  49. if (!cell) {
  50. cell = [[[UINib nibWithNibName:@"SignViewCell" bundle:nil]instantiateWithOwner:self options:nil]lastObject];
  51. cell.selectionStyle = UIAccessibilityTraitNone;
  52. cell.model = _model;
  53. }
  54. return cell;
  55. }
  56. -(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
  57. return 1;
  58. }
  59. -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  60. return 695;
  61. }
  62. - (IBAction)signUp:(id)sender {
  63. ActivityDetailViewController *aVc = [[ActivityDetailViewController alloc]init];
  64. if ([_model.issign isEqualToString:@"1"]) {
  65. [MBProgressHUD showTextHUD:@"不能重复报名" inView:self.view hideAfterDelay:1];
  66. }else{
  67. aVc.model = _model;
  68. [self.navigationController pushViewController:aVc animated:YES];
  69. }
  70. }
  71. - (void)didReceiveMemoryWarning {
  72. [super didReceiveMemoryWarning];
  73. // Dispose of any resources that can be recreated.
  74. }
  75. @end