JXTFuLiCell.m 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. //
  2. // JXTableViewCell.m
  3. // shiku_im
  4. //
  5. // Created by 123 on 2020/6/1.
  6. // Copyright © 2020 Reese. All rights reserved.
  7. //
  8. #import "JXTFuLiCell.h"
  9. #import "UIView+LK.h"
  10. @interface JXTFuLiCell ()
  11. @property (weak, nonatomic) IBOutlet UILabel *topTitle;
  12. @property (weak, nonatomic) IBOutlet UILabel *bottomTitle;
  13. @property (weak, nonatomic) IBOutlet UILabel *competL;
  14. @property (weak, nonatomic) IBOutlet UIView *totoalPressL;
  15. @property (weak, nonatomic) IBOutlet UIView *colorPressL;
  16. @property (weak, nonatomic) UIView *colorPressL2;
  17. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *colorPressConsW;
  18. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *totoalPressW;
  19. @end
  20. @implementation JXTFuLiCell
  21. - (void)awakeFromNib {
  22. [super awakeFromNib];
  23. self.backgroundColor=[UIColor clearColor];
  24. }
  25. + (instancetype)cellWithTableView:(UITableView *)tableView
  26. {
  27. static NSString *ID = @"JXTFuLiCell";
  28. JXTFuLiCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
  29. if (!cell) {
  30. cell = [[NSBundle mainBundle] loadNibNamed:@"JXTFuLiCell" owner:nil options:nil].firstObject;
  31. cell.selectionStyle=UITableViewCellSelectionStyleNone;
  32. }
  33. cell.backgroundColor=[UIColor clearColor];
  34. return cell;
  35. }
  36. -(void)setDict:(NSDictionary *)dict{
  37. self.topTitle.text=[NSString stringWithFormat:@"%@",[dict objectForKey:@"title"]];
  38. self.bottomTitle.text=[NSString stringWithFormat:@"%@",[dict objectForKey:@"currentDesc"]];
  39. self.competL.text=[NSString stringWithFormat:@"%@",[dict objectForKey:@"surplusDesc"]];
  40. int current=[[dict objectForKey:@"current"] intValue];
  41. float surplus=[[dict objectForKey:@"surplus"] floatValue];
  42. CGFloat aaa=current/ (current+surplus);
  43. if (aaa>0) {
  44. _colorPressConsW.constant =aaa*326+10;
  45. }else{
  46. _colorPressConsW.constant =0;
  47. }
  48. // cell.projectLabel.text = [NSString stringWithFormat:@"%@",]
  49. // cell.detail.text = [NSString stringWithFormat:@"%@",];
  50. // cell.detail.text = [NSString stringWithFormat:@"%@",[dictionary objectForKey:@"currentDesc"]];
  51. // if ([status intValue]==2) {
  52. //
  53. // cell.descriptionLabel.text = [NSString stringWithFormat:@"%@",[dictionary objectForKey:@"surplusDesc"]];
  54. // }else{
  55. //
  56. // cell.descriptionLabel.text = [NSString stringWithFormat:@"%@",@"未完成"];
  57. // }
  58. }
  59. @end