123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- //
- // JXMyServiceCell.m
- // shiku_im
- //
- // Created by 123 on 2020/5/15.
- // Copyright © 2020 Reese. All rights reserved.
- //
- #import "JXMyServiceCell.h"
-
- @interface JXMyServiceCell()
- @property (nonatomic,weak) UIImageView *backIMG;
- @property (nonatomic,weak) UIImageView *leftIMG;
- @property (nonatomic,weak) UILabel *leftLab;
- @property (nonatomic,weak) UILabel *rightL;
- @property (nonatomic,weak) UILabel *timeL;
- @end
- @implementation JXMyServiceCell
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- }
- -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
- if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
-
- UIImageView *backIMG=[[UIImageView alloc]init];
- // backIMG.backgroundColor=kRGBColor(33, 133, 88);
- // backIMG.contentMode=UIViewContentModeScaleAspectFill;
- backIMG.image=[UIImage imageNamed:@"kefuzhu"];
- [self.contentView addSubview:backIMG];
- self.backIMG=backIMG;
- [backIMG mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(0);
- make.left.mas_equalTo(20);
- make.right.mas_equalTo(-20);
- make.height.mas_equalTo(100);
- }];
-
- UIImageView *leftIMG=[[UIImageView alloc]init];
- leftIMG.image=[UIImage imageNamed:@"kefuzhuCall"];
- [backIMG addSubview:leftIMG];
- self.leftIMG=leftIMG;
- [leftIMG mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(8);
- make.left.mas_equalTo(15);
- }];
-
- UILabel *leftLab=[[UILabel alloc]init];
- leftLab.text=@"主线客服";
- leftLab.textColor=[UIColor whiteColor];
- leftLab.font=[UIFont systemFontOfSize:16 weight:UIFontWeightRegular];
- [backIMG addSubview:leftLab];
- self.leftLab=leftLab;
- [leftLab mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerY.mas_equalTo(leftIMG.mas_centerY);
- make.left.mas_equalTo(leftIMG.mas_right).mas_offset(10);
- }];
-
- UILabel *rightL=[[UILabel alloc]init];
- rightL.text=@"Main Customer Support";
- rightL.textColor=[UIColor whiteColor];
- rightL.font=[UIFont systemFontOfSize:13 weight:UIFontWeightRegular];
- [backIMG addSubview:rightL];
- self.rightL=rightL;
- [rightL mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(leftIMG.mas_bottom).mas_offset(8);
- make.left.mas_equalTo(15);
- }];
-
-
- UILabel *timeL=[[UILabel alloc]init];
- timeL.text=@"7*24小时专线服务 贴心至上";
- timeL.textColor=[UIColor whiteColor];
- timeL.font=[UIFont systemFontOfSize:13 weight:UIFontWeightRegular];
- [backIMG addSubview:timeL];
- self.timeL=timeL;
- [timeL mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(rightL.mas_bottom).mas_offset(8);
- make.left.mas_equalTo(15);
- }];
-
- UIImageView *rightIMG=[[UIImageView alloc]init];
- rightIMG.image=[UIImage imageNamed:@"youjiantouM"];
- [backIMG addSubview:rightIMG];
- [rightIMG mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerY.mas_equalTo(backIMG.mas_centerY);
- make.right.mas_equalTo(-15);
- }];
- }
-
- return self;
- }
- + (instancetype)cellWithTableView:(UITableView *)tableView
- {
- static NSString *ID = @"JXMyServiceCell";
- JXMyServiceCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
-
- if (!cell) {
- cell = [[JXMyServiceCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
- cell.selectionStyle=UITableViewCellSelectionStyleNone;
- }
- // cell.layer.cornerRadius=8;
- // cell.layer.masksToBounds=YES;
- cell.backgroundColor=[UIColor clearColor];
- return cell;
- }
-
- -(void)setModeL:(StatusesModel *)modeL{
- _modeL=modeL;
-
- self.backIMG.image=[UIImage imageNamed:modeL.image];
- self.leftIMG.image=[UIImage imageNamed:modeL.leftIMG];
- self.leftLab.text=modeL.text;
- self.rightL.text=modeL.subtile;
- self.timeL.text=modeL.contet;
- }
- -(void)setFrame:(CGRect)frame{
-
- frame.origin.y+=20;
- frame.size.height-=20;
- [super setFrame:frame];
- }
- @end
|