新功能开发
This commit is contained in:
@@ -43,6 +43,15 @@
|
||||
@property (nonatomic, strong) UILabel *statusLabel;
|
||||
|
||||
@property (nonatomic, strong) UIStackView *statusStackView;
|
||||
///陪玩标签
|
||||
@property(nonatomic,strong) UIImageView *gameIconView;
|
||||
///陪玩背景
|
||||
@property(nonatomic,strong) UIView *gameBgView;
|
||||
///陪玩类型
|
||||
@property(nonatomic,strong) UILabel *gameView;
|
||||
///陪玩类型图标
|
||||
@property(nonatomic,strong) NetImageView *gameImageView;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -84,6 +93,7 @@
|
||||
- (void)initSubViews {
|
||||
[self.contentView addSubview:self.bgView];
|
||||
[self.bgView addSubview:self.avatarImageView];
|
||||
[self.bgView addSubview:self.gameIconView];
|
||||
[self.bgView addSubview:self.onlineImageView];
|
||||
[self.bgView addSubview:self.nameStackView];
|
||||
[self.bgView addSubview:self.constellationStackView];
|
||||
@@ -91,6 +101,10 @@
|
||||
[self.bgView addSubview:self.livingView];
|
||||
[self.bgView addSubview:self.chatImageView];
|
||||
[self.bgView addSubview:self.statusLabel];
|
||||
[self.bgView addSubview:self.gameBgView];
|
||||
[self.gameBgView addSubview:self.gameImageView];
|
||||
[self.gameBgView addSubview:self.gameView];
|
||||
|
||||
|
||||
[self.nameStackView addArrangedSubview:self.nobleImageView];
|
||||
[self.nameStackView addArrangedSubview:self.nickLabel];
|
||||
@@ -102,28 +116,52 @@
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(25);
|
||||
make.right.mas_equalTo(-15);
|
||||
make.top.mas_equalTo(6);
|
||||
make.bottom.mas_equalTo(-6);
|
||||
make.left.mas_equalTo(22);
|
||||
make.right.mas_equalTo(-14);
|
||||
make.top.mas_equalTo(0);
|
||||
make.bottom.mas_equalTo(-10);
|
||||
}];
|
||||
|
||||
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(-10);
|
||||
make.left.mas_equalTo(-8);
|
||||
make.centerY.mas_equalTo(self.bgView);
|
||||
make.size.mas_equalTo(CGSizeMake(72, 72));
|
||||
make.size.mas_equalTo(CGSizeMake(64, 64));
|
||||
}];
|
||||
|
||||
|
||||
[self.gameIconView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(48);
|
||||
make.height.mas_equalTo(16);
|
||||
make.centerX.equalTo(self.avatarImageView);
|
||||
make.centerY.equalTo(self.avatarImageView.mas_bottom);
|
||||
}];
|
||||
|
||||
[self.onlineImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(self.avatarImageView.mas_right).offset(-3);
|
||||
make.bottom.mas_equalTo(self.avatarImageView.mas_bottom).offset(-6);
|
||||
make.size.mas_equalTo(CGSizeMake(12, 12));
|
||||
make.right.mas_equalTo(self.avatarImageView.mas_right).offset(-6);
|
||||
make.top.mas_equalTo(self.avatarImageView.mas_top).offset(2);
|
||||
make.size.mas_equalTo(CGSizeMake(11, 11));
|
||||
}];
|
||||
|
||||
[self.gameBgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-10);
|
||||
make.top.mas_equalTo(self.avatarImageView.mas_top).offset(5);
|
||||
make.height.mas_equalTo(20);
|
||||
make.width.mas_lessThanOrEqualTo(126);
|
||||
}];
|
||||
|
||||
[self.gameView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-8);
|
||||
make.left.mas_equalTo(26);
|
||||
make.centerY.equalTo(self.gameBgView);
|
||||
}];
|
||||
[self.gameImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.height.mas_equalTo(14);
|
||||
make.centerY.equalTo(self.gameBgView);
|
||||
make.left.mas_equalTo(10);
|
||||
}];
|
||||
|
||||
[self.nameStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.avatarImageView.mas_right).offset(12);
|
||||
make.top.mas_equalTo(self.avatarImageView.mas_top).offset(4);
|
||||
make.right.mas_lessThanOrEqualTo(self.livingView.mas_left).offset(-10);
|
||||
make.right.mas_lessThanOrEqualTo(self.gameBgView.mas_left).offset(-2);
|
||||
make.height.mas_equalTo(21);
|
||||
}];
|
||||
|
||||
@@ -132,7 +170,7 @@
|
||||
}];
|
||||
|
||||
[self.constellationStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self.avatarImageView);
|
||||
make.centerY.mas_equalTo(self.avatarImageView).mas_offset(5);
|
||||
make.left.mas_equalTo(self.nameStackView);
|
||||
}];
|
||||
|
||||
@@ -148,13 +186,13 @@
|
||||
|
||||
[self.signLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.nameStackView);
|
||||
make.bottom.mas_equalTo(self.avatarImageView.mas_bottom).offset(-4);
|
||||
make.top.equalTo(self.constellationStackView.mas_bottom).mas_offset(10);
|
||||
make.right.mas_equalTo(self.livingView.mas_left).offset(-10);
|
||||
}];
|
||||
|
||||
[self.livingView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-15);
|
||||
make.centerY.mas_equalTo(self.bgView).mas_offset(-8);
|
||||
make.top.equalTo(self.gameBgView.mas_bottom).mas_offset(12);
|
||||
make.size.mas_equalTo(CGSizeMake(20, 20));
|
||||
}];
|
||||
|
||||
@@ -288,6 +326,22 @@
|
||||
self.nobleImageView.hidden = YES;
|
||||
self.nickLabel.textColor = [ThemeColor mainTextColor];
|
||||
}
|
||||
_gameIconView.hidden = YES;
|
||||
_gameBgView.hidden = YES;
|
||||
if(_roomInfo.userGamePartnerVo){
|
||||
_gameIconView.hidden = NO;
|
||||
_gameBgView.hidden = NO;
|
||||
_gameImageView.imageUrl = _roomInfo.userGamePartnerVo.firstLogo;
|
||||
NSString *gameName = @"";
|
||||
if(_roomInfo.userGamePartnerVo.firstGameName.length > 0 && _roomInfo.userGamePartnerVo.secondGameName.length > 0){
|
||||
gameName = [NSString stringWithFormat:@"%@|%@",_roomInfo.userGamePartnerVo.firstGameName,_roomInfo.userGamePartnerVo.secondGameName];
|
||||
}else if(_roomInfo.userGamePartnerVo.firstGameName.length > 0){
|
||||
gameName = _roomInfo.userGamePartnerVo.firstGameName;
|
||||
}else if(_roomInfo.userGamePartnerVo.secondGameName.length > 0){
|
||||
gameName = _roomInfo.userGamePartnerVo.secondGameName;
|
||||
}
|
||||
_gameView.text = gameName;
|
||||
}
|
||||
}
|
||||
|
||||
- (UIView *)bgView {
|
||||
@@ -307,7 +361,7 @@
|
||||
_avatarImageView = [[NetImageView alloc] initWithConfig:config];
|
||||
_avatarImageView.userInteractionEnabled = YES;
|
||||
_avatarImageView.layer.masksToBounds = YES;
|
||||
_avatarImageView.layer.cornerRadius = 36;
|
||||
_avatarImageView.layer.cornerRadius = 32;
|
||||
_avatarImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapAvatarGuest)];
|
||||
[_avatarImageView addGestureRecognizer:tap];
|
||||
@@ -319,7 +373,7 @@
|
||||
if (!_onlineImageView) {
|
||||
_onlineImageView = [[UIImageView alloc] init];
|
||||
_onlineImageView.backgroundColor = [ThemeColor colorWithHexString:@"#6CE19A"];
|
||||
_onlineImageView.layer.cornerRadius = 6;
|
||||
_onlineImageView.layer.cornerRadius = 5.5;
|
||||
_onlineImageView.layer.borderWidth = 2;
|
||||
_onlineImageView.layer.borderColor = UIColor.whiteColor.CGColor;
|
||||
_onlineImageView.clipsToBounds = YES;
|
||||
@@ -439,5 +493,41 @@
|
||||
}
|
||||
return _statusStackView;
|
||||
}
|
||||
|
||||
-(UIImageView *)gameIconView{
|
||||
if(!_gameIconView){
|
||||
_gameIconView = [UIImageView new];
|
||||
_gameIconView.image = kImage(@"home_gamge_icon");
|
||||
_gameIconView.hidden = YES;
|
||||
}
|
||||
return _gameIconView;
|
||||
}
|
||||
- (UIView *)gameBgView{
|
||||
if(!_gameBgView){
|
||||
_gameBgView = [UIView new];
|
||||
_gameBgView.backgroundColor = UIColorFromRGB(0xF8F8FA);
|
||||
_gameBgView.layer.cornerRadius = kGetScaleWidth(10);
|
||||
_gameBgView.layer.masksToBounds = YES;
|
||||
_gameBgView.hidden = YES;
|
||||
}
|
||||
return _gameBgView;
|
||||
}
|
||||
- (UILabel *)gameView{
|
||||
if(!_gameView){
|
||||
_gameView = [UILabel new];
|
||||
_gameView.font = [UIFont systemFontOfSize:10 weight:UIFontWeightRegular];
|
||||
_gameView.text = @"";
|
||||
_gameView.textColor = UIColorFromRGB(0x696D7A);
|
||||
}
|
||||
return _gameView;
|
||||
}
|
||||
- (NetImageView *)gameImageView{
|
||||
if(!_gameImageView){
|
||||
NetImageConfig *config = [[NetImageConfig alloc]init];
|
||||
config.placeHolder = [UIImageConstant defaultEmptyAvatarPlaceholder];
|
||||
_gameImageView = [[NetImageView alloc]initWithConfig:config];
|
||||
_gameImageView.layer.cornerRadius = 7;
|
||||
_gameImageView.layer.masksToBounds = YES;
|
||||
}
|
||||
return _gameImageView;
|
||||
}
|
||||
@end
|
||||
|
Reference in New Issue
Block a user