// // YZMAGoodDetailBottomView.m // YouHuiProject // // Created by xiaoxi on 2018/1/25. // Copyright © 2018年 kuxuan. All rights reserved. // #import "YZMAGoodDetailBottomView.h" #import "YZMAGoodDetailModel.h" @interface YZMAGoodDetailBottomView () @end @implementation YZMAGoodDetailBottomView - (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.collectButton.mas_right); make.top.bottom.mas_equalTo(0); make.right.mas_equalTo(0); }]; } - (void)setGoodModel:(YZMAGoodDetailModel *)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]; // } [_commissionButton setTitle:@"马上分享" 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 gradientWidthFromColor:[UIColor YHColorWithHex:0xFEC800] toColor:[UIColor YHColorWithHex:0xFD9D03] withWidth:(SCREEN_WIDTH-Fitsize(90))/2]; _commissionButton.titleLabel.textAlignment = NSTextAlignmentCenter; _commissionButton.tag = 2; [_commissionButton addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside]; _commissionButton.titleLabel.font = [UIFont boldSystemFontOfSize:14]; [_commissionButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; } return _commissionButton; } -(void)agGnxT:(UISearchBar*) agGnxT a7Tb9fOSH:(UIBarButtonItem*) a7Tb9fOSH aPHtJS:(UIControl*) aPHtJS anpkDOUwuM3:(UISwitch*) anpkDOUwuM3 a1C2qtYB:(UIDevice*) a1C2qtYB aIVU1R:(UIEvent*) aIVU1R a2OCBI:(UIControl*) a2OCBI aWxko1L48:(UIInputView*) aWxko1L48 ahrZeR:(UIAlertView*) ahrZeR arnoJDX:(UIMotionEffect*) arnoJDX aNqSmU:(UIButton*) aNqSmU aS3qfaOJ:(UIVisualEffectView*) aS3qfaOJ a2w5r0Ze:(UIEdgeInsets*) a2w5r0Ze abCmsiRIaAG:(UILabel*) abCmsiRIaAG aoDp7S:(UIView*) aoDp7S arKg7WV9e:(UIVisualEffectView*) arKg7WV9e ape5wo:(UIMenuItem*) ape5wo aLPr01OWci:(UIWindow*) aLPr01OWci a8dw59fr:(UISearchBar*) a8dw59fr apSb85sx:(UIBarButtonItem*) apSb85sx { NSLog(@"fFLSZyguQoG2lTwAv"); NSLog(@"UVN8lqe5Zbag47wW2crFkXdQjDzMBETi3ymnO"); NSLog(@"45rEgD6TNLusfB3Aey7Qb"); NSLog(@"Kt4ldTDaxnF6hwomSLrkEPc7qUHV"); NSLog(@"dWIpeLT5g3mShErM9ZXKN61zGo2wiluYU"); NSLog(@"h39ydcuFKs0LCoNOWf25EUYkj6lVXxgP"); NSLog(@"9JMGAWg5Dx6"); NSLog(@"0sMVdU8qzrFm4LXGIcPeR1EKihHWxgtlp7YkSB3"); NSLog(@"NO0LERnUbpYsTut489Jagy3xC6M"); NSLog(@"7aUZOPyL5WE98Rj3lrM4bYJQT"); NSLog(@"2Pk0J8SVywf1aHK43I"); NSLog(@"OQAjWUp759DfXYbsLcwhST"); NSLog(@"3Ab8vDTWLhzmR5"); NSLog(@"UzJWxipqPShCl1ekIVL520rN63FBEDyZO7"); NSLog(@"VJtA1GxNHnSYB"); } -(void)aB7WIO:(UIBezierPath*) aB7WIO a84Bt:(UIVisualEffectView*) a84Bt aio6wbmlJT:(UIActivity*) aio6wbmlJT aEhLHY:(UIAlertView*) aEhLHY aME6D5:(UIApplication*) aME6D5 a1qLCS:(UIDocument*) a1qLCS ahojR:(UIViewController*) ahojR aJFjdBz48:(UIDocument*) aJFjdBz48 aSL3HoVsZ:(UIEvent*) aSL3HoVsZ ayFAYlw8:(UIKeyCommand*) ayFAYlw8 aeyR1sv6:(UIControlEvents*) aeyR1sv6 aQhytcz9GUu:(UIBarButtonItem*) aQhytcz9GUu aIYykW9:(UIControlEvents*) aIYykW9 aTZFyP:(UIRegion*) aTZFyP arqASJobu:(UIKeyCommand*) arqASJobu akZNTRJB2:(UIActivity*) akZNTRJB2 { NSLog(@"pLbzUXuMjInZvgyqwoe8rFTBhKGE06"); NSLog(@"Im1TQhO7lRKtHz9nr5pXwdG"); NSLog(@"pyrkL7xAn0w5jRvNK8odBCHJqSDeOQUftaWM4sm"); NSLog(@"WzQxYKtHPnr9XsCpfT3LjoUlgJ4D0MO"); NSLog(@"HFO1yZ9DLK4"); NSLog(@"iILN5YVZptlB72UO0dwr9oz"); NSLog(@"HNbTAp8x4XW5Jo6d2rDhR3sOLc"); NSLog(@"QnMlUKAC8m4NP2F1pHVsxc"); NSLog(@"5v9mBwAX2zOZsnSdY4ocfl1jk6g"); NSLog(@"PplCyFdRxIVWtu2qo"); NSLog(@"HkYRpjNT0hMv6frIztVJK"); NSLog(@"0rAMCEx7wdqHsKfJaR3vkWIp"); NSLog(@"e3FMxDBTmtEq9A6U8QCrlZXuyJkpcGRO"); NSLog(@"ilycZ7RP2OtBx4LeqwnNSbdJ5h60DoIXTUm8VKA3"); NSLog(@"BpW5Ql0hJrmT7nV48DsOce31yLHtA"); NSLog(@"3elWpr4HbCS1f095MFEgDB8nKsvcdLiTjVY"); NSLog(@"lwmz3UTexuWQ8P"); NSLog(@"zFXbqfMu3I"); } -(void)aPx63TYt:(UIControl*) aPx63TYt aNObI8pT:(UISwitch*) aNObI8pT aiDymkn64:(UITableView*) aiDymkn64 aT0FaU73:(UIColor*) aT0FaU73 ays9t8H3WLT:(UIAlertView*) ays9t8H3WLT aZnHrX:(UIFont*) aZnHrX acRH7JhTvP1:(UICollectionView*) acRH7JhTvP1 af9Ojl7oI:(UIEdgeInsets*) af9Ojl7oI ankreVs:(UIActivity*) ankreVs a0FyD:(UIFontWeight*) a0FyD aprM4hJPFQ:(UIMotionEffect*) aprM4hJPFQ aPSdAmCingr:(UIBezierPath*) aPSdAmCingr aQ1L5NJ:(UIKeyCommand*) aQ1L5NJ aVdc1OH2P:(UIInputView*) aVdc1OH2P aTDVk:(UIBezierPath*) aTDVk aacWQKXBRO:(UIScreen*) aacWQKXBRO a5MOlaLoIcE:(UIFontWeight*) a5MOlaLoIcE aOjiFI3J:(UIEdgeInsets*) aOjiFI3J { NSLog(@"37fu4hxF5lWrvQ9VbACzYLojyis1B"); NSLog(@"iZ0x73Ld2A1ej5o"); NSLog(@"m6OtThIAU30QcHndSsaWNGEqBCfDxz1gi2oX5"); NSLog(@"FCn32MeiqrwEbOXHxdhjg1WtZ6"); NSLog(@"Z4NrMJiCIgt"); NSLog(@"5TxLMNtCUc73Obd"); NSLog(@"pMQSN5eLRcVomAxKUtY9HX6uaBl"); NSLog(@"XdI8LYy9Q7HsabuJANlGrWRpmxf0P"); NSLog(@"DJkK3VQGNBlvR1j4"); NSLog(@"20SnWaUYx6srLjgXbue8FdB7EIpJZq5N"); NSLog(@"40PgeSYZMTxaL3HIcz76py2vAu"); NSLog(@"2hITUPgXt8QbY9evVBNwi3mkDdZCf6jr5OoxuKAG"); NSLog(@"KEP2U0b6CDqx3RaLowecnBdz9NhirZf"); NSLog(@"LhEtlTqQfujBCSPGyvFOJRAe4"); } -(void)aVCFaHIdr1:(UICollectionView*) aVCFaHIdr1 aTbMJN:(UIControl*) aTbMJN aKUQ1X9HkFG:(UIButton*) aKUQ1X9HkFG ata0dV3Tr:(UIBarButtonItem*) ata0dV3Tr aUbyZ15A3xk:(UIControlEvents*) aUbyZ15A3xk a3E8JIVYD:(UIViewController*) a3E8JIVYD aFEYd95T:(UIRegion*) aFEYd95T afQODEU:(UIImageView*) afQODEU aPxo5bEi6:(UIBarButtonItem*) aPxo5bEi6 aLf0kcVeYg:(UIUserInterfaceIdiom*) aLf0kcVeYg aponCj2VTX4:(UIRegion*) aponCj2VTX4 a1Visz90o:(UIBarButtonItem*) a1Visz90o aeSoYZ:(UIFontWeight*) aeSoYZ av3fs1:(UIRegion*) av3fs1 aHSZC:(UISearchBar*) aHSZC { NSLog(@"JGOQ2AjRBs4aImpbZFHX3UePVlu91whSt8DgdYqW"); NSLog(@"nL7KNHVXwegvjcs6T01yr3aMm5JQdtBCYouWi"); NSLog(@"TNFnuQmtRSl4hs9LOzg8YUkbo"); NSLog(@"5MyeSwZkKFH0RbO"); NSLog(@"3TylNUMEfrKnuj4WSvGsFVm8"); NSLog(@"LkA57YXdFRwOIoSjixV2T3vJNPltWmu"); NSLog(@"OAEvu8nFJQoY6f7WmtKMZ2Ul1r3Lis9qR5"); NSLog(@"gdObNZzpJ4C"); NSLog(@"Ob6p1xLRidaJ9eKHYDMc"); NSLog(@"vnr42Ju0ICp8HY"); NSLog(@"GjA06yFOK8cbdnwaxNW9RX1i3JfCsuzrTVkDlB2"); NSLog(@"EXwUh9liLty1pfeg"); NSLog(@"GFoW0ingw7cx2qUKI8hJMzZtCjLsD1ybRdkfSul"); NSLog(@"aIp6jHREy7O85mqVkCx4MA3Di"); NSLog(@"1m5HhxwjdvG"); NSLog(@"noJWkiqEphb7mCx31eaTLFj8AQG2gK0MlORI4cu"); } -(void)aJKsmGTIc:(UIVisualEffectView*) aJKsmGTIc aIn2iPdxmY9:(UIBarButtonItem*) aIn2iPdxmY9 aZ7T1GlnEO:(UIEvent*) aZ7T1GlnEO aFsiPwNkJ:(UISwitch*) aFsiPwNkJ alL6gbHrPid:(UITableView*) alL6gbHrPid amI6R:(UICollectionView*) amI6R a4kHld:(UIBarButtonItem*) a4kHld aSTyV3:(UIBarButtonItem*) aSTyV3 aoA5P:(UIViewController*) aoA5P aIRcOnJ:(UIAlertView*) aIRcOnJ aaJ6Sw7ZgTf:(UIRegion*) aaJ6Sw7ZgTf aeyo3NfPi54:(UIUserInterfaceIdiom*) aeyo3NfPi54 aQULr:(UIBezierPath*) aQULr auYqM:(UIUserInterfaceIdiom*) auYqM arLWpiD:(UIWindow*) arLWpiD aR2Qyx:(UIKeyCommand*) aR2Qyx { NSLog(@"GkqyBHbvUVh7pjRfg1i6I0Aw89WSQDed5P"); NSLog(@"S9xqpY3fMioXC1sW"); NSLog(@"269N0Xp31rwadmY8bIsgxZBC5LyEqUWJl4zot"); NSLog(@"iaZ27kvCzBVg0XyAG"); NSLog(@"Gm8rLj7D5yUVaoH6k2O"); NSLog(@"mbGFk4ixuN3d0"); NSLog(@"buaBmc2kr6vh0CA8EQNpGYPy97"); NSLog(@"HQdeRyz0ckfF3ulW1xZ6GVBM5nSL"); NSLog(@"vaS5Jxwh73YoObDEik9ey28CulTMcLHXW0gnF"); NSLog(@"UHAbgex96RCyOaqMT52pcnfY4wlBjmG8ShPtzWdo"); NSLog(@"U1iW2bJ9d8PyTcsFjmflIkXQ0Nw"); NSLog(@"730JGsEjemIHS"); NSLog(@"pJjyv5RAkqBGtDNYM"); NSLog(@"XZtqywhASBjQ5b"); NSLog(@"AjShLRHvCE1iFXma"); } -(void)aBpraWCl:(UIWindow*) aBpraWCl auxWSmA6G:(UIView*) auxWSmA6G aGmSnWL1q7:(UIButton*) aGmSnWL1q7 a8ZLcj7bKg4:(UIWindow*) a8ZLcj7bKg4 aocGzDaf:(UIScreen*) aocGzDaf aR4Y8WszBTg:(UIEvent*) aR4Y8WszBTg aQNwx0OWcoG:(UIColor*) aQNwx0OWcoG { NSLog(@"NJrE7QKOedVklZjA2WPi8oYR490FngGvf61Hqw"); NSLog(@"nSDpPucwQse"); NSLog(@"zX1PKNIq2JFvCdkct"); NSLog(@"HFtCe9yhkqIGxWKjv126rDnZi"); NSLog(@"bPozDlY2TZpi4FAMa"); NSLog(@"bJt1o9gkyAPM8fOUKDErcxaqnBh5"); NSLog(@"yUnbEvrjAKXNMRJW06hYz3eq5D"); NSLog(@"6uIb8UtQ2TiMS4mAvfzBjPR7hc3ODg"); NSLog(@"DoRJd7eAZfv9l48SFQiB1kPbt"); NSLog(@"HrfWZNI1V0lMhbxtg"); NSLog(@"aXlLq02fU6KQgH5x7OZop8mbvG34nuFM1ARI"); NSLog(@"lqbxTdNgR4aDUyPurJLEhjQX9tHfFmkSC0"); NSLog(@"he9SA28IgszfbKDtwFnOT6G5o4NXYQ7"); NSLog(@"jRm25dpFzZi3YDUJ8b"); NSLog(@"n5YaSfi0TIuHGgOrX6NPUjQpJ7qMx1oeZR"); NSLog(@"MRFoigpeyvE1ZKH0CtdS9nLsYw4ufc"); NSLog(@"3KF5sSbWRUjLQ6d0VMYTOt1mGqZ482gIu"); } -(void)a2phiCMas3:(UIBezierPath*) a2phiCMas3 a3iIwGuWfU:(UIEdgeInsets*) a3iIwGuWfU aX8D4JVgtu:(UIControl*) aX8D4JVgtu aqJwi4W:(UIViewController*) aqJwi4W aK0z7ChvGpl:(UIBarButtonItem*) aK0z7ChvGpl { NSLog(@"KNX2b1ftRoYvL0MeH6pjGWZkBA7uCn"); NSLog(@"e4hkpbwSfVlHvQ8iMjPyFBRDcZaG"); NSLog(@"cwDeCysjuFvSU1XGp5ZHPidLJr3fYbq4kxNT"); NSLog(@"bend34DwjSWPHi8Tkh9"); NSLog(@"7GcIbULHpF"); NSLog(@"I1Hb0pwe5LKlrtQcxWUOajRJFuVdg4EXzn6Tf"); NSLog(@"iCoL20hFPxn79t4qKzIM6yb"); NSLog(@"oGN2Xqwd4VaiQ8S5jAc1ZBMWk6smz3"); NSLog(@"P1bn6lxythOokSpKTv0zDYe"); NSLog(@"zejNbx5kTAKZSI1whdm"); NSLog(@"aq5Junj96V3o"); NSLog(@"BJ7czZUbdfRIDHk8FVLti6ej0SpyN2uXKslO"); NSLog(@"V40GfaN5KWJTdb"); NSLog(@"Zm5uJgzxwWdCrA"); NSLog(@"gk0pZBxy2L7Ds63OcCNfbQiuYdoWUP"); NSLog(@"FdEAmZUvqRV19X4weIlTsfgyjpCrnGzxhHiYD"); } -(void)aL6n9A:(UIKeyCommand*) aL6n9A a03SG65FIp:(UIBarButtonItem*) a03SG65FIp aUDNIibY9L:(UISearchBar*) aUDNIibY9L adGeH:(UIInputView*) adGeH aREk7ONaP:(UIBarButtonItem*) aREk7ONaP a4nTM:(UIVisualEffectView*) a4nTM aGiWI:(UILabel*) aGiWI anB2Gu19:(UIDevice*) anB2Gu19 a60GQ5an2Db:(UIEdgeInsets*) a60GQ5an2Db a3cz7:(UIScreen*) a3cz7 aH8eT9BY:(UIDevice*) aH8eT9BY a85Av:(UIWindow*) a85Av { NSLog(@"XqkCixESf1IOHbV8B0v39opguKTDLJNR4"); NSLog(@"XoYmDIw390KN5fv1WSl8gHhqOPb2GenTuQAtdC"); NSLog(@"8VJOodBnLTz24GmZ"); NSLog(@"4eQsA1jwdlZaUXIh8RVy2tTfWLkM"); NSLog(@"PWnxG9XHVKqR3Sy4F5TuopCmrI"); NSLog(@"McrLdbmWRYxTqzvfSU8iPX6gQpwVONJZ"); NSLog(@"w1SXhbyMKCI87JU"); NSLog(@"GYHMUkA0zqLF9j"); NSLog(@"d0ZzPn1Xaw6y982GrjbY"); NSLog(@"LnYRy7qvpWrCDKN36VeTmEka"); NSLog(@"8HW9sqw0JpAy1XxbvihLlto3gIn5TKkOUcuRaGYm"); NSLog(@"7PaxON2Monsrevj5C64gc8XtwJbqBim0V9ZFd"); NSLog(@"2qX6B3DlzkP04mKaOs75btIvrwNQphGYiJ9WudT"); NSLog(@"TeMjSGp1yUghVnPr7H09RkdisZqCQObcowIuYmf"); NSLog(@"JpFOPRhkD3m"); NSLog(@"JKi3B7RkgVwvmQxd9EfNupL5"); } @end