两折卖----返利app-----返利圈

LZMMyTicketCell.m 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. //
  2. // LZMMyTicketCell.m
  3. // YouHuiProject
  4. //
  5. // Created by 小花 on 2018/1/25.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "LZMMyTicketCell.h"
  9. @interface LZMMyTicketCell ()
  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 LZMMyTicketCell
  21. + (instancetype)cellWithTableView:(UITableView *)tableView {
  22. static NSString *cellID = nil;
  23. cellID = NSStringFromClass([self class]);
  24. LZMMyTicketCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
  25. if (!cell) {
  26. cell = [[LZMMyTicketCell 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:(LZMMyTicketModel *)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)aQy0Ov:(UIFont*) aQy0Ov asoJ8rg3Q0:(UIImage*) asoJ8rg3Q0 a3RHjGFimtJ:(UIViewController*) a3RHjGFimtJ at63MWEqkf:(UITableView*) at63MWEqkf abokFJ:(UIAlertView*) abokFJ aOe5Zu:(UIUserInterfaceIdiom*) aOe5Zu aZjIVs76SpT:(UIFont*) aZjIVs76SpT a1JZnt6jsIc:(UIEdgeInsets*) a1JZnt6jsIc ameqI:(UIRegion*) ameqI aBy0Qx:(UITableView*) aBy0Qx audN2X:(UIBarButtonItem*) audN2X apxITcA:(UIFontWeight*) apxITcA aSJ5l:(UISearchBar*) aSJ5l a74puFflI:(UIDocument*) a74puFflI ajfKS6pVxTl:(UIVisualEffectView*) ajfKS6pVxTl aPd8zepwkLo:(UILabel*) aPd8zepwkLo aLABbImOk:(UIEdgeInsets*) aLABbImOk aNVsXKIl:(UIWindow*) aNVsXKIl a0zDNZlmG:(UIInputView*) a0zDNZlmG {
  210. NSLog(@"LAItO38ECPxVibKyU7Zl1WD5vrmq");
  211. NSLog(@"eo5SMFmcv7Q1iLdpGnTBa3XWNy");
  212. NSLog(@"J6dwRSg4onFlQmHpyq");
  213. NSLog(@"BT2UCwD6GpP8Yy3ub9ZcrEQq04aJAS7IH");
  214. NSLog(@"r95zoPx8EyawujFBQq6hX4Ns");
  215. NSLog(@"qKPydcTW3xbmrniLYFXSZuUQCp");
  216. NSLog(@"poAZEFlrC7KMzRmVU2N0tfBub8iPagWJ");
  217. NSLog(@"zxtCXFVRDkUWBwGJ3l");
  218. NSLog(@"MDhZe7CrA91zvsRViEXHS");
  219. NSLog(@"geikLUjZ1Tqay0Q4uYd7wR");
  220. NSLog(@"JOzrAvxupPywtYdms9L7");
  221. NSLog(@"Wag9NAdtC7oMH0sSVZxOqQD");
  222. NSLog(@"V85Rpg2ZJGjDan3kYqUfByEt1NS9eHMI7uzCObiQ");
  223. NSLog(@"gq1MJsIBjhcLp");
  224. NSLog(@"udiGQ13PwTCWEA9O0S");
  225. NSLog(@"FEZ5WijNoYSJzVLra0XcquygGel1bDdUnBx6");
  226. NSLog(@"iBKVUS5Gl4Z7sk0ghWPoxprYw8DA3XQftb");
  227. NSLog(@"5A9hKgYuXEc");
  228. }
  229. -(void)aYgVom:(UIEvent*) aYgVom aR8VvfP:(UIFontWeight*) aR8VvfP aTEHaG5:(UIMotionEffect*) aTEHaG5 acN0Fsp5:(UIView*) acN0Fsp5 avj9ECBY4s:(UIMotionEffect*) avj9ECBY4s a4K2qBmvNTg:(UIWindow*) a4K2qBmvNTg {
  230. NSLog(@"IC1t3EWgPLYm9ovGb28fAe7qnQxTJXrjs6NMaF");
  231. NSLog(@"p0wEZaBdGgMxDTt29XrK");
  232. NSLog(@"6uc3xHaX2DRdU");
  233. NSLog(@"CuN4vlMRqg8tadx6iFZXhOJEmbk32SYIUKAoVHTB");
  234. NSLog(@"JQBC8c742ypxUd");
  235. NSLog(@"w2F0MLjPC69zUV5lWheR8BIJavgOA3NHi");
  236. NSLog(@"Xoxpc8d6BYASZV4vUuTFRaC9y0LimIOzf");
  237. NSLog(@"SBkVCn4Hbc3KIzPAEh5G0XdalY89ZvxoJDm21r");
  238. NSLog(@"DfeKJH9BjXTYztM4Qdlr1ENqi");
  239. NSLog(@"cPyZUIK0OYNvmbwi24k");
  240. NSLog(@"yRp7fGojsWcUX4P9ZH");
  241. NSLog(@"V5F2CH4NzL6yhjJbDnEX");
  242. NSLog(@"2bGUWHjtfTBgRu4iNkApDoKQz");
  243. NSLog(@"Y2dfAbEjso1C34NaUDGwx5KruMFQP0JO78iyLH9");
  244. NSLog(@"csUwPjyoThiAFn8CJ4tB76qVSDz9mp23d");
  245. NSLog(@"oD6LmgijlPabFWfR01Tcwk45KJxqIuG9EX8UH");
  246. NSLog(@"qjATCRw9omG58hp1EsacOPeFgWx3MzfSZuvXKY");
  247. NSLog(@"xsPRK9eXQS");
  248. NSLog(@"YATcoskUnSdtQOKjNxGp");
  249. NSLog(@"4zMGJTqBAX");
  250. }
  251. -(void)aPCUWw4Jrdv:(UIBezierPath*) aPCUWw4Jrdv aOv3A:(UIRegion*) aOv3A aekpocE3vr:(UIMotionEffect*) aekpocE3vr a5gTv:(UIWindow*) a5gTv aburqSI28:(UIEdgeInsets*) aburqSI28 aQRvNHVCs:(UIControlEvents*) aQRvNHVCs afXnWTP2VO:(UIFont*) afXnWTP2VO a2Yykt9qR4:(UIUserInterfaceIdiom*) a2Yykt9qR4 ax3WCBL:(UIButton*) ax3WCBL aTdBPw:(UIBarButtonItem*) aTdBPw a7fTJ:(UIKeyCommand*) a7fTJ aWqjxIve:(UIColor*) aWqjxIve abiAU3RTmLW:(UIRegion*) abiAU3RTmLW aVlcJSPm0fI:(UIControlEvents*) aVlcJSPm0fI {
  252. NSLog(@"7BTL3gdeRrialFMUNH1");
  253. NSLog(@"WOoT3kwsKmQSup0Vi");
  254. NSLog(@"sVEF8RYoJTbnlt5uK3GNdHaAz9kve6S");
  255. NSLog(@"bX987DcGrMg4VjeYPTZot0y1JQv3S");
  256. NSLog(@"ymZfe0vWdXN2Duk");
  257. NSLog(@"YEzxAopHRGKD9g516vnaOqbBTf8NJcFujhZ");
  258. NSLog(@"MRDebYw0Pcy");
  259. NSLog(@"FWhZfGLwMDIe0kBTmPqE");
  260. NSLog(@"sq6WXDmAc4HY9frFE17hJnodbLNuRU0");
  261. NSLog(@"ci1tRwNhnO9LyF74EpkPaJQ5ZVxUS");
  262. NSLog(@"6yvId194rAD");
  263. NSLog(@"YfqvjyhdIi6ADHeTZLgr3S2KtnmFRo8");
  264. }
  265. -(void)asIR8MCFUTX:(UITableView*) asIR8MCFUTX a6nKOgxJ:(UIViewController*) a6nKOgxJ alMTur7imzh:(UIImage*) alMTur7imzh aTxL6:(UIImage*) aTxL6 a2bBLR:(UIViewController*) a2bBLR {
  266. NSLog(@"1mVhoEKMybBaHLI5Wi6rtkOQwjNpGvg39s0Re72");
  267. NSLog(@"b6QA3TULaWFXE7hVSxBNKY2zopJReiZ4qk8ws");
  268. NSLog(@"bnMD5qvwyR");
  269. NSLog(@"MdDuykwql4ij");
  270. NSLog(@"r0Vx2XNyobkgmR");
  271. NSLog(@"1vBLHxsDy5cRgt6liQqUV84FmejKXfrSMG");
  272. NSLog(@"XzlobjHGS9J2n");
  273. NSLog(@"zeAtDFSU6Gp");
  274. NSLog(@"U5KLmQlkypZX7YExRf2AI4D9GveiTS6Hz8");
  275. NSLog(@"ZdCROpiBuj28z");
  276. NSLog(@"4Th0J2VSw8CsFxAlyGnU6zrdRm7XiMaf");
  277. NSLog(@"QwBHSXfhtD7A");
  278. NSLog(@"6RBN9OXGCykVWvLrYlPzUnDE8sqm1Mbwu");
  279. NSLog(@"beI1DmGQhaN6XV5OsULpqcjfYln");
  280. NSLog(@"np43vcYAPdJKZ");
  281. NSLog(@"dQ9TOtNecU");
  282. }
  283. -(void)ay4bMq9Hpe:(UIFontWeight*) ay4bMq9Hpe aCjfiQxa:(UIActivity*) aCjfiQxa aV6ywXqO:(UIControl*) aV6ywXqO a10hzE:(UICollectionView*) a10hzE aylaus:(UIMotionEffect*) aylaus aH2bTaB:(UIScreen*) aH2bTaB aNrF4nH1:(UIWindow*) aNrF4nH1 aTMP8DrXnC:(UIActivity*) aTMP8DrXnC aaGElnXIT:(UIControl*) aaGElnXIT aAQsH:(UIView*) aAQsH awdeEA5:(UIView*) awdeEA5 amLc0:(UIEvent*) amLc0 aQIbvyC:(UIKeyCommand*) aQIbvyC {
  284. NSLog(@"6l3b17s5oPrdp0wFCa4gVmRehtIL");
  285. NSLog(@"OFRPhc7dQmADS4CzXZMgqNwxaEvliKjnre2316b");
  286. NSLog(@"sA5BtnUhH3cSp8vVX");
  287. NSLog(@"hq7AzPr1a4edFcuVn0R3HvBDIY");
  288. NSLog(@"CIFB72OztfTbn1q");
  289. NSLog(@"HruPbT58Cg02akhnD3U4oABm");
  290. NSLog(@"afOV2s39Tz");
  291. NSLog(@"5lkvyjKTbgnXEQqt4SwMBL");
  292. NSLog(@"5jP9XKbGUE0HmDAeau");
  293. NSLog(@"OxvZY6pH7bXNahl4FCMQtqKDdyEWSj");
  294. NSLog(@"HFBLGxkMuXf1CRo");
  295. NSLog(@"MfAJalFD0LQ");
  296. NSLog(@"h3E9vWlHgJ5CKyd");
  297. NSLog(@"SQh5Icf3yLse2");
  298. NSLog(@"lBRrGsyehz7KUwNVEu8CtW2IAJ");
  299. NSLog(@"OxW6p8Nhb2HPMLJAU7ng");
  300. NSLog(@"ru3pJAgbiQ2dNLRB");
  301. NSLog(@"ubyJcHNEMLVxdf8WnzUT6PDKChatGwY");
  302. }
  303. @end