修改了动态的很多个bug

This commit is contained in:
fengshuo
2022-08-25 21:17:23 +08:00
parent 098f0b5572
commit 1808c072af
52 changed files with 779 additions and 50 deletions

View File

@@ -15,6 +15,7 @@
#import "XPMonentsLayoutConfig.h"
#import "NSString+Utils.h"
#import "QEmotionHelper.h"
#import "AccountInfoStorage.h"
///Model
#import "MonentsCommentModel.h"
///View
@@ -30,6 +31,8 @@
@property (nonatomic,strong) NetImageView *commentAvatarView;
///
@property (nonatomic,strong) UILabel *commentNickLabel;
///
@property (nonatomic,strong) UIImageView *ownerImageView;
///
@property (nonatomic,strong) YYLabel *commentLabel;
///
@@ -68,6 +71,7 @@
[self.commentUserView addSubview:self.commentAvatarView];
[self.commentUserView addSubview:self.commentNickLabel];
[self.commentUserView addSubview:self.ownerImageView];
[self.commentUserView addSubview:self.commentLabel];
[self.commentUserView addSubview:self.commentDateLabel];
}
@@ -98,7 +102,12 @@
make.left.mas_equalTo(self.commentAvatarView.mas_right).offset(10);
make.top.mas_equalTo(self.commentUserView).offset(10);
make.height.mas_equalTo(15);
make.right.mas_lessThanOrEqualTo(self.commentDateLabel.mas_left).offset(-10);
}];
[self.ownerImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(32, 15));
make.centerY.mas_equalTo(self.commentNickLabel);
make.left.mas_equalTo(self.commentNickLabel.mas_right).offset(5);
}];
[self.commentDateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -139,12 +148,20 @@
cell.replyInfo = [self.datasource objectAtIndex:indexPath.row];
return cell;
}
XPMonentsReplyMoreTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMonentsReplyMoreTableViewCell class])];
cell.leftCount = self.commentInfo.replyInfo.leftCount;
cell.delegate = self;
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (indexPath.section == 0 && self.datasource.count > 0) {
MonentsReplyModel * replyInfo = [self.datasource objectAtIndex:indexPath.row];
if (replyInfo.uid.integerValue != [AccountInfoStorage instance].getUid.integerValue && self.delegate && [self.delegate respondsToSelector:@selector(xPMonentsCommentTableViewCell:didClickCommon:)]) {
[self.delegate xPMonentsCommentTableViewCell:self didClickCommon:replyInfo];
}
}
}
#pragma mark - XPMonentsReplyMoreTableViewCellDelegate
@@ -158,6 +175,7 @@
- (void)setCommentInfo:(MonentsCommentModel *)commentInfo {
_commentInfo = commentInfo;
if (_commentInfo) {
self.ownerImageView.hidden = !_commentInfo.landLordFlag;
self.commentAvatarView.imageUrl = _commentInfo.avatar;
NSString * nick = _commentInfo.nick;
if (nick.length > 8) {
@@ -279,4 +297,14 @@
return _lineContainerView;
}
- (UIImageView *)ownerImageView {
if (!_ownerImageView) {
_ownerImageView = [[UIImageView alloc] init];
_ownerImageView.userInteractionEnabled = YES;
_ownerImageView.image = [UIImage imageNamed:@"monents_common_landLordFlag"];
_ownerImageView.hidden = YES;
}
return _ownerImageView;
}
@end