1
Podfile
@@ -19,6 +19,7 @@ target 'YuMi' do
|
||||
pod 'MJExtension'
|
||||
#图片加载
|
||||
pod 'SDWebImage'
|
||||
# pod 'SDWebImageWebPCoder' 用于加载 webP
|
||||
pod 'FLAnimatedImage'
|
||||
pod 'SDWebImageFLPlugin' # 对FLAnimatedImage和SDWebImage的桥接
|
||||
pod 'AFNetworking'
|
||||
|
@@ -12927,6 +12927,17 @@
|
||||
"$(PROJECT_DIR)/YuMi/Tools/TencentOpenApiSDK",
|
||||
);
|
||||
GCC_PREFIX_HEADER = YuMi/Structure/PrefixHeader.pch;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"$(inherited)",
|
||||
"SD_WEBP=1",
|
||||
"COCOAPODS=1",
|
||||
"$(inherited)",
|
||||
"GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1",
|
||||
"$(inherited)",
|
||||
"PB_FIELD_32BIT=1",
|
||||
"PB_NO_PACKED_STRUCTS=1",
|
||||
"PB_ENABLE_MALLOC=1",
|
||||
);
|
||||
INFOPLIST_FILE = YuMi/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
|
@@ -5,7 +5,6 @@
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "ms_room_game_button@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
|
Before Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 24 KiB |
@@ -5,7 +5,6 @@
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "ms_room_menu_game@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
|
Before Width: | Height: | Size: 603 B |
@@ -5,7 +5,6 @@
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_menu_more@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
|
Before Width: | Height: | Size: 583 B |
@@ -5,7 +5,6 @@
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_menu_more_red@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
|
Before Width: | Height: | Size: 2.0 KiB |
21
YuMi/Assets.xcassets/yna/Menu/room_menu_play.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_menu_play@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
YuMi/Assets.xcassets/yna/Menu/room_menu_play.imageset/room_menu_play@3x.png
vendored
Normal file
After Width: | Height: | Size: 3.9 KiB |
@@ -184,14 +184,20 @@
|
||||
/// @param roomUid 房主的uid 获取房间专属礼物
|
||||
- (void)getNormalGiftList:(NSString *)roomUid {
|
||||
///先不请求接口 从缓存中获取
|
||||
CGFloat delayDuration = 0.0;
|
||||
NSArray *giftCacheArray = [[XPGiftStorage shareStorage] getGiftDatasource:roomUid];
|
||||
if (giftCacheArray.count == 0) {
|
||||
[Api requestNormalGiftList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code == 200) {
|
||||
if (giftCacheArray.count > 0) {
|
||||
delayDuration = 0.25;
|
||||
}
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayDuration * NSEC_PER_SEC)), dispatch_get_global_queue(0, 0), ^{
|
||||
@kWeakify(self);
|
||||
[Api requestNormalGiftList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
@kStrongify(self);
|
||||
if (data.data) {
|
||||
[[XPGiftStorage shareStorage] cacheWith:data.data inRoom:roomUid];
|
||||
}
|
||||
} roomUid:roomUid];
|
||||
}
|
||||
}fail:^(NSInteger code, NSString * _Nullable msg) {}] roomUid:roomUid];
|
||||
});
|
||||
}
|
||||
|
||||
/// 上报用户进房
|
||||
|
@@ -55,7 +55,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
|
||||
@property(nonatomic,strong) PIRoomEnterRedPacketView *redPacketView;
|
||||
|
||||
///游戏菜单按钮
|
||||
@property(nonatomic, strong) UIButton *gameMenuButton;
|
||||
@property(nonatomic, strong) UIButton *gambleMenuButton;
|
||||
///游戏菜单按钮
|
||||
@property(nonatomic, strong) UIButton *pkMenuButton;
|
||||
|
||||
@@ -101,7 +101,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
|
||||
[self.stackView addArrangedSubview:self.redPacketView];
|
||||
[self.stackView addArrangedSubview:self.joinDatingView];
|
||||
[self.stackView addArrangedSubview:self.pkMenuButton];
|
||||
[self.stackView addArrangedSubview:self.gameMenuButton];
|
||||
[self.stackView addArrangedSubview:self.gambleMenuButton];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
@@ -123,7 +123,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
|
||||
make.size.mas_equalTo(CGSizeMake(76, 76));
|
||||
}];
|
||||
|
||||
[self.gameMenuButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
[self.gambleMenuButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(0);
|
||||
make.size.mas_equalTo(CGSizeMake(76, 76));
|
||||
}];
|
||||
@@ -227,10 +227,10 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
|
||||
- (void)onRoomUpdate {
|
||||
RoomInfoModel * roomInfo = self.hostDelegate.getRoomInfo;
|
||||
if (roomInfo.type == RoomType_Anchor || roomInfo.roomModeType == RoomModeType_Open_Blind) {
|
||||
self.gameMenuButton.hidden = YES;
|
||||
self.gambleMenuButton.hidden = YES;
|
||||
self.pkMenuButton.hidden = YES;
|
||||
} else {
|
||||
self.gameMenuButton.hidden = NO;
|
||||
self.gambleMenuButton.hidden = NO;
|
||||
self.pkMenuButton.hidden = NO;
|
||||
}
|
||||
|
||||
@@ -243,21 +243,21 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
|
||||
self.redPacketView.type = roomInfo.type;
|
||||
if (roomInfo.type == RoomType_MiniGame) {
|
||||
self.redPacketView.hidden = YES;
|
||||
[self.gameMenuButton removeFromSuperview];
|
||||
[self.gambleMenuButton removeFromSuperview];
|
||||
[self.pi_cycleScrollView removeFromSuperview];
|
||||
[self.stackView insertArrangedSubview:self.gameMenuButton atIndex:0];
|
||||
[self.stackView insertArrangedSubview:self.gambleMenuButton atIndex:0];
|
||||
[self.stackView addArrangedSubview:self.pi_cycleScrollView];
|
||||
[self.gameMenuButton bringSubviewToFront:self.stackView];
|
||||
[self.gambleMenuButton bringSubviewToFront:self.stackView];
|
||||
if (self.isLoadActivity) {
|
||||
[self configLittleGameActivity];
|
||||
} else {
|
||||
[self requestActivityList];
|
||||
}
|
||||
} else {
|
||||
[self.gameMenuButton removeFromSuperview];
|
||||
[self.gambleMenuButton removeFromSuperview];
|
||||
[self.pi_cycleScrollView removeFromSuperview];
|
||||
[self.stackView insertArrangedSubview:self.pi_cycleScrollView atIndex:0];
|
||||
[self.stackView addArrangedSubview:self.gameMenuButton];
|
||||
[self.stackView addArrangedSubview:self.gambleMenuButton];
|
||||
self.redPacketView.redPacketList = self.redPacketList;
|
||||
NSMutableArray *picArray = [NSMutableArray array];
|
||||
for (ActivityInfoModel *model in self.activityList) {
|
||||
@@ -546,7 +546,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
|
||||
}
|
||||
|
||||
- (void)didTapGameMenuButton {
|
||||
MSRoomMenuGameVC *vc = [[MSRoomMenuGameVC alloc] initWithDelegate:self.hostDelegate roomMenuType:MSRoomMenuTypeLittleGame];
|
||||
MSRoomMenuGameVC *vc = [[MSRoomMenuGameVC alloc] initWithDelegate:self.hostDelegate roomMenuType:MSRoomMenuTypeGame];
|
||||
vc.modalPresentationStyle = UIModalPresentationOverFullScreen;
|
||||
[self.hostDelegate.getCurrentNav presentViewController:vc animated:YES completion:nil];
|
||||
}
|
||||
@@ -662,15 +662,15 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
|
||||
return _redPacketView;
|
||||
}
|
||||
|
||||
- (UIButton *)gameMenuButton {
|
||||
if (!_gameMenuButton) {
|
||||
- (UIButton *)gambleMenuButton {
|
||||
if (!_gambleMenuButton) {
|
||||
UIButton *b = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[b setImage:[UIImage imageNamed:@"ms_room_game_button"] forState:UIControlStateNormal];
|
||||
[b addTarget:self action:@selector(didTapGameMenuButton) forControlEvents:UIControlEventTouchUpInside];
|
||||
b.hidden = YES;
|
||||
_gameMenuButton = b;
|
||||
_gambleMenuButton = b;
|
||||
}
|
||||
return _gameMenuButton;
|
||||
return _gambleMenuButton;
|
||||
}
|
||||
|
||||
- (UIButton *)pkMenuButton {
|
||||
|
@@ -11,8 +11,9 @@
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef NS_ENUM(NSInteger, MSRoomMenuType) {
|
||||
MSRoomMenuTypePK, // 只有 PK
|
||||
MSRoomMenuTypeGame, // 玩法
|
||||
MSRoomMenuTypeLittleGame, // 小游戏
|
||||
MSRoomMenuTypeLittleGame, // 小游戏, 百顺的
|
||||
};
|
||||
|
||||
|
||||
|
@@ -66,6 +66,9 @@
|
||||
|
||||
- (void)loadMenuData {
|
||||
switch (self.type) {
|
||||
case MSRoomMenuTypePK:
|
||||
[self updateGamePlayList:@[]];
|
||||
break;
|
||||
case MSRoomMenuTypeGame:
|
||||
[self getGameData];
|
||||
break;
|
||||
@@ -78,11 +81,12 @@
|
||||
}
|
||||
|
||||
-(void)getGameData{
|
||||
NSMutableArray *resourceList = [self.hostDelegate getPlayList];
|
||||
if(resourceList.count > 0){
|
||||
[self updateGamePlayList:resourceList];
|
||||
return;
|
||||
}
|
||||
// NSMutableArray *resourceList = [self.hostDelegate getPlayList];
|
||||
// if(resourceList.count > 0){
|
||||
// self.gameView.playList = resourceList;
|
||||
//// [self updateGamePlayList:resourceList];
|
||||
// return;
|
||||
// }
|
||||
|
||||
NSString * roomId = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.roomId];
|
||||
@kWeakify(self);
|
||||
@@ -90,7 +94,14 @@
|
||||
if (code == 200) {
|
||||
@kStrongify(self);
|
||||
NSArray <ActivityInfoModel *>* array = [ActivityInfoModel modelsWithArray:data.data];
|
||||
[self updateGamePlayList:array];
|
||||
// NSMutableArray *tA = [array mutableCopy];
|
||||
// [tA addObjectsFromArray:array];
|
||||
// [tA addObjectsFromArray:array];
|
||||
// [tA addObjectsFromArray:array];
|
||||
// [tA addObjectsFromArray:array];
|
||||
|
||||
self.gameView.playList = [array mutableCopy];
|
||||
// [self updateGamePlayList:array];
|
||||
}
|
||||
} roomId:roomId];
|
||||
}
|
||||
|
@@ -16,12 +16,18 @@ static const NSInteger kItemsPerRow = 5;
|
||||
@property(nonatomic,strong) UIButton *backBtn;
|
||||
@property(nonatomic,strong) UIView *ms_bgView;
|
||||
@property(nonatomic,strong) UICollectionView *collectionView;
|
||||
|
||||
@property (nonatomic, assign) CGFloat itemHeight;
|
||||
|
||||
@end
|
||||
@implementation MSRoomMenuGameView
|
||||
|
||||
-(instancetype)initWithFrame:(CGRect)frame{
|
||||
self = [super initWithFrame:frame];
|
||||
if(self){
|
||||
|
||||
self.itemHeight = kGetScaleWidth(80);
|
||||
|
||||
[self installUI];
|
||||
[self installConstraints];
|
||||
}
|
||||
@@ -69,9 +75,19 @@ static const NSInteger kItemsPerRow = 5;
|
||||
}
|
||||
|
||||
- (void)updateViewHeightWithItemCount:(NSInteger)count {
|
||||
NSInteger lineNum = (count + kItemsPerRow - 1)/kItemsPerRow;
|
||||
NSInteger lineNum = MIN(3, (count + kItemsPerRow - 1)/kItemsPerRow);
|
||||
|
||||
if (lineNum == 1) {
|
||||
self.itemHeight = kGetScaleWidth(100);
|
||||
}
|
||||
|
||||
CGFloat calHeight = kGetScaleWidth(80);
|
||||
if (lineNum < 3) {
|
||||
calHeight = kGetScaleWidth(100);
|
||||
}
|
||||
|
||||
CGFloat height = 20 + 56 * lineNum + 44 * (lineNum - 1) + 70;
|
||||
height = kGetScaleWidth(100) * lineNum;
|
||||
height = calHeight * lineNum;
|
||||
// [_ms_bgView setCornerWithLeftTopCorner:kGetScaleWidth(12) rightTopCorner:kGetScaleWidth(12) bottomLeftCorner:0 bottomRightCorner:0 size:CGSizeMake(KScreenWidth, height-48)];
|
||||
[self.ms_bgView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(kGetScaleWidth(height + 12));
|
||||
@@ -88,7 +104,7 @@ static const NSInteger kItemsPerRow = 5;
|
||||
#pragma mark- UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout
|
||||
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
CGFloat width = (KScreenWidth-kGetScaleWidth(6))/5;
|
||||
return [self countOfCurrentType] > 0 ? CGSizeMake(width, kGetScaleWidth(100)): CGSizeMake(KScreenWidth, kGetScaleWidth(200));
|
||||
return [self countOfCurrentType] > 0 ? CGSizeMake(width, self.itemHeight): CGSizeMake(KScreenWidth, kGetScaleWidth(200));
|
||||
}
|
||||
- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section{
|
||||
return [self countOfCurrentType] > 0 ? UIEdgeInsetsMake(0, kGetScaleWidth(3), 0, kGetScaleWidth(3)): UIEdgeInsetsMake(0, 0, 0, 0);
|
||||
|
@@ -19,7 +19,8 @@ typedef NS_ENUM(NSInteger, XPRoomMenuItemType) {
|
||||
XPRoomMenuItemType_ArrangeMic,///排麦
|
||||
XPRoomMenuItemType_Gift,///礼物
|
||||
XPRoomMenuItemType_Noble,///VIP
|
||||
MSRoomMenuItemType_Game,///VIP
|
||||
XPRoomMenuItemType_PK,/// PK 菜单
|
||||
MSRoomMenuItemType_BAISHUN_GAME,///显示百顺游戏
|
||||
};
|
||||
|
||||
@interface XPRoomMenuItem : NSObject
|
||||
|
@@ -51,6 +51,8 @@
|
||||
@property (nonatomic,strong) UIButton *messageButton;
|
||||
///更多
|
||||
@property (nonatomic,strong) UIButton *moreButton;
|
||||
/// PK 入口
|
||||
@property (nonatomic,strong) UIButton *pkButton;
|
||||
///礼物
|
||||
@property (nonatomic,strong) UIButton *giftButton;
|
||||
@property (nonatomic, strong) SVGAImageView *svgDisplayView;
|
||||
@@ -59,7 +61,7 @@
|
||||
@property (nonatomic,strong) UIButton *arrangeMicButton;
|
||||
|
||||
///游戏、活动
|
||||
@property(nonatomic,strong) UIButton *gameButton;
|
||||
@property(nonatomic,strong) UIButton *baiShunGameButton;
|
||||
|
||||
///输入框
|
||||
@property (nonatomic,strong) XPRoomSendTextView *inputTextView;
|
||||
@@ -199,9 +201,16 @@
|
||||
[self.delegate.getCurrentNav pushViewController:nobleVC animated:YES];
|
||||
}
|
||||
break;
|
||||
case MSRoomMenuItemType_Game:
|
||||
case MSRoomMenuItemType_BAISHUN_GAME:
|
||||
{
|
||||
MSRoomMenuGameVC *vc = [[MSRoomMenuGameVC alloc]initWithDelegate:self.delegate roomMenuType:MSRoomMenuTypeGame];
|
||||
MSRoomMenuGameVC *vc = [[MSRoomMenuGameVC alloc]initWithDelegate:self.delegate roomMenuType:MSRoomMenuTypeLittleGame];
|
||||
vc.modalPresentationStyle = UIModalPresentationOverFullScreen;
|
||||
[self.delegate.getCurrentNav presentViewController:vc animated:YES completion:nil];
|
||||
break;
|
||||
}
|
||||
case XPRoomMenuItemType_PK:
|
||||
{
|
||||
MSRoomMenuGameVC *vc = [[MSRoomMenuGameVC alloc]initWithDelegate:self.delegate roomMenuType:MSRoomMenuTypePK];
|
||||
vc.modalPresentationStyle = UIModalPresentationOverFullScreen;
|
||||
[self.delegate.getCurrentNav presentViewController:vc animated:YES completion:nil];
|
||||
break;
|
||||
@@ -227,20 +236,21 @@
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.inputButton];
|
||||
[self addSubview:self.scrollView];
|
||||
[self addSubview:self.gameButton];
|
||||
[self addSubview:self.svgDisplayView];
|
||||
[self addSubview:self.giftButton];
|
||||
|
||||
[self.scrollView addSubview:self.stackView];
|
||||
|
||||
[self.stackView addArrangedSubview:self.inputButton];
|
||||
[self.stackView addArrangedSubview:self.micButton];
|
||||
[self.stackView addArrangedSubview:self.voiceButton];
|
||||
[self.stackView addArrangedSubview:self.faceButton];
|
||||
[self.stackView addArrangedSubview:self.arrangeMicButton];
|
||||
[self.stackView addArrangedSubview:self.messageButton];
|
||||
[self.stackView addArrangedSubview:self.moreButton];
|
||||
[self.stackView addArrangedSubview:self.baiShunGameButton];
|
||||
[self.stackView addArrangedSubview:self.pkButton];
|
||||
|
||||
self.backgroundColor = UIColorRGBAlpha(0xFFFFFF, 0.2);
|
||||
CAShapeLayer * layer = [CAShapeLayer layer];
|
||||
@@ -270,8 +280,8 @@
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(self).offset(15);
|
||||
make.trailing.mas_equalTo(self.gameButton.mas_leading).offset(-11);
|
||||
make.leading.mas_equalTo(self.inputButton.mas_trailing).offset(15);
|
||||
make.trailing.mas_equalTo(self.giftButton.mas_leading).offset(-11);
|
||||
make.top.mas_equalTo(self).offset(16);
|
||||
make.height.mas_equalTo(29);
|
||||
}];
|
||||
@@ -282,6 +292,7 @@
|
||||
|
||||
[self.inputButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(90, 28));
|
||||
make.left.top.mas_equalTo(16);
|
||||
}];
|
||||
[self.svgDisplayView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self.scrollView);
|
||||
@@ -291,11 +302,6 @@
|
||||
[self.giftButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.svgDisplayView);
|
||||
}];
|
||||
[self.gameButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self.scrollView);
|
||||
make.trailing.equalTo(self.svgDisplayView.mas_leading).mas_offset(-11);
|
||||
make.size.mas_equalTo(CGSizeMake(29, 29));
|
||||
}];
|
||||
}
|
||||
|
||||
- (NSArray<XPGiftUserInfoModel *> *)configGiftUsers:(NSMutableDictionary<NSString *,MicroQueueModel *> *)queue {
|
||||
@@ -391,15 +397,13 @@
|
||||
|
||||
- (void)onRoomUpdate {
|
||||
RoomInfoModel * roomInfo = self.delegate.getRoomInfo;
|
||||
// UserInfoModel * userInfo = self.delegate.getUserInfo;
|
||||
|
||||
// if (userInfo.isFirstCharge) {
|
||||
// [self.giftButton setImage:[UIImage getLanguageImage:@"room_menu_gift_first_recharge"] forState:UIControlStateNormal];
|
||||
// [self.giftButton setImage:[UIImage getLanguageImage:@"room_menu_gift_first_recharge"] forState:UIControlStateSelected];
|
||||
// } else {
|
||||
[self.giftButton setImage:[UIImage imageNamed:@"room_menu_gift"] forState:UIControlStateNormal];
|
||||
[self.giftButton setImage:[UIImage imageNamed:@"room_menu_gift"] forState:UIControlStateSelected];
|
||||
// }
|
||||
|
||||
#if RELEASE
|
||||
self.gameButton.hidden = self.delegate.getUserInfo.uid != roomInfo.uid;
|
||||
#endif
|
||||
|
||||
self.arrangeMicButton.hidden = roomInfo.roomModeType != RoomModeType_Open_Micro_Mode;
|
||||
if (roomInfo.roomModeType == RoomModeType_Open_Blind || roomInfo.roomModeType == RoomModeType_Open_PK_Mode || roomInfo.roomModeType == RoomModeType_Open_Micro_Mode) {
|
||||
@@ -408,7 +412,9 @@
|
||||
if([AccountInfoStorage instance].getUid != nil){
|
||||
request.userIds = @[[AccountInfoStorage instance].getUid];
|
||||
}
|
||||
@kWeakify(self);
|
||||
[[NIMSDK sharedSDK].chatroomManager fetchChatroomMembersByIds:request completion:^(NSError * _Nullable error, NSArray<NIMChatroomMember *> * _Nullable members) {
|
||||
@kStrongify(self);
|
||||
if (error == nil) {
|
||||
NIMChatroomMember * member = members.firstObject;
|
||||
if (member.type == NIMChatroomMemberTypeCreator || member.type == NIMChatroomMemberTypeManager) {
|
||||
@@ -432,7 +438,9 @@
|
||||
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
|
||||
request.roomId = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.roomId];
|
||||
request.userIds = @[[AccountInfoStorage instance].getUid];
|
||||
@kWeakify(self);
|
||||
[[NIMSDK sharedSDK].chatroomManager fetchChatroomMembersByIds:request completion:^(NSError * _Nullable error, NSArray<NIMChatroomMember *> * _Nullable members) {
|
||||
@kStrongify(self);
|
||||
NIMChatroomMember * member;
|
||||
if (error == nil) {
|
||||
member = members.firstObject;
|
||||
@@ -588,6 +596,17 @@
|
||||
return _moreButton;
|
||||
}
|
||||
|
||||
- (UIButton *)pkButton {
|
||||
if (!_pkButton) {
|
||||
_pkButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
_pkButton.imageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
_pkButton.tag = XPRoomMenuItemType_PK;
|
||||
[_pkButton setImage:[UIImage imageNamed:@"ms_room_menu_game"] forState:UIControlStateNormal];
|
||||
[_pkButton addTarget:self action:@selector(menuButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _pkButton;
|
||||
}
|
||||
|
||||
|
||||
- (UIButton *)giftButton {
|
||||
if (!_giftButton) {
|
||||
@@ -616,7 +635,7 @@
|
||||
if (!_stackView) {
|
||||
_stackView = [[UIStackView alloc] init];
|
||||
_stackView.axis = UILayoutConstraintAxisHorizontal;
|
||||
_stackView.distribution = UIStackViewDistributionFill;
|
||||
_stackView.distribution = UIStackViewDistributionFillEqually;
|
||||
_stackView.alignment = UIStackViewAlignmentCenter;
|
||||
_stackView.spacing = 11;
|
||||
}
|
||||
@@ -651,14 +670,14 @@
|
||||
}
|
||||
return _miniMessageView;
|
||||
}
|
||||
- (UIButton *)gameButton{
|
||||
if(!_gameButton){
|
||||
_gameButton = [UIButton new];
|
||||
[_gameButton setImage:[UIImage imageNamed:@"ms_room_menu_game"] forState:UIControlStateNormal];
|
||||
[_gameButton setImage:[UIImage imageNamed:@"ms_room_menu_game"] forState:UIControlStateSelected];
|
||||
_gameButton.tag = MSRoomMenuItemType_Game;
|
||||
[_gameButton addTarget:self action:@selector(menuButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
- (UIButton *)baiShunGameButton{
|
||||
if(!_baiShunGameButton){
|
||||
_baiShunGameButton = [UIButton new];
|
||||
[_baiShunGameButton setImage:[UIImage imageNamed:@"room_menu_play"] forState:UIControlStateNormal];
|
||||
[_baiShunGameButton setImage:[UIImage imageNamed:@"room_menu_play"] forState:UIControlStateSelected];
|
||||
_baiShunGameButton.tag = MSRoomMenuItemType_BAISHUN_GAME;
|
||||
[_baiShunGameButton addTarget:self action:@selector(menuButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _gameButton;
|
||||
return _baiShunGameButton;
|
||||
}
|
||||
@end
|
||||
|
@@ -53,10 +53,13 @@
|
||||
/// @param roomUid 房主的uid 获取房间专属礼物
|
||||
- (void)getNormalGiftList:(NSString *)roomUid {
|
||||
///先不请求接口 从缓存中获取
|
||||
CGFloat delayDuration = 0.0;
|
||||
NSArray * arrary = [[XPGiftStorage shareStorage] getGiftDatasource:roomUid];
|
||||
if (arrary.count > 0) {
|
||||
delayDuration = 1;
|
||||
[[self getView] getNormalGiftListSuccess:arrary];
|
||||
}
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayDuration * NSEC_PER_SEC)), dispatch_get_global_queue(0, 0), ^{
|
||||
@kWeakify(self);
|
||||
[Api requestNormalGiftList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
@kStrongify(self);
|
||||
@@ -65,6 +68,7 @@
|
||||
@kStrongify(self);
|
||||
[[self getView] getNormalGiftListFail:msg];
|
||||
}] roomUid:roomUid];
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|