// // JXPhangBangCell.m // shiku_im // // Created by 123 on 2020/5/19. // Copyright © 2020 Reese. All rights reserved. // #import "JXPhangBangCell.h" @interface JXPhangBangCell() @property (nonatomic,weak) UILabel *indexLb; @property (nonatomic,weak) UIImageView *headIM; @property (nonatomic,weak) UILabel *titleL; @property (nonatomic,weak) UILabel *statusL; @end @implementation JXPhangBangCell - (void)awakeFromNib { [super awakeFromNib]; // Initialization code } -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) { self.backgroundColor = kRGBColor(181, 27, 35); //索引 UILabel *indexLb=[[UILabel alloc]init]; indexLb.textColor=kRGBColor(255, 241, 173); indexLb.font=[UIFont systemFontOfSize:12 weight:UIFontWeightMedium]; [self.contentView addSubview:indexLb]; self.indexLb=indexLb; [indexLb mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_offset(7); make.left.mas_equalTo(18); make.height.mas_equalTo(50); }]; UIImageView *headIM=[[UIImageView alloc]init]; headIM.image=[UIImage imageNamed:@"组1"]; [self.contentView addSubview:headIM]; headIM.layer.cornerRadius=25; headIM.layer.masksToBounds=YES; [g_server delHeadImage:g_server.myself.userId]; [g_server getHeadImageSmall:g_server.myself.userId userName:g_server.myself.userNickname imageView:headIM]; self.headIM=headIM; [headIM mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_offset(7); make.left.mas_equalTo(indexLb.mas_right).mas_offset(20); make.height.mas_equalTo(50); make.width.mas_equalTo(50); }]; UILabel *titleL=[[UILabel alloc]init]; titleL.text=@"XJ****12"; titleL.font=[UIFont systemFontOfSize:12 weight:UIFontWeightMedium]; titleL.textColor=kRGBColor(255, 241, 173); titleL.textAlignment=NSTextAlignmentCenter; [self.contentView addSubview:titleL]; self.titleL=titleL; [titleL mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_offset(7); make.left.mas_offset(130); make.right.mas_offset(-130); make.height.mas_equalTo(50); }]; UILabel *statusL=[[UILabel alloc]init]; statusL.textColor=kRGBColor(255, 241, 173); statusL.text=@"今日盈利 211001.2"; statusL.font=[UIFont systemFontOfSize:12 weight:UIFontWeightMedium]; [self.contentView addSubview:statusL]; self.statusL=statusL; [statusL mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_offset(7); make.right.mas_offset(-10); make.height.mas_equalTo(50); }]; /* */ } return self; } - (void)createLayoutsub{ } + (instancetype)cellWithTableView:(UITableView *)tableView { static NSString *ID = @"JXPhangBangCell"; JXPhangBangCell *cell = [tableView dequeueReusableCellWithIdentifier:ID]; if (!cell) { cell = [[JXPhangBangCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID]; cell.selectionStyle=UITableViewCellSelectionStyleNone; } return cell; } -(void)createStatuModl:(JXMyModel *)model andIndexPath:(NSInteger)indexRow{ self.indexLb.text=[NSString stringWithFormat:@"%zd",indexRow+1]; [g_server getHeadImageSmall:model.userId userName:g_server.myself.userNickname imageView:self.headIM]; self.titleL.text=[NSString stringWithFormat:@"%@",model.membershipAccount]; if ([model.type intValue]==1) { self.statusL.text=[NSString stringWithFormat:@"盈利奖金%@",model.money]; }else if ([model.type intValue]==2) { self.statusL.text=[NSString stringWithFormat:@"总充值%@",model.money]; } else { self.statusL.text=[NSString stringWithFormat:@"总打码%@",model.money]; } } @end