ApplicantCell.m 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //
  2. // ApplicantCell.m
  3. // BuguLive
  4. //
  5. // Created by 杨仁伟 on 2017/8/8.
  6. // Copyright © 2017年 xfg. All rights reserved.
  7. //
  8. #import "ApplicantCell.h"
  9. @implementation ApplicantCell
  10. - (void)awakeFromNib {
  11. [super awakeFromNib];
  12. // Initialization code
  13. self.applicantHeadImg.layer.cornerRadius = 20;
  14. self.applicantHeadImg.clipsToBounds = YES;
  15. self.applicantLivingBtn.layer.cornerRadius = 10;
  16. self.applicantLivingBtn.clipsToBounds = YES;
  17. self.applicantRefuseBtn.layer.cornerRadius = 10;
  18. self.applicantRefuseBtn.clipsToBounds = YES;
  19. self.applicantAgreeBtn.layer.cornerRadius = 10;
  20. self.applicantAgreeBtn.clipsToBounds = YES;
  21. self.applicantAgreeBtn.backgroundColor = kAppMainColor;
  22. self.applicantNickNameLbl.textColor = kAppGrayColor1;
  23. }
  24. - (void)configCellMsg:(SociatyDetailModel *)model
  25. {
  26. self.applicantLivingBtn.hidden = model.live_in.intValue == 1 ? NO : YES;
  27. self.applicantLivingLbl.hidden = model.live_in.intValue == 1 ? NO : YES;
  28. [self.applicantHeadImg sd_setImageWithURL:[NSURL URLWithString:model.user_image] placeholderImage:kDefaultPreloadHeadImg];
  29. self.applicantGradeImg.image = [UIImage imageNamed:[NSString stringWithFormat:@"level%@",model.user_lv]];
  30. self.applicantNickNameLbl.text = model.user_name;
  31. self.applicantSexImg.image = [model.user_sex intValue] == 1 ? [UIImage imageNamed:@"com_male_selected"] : [UIImage imageNamed:@"com_female_selected"];
  32. }
  33. - (IBAction)agreeClick:(id)sender {
  34. if (self.delegate && [self.delegate respondsToSelector:@selector(agreeOfSociety:)]) {
  35. [self.delegate agreeOfSociety:self];
  36. }
  37. }
  38. - (IBAction)refuseClick:(id)sender {
  39. if (self.delegate && [self.delegate respondsToSelector:@selector(refuseOfSociety:)]) {
  40. [self.delegate refuseOfSociety:self];
  41. }
  42. }
  43. - (IBAction)viewLiving:(id)sender {
  44. if (self.delegate && [self.delegate respondsToSelector:@selector(viewLiving:)]) {
  45. [self.delegate viewLiving:self];
  46. }
  47. }
  48. @end