LockCell.m 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // LockCell.m
  3. // LN_School
  4. //
  5. // Created by EchoShacolee on 2017/4/17.
  6. // Copyright © 2017年 Danson. All rights reserved.
  7. //
  8. #import "LockCell.h"
  9. @implementation LockCell
  10. - (void)awakeFromNib {
  11. [super awakeFromNib];
  12. // Initialization code
  13. }
  14. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  15. [super setSelected:selected animated:animated];
  16. // Configure the view for the selected state
  17. }
  18. -(void)upDataWithDic:(NSDictionary *)dic{
  19. _nameLab.text = [NSString stringWithFormat:@"%@",dic[@"TLR_USER"]];
  20. _timeLab.text = [NSString stringWithFormat:@"%@",dic[@"TLR_OPE_DATE"]];
  21. if ([[NSString stringWithFormat:@"%@",dic[@"TLR_LOCK_STATUS"]] isEqualToString:@"1"]) {
  22. _statusLab.text = @"锁定";
  23. _statusLab.textColor = [UIColor redColor];
  24. }else{
  25. _statusLab.text = @"解锁";
  26. _statusLab.textColor = COLOR_THEME;
  27. }
  28. _reasonLab.text = [NSString stringWithFormat:@"%@",dic[@"TLR_LOCK_REASON"]];
  29. }
  30. + (CGFloat)heightForDic:(NSDictionary *)dic
  31. {
  32. // 而高度是动态返回的
  33. CGRect bounds = [dic[@"TLR_LOCK_REASON"] boundingRectWithSize:CGSizeMake(kSize.width-100, 1000) options:NSStringDrawingUsesLineFragmentOrigin attributes:[NSDictionary dictionaryWithObject:[UIFont systemFontOfSize:14] forKey:NSFontAttributeName] context:nil];
  34. return 75+bounds.size.height;
  35. }
  36. @end