OrdercontentCell.m 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //
  2. // OrdercontentCell.m
  3. // jitao
  4. //
  5. // Created by 罗云飞 on 2017/12/24.
  6. // Copyright © 2017年 罗云飞. All rights reserved.
  7. //
  8. #import "OrdercontentCell.h"
  9. @implementation OrdercontentCell
  10. - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
  11. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  12. if (self) {
  13. _view = [UIView new];
  14. _view.backgroundColor = [UIColor colorWithString:@"#F8F8F8"];
  15. [self.contentView addSubview:_view];
  16. _content = [UILabel new];
  17. _content.font = NewFont(fitScreenWidth(12));
  18. _content.textColor = [UIColor colorWithString:@"#9A9A9A"];
  19. _content.numberOfLines = 0;
  20. [_view addSubview:_content];
  21. _content.sd_layout
  22. .topSpaceToView(_view, 5)
  23. .autoHeightRatio(0)
  24. .leftSpaceToView(_view, 15)
  25. .rightSpaceToView(_view, 15);
  26. }
  27. return self;
  28. }
  29. - (void)assignment:(OrderdetailModel*)model {
  30. CGFloat height = [NewUtils heightforString:model.orderRemarks andWidth:SCREEN_WIDTH-30 fontSize:fitScreenWidth(12)];
  31. _view.sd_layout
  32. .leftEqualToView(self.contentView)
  33. .topEqualToView(self.contentView)
  34. .rightEqualToView(self.contentView)
  35. .heightIs(height+30);
  36. if ([model.orderRemarks isEqualToString:@""]) {
  37. _content.text = @"暂无备注~";
  38. }else{
  39. _content.text = model.orderRemarks;
  40. }
  41. }
  42. - (void)awakeFromNib {
  43. [super awakeFromNib];
  44. // Initialization code
  45. }
  46. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  47. [super setSelected:selected animated:animated];
  48. // Configure the view for the selected state
  49. }
  50. @end