123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- //
- #import "LDSearchCoupleBottomView.h"
- @interface LDSearchCoupleBottomView ()
- @property (nonatomic, strong) UIButton *searchBtn;
- @property (nonatomic, strong) UIButton *shareBtn;
- @property (nonatomic, strong) UIButton *payBtn;
- @end
- @implementation LDSearchCoupleBottomView
- - (instancetype)initWithFrame:(CGRect)frame
- {
- self = [super initWithFrame:frame];
- if (self) {
- self.backgroundColor = [UIColor homeRedColor];
- [self initUI];
- }
- return self;
- }
- - (void)initUI {
- [self addSubview:self.searchBtn];
- [self addSubview:self.shareBtn];
- [self addSubview:self.payBtn];
- }
- - (void)showSearch {
- self.searchBtn.hidden = NO;
- self.shareBtn.hidden = YES;
- self.payBtn.hidden = YES;
- }
- - (void)showPay {
- self.searchBtn.hidden = YES;
- self.shareBtn.hidden = NO;
- self.payBtn.hidden = NO;
- }
- - (void)searchCouple {
- if (self.delegate && [self.delegate respondsToSelector:@selector(bottomViewSearchClick)]) {
- [self.delegate bottomViewSearchClick];
- }
- }
- - (void)shareAction {
- if (self.delegate && [self.delegate respondsToSelector:@selector(bottomViewShareClick)]) {
- [self.delegate bottomViewShareClick];
- }
- }
- - (void)payAction {
- if ([self.delegate respondsToSelector:@selector(bottomViewPayClick)]) {
- [self.delegate bottomViewPayClick];
- }
- }
- - (UIButton *)searchBtn {
- if (!_searchBtn) {
- _searchBtn = [[UIButton alloc] initWithFrame:self.bounds];
- [_searchBtn setTitle:@"搜券查佣金" forState:UIControlStateNormal];
- [_searchBtn setImage:[UIImage imageNamed:@"sousuo"] forState:UIControlStateNormal];
- [_searchBtn setButtonImageTitleStyle:ButtonImageTitleStyleLeft padding:7];
- _searchBtn.titleLabel.font = [UIFont systemFontOfSize:15];
- [_searchBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
- [_searchBtn addTarget:self action:@selector(searchCouple) forControlEvents:UIControlEventTouchUpInside];
- }
- return _searchBtn;
- }
- - (UIButton *)shareBtn {
- if (!_shareBtn) {
- _shareBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, Fitsize(137), self.height)];
- [_shareBtn setTitle:@"分享" forState:UIControlStateNormal];
- [_shareBtn setImage:[UIImage imageNamed:@"fenxiang-3"] forState:UIControlStateNormal];
- _shareBtn.titleLabel.font = [UIFont systemFontOfSize:15];
- _shareBtn.backgroundColor = [UIColor YHColorWithHex:0xFF9402];
- [_shareBtn setButtonImageTitleStyle:ButtonImageTitleStyleLeft padding:7];
- [_shareBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
- [_shareBtn addTarget:self action:@selector(shareAction) forControlEvents:UIControlEventTouchUpInside];
- }
- return _shareBtn;
- }
- - (UIButton *)payBtn {
- if (!_payBtn) {
- _payBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.shareBtn.right, 0, self.width-self.shareBtn.width, self.height)];
- [_payBtn setTitle:@"立即购买" forState:UIControlStateNormal];
- [_payBtn setImage:[UIImage imageNamed:@"quan-2"] forState:UIControlStateNormal];
- _payBtn.backgroundColor = [UIColor homeRedColor];
- _payBtn.titleLabel.font = [UIFont systemFontOfSize:15];
- [_payBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
- [_payBtn setButtonImageTitleStyle:ButtonImageTitleStyleLeft padding:7];
- [_payBtn addTarget:self action:@selector(payAction) forControlEvents:UIControlEventTouchUpInside];
- }
- return _payBtn;
- }
- @end
|