h5跳转房间打开礼物面板
This commit is contained in:
@@ -69,6 +69,8 @@
|
||||
@property (nonatomic,assign) GiftSegmentType segmentType;
|
||||
///最后一次选中的礼物
|
||||
@property (nonatomic,strong) GiftInfoModel *lastSelectGift;
|
||||
|
||||
@property (nonatomic, assign) NSInteger selectIndex;
|
||||
@end
|
||||
|
||||
@implementation XPGiftInfoView
|
||||
@@ -351,8 +353,17 @@
|
||||
break;
|
||||
}
|
||||
if (self.datasource.count > 0) {
|
||||
GiftInfoModel * gift = [self.datasource firstObject];
|
||||
[self dealSelectGift:gift];
|
||||
if (self.defaultSelectGiftId.length) {
|
||||
for (GiftInfoModel * gift in self.datasource) {
|
||||
if (gift.giftId == [self.defaultSelectGiftId integerValue]) {
|
||||
[self dealSelectGift:gift];
|
||||
self.selectIndex = [self.datasource indexOfObject:gift];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
GiftInfoModel * gift = [self.datasource firstObject];
|
||||
[self dealSelectGift:gift];
|
||||
}
|
||||
} else {
|
||||
self.playRuleButton.hidden = YES;
|
||||
}
|
||||
@@ -393,7 +404,34 @@
|
||||
self.giftLuckyArray = luckyArray;
|
||||
self.giftNobleArray = nobleArray;
|
||||
self.giftWeekStarArray = weekStarArray;
|
||||
self.segmentType = GiftSegmentType_Normal;
|
||||
if (self.defaultSelectGiftId.length) {
|
||||
for (GiftInfoModel *gift in self.normalOriginArray) {
|
||||
if (gift.giftId == [self.defaultSelectGiftId integerValue]) {
|
||||
self.segmentType = GiftSegmentType_Normal;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (GiftInfoModel *gift in self.giftLuckyArray) {
|
||||
if (gift.giftId == [self.defaultSelectGiftId integerValue]) {
|
||||
self.segmentType = GiftSegmentType_Lucky;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (GiftInfoModel *gift in self.giftNobleArray) {
|
||||
if (gift.giftId == [self.defaultSelectGiftId integerValue]) {
|
||||
self.segmentType = GiftSegmentType_Noble;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (GiftInfoModel *gift in self.giftWeekStarArray) {
|
||||
if (gift.giftId == [self.defaultSelectGiftId integerValue]) {
|
||||
self.segmentType = GiftSegmentType_WeekStar;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
self.segmentType = GiftSegmentType_Normal;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setPackOriginArray:(NSArray *)packOriginArray {
|
||||
@@ -413,6 +451,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setDefaultSelectGiftId:(NSString *)defaultSelectGiftId {
|
||||
_defaultSelectGiftId = defaultSelectGiftId;
|
||||
}
|
||||
|
||||
- (UIStackView *)segmentStackView {
|
||||
if (!_segmentStackView) {
|
||||
_segmentStackView = [[UIStackView alloc] init];
|
||||
|
Reference in New Issue
Block a user