temp save
This commit is contained in:
@@ -13,6 +13,8 @@
|
||||
#import "ActivityInfoModel.h"
|
||||
#import "LittleGameInfoModel.h"
|
||||
|
||||
@class BoomDetailModel;
|
||||
|
||||
typedef void(^OpenRedPacketHandle)(XPRedPacketModel *_Nullable,RoomType type ,BOOL isChangeRoom);
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@@ -24,6 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property(nonatomic,strong) NSMutableArray<LittleGameInfoModel *> *littleGameList;
|
||||
- (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate;
|
||||
- (void)updateView;
|
||||
- (void)updateForBoomDetailArray:(NSArray <BoomDetailModel*> *)models;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -47,8 +47,11 @@
|
||||
#import "MSRoomMenuGameVC.h"
|
||||
|
||||
#import "BoomInfoModel.h"
|
||||
#import "RoomBoomManager.h"
|
||||
#import "RoomBoomEntryView.h"
|
||||
#import "BoomInfoViewController.h"
|
||||
|
||||
|
||||
UIKIT_EXTERN NSString *kShowFirstRechargeView;
|
||||
@interface XPRoomActivityContainerView ()<SDCycleScrollViewDelegate,PIRoomEnterRedPacketViewDelegate>
|
||||
///容器
|
||||
@@ -72,8 +75,9 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
|
||||
///是否加载了活动
|
||||
@property (nonatomic,assign) BOOL isLoadActivity;
|
||||
|
||||
@property (nonatomic, strong) UIView *boomView;
|
||||
@property (nonatomic, strong) BoomInfoModel *boomModel;
|
||||
@property (nonatomic, strong) RoomBoomEntryView *boomView;
|
||||
@property (nonatomic, copy) NSArray <BoomDetailModel *> *boomModels;
|
||||
@property (nonatomic, strong) BoomDetailModel *currentLevelBoomModel;
|
||||
|
||||
@property (nonatomic, strong) NetImageView *loader_url_1;
|
||||
@property (nonatomic, strong) NetImageView *loader_url_2;
|
||||
@@ -83,13 +87,17 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
|
||||
@implementation XPRoomActivityContainerView
|
||||
-(void)dealloc{
|
||||
[[NSNotificationCenter defaultCenter]removeObserver:self];
|
||||
[[RoomBoomManager sharedManager] removeEventListenerForTarget:self];
|
||||
}
|
||||
|
||||
- (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.hostDelegate = delegate;
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
|
||||
[self setupBoomManager];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -102,13 +110,31 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updateForBoom:(BoomInfoModel *)model {
|
||||
_boomModel = model;
|
||||
if (model) {
|
||||
self.boomView.hidden = NO;
|
||||
- (void)updateForBoomDetailArray:(NSArray <BoomDetailModel*> *)models {
|
||||
_boomModels = models;
|
||||
|
||||
self.boomView.hidden = NO;
|
||||
if (models) {
|
||||
for (BoomDetailModel *boom in models) {
|
||||
if (boom.currLevel == 1) {
|
||||
self.boomView.boomModel = boom;
|
||||
self.boomView.hidden = NO;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setupBoomManager {
|
||||
@kWeakify(self);
|
||||
[[RoomBoomManager sharedManager] registerBoomProgressUpdate:^(id _Nonnull sth) {
|
||||
@kStrongify(self);
|
||||
if ([sth isKindOfClass:[BoomDetailModel class]]) {
|
||||
self.boomView.boomModel = (BoomDetailModel *)sth;
|
||||
}
|
||||
} target:self];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.stackView];
|
||||
@@ -614,7 +640,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
|
||||
}
|
||||
|
||||
- (void)displayBoomInfoProgress {
|
||||
BoomInfoViewController *vc = [BoomInfoViewController vcFromBoomProgress:self.boomModel];
|
||||
BoomInfoViewController *vc = [[BoomInfoViewController alloc] init];
|
||||
vc.modalPresentationStyle = UIModalPresentationOverFullScreen;
|
||||
[self.hostDelegate.getCurrentNav presentViewController:vc animated:YES completion:nil];
|
||||
}
|
||||
@@ -822,12 +848,11 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
|
||||
return _pkMenuButton;
|
||||
}
|
||||
|
||||
- (UIView *)boomView {
|
||||
- (RoomBoomEntryView *)boomView {
|
||||
if (!_boomView) {
|
||||
_boomView = [[UIView alloc] init];
|
||||
_boomView = [[RoomBoomEntryView alloc] init];
|
||||
_boomView.hidden = YES;
|
||||
_boomView.userInteractionEnabled = YES;
|
||||
_boomView.backgroundColor = [UIColor systemYellowColor];
|
||||
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(displayBoomInfoProgress)];
|
||||
[_boomView addGestureRecognizer:tap];
|
||||
}
|
||||
|
Reference in New Issue
Block a user