| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 | 
							- //
 
- //  ASOrderDetailsItemsCell.m
 
- //  Asteria
 
- //
 
- //  Created by xingyu on 2024/5/16.
 
- //
 
- #import "ASOrderDetailsItemsCell.h"
 
- @interface ASOrderDetailsItemsCell()
 
- @property (nonatomic, strong) UIImageView *goodsImage;
 
- @property (nonatomic, strong) UILabel *nameLab;
 
- @property (nonatomic, strong) UILabel *countLab;
 
- @property (nonatomic, strong) UILabel *realPriceLab;
 
- @property (nonatomic, strong) UILabel *priceLab;
 
- @property (nonatomic, strong) UILabel *optLab;
 
- @end
 
- @implementation ASOrderDetailsItemsCell
 
- - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
 
-     if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
 
-         self.selectionStyle = UITableViewCellSelectionStyleNone;
 
-         self.contentView.backgroundColor = _F8F8F8;
 
-         
 
-         UIView *backView = [[UIView alloc] init];
 
-         backView.backgroundColor = Col_FFF;
 
-         TT_ViewRadius(backView, 3);
 
-         [self.contentView addSubview:backView];
 
-         [backView mas_makeConstraints:^(MASConstraintMaker *make) {
 
-             make.left.mas_equalTo(10);
 
-             make.top.mas_equalTo(5);
 
-             make.right.mas_equalTo(-10);
 
-             make.bottom.mas_equalTo(0);
 
-         }];
 
-         
 
-         _goodsImage = [[UIImageView alloc] init];
 
-         _goodsImage.contentMode = UIViewContentModeScaleAspectFill;
 
-         TT_ViewRadius(_goodsImage, 4);
 
-         [backView addSubview:_goodsImage];
 
-         [_goodsImage mas_makeConstraints:^(MASConstraintMaker *make) {
 
-             make.left.mas_equalTo(10);
 
-             make.top.mas_equalTo(20);
 
-             make.width.height.mas_equalTo(86);
 
-         }];
 
-         
 
-         _nameLab = [UILabel labelCreateWithText:@"sdafhasjkfah" font:[UIFont fontWithName:Rob_Regular size:12] textColor:Col_000];
 
-         _nameLab.numberOfLines = 2;
 
-         [backView addSubview:_nameLab];
 
-         [_nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
 
-             make.top.mas_equalTo(20);
 
-             make.right.mas_equalTo(-10);
 
-             make.left.equalTo(_goodsImage.mas_right).offset(10);
 
-         }];
 
-         
 
-         _countLab = [UILabel labelCreateWithText:@"x1" font:[UIFont fontWithName:Rob_Bold size:14] textColor:Col_000];
 
-         [backView addSubview:_countLab];
 
-         [_countLab mas_makeConstraints:^(MASConstraintMaker *make) {
 
-             make.bottom.mas_equalTo(_goodsImage.mas_bottom).offset(0);
 
-             make.left.equalTo(_goodsImage.mas_right).offset(10);
 
-         }];
 
-         
 
-         _priceLab = [UILabel labelCreateWithText:@"123" font:[UIFont fontWithName:Rob_Regular size:12] textColor:[UIColor colorWithHexString:@"#8c8c8c"]];
 
-         [backView addSubview:_priceLab];
 
-         [_priceLab mas_makeConstraints:^(MASConstraintMaker *make) {
 
-             make.centerY.mas_equalTo(_countLab);
 
-             make.right.mas_equalTo(-10);
 
-         }];
 
-         
 
-         _realPriceLab = [UILabel labelCreateWithText:@"" font:[UIFont fontWithName:Rob_Bold size:14] textColor:_0B0B0B];
 
-         [backView addSubview:_realPriceLab];
 
-         [_realPriceLab mas_makeConstraints:^(MASConstraintMaker *make) {
 
-             make.centerY.mas_equalTo(_countLab);
 
-             make.right.mas_equalTo(_priceLab.mas_left).offset(-6);
 
-         }];
 
-         
 
-         _optLab = [UILabel labelCreateWithText:@"" font:[UIFont fontWithName:Rob_Regular size:12] textColor:_0B0B0B];
 
-         _optLab.numberOfLines = 0;
 
-         [backView addSubview:_optLab];
 
-         [_optLab mas_makeConstraints:^(MASConstraintMaker *make) {
 
-             make.top.mas_equalTo(_goodsImage.mas_bottom).offset(18);
 
-             make.bottom.mas_equalTo(-20);
 
-             make.right.mas_equalTo(-10);
 
-             make.left.mas_equalTo(10);
 
-         }];
 
-     }
 
-     return self;
 
- }
 
- - (void)setItemModel:(ASOrderDetailsItemModel *)itemModel {
 
-     _itemModel = itemModel;
 
-     
 
-     NSString *imageAllStr = [NSString stringWithFormat:@"https:%@%@%@",HostPath,ProductImgPath,AS_String_NotNull(_itemModel.image)];
 
-     [self.goodsImage sd_setImageWithURL:[NSURL URLWithString:imageAllStr] placeholderImage:UIImageDefaultImg_SD];
 
-     
 
-     _nameLab.text = AS_String_NotNull(_itemModel.name);
 
-     _countLab.text = [NSString stringWithFormat:@"X%@", AS_String_NotNull(_itemModel.qty_ordered)];
 
-     _realPriceLab.text = [NSString stringWithFormat:@"%@%@", AS_String_NotNull(_itemModel.currency_symbol), AS_String_NotNull(_itemModel.price)];
 
-     
 
-     NSMutableAttributedString *priceAtr = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%@%@",AS_String_NotNull(_itemModel.currency_symbol),  AS_String_NotNull(_itemModel.original_price)]];
 
-     [priceAtr addAttribute:NSStrikethroughStyleAttributeName
 
-                     value:[NSNumber numberWithInteger:NSUnderlineStyleSingle]
 
-                     range:NSMakeRange(0, priceAtr.length)];
 
-     _priceLab.attributedText = priceAtr;
 
-     
 
-     
 
-     NSArray *array = [Current_normalTool arrFromjsonStr:_itemModel.sku];
 
-     NSString *optionStr = @"";
 
-     for (int i = 0; i < array.count; i++) {
 
-         NSDictionary *dic = [array objectAtIndex:i];
 
-         optionStr = [NSString stringWithFormat:@"%@%@:%@", optionStr, dic[@"label"], dic[@"value"]];
 
-         
 
-         if (i < array.count - 1) {
 
-             optionStr = [NSString stringWithFormat:@"%@ ", optionStr];
 
-         }
 
-     }
 
-     self.optLab.text = optionStr;
 
-     
 
- }
 
- @end
 
 
  |