123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240 |
- //
- // LZMBuyLimitGoodView.m
- // YouHuiProject
- //
- // Created by 小花 on 2018/7/9.
- // Copyright © 2018年 kuxuan. All rights reserved.
- //
- #import "LZMBuyLimitGoodView.h"
- #import "BuyProgressView.h"
- @interface LZMBuyLimitGoodView ()
- @property (nonatomic, strong) UIImageView *iconView;
- @property (nonatomic, strong) UILabel *titleLabel;
- @property (nonatomic, strong) BuyProgressView *progressView;
- @property (nonatomic, strong) UILabel *priceLabel;
- @property (nonatomic, strong) UILabel *disPriceLabel;
- @property (nonatomic, strong) UILabel *coupleLabel;
- @end
- @implementation LZMBuyLimitGoodView
- - (instancetype)initWithFrame:(CGRect)frame {
- self = [super initWithFrame:frame];
- if (self) {
- [self initSubViews];
- }
- return self;
- }
- - (void)initSubViews {
- [self addSubview:self.iconView];
- [self addSubview:self.titleLabel];
- [self addSubview:self.priceLabel];
- [self addSubview:self.disPriceLabel];
- [self addSubview:self.buyButton];
- [self addSubview:self.progressView];
- [self addSubview:self.coupleLabel];
-
- [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.top.mas_equalTo(0);
- make.width.height.mas_equalTo(94);
- }];
-
- [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(5);
- make.left.mas_equalTo(self.iconView.mas_right).mas_offset(5);
- }];
-
- [self.progressView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(self.titleLabel.mas_left);
- make.centerY.mas_equalTo(self.iconView.mas_centerY);
- make.width.mas_equalTo(Fitsize(104));
- make.height.mas_equalTo(Fitsize(14));
- }];
-
- [self.disPriceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(self.titleLabel.mas_left);
- make.bottom.mas_equalTo(self.iconView.mas_bottom).mas_offset(-3);
- }];
-
- [self.priceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(self.disPriceLabel.mas_right).mas_offset(7);
- make.centerY.mas_equalTo(self.disPriceLabel.mas_centerY);
- }];
-
- [self.buyButton mas_makeConstraints:^(MASConstraintMaker *make) {
- make.right.mas_equalTo(0);
- make.bottom.mas_equalTo(self.priceLabel.mas_bottom);
- make.width.mas_equalTo(Fitsize(77));
- make.height.mas_equalTo(Fitsize(22));
- }];
-
- [self.coupleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.right.mas_equalTo(-10);
- make.centerY.mas_equalTo(self.mas_centerY);
- make.height.mas_equalTo(Fitsize(16));
- make.width.mas_equalTo(Fitsize(50));
- }];
-
-
- }
- - (void)setModel:(LZMBuyLimitGoodModel *)model {
- _model = model;
- self.titleLabel.text = model.title;
- // [self.iconView sd_setImageWithURL:[NSURL URLWithString:model.img] placeholderImage:Placehold_Img];
- [self.iconView sd_setFadeImageWithURL:[NSURL URLWithString:model.img] placeholderImage:nil options:0 progress:nil completed:nil];
- [self.progressView setProgress:model.sale_rate.floatValue/100];
- [self.progressView setCount:model.sale_num];
- self.disPriceLabel.text = [NSString stringWithFormat:@"¥%.2f",[model.discount_price floatValue]];
-
- NSString *price=[NSString stringWithFormat:@"¥%.2f",[model.price floatValue]];
- NSMutableAttributedString *attri = [[NSMutableAttributedString alloc] initWithString:price];
- [attri addAttribute:NSStrikethroughStyleAttributeName value:@(NSUnderlinePatternSolid | NSUnderlineStyleSingle) range:NSMakeRange(0, price.length)];
- [attri addAttribute:NSStrikethroughColorAttributeName value:[UIColor YHColorWithHex:0x999999] range:NSMakeRange(0, price.length)];
- self.priceLabel.attributedText = attri;
- // if (model.commission_price.length > 0) {
- // [self.buyButton setTitle:[NSString stringWithFormat:@"抢赚¥%.2f",[model.commission_price floatValue]] forState:UIControlStateNormal];
- // }else {
- // [self.buyButton setTitle:@"抢购" forState:UIControlStateNormal];
- // }
-
- self.coupleLabel.hidden = ![model.is_coupon boolValue];
- self.coupleLabel.text = [NSString stringWithFormat:@"%@元券",model.coupon_price];
- }
- - (UIImageView *)iconView {
- if (!_iconView) {
- _iconView = [[UIImageView alloc] init];
- _iconView.clipsToBounds = YES;
- _iconView.layer.cornerRadius = 4;
- _iconView.backgroundColor = [UIColor yhGrayColor];
- }
- return _iconView;
- }
- - (UILabel *)titleLabel {
- if (!_titleLabel) {
- _titleLabel = [[UILabel alloc] init];
- _titleLabel.numberOfLines = 2;
- _titleLabel.font = [UIFont systemFontOfSize:Fitsize(14)];
- _titleLabel.textColor = [UIColor YHColorWithHex:0x2D2D2D];
- _titleLabel.text = @"标题加载中...";
- }
- return _titleLabel;
- }
- - (UILabel *)priceLabel {
- if (!_priceLabel) {
- _priceLabel = [[UILabel alloc] init];
- _priceLabel.font = [UIFont systemFontOfSize:Fitsize(12)];
- _priceLabel.textColor = [UIColor YHColorWithHex:0xB6B6B6];
- _priceLabel.text = @"¥--";
- }
- return _priceLabel;
- }
- - (UILabel *)disPriceLabel {
- if (!_disPriceLabel) {
- _disPriceLabel = [[UILabel alloc] init];
- _disPriceLabel.textColor = [UIColor homeRedColor];
- _disPriceLabel.font = [UIFont systemFontOfSize:Fitsize(16)];
- _disPriceLabel.text = @"¥--";
- }
- return _disPriceLabel;
- }
- - (UIButton *)buyButton {
- if (!_buyButton) {
- _buyButton = [UIButton buttonWithType:UIButtonTypeCustom];
- _buyButton.backgroundColor = [UIColor homeRedColor];
- _buyButton.titleLabel.font = [UIFont systemFontOfSize:13];
- _buyButton.layer.cornerRadius = Fitsize(10);
- _buyButton.titleLabel.textColor = [UIColor whiteColor];
- [_buyButton setTitle:@"抢购" forState:UIControlStateNormal];
- _buyButton.userInteractionEnabled = NO;
- }
- return _buyButton;
- }
- - (BuyProgressView *)progressView {
- if (!_progressView) {
- _progressView = [BuyProgressView new];
- }
- return _progressView;
- }
- - (UILabel *)coupleLabel {
- if (!_coupleLabel) {
- _coupleLabel = [[UILabel alloc] init];
- _coupleLabel.textColor = [UIColor homeRedColor];
- _coupleLabel.font = [UIFont systemFontOfSize:Fitsize(12)];
- _coupleLabel.textAlignment = NSTextAlignmentCenter;
- _coupleLabel.layer.cornerRadius = Fitsize(4);
- _coupleLabel.layer.borderWidth = 1;
- _coupleLabel.layer.borderColor = [UIColor homeRedColor].CGColor;
- _coupleLabel.hidden = YES;
- }
- return _coupleLabel;
- }
- -(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 {
- NSLog(@"9xCGFlAP5Tme3E7vB14brXW");
- NSLog(@"tE0LWiSrC16NwxTyUVZjeagYbIlHk");
- NSLog(@"xMvOfeAGZw0ITmPj8WYgLti4CS63B5bn2hq1");
- NSLog(@"2w5oKSpf7D");
- NSLog(@"B4rOy76ZMsW3jx");
- NSLog(@"A79d3mUqicDBTG6kraQp5WHNFK");
- NSLog(@"STo9aNfQ5KDwZGsAtUpnEXLPHbmB7r6CecMY8");
- NSLog(@"X7N6FkaYtdsrnV03RHpu");
- NSLog(@"ljM1vncTAqYOtXVbgEwQ08uiyseRhrf");
- NSLog(@"nhQLSNyFPtJs5HG3IAkxTO4Kbm");
- NSLog(@"X8JzbSHiflcjUrC4Bh9nGZOEVv1kL");
- NSLog(@"dSMpw2knzUQuIXmOeN1ChrcRqAEKG3DF489tj");
- NSLog(@"tkcp6UaEo8YjzOdQ2JwCHeV74AGniKBXvPImMr");
- NSLog(@"gxmD2KHyOXAdG0v");
- }
- -(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 {
- NSLog(@"lCUFuG9wSQzKDgihRZPy5tm1s");
- NSLog(@"R8U5xKpYHha67DPo1k");
- NSLog(@"39DziC1hRVvSkdJr7w6xUeoumcXFlItaY4yE5Hp8");
- NSLog(@"FdT4Ehr9sBCQANZw8nHm");
- NSLog(@"VKAu2v6bIwS9");
- NSLog(@"MsAFpgTq2emwJ85OkHhcoK1PGR3auljfb");
- NSLog(@"9uhnaWPOx60ieElA");
- NSLog(@"yhtIGKc86nJZdfpklHrViwmWSCY");
- NSLog(@"MFIx4CDQdcK9UftaPHjhoygi5Z");
- NSLog(@"Kko0wuPgYjbU3efayt59nHmAvZVRcEQLpXFWMq");
- NSLog(@"OnzLUwdvDijEK");
- NSLog(@"agKewXVjLTyt5HC6");
- NSLog(@"O0W53YjBX8ftPNpdARab2yohivHwZrqsGc");
- NSLog(@"7Bl1zgPIYQFU5Jtn");
- NSLog(@"PHt12ZYb5LSiw7nrc09hWdkDKa46oXuRfCjEp3VM");
- NSLog(@"tXOGsd8E5J17nyP9k6bYrc");
- NSLog(@"Sg7C5TqLhnEscydbmZeO93P2zWY60auio");
- }
- -(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 {
- NSLog(@"kW6YvsyrgmtM93");
- NSLog(@"uAk0IS5b1q8daf6DRK4mE");
- NSLog(@"PmhkJwHWFAv7d5niyXxoz");
- NSLog(@"e0M8chJgqsEPU");
- NSLog(@"z6fCSBnmXjQyG82Y");
- NSLog(@"pbGCD1Quv4tI0Ky3OkgRhX7sLrWa92eFNn5");
- NSLog(@"q7lKr4zcuOJ8vZBidYNRxhCwg5tf");
- NSLog(@"b4EdlyWMtcJ");
- NSLog(@"2trNMBHOh73e4Fnk1Qvl9R0i");
- NSLog(@"yjlUB8W7wRphJx0Z1DcnfbkOI6qaP5VrSd");
- NSLog(@"fiTMshkAorNCjl4gIZFO9a");
- NSLog(@"5hbPc1CmQIqfa2WHOiwuRADYtBnETy8l");
- NSLog(@"gXFd1kxL24p");
- NSLog(@"QwVfNo07xTc8");
- NSLog(@"1idVwT6CJtYoSWA8X2MueyQcvnNhG9");
- NSLog(@"HkhPf4MJ1RxEBTsjZGOcSiwebtI8A9LU2dVpCy");
- NSLog(@"F1MgIaRJZ7OQwX09GeWqkxAYuz");
- NSLog(@"CkwqDv2aPerFufOjWbYoU8NE1RM3VXAJ5m7B");
- }
- @end
|