1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- //
- // YOUPAILZProfileMenuItemCell.m
- // MEISHI
- //
- // Created by CY on 2021/1/12.
- // Copyright © 2021 leo. All rights reserved.
- //
- #import "YOUPAILZProfileMenuItemCell.h"
- #import "YOUPAIHRMedalView.h"
- #import "YOUPAIProfileMenuItemContentCell.h"
- @interface YOUPAILZProfileMenuItemCell ()<UITableViewDataSource,UITableViewDelegate>
- @end
- @implementation YOUPAILZProfileMenuItemCell
- - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
- if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
- self.selectionStyle = UITableViewCellSelectionStyleNone;
- self.backgroundColor = LZFAFAFCColor;
-
- [self youpaifinitUI];
- }
- return self;
- }
- -(void)youpaifinitUI{
-
- UIView *bgView = [UIView new];
- [self.contentView addSubview:bgView];
- [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(12);
- make.right.mas_equalTo(-12);
- make.top.mas_equalTo(10);
- make.bottom.mas_equalTo(-10);
- }];
- bgView.backgroundColor = [UIColor whiteColor];
- bgView.layer.cornerRadius = 12;
- bgView.clipsToBounds = YES;
- bgView.userInteractionEnabled = YES;
- UITableView *tableView = [[UITableView alloc]initWithFrame:CGRectZero style:UITableViewStylePlain];
- [bgView addSubview:tableView];
- [tableView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.edges.mas_equalTo(0);
- }];
-
- tableView.backgroundColor = [UIColor whiteColor];
- tableView.showsVerticalScrollIndicator = NO;
- tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
- tableView.estimatedRowHeight = 71.0f;
- tableView.rowHeight = 71.0f;
- tableView.delegate = self;
- tableView.dataSource= self;
-
- }
- -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
- NSMutableDictionary *cellData = self.countArr[indexPath.item];
- NSString *title = [cellData valueForKey:@"type"];
- if (self.vqupaipDidSelectBlock) {
- self.vqupaipDidSelectBlock(title);
- }
- }
- -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
-
- return self.countArr.count;
- }
- -(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
-
-
- NSMutableDictionary *cellData = self.countArr[indexPath.row];
- NSString *cellID = @"YOUPAIProfileMenuItemContentCell";
- YOUPAIProfileMenuItemContentCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
-
- cell = [[YOUPAIProfileMenuItemContentCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
-
- cell.youpaipimgV.image = [cellData valueForKey:@"image"];
- cell.youpaiptextL.text = [cellData valueForKey:@"title"];
- cell.youpaiplz_accessoryType = [[cellData valueForKey:@"accessoryType"] integerValue];
- cell.youpaiprightLabel.text = [cellData valueForKey:@"rightText"];
-
- cell.youpaipsubTextL.text = @"";
- cell.youpaipisShow = cellData[@"redView"];
- if ([cellData.allKeys containsObject:@"subTitle"]) {
- cell.youpaipsubTextL.text = cellData[@"subTitle"];
- }
- if (indexPath.row == self.countArr.count-1) {
- cell.line.hidden = YES;
- }else{
- cell.line.hidden = NO;
- }
- return cell;
-
- }
- @end
|