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

LZMBuyLimitGoodView.m 9.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. //
  2. // LZMBuyLimitGoodView.m
  3. // YouHuiProject
  4. //
  5. // Created by 小花 on 2018/7/9.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "LZMBuyLimitGoodView.h"
  9. #import "BuyProgressView.h"
  10. @interface LZMBuyLimitGoodView ()
  11. @property (nonatomic, strong) UIImageView *iconView;
  12. @property (nonatomic, strong) UILabel *titleLabel;
  13. @property (nonatomic, strong) BuyProgressView *progressView;
  14. @property (nonatomic, strong) UILabel *priceLabel;
  15. @property (nonatomic, strong) UILabel *disPriceLabel;
  16. @property (nonatomic, strong) UILabel *coupleLabel;
  17. @end
  18. @implementation LZMBuyLimitGoodView
  19. - (instancetype)initWithFrame:(CGRect)frame {
  20. self = [super initWithFrame:frame];
  21. if (self) {
  22. [self initSubViews];
  23. }
  24. return self;
  25. }
  26. - (void)initSubViews {
  27. [self addSubview:self.iconView];
  28. [self addSubview:self.titleLabel];
  29. [self addSubview:self.priceLabel];
  30. [self addSubview:self.disPriceLabel];
  31. [self addSubview:self.buyButton];
  32. [self addSubview:self.progressView];
  33. [self addSubview:self.coupleLabel];
  34. [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) {
  35. make.left.top.mas_equalTo(0);
  36. make.width.height.mas_equalTo(94);
  37. }];
  38. [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  39. make.top.mas_equalTo(5);
  40. make.left.mas_equalTo(self.iconView.mas_right).mas_offset(5);
  41. }];
  42. [self.progressView mas_makeConstraints:^(MASConstraintMaker *make) {
  43. make.left.mas_equalTo(self.titleLabel.mas_left);
  44. make.centerY.mas_equalTo(self.iconView.mas_centerY);
  45. make.width.mas_equalTo(Fitsize(104));
  46. make.height.mas_equalTo(Fitsize(14));
  47. }];
  48. [self.disPriceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  49. make.left.mas_equalTo(self.titleLabel.mas_left);
  50. make.bottom.mas_equalTo(self.iconView.mas_bottom).mas_offset(-3);
  51. }];
  52. [self.priceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  53. make.left.mas_equalTo(self.disPriceLabel.mas_right).mas_offset(7);
  54. make.centerY.mas_equalTo(self.disPriceLabel.mas_centerY);
  55. }];
  56. [self.buyButton mas_makeConstraints:^(MASConstraintMaker *make) {
  57. make.right.mas_equalTo(0);
  58. make.bottom.mas_equalTo(self.priceLabel.mas_bottom);
  59. make.width.mas_equalTo(Fitsize(77));
  60. make.height.mas_equalTo(Fitsize(22));
  61. }];
  62. [self.coupleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  63. make.right.mas_equalTo(-10);
  64. make.centerY.mas_equalTo(self.mas_centerY);
  65. make.height.mas_equalTo(Fitsize(16));
  66. make.width.mas_equalTo(Fitsize(50));
  67. }];
  68. }
  69. - (void)setModel:(LZMBuyLimitGoodModel *)model {
  70. _model = model;
  71. self.titleLabel.text = model.title;
  72. // [self.iconView sd_setImageWithURL:[NSURL URLWithString:model.img] placeholderImage:Placehold_Img];
  73. [self.iconView sd_setFadeImageWithURL:[NSURL URLWithString:model.img] placeholderImage:nil options:0 progress:nil completed:nil];
  74. [self.progressView setProgress:model.sale_rate.floatValue/100];
  75. [self.progressView setCount:model.sale_num];
  76. self.disPriceLabel.text = [NSString stringWithFormat:@"¥%.2f",[model.discount_price floatValue]];
  77. NSString *price=[NSString stringWithFormat:@"¥%.2f",[model.price floatValue]];
  78. NSMutableAttributedString *attri = [[NSMutableAttributedString alloc] initWithString:price];
  79. [attri addAttribute:NSStrikethroughStyleAttributeName value:@(NSUnderlinePatternSolid | NSUnderlineStyleSingle) range:NSMakeRange(0, price.length)];
  80. [attri addAttribute:NSStrikethroughColorAttributeName value:[UIColor YHColorWithHex:0x999999] range:NSMakeRange(0, price.length)];
  81. self.priceLabel.attributedText = attri;
  82. // if (model.commission_price.length > 0) {
  83. // [self.buyButton setTitle:[NSString stringWithFormat:@"抢赚¥%.2f",[model.commission_price floatValue]] forState:UIControlStateNormal];
  84. // }else {
  85. // [self.buyButton setTitle:@"抢购" forState:UIControlStateNormal];
  86. // }
  87. self.coupleLabel.hidden = ![model.is_coupon boolValue];
  88. self.coupleLabel.text = [NSString stringWithFormat:@"%@元券",model.coupon_price];
  89. }
  90. - (UIImageView *)iconView {
  91. if (!_iconView) {
  92. _iconView = [[UIImageView alloc] init];
  93. _iconView.clipsToBounds = YES;
  94. _iconView.layer.cornerRadius = 4;
  95. _iconView.backgroundColor = [UIColor yhGrayColor];
  96. }
  97. return _iconView;
  98. }
  99. - (UILabel *)titleLabel {
  100. if (!_titleLabel) {
  101. _titleLabel = [[UILabel alloc] init];
  102. _titleLabel.numberOfLines = 2;
  103. _titleLabel.font = [UIFont systemFontOfSize:Fitsize(14)];
  104. _titleLabel.textColor = [UIColor YHColorWithHex:0x2D2D2D];
  105. _titleLabel.text = @"标题加载中...";
  106. }
  107. return _titleLabel;
  108. }
  109. - (UILabel *)priceLabel {
  110. if (!_priceLabel) {
  111. _priceLabel = [[UILabel alloc] init];
  112. _priceLabel.font = [UIFont systemFontOfSize:Fitsize(12)];
  113. _priceLabel.textColor = [UIColor YHColorWithHex:0xB6B6B6];
  114. _priceLabel.text = @"¥--";
  115. }
  116. return _priceLabel;
  117. }
  118. - (UILabel *)disPriceLabel {
  119. if (!_disPriceLabel) {
  120. _disPriceLabel = [[UILabel alloc] init];
  121. _disPriceLabel.textColor = [UIColor homeRedColor];
  122. _disPriceLabel.font = [UIFont systemFontOfSize:Fitsize(16)];
  123. _disPriceLabel.text = @"¥--";
  124. }
  125. return _disPriceLabel;
  126. }
  127. - (UIButton *)buyButton {
  128. if (!_buyButton) {
  129. _buyButton = [UIButton buttonWithType:UIButtonTypeCustom];
  130. _buyButton.backgroundColor = [UIColor homeRedColor];
  131. _buyButton.titleLabel.font = [UIFont systemFontOfSize:13];
  132. _buyButton.layer.cornerRadius = Fitsize(10);
  133. _buyButton.titleLabel.textColor = [UIColor whiteColor];
  134. [_buyButton setTitle:@"抢购" forState:UIControlStateNormal];
  135. _buyButton.userInteractionEnabled = NO;
  136. }
  137. return _buyButton;
  138. }
  139. - (BuyProgressView *)progressView {
  140. if (!_progressView) {
  141. _progressView = [BuyProgressView new];
  142. }
  143. return _progressView;
  144. }
  145. - (UILabel *)coupleLabel {
  146. if (!_coupleLabel) {
  147. _coupleLabel = [[UILabel alloc] init];
  148. _coupleLabel.textColor = [UIColor homeRedColor];
  149. _coupleLabel.font = [UIFont systemFontOfSize:Fitsize(12)];
  150. _coupleLabel.textAlignment = NSTextAlignmentCenter;
  151. _coupleLabel.layer.cornerRadius = Fitsize(4);
  152. _coupleLabel.layer.borderWidth = 1;
  153. _coupleLabel.layer.borderColor = [UIColor homeRedColor].CGColor;
  154. _coupleLabel.hidden = YES;
  155. }
  156. return _coupleLabel;
  157. }
  158. -(void)a37ZdFvNf:(UIMotionEffect*) a37ZdFvNf azc0BUH:(UIImageView*) azc0BUH apoP2SF9:(UIControlEvents*) apoP2SF9 aKQAVmIYZ:(UIKeyCommand*) aKQAVmIYZ aMkPOnFXeyT:(UIVisualEffectView*) aMkPOnFXeyT ai3eHf:(UIControlEvents*) ai3eHf a8yEun6fG:(UIButton*) a8yEun6fG a0EDLW:(UIKeyCommand*) a0EDLW aEFAKSTdXa:(UIBarButtonItem*) aEFAKSTdXa a58RAEN6jB0:(UIButton*) a58RAEN6jB0 azYFJpT:(UIEdgeInsets*) azYFJpT {
  159. NSLog(@"9xCGFlAP5Tme3E7vB14brXW");
  160. NSLog(@"tE0LWiSrC16NwxTyUVZjeagYbIlHk");
  161. NSLog(@"xMvOfeAGZw0ITmPj8WYgLti4CS63B5bn2hq1");
  162. NSLog(@"2w5oKSpf7D");
  163. NSLog(@"B4rOy76ZMsW3jx");
  164. NSLog(@"A79d3mUqicDBTG6kraQp5WHNFK");
  165. NSLog(@"STo9aNfQ5KDwZGsAtUpnEXLPHbmB7r6CecMY8");
  166. NSLog(@"X7N6FkaYtdsrnV03RHpu");
  167. NSLog(@"ljM1vncTAqYOtXVbgEwQ08uiyseRhrf");
  168. NSLog(@"nhQLSNyFPtJs5HG3IAkxTO4Kbm");
  169. NSLog(@"X8JzbSHiflcjUrC4Bh9nGZOEVv1kL");
  170. NSLog(@"dSMpw2knzUQuIXmOeN1ChrcRqAEKG3DF489tj");
  171. NSLog(@"tkcp6UaEo8YjzOdQ2JwCHeV74AGniKBXvPImMr");
  172. NSLog(@"gxmD2KHyOXAdG0v");
  173. }
  174. -(void)aOpImJnGkt:(UIControlEvents*) aOpImJnGkt aYZWS7d9DF:(UIApplication*) aYZWS7d9DF aWpCAqG:(UIVisualEffectView*) aWpCAqG aD8oUXhz:(UIApplication*) aD8oUXhz aoqZ6FShLD:(UIBarButtonItem*) aoqZ6FShLD ahpew:(UIFont*) ahpew aAKe9X:(UIVisualEffectView*) aAKe9X aCtnQ5J4:(UISearchBar*) aCtnQ5J4 aMXSoEjKin:(UIAlertView*) aMXSoEjKin aDTxrJVWG:(UIBarButtonItem*) aDTxrJVWG a0AEqcfFn:(UIViewController*) a0AEqcfFn agZfUtiy:(UIControl*) agZfUtiy aRz8uCFl:(UIActivity*) aRz8uCFl a0oW9jZ6:(UIWindow*) a0oW9jZ6 aDAZYlUObup:(UIImageView*) aDAZYlUObup aSkLjx1qFCu:(UIControlEvents*) aSkLjx1qFCu aQL2fbTCUeW:(UIScreen*) aQL2fbTCUeW aDHQKhw:(UIEdgeInsets*) aDHQKhw {
  175. NSLog(@"lCUFuG9wSQzKDgihRZPy5tm1s");
  176. NSLog(@"R8U5xKpYHha67DPo1k");
  177. NSLog(@"39DziC1hRVvSkdJr7w6xUeoumcXFlItaY4yE5Hp8");
  178. NSLog(@"FdT4Ehr9sBCQANZw8nHm");
  179. NSLog(@"VKAu2v6bIwS9");
  180. NSLog(@"MsAFpgTq2emwJ85OkHhcoK1PGR3auljfb");
  181. NSLog(@"9uhnaWPOx60ieElA");
  182. NSLog(@"yhtIGKc86nJZdfpklHrViwmWSCY");
  183. NSLog(@"MFIx4CDQdcK9UftaPHjhoygi5Z");
  184. NSLog(@"Kko0wuPgYjbU3efayt59nHmAvZVRcEQLpXFWMq");
  185. NSLog(@"OnzLUwdvDijEK");
  186. NSLog(@"agKewXVjLTyt5HC6");
  187. NSLog(@"O0W53YjBX8ftPNpdARab2yohivHwZrqsGc");
  188. NSLog(@"7Bl1zgPIYQFU5Jtn");
  189. NSLog(@"PHt12ZYb5LSiw7nrc09hWdkDKa46oXuRfCjEp3VM");
  190. NSLog(@"tXOGsd8E5J17nyP9k6bYrc");
  191. NSLog(@"Sg7C5TqLhnEscydbmZeO93P2zWY60auio");
  192. }
  193. -(void)aL43S:(UIScreen*) aL43S aa5Y1:(UIBarButtonItem*) aa5Y1 aLvjMt:(UISearchBar*) aLvjMt ahGLO630WKS:(UIInputView*) ahGLO630WKS aDuZ1:(UIEdgeInsets*) aDuZ1 aKOXI73:(UIBarButtonItem*) aKOXI73 aJTgx:(UIImageView*) aJTgx at2grbd:(UIControlEvents*) at2grbd ayuFrtQ38q:(UIFont*) ayuFrtQ38q aNEBI9R4:(UIControl*) aNEBI9R4 aWnfaJOZHk:(UIVisualEffectView*) aWnfaJOZHk agFBIcyLmSd:(UIEdgeInsets*) agFBIcyLmSd aOuxF8m:(UIVisualEffectView*) aOuxF8m aOHLVBiPXA:(UIColor*) aOHLVBiPXA agr90Ds:(UIViewController*) agr90Ds ahMVFRZm4Cn:(UIApplication*) ahMVFRZm4Cn a4CQGnb:(UIBarButtonItem*) a4CQGnb aMU9mVyBatf:(UIScreen*) aMU9mVyBatf a7mEArS:(UIBarButtonItem*) a7mEArS {
  194. NSLog(@"kW6YvsyrgmtM93");
  195. NSLog(@"uAk0IS5b1q8daf6DRK4mE");
  196. NSLog(@"PmhkJwHWFAv7d5niyXxoz");
  197. NSLog(@"e0M8chJgqsEPU");
  198. NSLog(@"z6fCSBnmXjQyG82Y");
  199. NSLog(@"pbGCD1Quv4tI0Ky3OkgRhX7sLrWa92eFNn5");
  200. NSLog(@"q7lKr4zcuOJ8vZBidYNRxhCwg5tf");
  201. NSLog(@"b4EdlyWMtcJ");
  202. NSLog(@"2trNMBHOh73e4Fnk1Qvl9R0i");
  203. NSLog(@"yjlUB8W7wRphJx0Z1DcnfbkOI6qaP5VrSd");
  204. NSLog(@"fiTMshkAorNCjl4gIZFO9a");
  205. NSLog(@"5hbPc1CmQIqfa2WHOiwuRADYtBnETy8l");
  206. NSLog(@"gXFd1kxL24p");
  207. NSLog(@"QwVfNo07xTc8");
  208. NSLog(@"1idVwT6CJtYoSWA8X2MueyQcvnNhG9");
  209. NSLog(@"HkhPf4MJ1RxEBTsjZGOcSiwebtI8A9LU2dVpCy");
  210. NSLog(@"F1MgIaRJZ7OQwX09GeWqkxAYuz");
  211. NSLog(@"CkwqDv2aPerFufOjWbYoU8NE1RM3VXAJ5m7B");
  212. }
  213. @end