房间内贵族礼物面板
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user