Compare commits

...

11 Commits

32 changed files with 409 additions and 378 deletions

View File

@@ -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 = "";

View File

@@ -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"

View File

@@ -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"];
}
///

View File

@@ -13,8 +13,11 @@ NS_ASSUME_NONNULL_BEGIN
@optional
///获取用户信息成功
- (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo;
- (void)onGetUserInfoFailure;
///获取用户详细信息成功
- (void)onGetDetailInfoSuccess:(UserInfoModel *)userInfo;
///关注/取消关注
- (void)attentionUserSuccess:(BOOL)status;
///获取关注状态

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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];

View File

@@ -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{

View File

@@ -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 {

View File

@@ -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];
});
// });
}
///

View File

@@ -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]) {

View File

@@ -1100,7 +1100,6 @@
giftInfo = [[XPGiftStorage shareStorage] findGiftInfo:info.giftId];
}
///
[attribute appendAttributedString:[self createOfficalAndNewuserAttribute:sendInfo.defUser newUser:sendInfo.newUser fromSayHelloChannel:sendInfo.fromSayHelloChannel]];
//nick

View File

@@ -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{

View File

@@ -18,6 +18,8 @@ NS_ASSUME_NONNULL_BEGIN
-(void)getRoomGameConfigSuccessWithUser:(UserInfoModel *)user gameModel:(MSTabbarRoomGameModel *)gameModel;
///开始游戏
-(void)startMatchGameSuccess;
///用户选择退出房间并重新排位
-(void)forceExitRoom;
///得到游戏详情
-(void)getRoomGameDetailsSuccessWithModel:(MSRoomGameModel *)model;
///得到金币数量

View File

@@ -11,6 +11,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface MSTabbarRoomGameVC : MvpViewController
@property (nonatomic, copy) void(^needForceExitRoom)(void);
@end
NS_ASSUME_NONNULL_END

View File

@@ -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
///

View File

@@ -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]) {

View File

@@ -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];
}

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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 获取房间专属礼物

View File

@@ -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];
});
}
}

View File

@@ -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

View File

@@ -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

View File

@@ -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;

View File

@@ -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 {

View File

@@ -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 = @"";

View File

@@ -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;
}
}

View File

@@ -340,8 +340,8 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[[NIMSDK sharedSDK].broadcastManager addDelegate:self];
}
/// -2: roomUid
- (void)preLoadGifts {
///
[self.presenter getNormalGiftList:self.roomUid];
///

View File

@@ -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];