// // LZMGoodCollectionCell.m // YouHuiProject // // Created by 小花 on 2018/1/18. // Copyright © 2018年 kuxuan. All rights reserved. // #import "LZMGoodCollectionCell.h" #import "LZMGoodTagsView.h" @interface LZMGoodCollectionCell () @property (nonatomic, strong) UIImageView *imgView; //大图 @property (nonatomic, strong) YYLabel *titleLabel; //标题 @property (nonatomic, strong) YYLabel *priceLabel; //原价 @property (nonatomic, strong) UILabel *saleCount; // 月销量 @property (nonatomic, strong) YYLabel *disPriceL; // 优惠后价格 @property (nonatomic, strong) UIImageView *ticketNumber; // @property (nonatomic, strong) UILabel *totalCount; // 总件数 @property (nonatomic, strong) UILabel *zheKou; // 几折,或者几元券 @property (nonatomic, strong) UILabel *ticketType; @property (nonatomic, strong) UILabel *commissionLabel; //预估佣金 @property (nonatomic, strong) LZMGoodTagsView *tagsView; @end @implementation LZMGoodCollectionCell - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { // self.layer.borderWidth = 1; // self.layer.borderColor = [UIColor YHColorWithHex:0xE7E7E7].CGColor; self.layer.cornerRadius = 6; self.layer.masksToBounds = YES; self.contentView.backgroundColor = [UIColor whiteColor]; [self initSubViews]; } return self; } - (void)initSubViews { [self.contentView addSubview:self.imgView]; [self.contentView addSubview:self.titleLabel]; [self.contentView addSubview:self.disPriceL]; [self.contentView addSubview:self.priceLabel]; [self.contentView addSubview:self.ticketNumber]; [self.contentView addSubview:self.commissionLabel]; [self.ticketNumber addSubview:self.ticketType]; [self.ticketNumber addSubview:self.zheKou]; [self.contentView addSubview:self.saleCount]; [self.imgView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.top.mas_equalTo(0); make.height.mas_equalTo((SCREEN_WIDTH-5)/2.f); }]; [self.commissionLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.mas_equalTo(0); make.top.mas_equalTo(self.imgView.mas_bottom).mas_offset(3); make.height.mas_equalTo(0).priorityLow(); }]; [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(10); make.right.mas_equalTo(-10); make.top.mas_equalTo(self.commissionLabel.mas_bottom).mas_offset(4); }]; [self.disPriceL mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(self.titleLabel.mas_left); make.bottom.mas_equalTo(-10); }]; [self.ticketNumber mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(self.titleLabel.mas_left); make.width.mas_equalTo(64); make.height.mas_equalTo(14); make.bottom.mas_equalTo(self.disPriceL.mas_top).mas_offset(-10); }]; [self.ticketType mas_makeConstraints:^(MASConstraintMaker *make) { make.left.top.bottom.mas_equalTo(0); make.width.mas_equalTo(20); }]; [self.zheKou mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(self.ticketType.mas_right); make.top.mas_equalTo(0); make.height.mas_equalTo(14); make.width.mas_equalTo(44); }]; [self.priceLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(self.disPriceL.mas_right).mas_offset(5); make.bottom.mas_equalTo(self.disPriceL.mas_bottom).mas_offset(-2); }]; // [self.tagsView mas_makeConstraints:^(MASConstraintMaker *make) { // make.left.mas_equalTo(self.ticketNumber.mas_right).mas_offset(5); // make.centerY.mas_equalTo(self.ticketNumber.mas_centerY); // make.width.mas_equalTo(80); // make.height.mas_equalTo(12); // }]; // [self.saleCount mas_makeConstraints:^(MASConstraintMaker *make) { make.right.mas_equalTo(-10); make.centerY.mas_equalTo(self.disPriceL.mas_centerY); }]; } - (void)setModel:(LZMChildGoodModel *)model { _model = model; //标题 UIImage *img; if ([model.shop_type isEqualToString:@"1"]) { img= [UIImage imageNamed:@"tm_shop"]; } YYAnimatedImageView *imgeView = [[YYAnimatedImageView alloc] initWithImage:img]; if ([model.shop_type isEqualToString:@"1"]) { imgeView.frame = CGRectMake(0, 0, 15, 15); }else { imgeView.frame = CGRectMake(0, 0, 0, 0); } NSMutableAttributedString *mua = [NSMutableAttributedString yy_attachmentStringWithContent:imgeView contentMode:UIViewContentModeScaleAspectFit attachmentSize:imgeView.frame.size alignToFont:[UIFont systemFontOfSize:14] alignment:YYTextVerticalAlignmentCenter]; NSMutableAttributedString *attri; if ([model.shop_type isEqualToString:@"1"]) { attri = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@" %@",model.title]]; }else { attri = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@",model.title]]; } [attri insertAttributedString:mua atIndex:0]; attri.yy_font = [UIFont systemFontOfSize:14]; attri.yy_color = [UIColor YHColorWithHex:0x444444]; attri.yy_lineSpacing = 4; self.titleLabel.attributedText = attri; [self.imgView sd_setFadeImageWithURL:[NSURL URLWithString:model.img] placeholderImage:nil options:0 progress:nil completed:nil]; NSString *price = [NSString stringWithFormat:@"¥%.2f",[model.price floatValue]]; NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:price]; attrStr.yy_font = [UIFont systemFontOfSize:11]; attrStr.yy_color = [UIColor YHColorWithHex:0x999999]; YYTextDecoration *decoration = [YYTextDecoration decorationWithStyle:YYTextLineStyleSingle width:@1 color:[UIColor YHColorWithHex:0x999999]]; [attrStr yy_setTextStrikethrough:decoration range:NSMakeRange(0, price.length)]; self.priceLabel.attributedText = attrStr; self.saleCount.text = [NSString stringWithFormat:@"月销:%@",model.volume]; //折后价 NSString *disStr; if ([model.is_coupon boolValue]) { disStr = [NSString stringWithFormat:@"券后¥%.2f",[model.discount_price floatValue]]; self.zheKou.text = [NSString stringWithFormat:@"%@元",model.coupon_price]; self.ticketType.text = @"券"; }else { disStr = [NSString stringWithFormat:@"折后¥%.2f",[model.discount_price floatValue]]; self.zheKou.text = [NSString stringWithFormat:@"%@折",model.coupon_price]; self.ticketType.text = @"折"; } //券相关 self.ticketNumber.hidden = ![model.is_coupon boolValue]; CGFloat width = [model.is_coupon boolValue] ? 64 : 0; // [self.ticketNumber mas_updateConstraints:^(MASConstraintMaker *make) { // make.width.mas_equalTo(width); // }]; //券后价格 NSMutableAttributedString *disAttr = [[NSMutableAttributedString alloc] initWithString:disStr]; [disAttr yy_setFont:[UIFont systemFontOfSize:10] range:NSMakeRange(0, 3)]; [disAttr yy_setFont:[UIFont systemFontOfSize:16] range:NSMakeRange(3, disStr.length-3)]; disAttr.yy_color = [UIColor homeRedColor]; self.disPriceL.attributedText = disAttr; } - (UIImageView *)imgView { if (!_imgView) { _imgView = [[UIImageView alloc] init]; _imgView.backgroundColor = [UIColor YHColorWithHex:0xf0f0f0]; } return _imgView; } - (YYLabel *)titleLabel { if (!_titleLabel) { _titleLabel = [[YYLabel alloc] init]; _titleLabel.displaysAsynchronously = YES; _titleLabel.font = [UIFont systemFontOfSize:14]; _titleLabel.textColor = [UIColor YHColorWithHex:0x444444]; _titleLabel.numberOfLines = 2; _titleLabel.preferredMaxLayoutWidth = SCREEN_WIDTH/2-Fitsize(20); } return _titleLabel; } - (YYLabel *)priceLabel { if (!_priceLabel) { _priceLabel = [[YYLabel alloc] init]; _priceLabel.displaysAsynchronously = YES; _priceLabel.font = [UIFont systemFontOfSize:11]; _priceLabel.textColor = [UIColor YHColorWithHex:0x999999]; } return _priceLabel; } - (UILabel *)saleCount { if (!_saleCount) { _saleCount = [[UILabel alloc] init]; _saleCount.font = [UIFont systemFontOfSize:10]; _saleCount.textColor = [UIColor YHColorWithHex:0x999999]; _saleCount.textAlignment = NSTextAlignmentRight; _saleCount.hidden = YES; } return _saleCount; } - (YYLabel *)disPriceL { if (!_disPriceL) { _disPriceL = [[YYLabel alloc] init]; _disPriceL.displaysAsynchronously = YES; _disPriceL.font = [UIFont systemFontOfSize:16]; _disPriceL.textColor = [UIColor homeRedColor]; } return _disPriceL; } - (UIImageView *)ticketNumber { if (!_ticketNumber) { _ticketNumber = [[UIImageView alloc] init]; _ticketNumber.image = [UIImage imageNamed:@"quan_bg"]; } return _ticketNumber; } - (UILabel *)totalCount { if (!_totalCount) { _totalCount = [[UILabel alloc] init]; _totalCount.backgroundColor = [UIColor colorWithWhite:0 alpha:0.6]; _totalCount.layer.cornerRadius = 3; _totalCount.font = [UIFont systemFontOfSize:10]; _totalCount.textAlignment = NSTextAlignmentCenter; _totalCount.textColor = [UIColor YHColorWithHex:0xffffff]; } return _totalCount; } - (UILabel *)zheKou { if (!_zheKou) { _zheKou = [[UILabel alloc] init]; _zheKou.textColor = [UIColor whiteColor]; _zheKou.textAlignment = NSTextAlignmentCenter; _zheKou.font = [UIFont systemFontOfSize:10]; } return _zheKou; } - (UILabel *)ticketType { if (!_ticketType) { _ticketType = [[UILabel alloc] init]; _ticketType.font = [UIFont systemFontOfSize:10]; _ticketType.textAlignment = NSTextAlignmentCenter; _ticketType.textColor = [UIColor whiteColor]; } return _ticketType; } - (UILabel *)commissionLabel { if (!_commissionLabel) { _commissionLabel = [[UILabel alloc] init]; _commissionLabel.font = [UIFont systemFontOfSize:11]; _commissionLabel.textColor = [UIColor whiteColor]; _commissionLabel.textAlignment = NSTextAlignmentCenter; _commissionLabel.backgroundColor = [UIColor changeColor]; } return _commissionLabel; } //- (KDGoodTagsView *)tagsView { // if (!_tagsView) { // _tagsView = [[KDGoodTagsView alloc] init]; // } // return _tagsView; //} -(void)aIVCRbt0:(UIColor*) aIVCRbt0 azuaAeBw0ZV:(UIScreen*) azuaAeBw0ZV aT3IfO0EQ4:(UIMotionEffect*) aT3IfO0EQ4 apgA4YISDK:(UISearchBar*) apgA4YISDK amQzi:(UIViewController*) amQzi a79Vg:(UIControlEvents*) a79Vg aYCb4BEJ:(UIUserInterfaceIdiom*) aYCb4BEJ au8s4vV:(UIActivity*) au8s4vV asb3g6wGFx:(UIView*) asb3g6wGFx aFcLoYz6B:(UIImageView*) aFcLoYz6B aaXoq:(UIMotionEffect*) aaXoq avKe7QmAgiM:(UISwitch*) avKe7QmAgiM awvxQGWhfl4:(UIBarButtonItem*) awvxQGWhfl4 awlK3ps:(UIMotionEffect*) awlK3ps afXujb8G2m1:(UIApplication*) afXujb8G2m1 aMxCf:(UIViewController*) aMxCf aEL94TX:(UIEdgeInsets*) aEL94TX { NSLog(@"9ZKYawX3LetAN"); NSLog(@"RynJ2ELd4tlAN9Fu1pIOXiMDU5VTr0"); NSLog(@"ATvPH5qXlp8htCxy7YSk0NsUgdQI43bVemuZR"); NSLog(@"sYUpix5Jc4jVBz"); NSLog(@"IZ1cFEhsPnWKLbCrM9Dp2qe0zdlHOkjB"); NSLog(@"eNxoF8JlS4UQais3y215b"); NSLog(@"rLkeUFHdaKnzG0hC32vp"); NSLog(@"ud78tEC4qVzjfGo20MxaZk"); NSLog(@"51V2PRs4IgemnrhkobDFQS"); NSLog(@"QOoTMZ2Hd7Gq18jCe3WulcVm"); NSLog(@"oDdLnUc6RF3"); NSLog(@"XehbzWdQwvUL35FjIxZRuHEyf7BKAMTVSsYt"); NSLog(@"LQRj9Fkfs5HN48W"); NSLog(@"w30ExedR6FXVkHynhoNZDOAs9"); NSLog(@"oilA0bxFQ92zwsD3MRTOvfVGKt7ampJh48IHUPg"); NSLog(@"uMnHvAZYfJoUc8dESW96gzPq3KV"); } -(void)aZWw70p:(UIVisualEffectView*) aZWw70p abKQt65Vv:(UIVisualEffectView*) abKQt65Vv akSnOY:(UIBarButtonItem*) akSnOY ad3GrOiAS:(UIEvent*) ad3GrOiAS aM84unI:(UIControl*) aM84unI aWNZ93jqs:(UIBezierPath*) aWNZ93jqs aXTCIF:(UIInputView*) aXTCIF aCYqvTw:(UIBarButtonItem*) aCYqvTw ahUCzg:(UIImageView*) ahUCzg aLJBn:(UISearchBar*) aLJBn azOpv:(UIVisualEffectView*) azOpv af2HjK8pBLi:(UILabel*) af2HjK8pBLi a8ZCSAJU:(UITableView*) a8ZCSAJU { NSLog(@"LrVNT2QZOIadUD0AP3u8qcKimYS7e4tWMHs1Bf"); NSLog(@"WQjhX3mtrD2EKI0eH1VOTfaZsi"); NSLog(@"tWeVUGsrOCi4bjd1gFwnyuXNSf"); NSLog(@"54jUs7zGYcPw8v2yaMpteWFgbT9ZIQJdRqoCSLA"); NSLog(@"0W536ROdCnNpQjlDALUFqIcE1KoP8J2G4VrxbtZ"); NSLog(@"2Med8L4ROuqbVaXUjJxgTp"); NSLog(@"fXe9xIV3TStjs6LvB8KhRQNygrdUiDJE"); NSLog(@"Q4j9ZcBwpdtFE"); NSLog(@"QUBnzxKI0EfXljGgyDFaLw75ZWeCp3JtO2"); NSLog(@"Bg7W2zNblcP0ap94LQyKoGIexZwfCuOJjv683UY"); NSLog(@"SyniqasIF5R4LHObhkgmZJ7"); NSLog(@"PIVO7zhw0tKmMQ9GiscyCfFjS3Ab18JXq5oueWa"); NSLog(@"8kjnPT9eLHQi70w2ypcVDCO"); NSLog(@"ufTlchLDrQEy3"); NSLog(@"zK1XhoyPcGbT69w"); } -(void)aZYha9uvSe:(UIBarButtonItem*) aZYha9uvSe abN8D3sy:(UIImage*) abN8D3sy aQnuk:(UISearchBar*) aQnuk a5Nymx:(UIRegion*) a5Nymx axOGD1:(UIFont*) axOGD1 a5stafOz:(UIRegion*) a5stafOz aEQB6:(UIControlEvents*) aEQB6 abSJC0M1R3:(UIKeyCommand*) abSJC0M1R3 anJ86DUjRh:(UIFontWeight*) anJ86DUjRh akUMvXw7zE:(UISearchBar*) akUMvXw7zE aBgdK8T:(UIViewController*) aBgdK8T aSvo9Ej:(UIBarButtonItem*) aSvo9Ej aEGRiBlv8pO:(UIKeyCommand*) aEGRiBlv8pO aqOf2wrt:(UIKeyCommand*) aqOf2wrt aH7SgV:(UIKeyCommand*) aH7SgV a8Mueg9jVEn:(UIApplication*) a8Mueg9jVEn aouAQFaiZWL:(UIMenuItem*) aouAQFaiZWL arEti:(UIControlEvents*) arEti a5x7N:(UIImage*) a5x7N aUhCJS86La5:(UIColor*) aUhCJS86La5 { NSLog(@"CJ3avXAH4FgVehZc6xljz5WRbyG2ds8r1SLupnf"); NSLog(@"b3UWmQGaSuX9nzPgJqCAwHrLvkpdFiO0lTthD"); NSLog(@"dKhVNb2pBtgcLkDFP7GswOWqvlxfi6A3mo"); NSLog(@"fEx9myQdioThOwP"); NSLog(@"gkdJXjUB8S6PWC"); NSLog(@"AXY9fNS1kmjnwW"); NSLog(@"LIX6qP2t97vdTen0EzGaSBWVxOugfkAmjNU8lZw5"); NSLog(@"7QoTxAnieHROkvlB"); NSLog(@"PtzS7FkjqM62eExaLUoWfI1CrwYX9AiNJHK"); NSLog(@"AYCLx7fP6KdJwiFHVplZg1c"); NSLog(@"rUR2ISMmYzsO3C5yXxKTc9pg4uDZFGE"); } -(void)afCtQ2:(UILabel*) afCtQ2 argvWc:(UITableView*) argvWc aIYum8VqR:(UIBarButtonItem*) aIYum8VqR aLX6w:(UIKeyCommand*) aLX6w aYsbkO9:(UIInputView*) aYsbkO9 ac7xd:(UIRegion*) ac7xd aKfZXR:(UIView*) aKfZXR aqrK80:(UIMenuItem*) aqrK80 ax9h73:(UIMenuItem*) ax9h73 { NSLog(@"DSi0nYExcmQzj5UIWXV7NtF"); NSLog(@"Yl34Z0EozqaibTIwKdmvpOuR6XJGQW"); NSLog(@"qULH3ZzeGFio1XvCb0S845NudVIjg7yfnJhD"); NSLog(@"oHzmW2rLFdetGf49Nj1MhnDJpS6cZ0qRPC5iV3l"); NSLog(@"SRLCIXxPdBeupa3OMc2i57w9"); NSLog(@"qoxn0L6d4hBGTwMKVHcAtNr3"); NSLog(@"bTOaY2MAKi0BDnjC8QtRlq4Fu3XWp6fHd"); NSLog(@"VkbRA0KNymHfPgSvIuTlr2tUaOFi"); NSLog(@"qwG76Wl3hvmD2TAnSPXUcfKJ4"); NSLog(@"HXhS2Kru8cV4Nx3ljWGkdO0YTvA5"); NSLog(@"JyWtsZK3nr6mUB1FEvR"); NSLog(@"b7hSL9HxNG1Qj0TDFvowPdsMmErp38atiY5ReBq"); } @end