Files
yinmeng-ios-store/yinmeng-ios/DingDangApp/CodeClass/Dynamic/MM/DDDynamicModel.m
2023-12-07 10:50:21 +08:00

48 lines
1.3 KiB
Objective-C

//
// DDDynamicModel.m
// DingDangApp
//
// Created by apple on 2023/5/31.
//
#import "DDDynamicModel.h"
@implementation DDDynamicLocationModel
@end
@implementation DDDynamicModel
+ (NSDictionary *)modelCustomPropertyMapper {
return @{
@"userVipLevelIcon":@"user.userVipLevel.icon",
@"userVipLevel":@"user.userVipLevel.level",
@"userVipExperience":@"user.userVipLevel.experience",
};
}
- (void)setContent:(NSString *)content{
_content = content;
CGFloat space = 10;
self.textHeight = [content getHeightWithWidth:kWidth-52 font:14]+space;
CGFloat likeHeight = 10;
self.rowHeight+=self.textHeight+space+40+space+space+space*2+space*2+likeHeight;
}
- (void)setVideo:(NSString *)video{
_video = video;
if (![ToolsObject IsNullWithObject:video]){
self.videoHeight = 260;
self.rowHeight+=self.videoHeight;
}
}
- (void)setImgs:(NSMutableArray *)imgs{
_imgs = imgs;
if (![ToolsObject IsNullWithObject:imgs]){
if (imgs.count==1){
self.picturesHeight = 176;
}else{
CGFloat row = ceil(imgs.count/3.0);
CGFloat width = (kWidth - 52 - 5*2)/3;
self.picturesHeight = row*width + row*5;
}
self.rowHeight+=self.picturesHeight;
}
}
@end