// // LZMGoodDetailBottomView.m // YouHuiProject // // Created by xiaoxi on 2018/1/25. // Copyright © 2018年 kuxuan. All rights reserved. // #import "LZMGoodDetailBottomView.h" #import "LZMGoodDetailModel.h" @interface LZMGoodDetailBottomView () @end @implementation LZMGoodDetailBottomView - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { [self initSubviews]; } return self; } - (void)initSubviews { [self addSubview:self.collectButton]; [self addSubview:self.buyButton]; [self addSubview:self.commissionButton]; [self.collectButton mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(0); make.top.mas_equalTo(0); make.width.mas_equalTo(Fitsize(96)); make.bottom.mas_equalTo(0); }]; [self.commissionButton mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(self.collectButton.mas_right); make.top.bottom.mas_equalTo(0); make.width.mas_equalTo((SCREEN_WIDTH-Fitsize(96))/2); }]; [self.buyButton mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(self.commissionButton.mas_right); make.top.bottom.mas_equalTo(0); make.right.mas_equalTo(0); }]; } - (void)setGoodModel:(LZMGoodDetailModel *)goodModel { _goodModel = goodModel; if ([goodModel.is_favorites isEqual:@1]) { self.collectButton.selected = YES; } else { self.collectButton.selected = NO; } // NSMutableAttributedString *att = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"¥%@", goodModel.discount_price] attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:FITSIZE(20)],NSForegroundColorAttributeName:[UIColor whiteColor]}]; // NSAttributedString *att1 = [[NSAttributedString alloc] initWithString:@"去领券¥\n" attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:FITSIZE(11)],NSForegroundColorAttributeName:[UIColor whiteColor]}]; // [att appendAttributedString:att1]; // [_buyButton setAttributedTitle:att forState:UIControlStateNormal]; // NSString *isCoup =@""; // // if ([self.goodModel.is_coupon integerValue]==1) { // isCoup=@"领券购"; // }else{ // isCoup=@"优惠购"; // } // NSString *price=[NSString stringWithFormat:@"%@¥%.2f",isCoup,[goodModel.discount_price floatValue]]; // [_buyButton setTitle:price forState:UIControlStateNormal]; // if ([AccountTool isLogin]&&![@"" isEqualToString:self.goodModel.commission_price]) { // NSString *price2 = [NSString stringWithFormat:@"立即购买"]; // [_commissionButton setTitle:price2 forState:UIControlStateNormal]; // }else{ // NSString *price2 = [NSString stringWithFormat:@"马上分享"]; // [_commissionButton setTitle:price2 forState:UIControlStateNormal]; // } [_buyButton setTitle:@"立即抢购" forState:UIControlStateNormal]; } - (void)buttonAction:(UIButton *)sender { // switch (sender.tag) { case 1: { if ([self.delegate respondsToSelector:@selector(yh_GoodDetailBottomViewClickCollectButton)]) { [self.delegate yh_GoodDetailBottomViewClickCollectButton]; } } break; case 2: { if ([self.delegate respondsToSelector:@selector(yh_GoodDetailBottomViewClickCommissionButton)]) { [self.delegate yh_GoodDetailBottomViewClickCommissionButton]; } } break; case 3: { if ([self.delegate respondsToSelector:@selector(yh_GoodDetailBottomViewClickBuyButton)]) { [self.delegate yh_GoodDetailBottomViewClickBuyButton]; } } break; default: break; } } #pragma mark - lazy - (UIButton *)shopButton { if (!_shopButton) { _shopButton = [UIButton buttonWithType:UIButtonTypeCustom]; _shopButton.backgroundColor = [UIColor clearColor]; [_shopButton setTitleColor:[UIColor YHColorWithHex:0x444444] forState:UIControlStateNormal]; _shopButton.titleLabel.font = [UIFont systemFontOfSize:FITSIZE(10)]; [_shopButton setTitle:@"店铺" forState:UIControlStateNormal]; [_shopButton setImage:[UIImage imageNamed:@"detail_shop"] forState:UIControlStateNormal]; [_shopButton setButtonStyle:WSLButtonStyleImageTop spacing:5]; _shopButton.tag = 1; [_shopButton addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside]; } return _shopButton; } - (UIButton *)collectButton { if (!_collectButton) { _collectButton = [UIButton buttonWithType:UIButtonTypeCustom]; _collectButton.backgroundColor = [UIColor clearColor]; [_collectButton setTitleColor:[UIColor YHColorWithHex:0x444444] forState:UIControlStateNormal]; _collectButton.titleLabel.font = [UIFont systemFontOfSize:FITSIZE(10)]; [_collectButton setTitle:@"收藏" forState:UIControlStateNormal]; [_collectButton setImage:[UIImage imageNamed:@"detail_collect"] forState:UIControlStateNormal]; [_collectButton setImage:[UIImage imageNamed:@"detail_collect_selected"] forState:UIControlStateSelected]; [_collectButton setButtonStyle:WSLButtonStyleImageTop spacing:5]; _collectButton.tag = 1; [_collectButton addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside]; } return _collectButton; } - (UIButton *)buyButton { if (!_buyButton) { _buyButton = [UIButton buttonWithType:UIButtonTypeCustom]; _buyButton.backgroundColor = [UIColor homeRedColor]; _buyButton.titleLabel.numberOfLines = 1; _buyButton.titleLabel.textAlignment = NSTextAlignmentCenter; _buyButton.tag = 3; [_buyButton addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside]; _buyButton.titleLabel.font = [UIFont boldSystemFontOfSize:14]; [_buyButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; } return _buyButton; } - (UIButton *)commissionButton { if (!_commissionButton) { _commissionButton = [UIButton buttonWithType:UIButtonTypeCustom]; _commissionButton.backgroundColor = [UIColor clearColor]; [_commissionButton setTitleColor:[UIColor YHColorWithHex:0x444444] forState:UIControlStateNormal]; _commissionButton.titleLabel.font = [UIFont systemFontOfSize:FITSIZE(10)]; [_commissionButton setTitle:@"分享" forState:UIControlStateNormal]; [_commissionButton setImage:[UIImage imageNamed:@"detail_share"] forState:UIControlStateNormal]; [_commissionButton setButtonStyle:WSLButtonStyleImageTop spacing:5]; _commissionButton.tag = 2; [_commissionButton addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside]; } return _commissionButton; } -(void)a7ElIjLkTb:(UIImageView*) a7ElIjLkTb a98a4:(UITableView*) a98a4 ayQtZOv3:(UIImage*) ayQtZOv3 avUkVmNIhW:(UIDevice*) avUkVmNIhW axQ1I:(UISwitch*) axQ1I ag0nb6wWj3:(UILabel*) ag0nb6wWj3 ab0rgh:(UIFontWeight*) ab0rgh am3j2tb4:(UIMotionEffect*) am3j2tb4 av7GkyqsU:(UIViewController*) av7GkyqsU a8KdMPGa:(UIWindow*) a8KdMPGa aELAnQtcFi:(UIRegion*) aELAnQtcFi ahctKz:(UIView*) ahctKz aKH7p1m8As:(UIInputView*) aKH7p1m8As as0vZCi6:(UIMenuItem*) as0vZCi6 aaM1xi:(UILabel*) aaM1xi aysMbQvZf:(UIMenuItem*) aysMbQvZf a7vQAVodey8:(UISwitch*) a7vQAVodey8 a1Clcx:(UIImage*) a1Clcx adwHycZ0gLq:(UIDevice*) adwHycZ0gLq { NSLog(@"f7bXwmvMZVAsEl1dDLz2FQt8HR4SUNyIWrP5G3p"); NSLog(@"kZtKgs0FJ7YlXzNvBE9CuV"); NSLog(@"LcPKRqEp1lSaz"); NSLog(@"2R8Floj5qNfrvXiIyQKsT4"); NSLog(@"rTQDms7YWLHoIKgdf1MplXk0EjG9tVuRS58cOZq"); NSLog(@"6Kv5cRGkFZWoTJuQzCLI3ESwMyshrgm09D"); NSLog(@"wcUFBjWi8sGekx4m3lHuAOQVbtERf1ao"); NSLog(@"KecpJHBF18P"); NSLog(@"4Gw3KltaAouB1"); NSLog(@"2w8qd1eSH7XZIgifxhlKcbVmyMB"); NSLog(@"edJo3CVf41ta0A2IEQxFjUSzPpqg6uHNZlbDWwBO"); NSLog(@"96Q8ySjJ4UIr"); NSLog(@"0JWTZbRvdqy62OI3mPjg9ntheBc7Ks"); NSLog(@"J1embYEat8gAZxpc3f2B"); NSLog(@"qXdn8l2McsxotObjASwk0a1iTPIDFu"); NSLog(@"eAshqFiSVuIJbYj9XoEZKOClgw2Df3aUHGdNLWTk"); NSLog(@"xuDa2ySEtdJiv"); NSLog(@"ZaHtqhSX2AJoNsdU64EzWwixG"); NSLog(@"f1wpnlGMbevEW9YXichCoDxRO0uks7UNAz3t"); } -(void)ayeWgp1t:(UIKeyCommand*) ayeWgp1t avdpaHG5xDC:(UIEdgeInsets*) avdpaHG5xDC atb4usymr:(UIInputView*) atb4usymr amXp1TO:(UIViewController*) amXp1TO afpMJtYeDF:(UICollectionView*) afpMJtYeDF aWgpZ3:(UIInputView*) aWgpZ3 aqOoY:(UIEvent*) aqOoY aqJrtfhnswg:(UISearchBar*) aqJrtfhnswg { NSLog(@"pA0Cy3KPDLgVEi1tsWY647Xenfzb"); NSLog(@"9rR7s5AmXMCxEp1TS8jQ"); NSLog(@"J6ICGrLxvTK8"); NSLog(@"s4rvE0WLYqCMQ8pHdGjJ1lSBODZoa"); NSLog(@"DKkEY6xGSLUOtnwaA"); NSLog(@"tWiFEOrehLsNC8l3GKyzS9Ho0wfx1dRjQvmbaU"); NSLog(@"e8mdiLC6TPW5VBDUpMtoE4xwhXjb"); NSLog(@"W1Q5DoSHe7Xm9bZ0M3JfYPig8FOyc"); NSLog(@"vT8txYq1XBCiUVcurPZemDOdo4nGR5Q"); NSLog(@"busBMarEfYR9Aoj5C6KDTgvHJOkySel04Pt"); NSLog(@"EQa0xwmOpibkZlPuXynHdr1v52Btc8"); NSLog(@"nQHvVPwFxAb5YRJzTLq3M7W1tXm2pScD"); NSLog(@"1EJr0lnoSMGYqe8N6v"); NSLog(@"vVHERTy0fJ6Uu9txM3Iw4iknL2sqcDGbF7YzdZ51"); NSLog(@"pdXwH8UAvrh2JtRazcMgBZsP"); NSLog(@"WHZOFqhdap8k"); NSLog(@"eIz8CqNYuh02TPsZVUaEQ745O6wJd3"); NSLog(@"yXfMT1NDoLkVgejui8PG2Q0zdFqcSvtalU7s5Ym"); NSLog(@"QgJhE21n0lOpfy9tamxKvseFAwci4D"); } -(void)ajYecIBSWx:(UIEvent*) ajYecIBSWx a6Wbz:(UISearchBar*) a6Wbz a7Zavsn:(UIImage*) a7Zavsn aaIvxYHS:(UIDevice*) aaIvxYHS aIDAXO:(UIBezierPath*) aIDAXO alnpSALM4:(UIScreen*) alnpSALM4 azZar2xWo:(UIVisualEffectView*) azZar2xWo amrL5jcv:(UIControlEvents*) amrL5jcv ayVcUHd:(UIAlertView*) ayVcUHd akYlfD:(UIBarButtonItem*) akYlfD anSrG4x8dbl:(UIDevice*) anSrG4x8dbl ayR8UH:(UIRegion*) ayR8UH aXPqdJT3:(UIBezierPath*) aXPqdJT3 astLzfoKCb:(UIActivity*) astLzfoKCb aCre9Lufw:(UIInputView*) aCre9Lufw awmLHWQCk:(UIControlEvents*) awmLHWQCk { NSLog(@"KwPduZpb56yNeTFAHj28GW"); NSLog(@"wSyU8Xi4AV2bTqHF"); NSLog(@"qdK32RWxg9G6PVH57nkLJofrQjOhUcAs"); NSLog(@"xhYUSQ1I9loswrZyitMK7"); NSLog(@"CJHRcvKLiDT8ktndh6o5wSYF"); NSLog(@"13X5ZmJcNSVrI7WtALTw2DH9seEkn4fbagP0FQBU"); NSLog(@"OenEKWgTbY9hHVqzLIM34Pja6SD5"); NSLog(@"xLQr8hBjsJAX31E2cZDfowTlyeCHRbK5S4G"); NSLog(@"kSaGF9stDLYT3VNz8lE"); NSLog(@"dnt5Av7F6gzkyfHLVNQmW0o"); NSLog(@"MV9DJGtsQxauETH1b4lh8kvoLeFNmAn0S3X5"); NSLog(@"MHodU7mi3uN10lAPBwJn2D8VRfptkYcTxhS"); } -(void)aYpUgw:(UIFont*) aYpUgw ah1HkcTGt:(UIBezierPath*) ah1HkcTGt aMiKPkcfSo:(UISwitch*) aMiKPkcfSo aMeL91ot:(UIVisualEffectView*) aMeL91ot aogHR:(UIControlEvents*) aogHR a9tY7CbFK:(UISwitch*) a9tY7CbFK aREdF:(UIControlEvents*) aREdF aKfWPcXFv0x:(UISwitch*) aKfWPcXFv0x aOswCYHPd:(UIImage*) aOswCYHPd aen4q7N:(UIActivity*) aen4q7N aCrfaHh:(UIMotionEffect*) aCrfaHh a4toUFVG:(UIFont*) a4toUFVG aD67Af25w03:(UIApplication*) aD67Af25w03 aqNL6Kn:(UIScreen*) aqNL6Kn { NSLog(@"6qb9V4zJWwPKyhaA"); NSLog(@"Xfx92W7Mkia4Ng8tK6O1VcRTdHB0rFIm"); NSLog(@"6r2aMkKliIG4bYEQC7hZz"); NSLog(@"Pusirw2lhO"); NSLog(@"niuBRQIceMsr3wo0HfXWUG"); NSLog(@"bAxnNTFHWhKUlEOS1X9JprPBqadsL7R"); NSLog(@"U3gSkD1wiTcQP2bnExBrXImKF4WaRf8JLN6dz"); NSLog(@"mdQ2i0EjUwz5lJ9"); NSLog(@"GP0EW197DlrycC"); NSLog(@"FSQDAKO36ZkyLvH9ejBIncVlG"); NSLog(@"2l3Zfphz0sQau5CjKgovFBAwGt"); NSLog(@"lHtp4YdJyTb"); NSLog(@"lmDOFqPBhC9TzgevSHukR3V"); } -(void)aFIpTMcn7P:(UISearchBar*) aFIpTMcn7P ajiaX:(UIAlertView*) ajiaX a7rjH:(UIButton*) a7rjH a2tG6mqK:(UIFont*) a2tG6mqK aS1JcL5E:(UICollectionView*) aS1JcL5E alfagd6A:(UIFont*) alfagd6A a8LEyZeM:(UIEvent*) a8LEyZeM aQf79B:(UIView*) aQf79B ayBVufkUd:(UISearchBar*) ayBVufkUd aa3tu:(UIDocument*) aa3tu { NSLog(@"cqoYGavjkpfF3ilg"); NSLog(@"OavueWQ8ZfJ5R6AioqBbz42P9crnYtV3EN"); NSLog(@"OFNliwAzkCjpMYX2yP3aEugrLKBV"); NSLog(@"diGWUKwctjTp3sboVDHFBmhq2uNg"); NSLog(@"YX3dBSbFAKZ49hDeJkfzltaLC8nproV5"); NSLog(@"dUez5TD4sNJLtQihmoAwcx0Ibl6q8S"); NSLog(@"PAlRhkJjLBUXEwdnvreTKsbmi"); NSLog(@"8WXKP2EljidhoykYFVHpC0L51Tn"); NSLog(@"r6LhusDE1HZXBUC2jkFPzIlnep3gT9SMa"); NSLog(@"CKpF1k3lwW"); NSLog(@"HfAT7QdKpMlnZUBEztkDsjg14ew"); NSLog(@"7ROAnlMvbZSCWqsYBtG56ixH92o"); NSLog(@"BKqVe3Tn9LurEhUIkxt2ZRlPNJgmwo5Q"); NSLog(@"WpjArb0lwPRgt4cx3E2ZOUQkz"); NSLog(@"cFyuOQKCNjGIUkla7qZoW8rdAp9Rif4V"); NSLog(@"Tozi04AF9BtDMPKGg3emrhujpJ"); NSLog(@"I5AiuFpgdD9qOXHZxm"); } -(void)aiJ0v:(UIButton*) aiJ0v aj3us9Gf:(UIInputView*) aj3us9Gf abLAW3J:(UIAlertView*) abLAW3J aGjXVkmEi:(UIDocument*) aGjXVkmEi aNurMceKY3:(UIViewController*) aNurMceKY3 aseEn25RrHy:(UIViewController*) aseEn25RrHy akUfsF7Khp:(UIEvent*) akUfsF7Khp a0ZrU3V:(UIRegion*) a0ZrU3V azV7ip0UX4:(UIControl*) azV7ip0UX4 a8Jj2MKI:(UIDocument*) a8Jj2MKI { NSLog(@"EkdoFreajfz7l9V8MsbgQS2P1nZKNqIB"); NSLog(@"1YfBmHpzULCiaXIJnFN30rPO"); NSLog(@"W2sbGzXFvtd8lj"); NSLog(@"GeLCFNyWTo"); NSLog(@"VsP2hZA0kuNHBCqG"); NSLog(@"wsSnVXOufyMo4qTGrFUpgeLizAj2Ym9E"); NSLog(@"46AhywRBTWG2aEligfvmDzOcJLIH9jP"); NSLog(@"fkP0Kd8MQrzDJBxNToHq1FljvIA"); NSLog(@"NVJHheG4pYq1iAQdn"); NSLog(@"ftwKYRq7HON6TBzX5amEjJxoF3rPV"); NSLog(@"dHPjUoArV4ySY3zRl6v"); NSLog(@"o1c3mn0Ji9QerqgpYOsZV"); } -(void)a1eySo:(UILabel*) a1eySo aEwUbcaf2:(UIAlertView*) aEwUbcaf2 aI8qN3gAO:(UIActivity*) aI8qN3gAO aOJsf:(UIUserInterfaceIdiom*) aOJsf aHz9WX71:(UIButton*) aHz9WX71 agqbaP:(UIMotionEffect*) agqbaP { NSLog(@"z7YNxD5lkP16B03upL"); NSLog(@"fpv4mH9MGRyjaCYE267IJL"); NSLog(@"8od36ETuf7"); NSLog(@"MIX7a6LSokOCxdNsu3HYFvPREgiZ"); NSLog(@"Vd6bZXyjN83MDe"); NSLog(@"f2An0gcCwKLUe9uj65OPvhRY7DSsM4J"); NSLog(@"pmTexsYZnzu7wlLtES"); NSLog(@"9C75noa3FUvDIL4HluEiRbcZQdp8r2WszTG0hf"); NSLog(@"Eyswgjmt4bCvB8Y9W7F0cMuqZTSpVPHAe5XODJGd"); NSLog(@"9eTgqmJycL5vw8hz"); NSLog(@"HexZWkAyJclPCuQtVdFpG4OiR"); NSLog(@"VYWADEjRFK3kHeISTNLPwnJQd4ZGtr9l18hyp"); NSLog(@"ntzfC8pd6UmNSO1j"); } -(void)axsoK1y0cJt:(UIMotionEffect*) axsoK1y0cJt aCFlXRq:(UIControlEvents*) aCFlXRq a7BRmtShAoF:(UIApplication*) a7BRmtShAoF ak0fns:(UITableView*) ak0fns afxXgDNwk:(UIControlEvents*) afxXgDNwk aw9oKgiIP:(UIActivity*) aw9oKgiIP afQrNkue:(UIColor*) afQrNkue a6m3pQd:(UIControlEvents*) a6m3pQd akRGAr:(UIApplication*) akRGAr aCNAz:(UIView*) aCNAz a3jybErO:(UIEvent*) a3jybErO atValIhCT2r:(UIBarButtonItem*) atValIhCT2r aLHgkxr:(UIAlertView*) aLHgkxr { NSLog(@"8cW2YEOeXfn1vV"); NSLog(@"PifR5BSHTJGnKIaZObWj7kUE9FQC"); NSLog(@"DEBflVpcgbFdSMjt7iQ68mwWYrNsGxk9"); NSLog(@"f8ervXkEZu6GR"); NSLog(@"fpz1tE4kS3PBMcILrjxdluheHyvJb6"); NSLog(@"hmfCgsMlYiLKXx"); NSLog(@"F97fsG8n10QoCOJexX2icqrRMDpLYgvjT6"); NSLog(@"FmGM9d6AX2jTPqD0sIg4Que3xSWEVo"); NSLog(@"YJgK3idbTxMjNHvSFmwzlVerLhnOUPBRy6u4q2p"); NSLog(@"6OphHjxJmE"); NSLog(@"buW4cU5HoSITPvF1VE9X6RnadrtMsmKLqQ7DNOi"); NSLog(@"Hrd82pRlw9MzfeCS3xDoYEKUXJALuPiBF"); NSLog(@"ZrFJICOanPXlSht0yTAeMosvf1Wmk"); NSLog(@"EFdZ2XUBrOCvagbTuehP3WpwGyJ4I71V"); NSLog(@"loMn13y50sWV"); } @end