diff --git a/xplan-ios/Main/Mine/View/SubViews/AnchorLevel/AnchorLevelProgressView.m b/xplan-ios/Main/Mine/View/SubViews/AnchorLevel/AnchorLevelProgressView.m index 7c6b165c..dcf3ab94 100644 --- a/xplan-ios/Main/Mine/View/SubViews/AnchorLevel/AnchorLevelProgressView.m +++ b/xplan-ios/Main/Mine/View/SubViews/AnchorLevel/AnchorLevelProgressView.m @@ -106,11 +106,16 @@ } 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); - }]; + if (_levelInfo.targetDiamond > 0) { + CGFloat itemWidth = ((CGFloat)_levelInfo.currentDiamond / (CGFloat)_levelInfo.targetDiamond)* 260; + [self.progressView mas_updateConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(itemWidth); + }]; + } else { + [self.progressView mas_updateConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(0.1); + }]; + } } else { NSString * diamond = [NSString stringWithFormat:@"%.0f%@", _levelInfo.currentReply * 100, @"%"]; NSString * task = [NSString stringWithFormat:@"新用户私聊回复率:%@", diamond]; @@ -122,8 +127,6 @@ } else { self.titleLabel.text = [NSString stringWithFormat:@"还差%.0f%@可完成", (_levelInfo.targetReply - _levelInfo.currentReply) * 100, @"%"]; } - - CGFloat itemWidth = _levelInfo.currentReply * 260; [self.progressView mas_updateConstraints:^(MASConstraintMaker *make) { make.width.mas_equalTo(itemWidth);