个播PK房间标题改为用户昵称

This commit is contained in:
chenguilong
2022-04-19 14:28:46 +08:00
parent ff67b3c7f5
commit 71939dfad0
8 changed files with 21 additions and 10 deletions

View File

@@ -70,6 +70,11 @@ typedef NS_ENUM(NSUInteger, AcrossRoomPkStateType) {
@property (nonatomic, assign) NSInteger roundId;
///对方的房间id
@property (nonatomic, copy) NSString *aRoomId;
///对方房主昵称
@property (nonatomic, copy) NSString *aNick;
///我方房主昵称
@property (nonatomic, copy) NSString *cNick;
@end
@interface AcrossRoomPkRankModel : NSObject

View File

@@ -26,6 +26,10 @@ typedef NS_ENUM(NSUInteger, AcrossRoomPKType) {
@property (nonatomic, copy) NSString *winTitle;
///输方标题
@property (nonatomic, copy) NSString *failTitle;
///赢方昵称
@property (nonatomic, copy) NSString *winNick;
///输方昵称
@property (nonatomic, copy) NSString *failNick;
///描述
@property (nonatomic, copy) NSString *msg;
///PK类型0 普通PK 1个播PK

View File

@@ -115,6 +115,8 @@
self.blueRoomTitleLabel.text = data.failTitle;
self.titleLabel.text = data.msg;
if (data.pkType == AcrossRoomPKTypeAnchor) {
self.redRoomTitleLabel.text = data.winNick;
self.blueRoomTitleLabel.text = data.failNick;
self.titleLabel.numberOfLines = 0;
self.titleLabel.font = [UIFont systemFontOfSize:10];
self.titleLabel.textAlignment = NSTextAlignmentCenter;

View File

@@ -87,7 +87,7 @@
- (void)setRoomPKInfo:(AcrossRoomPKInfoModel *)roomPKInfo {
_roomPKInfo = roomPKInfo;
self.avatarImageView.imageUrl = _roomPKInfo.avatar;
self.nameLabel.text = _roomPKInfo.title;
self.nameLabel.text = _roomPKInfo.nick;
self.idLabel.text = [NSString stringWithFormat:@"大鹅号:%@", _roomPKInfo.erbanNo];
self.selectButton.userInteractionEnabled = !roomPKInfo.crossPking;
if (roomPKInfo.crossPking) {

View File

@@ -207,7 +207,7 @@
- (void)setDataDic:(NSDictionary *)dataDic {
_dataDic = dataDic;
if (_dataDic.allKeys.count > 0) {
self.inviteView.contentLabel.text = _dataDic[@"inviteRoomTitle"];
self.inviteView.contentLabel.text = _dataDic[@"inviteNick"];
self.timeView.contentLabel.text = [NSString stringWithFormat:@"%@分钟", _dataDic[@"pkDuration"]];
NSString *desc = _dataDic[@"pkDesc"];
if (desc.length > 0) {

View File

@@ -276,7 +276,7 @@
self.contributeTitleBgImageView.image = [UIImage imageNamed:@"anchorPK_result_tie_title_bg"];
}
self.avatarImageView.imageUrl = data.cAvatar;
self.roomTitleLabel.text = data.cTitle;
self.roomTitleLabel.text = data.cNick;
self.pkValueLabel.text = [NSString stringWithFormat:@"PK值%lld", data.cAmount];
if (data.csRank.count > 0) {//
self.contributeTitleBgImageView.hidden = NO;

View File

@@ -448,12 +448,12 @@
[self openCountdownWithTime:aTime];
}];
}
if (_pkPanelInfo.cTitle.length > 7) {
_pkPanelInfo.cTitle = [NSString stringWithFormat:@"%@…", [_pkPanelInfo.cTitle substringToIndex:7]];
if (_pkPanelInfo.cNick.length > 7) {
_pkPanelInfo.cNick = [NSString stringWithFormat:@"%@…", [_pkPanelInfo.cNick substringToIndex:7]];
}
if (_pkPanelInfo.aTitle.length > 7) {
_pkPanelInfo.aTitle = [NSString stringWithFormat:@"%@…", [_pkPanelInfo.aTitle substringToIndex:7]];
if (_pkPanelInfo.aNick.length > 7) {
_pkPanelInfo.aNick = [NSString stringWithFormat:@"%@…", [_pkPanelInfo.aNick substringToIndex:7]];
}
self.redCountLabel.text = [NSString stringWithFormat:@"%lld", _pkPanelInfo.cAmount];
@@ -489,8 +489,8 @@
make.width.mas_equalTo(width);
}];
self.otherAvatarImageView.imageUrl = pkPanelInfo.aAvatar;
self.otherNickLabel.text = pkPanelInfo.aTitle;
self.redNickLabel.text = pkPanelInfo.cTitle;
self.otherNickLabel.text = pkPanelInfo.aNick;
self.redNickLabel.text = pkPanelInfo.cNick;
} else {
self.redCountLabel.text = @"0";
self.blueCountLabel.text = @"0";

View File

@@ -101,7 +101,7 @@
[self.onLookBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(40);
make.height.mas_equalTo(20);
make.right.mas_equalTo(self.bgImageView).mas_offset(-10);
make.left.mas_equalTo(self.rankLabel.mas_right).mas_offset(8);
make.centerY.mas_equalTo(self.bgImageView);
}];
}