优化 XPRoomAnchorInfoCardView 和 XPRoomFunctionContainerView 的布局约束,调整 descLabel 的约束以支持多行文本显示,并在 followBtnClick 方法中添加错误处理逻辑以增强用户体验。使用弱引用和强引用来避免循环引用。
This commit is contained in:
@@ -72,8 +72,9 @@
|
||||
make.leading.mas_equalTo(margin);
|
||||
}];
|
||||
[self.descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.nameLabel.mas_bottom).mas_offset(30);
|
||||
make.centerX.mas_equalTo(self.mas_centerX);
|
||||
make.top.mas_equalTo(self.nameLabel.mas_bottom).mas_offset(8);
|
||||
make.leading.trailing.mas_equalTo(self).inset(30);
|
||||
make.bottom.mas_equalTo(self.followBtn.mas_top).offset(-8);
|
||||
}];
|
||||
[self.followBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(kSafeAreaBottomHeight > 0 ? -kSafeAreaBottomHeight : -20);
|
||||
@@ -111,7 +112,10 @@
|
||||
NSString * uid = [[AccountInfoStorage instance] getUid];
|
||||
NSString * ticket = [[AccountInfoStorage instance] getTicket];
|
||||
NSString * type = @"1";
|
||||
@kWeakify(self);
|
||||
|
||||
[Api attentionCompletion:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
if (code == 200) {
|
||||
[self.followBtn setBackgroundImage:[UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor cancelButtonGradientStartColor], [DJDKMIMOMColor cancelButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
|
||||
[self.followBtn setTitle:YMLocalizedString(@"XPRoomAnchorInfoCardView0") forState:UIControlStateNormal];
|
||||
@@ -138,6 +142,8 @@
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[TTPopup dismiss];
|
||||
});
|
||||
} else {
|
||||
[XNDJTDDLoadingTool showErrorWithMessage:msg];
|
||||
}
|
||||
} uid:uid likedUid:[NSString stringWithFormat:@"%zd", self.targetUserInfo.uid] ticket:ticket type:type];
|
||||
}
|
||||
@@ -185,6 +191,8 @@
|
||||
_descLabel.textColor = [DJDKMIMOMColor textThirdColor];
|
||||
_descLabel.textAlignment = NSTextAlignmentCenter;
|
||||
_descLabel.text = YMLocalizedString(@"XPRoomAnchorInfoCardView1");
|
||||
_descLabel.numberOfLines = 0;
|
||||
|
||||
}
|
||||
return _descLabel;
|
||||
}
|
||||
|
@@ -642,7 +642,9 @@
|
||||
[self updateHourRankEntrance];
|
||||
if (roomInfo.type == RoomType_Anchor) {//个播房
|
||||
///进房初始化当前用户与房间粉丝团关系
|
||||
@kWeakify(self);
|
||||
[Api requestInRoomFansTeam:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
XPAnchorFansRelationModel *model = [XPAnchorFansRelationModel modelWithJSON:data.data];
|
||||
[self updateFansTeamEntranceView:model];
|
||||
} teamUid:roomUid];
|
||||
@@ -652,7 +654,9 @@
|
||||
}
|
||||
if (![[AccountInfoStorage instance].getUid isEqualToString:roomUid]) {//非房主
|
||||
NSString * uid = [[AccountInfoStorage instance] getUid];
|
||||
@kWeakify(self);
|
||||
[Api attentionStatusCompletion:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {//是否关注了房主
|
||||
@kStrongify(self);
|
||||
BOOL isLike = ((NSNumber *)data.data).boolValue;
|
||||
if (!isLike && !roomInfo.isRoomFans) {
|
||||
[self setFollowAnchorTimer];
|
||||
|
Reference in New Issue
Block a user