// // TwoImageCell.m // 千模 // // Created by MUMEI on 2018/6/7. // Copyright © 2018年 MUMEI. All rights reserved. // #import "TwoImageCell.h" #import "UILabel+LabelHeightAndWidth.h" @implementation TwoImageCell - (void)awakeFromNib { [super awakeFromNib]; // [self buildLabelOne]; // Initialization code } - (void)setModel:(PrivateModel *)model{ _model = model; self.detailLabel.text = model.intro; [self buildLabelOne]; NSString *now = [Helper getCurrentTimes]; NSString *lastDay = [Helper getLastTimes]; NSArray * dateNow = [now componentsSeparatedByString:@" "]; NSArray * nowYMD = [dateNow[0] componentsSeparatedByString:@"-"]; NSString * nowY = nowYMD[0]; NSString * nowM = nowYMD[1]; NSString * nowD = nowYMD[2]; NSArray * dateLast = [lastDay componentsSeparatedByString:@" "]; NSArray * lastYMD = [dateLast[0] componentsSeparatedByString:@"-"]; NSString * lastY = lastYMD[0]; NSString * lastM = lastYMD[1]; NSString * lastD = lastYMD[2]; NSArray * date = [model.pdate componentsSeparatedByString:@" "]; NSString * date2 = date[0]; NSArray * YMD = [date2 componentsSeparatedByString:@"-"]; NSString * Y = YMD[0]; NSString * M = YMD[1]; NSString * D = YMD[2]; if ([Y isEqualToString:nowY]) { if ([M isEqualToString:nowM]) { if ([D isEqualToString:nowD]) { D = @"今天"; self.Day.text = @""; self.Month.hidden = YES; self.noMonth = YES; } } } if ([Y isEqualToString:lastY]) { if ([M isEqualToString:lastM]) { if ([D isEqualToString:lastD]) { D = @"昨天"; self.Day.text = D; self.Month.hidden = YES; self.noMonth = YES; } } } if (!self.noMonth) { if([M isEqualToString:@"01"]){ M = @"1"; }else if ([M isEqualToString:@"02"]){ M = @"2"; }else if ([M isEqualToString:@"03"]){ M = @"3"; }else if ([M isEqualToString:@"04"]){ M = @"4"; }else if ([M isEqualToString:@"05"]){ M = @"5"; }else if ([M isEqualToString:@"06"]){ M = @"6"; }else if ([M isEqualToString:@"07"]){ M = @"7"; }else if ([M isEqualToString:@"08"]){ M = @"8"; }else if ([M isEqualToString:@"09"]){ M = @"9"; }else if ([M isEqualToString:@"10"]){ M = @"10"; }else if ([M isEqualToString:@"11"]){ M = @"11"; }else if ([M isEqualToString:@"12"]){ M = @"12"; } self.Day.text = D; self.Month.text = [NSString stringWithFormat:@"%@月",M]; } for (int i=0; i80) { height = 80; } _detailLabel.frame = CGRectMake(210, 15, 135, height); } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } @end