| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 | ////  KWMineHomeOrderSubView.m//  westkissMob////  Created by iOS on 2022/10/12.//#import "KWMineHomeOrderSubView.h"@interface KWMineHomeOrderSubView ()@property (nonatomic, strong) UILabel *titleLB;@property (nonatomic, strong) UILabel *priceLb;@property (nonatomic, strong) UILabel *xLB;@property (nonatomic, strong) UILabel *numLB;@property (nonatomic, strong) UIImageView *imgV;@property (nonatomic, strong) KWMineOrderProInfoModel *m;@end@implementation KWMineHomeOrderSubView- (void)setData:(KWMineOrderProInfoModel *)model {    self.m = model;    self.titleLB.text = model.name;    self.priceLb.text = [NSString stringWithFormat:@"%@%@",  model.currency_symbol, model.price];    self.numLB.text = model.qty_ordered;    NSString *imageStr = [NSString stringWithFormat:@"https:%@%@%@",HostPath,ProductImgPath,model.image];    [self.imgV sd_setImageWithURL:[NSURL URLWithString:imageStr.urlEncode] placeholderImage:[UIImage imageNamed:@"product_defualtImg"]];}-(instancetype)init {    self = [super init];    if (self) {        [self loadSubV];    }    return self;}- (void)loadSubV {    self.backgroundColor = UIColor.clearColor;    [self addSubview:self.imgV];    [self addSubview:self.titleLB];    [self addSubview:self.priceLb];    [self addSubview:self.xLB];    [self addSubview:self.numLB];            [_imgV mas_makeConstraints:^(MASConstraintMaker *make) {        make.top.equalTo(self).offset(0);        make.left.equalTo(self).offset(0);        make.bottom.equalTo(self).offset(0);        make.width.height.equalTo(@86);    }];        [_titleLB mas_makeConstraints:^(MASConstraintMaker *make) {        make.top.equalTo(self.imgV);        make.left.equalTo(self.imgV.mas_right).offset(10);        make.right.equalTo(self).offset(0);        make.height.equalTo(@35);    }];        [self.priceLb setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];    [self.priceLb mas_makeConstraints:^(MASConstraintMaker *make) {        make.bottom.equalTo(self.imgV);        make.left.equalTo(self.titleLB);        make.height.equalTo(@17);    }];    [self.xLB mas_makeConstraints:^(MASConstraintMaker *make) {        make.width.equalTo(@17);        make.height.equalTo(@17);        make.left.equalTo(self.priceLb.mas_right);        make.centerY.equalTo(self.priceLb);    }];    [self.numLB mas_makeConstraints:^(MASConstraintMaker *make) {        make.width.equalTo(@25);        make.height.equalTo(@17);        make.left.equalTo(self.xLB.mas_right);        make.centerY.equalTo(self.priceLb);    }];}- (UIImageView *)imgV {    if (!_imgV) {        UIImageView *imgV = [[UIImageView alloc] init];        _imgV = imgV;    }    return _imgV;}- (UILabel *)titleLB {    if (!_titleLB) {        UILabel *lb = [[UILabel alloc] init];        lb.font = [UIFont fontWithName:Rob_Regular size:12];        lb.textColor = [UIColor blackColor];        lb.backgroundColor = [UIColor clearColor];        lb.numberOfLines = 2;        _titleLB = lb;    }    return _titleLB;}- (UILabel *)priceLb {    if (!_priceLb) {        UILabel *lb = [[UILabel alloc] init];        lb.font = [UIFont fontWithName:Rob_Bold size:14];        lb.textColor = _0B0B0B;        lb.backgroundColor = [UIColor clearColor];        _priceLb = lb;    }    return _priceLb;}- (UILabel *)xLB {    if (!_xLB) {        UILabel *lb = [[UILabel alloc] init];        lb.font = [UIFont fontWithName:Rob_Regular size:14];        lb.textColor = _0B0B0B;        lb.backgroundColor = [UIColor clearColor];        lb.textAlignment = NSTextAlignmentCenter;        lb.text = @"x";        _xLB = lb;    }    return _xLB;}- (UILabel *)numLB {    if (!_numLB) {        UILabel *lb = [[UILabel alloc] init];        lb.font = [UIFont fontWithName:Rob_Regular size:14];        lb.textColor = _0B0B0B;        lb.backgroundColor = [UIColor clearColor];        _numLB = lb;    }    return _numLB;}@end
 |