// // MyDetailTableViewCell.m // DSH // // Created by 张毅成 on 2018/9/26. // Copyright © 2018 WZX. All rights reserved. // #import "MyDetailTableViewCell.h" @implementation MyDetailTableViewCell - (void)awakeFromNib { [super awakeFromNib]; // Initialization code } - (void)setDataWithModel:(NSDictionary *)dic { if ([NSStringFromClass([dic class]) isEqualToString:@"__NSCFConstantString"]) { self.labelDetail.hidden = true; self.imageViewIcon.hidden = true; self.labelTitle.text = (NSString *)dic; return; } NSString *imageName = dic[@"imageName"]; self.labelTitle.text = dic[@"title"]; self.labelDetail.text = dic[@"titleDetail"]; self.imageViewIcon.hidden = true; if (imageName.length > 0) { self.imageViewIcon.hidden = false; self.imageViewIcon.image = [UIImage imageNamed:imageName]; if ([imageName isEqualToString:@"我的-个人信息-详细-二维码"]) { self.imageViewIcon.layer.cornerRadius = 0; self.imageViewIcon.layer.masksToBounds = false; self.imageViewWidth.constant = 15; self.imageViewHeight.constant = 15; }else{ self.imageViewHeight.constant = 32; self.imageViewWidth.constant = 32; self.imageViewIcon.layer.cornerRadius = 16; self.imageViewIcon.layer.masksToBounds = true; // [self.imageViewIcon sd_setImageWithURL:[NSURL URLWithString:kUserHeadImageURL] placeholderImage:kUserDefaultHeadImage]; } self.labelDetail.hidden = true; }else self.labelDetail.hidden = false; if ([self.labelTitle.text isEqualToString:@"我的会员"]) { self.labelDetail.text = @"您还不是会员~加入会员享特权"; } } + (instancetype)cellWithTableView:(UITableView *)tableView { static NSString *ID = @"MyDetailTableViewCell"; MyDetailTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID]; if (cell == nil) { cell = [[[NSBundle mainBundle] loadNibNamed:ID owner:self options:nil] firstObject]; } cell.selectionStyle = UITableViewCellSelectionStyleNone; return cell; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } @end