Files
peko-ios/YuMi/Modules/YMRoom/View/ActivityContainerView/XPRoomActivityContainerView.m
2023-11-15 16:49:59 +08:00

599 lines
24 KiB
Objective-C

//
// XPRoomActivityView.m
// xplan-ios
//
// Created by 冯硕 on 2021/10/12.
//
#import "XPRoomActivityContainerView.h"
///Third
#import <Masonry/Masonry.h>
#import <SDCycleScrollView/SDCycleScrollView.h>
///Tool
#import "AccountInfoStorage.h"
#import "Api+Room.h"
#import "Api+TreasureFairy.h"
#import "ClientConfig.h"
#import "NetImageView.h"
#import "TTPopup.h"
///Model
#import "UserInfoModel.h"
#import "RoomInfoModel.h"
#import "ActivityInfoModel.h"
#import "AttachmentModel.h"
#import "FirstRechargeModel.h"
#import "TreasureFairyLimitModel.h"
#import "XPRedPacketResultModel.h"
///View
#import "XPRoomHalfWebView.h"
#import "XPCandyTreeViewController.h"
#import "XPWebViewController.h"
#import "XPRoomViewController.h"
#import "XPFirstRechargeSuccessView.h"
#import "XPArrangeMicViewController.h"
#import "XPSailingViewController.h"
#import "XCCurrentVCStackManager.h"
#import "XPTreasureFairyViewController.h"
#import "PIRoomEnterRedPacketView.h"
#import "BaseNavigationController.h"
#import "PIRoomActivityWebView.h"
UIKIT_EXTERN NSString *kShowFirstRechargeView;
@interface XPRoomActivityContainerView ()<SDCycleScrollViewDelegate,PIRoomEnterRedPacketViewDelegate>
///容器
@property (nonatomic,strong) UIStackView *stackView;
///轮播图
@property (nonatomic,strong) SDCycleScrollView *pi_cycleScrollView;
///糖果树
@property (nonatomic,strong) NetImageView *lookLoveImageView;
///红包
@property(nonatomic,strong) PIRoomEnterRedPacketView *redPacketView;
///夺宝精灵
@property (nonatomic,strong) TreasureFairyLimitModel *fairyModel;
///参加相亲
@property (nonatomic,strong) UIImageView *joinDatingView;
///host 代理
@property (nonatomic,weak) id<RoomHostDelegate>hostDelegate;
///房间活动的列表
@property (nonatomic,copy) NSMutableArray<ActivityInfoModel *> *activityList;
///航海
@property (nonatomic,strong) UIImageView *sailingImageView;
///是否加载了活动
@property (nonatomic,assign) BOOL isLoadActivity;
///夺宝精灵
@property (nonatomic,strong) ActivityInfoModel *fairyActivityModel;
///首充
@property (nonatomic,strong) ActivityInfoModel * firstRechargeModel;
///寻爱之旅
@property (nonatomic,strong) ActivityInfoModel * lookLoveModel;
@end
@implementation XPRoomActivityContainerView
-(void)dealloc{
[[NSNotificationCenter defaultCenter]removeObserver:self];
}
- (instancetype)initWithdelegate:(id<RoomHostDelegate>)delegate {
self = [super init];
if (self) {
self.hostDelegate = delegate;
[self initSubViews];
[self initSubViewConstraints];
[self requestActivityList];
[self configLookLove];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
[self addSubview:self.stackView];
UIView *emptyView = [UIView new];
[self.stackView addArrangedSubview:self.pi_cycleScrollView];
[self.stackView addArrangedSubview:emptyView];
[self.stackView addArrangedSubview:self.redPacketView];
[self.stackView addArrangedSubview:self.lookLoveImageView];
[self.stackView addArrangedSubview:self.joinDatingView];
}
- (void)initSubViewConstraints {
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self);
}];
CGFloat itemWidth = KScreenHeight > 667 ? 65 : 55 * kScreenHeightScale;
[self.pi_cycleScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(itemWidth , itemWidth));
}];
[self.redPacketView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(kGetScaleWidth(58));
}];
[self.lookLoveImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(itemWidth, itemWidth));
}];
[self.joinDatingView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(35* kScreenHeightScale);
}];
}
- (void)requestActivityList {
///网络请求异步加载
dispatch_group_t group =dispatch_group_create();
// 并行队列
dispatch_queue_t queue =dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0);
dispatch_group_enter(group);
dispatch_group_async(group, queue, ^{
NSString * roomId = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.roomId];
[Api roomActivityList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) {
NSArray <ActivityInfoModel *>* array = [ActivityInfoModel modelsWithArray:data.data];
[self.activityList addObjectsFromArray:array];
}
dispatch_group_leave(group);
} roomId:roomId type:@"2"];
});
dispatch_group_enter(group);
dispatch_group_async(group, queue, ^{
[Api treasureFailyLimitInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if(code == 200){
TreasureFairyLimitModel * info =[TreasureFairyLimitModel modelWithDictionary:data.data];
self.fairyModel = info;
}
dispatch_group_leave(group);
}];
});
dispatch_group_notify(group,dispatch_get_main_queue(), ^{
self.isLoadActivity = YES;
self.pi_cycleScrollView.hidden = NO;
if (self.hostDelegate.getRoomInfo.type == RoomType_MiniGame) {
[self configLittleGameActivity];
} else {
///是否包含首充
[self configFairy];
[self configfirstRecharge];
NSMutableArray *picArray = [NSMutableArray array];
for (ActivityInfoModel *model in self.activityList) {
[picArray addObject:model.bannerPic];
}
self.pi_cycleScrollView.imageURLStringsGroup = picArray;
if (self.activityList.count > 1) {
[self.pi_cycleScrollView setAutoScroll:YES];
self.pi_cycleScrollView.autoScrollTimeInterval = 3;
} else {
[self.pi_cycleScrollView setAutoScroll:NO];
}
}
});
}
///首充
-(void)configfirstRecharge{
UserInfoModel * userInfo = self.hostDelegate.getUserInfo;
if (userInfo.isFirstCharge == YES) {
if(![self.activityList containsObject:self.firstRechargeModel]){
[self.activityList insertObject:self.firstRechargeModel atIndex:0];
}
}else{
if([self.activityList containsObject:self.firstRechargeModel]){
[self.activityList removeObject:self.firstRechargeModel];
}
}
}
///夺宝精灵
-(void)configFairy{
if (self.fairyModel.open == YES && self.fairyModel.levelLimit <= self.hostDelegate.getUserInfo.userLevelVo.experLevelSeq) {
if(![self.activityList containsObject:self.fairyActivityModel]){
[self.activityList insertObject:self.fairyActivityModel atIndex:0];
}
}else{
if([self.activityList containsObject:self.fairyActivityModel]){
[self.activityList removeObject:self.fairyActivityModel];
}
}
}
///寻爱之旅
- (void)configLookLove {
UserInfoModel * userInfo = self.hostDelegate.getUserInfo;
RoomInfoModel * roomInfo = self.hostDelegate.getRoomInfo;
if (userInfo.userLevelVo.experLevelSeq >= roomInfo.findLoveDrawSwitchVo.openLevel && roomInfo.findLoveDrawSwitchVo.open == YES) {
self.lookLoveImageView.hidden = NO;
self.lookLoveImageView.image = [UIImage imageNamed:@"room_candy_tree_enter"];
} else {
self.lookLoveImageView.hidden = YES;
}
}
- (void)configLittleGameActivity {
RoomInfoModel * roomInfo = self.hostDelegate.getRoomInfo;
UserInfoModel * userInfo = self.hostDelegate.getUserInfo;
if (userInfo.userLevelVo.experLevelSeq >= roomInfo.findLoveDrawSwitchVo.openLevel && roomInfo.findLoveDrawSwitchVo.open == YES) {
self.lookLoveModel.bannerPic = @"room_candy_tree_enter";
if(![self.activityList containsObject:self.lookLoveModel]){
[self.activityList insertObject:self.lookLoveModel atIndex:0];
}
}
NSMutableArray *picArray = [NSMutableArray array];
for (ActivityInfoModel *model in self.activityList) {
[picArray addObject:model.bannerPic];
}
self.pi_cycleScrollView.imageURLStringsGroup = picArray;
if (self.activityList.count > 1) {
[self.pi_cycleScrollView setAutoScroll:YES];
self.pi_cycleScrollView.autoScrollTimeInterval = 3;
}else{
[self.pi_cycleScrollView setAutoScroll:NO];
}
}
- (void)setRedPacketList:(NSMutableArray *)redPacketList{
_redPacketList = redPacketList;
self.redPacketView.redPacketList = redPacketList;
if(self.openRedPacketHandle){
self.openRedPacketHandle(nil,self.hostDelegate.getRoomInfo.type,YES);
}
}
#pragma mark - RoomGuestDelegat
- (void)onRoomUpdate {
RoomInfoModel * roomInfo = self.hostDelegate.getRoomInfo;
self.redPacketView.type = roomInfo.type;
if (roomInfo.type == RoomType_MiniGame) {
self.redPacketView.hidden = YES;
self.lookLoveImageView.hidden = YES;
self.sailingImageView.hidden = YES;
if (self.isLoadActivity) {
[self configLittleGameActivity];
} else {
[self requestActivityList];
}
} else {
self.redPacketView.redPacketList = self.redPacketList;
if([self.activityList containsObject:self.lookLoveModel]){
[self.activityList removeObject:self.lookLoveModel];
}
[self configLookLove];
[self configFairy];
[self configfirstRecharge];
NSMutableArray *picArray = [NSMutableArray array];
for (ActivityInfoModel *model in self.activityList) {
[picArray addObject:model.bannerPic];
}
self.pi_cycleScrollView.imageURLStringsGroup = picArray;
if (self.activityList.count > 1) {
[self.pi_cycleScrollView setAutoScroll:YES];
self.pi_cycleScrollView.autoScrollTimeInterval = 3;
} else {
[self.pi_cycleScrollView setAutoScroll:NO];
}
if (roomInfo.roomModeType == RoomModeType_Open_Blind || roomInfo.roomModeType == RoomModeType_Open_PK_Mode || roomInfo.roomModeType == RoomModeType_Open_Micro_Mode) {
if (roomInfo.roomModeType == RoomModeType_Open_PK_Mode ) {
self.joinDatingView.image = [UIImage imageNamed:@"room_pk_normal_member_enter"];
} else {
self.joinDatingView.image = [UIImage imageNamed:@"room_mode_dating_enter"];
}
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
request.roomId = [NSString stringWithFormat:@"%ld", roomInfo.roomId];
request.userIds = @[[AccountInfoStorage instance].getUid];
[[NIMSDK sharedSDK].chatroomManager fetchChatroomMembersByIds:request completion:^(NSError * _Nullable error, NSArray<NIMChatroomMember *> * _Nullable members) {
if (error == nil) {
NIMChatroomMember * member = members.firstObject;
if (member.type == NIMTeamMemberTypeOwner || member.type == NIMTeamMemberTypeManager) {
self.joinDatingView.hidden = YES;
return;
}
}
self.joinDatingView.hidden = NO;
}];
} else {
self.joinDatingView.hidden = YES;
}
if ([ClientConfig shareConfig].configInfo.linearlyPoolOpenLevel <= self.hostDelegate.getUserInfo.userLevelVo.experLevelSeq) {
self.sailingImageView.hidden = NO;
} else {
self.sailingImageView.hidden = YES;
}
}
if(self.openRedPacketHandle){
self.openRedPacketHandle(nil,self.hostDelegate.getRoomInfo.type,YES);
}
}
- (void)onRoomEntered {
[self onRoomUpdate];
}
- (void)handleNIMCustomMessage:(NIMMessage *)message {
NIMCustomObject *obj = (NIMCustomObject *)message.messageObject;
if (obj.attachment != nil && [obj.attachment isKindOfClass:[AttachmentModel class]]) {
AttachmentModel *attachment = (AttachmentModel *)obj.attachment;
if (attachment.first == CustomMessageType_First_Recharge_Reward && attachment.second == Custom_Message_Sub_Room_First_Recharge_Reward) {
FirstRechargeModel *model = [FirstRechargeModel modelWithJSON:attachment.data];
XPFirstRechargeSuccessView * firstRechargeView= [[XPFirstRechargeSuccessView alloc] init];
firstRechargeView.rechargeInfo = model;
[TTPopup popupView:firstRechargeView style:TTPopupStyleAlert];
}
}
}
- (void)handleNIMNotificationMessage:(NIMMessage *)message {
NIMNotificationObject *notiMsg = (NIMNotificationObject *)message.messageObject;
NIMChatroomNotificationContent *content = (NIMChatroomNotificationContent *)notiMsg.content;
switch (content.eventType) {
case NIMChatroomEventTypeAddManager:
{
if (self.hostDelegate.getRoomInfo.roomModeType == RoomModeType_Open_Blind || self.hostDelegate.getRoomInfo.roomModeType == RoomModeType_Open_PK_Mode) {
for (NIMChatroomNotificationMember * member in content.targets) {
if (member.userId.intValue == [AccountInfoStorage instance].getUid.integerValue) {
self.joinDatingView.hidden = YES;
break;
}
}
}
}
break;
case NIMChatroomEventTypeRemoveManager:
{
if (self.hostDelegate.getRoomInfo.roomModeType == RoomModeType_Open_Blind || self.hostDelegate.getRoomInfo.roomModeType == RoomModeType_Open_PK_Mode) {
for (NIMChatroomNotificationMember * member in content.targets) {
if (member.userId.intValue == [AccountInfoStorage instance].getUid.integerValue) {
self.joinDatingView.hidden = NO;
break;
}
}
}
}
break;
default:
break;
}
}
#pragma mark - SDCycleScrollViewDelegate
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index {
NSArray *imageUrlList = cycleScrollView.imageURLStringsGroup;
if (imageUrlList.count > index) {
NSString *pic = imageUrlList[index];
NSMutableArray *inftList = [NSMutableArray array];
ActivityInfoModel * info;
for (ActivityInfoModel * getInfo in self.activityList) {
if([getInfo.bannerPic isEqualToString:pic]){
info = getInfo;
}
if([getInfo.bannerPic hasPrefix:@"http"]){
[inftList addObject:getInfo];
}
}
if(info == nil)return;
if (info.activityType == ActivityType_Love) {
[self lookLoveTapRecognizer];
} else if(info.activityType == ActivityType_First) {
[self firstRechargeTapRecognizer];
}else if(info.activityType == ActivityType_Fairy){
XPTreasureFairyViewController * fairyVC = [[XPTreasureFairyViewController alloc] initWithdelegate:self.hostDelegate];
fairyVC.roomUid =[NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid];
fairyVC.view.frame = CGRectMake(0, KScreenHeight, KScreenWidth, KScreenHeight);
[[XCCurrentVCStackManager shareManager].getCurrentVC addChildViewController:fairyVC];
[fairyVC.navigationController setNavigationBarHidden:YES animated:NO];
[[XCCurrentVCStackManager shareManager].getCurrentVC.view addSubview:fairyVC.view];
[UIView animateWithDuration:0.2 animations:^{
fairyVC.view.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight);
}completion:^(BOOL finished) {
}];
}else {
if (info.skipType == ActivitySkipType_Room) {
[self.hostDelegate exitRoom];
[XPRoomViewController openRoom:info.skipUri viewController:self.hostDelegate.getCurrentNav];
} else if(info.skipType == ActivitySkipType_Web) {
PIRoomActivityWebView * webView = [[PIRoomActivityWebView alloc]initWithFrame:CGRectMake(0, KScreenHeight, KScreenWidth, KScreenHeight)];
webView.roomUid = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid];
webView.url = info.skipUri;
webView.infoList = inftList;
[kWindow addSubview:webView];
[UIView animateWithDuration:0.2 animations:^{
webView.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight);
}];
}
}
}
}
#pragma mark - Event Response
- (void)lookLoveTapRecognizer {
XPCandyTreeViewController * candyTreeVC = [[XPCandyTreeViewController alloc] initWithDelegate:self.hostDelegate];
candyTreeVC.view.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight);
[[XCCurrentVCStackManager shareManager].getCurrentVC addChildViewController:candyTreeVC];
[candyTreeVC.navigationController setNavigationBarHidden:YES animated:NO];
[[XCCurrentVCStackManager shareManager].getCurrentVC.view addSubview:candyTreeVC.view];
}
- (void)firstRechargeTapRecognizer {
[[NSNotificationCenter defaultCenter]postNotificationName:kShowFirstRechargeView object:nil];
}
- (void)didTapJoinDatingRecognizer {
if (self.hostDelegate.getRoomInfo.roomModeType == RoomModeType_Open_PK_Mode && self.hostDelegate.isRoomPKPlaying) {
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPRoomActivityContainerView2")];
return;
}
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
request.roomId = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.roomId];
request.userIds = @[[AccountInfoStorage instance].getUid];
[[NIMSDK sharedSDK].chatroomManager fetchChatroomMembersByIds:request completion:^(NSError * _Nullable error, NSArray<NIMChatroomMember *> * _Nullable members) {
NIMChatroomMember * member;
if (error == nil) {
member = members.firstObject;
}
RoomInfoModel * roomInfo = self.hostDelegate.getRoomInfo;
XPArrangeMicInfoModel * info = [[XPArrangeMicInfoModel alloc] init];
info.roomUid = [NSString stringWithFormat:@"%ld", roomInfo.uid];
info.roomId = [NSString stringWithFormat:@"%ld", roomInfo.roomId];
info.nick = roomInfo.nick;
info.roomAvatar = roomInfo.avatar;
info.roomTitle = roomInfo.title;
info.micQueue = [self.hostDelegate getMicroQueue];
info.isManager = (member.type == NIMChatroomMemberTypeCreator || member.type == NIMChatroomMemberTypeManager);
info.type = roomInfo.roomModeType == RoomModeType_Open_Blind ? ArrangeMicType_Dating : roomInfo.roomModeType == RoomModeType_Open_PK_Mode ? ArrangeMicType_Room_PK : ArrangeMicType_Normal;
XPArrangeMicViewController * arrangeMicVC = [[XPArrangeMicViewController alloc] initWithInfo:info];
[self.hostDelegate.getCurrentNav presentViewController:arrangeMicVC animated:YES completion:nil];
}];
}
- (void)sailTapRecognizer {
NSString * roomUid = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid];
XPSailingViewController * sailingVC = [[XPSailingViewController alloc] initWithRoomUid:roomUid];
[self.hostDelegate.getCurrentNav presentViewController:sailingVC animated:YES completion:nil];
}
#pragma mark- PIRoomEnterRedPacketViewDelegate
-(void)openRedPacketWtihModel:(XPRedPacketModel *)redModel{
if(self.openRedPacketHandle){
self.openRedPacketHandle(redModel,self.hostDelegate.getRoomInfo.type,NO);
}
}
#pragma mark - Getters And Setters
- (SDCycleScrollView *)pi_cycleScrollView {
if (!_pi_cycleScrollView) {
_pi_cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectZero delegate:self placeholderImage:nil];
_pi_cycleScrollView.pageControlAliment = SDCycleScrollViewPageContolAlimentCenter;
_pi_cycleScrollView.currentPageDotColor = [UIColor whiteColor];
_pi_cycleScrollView.pageDotColor = [UIColor colorWithWhite:1 alpha:0.2];
_pi_cycleScrollView.pageControlDotSize = CGSizeMake(5, 2);
_pi_cycleScrollView.pageControlStyle = SDCycleScrollViewPageContolStyleClassic;
_pi_cycleScrollView.currentPageDotImage = [UIImage imageNamed:@"room_activity_banner_select"];
_pi_cycleScrollView.pageDotImage = [UIImage imageNamed:@"room_activity_banner_normal"];
_pi_cycleScrollView.backgroundColor = [UIColor colorWithWhite:1 alpha:0.00];
_pi_cycleScrollView.bannerImageViewContentMode = UIViewContentModeScaleAspectFit;
_pi_cycleScrollView.pageControlBottomOffset = -10;
_pi_cycleScrollView.hidden = YES;
}
return _pi_cycleScrollView;
}
- (UIStackView *)stackView {
if (!_stackView) {
_stackView = [[UIStackView alloc] init];
_stackView.axis = UILayoutConstraintAxisVertical;
_stackView.distribution = UIStackViewDistributionFill;
_stackView.alignment = UIStackViewAlignmentCenter;
_stackView.spacing = 0;
}
return _stackView;
}
- (UIImageView *)lookLoveImageView {
if (!_lookLoveImageView) {
NetImageConfig * config = [[NetImageConfig alloc] init];
config.placeHolder = [UIImage imageNamed:@"room_candy_tree_enter"];
config.imageType = ImageTypeUserIcon;
_lookLoveImageView = [[NetImageView alloc] initWithConfig:config];
_lookLoveImageView.userInteractionEnabled = YES;
_lookLoveImageView.hidden = YES;
_lookLoveImageView.image = [UIImage imageNamed:@"room_candy_tree_enter"];
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(lookLoveTapRecognizer)];
[_lookLoveImageView addGestureRecognizer:tap];
}
return _lookLoveImageView;
}
- (UIImageView *)joinDatingView {
if (!_joinDatingView) {
_joinDatingView = [[UIImageView alloc] init];
_joinDatingView.image = [UIImage imageNamed:@"room_mode_dating_enter"];
_joinDatingView.userInteractionEnabled = YES;
_joinDatingView.hidden = YES;
_joinDatingView.contentMode = UIViewContentModeScaleAspectFit;
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapJoinDatingRecognizer)];
[_joinDatingView addGestureRecognizer:tap];
}
return _joinDatingView;
}
- (NSMutableArray<ActivityInfoModel *> *)activityList {
if (!_activityList) {
_activityList = [NSMutableArray array];
}
return _activityList;
}
- (UIImageView *)sailingImageView {
if (!_sailingImageView) {
_sailingImageView = [[UIImageView alloc] init];
_sailingImageView.image = [UIImage imageNamed:@"room_sailiing_enter"];
_sailingImageView.userInteractionEnabled = YES;
_sailingImageView.hidden = YES;
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(sailTapRecognizer)];
[_sailingImageView addGestureRecognizer:tap];
}
return _sailingImageView;
}
- (ActivityInfoModel *)fairyActivityModel{
if (!_fairyActivityModel){
ActivityInfoModel *fairyModel = [ActivityInfoModel new];
fairyModel.bannerName = YMLocalizedString(@"XPRoomActivityContainerView3");
fairyModel.bannerPic = @"room_treasure_fairy_enter";
_fairyActivityModel = fairyModel;
_fairyActivityModel.activityType = ActivityType_Fairy;
}
return _fairyActivityModel;
}
- (ActivityInfoModel *)firstRechargeModel{
if (!_firstRechargeModel){
ActivityInfoModel * activityInfo = [[ActivityInfoModel alloc] init];
activityInfo.bannerPic = @"room_first_recharge_enter";
activityInfo.bannerName = YMLocalizedString(@"XPRoomActivityContainerView0");
_firstRechargeModel = activityInfo;
_firstRechargeModel.activityType = ActivityType_First;
}
return _firstRechargeModel;
}
-(ActivityInfoModel *)lookLoveModel{
if (!_lookLoveModel){
ActivityInfoModel * activityInfo = [[ActivityInfoModel alloc] init];
activityInfo.bannerName = YMLocalizedString(@"XPRoomActivityContainerView1");
_lookLoveModel = activityInfo;
_lookLoveModel.activityType = ActivityType_Love;
}
return _lookLoveModel;
}
- (PIRoomEnterRedPacketView *)redPacketView{
if(!_redPacketView){
_redPacketView = [[PIRoomEnterRedPacketView alloc]initWithFrame:CGRectZero];
_redPacketView.hidden = YES;
_redPacketView.delegate = self;
}
return _redPacketView;
}
@end