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