MessageComReplyModel.m
1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//
// MessageComReplyModel.m
// DreamSleep
//
// Created by peter on 2022/10/17.
//
#import "MessageComReplyModel.h"
@implementation MessageComReplyModel
#pragma mark - YYModel
+ (nullable NSDictionary<NSString *, id> *)modelCustomPropertyMapper {
return @{@"identifier" : @"id",
@"userID" : @"user_id",
@"preUserID" : @"pre_user_id",
@"preContent" : @"pre_content",
@"publishTime" : @"publish_time",
@"nickName" : @"nick_name",
@"userProfile" : @"user_profile"
};
}
#pragma mark - public
+ (UIFont *)contentFont {
return SysFont(14);
}
+ (UIFont *)preContentFont {
return SysFont(14);
}
+ (CGFloat)contentLeftMargin {
return 67;
}
+ (CGFloat)contentRightMargin {
return 50;
}
- (CGFloat)contentHeight {
CGFloat contentW = kScreenWidth - [MessageComReplyModel contentLeftMargin] - [MessageComReplyModel contentRightMargin];
return [UILabel getHeightByWidth:contentW text:self.content font:[MessageComReplyModel contentFont]];
}
- (CGFloat)preContentHeight {
return 20;
}
- (CGFloat)cellHeight {
CGFloat iconH = 40;
CGFloat contentH = [self contentHeight];
CGFloat space = 6;
CGFloat preContentHeight = [self preContentHeight];
CGFloat bottomH = 72;
return iconH +contentH + space + preContentHeight + bottomH;
}
@end