|
|
|
@@ -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) {
|
|
|
|
|