1
This commit is contained in:
@@ -70,6 +70,12 @@
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)actionButtonTapped {
|
||||
if (self.onTapAction) {
|
||||
self.onTapAction();
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setCharacter:(KBCharacter *)character {
|
||||
_character = character;
|
||||
|
||||
@@ -94,6 +100,8 @@
|
||||
[self.actionButton setTitleColor:[UIColor colorWithRed:0.20 green:0.65 blue:0.50 alpha:1.0] forState:UIControlStateNormal];
|
||||
self.actionButton.backgroundColor = [UIColor colorWithRed:0.88 green:0.97 blue:0.93 alpha:1.0];
|
||||
}
|
||||
// 已加入后禁用按钮,避免重复添加或取消
|
||||
self.actionButton.enabled = !joined;
|
||||
}
|
||||
|
||||
// 兼容旧调用:转成一个临时模型再走统一逻辑
|
||||
@@ -111,6 +119,7 @@
|
||||
[self.avatarView kb_cancelImageLoad];
|
||||
self.avatarView.image = nil;
|
||||
self.character = nil;
|
||||
self.onTapAction = nil;
|
||||
}
|
||||
|
||||
#pragma mark - Lazy
|
||||
@@ -170,6 +179,7 @@
|
||||
_actionButton.layer.cornerRadius = 12;
|
||||
_actionButton.layer.masksToBounds = YES;
|
||||
_actionButton.titleLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightBold];
|
||||
[_actionButton addTarget:self action:@selector(actionButtonTapped) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _actionButton;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user