// // YOUPAILCBillDetailCell.m // LiveChat // // Created by 张灿 on 2018/10/10. // Copyright © 2018年 caicai. All rights reserved. // #import "YOUPAILCBillDetailCell.h" @interface YOUPAILCBillDetailCell() @property(nonatomic,strong)UILabel* youpaipzhuanshiLabel; @property(nonatomic,strong)UILabel* youpaiptypeLabel; @property(nonatomic,strong)UILabel* youpaiptimeLab; @property(nonatomic,strong)UILabel* youpaipvalueLab; @end @implementation YOUPAILCBillDetailCell - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { self.selectionStyle = UITableViewCellSelectionStyleNone; [self youpaifinitUI]; } return self; } - (void)youpaifinitUI{ self.backgroundColor = LCBkgColor; UIView *bgView = [UIView new]; [self.contentView addSubview:bgView]; [bgView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(14); make.right.mas_equalTo(-14); make.height.mas_equalTo(94); }]; bgView.layer.cornerRadius = 5; bgView.layer.masksToBounds = YES; bgView.backgroundColor = HexColorFromRGB(0x2A2935); //充值砖石 UILabel* zhuanshiLabel = [[UILabel alloc]init]; zhuanshiLabel.textColor = HexColorFromRGB(0xffffff); zhuanshiLabel.font = LCFont14; [bgView addSubview:zhuanshiLabel]; self.youpaipzhuanshiLabel = zhuanshiLabel; [zhuanshiLabel makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(@12); make.top.equalTo(@18); }]; //支付方式 UILabel* typeLabel = [[UILabel alloc]init]; typeLabel.textColor = HexColorFromRGB(0xffffff); typeLabel.font = LCFont14; [bgView addSubview:typeLabel]; self.youpaiptypeLabel = typeLabel; [typeLabel makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(@12); make.top.equalTo(zhuanshiLabel.mas_bottom).offset(9); }]; //时间 UILabel* timeLab = [[UILabel alloc]init]; timeLab.textColor = HexColorFromRGB(0x9F9DA5); timeLab.font = LCFont12; [bgView addSubview:timeLab]; self.youpaiptimeLab = timeLab; [timeLab makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(@12); make.top.equalTo(typeLabel.bottom).offset(@9); }]; //支付金额 UILabel* valueLab = [[UILabel alloc]init]; valueLab.textColor = HexColorFromRGB(0x999999); valueLab.font = LCFont12; [bgView addSubview:valueLab]; self.youpaipvalueLab = valueLab; [valueLab makeConstraints:^(MASConstraintMaker *make) { make.right.equalTo(-12); make.centerY.equalTo(0); }]; } - (void)setYoupaipbillModel:(YOUPAILCBillDetailModel *)billModel{ _youpaipbillModel = billModel; self.youpaipzhuanshiLabel.text = [NSString stringWithFormat:@"充值钻石:%.0f",billModel.youpaipchange_value]; self.youpaiptypeLabel.text = [NSString stringWithFormat:@"%@:%@",LCStr(word43),billModel.youpaipplatform_name];//支付方式 self.youpaiptimeLab.text = billModel.youpaipcreate_time; self.youpaipvalueLab.attributedText = [LCTools setRichTextWithTitle:@"支付: ¥" subTitle:billModel.youpaiprecharge_money titleColor:[UIColor whiteColor] subTitleColor:[UIColor whiteColor] titleFontSize:14 subTitleFontSize:18];; // //头像 type //1充值 2提现 3视频 4礼物 5系统 6兑换 7私信 // if (billModel.type==5||billModel.type==9||billModel.type==10) { // self.avatarImgV.image = [UIImage imageNamed:@"vqu_images_appLogo"]; // }else if (billModel.type==1 || billModel.type==2 || billModel.type==6 ){ // self.avatarImgV.image = [UIImage imageNamed:@"vqu_images_P_wallet"]; // }else{ // [self.avatarImgV sd_setImageWithURL:[LCTools getImageUrlWithAddress:billModel.icon]]; // } // //账户变动值 // if (billModel.change_value>0) { // if (billModel.account_type==1||billModel.account_type==2) { // self.valueLab.text = [NSString stringWithFormat:@"+%.2f元",billModel.change_value]; // self.valueLab.textColor = LCRedColor; // }else{ // self.valueLab.text = [NSString stringWithFormat:@"+ %.0f钻石",billModel.change_value]; // self.valueLab.textColor = DecColorFromRGB(102,102,102); // } // }else{ // self.valueLab.textColor = DecColorFromRGB(170,170,170); // if (billModel.account_type==1||billModel.account_type==2) { // self.valueLab.text = [NSString stringWithFormat:@"%.2f元",billModel.change_value]; // }else{ // self.valueLab.text = [NSString stringWithFormat:@"%.0f钻石",billModel.change_value]; // } // } // //账户描述 // if (billModel.type==5 || billModel.type==6||billModel.type==9||billModel.type==10 ||billModel.type == 11) { // self.descLab.text = billModel.system_str; // }else if(billModel.type==1){ // if (billModel.account_type==1||billModel.account_type==2) { // self.descLab.text = @"充值余额"; // }else{ // self.descLab.text = @"购买钻石"; // } // }else if(billModel.type==2){ // self.descLab.text = @"用户提现"; // }else{ // NSString* text1,*text2; // if (billModel.type==3) { // text1 = @"视频"; // }else if (billModel.type==4){ // text1 = @"礼物"; // }else if (billModel.type==7){ // text1 = @"私信"; // }else if (billModel.type==9){ // text1 = @"守护"; // } // //modify by leo v1.5.3 // else if (billModel.type==10) // { // text1 = @"公会"; // }else{ // text1 = billModel.system_str; // } // if (billModel.change_value>0) { // text2 = @"收入来自于"; // }else{ // text2 = @"支出给"; // } // // // // self.descLab.text = [NSString stringWithFormat:@"%@%@%@",text1,text2,billModel.from_username]; // } } @end