Compare commits
11 Commits
1.0.15
...
appstore_p
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b2ee73c924 | ||
![]() |
9fddcc83ad | ||
![]() |
fa1362dcb2 | ||
![]() |
814954e04c | ||
![]() |
778b9cfa4b | ||
![]() |
259c8ab3f7 | ||
![]() |
c999bdbaf8 | ||
![]() |
18949d3217 | ||
![]() |
bb9f933e05 | ||
![]() |
541db3cb1e | ||
![]() |
75bdf84320 |
@@ -12956,7 +12956,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 20.20.32;
|
||||
MARKETING_VERSION = 20.20.33;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
@@ -12998,7 +12998,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 20.20.32;
|
||||
MARKETING_VERSION = 20.20.33;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
|
@@ -49,7 +49,7 @@ isPhoneXSeries = [[UIApplication sharedApplication] delegate].window.safeAreaIns
|
||||
|
||||
|
||||
///内置版本号
|
||||
#define PI_App_Version @"1.0.18"
|
||||
#define PI_App_Version @"1.0.19"
|
||||
///渠道
|
||||
#define PI_App_Source @"appstore"
|
||||
#define PI_Test_Flight @"TestFlight"
|
||||
|
@@ -27,8 +27,9 @@
|
||||
UserInfoModel * infoModel = [UserInfoModel modelWithDictionary:data.data];
|
||||
[[self getView] onGetUserInfoSuccess:infoModel];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
|
||||
}] uid:uid];
|
||||
@kStrongify(self);
|
||||
[[self getView] onGetUserInfoFailure];
|
||||
} showLoading:YES errorToast:YES] uid:uid];
|
||||
}
|
||||
|
||||
// 获取用户详细信息
|
||||
@@ -38,7 +39,10 @@
|
||||
@kStrongify(self);
|
||||
UserInfoModel * infoModel = [UserInfoModel modelWithDictionary:data.data];
|
||||
[[self getView] onGetDetailInfoSuccess:infoModel];
|
||||
}] uid:uid page:@"1" pageSize:@"20"];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
[[self getView] onGetUserInfoFailure];
|
||||
} errorToast:YES] uid:uid page:@"1" pageSize:@"20"];
|
||||
}
|
||||
|
||||
/// 两个人的关注状态
|
||||
|
@@ -13,8 +13,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@optional
|
||||
///获取用户信息成功
|
||||
- (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo;
|
||||
- (void)onGetUserInfoFailure;
|
||||
|
||||
///获取用户详细信息成功
|
||||
- (void)onGetDetailInfoSuccess:(UserInfoModel *)userInfo;
|
||||
|
||||
///关注/取消关注
|
||||
- (void)attentionUserSuccess:(BOOL)status;
|
||||
///获取关注状态
|
||||
|
@@ -357,6 +357,10 @@ XPMineCustomNavViewDelegate, XPMineUserInfoProtocol, XPMineUserInfoHeaderViewDel
|
||||
[self.presenter getUserDetailInfoWithUid:@(self.uid).stringValue];
|
||||
}
|
||||
|
||||
- (void)onGetUserInfoFailure {
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
|
||||
- (void)onGetDetailInfoSuccess:(UserInfoModel *)userInfo {
|
||||
self.userDataVC.giftWall = userInfo.userGiftWall;
|
||||
self.userDataVC.luckyGiftWall = userInfo.userLuckyBagGiftWall;
|
||||
|
@@ -39,7 +39,7 @@
|
||||
make.trailing.mas_equalTo(self).offset(-26);
|
||||
}
|
||||
|
||||
make.centerY.mas_equalTo(self);
|
||||
make.centerY.mas_equalTo(self).offset(0.8);
|
||||
}];
|
||||
|
||||
[self.copiedImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -55,7 +55,7 @@
|
||||
self.numLabel.text = num;
|
||||
|
||||
UIImage *longBackgroundImage = [UIImage imageNamed:@"user_info_id_beatiful_mark_short"];
|
||||
UIEdgeInsets capInsets = UIEdgeInsetsMake(0, 20, 0, 14);
|
||||
UIEdgeInsets capInsets = UIEdgeInsetsMake(0, 27, 0, 14);
|
||||
UIImage *resizableImage = [longBackgroundImage resizableImageWithCapInsets:capInsets resizingMode:UIImageResizingModeStretch];
|
||||
self.frameImageView.image = resizableImage;
|
||||
}
|
||||
|
@@ -38,7 +38,7 @@ typedef void(^CompletionHandler)(NSMutableAttributedString *);
|
||||
@property (nonatomic, assign) NSInteger visitorUnReadCount;
|
||||
|
||||
///当装扮铭牌时,我的页面中不需要显示铭牌标识
|
||||
- (void)createNamePlateLevelAttribute:(UserInfoModel *)userInfo complete:(CompletionHandler)complete;
|
||||
- (void)createNamePlateLevelAttribute:(UserInfoModel *)userInfo;// complete:(CompletionHandler)complete;
|
||||
///id
|
||||
- (NSMutableAttributedString *)createNamePlateIdLabelAttribute:(UserInfoModel *)userInfo ;
|
||||
@end
|
||||
|
@@ -41,6 +41,12 @@
|
||||
|
||||
///显示等级
|
||||
@property (nonatomic,strong) YYLabel *levelLabel;
|
||||
|
||||
@property (nonatomic,strong) NetImageView *experImageView;
|
||||
@property (nonatomic,strong) NetImageView *charmImageView;
|
||||
//@property (nonatomic,strong) NetImageView *nameplateImageView;
|
||||
//@property (nonatomic,strong) UILabel *nameplateLabel;
|
||||
|
||||
///关注、粉丝的容器
|
||||
@property (nonatomic,strong) UIStackView *attentionStackView;
|
||||
///关注
|
||||
@@ -97,6 +103,8 @@
|
||||
[_stackView addArrangedSubview:self.nobleEntranceView];
|
||||
[_stackView addArrangedSubview:self.agencyView];
|
||||
|
||||
[self addSubview:self.experImageView];
|
||||
[self addSubview:self.charmImageView];
|
||||
|
||||
[self.avatarImageView addSubview:self.reviewView];
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAvatarImageView)];
|
||||
@@ -131,6 +139,20 @@
|
||||
make.top.mas_equalTo(self.idStackView.mas_bottom).offset(5);
|
||||
}];
|
||||
|
||||
[self.experImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(self.nameStackView);
|
||||
make.top.mas_equalTo(self.idStackView.mas_bottom).offset(5);
|
||||
make.width.mas_equalTo(0);
|
||||
make.height.mas_equalTo(20);
|
||||
}];
|
||||
|
||||
[self.charmImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(self.experImageView.mas_trailing).offset(8);
|
||||
make.top.mas_equalTo(self.idStackView.mas_bottom).offset(5);
|
||||
make.width.mas_equalTo(0);
|
||||
make.height.mas_equalTo(20);
|
||||
}];
|
||||
|
||||
[self.attentionStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.avatarImageView.mas_bottom).mas_offset(16);
|
||||
make.height.mas_equalTo(60);
|
||||
@@ -320,32 +342,33 @@
|
||||
attachment.bounds = CGRectMake(0, roundf(font.capHeight - iconImage.size.height)/2.f, iconImage.size.width, iconImage.size.height);
|
||||
attachment.image = iconImage;
|
||||
[textAtt insertAttributedString:[NSMutableAttributedString attributedStringWithAttachment:attachment] atIndex:textAtt.length];
|
||||
self.idLabel.attributedText = textAtt;
|
||||
return textAtt;
|
||||
}
|
||||
|
||||
///当装扮铭牌时,我的页面中不需要显示铭牌标识
|
||||
- (void)createNamePlateLevelAttribute:(UserInfoModel *)userInfo complete:(nonnull CompletionHandler)complete{
|
||||
- (void)createNamePlateLevelAttribute:(UserInfoModel *)userInfo {// complete:(nonnull CompletionHandler)complete{
|
||||
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] init];
|
||||
if (!userInfo) {
|
||||
if(complete){
|
||||
complete(attributedString);
|
||||
}
|
||||
// if(complete){
|
||||
// complete(attributedString);
|
||||
// }
|
||||
return;
|
||||
}
|
||||
|
||||
// if(userInfo.isCertified == YES){
|
||||
// //主播认证
|
||||
// if (userInfo.nameplatePic.length > 0) {
|
||||
// [self createNameplateAttibuteWithImage:userInfo.nameplatePic];
|
||||
// [attributedString appendAttributedString:[self createSpaceAttribute:2]];
|
||||
// }
|
||||
// }else{
|
||||
// //主播认证
|
||||
// if (userInfo.nameplateWord.length > 0 && userInfo.nameplatePic.length>0) {
|
||||
// [self createNameplateAttibute:userInfo.nameplateWord image:userInfo.nameplatePic textFont:[UIFont systemFontOfSize:9]];
|
||||
// [attributedString appendAttributedString:[self createSpaceAttribute:2]];
|
||||
// }
|
||||
// }
|
||||
if(userInfo.isCertified == YES){
|
||||
//主播认证
|
||||
if (userInfo.nameplatePic.length > 0) {
|
||||
[self createNameplateAttibuteWithImage:userInfo.nameplatePic];
|
||||
[attributedString appendAttributedString:[self createSpaceAttribute:2]];
|
||||
}
|
||||
}else{
|
||||
//主播认证
|
||||
if (userInfo.nameplateWord.length > 0 && userInfo.nameplatePic.length>0) {
|
||||
[self createNameplateAttibute:userInfo.nameplateWord image:userInfo.nameplatePic textFont:[UIFont systemFontOfSize:9]];
|
||||
[attributedString appendAttributedString:[self createSpaceAttribute:2]];
|
||||
}
|
||||
}
|
||||
|
||||
// userRank 用户级别
|
||||
if (userInfo.userLevelVo.experUrl) {
|
||||
@@ -359,16 +382,18 @@
|
||||
[attributedString appendAttributedString:[self createSpaceAttribute:4]];
|
||||
}
|
||||
|
||||
if(complete){
|
||||
complete(attributedString);
|
||||
}
|
||||
// if(complete){
|
||||
// complete(attributedString);
|
||||
// }
|
||||
|
||||
self.levelLabel.attributedText = attributedString;
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setUserInfo:(UserInfoModel *)userInfo {
|
||||
_userInfo = userInfo;
|
||||
if (_userInfo) {
|
||||
self.idLabel.attributedText = userInfo.idAtt;
|
||||
|
||||
self.nameLabel.text = _userInfo.nick.length > 0 ? _userInfo.nick : @"";
|
||||
self.avatarImageView.imageUrl = userInfo.avatar;
|
||||
if (userInfo.isReview) {
|
||||
@@ -384,10 +409,55 @@
|
||||
self.sexImageView.selected = _userInfo.gender != GenderType_Male;
|
||||
self.sexImageView.titleEdgeInsets = _userInfo.gender != GenderType_Male ? UIEdgeInsetsMake(0, 2, 0, 0):UIEdgeInsetsMake(0, -1, 0, 0);
|
||||
|
||||
self.levelLabel.attributedText = _userInfo.levelAtt;
|
||||
// self.levelLabel.attributedText = _userInfo.levelAtt;
|
||||
|
||||
self.fansView.number = [NSString stringWithFormat:@"%ld",_userInfo.fansNum];
|
||||
self.attentionView.number = [NSString stringWithFormat:@"%ld",_userInfo.followNum];
|
||||
|
||||
// self.nameplateImageView.imageUrl = _userInfo.nameplatePic;
|
||||
|
||||
@kWeakify(self);
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.25 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
@kStrongify(self);
|
||||
@kWeakify(self);
|
||||
[self.experImageView loadImageWithUrl:self.userInfo.userLevelVo.experUrl completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
|
||||
@kStrongify(self);
|
||||
self.experImageView.image = image;
|
||||
CGFloat scale = 0;
|
||||
if (image) {
|
||||
CGFloat height = image.size.height > 0 ? image.size.height : 1;
|
||||
scale = image.size.width / height ;
|
||||
}
|
||||
else {
|
||||
NSURL *imgUrl = [NSURL URLWithString:self.userInfo.userLevelVo.experUrl];
|
||||
UIImage *myImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:imgUrl]];
|
||||
CGFloat height = myImage.size.height > 0 ? myImage.size.height : 1;
|
||||
scale = myImage.size.width / height;
|
||||
}
|
||||
[self.experImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(20 * scale);
|
||||
}];
|
||||
}];
|
||||
|
||||
[self.charmImageView loadImageWithUrl:self.userInfo.userLevelVo.charmUrl completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
|
||||
@kStrongify(self);
|
||||
self.charmImageView.image = image;
|
||||
CGFloat scale = 0;
|
||||
if (image) {
|
||||
CGFloat height = image.size.height > 0 ? image.size.height : 1;
|
||||
scale = image.size.width / height ;
|
||||
}
|
||||
else {
|
||||
NSURL *imgUrl = [NSURL URLWithString:self.userInfo.userLevelVo.experUrl];
|
||||
UIImage *myImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:imgUrl]];
|
||||
CGFloat height = myImage.size.height > 0 ? myImage.size.height : 1;
|
||||
scale = myImage.size.width / height;
|
||||
}
|
||||
[self.charmImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(20 * scale);
|
||||
}];
|
||||
}];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -486,6 +556,22 @@
|
||||
return _levelLabel;
|
||||
}
|
||||
|
||||
- (NetImageView *)experImageView {
|
||||
if (!_experImageView) {
|
||||
_experImageView = [[NetImageView alloc] init];
|
||||
_experImageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
}
|
||||
return _experImageView;
|
||||
}
|
||||
|
||||
- (NetImageView *)charmImageView {
|
||||
if (!_charmImageView) {
|
||||
_charmImageView = [[NetImageView alloc] init];
|
||||
_charmImageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
}
|
||||
return _charmImageView;
|
||||
}
|
||||
|
||||
- (UIStackView *)attentionStackView {
|
||||
if (!_attentionStackView) {
|
||||
_attentionStackView = [[UIStackView alloc] init];
|
||||
|
@@ -125,9 +125,6 @@ UIKIT_EXTERN NSString *kRequestTicket;
|
||||
if([AccountInfoStorage instance].isRequestTicket == NO) {
|
||||
[self getDataInfo];
|
||||
}
|
||||
if (!self.userInfo) {
|
||||
[self showLoading];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)viewDidAppear:(BOOL)animated {
|
||||
@@ -629,40 +626,26 @@ UIKIT_EXTERN NSString *kRequestTicket;
|
||||
|
||||
- (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo {
|
||||
///防止重新注册时,获取到用户信息不全,调用接口时401
|
||||
if (!userInfo.isBindPhone && [ClientConfig shareConfig].iOSPhoneBind) {
|
||||
[self hideHUD];
|
||||
if (!userInfo.isBindPhone && [ClientConfig shareConfig].iOSPhoneBind) {
|
||||
return;
|
||||
}
|
||||
if (userInfo.nick == nil || userInfo.avatar == nil ) {
|
||||
[self hideHUD];
|
||||
return;
|
||||
}
|
||||
self.userInfo = userInfo;
|
||||
|
||||
[self checkHaveGiveDiamondsPermission];
|
||||
|
||||
self.userInfo = userInfo;
|
||||
@kWeakify(self);
|
||||
userInfo.idAtt = [self.headView createNamePlateIdLabelAttribute:userInfo];
|
||||
[self.tableView reloadData];
|
||||
[self.headView createNamePlateIdLabelAttribute:userInfo];
|
||||
self.headView.userInfo = userInfo;
|
||||
|
||||
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
||||
@kStrongify(self);
|
||||
// MARK: 获取配置列表前,需要先执行 checkHaveGiveDiamondsPermission 确认权限
|
||||
[self.presenter getPersonItemList];
|
||||
[self.presenter getClanDetailInfo];
|
||||
[self.presenter getUserWalletInfo];
|
||||
[self.presenter getPersonItemList];
|
||||
// [self.presenter getMineBannerList];
|
||||
[self.presenter getNobleInfo];
|
||||
});
|
||||
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.25 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[self.headView createNamePlateLevelAttribute:userInfo complete:^(NSMutableAttributedString *textAtt) {
|
||||
@kStrongify(self);
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
userInfo.levelAtt = textAtt;
|
||||
self.headView.userInfo = userInfo;
|
||||
});
|
||||
}];
|
||||
});
|
||||
}
|
||||
|
||||
- (void)getUserWalletInfo:(WalletInfoModel *)balanceInfo{
|
||||
|
@@ -11,6 +11,9 @@
|
||||
#import "XPHomeMineViewController.h"
|
||||
#import "XPRoomSearchContainerViewController.h"
|
||||
|
||||
#import "Api+Gift.h"
|
||||
#import "XPGiftStorage.h"
|
||||
|
||||
@interface XPHomePagingViewController () <UIPageViewControllerDelegate, UIPageViewControllerDataSource>
|
||||
|
||||
@property (nonatomic, strong) UIView *topControlView;
|
||||
@@ -36,6 +39,17 @@
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self setup];
|
||||
[self preLoadGifts];
|
||||
}
|
||||
|
||||
/// 禮物面板緩存-1: 登錄後,用空的 roomUid 預加載默認禮物,並緩存
|
||||
- (void)preLoadGifts {
|
||||
[Api requestAllTagsAndNormalGifts:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code == 200 && data.data) {
|
||||
[[XPGiftStorage shareStorage] cacheTagsWith:data.data
|
||||
inRoom:[[XPGiftStorage shareStorage] defaultKey]];
|
||||
}
|
||||
} roomUid:@""];
|
||||
}
|
||||
|
||||
- (void)setup {
|
||||
|
@@ -67,17 +67,7 @@
|
||||
[room sendCompleted];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[room sendError:nil];
|
||||
if (msg.length > 0) {
|
||||
TTAlertConfig *config = [[TTAlertConfig alloc]init];
|
||||
config.message = msg;
|
||||
config.actionStyle = TTAlertActionConfirmStyle;
|
||||
[TTPopup alertWithConfig:config showBorder:NO confirmHandler:^{
|
||||
|
||||
} cancelHandler:^{
|
||||
|
||||
}];
|
||||
}
|
||||
} showLoading:YES errorToast:NO] uid:roomUid intoUid:uid];
|
||||
} showLoading:YES errorToast:YES] uid:roomUid intoUid:uid];
|
||||
}
|
||||
|
||||
- (void)enterNIMRoom:(NSString *)roomId user:(UserInfoModel *)userInfo {
|
||||
@@ -189,27 +179,23 @@
|
||||
/// 获取普通的礼物
|
||||
/// @param roomUid 房主的uid 获取房间专属礼物
|
||||
- (void)getNormalGiftList:(NSString *)roomUid {
|
||||
// return;
|
||||
///先不请求接口 从缓存中获取
|
||||
CGFloat delayDuration = 0.0;
|
||||
NSArray *giftCacheArray = [[XPGiftStorage shareStorage] getGiftDatasource:roomUid];
|
||||
if (giftCacheArray.count > 0) {
|
||||
delayDuration = 0.25;
|
||||
}
|
||||
// CGFloat delayDuration = 0.0;
|
||||
// NSArray *giftCacheArray = [[XPGiftStorage shareStorage] getGiftPanelTagsDatasource:roomUid];
|
||||
// if (giftCacheArray.count > 0) {
|
||||
// delayDuration = 0.25;
|
||||
// }
|
||||
|
||||
// 进房时先 load 一次最新数据
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayDuration * NSEC_PER_SEC)), dispatch_get_global_queue(0, 0), ^{
|
||||
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayDuration * NSEC_PER_SEC)), dispatch_get_global_queue(0, 0), ^{
|
||||
[Api requestAllTagsAndNormalGifts:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code == 200 && data.data) {
|
||||
[[XPGiftStorage shareStorage] cacheWith:data.data inRoom:roomUid];
|
||||
// [[XPGiftStorage shareStorage] cacheWith:data.data inRoom:roomUid];
|
||||
[[XPGiftStorage shareStorage] cacheTagsWith:data.data inRoom:roomUid];
|
||||
}
|
||||
} roomUid:roomUid];
|
||||
// [Api requestNormalGiftList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
// if (data.data) {
|
||||
// [[XPGiftStorage shareStorage] cacheWith:data.data inRoom:roomUid];
|
||||
// }
|
||||
// }fail:^(NSInteger code, NSString * _Nullable msg) {}] roomUid:roomUid];
|
||||
});
|
||||
// });
|
||||
}
|
||||
|
||||
/// 上报用户进房
|
||||
|
@@ -409,7 +409,7 @@
|
||||
self.pkButton.hidden = YES;
|
||||
if ([AccountInfoStorage instance].getUid.integerValue == roomInfo.uid) {
|
||||
self.baiShunGameButton.hidden = NO;
|
||||
self.pkButton.hidden = roomInfo.type != RoomType_Anchor;
|
||||
self.pkButton.hidden = roomInfo.type == RoomType_Anchor;
|
||||
} else {
|
||||
for (GuildSuperAdminInfoModel *managerInfo in self.delegate.getRoomSuperAdminList) {
|
||||
if ([managerInfo.uid isEqualToString:[AccountInfoStorage instance].getUid]) {
|
||||
|
@@ -1100,7 +1100,6 @@
|
||||
giftInfo = [[XPGiftStorage shareStorage] findGiftInfo:info.giftId];
|
||||
}
|
||||
|
||||
|
||||
///官方新用户
|
||||
[attribute appendAttributedString:[self createOfficalAndNewuserAttribute:sendInfo.defUser newUser:sendInfo.newUser fromSayHelloChannel:sendInfo.fromSayHelloChannel]];
|
||||
//nick
|
||||
|
@@ -63,11 +63,20 @@
|
||||
}
|
||||
///开始匹配游戏
|
||||
-(void)startMatchGameWithroomId:(NSString *)roomId mgId:(NSString *)mgId gameMode:(NSString *)gameMode{
|
||||
@kWeakify(self);
|
||||
[Api startMatchGame:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
@kStrongify(self);
|
||||
[[self getView]startMatchGameSuccess];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
|
||||
} showLoading:YES errorToast:YES] roomId:roomId mgId:mgId gameMode:gameMode];
|
||||
if (code == 34792) { // 特殊操作,后续优化
|
||||
[TTPopup alertWithMessage:msg confirmHandler:^{
|
||||
@kStrongify(self);
|
||||
[[self getView] forceExitRoom];
|
||||
} cancelHandler:^{}];
|
||||
} else {
|
||||
[[self getView] showErrorToast:msg];
|
||||
}
|
||||
} showLoading:YES errorToast:NO] roomId:roomId mgId:mgId gameMode:gameMode];
|
||||
}
|
||||
///得到房间详情
|
||||
-(void)getRoomGameDetailWithRoomType:(NSString *)roomType{
|
||||
|
@@ -18,6 +18,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
-(void)getRoomGameConfigSuccessWithUser:(UserInfoModel *)user gameModel:(MSTabbarRoomGameModel *)gameModel;
|
||||
///开始游戏
|
||||
-(void)startMatchGameSuccess;
|
||||
///用户选择退出房间并重新排位
|
||||
-(void)forceExitRoom;
|
||||
///得到游戏详情
|
||||
-(void)getRoomGameDetailsSuccessWithModel:(MSRoomGameModel *)model;
|
||||
///得到金币数量
|
||||
|
@@ -11,6 +11,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MSTabbarRoomGameVC : MvpViewController
|
||||
|
||||
@property (nonatomic, copy) void(^needForceExitRoom)(void);
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -119,6 +119,17 @@
|
||||
|
||||
}
|
||||
|
||||
- (void)forceExitRoom {
|
||||
if (_needForceExitRoom) {
|
||||
_needForceExitRoom();
|
||||
@kWeakify(self);
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
@kStrongify(self);
|
||||
[self startMatchGameActionWithModel:self.chooseGameModel];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - MSRoomGameProtocol
|
||||
///得到金币数量
|
||||
|
@@ -274,8 +274,6 @@
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(getGameRsultsWithList:)]){
|
||||
[self.delegate getGameRsultsWithList:list];
|
||||
}
|
||||
|
||||
|
||||
}else if ([state isEqualToString:MG_COMMON_PUBLIC_MESSAGE]) {
|
||||
NSLog(@"ISudFSMMG:onGameStateChange:游戏->APP:公屏消息");
|
||||
} else if ([state isEqualToString:MG_COMMON_KEY_WORD_TO_HIT]) {
|
||||
|
@@ -17,10 +17,13 @@
|
||||
- (void)getRoomAlbumListWithroomUid:(NSString *)roomUid type:(NSString *_Nullable)type page:(NSString *)page pageSize:(NSString *)pageSize{
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
||||
@kWeakify(self);
|
||||
[Api getRoomAlbumList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
@kStrongify(self);
|
||||
NSArray *list = [PIRoomPhotoAlbumItemModel modelsWithArray:data.data];
|
||||
[[self getView]getRoomAlbumListSuccessWithList:list];
|
||||
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
[[self getView]getRoomAlbumListFailWithCode:code];
|
||||
} showLoading:NO errorToast:YES] roomUid:roomUid page:page pageSize:pageSize uid:uid ticket:ticket type:type] ;
|
||||
|
||||
@@ -34,23 +37,21 @@
|
||||
-(void)uploadRoomAlbumListWithGiftId:(NSString *_Nullable)giftId photoUrls:(NSArray *)photoUrls roomUid:(NSString *)roomUid type:(NSString *)type{
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
||||
NSString *photoUrl = @"";
|
||||
for (NSString *getUrl in photoUrls) {
|
||||
if(photoUrl.length > 0){
|
||||
photoUrl = [NSString stringWithFormat:@"%@,%@",photoUrl,getUrl];
|
||||
}else{
|
||||
photoUrl = getUrl;
|
||||
}
|
||||
}
|
||||
NSString *photoUrl = [photoUrls componentsJoinedByString:@","];
|
||||
@kWeakify(self);
|
||||
[Api uploadRoomAlbumList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
@kStrongify(self);
|
||||
[[self getView]uploadRoomAlbumListSuccess];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
[[self getView]uploadRoomAlbumListFail];
|
||||
} showLoading:NO errorToast:YES] photoUrls:photoUrl roomUid:roomUid uid:uid ticket:ticket type:type giftId:giftId];
|
||||
}
|
||||
///删除房间相册
|
||||
-(void)deleteRoomAlbumPhotoWithId:(NSString *)id{
|
||||
@kWeakify(self);
|
||||
[Api deleteRoomAlbumPhoto:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
@kStrongify(self);
|
||||
[[self getView]deleteRoomAlbumPhotoSuccessWithPhotoId:id];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
|
||||
@@ -60,9 +61,12 @@
|
||||
/// - Parameters:
|
||||
/// - photoId: 图片id
|
||||
-(void)sendRoomAlbumPhotoWithId:(NSString *)id roomUid:(NSString *)roomUid{
|
||||
@kWeakify(self);
|
||||
[Api sendRoomAlbumPhoto:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
@kStrongify(self);
|
||||
[[self getView]sendRoomAlbumPhotoSuccess];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
[[self getView]sendRoomAlbumPhotoFail];
|
||||
} showLoading:NO errorToast:YES] id:id roomUid:roomUid];
|
||||
}
|
||||
|
@@ -63,18 +63,18 @@
|
||||
self.page = 1;
|
||||
if(self.type == Photo_Album_Type_Mine){
|
||||
[self.presenter getRoomAlbumListWithroomUid:self.roomUid type:@"0" page:@(self.page).stringValue pageSize:@"20"];
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
[self.presenter getRoomAlbumListWithroomUid:self.roomUid type:self.type == Photo_Album_Type_Normal ? @"1":@"2" page:@(self.page).stringValue pageSize:@"20"];
|
||||
}
|
||||
}
|
||||
-(void)footerRefresh{
|
||||
self.page++;
|
||||
if(self.type == Photo_Album_Type_Mine){
|
||||
[self.presenter getRoomAlbumListWithroomUid:self.roomUid type:@"0" page:@(self.page).stringValue pageSize:@"20"];
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
[self.presenter getRoomAlbumListWithroomUid:self.roomUid type:self.type == Photo_Album_Type_Normal ? @"1":@"2" page:@(self.page).stringValue pageSize:@"20"];
|
||||
}
|
||||
}
|
||||
- (void)initHeaderAndFooterRrfresh {
|
||||
MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(headerRefresh)];
|
||||
header.stateLabel.font = [UIFont systemFontOfSize:10.0];
|
||||
@@ -202,7 +202,7 @@
|
||||
return cell;
|
||||
}
|
||||
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if(self.type == Photo_Album_Type_Mine)return;
|
||||
if (self.type != Photo_Album_Type_Mine) {
|
||||
PIRoomPhotoAlbumItemModel *albumModel = [self.photoList xpSafeObjectAtIndex:indexPath.row];
|
||||
if(albumModel.type.intValue == 2 && albumModel.status == 0)return;
|
||||
PIRoomPhotoAlbumItemCell *cell = (PIRoomPhotoAlbumItemCell *)[self.collectionView cellForItemAtIndexPath:indexPath];
|
||||
@@ -215,6 +215,7 @@
|
||||
browser.isMe = NO;
|
||||
[browser show];
|
||||
}
|
||||
}
|
||||
#pragma mark - JXCategoryListContentViewDelegate
|
||||
- (UIView *)listView {
|
||||
return self.view;
|
||||
@@ -264,22 +265,40 @@
|
||||
|
||||
self.imageCount = 0;
|
||||
[XNDJTDDLoadingTool showOnlyView:kWindow enabled:YES];
|
||||
@kWeakify(self);
|
||||
[self uploadAlbumPicList:self.datasource finish:^(NSArray *list) {
|
||||
@kStrongify(self);
|
||||
if(list.count == 0){
|
||||
[XNDJTDDLoadingTool hideOnlyView:kWindow];
|
||||
[self showErrorToast:YMLocalizedString(@"PIRoomPhotoAlbumItemVC1")];
|
||||
return;
|
||||
}
|
||||
if(giftModel == nil){
|
||||
[self.presenter uploadRoomAlbumListWithGiftId:nil photoUrls:list roomUid:self.roomUid type: @"1"];
|
||||
return;
|
||||
|
||||
NSMutableArray *photoUrls = @[].mutableCopy;
|
||||
for (NSDictionary *dic in list) {
|
||||
NSString *url = [dic objectForKey:@"resUrl"];
|
||||
if (url && url.length > 0) {
|
||||
[photoUrls addObject:dic[@"resUrl"]];
|
||||
}
|
||||
}
|
||||
|
||||
if(giftModel){
|
||||
[self.presenter uploadRoomAlbumListWithGiftId:@(giftModel.giftId).stringValue
|
||||
photoUrls:photoUrls
|
||||
roomUid:self.roomUid
|
||||
type:@"2"];
|
||||
} else {
|
||||
[self.presenter uploadRoomAlbumListWithGiftId:nil
|
||||
photoUrls:photoUrls
|
||||
roomUid:self.roomUid
|
||||
type: @"1"];
|
||||
}
|
||||
[self.presenter uploadRoomAlbumListWithGiftId:@(giftModel.giftId).stringValue photoUrls:list roomUid:self.roomUid type:@"2"];
|
||||
}];
|
||||
}
|
||||
///上传图片
|
||||
- (void)uploadAlbumPicList:(NSArray *)array finish:(void(^)(NSArray *list))finish {
|
||||
|
||||
@kWeakify(self);
|
||||
dispatch_semaphore_t semaphore = dispatch_semaphore_create(1);
|
||||
dispatch_queue_t queue = dispatch_get_global_queue(0, 0);
|
||||
NSMutableArray * dataArray = [NSMutableArray array];
|
||||
@@ -290,6 +309,7 @@
|
||||
NSString *format = [UIImage getImageTypeWithImageData:data];
|
||||
NSString *name = [NSString stringWithFormat:@"image/%@.%@",[NSString createUUID],format];
|
||||
[[UploadFile share]QCloudUploadImage:data named:name success:^(NSString * _Nonnull key, NSDictionary * _Nonnull resp) {
|
||||
@kStrongify(self);
|
||||
dispatch_semaphore_signal(semaphore);
|
||||
self.imageCount ++;
|
||||
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
|
||||
@@ -309,8 +329,8 @@
|
||||
finish(dataArray);
|
||||
});
|
||||
}
|
||||
|
||||
} failure:^(NSNumber * _Nonnull resCode, NSString * _Nonnull message) {
|
||||
@kStrongify(self);
|
||||
self.imageCount ++;
|
||||
dispatch_semaphore_signal(semaphore);
|
||||
}];
|
||||
@@ -350,7 +370,9 @@
|
||||
TTAlertConfig *config = [[TTAlertConfig alloc]init];
|
||||
config.title = YMLocalizedString(@"XPIAPRechargeViewController7");
|
||||
config.message = YMLocalizedString(@"PIRoomPhotoAlbumItemVC5");
|
||||
@kWeakify(self);
|
||||
[TTPopup alertWithConfig:config confirmHandler:^{
|
||||
@kStrongify(self);
|
||||
[XNDJTDDLoadingTool showOnlyView:kWindow enabled:YES];
|
||||
[self.presenter sendRoomAlbumPhotoWithId:albumModel.ID roomUid:self.roomUid];
|
||||
} cancelHandler:^{
|
||||
@@ -361,7 +383,9 @@
|
||||
TTAlertConfig *config = [[TTAlertConfig alloc]init];
|
||||
config.title = YMLocalizedString(@"XPIAPRechargeViewController7");
|
||||
config.message = YMLocalizedString(@"PIRoomPhotoAlbumItemVC4");
|
||||
@kWeakify(self);
|
||||
[TTPopup alertWithConfig:config confirmHandler:^{
|
||||
@kStrongify(self);
|
||||
[self.presenter deleteRoomAlbumPhotoWithId:albumModel.ID];
|
||||
} cancelHandler:^{
|
||||
|
||||
@@ -414,7 +438,6 @@
|
||||
_collectionView.backgroundColor = [DJDKMIMOMColor colorWithHexString:@"#F4F4FA"];
|
||||
[_collectionView registerClass:[PIRoomPhotoAlbumItemCell class] forCellWithReuseIdentifier:NSStringFromClass([PIRoomPhotoAlbumItemCell class])];
|
||||
[_collectionView registerClass:[XPGuildEmptyCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPGuildEmptyCollectionViewCell class])];
|
||||
|
||||
}
|
||||
return _collectionView;
|
||||
}
|
||||
|
@@ -49,7 +49,6 @@
|
||||
}
|
||||
|
||||
- (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index {
|
||||
|
||||
UIViewController<JXCategoryListContentViewDelegate> * list = (UIViewController<JXCategoryListContentViewDelegate> *)[self.contentView.validListDict objectForKey:[NSNumber numberWithInteger:index]];
|
||||
if (list) {
|
||||
return list;
|
||||
|
@@ -15,9 +15,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)getUserInfo:(NSString *)uid;
|
||||
/// 获取用户钱包信息
|
||||
- (void)getUserWallInfo;
|
||||
/// 获取普通的礼物
|
||||
/// @param roomUid 房主的uid 获取房间专属礼物
|
||||
//- (void)getNormalGiftList:(NSString *)roomUid;
|
||||
|
||||
/// 获取面板 Tags 和所有普通礼物,替代 getNormalGiftList:
|
||||
/// @param roomUid 房主的uid 获取房间专属礼物
|
||||
|
@@ -52,48 +52,21 @@
|
||||
}] uid:uid ticket:ticket];
|
||||
}
|
||||
|
||||
|
||||
/// 获取普通的礼物
|
||||
/// @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];
|
||||
}
|
||||
@kWeakify(self);
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayDuration * NSEC_PER_SEC)), dispatch_get_global_queue(0, 0), ^{
|
||||
[Api requestNormalGiftList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
@kStrongify(self);
|
||||
[[self getView] getNormalGiftListSuccess:[[XPGiftStorage shareStorage] cacheWith:data.data inRoom:roomUid]];
|
||||
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
[[self getView] getNormalGiftListFail:msg];
|
||||
}] roomUid:roomUid];
|
||||
});
|
||||
}
|
||||
|
||||
///有緩存會直接使用,面板不額外觸發數據更新
|
||||
- (void)getTagsAndGifts:(NSString *)roomUid {
|
||||
CGFloat delayDuration = 0.0;
|
||||
NSArray * array = [[XPGiftStorage shareStorage] getGiftPanelTagsDatasource:roomUid];
|
||||
if (array.count > 0) {
|
||||
delayDuration = 1;
|
||||
[[self getView] getTagsSuccess:array];
|
||||
}
|
||||
|
||||
} else {
|
||||
@kWeakify(self);
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayDuration * NSEC_PER_SEC)), dispatch_get_global_queue(0, 0), ^{
|
||||
[Api requestAllTagsAndNormalGifts:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
@kStrongify(self);
|
||||
[[XPGiftStorage shareStorage] cacheWith:data.data inRoom:roomUid];
|
||||
[[self getView] getTagsSuccess:[[XPGiftStorage shareStorage] cacheTagsWith:data.data inRoom:roomUid]];
|
||||
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
[[self getView] getNormalGiftListFail:msg];
|
||||
}] roomUid:roomUid];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -15,6 +15,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (instancetype)copy NS_UNAVAILABLE;
|
||||
- (instancetype)mutableCopy NS_UNAVAILABLE;
|
||||
|
||||
- (NSString *)defaultKey;
|
||||
|
||||
- (NSArray<GiftInfoModel *> *)getGiftDatasource:(NSString *)roomUid;
|
||||
- (NSArray<GiftPanelTabModel *> *)getGiftPanelTagsDatasource:(NSString *)roomUid;
|
||||
|
||||
@@ -29,10 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param giftId 礼物的id
|
||||
- (GiftInfoModel *)findGiftInfo:(NSString *)giftId;
|
||||
|
||||
///礼物数据写入本地
|
||||
- (void)writeGiftToDirectory:(NSArray *)array;
|
||||
|
||||
- (NSArray *)cacheWith:(NSDictionary *)response inRoom:(NSString *)roomUid;
|
||||
//- (NSArray *)cacheWith:(NSDictionary *)response inRoom:(NSString *)roomUid;
|
||||
- (NSArray *)cacheTagsWith:(NSDictionary *)response inRoom:(NSString *)roomUid;
|
||||
|
||||
@end
|
||||
|
@@ -10,15 +10,14 @@
|
||||
#import "NSObject+MJExtension.h"
|
||||
#import "NSArray+Safe.h"
|
||||
@interface XPGiftStorage ()
|
||||
///key:房间id value:房间对应的礼物列表
|
||||
///key: 房间id value:房间对应的所有礼物列表,default 表示無房間 id 的默認禮物列表
|
||||
@property (nonatomic, strong) NSCache<NSString *, NSArray<GiftInfoModel *> *> *roomGiftCache;
|
||||
|
||||
///包括面板 tab 和所有禮物的數據
|
||||
@property (nonatomic, strong) NSCache<NSString *, NSArray<GiftPanelTabModel *> *> *roomGiftPanelTagsCache;
|
||||
|
||||
///当前房间的uid
|
||||
@property (nonatomic,copy) NSString *currentRoomUid;
|
||||
///
|
||||
@property (nonatomic,assign) BOOL isWriteToFile;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPGiftStorage
|
||||
@@ -28,44 +27,56 @@
|
||||
static XPGiftStorage * storage;
|
||||
dispatch_once(&onceToken, ^{
|
||||
storage = [[XPGiftStorage alloc] init];
|
||||
// [storage loadCache];
|
||||
});
|
||||
return storage;
|
||||
}
|
||||
|
||||
- (void)loadCache {
|
||||
|
||||
- (NSString *)defaultKey {
|
||||
return @"default";
|
||||
}
|
||||
|
||||
///只保存所有禮物數據,
|
||||
- (void)saveGiftDatasource:(NSArray<GiftInfoModel *> *)giftArray roomUid:(NSString *)roomUid {
|
||||
if (giftArray.count > 0 && roomUid.length > 0) {
|
||||
[self.roomGiftCache setObject:giftArray forKey:roomUid];
|
||||
// 確保排序,後續使用二分法查找
|
||||
NSArray<GiftInfoModel *> *sortedGiftLists = [giftArray sortedArrayUsingComparator:^NSComparisonResult(GiftInfoModel *obj1, GiftInfoModel *obj2) {
|
||||
return [@(obj1.giftId) compare:@(obj2.giftId)];
|
||||
}];
|
||||
[self.roomGiftCache setObject:sortedGiftLists forKey:roomUid];
|
||||
}
|
||||
}
|
||||
|
||||
///保存 tabs 和所tab 下相關禮物數據
|
||||
- (void)saveGiftPanelTagsDatasource:(NSArray<GiftPanelTabModel *> *)tagsArray roomUid:(NSString *)roomUid {
|
||||
if (tagsArray.count > 0 && roomUid.length > 0) {
|
||||
[self.roomGiftPanelTagsCache setObject:tagsArray forKey:roomUid];
|
||||
}
|
||||
}
|
||||
|
||||
///獲取全部禮物數據
|
||||
- (NSArray<GiftInfoModel *> *)getGiftDatasource:(NSString *)roomUid {
|
||||
if (roomUid.length > 0) {
|
||||
self.currentRoomUid = roomUid;
|
||||
NSArray *giftLists = [self.roomGiftCache objectForKey:roomUid];
|
||||
if (giftLists.count >= 0) {
|
||||
return giftLists;
|
||||
} else {
|
||||
giftLists = [self.roomGiftCache objectForKey:[self defaultKey]];
|
||||
return giftLists;
|
||||
}
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
///獲取 tabs 和所tab 下相關禮物數據
|
||||
- (NSArray<GiftPanelTabModel *> *)getGiftPanelTagsDatasource:(NSString *)roomUid {
|
||||
if (roomUid.length > 0) {
|
||||
self.currentRoomUid = roomUid;
|
||||
NSArray *tagsList = [self.roomGiftPanelTagsCache objectForKey:roomUid];
|
||||
if (tagsList.count >= 0) {
|
||||
return tagsList;
|
||||
} else {
|
||||
return [self.roomGiftPanelTagsCache objectForKey:[self defaultKey]];
|
||||
}
|
||||
}
|
||||
return nil;
|
||||
@@ -74,23 +85,29 @@
|
||||
/// 获取当前房间的数据中的礼物
|
||||
/// @param giftId 礼物的id
|
||||
- (GiftInfoModel *)findGiftInfo:(NSString *)giftId {
|
||||
// MARK: 每次都会从接口请求,已有内存缓存,没有读磁盘的必要
|
||||
// GiftInfoModel * giftInfo = [self getGiftInfoFromDirectory:giftId];
|
||||
// if (giftInfo) {
|
||||
// return giftInfo;
|
||||
// }
|
||||
|
||||
NSInteger giftIdInt = giftId.integerValue;
|
||||
if (self.currentRoomUid) {
|
||||
NSArray<GiftInfoModel *> *giftLists = [self.roomGiftCache objectForKey:self.currentRoomUid];
|
||||
if (giftLists.count > 0) {
|
||||
__block GiftInfoModel * giftInfo;
|
||||
[giftLists enumerateObjectsUsingBlock:^(GiftInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if (obj.giftId == giftId.integerValue) {
|
||||
giftInfo = obj;
|
||||
*stop = YES;
|
||||
if (giftLists.count == 0) {
|
||||
giftLists = [self.roomGiftCache objectForKey:[self defaultKey]];
|
||||
}
|
||||
}];
|
||||
return giftInfo;
|
||||
if (giftLists.count > 0) {
|
||||
NSInteger left = 0;
|
||||
NSInteger right = giftLists.count - 1;
|
||||
|
||||
while (left <= right) {
|
||||
NSInteger mid = left + (right - left) / 2;
|
||||
GiftInfoModel *midObject = giftLists[mid];
|
||||
|
||||
if (midObject.giftId == giftIdInt) {
|
||||
return midObject;
|
||||
} else if (midObject.giftId < giftIdInt) {
|
||||
left = mid + 1;
|
||||
} else {
|
||||
right = mid - 1;
|
||||
}
|
||||
}
|
||||
return nil; // 如果没有找到匹配的对象,返回 nil
|
||||
}
|
||||
}
|
||||
return nil;
|
||||
@@ -101,7 +118,7 @@
|
||||
if (!_roomGiftCache) {
|
||||
_roomGiftCache = [[NSCache alloc] init];
|
||||
// 设置缓存数据的数目
|
||||
_roomGiftCache.countLimit = 20;
|
||||
_roomGiftCache.countLimit = 50;
|
||||
}
|
||||
return _roomGiftCache;
|
||||
}
|
||||
@@ -110,43 +127,12 @@
|
||||
if (!_roomGiftPanelTagsCache) {
|
||||
_roomGiftPanelTagsCache = [[NSCache alloc] init];
|
||||
// 设置缓存数据的数目
|
||||
_roomGiftPanelTagsCache.countLimit = 20;
|
||||
_roomGiftPanelTagsCache.countLimit = 50;
|
||||
}
|
||||
return _roomGiftPanelTagsCache;
|
||||
}
|
||||
|
||||
- (void)writeGiftToDirectory:(NSArray *)array {
|
||||
///因为不想每次都要大量的IO操作 就保存一份吧
|
||||
if (self.isWriteToFile) {
|
||||
return;
|
||||
}
|
||||
|
||||
self.isWriteToFile = YES;
|
||||
|
||||
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
||||
NSString * path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).firstObject;
|
||||
NSString * giftDirPath = [path stringByAppendingPathComponent:@"Gift"];
|
||||
//判断有没有文件夹
|
||||
BOOL isDir =NO;
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
BOOL existed = [fileManager fileExistsAtPath:giftDirPath isDirectory:&isDir];
|
||||
if ( !(isDir ==YES && existed == YES) ){
|
||||
//如果没有文件夹则创建
|
||||
[fileManager createDirectoryAtPath:giftDirPath withIntermediateDirectories:YES attributes:nil error:nil];
|
||||
}
|
||||
|
||||
NSOperationQueue *operationQueue = [[NSOperationQueue alloc] init];
|
||||
operationQueue.maxConcurrentOperationCount = 10;
|
||||
for (GiftInfoModel *giftInfoModel in array) {
|
||||
NSBlockOperation *operation = [NSBlockOperation blockOperationWithBlock:^{
|
||||
NSString *giftPath = [giftDirPath stringByAppendingPathComponent:[NSString stringWithFormat:@"%ld", (long)giftInfoModel.giftId]];
|
||||
[NSKeyedArchiver archiveRootObject:giftInfoModel.model2dictionary toFile:giftPath];
|
||||
}];
|
||||
[operationQueue addOperation:operation];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
///處理 API 數據,分別緩存所有禮物和 tab/tab禮物
|
||||
- (NSArray *)cacheTagsWith:(NSDictionary *)response inRoom:(NSString *)roomUid {
|
||||
NSArray *tabModels = [GiftPanelTabModel modelsWithArray:response[@"tabList"]];
|
||||
[self saveGiftPanelTagsDatasource:tabModels roomUid:roomUid];
|
||||
@@ -158,6 +144,7 @@
|
||||
|
||||
NSSortDescriptor *sortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"seq" ascending:YES];
|
||||
NSMutableArray <GiftPanelTabModel *>*mutableTabs = [tabModels sortedArrayUsingDescriptors:@[sortDescriptor]].mutableCopy;
|
||||
NSMutableArray *totalInfo = [NSMutableArray array];
|
||||
|
||||
for (GiftPanelTabModel *model in mutableTabs) {
|
||||
NSString *key = model.key;
|
||||
@@ -165,75 +152,15 @@
|
||||
if (giftsArray.count > 0) {
|
||||
NSArray *giftModels = [GiftInfoModel modelsWithArray:giftsArray];
|
||||
model.gifts = giftModels;
|
||||
[totalInfo addObjectsFromArray:giftModels];
|
||||
}
|
||||
}
|
||||
|
||||
[self saveGiftDatasource:totalInfo roomUid:roomUid];
|
||||
[self saveGiftPanelTagsDatasource:mutableTabs roomUid:roomUid];
|
||||
|
||||
return mutableTabs;
|
||||
}
|
||||
|
||||
- (NSArray *)cacheWith:(NSDictionary *)response inRoom:(NSString *)roomUid {
|
||||
NSDictionary *contents = response;
|
||||
if ([[response allKeys] containsObject:@"giftTabMap"]) {
|
||||
contents = [response objectForKey:@"giftTabMap"];
|
||||
}
|
||||
|
||||
NSMutableArray *totalInfo = [NSMutableArray array];
|
||||
|
||||
for (NSArray *value in contents.allValues) {
|
||||
NSArray *giftInfoModels = [GiftInfoModel modelsWithArray:value];
|
||||
[totalInfo addObjectsFromArray:giftInfoModels];
|
||||
}
|
||||
|
||||
[self saveGiftDatasource:totalInfo roomUid:roomUid];
|
||||
/*
|
||||
NSArray *luckyBagGift = [GiftInfoModel modelsWithArray:contents[@"luckyGift"]]; // 福袋礼物
|
||||
NSArray *vipGift = [GiftInfoModel modelsWithArray:contents[@"vipGift"]]; // VIP礼物
|
||||
NSArray *luckyPoolGift = [GiftInfoModel modelsWithArray:contents[@"luckyPoolGift"]];// 福袋奖池礼物
|
||||
NSArray *normalGift = [GiftInfoModel modelsWithArray:contents[@"normalGift"]]; // 普通面板礼物
|
||||
NSArray *weekStarGift = [GiftInfoModel modelsWithArray:contents[@"weekStarGift"]]; // 周星礼物
|
||||
NSArray *drawGift = [GiftInfoModel modelsWithArray:contents[@"drawGift"]]; // 涂鸦礼物
|
||||
NSArray *penaltyGift = [GiftInfoModel modelsWithArray:contents[@"penaltyGift"]]; // 惩罚礼物
|
||||
NSArray *anchorGift = [GiftInfoModel modelsWithArray:contents[@"singlePopularGift"]]; // 个播礼物
|
||||
|
||||
NSMutableArray *info = [NSMutableArray array];
|
||||
[info addObjectsFromArray:luckyBagGift];
|
||||
[info addObjectsFromArray:vipGift];
|
||||
[info addObjectsFromArray:normalGift];
|
||||
[info addObjectsFromArray:weekStarGift];
|
||||
[info addObjectsFromArray:drawGift];
|
||||
[info addObjectsFromArray:anchorGift];
|
||||
[info addObjectsFromArray:penaltyGift];
|
||||
|
||||
NSMutableArray *totalInfo = [NSMutableArray array];
|
||||
[totalInfo addObjectsFromArray:info];
|
||||
[totalInfo addObjectsFromArray:luckyPoolGift];
|
||||
|
||||
///把礼物信息保存一下
|
||||
[self saveGiftDatasource:totalInfo roomUid:roomUid];
|
||||
*/
|
||||
// MARK: 每次都会从接口请求,页游内存缓存,没有写磁盘的必要
|
||||
// [self writeGiftToDirectory:totalInfo];
|
||||
|
||||
return @[].copy;
|
||||
}
|
||||
|
||||
- (GiftInfoModel *)getGiftInfoFromDirectory:(NSString *)giftId {
|
||||
//找到相应的目录
|
||||
NSString *path = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject];
|
||||
NSString *pathFile = [path stringByAppendingPathComponent:@"Gift"];
|
||||
//判断有没有文件夹
|
||||
BOOL isDir =NO;
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
BOOL existed = [fileManager fileExistsAtPath:pathFile isDirectory:&isDir];
|
||||
GiftInfoModel * giftInfo;
|
||||
if (existed) {
|
||||
NSString *aPath = [pathFile stringByAppendingPathComponent:giftId];
|
||||
NSDictionary * dic = [NSKeyedUnarchiver unarchiveObjectWithFile:aPath];
|
||||
giftInfo = [GiftInfoModel modelWithDictionary:dic];
|
||||
}
|
||||
return giftInfo;
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -48,7 +48,6 @@
|
||||
[self.countLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.trailing.mas_equalTo(-20);
|
||||
make.centerY.mas_equalTo(0);
|
||||
|
||||
}];
|
||||
|
||||
[self.arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -71,7 +70,7 @@
|
||||
}];
|
||||
}else{
|
||||
[self.countLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.trailing.mas_equalTo(-20);
|
||||
make.trailing.mas_equalTo(self.arrowImageView.mas_leading).offset(-4);
|
||||
make.centerY.mas_equalTo(0);
|
||||
}];
|
||||
_countLabel.textAlignment = NSTextAlignmentRight;
|
||||
|
@@ -162,13 +162,7 @@
|
||||
|
||||
}
|
||||
-(XPGiftInfoView *)getListVC:(NSInteger)index{
|
||||
GiftPanelTabModel *targetTab = nil;// [self.tagsArray xpSafeObjectAtIndex:index];
|
||||
for (GiftPanelTabModel *tab in self.tagsArray) {
|
||||
if (tab.seq-1 == index) {
|
||||
targetTab = tab;
|
||||
break;
|
||||
}
|
||||
}
|
||||
GiftPanelTabModel *targetTab = [self.tagsArray xpSafeObjectAtIndex:index];
|
||||
switch ([targetTab tabGiftType]) {
|
||||
case GiftType_Game:{
|
||||
return self.normalVC;
|
||||
@@ -212,22 +206,20 @@
|
||||
-(NSInteger)getIndex{
|
||||
for (int i = 0; i< self.tagsArray.count; i++) {
|
||||
GiftPanelTabModel *tab = [self.tagsArray xpSafeObjectAtIndex:i];
|
||||
if ([tab tabGiftType] == GiftType_Game && self.segmentType == GiftSegmentType_Normal) {
|
||||
GiftType tabGiftType = [tab tabGiftType];
|
||||
if (tabGiftType == GiftType_Game && self.segmentType == GiftSegmentType_Normal) {
|
||||
return i;
|
||||
} else if ([tab tabGiftType] == GiftType_Lucky && self.segmentType == GiftSegmentType_Lucky) {
|
||||
} else if (tabGiftType == GiftType_Lucky && self.segmentType == GiftSegmentType_Lucky) {
|
||||
return i;
|
||||
} else if ([tab tabGiftType] == GiftType_super && self.segmentType == GiftSegmentType_SuperLucky) {
|
||||
} else if (tabGiftType == GiftType_super && self.segmentType == GiftSegmentType_SuperLucky) {
|
||||
return i;
|
||||
} else if ([tab tabGiftType] == GiftType_WeekStar && self.segmentType == GiftSegmentType_WeekStar) {
|
||||
} else if (tabGiftType == GiftType_WeekStar && self.segmentType == GiftSegmentType_WeekStar) {
|
||||
return i;
|
||||
} else if ([tab tabGiftType] == GiftType_Noble && self.segmentType == GiftSegmentType_Noble) {
|
||||
} else if (tabGiftType == GiftType_Noble && self.segmentType == GiftSegmentType_Noble) {
|
||||
return i;
|
||||
} else if ([tab tabGiftType] == GiftType_Country && self.segmentType == GiftSegmentType_Country) {
|
||||
} else if (tabGiftType == GiftType_Country && self.segmentType == GiftSegmentType_Country) {
|
||||
return i;
|
||||
} else if ([tab tabGiftType] == GiftSegmentType_Anchor && self.segmentType == GiftSegmentType_Anchor) {
|
||||
return i;
|
||||
}
|
||||
else if ([tab tabGiftType] == GiftSegmentType_Anchor && self.segmentType == GiftSegmentType_Anchor) {
|
||||
} else if (tabGiftType == GiftType_Anchor && self.segmentType == GiftSegmentType_Anchor) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
@@ -275,9 +267,9 @@
|
||||
- (void)setTagsArray:(NSArray<GiftPanelTabModel *> *)tagsArray {
|
||||
[self hideLoading];
|
||||
|
||||
_tagsArray = tagsArray;
|
||||
NSMutableArray *tempTitles = @[].mutableCopy;
|
||||
NSMutableArray *tempGifts = @[].mutableCopy;
|
||||
NSMutableArray *tempTags = @[].mutableCopy;
|
||||
for (GiftPanelTabModel *tab in tagsArray) {
|
||||
// 聊天界面不显示 幸运/个播 礼物
|
||||
if (self.usingPlaceType == SendGiftType_User &&
|
||||
@@ -307,6 +299,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
[tempTags addObject:tab];
|
||||
if (canAddGift) {
|
||||
[tempGifts addObject:tab.gifts ? tab.gifts : @[]];
|
||||
} else {
|
||||
@@ -324,6 +317,7 @@
|
||||
}
|
||||
}];
|
||||
|
||||
_tagsArray = tempTags.copy;
|
||||
self.pi_titles = tempTitles.copy;
|
||||
self.titleView.titles = self.pi_titles;
|
||||
|
||||
@@ -331,11 +325,11 @@
|
||||
|
||||
[self.titleView reloadData];
|
||||
|
||||
// @kWeakify(self);
|
||||
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
// @kStrongify(self);
|
||||
@kWeakify(self);
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
@kStrongify(self);
|
||||
[self.pi_containerView reloadData];
|
||||
// });
|
||||
});
|
||||
}
|
||||
|
||||
- (void)setNormalOriginArray:(NSArray *)normalOriginArray {
|
||||
|
@@ -198,9 +198,9 @@
|
||||
CGFloat height = CGRectGetMinY(keyboardRect) - KScreenHeight;
|
||||
if (height < 0) {
|
||||
[UIView animateWithDuration:0.25 animations:^{
|
||||
CGRect rect = self.customCountView.superview.superview.superview.frame;
|
||||
CGRect rect = self.customCountView.superview.superview.frame;
|
||||
rect.origin.y = height;
|
||||
self.customCountView.superview.superview.superview.frame = rect;
|
||||
self.customCountView.superview.superview.frame = rect;
|
||||
}];
|
||||
}
|
||||
}
|
||||
@@ -208,9 +208,9 @@
|
||||
//键盘隐藏
|
||||
- (void)keyboardWillHidden:(NSNotification *)notification {
|
||||
[UIView animateWithDuration:0.25 animations:^{
|
||||
CGRect rect = self.customCountView.superview.superview.superview.frame;
|
||||
CGRect rect = self.customCountView.superview.superview.frame;
|
||||
rect.origin.y = 0;
|
||||
self.customCountView.superview.superview.superview.frame = rect;
|
||||
self.customCountView.superview.superview.frame = rect;
|
||||
}];
|
||||
self.customCountView.hidden = YES;
|
||||
self.editTextFiled.text = @"";
|
||||
|
@@ -434,7 +434,6 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
[self.presenter sendGift:uidString giftNum:giftNumber sendType:sendType giftId:giftId giftSource:sourceType giftType:giftInfo.giftType roomSendType:roomSendType roomUid:self.roomUid msg:@""];
|
||||
} else {
|
||||
[self showErrorToast:YMLocalizedString(@"XPSendGiftView2")];
|
||||
return;
|
||||
}
|
||||
} else if(self.usingplaceType == SendGiftType_User) {
|
||||
///送礼物的人
|
||||
@@ -455,7 +454,6 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
self.giftBarView.sendButtonIsEnable = NO;
|
||||
[self.presenter sendGift:uidString giftNum:giftNumber sendType:sendType giftId:giftId giftSource:sourceType giftType:giftInfo.giftType roomSendType:roomSendType roomUid:self.roomUid msg:@""];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
///充值
|
||||
@@ -562,16 +560,6 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
|
||||
switch (type) {
|
||||
case GiftSegmentType_Lucky: {
|
||||
if (view.lastSelectGift.giftType == GiftType_super){
|
||||
if (!self.superGiftView.superview) {
|
||||
[self.view addSubview:self.superGiftView];
|
||||
[self.superGiftView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.contentView.mas_top);
|
||||
make.leading.trailing.mas_equalTo(0);
|
||||
make.height.mas_equalTo(kGetScaleWidth(90));
|
||||
}];
|
||||
}
|
||||
}else{
|
||||
if (!self.luckyBroadcastView.superview) {
|
||||
[self.view addSubview:self.luckyBroadcastView];
|
||||
[self.luckyBroadcastView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -581,6 +569,16 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
}];
|
||||
}
|
||||
}
|
||||
break;
|
||||
case GiftSegmentType_SuperLucky: {
|
||||
if (!self.superGiftView.superview) {
|
||||
[self.view addSubview:self.superGiftView];
|
||||
[self.superGiftView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.contentView.mas_top);
|
||||
make.leading.trailing.mas_equalTo(0);
|
||||
make.height.mas_equalTo(kGetScaleWidth(90));
|
||||
}];
|
||||
}
|
||||
}
|
||||
break;
|
||||
case GiftSegmentType_WeekStar: {
|
||||
@@ -611,20 +609,9 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
|
||||
///点击了某个item
|
||||
- (void)pIGiftInfoSegmentedView:(PIGiftInfoSegmentedView *)view didClickItem:(GiftInfoModel *)info type:(GiftSegmentType)type{
|
||||
if (type == GiftSegmentType_Lucky){
|
||||
switch (type) {
|
||||
case GiftSegmentType_Lucky:{
|
||||
[self.constellationBanner removeFromSuperview];
|
||||
if (info.giftType == GiftType_super){
|
||||
[self.luckyBroadcastView removeFromSuperview];
|
||||
if (!self.superGiftView.superview) {
|
||||
self.superGiftView.giftModel = info;
|
||||
[self.view addSubview:self.superGiftView];
|
||||
[self.superGiftView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.contentView.mas_top);
|
||||
make.leading.trailing.mas_equalTo(0);
|
||||
make.height.mas_equalTo(kGetScaleWidth(90));
|
||||
}];
|
||||
}
|
||||
}else{
|
||||
[self.superGiftView removeFromSuperview];
|
||||
if (!self.luckyBroadcastView.superview) {
|
||||
[self.view addSubview:self.luckyBroadcastView];
|
||||
@@ -635,8 +622,22 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
}else if (type == GiftSegmentType_Graffiti) {
|
||||
break;
|
||||
case GiftSegmentType_SuperLucky: {
|
||||
[self.constellationBanner removeFromSuperview];
|
||||
[self.luckyBroadcastView removeFromSuperview];
|
||||
if (!self.superGiftView.superview) {
|
||||
self.superGiftView.giftModel = info;
|
||||
[self.view addSubview:self.superGiftView];
|
||||
[self.superGiftView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.contentView.mas_top);
|
||||
make.leading.trailing.mas_equalTo(0);
|
||||
make.height.mas_equalTo(kGetScaleWidth(90));
|
||||
}];
|
||||
}
|
||||
}
|
||||
break;
|
||||
case GiftSegmentType_Graffiti: {
|
||||
self.giftInfoView.hidden = YES;
|
||||
self.graffitiView.hidden = NO;
|
||||
self.graffitiView.price = info.goldPrice;
|
||||
@@ -654,11 +655,13 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
self.giftInfoView.hidden = NO;
|
||||
}
|
||||
}];
|
||||
}else if(type == GiftSegmentType_WeekStar){
|
||||
self.constellationBanner.giftInfo = info;
|
||||
}
|
||||
else {
|
||||
case GiftSegmentType_WeekStar:
|
||||
self.constellationBanner.giftInfo = info;
|
||||
break;
|
||||
default:
|
||||
self.giftBarView.drawGiftCount = 10;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -340,8 +340,8 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
[[NIMSDK sharedSDK].broadcastManager addDelegate:self];
|
||||
}
|
||||
|
||||
/// 禮物面板緩存-2: 進房後,用當前的 roomUid 加載最新數據,並緩存
|
||||
- (void)preLoadGifts {
|
||||
/// 公屏 福袋礼物爆出的礼物 需要依赖 当前房间中的礼物列表 需要提前获取礼物列表 可以拿到礼物 没有想到别的方法去解决这个问题 有需要改的在修改吧
|
||||
[self.presenter getNormalGiftList:self.roomUid];
|
||||
|
||||
///获取免费礼物
|
||||
|
@@ -754,8 +754,20 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
// viewController = [[XPNewHomeViewController alloc] init];
|
||||
viewController = [[XPHomePagingViewController alloc] init];
|
||||
break;
|
||||
case 1:
|
||||
viewController = [[MSTabbarRoomGameVC alloc] init];
|
||||
case 1: {
|
||||
@kWeakify(self);
|
||||
MSTabbarRoomGameVC *vc = [[MSTabbarRoomGameVC alloc] init];
|
||||
vc.needForceExitRoom = ^{
|
||||
@kStrongify(self);
|
||||
if ([XPRoomMiniManager shareManager].getRoomInfo) {
|
||||
[[RtcManager instance] exitRoom];
|
||||
[[NIMSDK sharedSDK].chatroomManager exitChatroom:[NSString stringWithFormat:@"%ld", [XPRoomMiniManager shareManager].getRoomInfo.roomId]
|
||||
completion:nil];
|
||||
[self.roomMineView hiddenRoomMiniView];
|
||||
}
|
||||
};
|
||||
viewController = vc;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
viewController = [[XPMomentsViewController alloc] init];
|
||||
|
Reference in New Issue
Block a user