// // JXTableViewCell.m // shiku_im // // Created by 123 on 2020/6/1. // Copyright © 2020 Reese. All rights reserved. // #import "JXTFuLiCell.h" #import "UIView+LK.h" @interface JXTFuLiCell () @property (weak, nonatomic) IBOutlet UILabel *topTitle; @property (weak, nonatomic) IBOutlet UILabel *bottomTitle; @property (weak, nonatomic) IBOutlet UILabel *competL; @property (weak, nonatomic) IBOutlet UIView *totoalPressL; @property (weak, nonatomic) IBOutlet UIView *colorPressL; @property (weak, nonatomic) UIView *colorPressL2; @property (weak, nonatomic) IBOutlet NSLayoutConstraint *colorPressConsW; @property (weak, nonatomic) IBOutlet NSLayoutConstraint *totoalPressW; @end @implementation JXTFuLiCell - (void)awakeFromNib { [super awakeFromNib]; self.backgroundColor=[UIColor clearColor]; } + (instancetype)cellWithTableView:(UITableView *)tableView { static NSString *ID = @"JXTFuLiCell"; JXTFuLiCell *cell = [tableView dequeueReusableCellWithIdentifier:ID]; if (!cell) { cell = [[NSBundle mainBundle] loadNibNamed:@"JXTFuLiCell" owner:nil options:nil].firstObject; cell.selectionStyle=UITableViewCellSelectionStyleNone; } cell.backgroundColor=[UIColor clearColor]; return cell; } -(void)setDict:(NSDictionary *)dict{ self.topTitle.text=[NSString stringWithFormat:@"%@",[dict objectForKey:@"title"]]; self.bottomTitle.text=[NSString stringWithFormat:@"%@",[dict objectForKey:@"currentDesc"]]; self.competL.text=[NSString stringWithFormat:@"%@",[dict objectForKey:@"surplusDesc"]]; int current=[[dict objectForKey:@"current"] intValue]; float surplus=[[dict objectForKey:@"surplus"] floatValue]; CGFloat aaa=current/ (current+surplus); if (aaa>0) { _colorPressConsW.constant =aaa*326+10; }else{ _colorPressConsW.constant =0; } // cell.projectLabel.text = [NSString stringWithFormat:@"%@",] // cell.detail.text = [NSString stringWithFormat:@"%@",]; // cell.detail.text = [NSString stringWithFormat:@"%@",[dictionary objectForKey:@"currentDesc"]]; // if ([status intValue]==2) { // // cell.descriptionLabel.text = [NSString stringWithFormat:@"%@",[dictionary objectForKey:@"surplusDesc"]]; // }else{ // // cell.descriptionLabel.text = [NSString stringWithFormat:@"%@",@"未完成"]; // } } @end