涂鸦礼物完成
This commit is contained in:
@@ -23,7 +23,8 @@
|
||||
#import "XPWeekStarInfoView.h"
|
||||
|
||||
@interface XPGiftInfoView ()<UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, XPWeekStarInfoViewDelegate, XPGiftWeekStarCollectionViewCellDelegate>
|
||||
///
|
||||
///滚动的容器
|
||||
@property (nonatomic,strong) UIScrollView *scrollView;
|
||||
@property (nonatomic,strong) UIStackView *segmentStackView;
|
||||
///普通礼物
|
||||
@property (nonatomic,strong) UIButton *normalGiftButton;
|
||||
@@ -131,8 +132,10 @@
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
|
||||
[self addSubview:self.segmentStackView];
|
||||
[self addSubview:self.scrollView];
|
||||
[self addSubview:self.giftStackView];
|
||||
|
||||
[self.scrollView addSubview:self.segmentStackView];
|
||||
///分段控制
|
||||
[self.segmentStackView addArrangedSubview:self.normalGiftButton];
|
||||
[self.segmentStackView addArrangedSubview:self.luckyGiftButton];
|
||||
@@ -154,9 +157,12 @@
|
||||
[self mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(30 + 108 * 2 + 10 + 10 + 15);
|
||||
}];
|
||||
|
||||
|
||||
[self.segmentStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
|
||||
[self.segmentStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.bottom.leading.trailing.height.mas_equalTo(self.scrollView);
|
||||
}];
|
||||
|
||||
[self.scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(self).inset(15);
|
||||
make.top.mas_equalTo(self);
|
||||
make.height.mas_equalTo(30);
|
||||
@@ -394,6 +400,10 @@
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPGiftInfoView:didClickSegment:)]) {
|
||||
[self.delegate xPGiftInfoView:self didClickSegment:_segmentType];
|
||||
}
|
||||
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPGiftInfoView:didClickItem:type:)]) {
|
||||
[self.delegate xPGiftInfoView:self didClickItem:self.lastSelectGift type:_segmentType];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setNormalOriginArray:(NSArray *)normalOriginArray {
|
||||
@@ -402,6 +412,7 @@
|
||||
NSMutableArray * normaleArray = [NSMutableArray array];
|
||||
NSMutableArray * nobleArray = [NSMutableArray array];
|
||||
NSMutableArray * weekStarArray = [NSMutableArray array];
|
||||
NSMutableArray * graffiti = [NSMutableArray array];
|
||||
[_normalOriginArray enumerateObjectsUsingBlock:^(GiftInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if (obj.giftType == GiftType_Lucky) {
|
||||
[luckyArray addObject:obj];
|
||||
@@ -411,13 +422,15 @@
|
||||
[nobleArray addObject:obj];
|
||||
} else if (obj.giftType == GiftType_WeekStar) {
|
||||
[weekStarArray addObject:obj];
|
||||
}
|
||||
} else if (obj.giftType == GiftType_Graffiti) {
|
||||
[graffiti addObject:obj];
|
||||
}
|
||||
}];
|
||||
self.giftArray = normaleArray;
|
||||
self.giftLuckyArray = luckyArray;
|
||||
self.giftNobleArray = nobleArray;
|
||||
self.giftWeekStarArray = weekStarArray;
|
||||
self.giftGraffitiArray = luckyArray;
|
||||
self.giftGraffitiArray = graffiti;
|
||||
if (self.defaultSelectGiftId.length) {
|
||||
for (GiftInfoModel *gift in self.normalOriginArray) {
|
||||
if (gift.giftId == [self.defaultSelectGiftId integerValue]) {
|
||||
@@ -469,6 +482,7 @@
|
||||
_usingplaceType = usingplaceType;
|
||||
if (_usingplaceType == SendGiftType_User) {
|
||||
self.luckyGiftButton.hidden = YES;
|
||||
self.graffitiButton.hidden = YES;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -669,5 +683,14 @@
|
||||
return _datasource;
|
||||
}
|
||||
|
||||
- (UIScrollView *)scrollView {
|
||||
if (!_scrollView) {
|
||||
_scrollView = [[UIScrollView alloc] init];
|
||||
_scrollView.backgroundColor = [UIColor clearColor];
|
||||
_scrollView.showsHorizontalScrollIndicator = NO;
|
||||
}
|
||||
return _scrollView;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
Reference in New Issue
Block a user