新增游戏
This commit is contained in:
@@ -191,6 +191,9 @@
|
||||
236B2E4E2AA07D06003967A8 /* Api+LittleGame.m in Sources */ = {isa = PBXBuildFile; fileRef = 236B2E402AA07D06003967A8 /* Api+LittleGame.m */; };
|
||||
236B2E532AA08757003967A8 /* LittleGameStageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 236B2E502AA08756003967A8 /* LittleGameStageView.m */; };
|
||||
236B2E542AA08757003967A8 /* LittleGameScrollStageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 236B2E512AA08756003967A8 /* LittleGameScrollStageView.m */; };
|
||||
236B2E592AA18E13003967A8 /* XPMIneGameCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 236B2E552AA18E12003967A8 /* XPMIneGameCollectionViewCell.m */; };
|
||||
236B2E5A2AA18E13003967A8 /* XPMineGameTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 236B2E572AA18E12003967A8 /* XPMineGameTableViewCell.m */; };
|
||||
236B2E5D2AA19169003967A8 /* HomeLittleGameRoomModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 236B2E5C2AA19169003967A8 /* HomeLittleGameRoomModel.m */; };
|
||||
237B94BC2A984DA7007853E3 /* XPTrumpetPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 237B94AE2A984DA7007853E3 /* XPTrumpetPresenter.m */; };
|
||||
237B94BD2A984DA7007853E3 /* XPNobleTrumpetModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 237B94B32A984DA7007853E3 /* XPNobleTrumpetModel.m */; };
|
||||
237B94BE2A984DA7007853E3 /* XPRoomTrumpetViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 237B94B72A984DA7007853E3 /* XPRoomTrumpetViewController.m */; };
|
||||
@@ -1726,6 +1729,12 @@
|
||||
236B2E502AA08756003967A8 /* LittleGameStageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LittleGameStageView.m; sourceTree = "<group>"; };
|
||||
236B2E512AA08756003967A8 /* LittleGameScrollStageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LittleGameScrollStageView.m; sourceTree = "<group>"; };
|
||||
236B2E522AA08757003967A8 /* LittleGameStageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LittleGameStageView.h; sourceTree = "<group>"; };
|
||||
236B2E552AA18E12003967A8 /* XPMIneGameCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPMIneGameCollectionViewCell.m; sourceTree = "<group>"; };
|
||||
236B2E562AA18E12003967A8 /* XPMineGameTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPMineGameTableViewCell.h; sourceTree = "<group>"; };
|
||||
236B2E572AA18E12003967A8 /* XPMineGameTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPMineGameTableViewCell.m; sourceTree = "<group>"; };
|
||||
236B2E582AA18E12003967A8 /* XPMIneGameCollectionViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPMIneGameCollectionViewCell.h; sourceTree = "<group>"; };
|
||||
236B2E5B2AA19168003967A8 /* HomeLittleGameRoomModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeLittleGameRoomModel.h; sourceTree = "<group>"; };
|
||||
236B2E5C2AA19169003967A8 /* HomeLittleGameRoomModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeLittleGameRoomModel.m; sourceTree = "<group>"; };
|
||||
237B94AD2A984DA7007853E3 /* XPTrumpetPresenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPTrumpetPresenter.h; sourceTree = "<group>"; };
|
||||
237B94AE2A984DA7007853E3 /* XPTrumpetPresenter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPTrumpetPresenter.m; sourceTree = "<group>"; };
|
||||
237B94B02A984DA7007853E3 /* XPRoomTrumpetProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPRoomTrumpetProtocol.h; sourceTree = "<group>"; };
|
||||
@@ -4943,10 +4952,10 @@
|
||||
236B2E202AA07D06003967A8 /* LittleGame */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
236B2E212AA07D06003967A8 /* Presenter */,
|
||||
236B2E2E2AA07D06003967A8 /* Model */,
|
||||
236B2E312AA07D06003967A8 /* View */,
|
||||
236B2E3F2AA07D06003967A8 /* Api */,
|
||||
236B2E2E2AA07D06003967A8 /* Model */,
|
||||
236B2E212AA07D06003967A8 /* Presenter */,
|
||||
236B2E312AA07D06003967A8 /* View */,
|
||||
);
|
||||
path = LittleGame;
|
||||
sourceTree = "<group>";
|
||||
@@ -4954,10 +4963,10 @@
|
||||
236B2E212AA07D06003967A8 /* Presenter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
236B2E222AA07D06003967A8 /* SudGameConfig.h */,
|
||||
236B2E232AA07D06003967A8 /* SudCommon.m */,
|
||||
236B2E242AA07D06003967A8 /* Category */,
|
||||
236B2E2D2AA07D06003967A8 /* SudCommon.h */,
|
||||
236B2E232AA07D06003967A8 /* SudCommon.m */,
|
||||
236B2E222AA07D06003967A8 /* SudGameConfig.h */,
|
||||
);
|
||||
path = Presenter;
|
||||
sourceTree = "<group>";
|
||||
@@ -4965,14 +4974,14 @@
|
||||
236B2E242AA07D06003967A8 /* Category */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
236B2E252AA07D06003967A8 /* NSString+RW.m */,
|
||||
236B2E262AA07D06003967A8 /* UIImage+RW.h */,
|
||||
236B2E272AA07D06003967A8 /* UIColor+RW.m */,
|
||||
236B2E2C2AA07D06003967A8 /* NSData+RW.h */,
|
||||
236B2E282AA07D06003967A8 /* NSData+RW.m */,
|
||||
236B2E292AA07D06003967A8 /* NSString+RW.h */,
|
||||
236B2E2A2AA07D06003967A8 /* UIImage+RW.m */,
|
||||
236B2E252AA07D06003967A8 /* NSString+RW.m */,
|
||||
236B2E2B2AA07D06003967A8 /* UIColor+RW.h */,
|
||||
236B2E2C2AA07D06003967A8 /* NSData+RW.h */,
|
||||
236B2E272AA07D06003967A8 /* UIColor+RW.m */,
|
||||
236B2E262AA07D06003967A8 /* UIImage+RW.h */,
|
||||
236B2E2A2AA07D06003967A8 /* UIImage+RW.m */,
|
||||
);
|
||||
path = Category;
|
||||
sourceTree = "<group>";
|
||||
@@ -4989,14 +4998,14 @@
|
||||
236B2E312AA07D06003967A8 /* View */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
236B2E322AA07D06003967A8 /* XPLittleGameRoomListView.h */,
|
||||
236B2E332AA07D06003967A8 /* XPLittleGameMiniStageView.m */,
|
||||
236B2E342AA07D06003967A8 /* XPRoomLittleGameContainerView.h */,
|
||||
236B2E352AA07D06003967A8 /* XPLittleGameRoomOpenView.h */,
|
||||
236B2E362AA07D06003967A8 /* Cell */,
|
||||
236B2E3B2AA07D06003967A8 /* XPLittleGameMiniStageView.h */,
|
||||
236B2E332AA07D06003967A8 /* XPLittleGameMiniStageView.m */,
|
||||
236B2E322AA07D06003967A8 /* XPLittleGameRoomListView.h */,
|
||||
236B2E3C2AA07D06003967A8 /* XPLittleGameRoomListView.m */,
|
||||
236B2E352AA07D06003967A8 /* XPLittleGameRoomOpenView.h */,
|
||||
236B2E3D2AA07D06003967A8 /* XPLittleGameRoomOpenView.m */,
|
||||
236B2E342AA07D06003967A8 /* XPRoomLittleGameContainerView.h */,
|
||||
236B2E3E2AA07D06003967A8 /* XPRoomLittleGameContainerView.m */,
|
||||
);
|
||||
path = View;
|
||||
@@ -5005,9 +5014,9 @@
|
||||
236B2E362AA07D06003967A8 /* Cell */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
236B2E372AA07D06003967A8 /* XPLittleGameTableViewCell.h */,
|
||||
236B2E382AA07D06003967A8 /* XPCreateLittleGameCollectionViewCell.m */,
|
||||
236B2E392AA07D06003967A8 /* XPCreateLittleGameCollectionViewCell.h */,
|
||||
236B2E382AA07D06003967A8 /* XPCreateLittleGameCollectionViewCell.m */,
|
||||
236B2E372AA07D06003967A8 /* XPLittleGameTableViewCell.h */,
|
||||
236B2E3A2AA07D06003967A8 /* XPLittleGameTableViewCell.m */,
|
||||
);
|
||||
path = Cell;
|
||||
@@ -5016,8 +5025,8 @@
|
||||
236B2E3F2AA07D06003967A8 /* Api */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
236B2E402AA07D06003967A8 /* Api+LittleGame.m */,
|
||||
236B2E412AA07D06003967A8 /* Api+LittleGame.h */,
|
||||
236B2E402AA07D06003967A8 /* Api+LittleGame.m */,
|
||||
);
|
||||
path = Api;
|
||||
sourceTree = "<group>";
|
||||
@@ -8269,6 +8278,8 @@
|
||||
E87DF4F42A42CC49009C1185 /* HomeMenuInfoModel.m */,
|
||||
E87DF4D92A42C9D9009C1185 /* HomeCollectRoomModel.h */,
|
||||
E87DF4D82A42C9D8009C1185 /* HomeCollectRoomModel.m */,
|
||||
236B2E5B2AA19168003967A8 /* HomeLittleGameRoomModel.h */,
|
||||
236B2E5C2AA19169003967A8 /* HomeLittleGameRoomModel.m */,
|
||||
E87DF4D62A42C9C3009C1185 /* HomePlayRoomModel.h */,
|
||||
E87DF4D52A42C9C3009C1185 /* HomePlayRoomModel.m */,
|
||||
E87DF4D22A42C9B1009C1185 /* HomeRecommendRoomModel.h */,
|
||||
@@ -9654,6 +9665,10 @@
|
||||
E85E7BBE2A4EE7AC00B6D00A /* XPMinePersonalCenterCell.m */,
|
||||
E85E7BC02A4EE82300B6D00A /* XPMineListCell.h */,
|
||||
E85E7BC12A4EE82300B6D00A /* XPMineListCell.m */,
|
||||
236B2E582AA18E12003967A8 /* XPMIneGameCollectionViewCell.h */,
|
||||
236B2E552AA18E12003967A8 /* XPMIneGameCollectionViewCell.m */,
|
||||
236B2E562AA18E12003967A8 /* XPMineGameTableViewCell.h */,
|
||||
236B2E572AA18E12003967A8 /* XPMineGameTableViewCell.m */,
|
||||
);
|
||||
path = Cell;
|
||||
sourceTree = "<group>";
|
||||
@@ -10328,6 +10343,7 @@
|
||||
18EE401A2754BA9F00A452BF /* NIMMessageMaker.m in Sources */,
|
||||
E8EEB91D26FC9D58007C6EBA /* XPMineUserInfoDateView.m in Sources */,
|
||||
E82325E9274CE56A003A3332 /* XPShareItem.m in Sources */,
|
||||
236B2E5D2AA19169003967A8 /* HomeLittleGameRoomModel.m in Sources */,
|
||||
E85E7B192A4EB0D200B6D00A /* GuildMessageModel.m in Sources */,
|
||||
1427219429A75F6F00C7C423 /* HTTPAuthenticationRequest.m in Sources */,
|
||||
E890BC0D273D09A50007C46B /* XPGiftCountView.m in Sources */,
|
||||
@@ -10652,6 +10668,7 @@
|
||||
E801274027E323C800BAC3F2 /* XPRoomPKViewController.m in Sources */,
|
||||
E8EEB91426FC7786007C6EBA /* XPMineUserInfoNickViewController.m in Sources */,
|
||||
18E7B31B26F0982E0064BC9B /* UserExpand.m in Sources */,
|
||||
236B2E592AA18E13003967A8 /* XPMIneGameCollectionViewCell.m in Sources */,
|
||||
9BDA3E7D27FD47AB00517FE6 /* XPAnchorFansTeamPresenter.m in Sources */,
|
||||
E8C6FFE62754FE53004DC9F0 /* XPHomeSearchPresenter.m in Sources */,
|
||||
9B2A12DE2783FEDD00CED41B /* UserVipInfoVo.m in Sources */,
|
||||
@@ -10946,6 +10963,7 @@
|
||||
E884C3722743AEDE00E1EBED /* CustomAttachmentDecoder.m in Sources */,
|
||||
18EE3FEE2750CE6D00A452BF /* NIMMessageUtils.m in Sources */,
|
||||
1427219529A75F6F00C7C423 /* DDNumber.m in Sources */,
|
||||
236B2E5A2AA18E13003967A8 /* XPMineGameTableViewCell.m in Sources */,
|
||||
E8DEC9AC2764A6CD0078CB70 /* XPRoomMoreMenuCollectionViewCell.m in Sources */,
|
||||
E81DCCD0282B63FD0039E5C5 /* XPMonentsRecommendViewController.m in Sources */,
|
||||
9B7D804A2753783D003DAC0C /* SessionViewController.m in Sources */,
|
||||
|
@@ -49,7 +49,7 @@ isPhoneXSeries = [[UIApplication sharedApplication] delegate].window.safeAreaIns
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
#define API_HOST_URL [NSString stringWithFormat:@"%@%@",@"https://beta.api",@".pekolive.com"]
|
||||
#define API_HOST_URL [NSString stringWithFormat:@"%@%@",@"http://beta.api",@".pekolive.com"]
|
||||
|
||||
#else
|
||||
|
||||
|
@@ -50,7 +50,7 @@
|
||||
}
|
||||
[[self getView] loginWithPhoenSuccess];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[[self getView] loginFail];
|
||||
[[self getView] loginFailWithMsg:msg];
|
||||
} errorToast:YES] phone:desPhone code:code client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password" phoneAreaCode:phoneAreaCode];
|
||||
}
|
||||
/// 使用手机号和密码登录
|
||||
@@ -66,7 +66,7 @@
|
||||
}
|
||||
[[self getView] loginSuccess];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[[self getView] loginFail];
|
||||
[[self getView] loginFailWithMsg:msg];
|
||||
} errorToast:YES] phone:desPhone password:desPassword client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password"];
|
||||
}
|
||||
/// 绑定手机号
|
||||
|
@@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
///登录成功
|
||||
- (void)loginSuccess;
|
||||
///登录失败
|
||||
- (void)loginFail;
|
||||
- (void)loginFailWithMsg:(NSString *)msg;
|
||||
///绑定手机号成功
|
||||
- (void)bindPhoneSuccess;
|
||||
///绑定授权码成功
|
||||
|
@@ -249,7 +249,8 @@
|
||||
[vc dismissViewControllerAnimated:YES completion:nil];
|
||||
[self.navigationController popToRootViewControllerAnimated:NO];
|
||||
}
|
||||
- (void)loginFail{
|
||||
- (void)loginFailWithMsg:(NSString *)msg{
|
||||
[self showErrorToast:msg];
|
||||
[XNDJTDDLoadingTool hideOnlyView:self.view];
|
||||
}
|
||||
-(void)backViewAction{
|
||||
|
@@ -26,7 +26,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
///获取个人中心banner
|
||||
- (void)getMineBannerListWithGroup:(dispatch_group_t) group;
|
||||
|
||||
///获取小游戏列表
|
||||
- (void)getLittleGameListWithGroup:(dispatch_group_t) group;
|
||||
///快速匹配小游戏房
|
||||
/// @param mgId 游戏ID
|
||||
- (void)quickMatchLittleGameWithMgId:(NSString *)mgId;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -13,6 +13,7 @@
|
||||
#import "Api+Mine.h"
|
||||
#import "Api+Guild.h"
|
||||
#import "Api+Home.h"
|
||||
#import "Api+LittleGame.h"
|
||||
///Model
|
||||
#import "XPMineItemModel.h"
|
||||
#import "UserInfoModel.h"
|
||||
@@ -21,6 +22,8 @@
|
||||
#import "HomeBannerInfoModel.h"
|
||||
#import "WalletInfoModel.h"
|
||||
#import "ClanDetailInfoModel.h"
|
||||
#import "LittleGameInfoModel.h"
|
||||
#import "HomeLittleGameRoomModel.h"
|
||||
///Protocol
|
||||
#import "XPMineProtocol.h"
|
||||
#import "Api+NobleCenter.h"
|
||||
@@ -109,6 +112,29 @@
|
||||
[[self getView] onGetPersonalBannerListFailWithGroup:group];
|
||||
} errorToast:NO] uid:uid type:@"10"];
|
||||
}
|
||||
|
||||
|
||||
///获取小游戏列表
|
||||
- (void)getLittleGameListWithGroup:(dispatch_group_t) group {
|
||||
NSString * uid = [[AccountInfoStorage instance] getUid];
|
||||
if (!uid.length) {
|
||||
[[self getView] onGetLittleGameListFailWithGroup:group];
|
||||
return;
|
||||
}
|
||||
[Api getLittleGameList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
NSArray * array = [LittleGameInfoModel modelsWithArray:data.data];
|
||||
[[self getView] onGetLittleGameListSuccess:array WithGroup:group];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[[self getView] onGetLittleGameListFailWithGroup:group];
|
||||
} errorToast:NO]];
|
||||
}
|
||||
///快速匹配小游戏房
|
||||
/// @param mgId 游戏ID
|
||||
- (void)quickMatchLittleGameWithMgId:(NSString *)mgId {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
[Api requestMineQuickMatchLittleGame:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
HomeLittleGameRoomModel *gameRoom = [HomeLittleGameRoomModel modelWithDictionary:data.data];
|
||||
[[self getView] quickMatchLittleGameRoomSuccess:gameRoom mgId:mgId];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_quick_entry_click eventAttributes:@{@"mgId" : mgId}];
|
||||
}] uid:uid mgId:mgId];
|
||||
}
|
||||
@end
|
||||
|
@@ -8,7 +8,7 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class XPMineItemModel, UserInfoModel, NobleCenterModel, ClanDetailInfoModel, XPMineFuntionItemModel, HomeBannerInfoModel, WalletInfoModel;
|
||||
@class XPMineItemModel, UserInfoModel, NobleCenterModel, ClanDetailInfoModel, XPMineFuntionItemModel, HomeBannerInfoModel, WalletInfoModel,LittleGameInfoModel,HomeLittleGameRoomModel;
|
||||
@protocol XPMineProtocol <NSObject>
|
||||
|
||||
///获取用户信息成功
|
||||
@@ -33,7 +33,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)onGetPersonalBannerListSuccess:(NSArray<HomeBannerInfoModel *> *)items WithGroup:(dispatch_group_t) group;
|
||||
///获取个人中心banner失败
|
||||
- (void)onGetPersonalBannerListFailWithGroup:(dispatch_group_t) group;
|
||||
|
||||
///获取小游戏列表
|
||||
- (void)onGetLittleGameListSuccess:(NSArray<LittleGameInfoModel *> *)items WithGroup:(dispatch_group_t) group;
|
||||
///获取小游戏列表失败
|
||||
- (void)onGetLittleGameListFailWithGroup:(dispatch_group_t) group;
|
||||
///匹配游戏房成功
|
||||
- (void)quickMatchLittleGameRoomSuccess:(HomeLittleGameRoomModel *)roomInfo mgId:(NSString *)mgId;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
19
YuMi/Modules/YMMine/View/Cell/XPMIneGameCollectionViewCell.h
Normal file
19
YuMi/Modules/YMMine/View/Cell/XPMIneGameCollectionViewCell.h
Normal file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// XPMIneGameCollectionViewCell.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/7/22.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class LittleGameInfoModel;
|
||||
@interface XPMIneGameCollectionViewCell : UICollectionViewCell
|
||||
|
||||
///游戏
|
||||
@property (nonatomic, strong) LittleGameInfoModel *gameModel;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
79
YuMi/Modules/YMMine/View/Cell/XPMIneGameCollectionViewCell.m
Normal file
79
YuMi/Modules/YMMine/View/Cell/XPMIneGameCollectionViewCell.m
Normal file
@@ -0,0 +1,79 @@
|
||||
//
|
||||
// XPMIneGameCollectionViewCell.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/7/22.
|
||||
//
|
||||
|
||||
#import "XPMIneGameCollectionViewCell.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import "NetImageView.h"
|
||||
|
||||
///Model
|
||||
#import "LittleGameInfoModel.h"
|
||||
|
||||
@interface XPMIneGameCollectionViewCell ()
|
||||
///显示图片
|
||||
@property (nonatomic,strong) NetImageView *logoImageView;
|
||||
///显示名字
|
||||
@property (nonatomic,strong) UILabel *titleLabel;
|
||||
@end
|
||||
|
||||
@implementation XPMIneGameCollectionViewCell
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self.contentView addSubview:self.logoImageView];
|
||||
[self.contentView addSubview:self.titleLabel];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.logoImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(40, 40));
|
||||
make.centerX.top.mas_equalTo(self.contentView);
|
||||
}];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.logoImageView.mas_bottom).offset(6);
|
||||
make.centerX.mas_equalTo(self.contentView);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setGameModel:(LittleGameInfoModel *)gameModel {
|
||||
_gameModel = gameModel;
|
||||
if (gameModel) {
|
||||
self.titleLabel.text = gameModel.name;
|
||||
self.logoImageView.imageUrl = gameModel.pic;
|
||||
}
|
||||
}
|
||||
|
||||
- (NetImageView *)logoImageView {
|
||||
if (!_logoImageView) {
|
||||
_logoImageView = [[NetImageView alloc] init];
|
||||
}
|
||||
return _logoImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:13];
|
||||
_titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
_titleLabel.textColor = [DJDKMIMOMColor secondTextColor];
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
@end
|
28
YuMi/Modules/YMMine/View/Cell/XPMineGameTableViewCell.h
Normal file
28
YuMi/Modules/YMMine/View/Cell/XPMineGameTableViewCell.h
Normal file
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// XPMineGameTableViewCell.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/7/22.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class LittleGameInfoModel, XPMineGameTableViewCell;
|
||||
@protocol XPMineGameTableViewCellDelegate <NSObject>
|
||||
|
||||
///选择了某个item
|
||||
- (void)xPMineGameTableViewCell:(XPMineGameTableViewCell *)cell didSelectItem:(LittleGameInfoModel *)item;
|
||||
|
||||
@end
|
||||
|
||||
@interface XPMineGameTableViewCell : UITableViewCell
|
||||
|
||||
///数据
|
||||
@property (nonatomic,strong) NSArray<LittleGameInfoModel *> *datasource;
|
||||
///代理
|
||||
@property (nonatomic,weak) id<XPMineGameTableViewCellDelegate> delegate;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
197
YuMi/Modules/YMMine/View/Cell/XPMineGameTableViewCell.m
Normal file
197
YuMi/Modules/YMMine/View/Cell/XPMineGameTableViewCell.m
Normal file
@@ -0,0 +1,197 @@
|
||||
//
|
||||
// XPMineGameTableViewCell.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/7/22.
|
||||
//
|
||||
|
||||
#import "XPMineGameTableViewCell.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "UIImage+Utils.h"
|
||||
///View
|
||||
#import "XPMIneGameCollectionViewCell.h"
|
||||
|
||||
@interface XPMineGameTableViewCell ()<UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout>
|
||||
|
||||
@property (nonatomic, strong) UIView *mainView;
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
@property (nonatomic, strong) UIImageView *titleBgView;
|
||||
///列表
|
||||
@property (nonatomic,strong) UICollectionView *collectionView;
|
||||
|
||||
@property (nonatomic, strong) UIView *slideBackView;
|
||||
@property (nonatomic, strong) UIView *sliderView;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPMineGameTableViewCell
|
||||
|
||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
|
||||
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
[self.contentView addSubview:self.mainView];
|
||||
[self.mainView addSubview:self.titleBgView];
|
||||
[self.mainView addSubview:self.titleLabel];
|
||||
[self.mainView addSubview:self.collectionView];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.mainView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.bottom.mas_equalTo(0);
|
||||
make.left.right.mas_equalTo(self.contentView).inset(15);
|
||||
}];
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.left.mas_equalTo(12);
|
||||
make.height.mas_equalTo(18);
|
||||
}];
|
||||
[self.titleBgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(self.titleLabel);
|
||||
make.bottom.mas_equalTo(self.titleLabel).mas_offset(1);
|
||||
make.size.mas_equalTo(CGSizeMake(41, 10));
|
||||
}];
|
||||
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_offset(14);
|
||||
make.left.right.mas_equalTo(0);
|
||||
make.height.mas_equalTo(63);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - UICollectionViewDatasource And UICollectionViewDelegate
|
||||
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
|
||||
return self.datasource.count;
|
||||
}
|
||||
|
||||
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
XPMIneGameCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPMIneGameCollectionViewCell class]) forIndexPath:indexPath];
|
||||
LittleGameInfoModel * item = [self.datasource safeObjectAtIndex1:indexPath.row];
|
||||
cell.gameModel = item;
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPMineGameTableViewCell:didSelectItem:)]) {
|
||||
LittleGameInfoModel * model = [self.datasource safeObjectAtIndex1:indexPath.row];
|
||||
[self.delegate xPMineGameTableViewCell:self didSelectItem:model];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - UICollectionViewFlowlayout
|
||||
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section {
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
CGFloat width = (KScreenWidth - 30) / 4;
|
||||
return CGSizeMake(width, 63);
|
||||
}
|
||||
|
||||
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section {
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
|
||||
CGPoint offset = scrollView.contentOffset;
|
||||
CGRect frame = self.sliderView.frame;
|
||||
frame.origin.x = offset.x*12/(scrollView.contentSize.width-scrollView.frame.size.width);
|
||||
self.sliderView.frame = frame;
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setDatasource:(NSArray<LittleGameInfoModel *> *)datasource {
|
||||
_datasource = datasource;
|
||||
if(datasource.count > 4) {
|
||||
[self.mainView addSubview:self.slideBackView];
|
||||
[self.slideBackView addSubview:self.sliderView];
|
||||
[self.slideBackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.mainView);
|
||||
make.size.mas_equalTo(CGSizeMake(24, 4));
|
||||
make.top.mas_equalTo(self.collectionView.mas_bottom).mas_offset(10);
|
||||
}];
|
||||
[self.sliderView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(12, 4));
|
||||
make.top.left.bottom.mas_equalTo(self.slideBackView);
|
||||
}];
|
||||
} else {
|
||||
[self.sliderView removeFromSuperview];
|
||||
[self.slideBackView removeFromSuperview];
|
||||
}
|
||||
[self.collectionView reloadData];
|
||||
}
|
||||
|
||||
- (UIView *)mainView {
|
||||
if (!_mainView) {
|
||||
_mainView = [[UIView alloc] init];
|
||||
_mainView.backgroundColor = [UIColor whiteColor];
|
||||
_mainView.layer.cornerRadius = 8;
|
||||
_mainView.layer.masksToBounds = YES;
|
||||
}
|
||||
return _mainView;
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.text = YMLocalizedString(@"XPMineGameTableViewCell0");
|
||||
_titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightBold];
|
||||
_titleLabel.textColor = [DJDKMIMOMColor mainTextColor];
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (UIImageView *)titleBgView {
|
||||
if (!_titleBgView) {
|
||||
_titleBgView = [[UIImageView alloc] init];
|
||||
_titleBgView.image = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xFFD15A), UIColorFromRGB(0xFFC000)] gradientType:GradientTypeTopToBottom imgSize:CGSizeMake(41, 10)];
|
||||
_titleBgView.layer.cornerRadius = 5;
|
||||
_titleBgView.layer.masksToBounds = YES;
|
||||
}
|
||||
return _titleBgView;
|
||||
}
|
||||
|
||||
- (UICollectionView *)collectionView{
|
||||
if (!_collectionView) {
|
||||
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
|
||||
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
|
||||
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
|
||||
_collectionView.showsHorizontalScrollIndicator = NO;
|
||||
_collectionView.dataSource = self;
|
||||
_collectionView.delegate = self;
|
||||
_collectionView.backgroundColor = [DJDKMIMOMColor appCellBackgroundColor];
|
||||
[_collectionView registerClass:[XPMIneGameCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPMIneGameCollectionViewCell class])];
|
||||
}
|
||||
return _collectionView;
|
||||
}
|
||||
|
||||
- (UIView *)sliderView {
|
||||
if (!_sliderView) {
|
||||
_sliderView = [[UIView alloc] init];
|
||||
_sliderView.backgroundColor = UIColorFromRGB(0xFFBC51);
|
||||
_sliderView.layer.cornerRadius = 2;
|
||||
_sliderView.layer.masksToBounds = YES;
|
||||
}
|
||||
return _sliderView;
|
||||
}
|
||||
|
||||
- (UIView *)slideBackView {
|
||||
if (!_slideBackView) {
|
||||
_slideBackView = [[UIView alloc] init];
|
||||
_slideBackView.backgroundColor = UIColorRGBAlpha(0x000000, 0.1);
|
||||
_slideBackView.layer.cornerRadius = 2;
|
||||
_slideBackView.layer.masksToBounds = YES;
|
||||
_sliderView.clipsToBounds = YES;
|
||||
}
|
||||
return _slideBackView;
|
||||
}
|
||||
|
||||
@end
|
@@ -8,7 +8,7 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class XPMineFuntionItemModel;
|
||||
@class XPMineFuntionItemModel, LittleGameInfoModel;
|
||||
@interface XPMineListCell : UITableViewCell
|
||||
///功能
|
||||
@property (nonatomic,strong) XPMineFuntionItemModel *itemModel;
|
||||
|
@@ -58,6 +58,10 @@
|
||||
#import "XPIAPRechargeViewController.h"
|
||||
#import "XPIncomeRecordVC.h"
|
||||
#import "XPNobleCenterViewController.h"
|
||||
#import "LittleGameInfoModel.h"
|
||||
#import "HomeLittleGameRoomModel.h"
|
||||
#import "XPLittleGameRoomOpenView.h"
|
||||
#import "XPMineGameTableViewCell.h"
|
||||
UIKIT_EXTERN NSString *kRequestRicket;
|
||||
|
||||
@interface XPMineViewController ()<UITableViewDelegate, UITableViewDataSource, XPMineProtocol, XPMineHeadItemTableViewCellDelegate, XPMineHeadViewDelegate, XPHomeBannerTableViewCellDelegate>
|
||||
@@ -83,6 +87,8 @@ UIKIT_EXTERN NSString *kRequestRicket;
|
||||
@property (nonatomic,assign) BOOL isRefreshRoomInfo;
|
||||
///是否正在请示数据,防止过多请求
|
||||
@property (nonatomic,assign) BOOL isRequestData;
|
||||
///游戏列表
|
||||
@property (nonatomic, strong) NSMutableArray<LittleGameInfoModel *> *littleGameArray;
|
||||
@end
|
||||
|
||||
@implementation XPMineViewController
|
||||
@@ -226,8 +232,22 @@ UIKIT_EXTERN NSString *kRequestRicket;
|
||||
break;
|
||||
case XPMineItemType_My_Room:
|
||||
{
|
||||
NSString* roomUid = [NSString stringWithFormat:@"%ld", (long)self.userInfo.uid];
|
||||
[XPRoomViewController openRoom:roomUid viewController:self];
|
||||
NSString* roomUid = [NSString stringWithFormat:@"%ld", (long)self.userInfo.uid];
|
||||
[Api getRoomInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code == 200) {
|
||||
RoomInfoModel * roomInfo = [RoomInfoModel modelWithJSON:data.data];
|
||||
if (roomInfo.isReselect) {
|
||||
XPLittleGameRoomOpenView * roomOpenView = [[XPLittleGameRoomOpenView alloc] init];
|
||||
roomOpenView.roomInfo = roomInfo;
|
||||
roomOpenView.currentVC = self;
|
||||
[TTPopup popupView:roomOpenView style:TTPopupStyleActionSheet];
|
||||
} else {
|
||||
[XPRoomViewController openRoom:roomUid viewController:self];
|
||||
}
|
||||
} else {
|
||||
[self showErrorToast:msg];
|
||||
}
|
||||
} uid:roomUid intoUid:roomUid];
|
||||
}
|
||||
break;
|
||||
case XPMineItemType_Collect_Room://收藏房间
|
||||
@@ -430,9 +450,24 @@ UIKIT_EXTERN NSString *kRequestRicket;
|
||||
///点击我的房间
|
||||
-(void)pushMyRoomVC{
|
||||
if(self.isRefreshRoomInfo == YES)return;
|
||||
self.isRefreshRoomInfo = YES;
|
||||
NSString* roomUid = [NSString stringWithFormat:@"%ld", (long)self.userInfo.uid];
|
||||
[XPRoomViewController openRoom:roomUid viewController:self];
|
||||
self.isRefreshRoomInfo = YES;
|
||||
NSString* roomUid = [NSString stringWithFormat:@"%ld", (long)self.userInfo.uid];
|
||||
[Api getRoomInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
self.isRefreshRoomInfo = NO;
|
||||
if (code == 200) {
|
||||
RoomInfoModel * roomInfo = [RoomInfoModel modelWithJSON:data.data];
|
||||
if (roomInfo.isReselect) {
|
||||
XPLittleGameRoomOpenView * roomOpenView = [[XPLittleGameRoomOpenView alloc] init];
|
||||
roomOpenView.roomInfo = roomInfo;
|
||||
roomOpenView.currentVC = self;
|
||||
[TTPopup popupView:roomOpenView style:TTPopupStyleActionSheet];
|
||||
} else {
|
||||
[XPRoomViewController openRoom:roomUid viewController:self];
|
||||
}
|
||||
} else {
|
||||
[self showErrorToast:msg];
|
||||
}
|
||||
} uid:roomUid intoUid:roomUid];
|
||||
}
|
||||
#pragma mark - XPMineHeadViewDelegate
|
||||
///点击头像
|
||||
@@ -490,7 +525,21 @@ UIKIT_EXTERN NSString *kRequestRicket;
|
||||
- (void)onGetMineFuntionItemFailWithGroup:(dispatch_group_t)group{
|
||||
dispatch_group_leave(group);
|
||||
}
|
||||
|
||||
///获取小游戏列表
|
||||
- (void)onGetLittleGameListSuccess:(NSArray<LittleGameInfoModel *> *)items WithGroup:(nonnull dispatch_group_t)group{
|
||||
[self.littleGameArray removeAllObjects];
|
||||
[self.littleGameArray addObjectsFromArray:items];
|
||||
dispatch_group_leave(group);
|
||||
NSMutableArray *array = [NSMutableArray array];
|
||||
for (LittleGameInfoModel *item in self.littleGameArray) {
|
||||
[array addObject:item.name];
|
||||
}
|
||||
NSString *trackName = [array componentsJoinedByString:@","];
|
||||
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_quick_entry_show eventAttributes:@{@"gameName" : trackName}];
|
||||
}
|
||||
- (void)onGetLittleGameListFailWithGroup:(dispatch_group_t)group{
|
||||
dispatch_group_leave(group);
|
||||
}
|
||||
///获取个人中心banner
|
||||
- (void)onGetPersonalBannerListSuccess:(NSArray<HomeBannerInfoModel *> *)items WithGroup:(nonnull dispatch_group_t)group{
|
||||
[self.bannerArray removeAllObjects];
|
||||
@@ -539,7 +588,10 @@ UIKIT_EXTERN NSString *kRequestRicket;
|
||||
dispatch_group_async(group, queue, ^{
|
||||
[self.presenter getPersonItemListWithGroup:group];
|
||||
});
|
||||
|
||||
dispatch_group_enter(group);
|
||||
dispatch_group_async(group, queue, ^{
|
||||
[self.presenter getLittleGameListWithGroup:group];
|
||||
});
|
||||
dispatch_group_enter(group);
|
||||
dispatch_group_async(group, queue, ^{
|
||||
[self.presenter getMineBannerListWithGroup:group];
|
||||
@@ -585,6 +637,56 @@ UIKIT_EXTERN NSString *kRequestRicket;
|
||||
- (void)onGetClanDetailInfofailWithGroup:(dispatch_group_t)group{
|
||||
dispatch_group_leave(group);
|
||||
}
|
||||
///匹配游戏房成功
|
||||
- (void)quickMatchLittleGameRoomSuccess:(HomeLittleGameRoomModel *)roomInfo mgId:(NSString *)mgId {
|
||||
if (roomInfo.isPick && roomInfo.uid.length > 0) {
|
||||
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_quick_entrysuccess_click eventAttributes:@{@"roomUid" : roomInfo.uid}];
|
||||
[XPRoomViewController openRoom:roomInfo.uid viewController:self];
|
||||
} else if (roomInfo.needOpenSelfRoom) {
|
||||
NSString* roomUid = [NSString stringWithFormat:@"%ld", (long)self.userInfo.uid];
|
||||
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_quick_entrysuccess_click eventAttributes:@{@"roomUid" : roomUid}];
|
||||
[Api getRoomInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code == 200) {
|
||||
RoomInfoModel * roomInfo = [RoomInfoModel modelWithJSON:data.data];
|
||||
if (roomInfo.mgId != [mgId intValue]) {///更新房间游戏类型
|
||||
NSMutableDictionary * params = [NSMutableDictionary dictionary];
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
||||
[params setObject:ticket forKey:@"ticket"];
|
||||
[params setObject:uid forKey:@"uid"];
|
||||
[params setObject:[NSString stringWithFormat:@"%ld", roomInfo.uid] forKey:@"roomUid"];
|
||||
if (roomInfo.title.length > 0) {
|
||||
[params setObject:roomInfo.title forKey:@"title"];
|
||||
}
|
||||
if (roomInfo.roomPwd.length > 0) {
|
||||
[params setObject:roomInfo.roomPwd forKey:@"roomPwd"];
|
||||
} else{
|
||||
[params setObject:@"" forKey:@"roomPwd"];
|
||||
}
|
||||
if (roomInfo.tagId > 0) {
|
||||
[params setObject:[NSString stringWithFormat:@"%ld", roomInfo.tagId] forKey:@"tagId"];
|
||||
}
|
||||
[params setObject:@(RoomType_MiniGame) forKey:@"type"];
|
||||
[params setObject:mgId forKey:@"mgId"];
|
||||
[params setObject:@(roomInfo.hasAnimationEffect) forKey:@"hasAnimationEffect"];
|
||||
[Api ownerUpdateRoomInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code == 200) {
|
||||
[XPRoomViewController openRoom:[AccountInfoStorage instance].getUid mgId:mgId viewController:self];
|
||||
}
|
||||
} params:params];
|
||||
}
|
||||
} else {
|
||||
[self showErrorToast:msg];
|
||||
}
|
||||
} uid:roomUid intoUid:roomUid];
|
||||
}
|
||||
}
|
||||
|
||||
///匹配游戏房失败
|
||||
- (void)quickMatchLittleGameRoomFail:(NSString *)mgId {
|
||||
[XPRoomViewController openRoom:[NSString stringWithFormat:@"%ld", self.userInfo.uid] mgId:mgId viewController:self];
|
||||
}
|
||||
|
||||
#pragma mark - XPMineHeadItemTableViewCellDelegate
|
||||
- (void)xPMineHeadItemTableViewCell:(XPMineHeadItemTableViewCell *)cell didSelectItem:(XPMineFuntionItemModel *)item {
|
||||
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_function_click eventAttributes:@{@"functionName" : item.centerName}];
|
||||
@@ -614,7 +716,11 @@ UIKIT_EXTERN NSString *kRequestRicket;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - XPMineGameTableViewCellDelegate
|
||||
///选择了某个游戏
|
||||
- (void)xPMineGameTableViewCell:(XPMineGameTableViewCell *)cell didSelectItem:(LittleGameInfoModel *)item {
|
||||
[self.presenter quickMatchLittleGameWithMgId:item.mgId];
|
||||
}
|
||||
|
||||
#pragma mark - NSNotification
|
||||
- (void)onVisitorUnReadCountUpdate:(NSNotification *)noti {
|
||||
@@ -661,6 +767,12 @@ UIKIT_EXTERN NSString *kRequestRicket;
|
||||
}
|
||||
return _functionArray;
|
||||
}
|
||||
- (NSMutableArray<LittleGameInfoModel *> *)littleGameArray {
|
||||
if (!_littleGameArray) {
|
||||
_littleGameArray = [NSMutableArray array];
|
||||
}
|
||||
return _littleGameArray;
|
||||
}
|
||||
|
||||
- (NSMutableArray<HomeBannerInfoModel *> *)bannerArray {
|
||||
if (!_bannerArray) {
|
||||
|
44
YuMi/Modules/YMNewHome/Model/HomeLittleGameRoomModel.h
Normal file
44
YuMi/Modules/YMNewHome/Model/HomeLittleGameRoomModel.h
Normal file
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// HomeLittleGameRoomModel.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/3/24.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class HomeLittleGameMicUserModel;
|
||||
@interface HomeLittleGameRoomModel : NSObject
|
||||
///头像
|
||||
@property (nonatomic, copy) NSString *avatar;
|
||||
///小游戏ID
|
||||
@property(nonatomic, copy) NSString *mgId;
|
||||
///小游戏名称
|
||||
@property(nonatomic, copy) NSString *mgName;
|
||||
///麦上用户
|
||||
@property (nonatomic, strong) NSArray<HomeLittleGameMicUserModel *> *micUsers;
|
||||
///在线人数
|
||||
@property (nonatomic, assign) NSInteger onlineNum;
|
||||
///房间标题
|
||||
@property (nonatomic, copy) NSString *title;
|
||||
///房主的uid
|
||||
@property (nonatomic,copy) NSString *uid;
|
||||
///房间小游戏状态:1-游戏进行中,2-等人中
|
||||
@property (nonatomic, assign) NSInteger state;
|
||||
///是否选择的房间
|
||||
@property (nonatomic, assign) BOOL isPick;
|
||||
///是否打开自己房间
|
||||
@property (nonatomic, assign) BOOL needOpenSelfRoom;
|
||||
@end
|
||||
|
||||
@interface HomeLittleGameMicUserModel : NSObject
|
||||
///头像
|
||||
@property (nonatomic, copy) NSString *avatar;
|
||||
///姓名
|
||||
@property (nonatomic,copy) NSString *nick;
|
||||
///用户的uid
|
||||
@property (nonatomic,copy) NSString *uid;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
24
YuMi/Modules/YMNewHome/Model/HomeLittleGameRoomModel.m
Normal file
24
YuMi/Modules/YMNewHome/Model/HomeLittleGameRoomModel.m
Normal file
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// HomeLittleGameRoomModel.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/3/24.
|
||||
//
|
||||
|
||||
#import "HomeLittleGameRoomModel.h"
|
||||
|
||||
@implementation HomeLittleGameRoomModel
|
||||
+ (NSDictionary *)objectClassInArray {
|
||||
return @{
|
||||
@"micUsers": [HomeLittleGameMicUserModel class]
|
||||
};
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation HomeLittleGameMicUserModel
|
||||
|
||||
|
||||
|
||||
@end
|
@@ -22,7 +22,7 @@
|
||||
#import "NSArray+Safe.h"
|
||||
///Model
|
||||
#import "HomeTagModel.h"
|
||||
|
||||
#import "XPLittleGameRoomOpenView.h"
|
||||
///View
|
||||
#import "XPRoomSearchContainerViewController.h"
|
||||
#import "XPHomePartyViewController.h"
|
||||
@@ -173,7 +173,22 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
|
||||
|
||||
}
|
||||
-(void)opRoom:(NSString *)roomUid{
|
||||
[XPRoomViewController openRoom:roomUid viewController:self];
|
||||
[Api getRoomInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code == 200) {
|
||||
RoomInfoModel * roomInfo = [RoomInfoModel modelWithJSON:data.data];
|
||||
if (roomInfo.isReselect) {
|
||||
XPLittleGameRoomOpenView * roomOpenView = [[XPLittleGameRoomOpenView alloc] init];
|
||||
roomOpenView.roomInfo = roomInfo;
|
||||
roomOpenView.currentVC = self;
|
||||
[TTPopup popupView:roomOpenView style:TTPopupStyleActionSheet];
|
||||
} else {
|
||||
[XPRoomViewController openRoom:roomUid viewController:self];
|
||||
}
|
||||
} else {
|
||||
[self showErrorToast:msg];
|
||||
}
|
||||
} uid:roomUid intoUid:roomUid];
|
||||
|
||||
}
|
||||
|
||||
- (void)xPNewHomeNavView:(XPNewHomeNavView *)view didClickSearch:(UIView *)sender {
|
||||
|
@@ -12,6 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@class Music;
|
||||
@interface XPRoomFunctionContainerView : UIView <RoomGuestDelegate>
|
||||
- (instancetype)initWithdelegate:(id<RoomHostDelegate>)delegate;
|
||||
- (void)hiddenSudGamePostionView;
|
||||
///获取当前的音乐
|
||||
- (Music *)getCurrentMusic;
|
||||
///是否正在播放
|
||||
|
@@ -94,15 +94,21 @@
|
||||
|
||||
|
||||
#import "XPRoomTrumpetView.h"
|
||||
#import "LittleGameInfoModel.h"
|
||||
#import "XPLittleGameMiniStageView.h"
|
||||
#import "XPLittleGameRoomListView.h"
|
||||
|
||||
|
||||
@interface XPRoomFunctionContainerView ()<XPAcrpssRoomPKPanelViewDelegate, XPAnchorPkPanelViewDelegate, XPRoomBackMusicPlayerViewDelegate, XPRoomNewUserGreetViewDelegate, XPWishGiftViewControllerDelegate>
|
||||
@interface XPRoomFunctionContainerView ()<XPAcrpssRoomPKPanelViewDelegate, XPAnchorPkPanelViewDelegate, XPRoomBackMusicPlayerViewDelegate, XPRoomNewUserGreetViewDelegate, XPWishGiftViewControllerDelegate,XPRoomLittleGameListViewDelegate>
|
||||
///host 代理
|
||||
@property (nonatomic,weak) id<RoomHostDelegate>delegate;
|
||||
///房间榜
|
||||
@property (nonatomic,strong) XPRoomRankEntranceView *contributeEnterView;
|
||||
///相亲阶段的按钮
|
||||
@property (nonatomic,strong) UIButton *datingProgresButton;
|
||||
///小游戏 最小化的坑位
|
||||
@property (nonatomic,strong) XPLittleGameMiniStageView *littleGameMiniView;
|
||||
///显示游戏的切换
|
||||
@property (nonatomic,strong) XPLittleGameRoomListView *gameListView;
|
||||
///关注个播房主倒计时
|
||||
@property (nonatomic, strong) dispatch_source_t followAnchorTimer;
|
||||
///个播粉丝团入口
|
||||
@@ -206,7 +212,13 @@
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
#pragma mark - Public Method
|
||||
- (void)hiddenSudGamePostionView {
|
||||
if (self.delegate.getRoomInfo.mgMicNum > 6) {
|
||||
return;
|
||||
}
|
||||
[self.littleGameMiniView hiddenSudGamePostionView];
|
||||
}
|
||||
#pragma mark - Public Method
|
||||
|
||||
- (Music *)getCurrentMusic {
|
||||
@@ -258,7 +270,81 @@
|
||||
make.top.mas_equalTo(50 + 5 + 6 + 12 + 3 + kNavigationHeight);
|
||||
}];
|
||||
}
|
||||
- (void)showLittleGameMiniView:(RoomType)type micCount:(NSInteger)micCount {
|
||||
if (type == RoomType_MiniGame) {
|
||||
if (!self.littleGameMiniView.superview) {
|
||||
[self addSubview:self.littleGameMiniView];
|
||||
[self.littleGameMiniView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(0);
|
||||
make.top.mas_equalTo(kNavigationHeight);
|
||||
make.height.mas_equalTo(23);
|
||||
}];
|
||||
}
|
||||
self.littleGameMiniView.micCount = micCount;
|
||||
if (micCount > 6) {
|
||||
[self.littleGameMiniView removeFromSuperview];
|
||||
}
|
||||
} else {
|
||||
if (self.littleGameMiniView.superview) {
|
||||
[self.littleGameMiniView removeFromSuperview];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)configLittleGameState {
|
||||
RoomInfoModel * roomInfo = self.delegate.getRoomInfo;
|
||||
if (roomInfo.isPermitRoom != PermitRoomType_Licnese && roomInfo.roomModeType != RoomModeType_Open_Blind && roomInfo.roomModeType != RoomModeType_Open_PK_Mode && roomInfo.roomModeType != RoomModeType_Open_AcrossRoomPK_mode && roomInfo.roomModeType != RoomModeType_Open_Micro_Mode && !roomInfo.leaveMode && roomInfo.uid == [AccountInfoStorage instance].getUid.integerValue) {
|
||||
if (!self.gameListView.superview) {
|
||||
[self addSubview:self.gameListView];
|
||||
[self.gameListView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(self).offset(-85);
|
||||
make.top.mas_equalTo(self).offset(kNavigationHeight - 14 - 11 - 19.0 / 2.0);
|
||||
}];
|
||||
}
|
||||
self.gameListView.mgId = roomInfo.mgId > 0 ? [NSString stringWithFormat:@"%lld", roomInfo.mgId] : @"0";
|
||||
} else {
|
||||
if (self.gameListView.superview) {
|
||||
[self.gameListView removeFromSuperview];
|
||||
}
|
||||
}
|
||||
}
|
||||
//自己是否在游戏中
|
||||
- (BOOL)isInSudGame {
|
||||
BOOL isGamePlaying = NO;
|
||||
if (self.delegate.getRoomInfo.type == RoomType_MiniGame) {
|
||||
for (int i = -1; i<5; i++) {
|
||||
NSMutableDictionary * micQueue = self.delegate.getMicroQueue;
|
||||
MicroQueueModel *micSequence = [micQueue objectForKey:[NSString stringWithFormat:@"%d", i]];
|
||||
if (micSequence == nil || micSequence.userInfo == nil) {
|
||||
continue;
|
||||
}
|
||||
if (micSequence.userInfo.uid == [AccountInfoStorage instance].getUid.integerValue && micSequence.userInfo.gameStatus == LittleGamePlayStatus_Plying) {
|
||||
isGamePlaying = YES;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return isGamePlaying;
|
||||
}
|
||||
|
||||
///当前房间是否在游戏中
|
||||
- (BOOL)currentRoomIsInSudGame {
|
||||
BOOL isGamePlaying = NO;
|
||||
if (self.delegate.getRoomInfo.type == RoomType_MiniGame) {
|
||||
for (int i = -1; i<5; i++) {
|
||||
NSMutableDictionary * micQueue = self.delegate.getMicroQueue;
|
||||
MicroQueueModel *micSequence = [micQueue objectForKey:[NSString stringWithFormat:@"%d", i]];
|
||||
if (micSequence == nil || micSequence.userInfo == nil) {
|
||||
continue;
|
||||
}
|
||||
if (micSequence.userInfo.gameStatus == LittleGamePlayStatus_Plying) {
|
||||
isGamePlaying = YES;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return isGamePlaying;
|
||||
}
|
||||
#pragma mark - 新用户打招呼动画
|
||||
- (void)handleNewUserGreet {
|
||||
if (self.delegate.getUserInfo.fromType == UserEnterRoomFromType_New_User_Greet && !self.isLoadGreet) {
|
||||
@@ -456,6 +542,8 @@
|
||||
}
|
||||
}
|
||||
[self updateRoomTopic];
|
||||
[self showLittleGameMiniView:roomInfo.type micCount:roomInfo.mgMicNum];
|
||||
[self configLittleGameState];
|
||||
[self configPlayMusicRoomTypeChange];
|
||||
[self configRoomPKPanelView:NO];
|
||||
///相亲模式下 隐藏许愿礼物 和vip坑位重叠了
|
||||
@@ -528,6 +616,8 @@
|
||||
[self handleAcrollPKCountView:roomInfo.pkBeginTime];
|
||||
}
|
||||
[self updateRoomTopic];
|
||||
[self showLittleGameMiniView:roomInfo.type micCount:roomInfo.mgMicNum];
|
||||
[self configLittleGameState];
|
||||
[self configRoomPKPanelView:YES];
|
||||
[self handleNewUserGreet];
|
||||
///新用户房间礼物
|
||||
@@ -861,7 +951,9 @@
|
||||
}
|
||||
|
||||
- (void)onMicroQueueUpdate:(NSMutableDictionary<NSString *,MicroQueueModel *> *)queue {
|
||||
if(self.delegate.getRoomInfo.roomModeType == RoomModeType_Open_PK_Mode) {
|
||||
if (self.delegate.getRoomInfo.type == RoomType_MiniGame) {
|
||||
[self.littleGameMiniView needRefreshPosition:queue];
|
||||
} else if(self.delegate.getRoomInfo.roomModeType == RoomModeType_Open_PK_Mode) {
|
||||
self.roompkPanelView.micQueue = queue;
|
||||
}else {
|
||||
|
||||
@@ -1479,6 +1571,53 @@
|
||||
if (self.hourRankEntranceView.superview) {[self.hourRankEntranceView removeFromSuperview];}
|
||||
}
|
||||
}
|
||||
#pragma mark - XPRoomLittleGameListViewDelegate
|
||||
- (void)xPRoomLittleGameListView:(XPLittleGameRoomListView *)view didSelectItem:(LittleGameInfoModel *)itemInfo {
|
||||
RoomInfoModel * roomInfo = self.delegate.getRoomInfo;
|
||||
NSMutableDictionary * params = [NSMutableDictionary dictionary];
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
||||
[params setObject:ticket forKey:@"ticket"];
|
||||
[params setObject:uid forKey:@"uid"];
|
||||
[params setObject:[NSString stringWithFormat:@"%ld", roomInfo.uid] forKey:@"roomUid"];
|
||||
if (roomInfo.title.length > 0) {
|
||||
[params setObject:roomInfo.title forKey:@"title"];
|
||||
}
|
||||
|
||||
if (roomInfo.roomPwd.length > 0) {
|
||||
[params setObject:roomInfo.roomPwd forKey:@"roomPwd"];
|
||||
} else{
|
||||
[params setObject:@"" forKey:@"roomPwd"];
|
||||
}
|
||||
|
||||
if (roomInfo.tagId > 0) {
|
||||
[params setObject:[NSString stringWithFormat:@"%ld", roomInfo.tagId] forKey:@"tagId"];
|
||||
}
|
||||
if ([itemInfo.mgId isEqualToString:@"0"]) {
|
||||
[params setObject:@(RoomType_Game) forKey:@"type"];
|
||||
[params setObject:@"0" forKey:@"mgId"];
|
||||
} else {
|
||||
[params setObject:@(RoomType_MiniGame) forKey:@"type"];
|
||||
[params setObject:itemInfo.mgId forKey:@"mgId"];
|
||||
}
|
||||
[params setObject:@(roomInfo.hasAnimationEffect) forKey:@"hasAnimationEffect"];
|
||||
[Api ownerUpdateRoomInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code == 200) {
|
||||
|
||||
} else {
|
||||
[XNDJTDDLoadingTool showErrorWithMessage:msg];
|
||||
}
|
||||
} params:params];
|
||||
}
|
||||
|
||||
- (void)xPRoomLittleGameListView:(XPLittleGameRoomListView *)view didSelectChooseType:(UIButton *)sender {
|
||||
if ([self currentRoomIsInSudGame]) {
|
||||
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPRoomFunctionContainerView18")];
|
||||
} else {
|
||||
sender.selected = !sender.selected;
|
||||
view.tableView.hidden = !sender.selected;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - 房间背景音乐
|
||||
-(void)pauseLayer:(CALayer*)layer {
|
||||
@@ -1740,6 +1879,20 @@
|
||||
}
|
||||
return _acrossPKPanelView;
|
||||
}
|
||||
- (XPLittleGameMiniStageView *)littleGameMiniView {
|
||||
if (!_littleGameMiniView) {
|
||||
_littleGameMiniView = [[XPLittleGameMiniStageView alloc] init];
|
||||
}
|
||||
return _littleGameMiniView;
|
||||
}
|
||||
|
||||
- (XPLittleGameRoomListView *)gameListView {
|
||||
if (!_gameListView) {
|
||||
_gameListView = [[XPLittleGameRoomListView alloc] init];
|
||||
_gameListView.delegate = self;
|
||||
}
|
||||
return _gameListView;
|
||||
}
|
||||
- (XPAnchorPkPanelView *)anchorPKPanelView {
|
||||
if (!_anchorPKPanelView) {
|
||||
_anchorPKPanelView = [[XPAnchorPkPanelView alloc] init];
|
||||
|
@@ -1295,6 +1295,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
[self.activityContainerView handleNIMNotificationMessage:message];
|
||||
[self.menuContainerView handleNIMNotificationMessage:message];
|
||||
[self.functionView handleNIMNotificationMessage:message];
|
||||
[self.littleGameView handleNIMNotificationMessage:message];
|
||||
if([self.stageView findMicroViewByUid:@(self.userInfo.uid).stringValue] != nil){
|
||||
[XPSkillCardPlayerManager shareInstance].isMineInMic = YES;
|
||||
}else{
|
||||
@@ -1309,6 +1310,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
[self.menuContainerView handleNIMCustomMessage:message];
|
||||
[self.activityContainerView handleNIMCustomMessage:message];
|
||||
[self.functionView handleNIMCustomMessage:message];
|
||||
[self.littleGameView handleNIMCustomMessage:message];
|
||||
if (attachment.first == CustomMessageType_First_Recharge_Reward && attachment.second == Custom_Message_Sub_Room_First_Recharge_Reward) {
|
||||
self.userInfo.isFirstCharge = NO;
|
||||
[self.menuContainerView onRoomUpdate];
|
||||
@@ -1336,6 +1338,8 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
[self cancelRoomArrangeMic];
|
||||
[[RtcManager instance] exitRoom];
|
||||
[self.presenter reportUserOutRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.uid]];
|
||||
[self.littleGameView handleSelfInExitEvent];
|
||||
[self.littleGameView destroyMG];
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
} else if (attachment.first == CustomMessageType_RedPacket) {
|
||||
@@ -1357,6 +1361,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
}
|
||||
} else if(message.messageType == NIMMessageTypeText) {
|
||||
[self.messageContainerView handleNIMTextMessage:message];
|
||||
[self.littleGameView handleNIMTextMessage:message];
|
||||
} else if(message.messageType == NIMMessageTypeTip) {
|
||||
[self.messageContainerView handleNIMTextMessage:message];
|
||||
}
|
||||
@@ -1534,7 +1539,33 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
[self handleFirstOutRoom];
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
} roomUid:roomUid operUid:uid page:@"1" pageSize:@"50"];
|
||||
} else {
|
||||
}else if(self.roomInfo.type == RoomType_MiniGame) {
|
||||
if ([self.littleGameView isInSudGame]) {
|
||||
TTAlertConfig *config = [[TTAlertConfig alloc] init];
|
||||
config.cancelButtonConfig.title = YMLocalizedString(@"XPRoomSettingInputView4");
|
||||
config.confirmButtonConfig.title = YMLocalizedString(@"XPRoomSettingInputView5");
|
||||
config.message = YMLocalizedString(@"XPRoomViewController14");
|
||||
[TTPopup alertWithConfig:config confirmHandler:^{ // 知道了
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[self.presenter exitNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId]];
|
||||
[[RtcManager instance] exitRoom];
|
||||
[self.littleGameView handleSelfInExitEvent];
|
||||
[self.littleGameView destroyMG];
|
||||
[self handleFirstOutRoom];
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
});
|
||||
} cancelHandler:^{
|
||||
}];
|
||||
} else {
|
||||
[self.presenter exitNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId]];
|
||||
[[RtcManager instance] exitRoom];
|
||||
[self.littleGameView handleSelfInExitEvent];
|
||||
[self.littleGameView destroyMG];
|
||||
[self handleFirstOutRoom];
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
}
|
||||
else {
|
||||
[self.presenter exitNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId]];
|
||||
[[XPRoomMiniManager shareManager] resetLocalMessage];
|
||||
[[RtcManager instance] exitRoom];
|
||||
@@ -1545,18 +1576,55 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
}
|
||||
|
||||
- (void)miniRoom {
|
||||
[self.menuContainerView menuResignFirstResponder];
|
||||
[[XPRoomMiniManager shareManager] configRoomInfo:self.roomInfo];
|
||||
[[XPRoomMiniManager shareManager] configUserInfo:self.userInfo];
|
||||
[[XPRoomMiniManager shareManager] configCurrentMusic:self.functionView.getCurrentMusic isPlaying:self.functionView.isPlaying];
|
||||
NSMutableDictionary * dic = [NSMutableDictionary dictionary];
|
||||
[dic safeSetObject:self.roomInfo.model2dictionary forKey:@"roomInfo"];
|
||||
[dic safeSetObject:self.userInfo.model2dictionary forKey:@"userInfo"];
|
||||
[dic safeSetObject:self.getMicroQueue forKey:@"microQueue"];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kRoomMiniNotificationKey object:nil userInfo:dic];
|
||||
[self.view endEditing:YES];
|
||||
[self handleFirstOutRoom];
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
|
||||
[self.menuContainerView menuResignFirstResponder];
|
||||
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(showRoomFirstChargeWindow) object:nil];
|
||||
NSDictionary *roomInfoDic = self.roomInfo.model2dictionary != nil ? self.roomInfo.model2dictionary : @{};
|
||||
NSDictionary *userInfoDic = self.userInfo.model2dictionary != nil ? self.userInfo.model2dictionary : @{};
|
||||
NSMutableDictionary *queueDic = self.getMicroQueue != nil ? self.getMicroQueue : [@{} mutableCopy];
|
||||
if(self.roomInfo.type == RoomType_MiniGame) {
|
||||
if ([self.littleGameView isInSudGame]) {
|
||||
TTAlertConfig *config = [[TTAlertConfig alloc] init];
|
||||
config.cancelButtonConfig.title = YMLocalizedString(@"XPRoomViewController15");
|
||||
config.confirmButtonConfig.title = YMLocalizedString(@"XPRoomViewController16");
|
||||
config.message = YMLocalizedString(@"XPRoomViewController17");
|
||||
[TTPopup alertWithConfig:config confirmHandler:^{ // 知道了
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[[XPRoomMiniManager shareManager] configRoomInfo:self.roomInfo];
|
||||
[[XPRoomMiniManager shareManager] configUserInfo:self.userInfo];
|
||||
[[XPRoomMiniManager shareManager] configCurrentMusic:self.functionView.getCurrentMusic isPlaying:self.functionView.isPlaying];
|
||||
NSDictionary * dic = @{@"roomInfo":roomInfoDic, @"userInfo":userInfoDic, @"microQueue":queueDic};
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kRoomMiniNotificationKey object:nil userInfo:dic];
|
||||
[self.view endEditing:YES];
|
||||
[self.littleGameView handleSelfInExitEvent];
|
||||
[self.littleGameView destroyMG];
|
||||
[self handleFirstOutRoom];
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
});
|
||||
} cancelHandler:^{
|
||||
}];
|
||||
} else {
|
||||
[[XPRoomMiniManager shareManager] configRoomInfo:self.roomInfo];
|
||||
[[XPRoomMiniManager shareManager] configUserInfo:self.userInfo];
|
||||
[[XPRoomMiniManager shareManager] configCurrentMusic:self.functionView.getCurrentMusic isPlaying:self.functionView.isPlaying];
|
||||
NSDictionary * dic = @{@"roomInfo":roomInfoDic, @"userInfo":userInfoDic, @"microQueue":queueDic};
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kRoomMiniNotificationKey object:nil userInfo:dic];
|
||||
[self.view endEditing:YES];
|
||||
[self.littleGameView handleSelfInExitEvent];
|
||||
[self.littleGameView destroyMG];
|
||||
[self handleFirstOutRoom];
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
}else {
|
||||
[[XPRoomMiniManager shareManager] configRoomInfo:self.roomInfo];
|
||||
[[XPRoomMiniManager shareManager] configUserInfo:self.userInfo];
|
||||
[[XPRoomMiniManager shareManager] configCurrentMusic:self.functionView.getCurrentMusic isPlaying:self.functionView.isPlaying];
|
||||
NSDictionary * dic = @{@"roomInfo":roomInfoDic, @"userInfo":userInfoDic, @"microQueue":queueDic};
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kRoomMiniNotificationKey object:nil userInfo:dic];
|
||||
[self.view endEditing:YES];
|
||||
[self handleFirstOutRoom];
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
}
|
||||
|
||||
- (UINavigationController *)getCurrentNav {
|
||||
@@ -1612,6 +1680,11 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kNewUserRechargeKey object:nil];
|
||||
}
|
||||
}
|
||||
#pragma mark - XPRoomLittleGameContainerViewDelegate
|
||||
- (void)hiddenSudGamePostionView {
|
||||
[self.functionView hiddenSudGamePostionView];
|
||||
}
|
||||
|
||||
#pragma mark - AnchorRoomScrollViewDelegate
|
||||
- (void)anchorScrollViewScrollToNext:(AnchorRoomScrollView *)anchorScrollView {
|
||||
if (!self) {
|
||||
@@ -1677,6 +1750,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
[self.activityContainerView onRoomEntered];
|
||||
[self.menuContainerView onRoomEntered];
|
||||
[self.backContainerView onRoomEntered];
|
||||
[self.littleGameView onRoomEntered];
|
||||
[self.littleGameView onRoomEntered];
|
||||
if ([XPRoomMiniManager shareManager].getRoomInfo.uid != self.roomUid.integerValue) {// 最小化进房 还是原来的房间的话 不需要重新进入云信 因为压根没退
|
||||
[self.presenter enterNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId] user:self.userInfo];
|
||||
@@ -1702,6 +1776,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
[self.functionView onRoomEntered];
|
||||
[self.presenter enterNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId] user:self.userInfo];
|
||||
[self.messageContainerView onRoomEntered];
|
||||
[self.littleGameView onRoomEntered];
|
||||
[[XPRoomMiniManager shareManager] configRoomInfo:nil];
|
||||
[[XPRoomMiniManager shareManager] configUserInfo:nil];
|
||||
[[XPRoomMiniManager shareManager] configCurrentMusic:nil isPlaying:NO];
|
||||
@@ -1779,7 +1854,13 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
}
|
||||
return _stageView;
|
||||
}
|
||||
|
||||
- (XPRoomLittleGameContainerView *)littleGameView {
|
||||
if (!_littleGameView) {
|
||||
_littleGameView = [[XPRoomLittleGameContainerView alloc] initWithDelegate:self];
|
||||
_littleGameView.delegate = self;
|
||||
}
|
||||
return _littleGameView;
|
||||
}
|
||||
- (AnchorRoomScrollView *)anchorScrollView {
|
||||
if (!_anchorScrollView) {
|
||||
_anchorScrollView = [[AnchorRoomScrollView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
|
||||
|
@@ -1049,7 +1049,7 @@
|
||||
"XPRoomFunctionContainerView11" = "进入嘉宾交流环节?";
|
||||
"XPRoomFunctionContainerView12" = "暂未设置话题";
|
||||
"XPRoomFunctionContainerView13" = "开始选择>";
|
||||
|
||||
"XPRoomFunctionContainerView18" = "游戏中不可切换游戏或玩法!";
|
||||
"XPRoomBackContainerView0" = "贵族专属背景图加载失败";
|
||||
"XPRoomBackContainerView1" = "个播背景图加载失败";
|
||||
|
||||
@@ -1161,7 +1161,8 @@
|
||||
"StageView27" = "抱Ta上麦当主持";
|
||||
"StageView28" = "下麦旁听";
|
||||
"StageView29" = "关注Ta";
|
||||
|
||||
///XPMineGameTableViewCell.m
|
||||
"XPMineGameTableViewCell0" = "休闲游戏";
|
||||
|
||||
"AnchorStageView1" = "解锁";
|
||||
"AnchorStageView3" = "开麦";
|
||||
@@ -1657,6 +1658,14 @@
|
||||
"XPRoomViewController11" = "退出房间后将退出目前排麦,再次进入需要重新排麦,确认退出房间吗?";
|
||||
"XPRoomViewController12" = "退出房间后将退出目前排麦,再次进入需要重新排麦,确认退出房间吗";
|
||||
"XPRoomViewController13" = "已经到顶啦~自动为您返回当前房间";
|
||||
"XPRoomViewController14" = "退出房间则默认认输逃跑,是否退房?";
|
||||
"XPRoomViewController15" = "取消";
|
||||
"XPRoomViewController16" = "确认";
|
||||
"XPRoomViewController17" = "退出房间则默认认输逃跑,是否退房?";
|
||||
"XPRoomViewController18" = "已经到顶啦~自动为您返回当前房间";
|
||||
"XPRoomViewController19" = "你已屏蔽该房间,可在【设置】-【屏蔽管理】中解除,精彩等你继续~";
|
||||
"XPRoomViewController20" = "抱歉,您暂时无法进入该房间";
|
||||
"XPRoomViewController21" = "抱歉,您暂时无法进入该房间";
|
||||
|
||||
"XPRoomSettingPresenter0" = "房间名";
|
||||
"XPRoomSettingPresenter1" = "房间上锁";
|
||||
|
@@ -1049,6 +1049,7 @@
|
||||
"XPRoomFunctionContainerView11" = "進入嘉賓交流環節?";
|
||||
"XPRoomFunctionContainerView12" = "暫未設置話題";
|
||||
"XPRoomFunctionContainerView13" = "開始選擇>";
|
||||
"XPRoomFunctionContainerView18" = "游戲中不可切換游戲或玩法!";
|
||||
|
||||
"XPRoomBackContainerView0" = "貴族專屬背景圖加載失敗";
|
||||
"XPRoomBackContainerView1" = "個播背景圖加載失敗";
|
||||
@@ -1657,6 +1658,14 @@
|
||||
"XPRoomViewController11" = "退出房間後將退出目前排麥,再次進入需要重新排麥,確認退出房間嗎?";
|
||||
"XPRoomViewController12" = "退出房間後將退出目前排麥,再次進入需要重新排麥,確認退出房間嗎";
|
||||
"XPRoomViewController13" = "已經到頂啦~自動為您返回當前房間";
|
||||
"XPRoomViewController14" = "退出房間則默認認輸逃跑,是否退房?";
|
||||
"XPRoomViewController15" = "取消";
|
||||
"XPRoomViewController16" = "確認";
|
||||
"XPRoomViewController17" = "退出房間則默認認輸逃跑,是否退房?";
|
||||
"XPRoomViewController18" = "已經到頂啦~自動為您返回當前房間";
|
||||
"XPRoomViewController19" = "你已屏蔽該房間,可在【設置】-【屏蔽管理】中解除,精彩等你繼續~";
|
||||
"XPRoomViewController20" = "抱歉,您暫時無法進入該房間";
|
||||
"XPRoomViewController21" = "抱歉,您暫時無法進入該房間";
|
||||
|
||||
"XPRoomSettingPresenter0" = "房間名";
|
||||
"XPRoomSettingPresenter1" = "房間上鎖";
|
||||
@@ -2960,6 +2969,8 @@
|
||||
"LittleGameStageView0" = "游戲中不可以換麥!";
|
||||
///LittleGameScrollStageView.m
|
||||
"LittleGameScrollStageView0" = "游戲中不可以換麥!";
|
||||
///XPMineGameTableViewCell.m
|
||||
"XPMineGameTableViewCell0" = "休閑游戲";
|
||||
///不能腳本生成的
|
||||
"App_Common_And" = "和";
|
||||
"App_Common_Male" = "男";
|
||||
|
Reference in New Issue
Block a user