NSDictionary *dic = [DicRemove clearErrorDataZanwu:_GardenPlotArray[indexPath.row]];
UIImageView *imagevview = [[UIImageView alloc]initWithFrame:CGRectMake(10, 6+4, 102, 68)];
NSString *imagess=[NSString stringWithFormat:@"%@",dic[@"imgPath"]];
NSString *imagename=[NSString stringWithFormat:@"%@%@",ImageUrl,imagess];
[imagevview sd_setImageWithURL:[NSURL URLWithString:imagename] placeholderImage:[UIImage imageNamed:@"contentMren"]];//gzz0919h
[cell.contentView addSubview:imagevview];
//gzz170213
UILabel* firstLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(imagevview.frame)+10,10,SCREEN_WIDTH-102-30,16)];//gzz0927
firstLabel.backgroundColor = [UIColor clearColor];
firstLabel.textColor = [UIColor blackColor];
firstLabel.numberOfLines=2;
firstLabel.font = [UIFont systemFontOfSize:16];
[cell.contentView addSubview:firstLabel];
NSString *summary=[dic objectForKey:@"topic"];
firstLabel.text=summary;
[firstLabel sizeToFit];
UILabel *timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(imagevview.frame)+10, 65,42, 14)]; //时间gzz0927
timeLabel.backgroundColor = [UIColor clearColor];
timeLabel.textColor = [UIColor grayColor];
timeLabel.font = [UIFont systemFontOfSize:12];
[cell.contentView addSubview:timeLabel];
NSString *timestr=[NSString stringWithFormat:@"%@", [dic objectForKey:@"modifyDate"]];
timestr=[timestr substringToIndex:10];
timeLabel.font=SYSTEMFONT(12);
timeLabel.textAlignment=NSTextAlignmentLeft;
timestr = [timestr substringWithRange:NSMakeRange(5, 5)];
timeLabel.text = timestr;
//总的view
UIView *coverView = [[UIView alloc]init];
coverView.frame = CGRectMake(SCREEN_WIDTH-120-10, 63, 120, 14);
coverView.backgroundColor = [UIColor whiteColor];
coverView.centerY = timeLabel.centerY;
[cell.contentView addSubview:coverView];
#pragma mark 图片+阅读量
UIImageView *readNumImageview = [[UIImageView alloc]init];
readNumImageview.frame = CGRectMake(0, 0, 14, 14);
readNumImageview.image = [UIImage imageNamed:@"read_news"];
[coverView addSubview:readNumImageview];
NSString *readStr=[NSString stringWithFormat:@"%@", [dic objectForKey:@"readnum"]];
NSString *readDa = readStr;
if (readStr.length>=5) {
NSInteger redNum = [readStr integerValue];
NSString *one,*two;
NSInteger onee = redNum/10000;
one = [NSString stringWithFormat:@"%zd",onee];
NSInteger twoo = redNum%10000;
twoo = twoo/1000;
two = [NSString stringWithFormat:@"%zd",twoo];
if (one.length>1) {
readDa=[NSString stringWithFormat:@"%@万",one];
}else{
readDa=[NSString stringWithFormat:@"%@.%@万",one,two];
}
}else{
readDa=[NSString stringWithFormat:@"%@", [dic objectForKey:@"readnum"]];
}
UILabel *readLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(readNumImageview.frame)+5, 0, 32, 14)];
[coverView addSubview:readLabel];
readLabel.backgroundColor = [UIColor clearColor];
readLabel.text = readDa;
readLabel.textAlignment = NSTextAlignmentLeft;
readLabel.textColor = [UIColor grayColor];
readLabel.font = [UIFont systemFontOfSize:12];
readLabel.centerY = readNumImageview.centerY;
#pragma mark 图片+点赞
UIImageView *agreeImageview = [[UIImageView alloc]init];
agreeImageview.frame = CGRectMake(CGRectGetMaxX(readLabel.frame)+5, 0, 14, 14);
agreeImageview.image = [UIImage imageNamed:@"agree_news"];
[coverView addSubview:agreeImageview];
NSString *agreeStr=[NSString stringWithFormat:@"%@", [dic objectForKey:@"agreenum"]];
NSString *agreeDa = agreeStr;
if (agreeDa.length>=5) {
NSInteger redNum = [agreeDa integerValue];
NSString *one,*two;
NSInteger onee = redNum/10000;
one = [NSString stringWithFormat:@"%zd",onee];
NSInteger twoo = redNum%10000;
twoo = twoo/1000;
two = [NSString stringWithFormat:@"%zd",twoo];
if (one.length>1) {
agreeDa=[NSString stringWithFormat:@"%@万",one];
}else{
agreeDa=[NSString stringWithFormat:@"%@.%@万",one,two];
}
}else{
agreeDa=[NSString stringWithFormat:@"%@", [dic objectForKey:@"agreenum"]];
}
UILabel *agreeLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(agreeImageview.frame)+5, 0, 32, 14)];
[coverView addSubview:agreeLabel];
agreeLabel.backgroundColor = [UIColor clearColor];
agreeLabel.text = agreeDa;
agreeLabel.textAlignment = NSTextAlignmentLeft;
agreeLabel.textColor = [UIColor grayColor];
agreeLabel.font = [UIFont systemFontOfSize:12];
agreeLabel.centerY = agreeImageview.centerY;
CGFloat wwww = 14+5+32+5+14+5+32;
coverView.frame = CGRectMake(SCREEN_WIDTH-wwww-10, coverView.y, wwww, 14);