更新勋章相关模型和视图,添加对使用勋章的支持,优化可见性管理和状态更新逻辑,保持代码结构一致性。

This commit is contained in:
edwinQQQ
2025-06-23 15:55:11 +08:00
parent a72c010b56
commit f62af24c48
10 changed files with 268 additions and 30 deletions

View File

@@ -243,12 +243,25 @@ typedef enum : NSInteger {
}
- (void)setupWearingButton {
UIView *wearingBg = [[UIView alloc] init];
[wearingBg addGradientBackgroundWithColors:@[
UIColorFromRGB(0xf2e7ff),
UIColorFromRGB(0xb497f6)
] startPoint:CGPointMake(0, 0.5) endPoint:CGPointMake(1, 0.5) cornerRadius:25/2];
[wearingBg setAllCornerRadius:25/2 borderWidth:1 borderColor:[UIColor whiteColor]];
[self.view addSubview:wearingBg];
UIButton *wearingButton = [self wearingButton];
[self.view addSubview:wearingButton];
[wearingButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(90);
make.trailing.mas_equalTo(-12);
}];
[wearingBg mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(wearingButton).insets(UIEdgeInsetsMake(0, -15, 0, -25));
}];
}
- (void)setupEmptyUserMedals {
@@ -449,6 +462,12 @@ typedef enum : NSInteger {
}
}
- (void)_updateWearingInfo {
if (self.displayType != MedalsCenterDisplayType_Other) {
}
}
- (void)_updateOtherInfo:(UserMedalsModel *)userModel {
if (self.displayType == MedalsCenterDisplayType_Other) {
self.otherAvatar.imageUrl = userModel.avatar;
@@ -612,6 +631,8 @@ typedef enum : NSInteger {
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button addTarget:self action:@selector(didTapWearingButton:) forControlEvents:UIControlEventTouchUpInside];
[button setTitle:YMLocalizedString(@"20.20.61_text_2") forState:UIControlStateNormal];
[button setTitleColor:UIColorFromRGB(0x201440) forState:UIControlStateNormal];
button.titleLabel.font = kFontMedium(12);
return button;
}