处理需求 #64

1. /miniGame/record/miniGameList 补充参数 roomUid
This commit is contained in:
eggmanQQQ
2024-06-03 14:59:42 +08:00
parent 6e1b8fab1a
commit 34c70c1e76
8 changed files with 21 additions and 11 deletions

View File

@@ -125,7 +125,8 @@
[[self getView] onGetLittleGameListSuccess:array ]; [[self getView] onGetLittleGameListSuccess:array ];
} fail:^(NSInteger code, NSString * _Nullable msg) { } fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView] onGetLittleGameListFail]; [[self getView] onGetLittleGameListFail];
} errorToast:NO]]; } errorToast:NO]
roomUid:uid];
} }
/// ///
/// @param mgId ID /// @param mgId ID

View File

@@ -197,6 +197,7 @@
[[self getView] onGetLittleGameListSuccess:array]; [[self getView] onGetLittleGameListSuccess:array];
}fail:^(NSInteger code, NSString * _Nullable msg) { }fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView] getHomeRecommendDataFail]; [[self getView] getHomeRecommendDataFail];
}errorToast:NO]]; }errorToast:NO]
roomUid:@""];
} }
@end @end

View File

@@ -130,7 +130,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
@kWeakify(self); @kWeakify(self);
RACSubject* playRAC = [RACSubject subject]; RACSubject* playRAC = [RACSubject subject];
RACSubject* littleGameRAC = [RACSubject subject]; RACSubject* littleGameRAC = [RACSubject subject];
[[RACSignal combineLatest:@[playRAC, littleGameRAC] [[RACSignal combineLatest:@[playRAC, littleGameRAC]
reduce:^id(NSArray<ActivityInfoModel*> *playModels, NSArray<LittleGameInfoModel*> *littleGameModels){ reduce:^id(NSArray<ActivityInfoModel*> *playModels, NSArray<LittleGameInfoModel*> *littleGameModels){
@kStrongify(self); @kStrongify(self);
self.playList = [NSMutableArray arrayWithArray:playModels]; self.playList = [NSMutableArray arrayWithArray:playModels];
@@ -138,7 +138,9 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
return nil; return nil;
}] subscribeError:^(NSError * _Nullable error) {}]; }] subscribeError:^(NSError * _Nullable error) {}];
NSString * roomId = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.roomId]; RoomInfoModel *roomInfo = self.hostDelegate.getRoomInfo;
NSString * roomId = [NSString stringWithFormat:@"%ld", roomInfo.roomId];
[Api roomActivityList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { [Api roomActivityList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
@kStrongify(self); @kStrongify(self);
if (code == 200) { if (code == 200) {
@@ -158,6 +160,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
} }
} roomId:roomId]; } roomId:roomId];
NSString * roomUid = [NSString stringWithFormat:@"%ld", roomInfo.uid];
[Api getLittleGameList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { [Api getLittleGameList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) { if (code == 200) {
NSArray * array = [LittleGameInfoModel modelsWithArray:data.data]; NSArray * array = [LittleGameInfoModel modelsWithArray:data.data];
@@ -166,7 +169,8 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
} else { } else {
[littleGameRAC sendError:nil]; [littleGameRAC sendError:nil];
} }
}]; }
roomUid:roomUid];
} }
-(void)dealWithData{ -(void)dealWithData{
self.isLoadActivity = YES; self.isLoadActivity = YES;

View File

@@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface Api (LittleGame) @interface Api (LittleGame)
/// 获取小游戏列表 /// 获取小游戏列表
/// @param completion 完成 /// @param completion 完成
+ (void)getLittleGameList:(HttpRequestHelperCompletion)completion; + (void)getLittleGameList:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid;
/// 获取小游戏的code /// 获取小游戏的code
/// @param completion 完成 /// @param completion 完成

View File

@@ -10,9 +10,10 @@
@implementation Api (LittleGame) @implementation Api (LittleGame)
/// ///
/// @param roomUid uid,
/// @param completion /// @param completion
+ (void)getLittleGameList:(HttpRequestHelperCompletion)completion { + (void)getLittleGameList:(HttpRequestHelperCompletion)completion roomUid:(nonnull NSString *)roomUid {
[self makeRequest:@"miniGame/record/miniGameList" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, nil]; [self makeRequest:@"miniGame/record/miniGameList" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, roomUid, nil];
} }

View File

@@ -130,7 +130,8 @@
self.gameList = [dataArray copy]; self.gameList = [dataArray copy];
self.datasource = [self handleGameListData:self.gameList]; self.datasource = [self handleGameListData:self.gameList];
} }
}]; }
roomUid:@""];
} }
} }

View File

@@ -74,7 +74,8 @@
self.datasource = array; self.datasource = array;
[self.collectionView reloadData]; [self.collectionView reloadData];
} }
}]; }
roomUid:@""];
} }
- (void)initSubViews { - (void)initSubViews {

View File

@@ -104,7 +104,8 @@
NSArray * array = [LittleGameInfoModel modelsWithArray:data.data]; NSArray * array = [LittleGameInfoModel modelsWithArray:data.data];
self.gameView.littleGameList = array.mutableCopy; self.gameView.littleGameList = array.mutableCopy;
} }
}]; }
roomUid:@""];
} }
-(void)installUI{ -(void)installUI{