修复bug

This commit is contained in:
liyuhua
2024-06-05 17:58:26 +08:00
parent f5d58b3ffc
commit a661b0ee55
5 changed files with 24 additions and 53 deletions

View File

@@ -41,12 +41,11 @@
#import "PIRoomEnterRedPacketView.h"
#import "BaseNavigationController.h"
#import "PIRoomActivityWebView.h"
#import "PIRoomActivityClickView.h"
#import "PIRoomActivityChoosePlayView.h"
#import "MSRoomMenuGameVC.h"
UIKIT_EXTERN NSString *kShowFirstRechargeView;
@interface XPRoomActivityContainerView ()<SDCycleScrollViewDelegate,PIRoomEnterRedPacketViewDelegate,PIRoomActivityClickViewDelegate,PIRoomActivityChoosePlayViewDelegate>
@interface XPRoomActivityContainerView ()<SDCycleScrollViewDelegate,PIRoomEnterRedPacketViewDelegate>
///
@property (nonatomic,strong) UIStackView *stackView;
///
@@ -66,7 +65,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
@property (nonatomic,strong) NSMutableArray<ActivityInfoModel *> *activityList;
///
@property (nonatomic,assign) BOOL isLoadActivity;
@property(nonatomic,assign) BOOL isShowChoosePlayView;
@end
@implementation XPRoomActivityContainerView
@@ -176,11 +175,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
self.isLoadActivity = YES;
self.pi_cycleScrollView.hidden = NO;
if (self.hostDelegate.getRoomInfo.type == RoomType_Anchor) {
[self.gameMenuButton removeFromSuperview];
} else {
self.gameMenuButton.hidden = NO;
}
if (self.hostDelegate.getRoomInfo.type == RoomType_MiniGame) {
[self configLittleGameActivity];
@@ -225,26 +220,29 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
#pragma mark - RoomGuestDelegat
- (void)onRoomUpdate {
RoomInfoModel * roomInfo = self.hostDelegate.getRoomInfo;
if (roomInfo.type == RoomType_Anchor || roomInfo.roomModeType == RoomModeType_Open_Blind) {
self.gameMenuButton.hidden = YES;
} else {
self.gameMenuButton.hidden = NO;
}
self.redPacketView.type = roomInfo.type;
if (roomInfo.type == RoomType_MiniGame) {
if(self.isShowChoosePlayView == YES){
PIRoomActivityChoosePlayView *choosePlayView = [self.hostDelegate.getSuperView viewWithTag:98021];
self.isShowChoosePlayView = NO;
CGFloat y = self.frame.size.height + self.frame.origin.y - 124;
[UIView animateWithDuration:0.1 animations:^{
choosePlayView.frame = CGRectMake(KScreenWidth, y, 201, 124);
}completion:^(BOOL finished) {
[choosePlayView removeFromSuperview];
}];
}
self.redPacketView.hidden = YES;
[self.gameMenuButton removeFromSuperview];
[self.pi_cycleScrollView removeFromSuperview];
[self.stackView insertArrangedSubview:self.gameMenuButton atIndex:0];
[self.stackView addArrangedSubview:self.pi_cycleScrollView];
[self.gameMenuButton bringSubviewToFront:self.stackView];
if (self.isLoadActivity) {
[self configLittleGameActivity];
} else {
[self requestActivityList];
}
} else {
[self.gameMenuButton removeFromSuperview];
[self.pi_cycleScrollView removeFromSuperview];
[self.stackView insertArrangedSubview:self.pi_cycleScrollView atIndex:0];
[self.stackView addArrangedSubview:self.gameMenuButton];
self.redPacketView.redPacketList = self.redPacketList;
NSMutableArray *picArray = [NSMutableArray array];
for (ActivityInfoModel *model in self.activityList) {
@@ -544,22 +542,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
self.openRedPacketHandle(redModel,self.hostDelegate.getRoomInfo.type,NO);
}
}
#pragma mark - PIRoomActivityClickViewDelegate
- (void)showChoosePlayViewAction{
// self.isShowChoosePlayView = YES;
PIRoomActivityChoosePlayView *choosePlayView = [[PIRoomActivityChoosePlayView alloc]initWithFrame:CGRectZero];
choosePlayView.delegate = self;
CGFloat y = self.frame.size.height + self.frame.origin.y - 124;
choosePlayView.tag = 98021;
[self.hostDelegate.getSuperView addSubview:choosePlayView];
choosePlayView.frame = isMSRTL() ? CGRectMake(-201, y, 201, 124) : CGRectMake(KScreenWidth, y, 201, 124);
[UIView animateWithDuration:0.1 animations:^{
choosePlayView.frame = isMSRTL() ? CGRectMake(15, y, 201, 124) : CGRectMake(KScreenWidth - 201, y, 201, 124);
}];
}
-(void)clickPlayTypeWithModel:(ActivityInfoModel *)model{
if ([model.code isEqualToString:@"FIND_LOVE"]) {
[self lookLoveTapRecognizer];
@@ -594,19 +577,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
[self.hostDelegate.getCurrentNav pushViewController:webVC animated:YES];
}
}
#pragma mark- PIRoomActivityChoosePlayViewDelegate
-(void)choosePlayTypeWithView:(PIRoomActivityChoosePlayView *)view model:(ActivityInfoModel *)model{
[self clickPlayTypeWithModel:model];
}
-(void)hiddenViewActionWithView:(PIRoomActivityChoosePlayView *)view{
self.isShowChoosePlayView = NO;
CGFloat y = self.frame.size.height + self.frame.origin.y - 124;
[UIView animateWithDuration:0.1 animations:^{
view.frame = isMSRTL() ? CGRectMake(-201, y, 201, 124) : CGRectMake(KScreenWidth, y, 201, 124);
}completion:^(BOOL finished) {
[view removeFromSuperview];
}];
}
#pragma mark - Getters And Setters
- (SDCycleScrollView *)pi_cycleScrollView {
if (!_pi_cycleScrollView) {

View File

@@ -141,7 +141,7 @@
NSString * uid = [AccountInfoStorage instance].getUid;
NSString * ticket = [AccountInfoStorage instance].getTicket;
[params setObject:ticket forKey:@"ticket"];
[params setObject:uid forKey:@"uid"];
[params setObject:@(roomInfo.uid).stringValue forKey:@"uid"];
[params setObject:[NSString stringWithFormat:@"%ld", roomInfo.uid] forKey:@"roomUid"];
if (roomInfo.title.length > 0) {
[params setObject:roomInfo.title forKey:@"title"];

View File

@@ -259,7 +259,7 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey";
[self.headlineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(self).offset(15);
make.top.trailing.mas_equalTo(self);
make.height.mas_greaterThanOrEqualTo(0);
make.height.mas_equalTo(0);
}];
RoomInfoModel *infoModel = self.hostDelegate.getRoomInfo;

View File

@@ -657,7 +657,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
make.height.mas_equalTo(0);
}];
[self.activityContainerView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(65);
make.height.mas_equalTo(115);
make.trailing.mas_equalTo(self.view);
make.bottom.mas_equalTo(self.quickMessageContainerView.mas_top).offset(-5);
make.width.mas_equalTo(87);