123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- //
- // YOUPAILZLiveBoardCycleViewCell.m
- // VQU
- //
- // Created by CY on 2021/7/23.
- // Copyright © 2021 leo. All rights reserved.
- //
- #import "YOUPAILZLiveBoardCycleViewCell.h"
- @interface YOUPAILZLiveBoardCycleViewCell()
- @property (nonatomic,weak) UIButton *youpaiptotalMoneyBgBtn;
- @property (nonatomic,weak) UILabel *youpaiptotalMoneyL;
- @property (nonatomic,weak) UIButton *youpaipgapMoneyBgBtn;
- @property (nonatomic,weak) UILabel *youpaipgapMoneyDescL;
- @property (nonatomic,weak) UILabel *youpaipgapMoneyL;
- @property (nonatomic,weak) UIButton *youpaipnoBgBtn;
- @property (nonatomic,weak) UILabel *youpaipnoL;
- @end
- @implementation YOUPAILZLiveBoardCycleViewCell
- - (instancetype)initWithFrame:(CGRect)frame{
- if (self = [super initWithFrame:frame]) {
- [self youpaifinitUI];
- }
- return self;
- }
- - (void)youpaifinitUI{
- UIButton *youpaiptotalMoneyBgBtn = [UIButton buttonWithType:UIButtonTypeCustom];
- youpaiptotalMoneyBgBtn.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.3f];
- youpaiptotalMoneyBgBtn.layer.cornerRadius = 10.0f;
- youpaiptotalMoneyBgBtn.hidden = YES;
- youpaiptotalMoneyBgBtn.clipsToBounds = YES;
- [youpaiptotalMoneyBgBtn addTarget:self action:@selector(youpaifbtnClick) forControlEvents:UIControlEventTouchUpInside];
- [self.contentView addSubview:youpaiptotalMoneyBgBtn];
- self.youpaiptotalMoneyBgBtn = youpaiptotalMoneyBgBtn;
- [youpaiptotalMoneyBgBtn mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.top.bottom.offset(0.0f);
- }];
-
- UIImageView *totalMoneyImgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"vqu_images_ic_user_show_zuanshi11"]];
- [youpaiptotalMoneyBgBtn addSubview:totalMoneyImgV];
- [totalMoneyImgV mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.offset(5.0f);
- make.centerY.equalTo(youpaiptotalMoneyBgBtn);
- make.size.mas_offset(CGSizeMake(12.0f, 12.0f));
- }];
-
- UILabel *youpaiptotalMoneyL = [[UILabel alloc] init];
- youpaiptotalMoneyL.font = LCFont(11.0f);
- youpaiptotalMoneyL.textColor = [UIColor whiteColor];
- [youpaiptotalMoneyBgBtn addSubview:youpaiptotalMoneyL];
- self.youpaiptotalMoneyL = youpaiptotalMoneyL;
- [youpaiptotalMoneyL mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.equalTo(totalMoneyImgV.mas_right).offset(2.0f);
- make.right.offset(-5.0f);
- make.top.bottom.offset(0.0f);
- }];
-
-
-
-
- UIButton *youpaipgapMoneyBgBtn = [UIButton buttonWithType:UIButtonTypeCustom];
- youpaipgapMoneyBgBtn.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.3f];
- youpaipgapMoneyBgBtn.layer.cornerRadius = 10.0f;
- youpaipgapMoneyBgBtn.hidden = YES;
- youpaipgapMoneyBgBtn.clipsToBounds = YES;
- [youpaipgapMoneyBgBtn addTarget:self action:@selector(btnClick) forControlEvents:UIControlEventTouchUpInside];
- [self.contentView addSubview:youpaipgapMoneyBgBtn];
- self.youpaipgapMoneyBgBtn = youpaipgapMoneyBgBtn;
- [youpaipgapMoneyBgBtn mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.top.bottom.offset(0.0f);
- }];
- UILabel *youpaipgapMoneyDescL = [[UILabel alloc] init];
- youpaipgapMoneyDescL.font = LCFont(11.0f);
- youpaipgapMoneyDescL.textColor = [UIColor whiteColor];
- [youpaipgapMoneyBgBtn addSubview:youpaipgapMoneyDescL];
- self.youpaipgapMoneyDescL = youpaipgapMoneyDescL;
- [youpaipgapMoneyDescL mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.offset(5.0f);
- make.top.bottom.offset(0.0f);
- }];
- UIImageView *gapMoneyImgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"vqu_images_ic_user_show_zuanshi11"]];
- [youpaipgapMoneyBgBtn addSubview:gapMoneyImgV];
- [gapMoneyImgV mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.equalTo(youpaipgapMoneyDescL.mas_right).offset(0.0f);
- make.centerY.equalTo(youpaipgapMoneyBgBtn);
- make.size.mas_offset(CGSizeMake(12.0f, 12.0f));
- }];
- UILabel *youpaipgapMoneyL = [[UILabel alloc] init];
- youpaipgapMoneyL.font = LCFont(11.0f);
- youpaipgapMoneyL.textColor = [UIColor whiteColor];
- [youpaipgapMoneyBgBtn addSubview:youpaipgapMoneyL];
- self.youpaipgapMoneyL = youpaipgapMoneyL;
- [youpaipgapMoneyL mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.equalTo(gapMoneyImgV.mas_right).offset(2.0f);
- make.right.offset(-5.0f);
- make.top.bottom.offset(0.0f);
- }];
- UIButton *youpaipnoBgBtn = [UIButton buttonWithType:UIButtonTypeCustom];
- youpaipnoBgBtn.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.3f];
- youpaipnoBgBtn.layer.cornerRadius = 10.0f;
- youpaipnoBgBtn.hidden = YES;
- youpaipnoBgBtn.clipsToBounds = YES;
- [youpaipnoBgBtn addTarget:self action:@selector(btnClick) forControlEvents:UIControlEventTouchUpInside];
- [self.contentView addSubview:youpaipnoBgBtn];
- self.youpaipnoBgBtn = youpaipnoBgBtn;
- [youpaipnoBgBtn mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.top.bottom.offset(0.0f);
- }];
- UILabel *noL = [[UILabel alloc] init];
- noL.font = LCFont(11.0f);
- noL.textColor = HexColorFromRGB(0xFFDD8D);
- [youpaipnoBgBtn addSubview:noL];
- self.youpaipnoL = noL;
- [noL mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.offset(14.0f);
- make.right.offset(-14.0f);
- make.top.bottom.offset(0.0f);
- }];
-
-
- }
- - (void)youpaifreloadWithModel:(LZLiveAnchorRankInfoContentModel *)model type:(NSString *)type{
- self.youpaipnoBgBtn.hidden = YES;
- self.youpaiptotalMoneyBgBtn.hidden = YES;
- self.youpaipgapMoneyBgBtn.hidden = YES;
- if ([type isEqual:@"no"]) {
- self.youpaipnoBgBtn.hidden = NO;
- self.youpaipnoL.text = model.youpaipval;
- }
- if ([type isEqual:@"totalMoney"]) {
- self.youpaiptotalMoneyBgBtn.hidden = NO;
- self.youpaiptotalMoneyL.text = model.youpaipval;
- }
- if ([type isEqual:@"gapMoney"]) {
- self.youpaipgapMoneyBgBtn.hidden = NO;
- self.youpaipgapMoneyDescL.text = model.youpaipdetail;
- self.youpaipgapMoneyL.text = model.youpaipval;
- }
-
- }
- - (void)youpaifbtnClick{
- if (self.youpaipclickBlock != nil) {
- self.youpaipclickBlock();
- }
- }
- @end
|