123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- //
- // YOUPAILZBillDetailCell.m
- // VQU
- //
- // Created by CY on 2021/7/30.
- // Copyright © 2021 leo. All rights reserved.
- //
- //
- // YOUPAILZBillDetailCell.m
- // LiveChat
- //
- // Created by 张灿 on 2018/10/10.
- // Copyright © 2018年 caicai. All rights reserved.
- //
- #import "YOUPAILZBillDetailCell.h"
- @interface YOUPAILZBillDetailCell()
- @property(nonatomic,strong)UIImageView* youpaipavatarImgV;
- @property(nonatomic,strong)UILabel *youpaipnicknameL;
- @property(nonatomic,strong)UILabel* youpaipdescLab;
- @property(nonatomic,strong)UILabel* youpaiptimeLab;
- @property(nonatomic,strong)UILabel* youpaipvalueLab;
- @end
- @implementation YOUPAILZBillDetailCell
- - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
- if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
- self.selectionStyle = UITableViewCellSelectionStyleNone;
- self.backgroundColor = [UIColor clearColor];
- [self youpaifinitUI];
- }
- return self;
- }
- - (void)youpaifinitUI{
-
- UIView *bgV = [[UIView alloc] init];
- bgV.layer.cornerRadius = 5.0f;
- bgV.clipsToBounds = YES;
- bgV.backgroundColor = LZFAFAFCColor;
- [self.contentView addSubview:bgV];
- [bgV mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.offset(14.0f);
- make.top.offset(0.0f);
- make.right.offset(-14.0f);
- make.bottom.offset(-5.0f);
- }];
-
- self.youpaipavatarImgV = [[UIImageView alloc]init];
- self.youpaipavatarImgV.contentMode = UIViewContentModeScaleAspectFill;
- self.youpaipavatarImgV.layer.masksToBounds = YES;
- self.youpaipavatarImgV.layer.cornerRadius = 20;
- [bgV addSubview:self.youpaipavatarImgV];
- [self.youpaipavatarImgV makeConstraints:^(MASConstraintMaker *make) {
- make.left.equalTo(@12);
- make.centerY.equalTo(bgV);
- make.size.mas_equalTo(CGSizeMake(40, 40));
- }];
-
- UILabel* nicknameL = [[UILabel alloc]init];
- nicknameL.textColor = LZ273145Color;
- nicknameL.font = LCBoldFont(14);
- [bgV addSubview:nicknameL];
- self.youpaipnicknameL = nicknameL;
- [nicknameL makeConstraints:^(MASConstraintMaker *make) {
- make.left.equalTo(self.youpaipavatarImgV.mas_right).offset(@6);
- make.top.equalTo(self.youpaipavatarImgV.mas_top).offset(@2);
- make.height.offset(14.0f);
- make.right.equalTo(bgV.mas_centerX);
- }];
-
- UILabel* descLab = [[UILabel alloc]init];
- descLab.textColor = LZ273145Color;
- descLab.textAlignment = NSTextAlignmentRight;
- descLab.font = LCFont12;
- [bgV addSubview:descLab];
- self.youpaipdescLab = descLab;
- [descLab makeConstraints:^(MASConstraintMaker *make) {
- make.right.offset(-14.0f);
- make.top.equalTo(self.youpaipavatarImgV.mas_top).offset(0.0f);
- make.left.equalTo(bgV.mas_centerX);
- }];
- UILabel* timeLab = [[UILabel alloc]init];
- timeLab.textColor = LZA3AABEColor;
- timeLab.font = LCFont12;
- [bgV addSubview:timeLab];
- self.youpaiptimeLab = timeLab;
- [timeLab makeConstraints:^(MASConstraintMaker *make) {
- make.left.equalTo(self.youpaipavatarImgV.mas_right).offset(@4);
- make.top.equalTo(self.youpaipnicknameL.mas_bottom).offset(@6);
- }];
- UILabel* valueLab = [[UILabel alloc]init];
- valueLab.textColor = LZ273145Color;
- valueLab.font = LCFont12;
- [bgV addSubview:valueLab];
- self.youpaipvalueLab = valueLab;
- [valueLab makeConstraints:^(MASConstraintMaker *make) {
- make.right.offset(-14);
- make.bottom.equalTo(self.youpaipavatarImgV.mas_bottom).offset(-2.0f);
- }];
- }
- - (void)setYoupaipbillModel:(YOUPAILCBillDetailModel *)billModel{
- self.youpaipnicknameL.text = billModel.youpaipfrom_username.length == 0 ? @"系统" : billModel.youpaipfrom_username;
- _youpaipbillModel = billModel;
- self.youpaiptimeLab.text = billModel.youpaipcreate_time;
- //头像 type //1充值 2提现 3视频 4礼物 5系统 6兑换 7私信
- // if (billModel.youpaiptype==5||billModel.youpaiptype==9||billModel.youpaiptype==10) {
- // self.youpaipavatarImgV.layer.cornerRadius = 0.0f;
- // self.youpaipavatarImgV.image = [UIImage imageNamed:@"vqu_images_appLogo"];
- // }else if (billModel.youpaiptype==1 || billModel.youpaiptype==2 || billModel.youpaiptype==6 ){
- // self.youpaipavatarImgV.layer.cornerRadius = 0.0f;
- // self.youpaipavatarImgV.image = [UIImage imageNamed:@"vqu_images_P_wallet"];
- // }else{
- // self.youpaipavatarImgV.layer.cornerRadius = 20.0f;
- [self.youpaipavatarImgV sd_setImageWithURL:[LCTools getImageUrlWithAddress:billModel.youpaipicon]];
- // }
- //账户变动值
- if ([billModel.newtype isEqual:@"1"]) { //new_type 1 钻石 2收益
- self.youpaipvalueLab.attributedText = [LCTools setRichTextWithTitle:[NSString stringWithFormat:@"%@",billModel.youpaipchange_value] subTitle:@"钻石" titleColor:LZ7C69FEColor subTitleColor:LZ273145Color titleFontSize:18.0f subTitleFontSize:12.0f];
- }else{
- self.youpaipvalueLab.attributedText = [LCTools setRichTextWithTitle:[NSString stringWithFormat:@"%@",billModel.youpaipchange_value_new] subTitle:@"元" titleColor:LZ7C69FEColor subTitleColor:LZ273145Color titleFontSize:18.0f subTitleFontSize:12.0f];
- }
- // if (billModel.youpaipchange_value>0) {
- // if (billModel.youpaipaccount_type==1||billModel.youpaipaccount_type==2) {
- // self.youpaipvalueLab.attributedText = [LCTools setRichTextWithTitle:[NSString stringWithFormat:@"+%.2f",billModel.youpaipchange_value] subTitle:@"元" titleColor:LZ7C69FEColor subTitleColor:LZ273145Color titleFontSize:18.0f subTitleFontSize:12.0f];
- // }else{
- // self.youpaipvalueLab.attributedText = [LCTools setRichTextWithTitle:[NSString stringWithFormat:@"+%.0f",billModel.youpaipchange_value] subTitle:@"钻石" titleColor:LZ7C69FEColor subTitleColor:LZ273145Color titleFontSize:18.0f subTitleFontSize:12.0f];
- // }
- // }else{
- // if (billModel.youpaipaccount_type==1||billModel.youpaipaccount_type==2) {
- // self.youpaipvalueLab.attributedText = [LCTools setRichTextWithTitle:[NSString stringWithFormat:@"%.2f",billModel.youpaipchange_value] subTitle:@"元" titleColor:LZ7C69FEColor subTitleColor:LZ273145Color titleFontSize:18.0f subTitleFontSize:12.0f];
- // }else{
- // self.youpaipvalueLab.attributedText = [LCTools setRichTextWithTitle:[NSString stringWithFormat:@"%.0f",billModel.youpaipchange_value] subTitle:@"钻石" titleColor:LZ7C69FEColor subTitleColor:LZ273145Color titleFontSize:18.0f subTitleFontSize:12.0f];
- // }
- // }
- self.youpaipdescLab.text = billModel.youpaipsystem_str;
- }
- @end
|