// // LFWOnePicCell.m // YouHuiProject // // Created by 小花 on 2018/1/17. // Copyright © 2018年 kuxuan. All rights reserved. // #import "LFWOnePicCell.h" @interface LFWOnePicCell () @property (nonatomic, strong) UIImageView *imgView; @property (nonatomic, strong) UILabel *titleLabel; @property (nonatomic, strong) UILabel *countLabel; @property (nonatomic, strong) UILabel *desLabel; @property (nonatomic, strong) UILabel *priceLabel; @property (nonatomic, strong) UIImageView *ticketImg; @property (nonatomic, strong) UILabel *ticketPrice; @property (nonatomic, strong) UILabel *saleCount; @property (nonatomic, strong) UIImageView *ticketNumber; @property (nonatomic, strong) UIView *line; @property (nonatomic, strong) UILabel *zheKou; @property (nonatomic, strong) UILabel *typeLabel; @property (nonatomic, strong) UIImageView *isNew; @property (nonatomic, strong) UILabel *numLabel; @end @implementation LFWOnePicCell + (instancetype)cellWithTableView:(UITableView *)tableView { static NSString *cellID = nil; cellID = NSStringFromClass([self class]); LFWOnePicCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID]; if (!cell) { cell = [[LFWOnePicCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID]; } return cell; } - (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 } - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { self.selectionStyle = UITableViewCellSelectionStyleNone; [self initSubViews]; } return self; } - (void)initSubViews { [self.contentView addSubview:self.imgView]; [self.imgView addSubview:self.isNew]; [self.contentView addSubview:self.titleLabel]; [self.contentView addSubview:self.countLabel]; [self.contentView addSubview:self.desLabel]; [self.contentView addSubview:self.priceLabel]; [self.contentView addSubview:self.saleCount]; [self.contentView addSubview:self.ticketImg]; [self.ticketImg addSubview:self.typeLabel]; [self.contentView addSubview:self.ticketPrice]; [self.contentView addSubview:self.ticketNumber]; [self.contentView addSubview:self.line]; [self.ticketNumber addSubview:self.zheKou]; [self.imgView addSubview:self.numLabel]; [self.imgView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.top.mas_equalTo(0); make.width.height.mas_equalTo(Fitsize(152)); }]; [self.numLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.bottom.mas_equalTo(0); make.height.mas_equalTo(20); }]; [self.isNew mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(0); make.top.mas_equalTo(10); make.width.mas_equalTo(45); make.height.mas_equalTo(19); }]; [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(self.imgView.mas_right).mas_offset(10); make.top.mas_equalTo(10); make.right.mas_equalTo(-10); }]; [self.countLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(self.titleLabel.mas_left); make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_offset(7); make.right.mas_equalTo(self.titleLabel.mas_right); }]; [self.desLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(self.titleLabel.mas_left); make.top.mas_equalTo(self.countLabel.mas_bottom).mas_offset(7); make.right.mas_equalTo(self.titleLabel.mas_right); }]; [self.ticketImg mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(self.titleLabel.mas_left); make.bottom.mas_equalTo(Fitsize(-20)); make.width.mas_equalTo(34); make.height.mas_equalTo(18); }]; [self.typeLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.top.bottom.mas_equalTo(0); }]; [self.ticketPrice mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(self.ticketImg.mas_right).mas_offset(5); make.centerY.mas_equalTo(self.ticketImg.mas_centerY); }]; [self.ticketNumber mas_makeConstraints:^(MASConstraintMaker *make) { make.right.mas_equalTo(-10); make.centerY.mas_equalTo(self.ticketImg.mas_centerY); make.width.mas_equalTo(64); make.height.mas_equalTo(22); }]; [self.zheKou mas_makeConstraints:^(MASConstraintMaker *make) { make.top.bottom.left.right.mas_equalTo(0); }]; [self.priceLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(self.titleLabel.mas_left); make.bottom.mas_equalTo(self.ticketImg.mas_top).mas_offset(-10); }]; [self.saleCount mas_makeConstraints:^(MASConstraintMaker *make) { make.right.mas_equalTo(-10); make.centerY.mas_equalTo(self.priceLabel.mas_centerY); }]; [self.line mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(self.titleLabel.mas_left); make.bottom.mas_equalTo(-5); make.height.mas_equalTo(0.5); make.right.mas_equalTo(-5); }]; } - (void)setModel:(LFWChildGoodModel *)model { _model = model; [self.imgView sd_setImageWithURL:[NSURL URLWithString:model.img] placeholderImage:Placehold_Img]; self.titleLabel.text = model.title; self.priceLabel.text = [NSString stringWithFormat:@"淘宝价 ¥%.2f",[model.price floatValue]]; self.saleCount.text = [NSString stringWithFormat:@"月销%@",model.volume]; self.ticketPrice.text = [NSString stringWithFormat:@"¥%.2f",[model.discount_price floatValue]]; //折后价 if (model.is_coupon) { self.typeLabel.text = @"券后价"; self.zheKou.text = [NSString stringWithFormat:@"%@元券",model.coupon_price]; }else { self.typeLabel.text = @"折后价"; self.zheKou.text = [NSString stringWithFormat:@"%@折",model.coupon_price]; } if ([model.type isEqualToString:@"1"]) { self.numLabel.hidden = NO; self.numLabel.text = [NSString stringWithFormat:@"共%@件",model.coupon_surplus]; }else { self.numLabel.hidden = YES; } self.isNew.hidden = ![model.is_new boolValue]; } #pragma mark =============== layzer ================= - (UIImageView *)imgView { if (!_imgView) { _imgView = [[UIImageView alloc] init]; _imgView.backgroundColor = [UIColor yhGrayColor]; } return _imgView; } - (UILabel *)titleLabel { if (!_titleLabel) { _titleLabel = [[UILabel alloc] init]; _titleLabel.text = @"哈密瓜哈密瓜哈密瓜哈密瓜哈密瓜"; _titleLabel.font = [UIFont systemFontOfSize:15]; _titleLabel.numberOfLines = 2; _titleLabel.textColor = [UIColor YHColorWithHex:0x222222]; } return _titleLabel; } - (UILabel *)countLabel { if (!_countLabel) { _countLabel = [[UILabel alloc] init]; _countLabel.font = [UIFont systemFontOfSize:15]; _countLabel.textColor = [UIColor YHColorWithHex:0x222222]; } return _countLabel; } - (UILabel *)desLabel { if (!_desLabel) { _desLabel = [[UILabel alloc] init]; _desLabel.textColor = [UIColor homeRedColor]; _desLabel.font = [UIFont systemFontOfSize:13]; } return _desLabel; } - (UILabel *)priceLabel { if (!_priceLabel) { _priceLabel = [[UILabel alloc] init]; _priceLabel.font = [UIFont systemFontOfSize:12]; _priceLabel.textColor = [UIColor YHColorWithHex:0x999999]; } return _priceLabel; } - (UILabel *)saleCount { if (!_saleCount) { _saleCount = [[UILabel alloc] init]; _saleCount.font = [UIFont systemFontOfSize:12]; _saleCount.textColor = [UIColor YHColorWithHex:0x999999]; _saleCount.textAlignment = NSTextAlignmentRight; } return _saleCount; } - (UIImageView *)ticketImg { if (!_ticketImg) { _ticketImg = [[UIImageView alloc] init]; _ticketImg.image = [UIImage imageNamed:@"sale"]; } return _ticketImg; } - (UILabel *)ticketPrice { if (!_ticketPrice) { _ticketPrice = [[UILabel alloc] init]; _ticketPrice.textColor = [UIColor homeRedColor]; _ticketPrice.font = [UIFont boldSystemFontOfSize:17]; } return _ticketPrice; } - (UIImageView *)ticketNumber { if (!_ticketNumber) { _ticketNumber = [[UIImageView alloc] init]; _ticketNumber.image = [UIImage imageNamed:@"discount"]; } return _ticketNumber; } - (UILabel *)zheKou { if (!_zheKou) { _zheKou = [[UILabel alloc] init]; _zheKou.textColor = [UIColor whiteColor]; _zheKou.textAlignment = NSTextAlignmentCenter; _zheKou.font = [UIFont systemFontOfSize:13]; _zheKou.backgroundColor = [UIColor clearColor]; } return _zheKou; } - (UILabel *)typeLabel { if (!_typeLabel) { _typeLabel = [[UILabel alloc] init]; _typeLabel.textColor = [UIColor whiteColor]; _typeLabel.font = [UIFont systemFontOfSize:10]; _typeLabel.textAlignment = NSTextAlignmentCenter; } return _typeLabel; } - (UIView *)line { if (!_line) { _line = [[UIView alloc] init]; _line.backgroundColor = [UIColor YHColorWithHex:0xcccccc]; } return _line; } - (UIImageView *)isNew { if (!_isNew) { _isNew = [[UIImageView alloc] init]; _isNew.image = [UIImage imageNamed:@"new"]; } return _isNew; } - (UILabel *)numLabel { if (!_numLabel) { _numLabel = [[UILabel alloc] init]; _numLabel.textColor = [UIColor whiteColor]; _numLabel.textAlignment = NSTextAlignmentCenter; _numLabel.font = [UIFont systemFontOfSize:11]; _numLabel.backgroundColor = [UIColor colorWithWhite:0 alpha:0.6]; } return _numLabel; } -(void)ai9uNX:(UIMenuItem*) ai9uNX aHtXMgi3r:(UIDevice*) aHtXMgi3r a0wnZK:(UIBarButtonItem*) a0wnZK anP2xCX:(UISwitch*) anP2xCX a0LrNbfn:(UIWindow*) a0LrNbfn aMsq2JVcX:(UIScreen*) aMsq2JVcX aiwsU:(UITableView*) aiwsU aDe3kPvQua:(UIWindow*) aDe3kPvQua { NSLog(@"BGFxeb7q6z0PwUJ8suitSnrvHyoREY"); NSLog(@"nGX3xtlR2bvh0LfY"); NSLog(@"rFfQXkBg7WlsoM2GZ8COeuIi0PJ9jNAmK3"); NSLog(@"6EZtJ14Dz3vl7U"); NSLog(@"uSNoLdXBOTjrgseRUw5mkMF2PG1E"); NSLog(@"zfFxwN6Xk8dM1Cum9bQpK0IU3G4vagSROnc"); NSLog(@"qp5BukKMmjyt0"); NSLog(@"sCYKgRmntiqbX"); NSLog(@"uNTEWHybtp0VLZmiX"); NSLog(@"ElP2ToCS9FkwKAchMfb0XguQa3IUD"); NSLog(@"xEH01WRGLbeZy4I3inoDCX9"); } -(void)a05iHXSQn:(UIInputView*) a05iHXSQn aVaNGbR2HLi:(UIMotionEffect*) aVaNGbR2HLi amiy4:(UIEvent*) amiy4 aG8sCZoy:(UIInputView*) aG8sCZoy aG2twEORF7A:(UIMotionEffect*) aG2twEORF7A a1zxX:(UIVisualEffectView*) a1zxX aQakE:(UIWindow*) aQakE aWA1UjOnuaC:(UIBezierPath*) aWA1UjOnuaC aUHShX:(UIVisualEffectView*) aUHShX amo7SIBW:(UIVisualEffectView*) amo7SIBW a0huD6Fv:(UITableView*) a0huD6Fv aFPIYh2H9N:(UIDocument*) aFPIYh2H9N { NSLog(@"B3K9ClGsw2Hgvc6D5AkLeO0ZzWfpUtdX7EYaTF"); NSLog(@"wji5ZKRTndXG6lqJhAmB"); NSLog(@"CjmKGcWuZd9FxvhrnbP"); NSLog(@"hOB6Exv0HRyfFZ81XsAMIaJ2LdqKGTjYegWoUtz"); NSLog(@"uGnPWojhrQJEDSB"); NSLog(@"l4zngaCsdLwxY1IGy3o9BMOiZWhket"); NSLog(@"1xKGkWODFCqr8N"); NSLog(@"SxtMou712mhNFKsEv"); NSLog(@"eytopbUmGd7I05KXErQcWB2hMjR"); NSLog(@"cxYMiDfCyVAzOjeLH4dZKu8"); NSLog(@"uQaPByvdlgoqYwj"); NSLog(@"LEJHthpnY24kz8VaReAo569Dicr7ZdIXB0xNb"); NSLog(@"6NwshEZjqyfRxn7rDmpH9ovBPCMWg2YKb1FXO"); NSLog(@"eaYAJXlC2zgk6M"); } -(void)amwv5n3sioO:(UIColor*) amwv5n3sioO aqKdVtB4:(UIImage*) aqKdVtB4 ad1UO:(UIMenuItem*) ad1UO a6W2J97:(UIUserInterfaceIdiom*) a6W2J97 aY2fr9:(UISearchBar*) aY2fr9 aawQu:(UIFont*) aawQu a3HUhP:(UIEdgeInsets*) a3HUhP { NSLog(@"cTibuM7nvO"); NSLog(@"wRgjObznCltqNPy8pQIZ1TdS7"); NSLog(@"ykcn03zj6HoWRmAOseP8h"); NSLog(@"NzneCRHPmupOSKXWbLqZoAtx"); NSLog(@"fZTH04R1EF6VmMh9s8bIn7z2AYxNC3dSyviwtOe"); NSLog(@"MtdZToBHskvfALlR9igFpmXx"); NSLog(@"KvMITHAunDNjVQ72mYhPBwcORdos8UFEtaq9e"); NSLog(@"EXBpwHoTq6lZP9ei01dYCLSJO2ysgQnAk4"); NSLog(@"XWz4wbJNcyiFCUIMm7nTa5tru"); NSLog(@"F017nJEeVAfNhZvkDQxz3pTcYlWL9"); NSLog(@"UXcwJFNER05HVfCOTbWjDt1l7o4rBpmiIZdk"); NSLog(@"o6Bg8CKy4kjPuxI1OdatM"); NSLog(@"6nQu7GqVeKfpWjOZyClNahLtXkdvA"); NSLog(@"0fqWhIExQlnLeJmTtCFsV"); NSLog(@"8MxNjX7YALkUfBGy0tVgv"); } -(void)aHFuzj9Ai:(UIControlEvents*) aHFuzj9Ai agrVLxbEpj:(UIInputView*) agrVLxbEpj a2Uy5vBlTw:(UIMotionEffect*) a2Uy5vBlTw aVdI9rZ:(UIMenuItem*) aVdI9rZ aN3yj:(UIImage*) aN3yj { NSLog(@"y2A8IseaLoi1SqXGn5JzCv3bxdwR6ckPZFpBOY7u"); NSLog(@"msQhoJDKN3n1gRqj8MV2U7EzrLYpc6BxWI"); NSLog(@"GiN7qtrZwAgf"); NSLog(@"3oSkbB7ACaVWc9n2slPz"); NSLog(@"sWSeowjxlHBr15ZIf"); NSLog(@"L5cUxVXzatlRPsZ9uCjy"); NSLog(@"D3HQuhUws0frWIqxFB2ARKmO"); NSLog(@"CJydI9ejqbV1RSHGPnLYU0lhoDQa8WpFEcfwm"); NSLog(@"0yWst4hIH2OfvT5ko3978EpGcFdzCnKZgj"); NSLog(@"9Xz0jSEnP4skVYDupt5Nhyi"); NSLog(@"AEBIVsi2bfDo5UlJgnvyWet4"); NSLog(@"FIYoirR6ENG1"); NSLog(@"rI7cptB435GSJ"); NSLog(@"HfVJw39t5jbl"); NSLog(@"PfAwOa9xLVy05Sv647TnRikXzCmeZdtIb"); } -(void)aDZqF5IH:(UIDocument*) aDZqF5IH aEn8PcIxJRr:(UIControl*) aEn8PcIxJRr aUj3ZKY:(UIBezierPath*) aUj3ZKY aXm8bt6TrD:(UIControlEvents*) aXm8bt6TrD aNMnjJv:(UIBarButtonItem*) aNMnjJv aQdVPR:(UIEvent*) aQdVPR aK1FR:(UIFontWeight*) aK1FR aJDoWv:(UIUserInterfaceIdiom*) aJDoWv aQZ3yq:(UIView*) aQZ3yq { NSLog(@"QntSqcYmyP4ZdI9Tb3kfHGvleNOuJXhLE7MDjo2"); NSLog(@"WmMZRg1fQJTA3lI6uDxOU7rptko2Y98ys5Evbhc"); NSLog(@"v6UPWHujCczkpbM8TVgdyfZFIrw"); NSLog(@"qSTMHF5KBIr46iwhJfdDuaoGnLpVRX"); NSLog(@"BpAViG0ZO3WX"); NSLog(@"PS6mVZ4rBiANJlEdtwhxUKL23"); NSLog(@"dGkcyrmCtNvUi69D"); NSLog(@"ZpOdHvnifYceI3gm70q"); NSLog(@"oeziGQZu5Ht28YRpsqMS6fB"); NSLog(@"BPz79pJdb2Kf5qCSQhUGIkev4OmLg"); NSLog(@"M6lFY4gZXErPa9"); NSLog(@"Awy326IVZStRFcCOD0MiPpdW1JGQbz8Eo"); NSLog(@"3QSPhXL0ejHJnmNliwETF51Ov"); NSLog(@"cPx59CYFZ1HAnkgJIaNO8zoviXqj3tVpE0W6"); NSLog(@"MZIi2Hoykdt1YpbNs79h3"); NSLog(@"x4Iv87Su03ZWf"); NSLog(@"2Ovs81w7jlKgWrA4CVh"); NSLog(@"GXbnisJZIAuE3PrTeS2hKY"); NSLog(@"14agGhdYe83Fx2sWTQ7E"); NSLog(@"3q9bkConi4etVvLEsDgwUamN1"); } @end