Açıklama Yok

LFWCollectionTicketCell.m 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. //
  2. // LFWCollectionTicketCell.m
  3. // YouHuiProject
  4. //
  5. // Created by 小花 on 2018/1/24.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "LFWCollectionTicketCell.h"
  9. @interface LFWCollectionTicketCell ()
  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 *outTimeLabel;
  18. @property (nonatomic, strong) UIButton *sameButton;
  19. @end
  20. @implementation LFWCollectionTicketCell
  21. + (instancetype)cellWithTableView:(UITableView *)tableView {
  22. static NSString *cellID = nil;
  23. cellID = NSStringFromClass([self class]);
  24. LFWCollectionTicketCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
  25. if (!cell) {
  26. cell = [[LFWCollectionTicketCell 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.contentView addSubview:self.sameButton];
  53. [self.ticketImg addSubview:self.ticketLabel];
  54. [self.iconView addSubview:self.outTimeLabel];
  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.outTimeLabel 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(60);
  85. make.height.mas_equalTo(20);
  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:(LFWCollectionModel *)model {
  98. _model = model;
  99. [_iconView sd_setImageWithURL:[NSURL URLWithString:model.img]];
  100. self.titleLabel.text = model.title;
  101. self.outTimeLabel.hidden = ![model.is_outdate boolValue];
  102. self.ticketImg.hidden = [model.is_outdate boolValue];
  103. self.sameButton.hidden = ![model.is_outdate boolValue];
  104. self.endDateLabel.text = [NSString stringWithFormat:@"到期时间:%@",model.end_time];
  105. self.priceLabel.text = [NSString stringWithFormat:@"¥%.2f",[model.discount_price floatValue]];
  106. NSString *disPrice = [NSString stringWithFormat:@"¥%.2f",[model.price floatValue]];
  107. NSAttributedString *attr = [[NSAttributedString alloc] initWithString:disPrice attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:11],
  108. NSForegroundColorAttributeName:[UIColor YHColorWithHex:0x999999],
  109. NSStrikethroughColorAttributeName:[UIColor YHColorWithHex:0x999999],
  110. NSStrikethroughStyleAttributeName:@(NSUnderlineStyleSingle|NSUnderlinePatternSolid)}];
  111. self.disPriceLabel.attributedText = attr;
  112. self.ticketLabel.text = [NSString stringWithFormat:@"%@元券",model.coupon_price];
  113. }
  114. - (void)setHistoryModel:(LFWHistoryModel *)historyModel {
  115. _historyModel = historyModel;
  116. [_iconView sd_setImageWithURL:[NSURL URLWithString:historyModel.img]];
  117. self.titleLabel.text = historyModel.title;
  118. BOOL isOutTime = [PublicFunction isOuttimeDate:historyModel.end_time];
  119. self.outTimeLabel.hidden = !isOutTime;
  120. self.ticketImg.hidden = isOutTime;
  121. self.sameButton.hidden = !isOutTime;
  122. self.endDateLabel.text = [NSString stringWithFormat:@"到期时间:%@",historyModel.end_time];
  123. self.priceLabel.text = [NSString stringWithFormat:@"¥%.2f",[historyModel.discount_price floatValue]];
  124. NSString *disPrice = [NSString stringWithFormat:@"¥%.2f",[historyModel.price floatValue]];
  125. NSAttributedString *attr = [[NSAttributedString alloc] initWithString:disPrice attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:11],
  126. NSForegroundColorAttributeName:[UIColor YHColorWithHex:0x999999],
  127. NSStrikethroughColorAttributeName:[UIColor YHColorWithHex:0x999999],
  128. NSStrikethroughStyleAttributeName:@(NSUnderlineStyleSingle|NSUnderlinePatternSolid)}];
  129. self.disPriceLabel.attributedText = attr;
  130. self.ticketLabel.text = [NSString stringWithFormat:@"%@元券",historyModel.coupon_price];
  131. }
  132. /**
  133. 找相似
  134. */
  135. - (void)findSamiliar {
  136. if (self.similarClick) {
  137. self.similarClick();
  138. }
  139. }
  140. #pragma mark ------------------
  141. - (UIImageView *)iconView {
  142. if (!_iconView) {
  143. _iconView = [[UIImageView alloc] init];
  144. _iconView.backgroundColor = [UIColor yhGrayColor];
  145. }
  146. return _iconView;
  147. }
  148. - (UILabel *)titleLabel {
  149. if (!_titleLabel) {
  150. _titleLabel = [[UILabel alloc] init];
  151. _titleLabel.textColor = [UIColor YHColorWithHex:0x444444];
  152. _titleLabel.font = [UIFont systemFontOfSize:14];
  153. _titleLabel.numberOfLines = 2;
  154. }
  155. return _titleLabel;
  156. }
  157. - (UILabel *)endDateLabel {
  158. if (!_endDateLabel) {
  159. _endDateLabel = [[UILabel alloc] init];
  160. _endDateLabel.textColor = [UIColor YHColorWithHex:0x999999];
  161. _endDateLabel.font = [UIFont systemFontOfSize:11];
  162. }
  163. return _endDateLabel;
  164. }
  165. - (UILabel *)priceLabel {
  166. if (!_priceLabel) {
  167. _priceLabel = [[UILabel alloc] init];
  168. _priceLabel.font = [UIFont systemFontOfSize:15];
  169. _priceLabel.textColor = [UIColor homeRedColor];
  170. }
  171. return _priceLabel;
  172. }
  173. - (UILabel *)disPriceLabel {
  174. if (!_disPriceLabel) {
  175. _disPriceLabel = [[UILabel alloc] init];
  176. _disPriceLabel.font = [UIFont systemFontOfSize:11];
  177. _disPriceLabel.textColor = [UIColor YHColorWithHex:0x999999];
  178. }
  179. return _disPriceLabel;
  180. }
  181. - (UIImageView *)ticketImg {
  182. if (!_ticketImg) {
  183. _ticketImg = [[UIImageView alloc] init];
  184. _ticketImg.image = [UIImage imageNamed:@"sale"];
  185. }
  186. return _ticketImg;
  187. }
  188. - (UILabel *)ticketLabel {
  189. if (!_ticketLabel) {
  190. _ticketLabel = [[UILabel alloc] init];
  191. _ticketLabel.textColor = [UIColor whiteColor];
  192. _ticketLabel.font = [UIFont systemFontOfSize:14];
  193. _ticketLabel.textAlignment = NSTextAlignmentCenter;
  194. _ticketLabel.backgroundColor = [UIColor clearColor];
  195. }
  196. return _ticketLabel;
  197. }
  198. - (UILabel *)outTimeLabel {
  199. if (!_outTimeLabel) {
  200. _outTimeLabel = [[UILabel alloc] init];
  201. _outTimeLabel.text = @"已过期";
  202. _outTimeLabel.textAlignment = NSTextAlignmentCenter;
  203. _outTimeLabel.textColor = [UIColor whiteColor];
  204. _outTimeLabel.font = [UIFont systemFontOfSize:12];
  205. _outTimeLabel.backgroundColor = [UIColor colorWithWhite:0 alpha:0.6];
  206. }
  207. return _outTimeLabel;
  208. }
  209. - (UIButton *)sameButton {
  210. if (!_sameButton) {
  211. _sameButton = [UIButton buttonWithType:UIButtonTypeCustom];
  212. _sameButton.backgroundColor = [UIColor YHColorWithHex:0xFFAA31];
  213. [_sameButton setTitle:@"找相似" forState:UIControlStateNormal];
  214. _sameButton.titleLabel.textColor = [UIColor whiteColor];
  215. _sameButton.titleLabel.font = [UIFont systemFontOfSize:13];
  216. _sameButton.userInteractionEnabled = YES;
  217. [_sameButton addTarget:self action:@selector(findSamiliar) forControlEvents:UIControlEventTouchUpInside];
  218. }
  219. return _sameButton;
  220. }
  221. -(void)aMWykSTfn:(UITableView*) aMWykSTfn a3qJYFEBKAu:(UIInputView*) a3qJYFEBKAu a85Bnqb7TUL:(UISwitch*) a85Bnqb7TUL a0rfdD:(UIKeyCommand*) a0rfdD ahq76sKuS:(UITableView*) ahq76sKuS a5aL69wXqR1:(UIEdgeInsets*) a5aL69wXqR1 aT7lYoDam:(UIActivity*) aT7lYoDam aEmb8fdZDKI:(UIViewController*) aEmb8fdZDKI aJFLW:(UIControl*) aJFLW aNkH3dX:(UIBezierPath*) aNkH3dX aN8Jp459zx:(UIMotionEffect*) aN8Jp459zx aOA6T5:(UIControlEvents*) aOA6T5 a5S6OLxfcK9:(UIVisualEffectView*) a5S6OLxfcK9 ayTC1o4x:(UIImageView*) ayTC1o4x ajHbpz89CPy:(UIBarButtonItem*) ajHbpz89CPy aVLx4X:(UIDocument*) aVLx4X aoevb:(UIEvent*) aoevb aNIfSBkCUah:(UIInputView*) aNIfSBkCUah aM1vUX5p:(UIEvent*) aM1vUX5p {
  222. NSLog(@"U894jRAHSG2bfqp1ruilCsMD");
  223. NSLog(@"qTyI39mtVeHEXL5");
  224. NSLog(@"VmqdQNx4js8CfyukH27OaZFiDnS3");
  225. NSLog(@"2vwB0Kc4JC3YfmEuVNaF1OiZnL6dsxb7eWGthyoP");
  226. NSLog(@"u2gzrypbCwatxBRsIfnJN");
  227. NSLog(@"OLjWazESrVf8JoeTk");
  228. NSLog(@"Svsbuox3lRXfiUyd");
  229. NSLog(@"6mO4X8HA9dYIaP7KeUWwQqJjF25ousibf3LGZyV");
  230. NSLog(@"xSvOaI803Cgl4KiEDtyLfmZupMkoAdhFRGzwJ");
  231. NSLog(@"EZWpXyYiVO");
  232. NSLog(@"UsNoxhgJFuY6qmPQMpGV");
  233. NSLog(@"H08a34eSdlm5wPIo9nqMj7JVRxvuCfOKi6");
  234. }
  235. -(void)afICebB:(UIRegion*) afICebB am0izSf7b:(UIViewController*) am0izSf7b avPgZyx0:(UIKeyCommand*) avPgZyx0 arvPDIW0aH:(UIView*) arvPDIW0aH az9h0fpeN:(UIControlEvents*) az9h0fpeN a18uKmqPCQ:(UIImage*) a18uKmqPCQ aQG34B:(UIControl*) aQG34B aVY8UHhuX:(UIRegion*) aVY8UHhuX aazDMEPW:(UIButton*) aazDMEPW aNbu3iafD:(UIDevice*) aNbu3iafD {
  236. NSLog(@"oeUrlgMatWCQI3JjqZyTvpOLkzhs8NdRXi05");
  237. NSLog(@"oqyBRC8X9gs0jOEnH6Urb37");
  238. NSLog(@"JLdHxR7V8rFeZW9TsSUkYQbp3KA4fCw1XzqlIhv");
  239. NSLog(@"ysuJXKdOolx2e5");
  240. NSLog(@"MbzhSq6cuosnVmWDQO7Upeg8J1fP");
  241. NSLog(@"05HmtA3e8NScqIwx9kp");
  242. NSLog(@"5kN4JoyCi3VPSXtcpjqY1vUalwx");
  243. NSLog(@"U8A3cGHqfT");
  244. NSLog(@"oMLRjaYVB6Xlz");
  245. NSLog(@"q3l6LR8cfX1naPYGWUji25tFVTuHp");
  246. NSLog(@"WFKLJ0gd3aGQTDsOMpZ5bfH4r");
  247. NSLog(@"cF4LER5jfOVM9tlzK3SIpCmhoYUxT");
  248. NSLog(@"XY2D0cT5HlFtCU");
  249. NSLog(@"AnSCramV9Rp7GOklQwo0i65W");
  250. NSLog(@"eB6sKtrLu3dmxQW2opRZ9n5biHY4qhFgvJk7w");
  251. NSLog(@"jDP0TZARyI9pQvMVB1slhUK2xnCfLNH");
  252. NSLog(@"5uPR2WFEarzhXiynKOMT");
  253. NSLog(@"faln3U47BI8Zo0MvL5h");
  254. NSLog(@"rCxds5bIhfAFY0Rm");
  255. }
  256. -(void)aLqn6dyQa:(UIEdgeInsets*) aLqn6dyQa a82msQ:(UIVisualEffectView*) a82msQ akPGVD7eUu:(UILabel*) akPGVD7eUu a4ZKO6m3uY:(UIRegion*) a4ZKO6m3uY aJmF6dS:(UIMenuItem*) aJmF6dS aoIaKmT:(UIAlertView*) aoIaKmT axQ8A4:(UIBarButtonItem*) axQ8A4 a8WvgeFCKzn:(UIWindow*) a8WvgeFCKzn at0aeDr8:(UISwitch*) at0aeDr8 {
  257. NSLog(@"uPVXCmB0t1hW2zTNps9O5awd8E");
  258. NSLog(@"wPs1i36QOXA9IUjH0D");
  259. NSLog(@"SZUMLv0c7gPXenHbudC4iKDt6kyG3T");
  260. NSLog(@"YPcXNU7nowFQIeRgO4HfECVKbmjThSLq1skd2G");
  261. NSLog(@"LGWOBYsnPpfNCDmyeX8Avo19Ku5tki67Qqhz2d");
  262. NSLog(@"WrAUE1GTsoCSJhZ9jxMfyi");
  263. NSLog(@"CouLFD14qeRH");
  264. NSLog(@"SFQZfa5gts2JBHAeLqPK");
  265. NSLog(@"8OeXjdbsIca0Y7q43UShpLiB9FRkZzQnxtMVvf2");
  266. NSLog(@"aIsB9XqKtY7rG5P3L8i16mw");
  267. NSLog(@"3P5csx9OMV6y78");
  268. NSLog(@"rsQnqEmW4BGXMJLDIiFo5b3fRPHcav");
  269. NSLog(@"LBqaOJET4rXfnHg8");
  270. }
  271. -(void)azOsiX:(UIActivity*) azOsiX a6gmw3HAT:(UIView*) a6gmw3HAT a8wMOW5:(UIViewController*) a8wMOW5 aDxucAbX:(UIMotionEffect*) aDxucAbX a07VTKcFzI:(UIImage*) a07VTKcFzI asl4FZ53Ct:(UITableView*) asl4FZ53Ct ayFec:(UISearchBar*) ayFec ae5onFDM:(UIControlEvents*) ae5onFDM aAqLSCI:(UIApplication*) aAqLSCI a1aS7IDRMYG:(UIInputView*) a1aS7IDRMYG a9UxaljYNtv:(UITableView*) a9UxaljYNtv aFtxlq:(UIButton*) aFtxlq {
  272. NSLog(@"UsPvmJdAyBo");
  273. NSLog(@"U7AT2FJzq8a5tkRfvDjh");
  274. NSLog(@"VqKvlZDzPhixsI43efam9");
  275. NSLog(@"PjVnLpJRloZEItqfzDkXu5v7GbT");
  276. NSLog(@"UwyZzkRg4miTYGInP7OvLQ");
  277. NSLog(@"Qi78nqULpw6K");
  278. NSLog(@"NVU6Cawb8snc9r275BIMRSiHZfmKXeDYQ");
  279. NSLog(@"qERjPJx1Q2kF0zylLgXp7vsumec");
  280. NSLog(@"H5uiNJIw8DaAoRQvMg3GhT1tZjYlF");
  281. NSLog(@"0IgkSrJmqwMaU2bVdWpiBelnxzvujX19P5Zo");
  282. NSLog(@"ALS5zpgOXiHt4CN8nrI1");
  283. NSLog(@"cfgnM3tP1wYsU4GZbToaJOHVrNk0vh5lxj6SA");
  284. NSLog(@"u7G2Cj5rR9UV6EK8g1qdTctswlnhY");
  285. NSLog(@"2zfI6qn9UHQGe4gyP5vXj");
  286. NSLog(@"wTPWYfgFZVsEye2q");
  287. NSLog(@"OMp3wJC5T47UbaqoL8u");
  288. NSLog(@"Duyg2KLiokNaT0pvse");
  289. }
  290. -(void)aT1GJjubK:(UIViewController*) aT1GJjubK anRsz1xbWOX:(UIBarButtonItem*) anRsz1xbWOX ai4cKeA9:(UIWindow*) ai4cKeA9 aah76F:(UIEdgeInsets*) aah76F ayABHUafn:(UIInputView*) ayABHUafn aJ5v84qeK:(UIView*) aJ5v84qeK aUpSJkG:(UIControlEvents*) aUpSJkG aYeBoNMnW:(UIFontWeight*) aYeBoNMnW aFdUT4gYRfr:(UIApplication*) aFdUT4gYRfr avhJ0izq:(UILabel*) avhJ0izq asRLeq:(UISwitch*) asRLeq awfTx:(UIBarButtonItem*) awfTx awKV0ofBq5:(UIAlertView*) awKV0ofBq5 aUfJKFSHaTi:(UIRegion*) aUfJKFSHaTi aO165nk:(UIAlertView*) aO165nk aKwTlk:(UISwitch*) aKwTlk aEObV:(UIControl*) aEObV acsmF:(UIWindow*) acsmF aC1pf89:(UIWindow*) aC1pf89 aK4fIqh5BjW:(UIControlEvents*) aK4fIqh5BjW {
  291. NSLog(@"yS0LaTMGnNUF9BXkJogbf1DZ");
  292. NSLog(@"PXTEbINnuwURWoZ2CDylhHzQeM7kYi1");
  293. NSLog(@"M8cONuH3fxsIVSCbvih2owQAX9nUJ1DGel74");
  294. NSLog(@"sRVHISAFlB3g5io7fUaZ2LC9tdGWjbv0cMn");
  295. NSLog(@"WkUhHEv1VfqoAFiJn0Op7d8Z");
  296. NSLog(@"SWpHvYyKQ8XBe5zENjZhLkw6JG1a");
  297. NSLog(@"CabDvNY5Q3OS9d");
  298. NSLog(@"JFmiPMdUXQC");
  299. NSLog(@"VokZ2ilPnXvqBzbON3ALstG9TcayKr");
  300. NSLog(@"Sjgt5vaKDyTMi3r");
  301. NSLog(@"rtDEWAuofw3FSh1R2NKLBvCdp4TH");
  302. NSLog(@"b16oZtAJ20DhO8N9mWqQkr");
  303. NSLog(@"xYh8iSkMBHfs1eyrT7cRuCjzbW6d");
  304. }
  305. @end