blackListCell.m 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. //
  2. // BlackListCell.m
  3. // YBVideo
  4. //
  5. // Created by YunBao on 2018/7/30.
  6. // Copyright © 2018年 cat. All rights reserved.
  7. //
  8. #import "BlackListCell.h"
  9. @implementation BlackListCell
  10. - (void)awakeFromNib {
  11. [super awakeFromNib];
  12. _iconBtn.layer.masksToBounds = YES;
  13. _iconBtn.layer.cornerRadius = _iconBtn.height/2;
  14. _iconBtn.userInteractionEnabled = NO;
  15. }
  16. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  17. [super setSelected:selected animated:animated];
  18. }
  19. +(BlackListCell*)cellWithTab:(UITableView *)tableView andIndexPath:(NSIndexPath*)indexPath {
  20. BlackListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"BlackListCell"];
  21. if (!cell) {
  22. cell = [[[NSBundle mainBundle]loadNibNamed:@"BlackListCell" owner:nil options:nil]objectAtIndex:0];
  23. cell.delBtn.layer.masksToBounds = YES;
  24. cell.delBtn.layer.cornerRadius = cell.delBtn.height/2;
  25. cell.delBtn.layer.borderWidth = 1;
  26. cell.delBtn.layer.borderColor = Pink_Cor.CGColor;
  27. }
  28. return cell;
  29. }
  30. - (void)setModel:(fansModel *)model {
  31. _model = model;
  32. [_iconBtn sd_setImageWithURL:[NSURL URLWithString:_model.icon] forState:0];
  33. _nameL.text = _model.name;
  34. _timeL.text = _model.time;
  35. [_delBtn setTitle:YZMsg(@"移除") forState:0];
  36. [_delBtn setTitleColor:Pink_Cor forState:0];
  37. }
  38. - (IBAction)clickIconBtn:(UIButton *)sender {
  39. //预留
  40. }
  41. - (IBAction)clickDelBtn:(UIButton *)sender {
  42. NSString *url = [NSString stringWithFormat:@"User.setBlack&uid=%@&token=%@&touid=%@",[Config getOwnID],[Config getOwnToken],_model.uid];
  43. [YBNetworking postWithUrl:url Dic:nil Suc:^(int code, id info, NSString *msg) {
  44. if (code == 0) {
  45. if (self.blackEvent) {
  46. self.blackEvent(@"");
  47. }
  48. [MBProgressHUD showPop:YZMsg(@"移除成功")];
  49. }else {
  50. [MBProgressHUD showPop:msg];
  51. }
  52. } Fail:^(id fail) {
  53. }];
  54. }
  55. @end