修改了动态的很多个bug
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user