房间内贵族礼物面板

This commit is contained in:
chenguilong
2021-12-27 17:17:21 +08:00
committed by fengshuo
parent 1b257041de
commit 90a615c468
8 changed files with 98 additions and 16 deletions

View File

@@ -27,6 +27,8 @@
@property (nonatomic,strong) UIButton *packGiftButton;
///
@property (nonatomic,strong) UIButton *luckyGiftButton;
///
@property (nonatomic,strong) UIButton *nobleGiftButton;
///
@property (nonatomic,strong) UIView * segmentPlaceView;
///
@@ -45,6 +47,8 @@
@property (nonatomic,strong) NSArray<GiftInfoModel *> *giftArray;
/////
@property (nonatomic,strong) NSArray<GiftInfoModel *> *giftLuckyArray;
///
@property (nonatomic, strong) NSArray<GiftInfoModel *> *giftNobleArray;
/////
@property (nonatomic,strong) NSArray<GiftInfoModel *> *giftPackArray;
///
@@ -71,6 +75,7 @@
- (void)didClickGiftSegmentAction:(UIButton *)sender {
self.normalGiftButton.selected = NO;
self.luckyGiftButton.selected = NO;
self.nobleGiftButton.selected = NO;
self.packGiftButton.selected = NO;
sender.selected = !sender.selected;
self.segmentType = sender.tag;
@@ -100,6 +105,7 @@
///
[self.segmentStackView addArrangedSubview:self.normalGiftButton];
[self.segmentStackView addArrangedSubview:self.luckyGiftButton];
[self.segmentStackView addArrangedSubview:self.nobleGiftButton];
[self.segmentStackView addArrangedSubview:self.packGiftButton];
[self.segmentStackView addArrangedSubview:self.segmentPlaceView];
[self.segmentStackView addArrangedSubview:self.playRuleButton];
@@ -253,6 +259,7 @@
[self resetSelectGift:self.giftArray];
[self resetSelectGift:self.packOriginArray];
[self resetSelectGift:self.giftLuckyArray];
[self resetSelectGift:self.giftNobleArray];
self.totalValueLabel.hidden = YES;
switch (_segmentType) {
case GiftSegmentType_Normal:
@@ -261,6 +268,9 @@
case GiftSegmentType_Lucky:
[self.datasource addObjectsFromArray:self.giftLuckyArray];
break;
case GiftSegmentType_Noble:
[self.datasource addObjectsFromArray:self.giftNobleArray];
break;
case GiftSegmentType_Pack:
{
[self.datasource addObjectsFromArray:self.packOriginArray];
@@ -292,16 +302,20 @@
- (void)setNormalOriginArray:(NSArray *)normalOriginArray {
_normalOriginArray = normalOriginArray;
NSMutableArray * luckyArray = [NSMutableArray array];
NSMutableArray * normaleArray = [NSMutableArray array];
NSMutableArray * normaleArray = [NSMutableArray array];
NSMutableArray * nobleArray = [NSMutableArray array];
[_normalOriginArray enumerateObjectsUsingBlock:^(GiftInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
if (obj.giftType == GiftType_Lucky) {
[luckyArray addObject:obj];
} else if(obj.giftType == GiftType_Game) {
[normaleArray addObject:obj];
}
} else if (obj.giftType == GiftType_Noble) {
[nobleArray addObject:obj];
}
}];
self.giftArray = normaleArray;
self.giftLuckyArray = luckyArray;
self.giftNobleArray = nobleArray;
self.segmentType = GiftSegmentType_Normal;
}
@@ -349,17 +363,31 @@
}
- (UIButton *)luckyGiftButton {
if (!_luckyGiftButton) {
_luckyGiftButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_luckyGiftButton setTitle:@"幸运礼物" forState:UIControlStateNormal];
[_luckyGiftButton setTitleColor:[ThemeColor giftSegmentSelectTitleColor] forState:UIControlStateSelected];
[_luckyGiftButton setTitleColor:[ThemeColor giftSegmentNormalTitleColor] forState:UIControlStateNormal];
_luckyGiftButton.titleLabel.font = [UIFont systemFontOfSize:14];
_luckyGiftButton.tag = GiftSegmentType_Lucky;
_luckyGiftButton.selected = NO;
[_luckyGiftButton addTarget:self action:@ selector(didClickGiftSegmentAction:) forControlEvents:UIControlEventTouchUpInside];
}
return _luckyGiftButton;
if (!_luckyGiftButton) {
_luckyGiftButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_luckyGiftButton setTitle:@"幸运礼物" forState:UIControlStateNormal];
[_luckyGiftButton setTitleColor:[ThemeColor giftSegmentSelectTitleColor] forState:UIControlStateSelected];
[_luckyGiftButton setTitleColor:[ThemeColor giftSegmentNormalTitleColor] forState:UIControlStateNormal];
_luckyGiftButton.titleLabel.font = [UIFont systemFontOfSize:14];
_luckyGiftButton.tag = GiftSegmentType_Lucky;
_luckyGiftButton.selected = NO;
[_luckyGiftButton addTarget:self action:@selector(didClickGiftSegmentAction:) forControlEvents:UIControlEventTouchUpInside];
}
return _luckyGiftButton;
}
- (UIButton *)nobleGiftButton {
if (!_nobleGiftButton) {
_nobleGiftButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_nobleGiftButton setTitle:@"贵族礼物" forState:UIControlStateNormal];
[_nobleGiftButton setTitleColor:[ThemeColor giftSegmentSelectTitleColor] forState:UIControlStateSelected];
[_nobleGiftButton setTitleColor:[ThemeColor giftSegmentNormalTitleColor] forState:UIControlStateNormal];
_nobleGiftButton.titleLabel.font = [UIFont systemFontOfSize:14];
_nobleGiftButton.tag = GiftSegmentType_Noble;
_nobleGiftButton.selected = NO;
[_nobleGiftButton addTarget:self action:@selector(didClickGiftSegmentAction:) forControlEvents:UIControlEventTouchUpInside];
}
return _nobleGiftButton;
}
- (UIButton *)packGiftButton {