YOUPAIZYEditUserShowAlertWindow.m 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #import "YOUPAIZYEditUserShowAlertWindow.h"
  2. #import "UIViewController+TFPresent.h"
  3. @interface YOUPAIZYEditUserShowAlertWindow ()
  4. @end
  5. @implementation YOUPAIZYEditUserShowAlertWindow
  6. - (void)viewDidLoad {
  7. [super viewDidLoad];
  8. self.baseView.hidden = YES;
  9. NSInteger count = _youpaipbtntitleArr.count;
  10. UIView *bgV = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, count * 50.0f + SafeHeight)];
  11. bgV.backgroundColor = LCSubBkgColor;
  12. [self.view addSubview:bgV];
  13. [bgV mas_makeConstraints:^(MASConstraintMaker *make) {
  14. make.left.right.bottom.offset(0.0f);
  15. make.height.offset(count * 50.0f + SafeHeight);
  16. }];
  17. [LCTools clipCorner:UIRectCornerTopLeft|UIRectCornerTopRight View:bgV size:CGSizeMake(20.0f, 20.0f)];
  18. // NSArray *btntitleArr = @[@"举报",@"拉黑",@"取消"];
  19. CGFloat btnH = 50.0f;
  20. for (NSInteger i = 0; i < _youpaipbtntitleArr.count; i ++) {
  21. UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
  22. button.frame = CGRectMake(0.0f,i * btnH,KScreenWidth,btnH);
  23. [button setTitle:_youpaipbtntitleArr[i] forState:UIControlStateNormal];
  24. button.titleLabel.font = LCFont(15);
  25. button.backgroundColor = [UIColor clearColor];
  26. if (i == _youpaipbtntitleArr.count - 1) {
  27. [button setTitleColor:HexColorFromRGB(0x9F9DA5) forState:UIControlStateNormal];
  28. }else{
  29. [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
  30. [button addLineWithColor:[HexColorFromRGB(0x4F4B5B) colorWithAlphaComponent:0.29f] lineRect:CGRectMake(14.0f, btnH - 0.5f, KScreenWidth - 28.0f, 0.5f)];
  31. }
  32. button.tag = i + 1;
  33. [button addTarget:self action:@selector(youpaifselectGenderAction:) forControlEvents:UIControlEventTouchUpInside];
  34. [bgV addSubview:button];
  35. }
  36. }
  37. -(void)youpaifselectGenderAction:(UIButton *)sender
  38. {
  39. NSArray *typeArr;
  40. if (_youpaipbtntitleArr.count == 5) {
  41. typeArr = @[@"look",@"setprofile",@"change",@"delete",@"cancel"];
  42. }else{
  43. typeArr = @[@"look",@"change",@"cancel"];
  44. }
  45. [self dismissViewControllerAnimated:YES completion:^{
  46. [self.youpaipdelegate youpaifimSessionMoreWindowAction:self
  47. type:typeArr[sender.tag - 1]
  48. tag:sender.tag
  49. andUserId:self.youpaipuser_id];
  50. }];
  51. }
  52. @end