主播评级总是显示s级的问题

This commit is contained in:
fengshuo
2023-01-03 11:28:18 +08:00
parent 3229c25e76
commit 736ee054b8
3 changed files with 13 additions and 3 deletions

View File

@@ -101,7 +101,12 @@
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] initWithString:task attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:11], NSForegroundColorAttributeName:[ThemeColor colorWithHexString:@"#8A8CAB"]}];
[attribute addAttribute:NSForegroundColorAttributeName value:[ThemeColor colorWithHexString:@"#F86099"] range:[task rangeOfString:diamond]];
self.taskLabel.attributedText = attribute;
self.titleLabel.text = [NSString stringWithFormat:@"还差%ld钻可完成", (_levelInfo.targetDiamond - _levelInfo.currentDiamond)];
if (_levelInfo.currentDiamond > _levelInfo.targetDiamond) {
self.titleLabel.text = @"已完成";
} else {
self.titleLabel.text = [NSString stringWithFormat:@"还差%ld钻可完成", (_levelInfo.targetDiamond - _levelInfo.currentDiamond)];
}
CGFloat itemWidth = ((CGFloat)_levelInfo.currentDiamond / (CGFloat)_levelInfo.targetDiamond)* 260;
[self.progressView mas_updateConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(itemWidth);
@@ -112,7 +117,12 @@
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] initWithString:task attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:11], NSForegroundColorAttributeName:[ThemeColor colorWithHexString:@"#8A8CAB"]}];
[attribute addAttribute:NSForegroundColorAttributeName value:[ThemeColor colorWithHexString:@"#F86099"] range:[task rangeOfString:diamond]];
self.taskLabel.attributedText = attribute;
self.titleLabel.text = [NSString stringWithFormat:@"还差%.0f%@可完成", (_levelInfo.targetReply - _levelInfo.currentReply) * 100, @"%"];
if (_levelInfo.currentReply > _levelInfo.targetReply) {
self.titleLabel.text = @"已完成";
} else {
self.titleLabel.text = [NSString stringWithFormat:@"还差%.0f%@可完成", (_levelInfo.targetReply - _levelInfo.currentReply) * 100, @"%"];
}
CGFloat itemWidth = _levelInfo.currentReply * 260;
[self.progressView mas_updateConstraints:^(MASConstraintMaker *make) {

View File

@@ -120,7 +120,6 @@
- (void)setLevelInfo:(AnchorLevelModel *)levelInfo {
_levelInfo = levelInfo;
if (_levelInfo) {
_levelInfo.grade = @"S";
self.diamondView.levelInfo = _levelInfo;
self.replyView.levelInfo = _levelInfo;
self.timeView.nextRemaining = _levelInfo.nextRemaining;

View File

@@ -752,6 +752,7 @@
[_anchorLevel setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateNormal];
[_anchorLevel setTitleEdgeInsets:UIEdgeInsetsMake(0, 25, 0, 0)];
[_anchorLevel addTarget:self action:@selector(anchorLevelAction:) forControlEvents:UIControlEventTouchUpInside];
_anchorLevel.hidden = YES;
}
return _anchorLevel;
}