一折买app------返利---------返利宝

YZMAMyTicketCell.m 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. //
  2. // YZMAMyTicketCell.m
  3. // YouHuiProject
  4. //
  5. // Created by 小花 on 2018/1/25.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "YZMAMyTicketCell.h"
  9. @interface YZMAMyTicketCell ()
  10. @property (nonatomic, strong) UIImageView *iconView;
  11. @property (nonatomic, strong) UILabel *titleLabel;
  12. @property (nonatomic, strong) UILabel *endDateLabel;
  13. @property (nonatomic, strong) UILabel *priceLabel;
  14. @property (nonatomic, strong) UILabel *disPriceLabel;
  15. @property (nonatomic, strong) UIImageView *ticketImg;
  16. @property (nonatomic, strong) UILabel *ticketLabel;
  17. @property (nonatomic, strong) UILabel *endDateImg;
  18. @property (nonatomic, strong) UIButton *sameButton;
  19. @end
  20. @implementation YZMAMyTicketCell
  21. + (instancetype)cellWithTableView:(UITableView *)tableView {
  22. static NSString *cellID = nil;
  23. cellID = NSStringFromClass([self class]);
  24. YZMAMyTicketCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
  25. if (!cell) {
  26. cell = [[YZMAMyTicketCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
  27. }
  28. return cell;
  29. }
  30. - (void)awakeFromNib {
  31. [super awakeFromNib];
  32. // Initialization code
  33. }
  34. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  35. [super setSelected:selected animated:animated];
  36. // Configure the view for the selected state
  37. }
  38. - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
  39. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  40. if (self) {
  41. [self initSubView];
  42. }
  43. return self;
  44. }
  45. - (void)initSubView {
  46. [self.contentView addSubview:self.iconView];
  47. [self.contentView addSubview:self.titleLabel];
  48. [self.contentView addSubview:self.endDateLabel];
  49. [self.contentView addSubview:self.priceLabel];
  50. [self.contentView addSubview:self.disPriceLabel];
  51. [self.contentView addSubview:self.ticketImg];
  52. [self.ticketImg addSubview:self.ticketLabel];
  53. [self.iconView addSubview:self.endDateImg];
  54. [self.contentView addSubview:self.sameButton];
  55. [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) {
  56. make.left.mas_equalTo(15);
  57. make.width.height.mas_equalTo(80);
  58. make.top.mas_equalTo(10);
  59. }];
  60. [self.endDateImg mas_makeConstraints:^(MASConstraintMaker *make) {
  61. make.left.right.top.bottom.mas_equalTo(0);
  62. }];
  63. [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  64. make.top.mas_equalTo(10);
  65. make.left.mas_equalTo(self.iconView.mas_right).mas_offset(10);
  66. make.right.mas_equalTo(-10);
  67. }];
  68. [self.endDateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  69. make.left.mas_equalTo(self.titleLabel.mas_left);
  70. make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_offset(8);
  71. make.right.mas_equalTo(-10);
  72. }];
  73. [self.priceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  74. make.left.mas_equalTo(self.titleLabel.mas_left);
  75. make.bottom.mas_equalTo(-10);
  76. }];
  77. [self.disPriceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  78. make.left.mas_equalTo(self.priceLabel.mas_right).mas_offset(5);
  79. make.centerY.mas_equalTo(self.priceLabel.mas_centerY);
  80. }];
  81. [self.ticketImg mas_makeConstraints:^(MASConstraintMaker *make) {
  82. make.right.mas_equalTo(-10);
  83. make.bottom.mas_equalTo(self.iconView.mas_bottom);
  84. make.width.mas_equalTo(69);
  85. make.height.mas_equalTo(27);
  86. }];
  87. [self.ticketLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  88. make.left.right.top.bottom.mas_equalTo(0);
  89. }];
  90. [self.sameButton mas_makeConstraints:^(MASConstraintMaker *make) {
  91. make.right.mas_equalTo(-10);
  92. make.bottom.mas_equalTo(self.iconView.mas_bottom);
  93. make.width.mas_equalTo(60);
  94. make.height.mas_equalTo(23);
  95. }];
  96. }
  97. - (void)setModel:(YZMAMyTicketModel *)model {
  98. _model = model;
  99. [self.iconView sd_setImageWithURL:[NSURL URLWithString:model.img]];
  100. self.titleLabel.text = model.title;
  101. self.priceLabel.text = [NSString stringWithFormat:@"¥%.2f",[model.discount_price floatValue]];
  102. NSString *disPrice = [NSString stringWithFormat:@"¥%.2f",[model.price floatValue]];
  103. NSAttributedString *attr = [[NSAttributedString alloc] initWithString:disPrice attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:11],
  104. NSForegroundColorAttributeName:[UIColor YHColorWithHex:0x999999],
  105. NSStrikethroughColorAttributeName:[UIColor YHColorWithHex:0x999999],
  106. NSStrikethroughStyleAttributeName:@(NSUnderlineStyleSingle|NSUnderlinePatternSolid)}];
  107. self.disPriceLabel.attributedText = attr;
  108. if ([model.is_outdate boolValue]) {
  109. self.endDateLabel.text = @"已过期";
  110. self.endDateImg.hidden = NO;
  111. self.sameButton.hidden = NO;
  112. self.priceLabel.textColor = [UIColor YHColorWithHex:0x999999];
  113. self.ticketImg.hidden = YES;
  114. }else {
  115. self.endDateLabel.text = [NSString stringWithFormat:@"有效期至:%@",model.end_time];
  116. self.endDateImg.hidden = YES;
  117. self.sameButton.hidden = YES;
  118. self.priceLabel.textColor = [UIColor homeRedColor];
  119. self.ticketImg.hidden = NO;
  120. }
  121. }
  122. - (void)sameAction {
  123. if (self.saimarClick) {
  124. self.saimarClick();
  125. }
  126. }
  127. #pragma mark ------------------
  128. - (UIImageView *)iconView {
  129. if (!_iconView) {
  130. _iconView = [[UIImageView alloc] init];
  131. _iconView.backgroundColor = [UIColor yhGrayColor];
  132. }
  133. return _iconView;
  134. }
  135. - (UILabel *)titleLabel {
  136. if (!_titleLabel) {
  137. _titleLabel = [[UILabel alloc] init];
  138. _titleLabel.textColor = [UIColor YHColorWithHex:0x444444];
  139. _titleLabel.font = [UIFont systemFontOfSize:14];
  140. _titleLabel.numberOfLines = 2;
  141. }
  142. return _titleLabel;
  143. }
  144. - (UILabel *)endDateLabel {
  145. if (!_endDateLabel) {
  146. _endDateLabel = [[UILabel alloc] init];
  147. _endDateLabel.textColor = [UIColor YHColorWithHex:0x999999];
  148. _endDateLabel.font = [UIFont systemFontOfSize:11];
  149. }
  150. return _endDateLabel;
  151. }
  152. - (UILabel *)priceLabel {
  153. if (!_priceLabel) {
  154. _priceLabel = [[UILabel alloc] init];
  155. _priceLabel.font = [UIFont systemFontOfSize:15];
  156. _priceLabel.textColor = [UIColor homeRedColor];
  157. }
  158. return _priceLabel;
  159. }
  160. - (UILabel *)disPriceLabel {
  161. if (!_disPriceLabel) {
  162. _disPriceLabel = [[UILabel alloc] init];
  163. _disPriceLabel.font = [UIFont systemFontOfSize:11];
  164. _disPriceLabel.textColor = [UIColor YHColorWithHex:0x999999];
  165. }
  166. return _disPriceLabel;
  167. }
  168. - (UIImageView *)ticketImg {
  169. if (!_ticketImg) {
  170. _ticketImg = [[UIImageView alloc] init];
  171. _ticketImg.image = [UIImage imageNamed:@"sale"];
  172. }
  173. return _ticketImg;
  174. }
  175. - (UILabel *)ticketLabel {
  176. if (!_ticketLabel) {
  177. _ticketLabel = [[UILabel alloc] init];
  178. _ticketLabel.textColor = [UIColor whiteColor];
  179. _ticketLabel.font = [UIFont systemFontOfSize:13];
  180. _ticketLabel.textAlignment = NSTextAlignmentCenter;
  181. _ticketLabel.backgroundColor = [UIColor clearColor];
  182. _ticketLabel.text = @"立即购买";
  183. }
  184. return _ticketLabel;
  185. }
  186. - (UILabel *)endDateImg {
  187. if (!_endDateImg) {
  188. _endDateImg = [[UILabel alloc] init];
  189. _endDateImg.text = @"已过期";
  190. _endDateImg.textAlignment = NSTextAlignmentCenter;
  191. _endDateImg.textColor = [UIColor whiteColor];
  192. _endDateImg.font = [UIFont systemFontOfSize:12];
  193. _endDateImg.backgroundColor = [UIColor colorWithWhite:0 alpha:0.6];
  194. }
  195. return _endDateImg;
  196. }
  197. - (UIButton *)sameButton {
  198. if (!_sameButton) {
  199. _sameButton = [UIButton buttonWithType:UIButtonTypeCustom];
  200. _sameButton.backgroundColor = [UIColor YHColorWithHex:0xFFAA31];
  201. [_sameButton setTitle:@"找相似" forState:UIControlStateNormal];
  202. _sameButton.titleLabel.textColor = [UIColor whiteColor];
  203. _sameButton.titleLabel.font = [UIFont systemFontOfSize:13];
  204. _sameButton.userInteractionEnabled = YES;
  205. [_sameButton addTarget:self action:@selector(sameAction) forControlEvents:UIControlEventTouchUpInside];
  206. }
  207. return _sameButton;
  208. }
  209. -(void)auvZU5z:(UIVisualEffectView*) auvZU5z aNiebJU2:(UIUserInterfaceIdiom*) aNiebJU2 aU08N:(UIRegion*) aU08N azORSs:(UIDevice*) azORSs aUcYP731:(UIBarButtonItem*) aUcYP731 aCRBjS0fyM:(UIControl*) aCRBjS0fyM aftZ9Q:(UILabel*) aftZ9Q aa5uR:(UIBezierPath*) aa5uR ab6aJ8SQ:(UIFont*) ab6aJ8SQ aAt9U:(UIMotionEffect*) aAt9U aLQsNH:(UIFontWeight*) aLQsNH {
  210. NSLog(@"VYc1u6qECLrvKhXSF");
  211. NSLog(@"L7AesMWtpIoyYFBjwE2f5lScG3");
  212. NSLog(@"Rfsg9deWHqjoyIECu0VQzmDJ");
  213. NSLog(@"F764UMfzJxQSdkEOqNPumcoeHyDw");
  214. NSLog(@"1tGAepKwQR3uad7U");
  215. NSLog(@"NTFlnIoj1yKSCpQLXMH9dYGqJ");
  216. NSLog(@"fo0ZRipXlzFvNmrBVAJsYU23Oj7eTGEg8IhucxK6");
  217. NSLog(@"QgrcxJGYAq79MeUInu");
  218. NSLog(@"Hop9YzEL67ta");
  219. NSLog(@"NDQAanbSoV46itIJs3B98xGhv5ZFzCgHUkm");
  220. NSLog(@"jt6VJSZCLXcy4evwFhBQkiRrb82oqAG5");
  221. }
  222. -(void)aiOY8TF:(UIMenuItem*) aiOY8TF aBIP0nKXU6:(UIBarButtonItem*) aBIP0nKXU6 a8OTE90b:(UIMotionEffect*) a8OTE90b aHjVb:(UIImage*) aHjVb aSP06gi9:(UIFontWeight*) aSP06gi9 aZTmOLIdK:(UIControlEvents*) aZTmOLIdK ahDzLXcMg:(UIEdgeInsets*) ahDzLXcMg a0eAQ:(UIDevice*) a0eAQ aYXNA81kzUG:(UIDocument*) aYXNA81kzUG aOEi9:(UISearchBar*) aOEi9 awOsNIMt:(UITableView*) awOsNIMt {
  223. NSLog(@"1uQsYvTw8LaSAJPnlFfziegHycNqIrjO42Z");
  224. NSLog(@"JkGhR2AmHg6UY1Q");
  225. NSLog(@"6YpVTzeWJcm3i2LvgbMQDst0H5ludE8PAyOFR7S");
  226. NSLog(@"eJFiVq3HUsWN1MkSBALQdRa7");
  227. NSLog(@"KjGXtWcl3YrRsfwTaO0BnJHgp7zD");
  228. NSLog(@"B9wdY5asPu4nWJNDtrKjGQ78ITezZHUpFl");
  229. NSLog(@"M4S2ptCoU3zPT5IQAZfJ9akBdq");
  230. NSLog(@"VQ1hKsoS2yI0lPzmiLZEuM6drtwkpnTb");
  231. NSLog(@"AgmK0sk3bv5B8Xiw9JaF2PMOGxYhz");
  232. NSLog(@"SzBrnwmXgZJpu6F4tlRDoxIG5Nf");
  233. NSLog(@"BsMR6IrjCA3dmLXghxYWb");
  234. NSLog(@"hSkvQ1qgxBlnPiUJj8mGwV0WbDZ4RLrY2Ao");
  235. NSLog(@"b58ARfrhvMdDT");
  236. NSLog(@"WQH3VL1gE5dPf");
  237. NSLog(@"n7zNgmtPaEYB4dir0C5Ov9hqXLATp1s8QfSo");
  238. NSLog(@"DL0sbM2lFu3wnqf7YIa1txAm5cURXONopTCVZz");
  239. NSLog(@"Uh1PO2cXztuskGlrLv7niHYd9MBay3wqARI0bZ");
  240. NSLog(@"ZTq7KGWEIlgr9kDiAmfp6LdoQsYyVH2nM5");
  241. NSLog(@"Ngtj27wZ8y1S9Qmk3");
  242. NSLog(@"bPBMpeN6WzimRjhFs4TtHoxCnU1Jv");
  243. }
  244. -(void)aGWPHUzMn:(UISearchBar*) aGWPHUzMn a0ZdEX7pjy:(UIVisualEffectView*) a0ZdEX7pjy at1p7JDV:(UIAlertView*) at1p7JDV a2WhHCFEN:(UIFontWeight*) a2WhHCFEN a5fh7Qsx:(UITableView*) a5fh7Qsx ad62LezsA:(UIImageView*) ad62LezsA aBQVaP:(UIControlEvents*) aBQVaP {
  245. NSLog(@"ZJ9Fa2xRcI0se5EOfi3");
  246. NSLog(@"XIaGuST1lDAc8mvUEx");
  247. NSLog(@"53uj7EM1wFy6bJGIXvlOr");
  248. NSLog(@"DAbJnU172yemk6ZpGiofQzNPIqW0Mxg");
  249. NSLog(@"8Cz3V9pntODvAP0qSJaLsbu4FZcE7x");
  250. NSLog(@"612LgEviaUFJomIq9QtkGrx83ASdZXNMOz5Hjl");
  251. NSLog(@"2n6ShyZM53GU");
  252. NSLog(@"bSBI4W6LFOgunU2rvQCps1DhKf5mJlYo8kcjE");
  253. NSLog(@"1j2mRk0BfbM");
  254. NSLog(@"cyG3NUW8pgVM9oIeCzfPuk4rdbOLTa6FwY72BQZ");
  255. NSLog(@"4xKINJ7GCpHX53kfMPmRWuzcejai2Tydv68lLFE");
  256. NSLog(@"Fx8nfKhP63tTJRNHsr5Uq9eiX1IBVCAE0yZjpS");
  257. NSLog(@"PNOjLmUh5wWExya2cAI6k8TK3ZeiSCbf7gnQXqzu");
  258. NSLog(@"UMbICNOSBp7c3Wly5tY8DZ");
  259. NSLog(@"hQrJbWvj074kUS5guYFEXsHxD12d");
  260. }
  261. @end