77 lines
2.1 KiB
Objective-C
77 lines
2.1 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)setDynamicResList:(NSArray *)dynamicResList{
|
|
_dynamicResList = dynamicResList;
|
|
NSMutableArray *list= [NSMutableArray array];
|
|
for (NSDictionary *dic in _dynamicResList) {
|
|
[list addObject:[MonentsPicInfoModel DD_ModelWithDict:dic]];
|
|
|
|
}
|
|
self.dynamicResLists = list;
|
|
}
|
|
- (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)setDynamicResLists:(NSArray<MonentsPicInfoModel *> *)dynamicResLists{
|
|
_dynamicResLists = dynamicResLists;
|
|
if (![ToolsObject IsNullWithObject:dynamicResLists]){
|
|
if (dynamicResLists.count==1){
|
|
self.picturesHeight = 176;
|
|
}else{
|
|
CGFloat row = ceil(dynamicResLists.count/3.0);
|
|
CGFloat width = (kWidth - 52 - 5*2)/3;
|
|
self.picturesHeight = row*width + row*5;
|
|
}
|
|
self.rowHeight+=self.picturesHeight;
|
|
}
|
|
}
|
|
- (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
|
|
@implementation MonentsPicInfoModel
|
|
|
|
|
|
@end
|
|
|
|
|