fix: 修正礼物面板提示问题
This commit is contained in:
@@ -65,9 +65,9 @@
|
||||
-(void)startMatchGameWithroomId:(NSString *)roomId mgId:(NSString *)mgId gameMode:(NSString *)gameMode{
|
||||
[Api startMatchGame:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView]startMatchGameSuccess];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
|
||||
} showLoading:YES errorToast:YES] roomId:roomId mgId:mgId gameMode:gameMode];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
|
||||
} showLoading:YES errorToast:YES] roomId:roomId mgId:mgId gameMode:gameMode];
|
||||
}
|
||||
///得到房间详情
|
||||
-(void)getRoomGameDetailWithRoomType:(NSString *)roomType{
|
||||
|
@@ -162,13 +162,7 @@
|
||||
|
||||
}
|
||||
-(XPGiftInfoView *)getListVC:(NSInteger)index{
|
||||
GiftPanelTabModel *targetTab = nil;// [self.tagsArray xpSafeObjectAtIndex:index];
|
||||
for (GiftPanelTabModel *tab in self.tagsArray) {
|
||||
if (tab.seq-1 == index) {
|
||||
targetTab = tab;
|
||||
break;
|
||||
}
|
||||
}
|
||||
GiftPanelTabModel *targetTab = [self.tagsArray xpSafeObjectAtIndex:index];
|
||||
switch ([targetTab tabGiftType]) {
|
||||
case GiftType_Game:{
|
||||
return self.normalVC;
|
||||
@@ -275,9 +269,9 @@
|
||||
- (void)setTagsArray:(NSArray<GiftPanelTabModel *> *)tagsArray {
|
||||
[self hideLoading];
|
||||
|
||||
_tagsArray = tagsArray;
|
||||
NSMutableArray *tempTitles = @[].mutableCopy;
|
||||
NSMutableArray *tempGifts = @[].mutableCopy;
|
||||
NSMutableArray *tempTags = @[].mutableCopy;
|
||||
for (GiftPanelTabModel *tab in tagsArray) {
|
||||
// 聊天界面不显示 幸运/个播 礼物
|
||||
if (self.usingPlaceType == SendGiftType_User &&
|
||||
@@ -307,6 +301,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
[tempTags addObject:tab];
|
||||
if (canAddGift) {
|
||||
[tempGifts addObject:tab.gifts ? tab.gifts : @[]];
|
||||
} else {
|
||||
@@ -324,6 +319,7 @@
|
||||
}
|
||||
}];
|
||||
|
||||
_tagsArray = tempTags.copy;
|
||||
self.pi_titles = tempTitles.copy;
|
||||
self.titleView.titles = self.pi_titles;
|
||||
|
||||
@@ -331,11 +327,11 @@
|
||||
|
||||
[self.titleView reloadData];
|
||||
|
||||
// @kWeakify(self);
|
||||
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
// @kStrongify(self);
|
||||
@kWeakify(self);
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
@kStrongify(self);
|
||||
[self.pi_containerView reloadData];
|
||||
// });
|
||||
});
|
||||
}
|
||||
|
||||
- (void)setNormalOriginArray:(NSArray *)normalOriginArray {
|
||||
|
@@ -561,25 +561,25 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
[self.constellationBanner removeFromSuperview];
|
||||
|
||||
switch (type) {
|
||||
case GiftSegmentType_Lucky:{
|
||||
if (view.lastSelectGift.giftType == GiftType_super){
|
||||
if (!self.superGiftView.superview) {
|
||||
[self.view addSubview:self.superGiftView];
|
||||
[self.superGiftView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.contentView.mas_top);
|
||||
make.leading.trailing.mas_equalTo(0);
|
||||
make.height.mas_equalTo(kGetScaleWidth(90));
|
||||
}];
|
||||
}
|
||||
}else{
|
||||
if (!self.luckyBroadcastView.superview) {
|
||||
[self.view addSubview:self.luckyBroadcastView];
|
||||
[self.luckyBroadcastView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.contentView.mas_top);
|
||||
make.leading.trailing.mas_equalTo(0);
|
||||
make.height.mas_equalTo(kGetScaleWidth(56));
|
||||
}];
|
||||
}
|
||||
case GiftSegmentType_Lucky: {
|
||||
if (!self.luckyBroadcastView.superview) {
|
||||
[self.view addSubview:self.luckyBroadcastView];
|
||||
[self.luckyBroadcastView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.contentView.mas_top);
|
||||
make.leading.trailing.mas_equalTo(0);
|
||||
make.height.mas_equalTo(kGetScaleWidth(56));
|
||||
}];
|
||||
}
|
||||
}
|
||||
break;
|
||||
case GiftSegmentType_SuperLucky: {
|
||||
if (!self.superGiftView.superview) {
|
||||
[self.view addSubview:self.superGiftView];
|
||||
[self.superGiftView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.contentView.mas_top);
|
||||
make.leading.trailing.mas_equalTo(0);
|
||||
make.height.mas_equalTo(kGetScaleWidth(90));
|
||||
}];
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -611,20 +611,9 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
|
||||
///点击了某个item
|
||||
- (void)pIGiftInfoSegmentedView:(PIGiftInfoSegmentedView *)view didClickItem:(GiftInfoModel *)info type:(GiftSegmentType)type{
|
||||
if (type == GiftSegmentType_Lucky){
|
||||
[self.constellationBanner removeFromSuperview];
|
||||
if (info.giftType == GiftType_super){
|
||||
[self.luckyBroadcastView removeFromSuperview];
|
||||
if (!self.superGiftView.superview) {
|
||||
self.superGiftView.giftModel = info;
|
||||
[self.view addSubview:self.superGiftView];
|
||||
[self.superGiftView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.contentView.mas_top);
|
||||
make.leading.trailing.mas_equalTo(0);
|
||||
make.height.mas_equalTo(kGetScaleWidth(90));
|
||||
}];
|
||||
}
|
||||
}else{
|
||||
switch (type) {
|
||||
case GiftSegmentType_Lucky:{
|
||||
[self.constellationBanner removeFromSuperview];
|
||||
[self.superGiftView removeFromSuperview];
|
||||
if (!self.luckyBroadcastView.superview) {
|
||||
[self.view addSubview:self.luckyBroadcastView];
|
||||
@@ -635,30 +624,46 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
}else if (type == GiftSegmentType_Graffiti) {
|
||||
self.giftInfoView.hidden = YES;
|
||||
self.graffitiView.hidden = NO;
|
||||
self.graffitiView.price = info.goldPrice;
|
||||
self.giftBarView.drawGiftCount = 0;
|
||||
self.graffitiView.selectUidNumber = [self.userView getSelectUserList].count;
|
||||
@kWeakify(self);
|
||||
[[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:info.giftUrl]
|
||||
options:SDWebImageProgressiveLoad
|
||||
progress:nil
|
||||
completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
|
||||
@kStrongify(self);
|
||||
if (error == nil && image) {
|
||||
self.graffitiView.image = image;
|
||||
} else {
|
||||
self.giftInfoView.hidden = NO;
|
||||
break;
|
||||
case GiftSegmentType_SuperLucky: {
|
||||
[self.constellationBanner removeFromSuperview];
|
||||
[self.luckyBroadcastView removeFromSuperview];
|
||||
if (!self.superGiftView.superview) {
|
||||
self.superGiftView.giftModel = info;
|
||||
[self.view addSubview:self.superGiftView];
|
||||
[self.superGiftView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.contentView.mas_top);
|
||||
make.leading.trailing.mas_equalTo(0);
|
||||
make.height.mas_equalTo(kGetScaleWidth(90));
|
||||
}];
|
||||
}
|
||||
}];
|
||||
}else if(type == GiftSegmentType_WeekStar){
|
||||
self.constellationBanner.giftInfo = info;
|
||||
}
|
||||
else {
|
||||
self.giftBarView.drawGiftCount = 10;
|
||||
}
|
||||
break;
|
||||
case GiftSegmentType_Graffiti: {
|
||||
self.giftInfoView.hidden = YES;
|
||||
self.graffitiView.hidden = NO;
|
||||
self.graffitiView.price = info.goldPrice;
|
||||
self.giftBarView.drawGiftCount = 0;
|
||||
self.graffitiView.selectUidNumber = [self.userView getSelectUserList].count;
|
||||
@kWeakify(self);
|
||||
[[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:info.giftUrl]
|
||||
options:SDWebImageProgressiveLoad
|
||||
progress:nil
|
||||
completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
|
||||
@kStrongify(self);
|
||||
if (error == nil && image) {
|
||||
self.graffitiView.image = image;
|
||||
} else {
|
||||
self.giftInfoView.hidden = NO;
|
||||
}
|
||||
}];
|
||||
}
|
||||
case GiftSegmentType_WeekStar:
|
||||
self.constellationBanner.giftInfo = info;
|
||||
break;
|
||||
default:
|
||||
self.giftBarView.drawGiftCount = 10;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user