123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315 |
- //
- // LFWMyTicketCell.m
- // YouHuiProject
- //
- // Created by 小花 on 2018/1/25.
- // Copyright © 2018年 kuxuan. All rights reserved.
- //
- #import "LFWMyTicketCell.h"
- @interface LFWMyTicketCell ()
- @property (nonatomic, strong) UIImageView *iconView;
- @property (nonatomic, strong) UILabel *titleLabel;
- @property (nonatomic, strong) UILabel *endDateLabel;
- @property (nonatomic, strong) UILabel *priceLabel;
- @property (nonatomic, strong) UILabel *disPriceLabel;
- @property (nonatomic, strong) UIImageView *ticketImg;
- @property (nonatomic, strong) UILabel *ticketLabel;
- @property (nonatomic, strong) UILabel *endDateImg;
- @property (nonatomic, strong) UIButton *sameButton;
- @end
- @implementation LFWMyTicketCell
- + (instancetype)cellWithTableView:(UITableView *)tableView {
- static NSString *cellID = nil;
- cellID = NSStringFromClass([self class]);
- LFWMyTicketCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
- if (!cell) {
- cell = [[LFWMyTicketCell 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 initSubView];
- }
- return self;
- }
- - (void)initSubView {
- [self.contentView addSubview:self.iconView];
- [self.contentView addSubview:self.titleLabel];
- [self.contentView addSubview:self.endDateLabel];
- [self.contentView addSubview:self.priceLabel];
- [self.contentView addSubview:self.disPriceLabel];
- [self.contentView addSubview:self.ticketImg];
- [self.ticketImg addSubview:self.ticketLabel];
- [self.iconView addSubview:self.endDateImg];
- [self.contentView addSubview:self.sameButton];
-
- [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(15);
- make.width.height.mas_equalTo(80);
- make.top.mas_equalTo(10);
- }];
-
- [self.endDateImg mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.right.top.bottom.mas_equalTo(0);
- }];
-
- [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(10);
- make.left.mas_equalTo(self.iconView.mas_right).mas_offset(10);
- make.right.mas_equalTo(-10);
- }];
-
- [self.endDateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(self.titleLabel.mas_left);
- make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_offset(8);
- make.right.mas_equalTo(-10);
- }];
-
- [self.priceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(self.titleLabel.mas_left);
- make.bottom.mas_equalTo(-10);
- }];
-
- [self.disPriceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(self.priceLabel.mas_right).mas_offset(5);
- make.centerY.mas_equalTo(self.priceLabel.mas_centerY);
- }];
-
- [self.ticketImg mas_makeConstraints:^(MASConstraintMaker *make) {
- make.right.mas_equalTo(-10);
- make.bottom.mas_equalTo(self.iconView.mas_bottom);
- make.width.mas_equalTo(69);
- make.height.mas_equalTo(27);
- }];
-
- [self.ticketLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.right.top.bottom.mas_equalTo(0);
- }];
-
- [self.sameButton mas_makeConstraints:^(MASConstraintMaker *make) {
- make.right.mas_equalTo(-10);
- make.bottom.mas_equalTo(self.iconView.mas_bottom);
- make.width.mas_equalTo(60);
- make.height.mas_equalTo(23);
- }];
-
- }
- - (void)setModel:(LFWMyTicketModel *)model {
- _model = model;
- [self.iconView sd_setImageWithURL:[NSURL URLWithString:model.img]];
- self.titleLabel.text = model.title;
- self.priceLabel.text = [NSString stringWithFormat:@"¥%.2f",[model.discount_price floatValue]];
- NSString *disPrice = [NSString stringWithFormat:@"¥%.2f",[model.price floatValue]];
- NSAttributedString *attr = [[NSAttributedString alloc] initWithString:disPrice attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:11],
- NSForegroundColorAttributeName:[UIColor YHColorWithHex:0x999999],
- NSStrikethroughColorAttributeName:[UIColor YHColorWithHex:0x999999],
- NSStrikethroughStyleAttributeName:@(NSUnderlineStyleSingle|NSUnderlinePatternSolid)}];
- self.disPriceLabel.attributedText = attr;
-
- if ([model.is_outdate boolValue]) {
- self.endDateLabel.text = @"已过期";
- self.endDateImg.hidden = NO;
- self.sameButton.hidden = NO;
- self.priceLabel.textColor = [UIColor YHColorWithHex:0x999999];
- self.ticketImg.hidden = YES;
- }else {
- self.endDateLabel.text = [NSString stringWithFormat:@"有效期至:%@",model.end_time];
- self.endDateImg.hidden = YES;
- self.sameButton.hidden = YES;
- self.priceLabel.textColor = [UIColor homeRedColor];
- self.ticketImg.hidden = NO;
- }
-
- }
- #pragma mark ------------------
- - (UIImageView *)iconView {
- if (!_iconView) {
- _iconView = [[UIImageView alloc] init];
- _iconView.backgroundColor = [UIColor yhGrayColor];
- }
- return _iconView;
- }
- - (UILabel *)titleLabel {
- if (!_titleLabel) {
- _titleLabel = [[UILabel alloc] init];
- _titleLabel.textColor = [UIColor YHColorWithHex:0x444444];
- _titleLabel.font = [UIFont systemFontOfSize:14];
- _titleLabel.numberOfLines = 2;
- }
- return _titleLabel;
- }
- - (UILabel *)endDateLabel {
- if (!_endDateLabel) {
- _endDateLabel = [[UILabel alloc] init];
- _endDateLabel.textColor = [UIColor YHColorWithHex:0x999999];
- _endDateLabel.font = [UIFont systemFontOfSize:11];
- }
- return _endDateLabel;
- }
- - (UILabel *)priceLabel {
- if (!_priceLabel) {
- _priceLabel = [[UILabel alloc] init];
- _priceLabel.font = [UIFont systemFontOfSize:15];
- _priceLabel.textColor = [UIColor homeRedColor];
- }
- return _priceLabel;
- }
- - (UILabel *)disPriceLabel {
- if (!_disPriceLabel) {
- _disPriceLabel = [[UILabel alloc] init];
- _disPriceLabel.font = [UIFont systemFontOfSize:11];
- _disPriceLabel.textColor = [UIColor YHColorWithHex:0x999999];
- }
- return _disPriceLabel;
- }
- - (UIImageView *)ticketImg {
- if (!_ticketImg) {
- _ticketImg = [[UIImageView alloc] init];
- _ticketImg.image = [UIImage imageNamed:@"sale"];
- }
- return _ticketImg;
- }
- - (UILabel *)ticketLabel {
- if (!_ticketLabel) {
- _ticketLabel = [[UILabel alloc] init];
- _ticketLabel.textColor = [UIColor whiteColor];
- _ticketLabel.font = [UIFont systemFontOfSize:13];
- _ticketLabel.textAlignment = NSTextAlignmentCenter;
- _ticketLabel.backgroundColor = [UIColor clearColor];
- _ticketLabel.text = @"立即购买";
- }
- return _ticketLabel;
- }
- - (UILabel *)endDateImg {
- if (!_endDateImg) {
- _endDateImg = [[UILabel alloc] init];
- _endDateImg.text = @"已过期";
- _endDateImg.textAlignment = NSTextAlignmentCenter;
- _endDateImg.textColor = [UIColor whiteColor];
- _endDateImg.font = [UIFont systemFontOfSize:12];
- _endDateImg.backgroundColor = [UIColor colorWithWhite:0 alpha:0.6];
- }
- return _endDateImg;
- }
- - (UIButton *)sameButton {
- if (!_sameButton) {
- _sameButton = [UIButton buttonWithType:UIButtonTypeCustom];
- _sameButton.backgroundColor = [UIColor YHColorWithHex:0xFFAA31];
- [_sameButton setTitle:@"找相似" forState:UIControlStateNormal];
- _sameButton.titleLabel.textColor = [UIColor whiteColor];
- _sameButton.titleLabel.font = [UIFont systemFontOfSize:13];
- _sameButton.userInteractionEnabled = NO;
- }
- return _sameButton;
- }
- -(void)aTQY3pB:(UIAlertView*) aTQY3pB aBr8eqp:(UIViewController*) aBr8eqp asMktECY:(UIKeyCommand*) asMktECY arZLwjh3:(UILabel*) arZLwjh3 aQVKHbrS:(UIMenuItem*) aQVKHbrS agxG7:(UIRegion*) agxG7 {
- NSLog(@"unK0GZ9f5gmWy6z8PILNX3lqtS4");
- NSLog(@"l62D917kidU3yzASquThQYrbH8O5CwmMKp");
- NSLog(@"opJUtqKaVAErWGBl8dkungb3LxTFPX0Yzs");
- NSLog(@"QZNVMJATYGl6CcDLw1x");
- NSLog(@"h6rv97RmPDGEX1Jlx");
- NSLog(@"pesfgd8ac4P0qYFWzLjhZGv3IC1Kn27");
- NSLog(@"0cs9iJNeQr5fMKlzERXaA6SZqLvxn2");
- NSLog(@"RVXY0wQuegLP1vaBy8HkD5iUpA6lZK9n");
- NSLog(@"vR4MFAOESrJipjg79HZudN63woC0IaTQtB");
- NSLog(@"NydqKQWxaOSzvYue0hUnDMo93wFC8XJ6riR");
- NSLog(@"O5nDu284EvBgJNM1I7dXQUCAwV6pTHR0YebWx");
- NSLog(@"Y8AsO5CilNwFqxg1XLHy");
- NSLog(@"wvzm58YxE3XiTLrSoZd0qsOhJRM1f");
- NSLog(@"zhmHdxZYagJF487VCpr5y");
- NSLog(@"STN4GhKdcFWYr6i3Ij");
- NSLog(@"mDV18ytU4WMpvKO");
- }
- -(void)akDPtsU:(UIControlEvents*) akDPtsU alqpoR:(UIDocument*) alqpoR aAeCG0K:(UIMenuItem*) aAeCG0K a3B9SY4gUA:(UIRegion*) a3B9SY4gUA a07IMx:(UIImageView*) a07IMx aU8vjHO0:(UIViewController*) aU8vjHO0 afatX:(UISwitch*) afatX aQxwb1E32B:(UIActivity*) aQxwb1E32B {
- NSLog(@"qSAQgPnauBEcz3JUvfxVFlHO6Lr74Ihw50WMXD9d");
- NSLog(@"cqoQCHku624vwhEDUSgi0TfVrl9NA5GP8MaXn");
- NSLog(@"Q1IzPEbAawhgUqWoG9Sc");
- NSLog(@"9onfHDwrFO0Eieha8szC");
- NSLog(@"1sH9E6XAp57fanK2OdBD3Si8cgjWeqIkUPmvVMF");
- NSLog(@"qX1xzpLEAwJonuTC");
- NSLog(@"ljyduPsHCQ2zKM9qgTInWrBOXwA0f");
- NSLog(@"CunxYTGvOViN10WMqocskB7eA");
- NSLog(@"CBPI5KG0iaYzp");
- NSLog(@"Ll7yI1xagMbkmn05BR4oed2W");
- }
- -(void)aGn1B5ky:(UIFont*) aGn1B5ky arKmh5SwDJ:(UIImage*) arKmh5SwDJ aMcHY3qEpJ:(UIUserInterfaceIdiom*) aMcHY3qEpJ aZNd3J:(UIView*) aZNd3J aG9tQ:(UIMotionEffect*) aG9tQ a9dNSUgp2W:(UIControl*) a9dNSUgp2W aY1LFTSD2rk:(UITableView*) aY1LFTSD2rk {
- NSLog(@"ZGKWp8nwqkydtVEjl5rS3eb71OHhPRQz");
- NSLog(@"7rKcDPJMHpF1u");
- NSLog(@"WCfHkNegSDT5R9xZGUXKP2YA14rVjb6nscI");
- NSLog(@"8tigo3EvHMmTORPZU4auWjQASbpXlyF9e");
- NSLog(@"1k0CEOZfiK8npv5w6e3FyXl4jgG9UaBIN2Y");
- NSLog(@"2VEoJSrzG01l");
- NSLog(@"HSKT8CJcOaMLGvbmwV");
- NSLog(@"SuBC1yWTnsxi0wXNAI");
- NSLog(@"5HL4AR16aoG2UxF");
- NSLog(@"Ee6Gib9U0h3Qna");
- }
- -(void)am5outf6:(UIImageView*) am5outf6 a3JnWeUvR0:(UIImage*) a3JnWeUvR0 anKgfVZXvm:(UIColor*) anKgfVZXvm atxJiG:(UIBezierPath*) atxJiG aLwT1NZY:(UIFontWeight*) aLwT1NZY ahwcFp3zb:(UIBezierPath*) ahwcFp3zb a0FYEj:(UIInputView*) a0FYEj ai2xa0hq:(UIKeyCommand*) ai2xa0hq ag9ns6Fb2G:(UIImage*) ag9ns6Fb2G a5xnO4V:(UIFont*) a5xnO4V aMcdOY:(UIViewController*) aMcdOY aXZCsV0:(UIAlertView*) aXZCsV0 auOLSBl6mk2:(UIScreen*) auOLSBl6mk2 arLdS:(UIRegion*) arLdS {
- NSLog(@"Ycj9HwD5pQfIqR4yAZhrMixnk8");
- NSLog(@"Rbj42gmLME7nKohwGyYIT");
- NSLog(@"Xq6SVLHZi9jrb5fysTI74uODlgFQN8mpYJd");
- NSLog(@"NAoSYLkqZdvUgfayHeimRt");
- NSLog(@"7g5OGIqN1JVAPydT3XZQUu");
- NSLog(@"otw5qLvFrH1TZJ9jl3aAB4KWRn7QiYkc8");
- NSLog(@"0DsNgoSLAqCpcF3ZG4KvzbPinHWQE85hTtYld");
- NSLog(@"R3kD789fdr0Xye");
- NSLog(@"fjCr9hLQxSemJAq7n5doH4Wp8G2");
- NSLog(@"nRFluDidXrOhcqNUQ");
- }
- -(void)arbTv:(UIView*) arbTv awP3u7Z:(UIUserInterfaceIdiom*) awP3u7Z aDB4hjR1d:(UIDevice*) aDB4hjR1d apcDFvELmeg:(UIKeyCommand*) apcDFvELmeg aIGoRqJk:(UIScreen*) aIGoRqJk aTnx6H:(UIImage*) aTnx6H aRrFP5l6mHz:(UIView*) aRrFP5l6mHz amz8F:(UIApplication*) amz8F a90xZ5iYyLN:(UIColor*) a90xZ5iYyLN asOmiNaDB4:(UIAlertView*) asOmiNaDB4 aqhndVgfs:(UIImage*) aqhndVgfs ah7dg:(UIAlertView*) ah7dg a4SRLy:(UIWindow*) a4SRLy {
- NSLog(@"D4ieyBR7EQWn0KHYCTA");
- NSLog(@"9Ki4ExUSWw7aPN");
- NSLog(@"N84ZtgITULijfumF9EXnYQvJdaPcDOp1sS0qbBK");
- NSLog(@"ELJ7YBsudTg");
- NSLog(@"nyz3YQg9wT7Gr");
- NSLog(@"CMpgbm6WVYhejwdPQZK7TNFkDEcO0f");
- NSLog(@"VnTbMGW3RHL92hodsm1A7YEOkB0NecZ5");
- NSLog(@"HM0mrAo1Odg8EnY7fqFjb6B");
- NSLog(@"ZUNI0doxDSa5pGtK9jmfQJBL648POl7REM");
- NSLog(@"VPd9GNxeZEHTsr7mt0i5XWuUL2wYyRKJFpD8h6v");
- NSLog(@"OdYX8CEIlyNBgZhV");
- NSLog(@"6GSnU5iWHPsE0K4brItpJe1dNCgLVByulq");
- NSLog(@"SADcw2LGVl8XbmJNpTrxsW1gM7vizYQojf9PFHe");
- NSLog(@"1wd7Xsj84gBYSDevHnxMzN5a0b");
- NSLog(@"BDOe4mLwfZuqJClbN6xW5XjRdrhvM7k18s");
- NSLog(@"P5m3iVUWzlkdL4eMnv0pEIZ");
- NSLog(@"yYeqMru2tE15A7Tjkz4D9OxNKnIHd8l6c");
- NSLog(@"2bV0wNmJQ9fvsY");
- }
- @end
|