| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- //
- // BusinesswaterDetailCell.m
- // jitao
- //
- // Created by 罗云飞 on 2017/12/28.
- // Copyright © 2017年 罗云飞. All rights reserved.
- //
- #import "BusinesswaterDetailCell.h"
- @implementation BusinesswaterDetailCell
- - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
- self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
- if (self) {
- UILabel *line = [UILabel new];
- line.backgroundColor = NewLineGrayColor;
- [self.contentView addSubview:line];
-
- line.sd_layout
- .leftEqualToView(self.contentView)
- .heightIs(10)
- .rightEqualToView(self.contentView)
- .topEqualToView(self.contentView);
-
- UIImageView *image = [UIImageView new];
- [image setImage:NewImageNamed(@"dd")];
- [self.contentView addSubview:image];
-
- image.sd_layout
- .widthIs(18)
- .heightIs(14)
- .leftSpaceToView(self.contentView, 15)
- .topSpaceToView(line, 15);
-
- _title = [UILabel new];
- _title.font = NewFont(fitScreenWidth(14));
- [_title setSingleLineAutoResizeWithMaxWidth:SCREEN_WIDTH-fitScreenWidth(40+155)];
- [self.contentView addSubview:_title];
-
- _title.sd_layout
- .leftSpaceToView(image, 5)
- .centerYEqualToView(image)
- .heightIs(fitScreenWidth(15));
-
-
- _time = [UILabel new];
- _time.font = NewFont(fitScreenWidth(12));
- [_time setSingleLineAutoResizeWithMaxWidth:0];
- _time.textColor = [UIColor colorWithString:@"#9A9A9A"];
- [self.contentView addSubview:_time];
-
- _time.sd_layout
- .rightSpaceToView(self.contentView, 15)
- .centerYEqualToView(image)
- .heightIs(fitScreenWidth(12));
-
- UILabel *line1 = [UILabel new];
- line1.backgroundColor = NewLineGrayColor;
- [self.contentView addSubview:line1];
-
- line1.sd_layout
- .leftEqualToView(self.contentView)
- .heightIs(0.8)
- .rightSpaceToView(self.contentView, 0)
- .topSpaceToView(line, 44);
-
- UIImageView *image1 = [UIImageView new];
- [image1 setImage:NewImageNamed(@"Check")];
- [self.contentView addSubview:image1];
-
- image1.sd_layout
- .leftEqualToView(image)
- .heightIs(16)
- .widthIs(16)
- .topSpaceToView(line1, 15);
-
- _state = [UILabel new];
- [_state setSingleLineAutoResizeWithMaxWidth:0];
- _state.font = NewFont(fitScreenWidth(12));
- [self.contentView addSubview:_state];
-
- _state.sd_layout
- .leftSpaceToView(image1, 5)
- .centerYEqualToView(image1)
- .heightIs(fitScreenWidth(12));
-
- _ordernumber = [UILabel new];
- _ordernumber.textColor = [UIColor colorWithString:@"#9A9A9A"];
- _ordernumber.font = NewFont(fitScreenWidth(12));
- [_ordernumber setSingleLineAutoResizeWithMaxWidth:0];
- [self.contentView addSubview:_ordernumber];
-
- _ordernumber.sd_layout
- .centerYEqualToView(image1)
- .heightIs(fitScreenWidth(12))
- .centerXEqualToView(self.contentView);
-
- _businessDesc = [UILabel new];
- _businessDesc.textColor = NewButtonColor;
- _businessDesc.font = NewFont(fitScreenWidth(12));
- [_businessDesc setSingleLineAutoResizeWithMaxWidth:0];
- [self.contentView addSubview:_businessDesc];
-
- _businessDesc.sd_layout
- .centerYEqualToView(image1)
- .heightIs(fitScreenWidth(12))
- .rightSpaceToView(self.contentView, 15);
-
-
- }
- return self;
- }
- - (void)assignment:(BusinesswaterModel*)model {
- _title.text = model.commodityName;
- _time.text = model.createTime;
- // 0-待确认 1-已确认 2-已拒绝
- if ([model.confirmSign isEqualToString:@"0"]) {
- _state.text = @"待确认";
- }else if ([model.confirmSign isEqualToString:@"1"]){
- _state.text = @"已确认";
- }else if ([model.confirmSign isEqualToString:@"2"]){
- _state.text = @"已拒绝";
- }
- _ordernumber.text = [NSString stringWithFormat:@"订单编号:%@",model.orderNo];
- _businessDesc.text = model.businessDesc;
-
- }
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- // Configure the view for the selected state
- }
- @end
|