1.0.19 feat:基本完成所有需求 & bug fix

This commit is contained in:
eggmanQQQ
2024-11-11 19:35:21 +08:00
parent efefa94d3c
commit 00014f0327
63 changed files with 1239 additions and 367 deletions

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "切图 23@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 892 B

View File

@@ -31,6 +31,11 @@
@property (nonatomic, strong) NetImageView *tabbarBGImageLoader;
@property (nonatomic, strong) NetImageView *navigationAreaBGImageLoader;
@property (nonatomic, strong) NSMutableArray *downloadedTabNormalImages;
@property (nonatomic, strong) NSMutableArray *downloadedTabSelectedImage;
@property (nonatomic, assign) BOOL isLoading;
@end
@implementation ClientConfig
@@ -43,6 +48,9 @@
config.isTF = [ClientConfig isTestFlight];
config.reloadNavigationAreaImageKey = @"今天光线很好";
config.reloadViewBackgroundColorKey = @"年轻人买不起美国买房平均年龄飙升至56岁";
config.downloadedTabNormalImages = @[].mutableCopy;
config.downloadedTabSelectedImage = @[].mutableCopy;
});
return config;
}
@@ -130,6 +138,10 @@
}
- (void)loadTabImages {
if (self.isLoading) {
return;
}
self.isLoading = YES;
[self loadNormalTabImage:0];
[self loadSelectedTabImage:0];
}
@@ -214,17 +226,16 @@
}
- (void)loadNormalTabImage:(NSInteger)index {
NSLog(@" ------------------ 666 ---------------, %ld, %s", (long)index, __FUNCTION__);
if (index >= self.normalTabImageSource.count) {
return;
}
if (!self.updateNormalTabImage) {
self.isLoading = NO;
return;
}
NSString *normalURLString = self.normalTabImageSource[index];
if ([NSString isEmpty:normalURLString]) {
self.updateNormalTabImage([UIImage imageNamed:[self _tabNormalImage:index]], index);
if ([NSString isEmpty:normalURLString] && self.updateNormalTabImage) {
UIImage *image = [UIImage imageNamed:[self _tabNormalImage:index]];
self.updateNormalTabImage([image resizeTo:CGSizeMake(40, 40)], index);
[self loadNormalTabImage:index + 1];
return;
}
@@ -236,16 +247,23 @@
@kWeakify(self);
[self.normalTabImageLoader loadImageWithUrl:normalURLString
completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
normalImage = image;
NSLog(@" ------------------ 777 ---------------, %ld", (long)index);
normalImage = [image resizeTo:CGSizeMake(40, 40)];
@kStrongify(self);
[self.downloadedTabNormalImages addObject:normalImage];
if (normalImage && self.updateNormalTabImage) {
self.updateNormalTabImage([normalImage resizeTo:CGSizeMake(25, 25)],
self.updateNormalTabImage(normalImage,
index);
}
[self loadNormalTabImage:index + 1];
}
fail:^(NSError * _Nonnull error) {
NSLog(@" ------------------ 999 ---------------, %ld", (long)index);
@kStrongify(self);
if (self.updateNormalTabImage) {
UIImage *image = [UIImage imageNamed:[self _tabNormalImage:index]];
self.updateNormalTabImage([image resizeTo:CGSizeMake(40, 40)], index);
}
[self loadNormalTabImage:index + 1];
}];
}
@@ -260,8 +278,9 @@
}
NSString *selectedURLString = self.selectedTabImageSource[index];
if ([NSString isEmpty:selectedURLString]) {
self.updateSelectedTabImage([UIImage imageNamed:[self _tabSelectedImage:index]], index);
if ([NSString isEmpty:selectedURLString] && self.updateSelectedTabImage) {
UIImage *image = [UIImage imageNamed:[self _tabSelectedImage:index]];
self.updateSelectedTabImage([image resizeTo:CGSizeMake(40, 40)], index);
[self loadSelectedTabImage:index + 1];
return;
}
@@ -276,15 +295,20 @@
[self.selectedTabImageLoader loadImageWithUrl:selectedURLString
completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
@kStrongify(self);
selectedImage = image;
selectedImage = [image resizeTo:CGSizeMake(40, 40)];
[self.downloadedTabSelectedImage addObject:selectedImage];
if (selectedImage && self.updateSelectedTabImage) {
self.updateSelectedTabImage([selectedImage resizeTo:CGSizeMake(25, 25)],
self.updateSelectedTabImage(selectedImage,
index);
}
[self loadSelectedTabImage:index + 1];
}
fail:^(NSError * _Nonnull error) {
@kStrongify(self);
if (self.updateSelectedTabImage) {
UIImage *image = [UIImage imageNamed:[self _tabSelectedImage:index]];
self.updateSelectedTabImage([image resizeTo:CGSizeMake(40, 40)], index);
}
[self loadSelectedTabImage:index + 1];
}];
}
@@ -312,7 +336,7 @@
}
- (UIColor *)bgColor {
if (self.uiSetting) {
if (self.uiSetting && ![NSString isEmpty:self.uiSetting.backgroundColor]) {
return [DJDKMIMOMColor colorWithHexString:self.uiSetting.backgroundColor];
}
@@ -352,11 +376,11 @@
}
- (UIImage *)tabNormalImageImage:(NSInteger)tabIndex {
return nil;
return [self.downloadedTabNormalImages xpSafeObjectAtIndex:tabIndex];
}
- (UIImage *)tabSelectedImageImage:(NSInteger)tabIndex {
return nil;
return [self.downloadedTabSelectedImage xpSafeObjectAtIndex:tabIndex];
}
@end

View File

@@ -53,14 +53,28 @@ static CGFloat kAlertButtonCornerRadius = 8.f;
_cancelButtonConfig.backgroundImage = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor cancelButtonGradientStartColor], [DJDKMIMOMColor cancelButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)];
_cancelButtonConfig.cornerRadius = kAlertButtonCornerRadius;//
// confirm button
_confirmButtonConfig = [[TTAlertButtonConfig alloc] init];
_confirmButtonConfig.title = YMLocalizedString(@"TTAlertConfig0");
_confirmButtonConfig.font = [UIFont systemFontOfSize:kAlertButtonFont];
_confirmButtonConfig.titleColor = [DJDKMIMOMColor confirmButtonTextColor];
_confirmButtonConfig.backgroundImage = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor], [DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)];
_confirmButtonConfig.backgroundImage = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xE29030), UIColorFromRGB(0xFCC074)]
gradientType:GradientTypeLeftToRight
imgSize:CGSizeMake(10, 10)];
_confirmButtonConfig.cornerRadius = kAlertButtonCornerRadius;
// //
// CAGradientLayer *gradientLayer = [CAGradientLayer layer];
// gradientLayer.colors = @[(__bridge id)UIColorFromRGB(0xE29030).CGColor,
// (__bridge id)UIColorFromRGB(0xFCC074).CGColor];
// gradientLayer.startPoint = CGPointMake(0.0, 0.0); //
// gradientLayer.endPoint = CGPointMake(0.0, 1.0); //
// gradientLayer.frame = CGRectMake(0, 0, 120, 38); //
//
// //
// [_previewActionButton.layer insertSublayer:gradientLayer atIndex:0];
_cornerRadius = kAlertCornerRadius;//
_shouldDismissOnBackgroundTouch = YES;//

View File

@@ -83,7 +83,7 @@ static CGFloat const kMaxHeight = 450.f;
showBorder:(BOOL)isShowBorder
confirmHandler:(TTPopupCompletionHandler)confirmHandler
cancelHandler:(TTPopupCompletionHandler)cancelHandler {
[self alertWithMessage:nil
[self alertWithMessage:@""
config:config
showBorder:isShowBorder
cancelHandler:cancelHandler

View File

@@ -13,6 +13,8 @@ NS_ASSUME_NONNULL_BEGIN
+ (void)getChatLimit:(HttpRequestHelperCompletion)completion receiverUid:(NSString *)receiverUid;
+ (void)checkLimit:(HttpRequestHelperCompletion)completion receiverUid:(NSString *)receiverUid;
@end
NS_ASSUME_NONNULL_END

View File

@@ -9,9 +9,13 @@
#import <Base64/MF_Base64Additions.h>
@implementation Api (Message)
+ (void)getChatLimit:(HttpRequestHelperCompletion)complection receiverUid:(NSString *)receiverUid {
+ (void)getChatLimit:(HttpRequestHelperCompletion)completion receiverUid:(NSString *)receiverUid {
NSString * fang = [NSString stringFromBase64String:@"cHJpdmF0ZUNoYXQvbGltaXQ="];///privateChat/limit
[self makeRequest:fang method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, receiverUid,nil];
[self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, receiverUid,nil];
}
+ (void)checkLimit:(HttpRequestHelperCompletion)completion receiverUid:(NSString *)receiverUid {
[self makeRequest:@"privateChat/limitV2" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, receiverUid,nil];
}

View File

@@ -79,6 +79,20 @@
#import "MessageProtocol.h"
#import "Api+Message.h"
#import "MessageGameOrderModel.h"
#import "VIPCenterViewController.h"
@interface CheckLimitModel :PIBaseModel
@property (nonatomic, assign) BOOL chat;
@property (nonatomic, copy) NSString *message;
@property (nonatomic, assign) NSInteger wealthLevel;
@property (nonatomic, assign) NSInteger charmLevel;
@property (nonatomic, strong) NSNumber *nextVipLevel;
@property (nonatomic, strong) NSNumber *nextUserCountLimit;
@end
@implementation CheckLimitModel
@end
@interface SessionViewController ()<MessageProtocol, UITableViewDelegate, UITableViewDataSource, NIMChatManagerDelegate, NIMConversationManagerDelegate, NIMMediaManagerDelegate, MessageCellDelegate, TZImagePickerControllerDelegate, SessionNavViewDelegate, SessionRiskViewDelegate,QInputBarViewDelegate, QInputBarViewDataSource,InputBoardDataSource ,InputBoardDelegate , QEmotionBoardViewDelegate, QinputPhotoViewDelegate, SessionUserInfoTableViewCellDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate>
@@ -763,6 +777,38 @@
[self.sessionTableView reloadData];
}
}
- (void)displayLimitMessage:(CheckLimitModel *)model {
TTAlertConfig * config = [[TTAlertConfig alloc] init];
config.title = YMLocalizedString(@"1.0.18_26");
BOOL confirmToBuyVIP = NO;
if (!model.nextVipLevel && !model.nextUserCountLimit) {
//
config.message = YMLocalizedString(@"1.0.18_29");
} else if (model.nextVipLevel && !model.nextUserCountLimit) {
// VIP VIP
confirmToBuyVIP = YES;
config.message = [NSString stringWithFormat:YMLocalizedString(@"1.0.18_27"), model.nextVipLevel];
config.confirmButtonConfig.title = [NSString stringWithFormat:YMLocalizedString(@"1.0.18_30"), model.nextVipLevel];
} else {
// VIP VIP,
confirmToBuyVIP = YES;
config.message = [NSString stringWithFormat:YMLocalizedString(@"1.0.18_28"), model.nextVipLevel, model.nextUserCountLimit];
config.confirmButtonConfig.title = [NSString stringWithFormat:YMLocalizedString(@"1.0.18_30"), model.nextVipLevel];
}
[TTPopup alertWithConfig:config confirmHandler:^{
if (confirmToBuyVIP) {
VIPCenterViewController *nobleCenter = [VIPCenterViewController new];
[nobleCenter jumpToTargetVIP:model.nextVipLevel.integerValue];
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:nobleCenter animated:YES];
}
} cancelHandler:^{
}];
}
#pragma mark - NIMConversationManagerDelegate
- (void)messagesDeletedInSession:(NIMSession *)session {
[self.messages removeAllObjects];
@@ -770,35 +816,88 @@
}
- (void)didFailRetry:(NIMMessage *)message {
@kWeakify(self);
[Api checkLimit:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
@kStrongify(self);
if(code == 200){
CheckLimitModel *model = [CheckLimitModel modelWithJSON:data.data];
if (model.chat) {
if (message.isReceivedMsg) {
[[NIMSDK sharedSDK].chatManager fetchMessageAttachment:message error:nil];
} else {
[[NIMSDK sharedSDK].chatManager resendMessage:message error:nil];
}
} else {
[self displayLimitMessage:model];
}
} else {
[self showErrorToast:msg];
}
} receiverUid:self.session.sessionId];
}
- (void)sendTextMessage:(NSString *)text {
@kWeakify(self);
[Api checkLimit:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
@kStrongify(self);
if(code == 200){
CheckLimitModel *model = [CheckLimitModel modelWithJSON:data.data];
if (model.chat) {
NIMMessage *message = [NIMMessageMaker msgWithText:text];
message.apnsPayload = @{@"uid": [AccountInfoStorage instance].getUid}; // ID
[[[NIMSDK sharedSDK] chatManager] sendMessage:message toSession:self.session error:nil];
} else {
[self displayLimitMessage:model];
}
} else {
[self showErrorToast:msg];
}
} receiverUid:self.session.sessionId];
}
- (void)audioRecordCompletion:(NSString *)recordPath {
@kWeakify(self);
[Api checkLimit:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
@kStrongify(self);
if(code == 200){
CheckLimitModel *model = [CheckLimitModel modelWithJSON:data.data];
if (model.chat) {
NIMMessage *message = [NIMMessageMaker msgWithAudio:recordPath];
message.apnsPayload = @{@"uid": [AccountInfoStorage instance].getUid}; // ID
[[[NIMSDK sharedSDK] chatManager] sendMessage:message toSession:self.session error:nil];
} else {
[self displayLimitMessage:model];
}
} else {
[self showErrorToast:msg];
}
} receiverUid:self.session.sessionId];
}
#pragma mark - TZImagePickerControllerDelegate
- (void)imagePickerController:(TZImagePickerController *)picker didFinishPickingPhotos:(NSArray<UIImage *> *)photos sourceAssets:(NSArray *)assets isSelectOriginalPhoto:(BOOL)isSelectOriginalPhoto infos:(NSArray<NSDictionary *> *)infos {
[photos enumerateObjectsUsingBlock:^(UIImage * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
if (obj) {
@kWeakify(self);
[Api checkLimit:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
@kStrongify(self);
if(code == 200){
CheckLimitModel *model = [CheckLimitModel modelWithJSON:data.data];
if (model.chat) {
//
NIMMessage * message = [NIMMessageMaker msgWithImage:obj];
message.apnsPayload = @{@"uid": [AccountInfoStorage instance].getUid}; // ID
//
[[NIMSDK sharedSDK].chatManager sendMessage:message toSession:self.session error:nil];
} else {
[self displayLimitMessage:model];
}
} else {
[self showErrorToast:msg];
}
} receiverUid:self.session.sessionId];
}
}];
}
@@ -1064,9 +1163,22 @@
}
//
NIMMessage * message = [NIMMessageMaker msgWithImage:image];
@kWeakify(self);
[Api checkLimit:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
@kStrongify(self);
if(code == 200){
CheckLimitModel *model = [CheckLimitModel modelWithJSON:data.data];
if (model.chat) {
message.apnsPayload = @{@"uid": [AccountInfoStorage instance].getUid}; // ID
[[NIMSDK sharedSDK].chatManager sendMessage:message toSession:self.session error:nil];
[view resetChoosePhotos];
} else {
[self displayLimitMessage:model];
}
} else {
[self showErrorToast:msg];
}
} receiverUid:self.session.sessionId];
}
}
@@ -1089,18 +1201,31 @@
if (picker.sourceType == UIImagePickerControllerSourceTypeCamera) {
UIImageWriteToSavedPhotosAlbum(selectedPhoto, nil, nil, nil);
}
@kWeakify(self);
[Api checkLimit:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
@kStrongify(self);
if(code == 200){
CheckLimitModel *model = [CheckLimitModel modelWithJSON:data.data];
if (model.chat) {
//
NIMMessage * message = [NIMMessageMaker msgWithImage:selectedPhoto];
message.apnsPayload = @{@"uid": [AccountInfoStorage instance].getUid}; // ID
//
[[NIMSDK sharedSDK].chatManager sendMessage:message toSession:self.session error:nil];
} else {
[self displayLimitMessage:model];
}
} else {
[self showErrorToast:msg];
}
} receiverUid:self.session.sessionId];
}
[picker dismissViewControllerAnimated:YES completion:^{}];
}
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker{
[picker dismissViewControllerAnimated:YES completion:^{
}];
[picker dismissViewControllerAnimated:YES
completion:^{}];
}

View File

@@ -211,7 +211,7 @@
if (!_vapView) {
_vapView = [[VAPView alloc] init];
[_vapView setMute:YES];
_vapView.contentMode = UIViewContentModeScaleAspectFill;
_vapView.contentMode = UIViewContentModeScaleAspectFit;
}
return _vapView;
}

View File

@@ -10,18 +10,34 @@
NS_ASSUME_NONNULL_BEGIN
@interface NameplateModel : PIBaseModel
///是否正在使用
/////是否正在使用
@property (nonatomic, assign) BOOL isUsing;
///id
/////id
@property (nonatomic, copy) NSString * nId;
///名字
@property (nonatomic, strong) NSString *nameplateName;
///铭牌的图片
@property (nonatomic, strong) NSString *nameplateImage;
///是否过期
/////名字
//@property (nonatomic, strong) NSString *nameplateName;
/////铭牌的图片
//@property (nonatomic, strong) NSString *nameplateImage;
/////是否过期
@property (nonatomic, assign) BOOL isExpired;
///过期的天数
@property (nonatomic,copy) NSString *expireDays;
/////过期的天数
//@property (nonatomic,copy) NSString *expireDays;
@property (nonatomic, assign) NSTimeInterval expireTime;
@property (nonatomic, assign) NSInteger uid;
@property (nonatomic, assign) NSInteger nameplateId;
@property (nonatomic, copy) NSString *nameplateImage;
@property (nonatomic, assign) NSInteger nameplateType;
@property (nonatomic, assign) NSTimeInterval createTime;
@property (nonatomic, assign) BOOL isCustomWord;
@property (nonatomic, copy) NSString *remark;
@property (nonatomic, copy) NSString *iconPic;
@property (nonatomic, assign) NSInteger expireDays;
@property (nonatomic, assign) NSTimeInterval updateTime;
@property (nonatomic, copy) NSString *nameplateName;
@property (nonatomic, copy) NSString *fixedWord;
@property (nonatomic, copy) NSString *word;
@end
NS_ASSUME_NONNULL_END

View File

@@ -90,7 +90,7 @@
self.titleLabel.text = _nameplateModel.nameplateName;
self.useButton.hidden = _nameplateModel.isExpired;
if (!_nameplateModel.isExpired) {
self.timeLabel.text = [NSString stringWithFormat:YMLocalizedString(@"XPMineNameplateTableViewCell0"), _nameplateModel.expireDays];
self.timeLabel.text = [NSString stringWithFormat:YMLocalizedString(@"XPMineNameplateTableViewCell0"), @(_nameplateModel.expireDays)];
} else {
self.timeLabel.text = YMLocalizedString(@"XPMineNameplateTableViewCell1");
}

View File

@@ -29,11 +29,11 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,copy) NSString *userUid;
///用户信息
@property (nonatomic, strong) UserInfoModel *userInfo;
@property (nonatomic, strong) NSArray<MomentsInfoModel *>*dynamicInfo;
@property (nonatomic, copy) NSArray<MomentsInfoModel *>*dynamicInfo;
@property (nonatomic, strong) MedalModel *medalInfo;
@property (nonatomic, strong) GuildInfo *guildInfo;
@property (nonatomic, strong) NSArray<UserGiftWallInfoModel *> *giftWall;
@property (nonatomic, strong) NSArray<UserGiftWallInfoModel *> *luckyGiftWall;
@property (nonatomic, copy) NSArray<UserGiftWallInfoModel *> *giftWall;
@property (nonatomic, copy) NSArray<UserGiftWallInfoModel *> *luckyGiftWall;
///代理
@property (nonatomic,weak) id<XPMineUserDataViewControllerDelegate> delegate;

View File

@@ -345,10 +345,10 @@ HWDMP4PlayDelegate>
self.headView.userInfo = userInfo;
self.userDataVC.userInfo = userInfo;
self.headerHeight = [XPMineUserInfoHeaderView headerHeight:userInfo];
[self.pagingView reloadData];
self.pagingView.hidden = NO;
// self.headerHeight = [XPMineUserInfoHeaderView headerHeight:userInfo];
//
// [self.pagingView reloadData];
// self.pagingView.hidden = NO;
// 使
[self.presenter getUserDetailInfoWithUid:@(self.uid).stringValue];
@@ -364,12 +364,22 @@ HWDMP4PlayDelegate>
self.userDataVC.dynamicInfo = userInfo.dynamicInfo;
self.userDataVC.medalInfo = userInfo.medals;
self.userDataVC.guildInfo = userInfo.guildInfo;
self.userMomentVC.dynamicInfo = userInfo.dynamicInfo;
self.headView.roomUid = userInfo.roomUid;
self.headView.relationUser = userInfo.relationUserVO;
self.headView.nameplateList = userInfo.userNameplateList;
self.giftVC.userInfo = userInfo;
self.userInfo.relationUserVO = userInfo.relationUserVO;
self.headerHeight = [XPMineUserInfoHeaderView headerHeight:userInfo];
[self.pagingView reloadData];
self.pagingView.hidden = NO;
if(isMSRTL()){
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.titleView selectItemAtIndex:0];

View File

@@ -64,7 +64,7 @@ NS_ASSUME_NONNULL_BEGIN
/// @param open 是否打开
+ (void)changePreventKickCompletion:(HttpRequestHelperCompletion)completion open:(NSString *)open;
+ (void)changePrivateChatLimitCompletion:(HttpRequestHelperCompletion)completion open:(NSString *)open;
@end
NS_ASSUME_NONNULL_END

View File

@@ -86,8 +86,12 @@
[self makeRequest:@"vip/changePreventTrace" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__,open, nil];
}
+ (void)changePreventKickCompletion:(HttpRequestHelperCompletion)completion open:(NSString *)open; {
+ (void)changePreventKickCompletion:(HttpRequestHelperCompletion)completion open:(NSString *)open {
[self makeRequest:@"vip/changePreventKick" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__,open, nil];
}
+ (void)changePrivateChatLimitCompletion:(HttpRequestHelperCompletion)completion open:(NSString *)open {
[self makeRequest:@"vip/changePrivateChatLimit" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__,open, nil];
}
@end

View File

@@ -50,6 +50,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)changePreventFollow:(BOOL)preventFollow; // 关注
- (void)changePreventTrace:(BOOL)preventTrace; // 跟随
- (void)changePreventKick:(BOOL)preventKick;
- (void)changePrivateChatLimit:(BOOL)chatLimit;
@end
NS_ASSUME_NONNULL_END

View File

@@ -180,6 +180,16 @@
} showLoading:YES errorToast:NO]];
}
- (void)changePrivateChatLimit:(BOOL)chatLimit {
@kWeakify(self);
[Api changePrivateChatLimitCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
@kStrongify(self);
[[self getView] changePrivateChatLimitSuccess:chatLimit];
} fail:^(NSInteger code, NSString * _Nullable msg) {
@kStrongify(self);
[[self getView] changePrivateChatLimitFail];
} showLoading:YES errorToast:YES] open:[NSString stringWithFormat:@"%d", chatLimit]];
}
@end

View File

@@ -48,6 +48,10 @@
- (void)changePreventKickSuccess:(BOOL)switchStatus;
///VIP 防被踢开关修改失败
- (void)changePreventKickFail;
///VIP 請勿打擾开关修改成功
- (void)changePrivateChatLimitSuccess:(BOOL)switchStatus;
///VIP 請勿打擾开关修改失败
- (void)changePrivateChatLimitFail;
///钻石开通会员成功
-(void)openVipWithDiamondSuccess;
///钻石开通会员失败

View File

@@ -11,6 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface VIPCenterViewController : MvpViewController
- (instancetype)initWithRoomUid:(NSInteger)roomUid;
- (void)jumpToTargetVIP:(NSInteger)vipLevel;
@end
NS_ASSUME_NONNULL_END

View File

@@ -472,17 +472,24 @@ UICollectionViewDataSource>
@property (nonatomic, copy) NSString *exclusivePrivilegesSubTitle;
@property (nonatomic, assign) NSInteger targetVIPLevel;
@end
@implementation VIPCenterViewController
- (instancetype)initWithRoomUid:(NSInteger)roomUid {
if (self = [super init]) {
self.targetVIPLevel = -1;
self.roomUid = roomUid;
}
return self;
}
- (void)jumpToTargetVIP:(NSInteger)vipLevel {
self.targetVIPLevel = vipLevel;
}
- (BOOL)isHiddenNavBar {
return YES;
}
@@ -624,10 +631,15 @@ UICollectionViewDataSource>
- (void)configVIPCards {
[self.vipCardCyclePager reloadData];
if (self.targetVIPLevel >=0 && self.targetVIPLevel <= 9) {
[self.vipCardCyclePager scrollToItemAtIndex:self.targetVIPLevel-1 animate:NO];
self.targetVIPLevel = -1;
} else {
if (self.userVIPInfo) {
[self.vipCardCyclePager scrollToItemAtIndex:self.userVIPInfo.vipLevel-1 animate:NO];
}
}
}
- (void)configIdentificationCards {
NSInteger currentVIPLevel = self.currentVIPInfo.vipLevel;

View File

@@ -8,7 +8,7 @@
#import <UIKit/UIKit.h>
#import "XPSoundCardModel.h"
#import "XPMineUserInfoTagModel.h"
@class RelationUserVO;
@class RelationUserVO, NameplateModel;
NS_ASSUME_NONNULL_BEGIN
@class UserInfoModel, SDCycleScrollView,XPMineUserInfoHeaderView;
@protocol XPMineUserInfoHeaderViewDelegate <NSObject>
@@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
///播放声音,播放或关闭
- (void)xPMineUserInfoHeaderView:(XPMineUserInfoHeaderView *)view didClickPlaySound:(BOOL)isPlay;
///去录音VC
- (void)didClickGoToPlaySound;
//- (void)didClickGoToPlaySound;
///去标签页
- (void)xPMineUserInfoHeaderView:(XPMineUserInfoHeaderView *)view didClickGotoEditView:(NSMutableArray *)itemList;
///去标签vc
@@ -36,6 +36,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, strong) RelationUserVO *relationUser;
@property (nonatomic, copy) NSArray <NameplateModel *> *nameplateList;
+ (CGFloat)headerHeight:(UserInfoModel *)model;
@end

View File

@@ -31,21 +31,67 @@
///Model
#import "UserInfoModel.h"
@interface NameplateCell : UICollectionViewCell
#define StackSpring(axis) \
^{\
UIView *view = UIView.new; \
[view mas_makeConstraints:^(MASConstraintMaker *make) {\
if (axis == UILayoutConstraintAxisHorizontal) {\
make.width.mas_equalTo(1000).priorityLow();\
} else {\
make.height.mas_equalTo(1000).priorityLow();\
}\
}];\
return view;\
}()
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) NetImageView *imageView;
@interface XPMineUserInfoHeaderView ()<SDCycleScrollViewDelegate, SDPhotoBrowserDelegate,XPMineUserInfoHeaderTagViewDelegate>
- (void)updateCell:(NameplateModel *)model;
@end
@implementation NameplateCell
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self.contentView addSubview:self.imageView];
[self.contentView addSubview:self.titleLabel];
[self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.contentView);
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.mas_equalTo(self.contentView);
}];
}
return self;
}
- (void)updateCell:(NameplateModel *)model {
self.titleLabel.hidden = !model.isCustomWord;
self.titleLabel.text = model.word;
self.imageView.imageUrl = model.nameplateImage;
}
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [UILabel labelInitWithText:@"" font:kFontRegular(10) textColor:[UIColor whiteColor]];
_titleLabel.textAlignment = NSTextAlignmentCenter;
}
return _titleLabel;
}
- (NetImageView *)imageView {
if (!_imageView) {
NetImageConfig * config = [[NetImageConfig alloc] init];
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
config.imageType = ImageTypeUserCardLevel;
_imageView = [[NetImageView alloc] initWithConfig:config];
_imageView.userInteractionEnabled = YES;
_imageView.contentMode = UIViewContentModeScaleAspectFit;
}
return _imageView;
}
@end
@interface XPMineUserInfoHeaderView ()<
SDCycleScrollViewDelegate,
SDPhotoBrowserDelegate,
XPMineUserInfoHeaderTagViewDelegate,
UICollectionViewDataSource,
UICollectionViewDelegateFlowLayout>
///
@property (nonatomic,strong) SDCycleScrollView *pi_cycleScrollView;
@@ -100,12 +146,8 @@ return view;\
@property (nonatomic,strong) NetImageView *experImageView;
///
@property (nonatomic,strong) NetImageView *rechargeImageView;
///
@property (nonatomic,strong) UIView * namePlateView;
///
@property (nonatomic,strong) NetImageView *nameplateImageView;
///
@property (nonatomic,strong) UILabel *nameplateLabel;
@property (nonatomic,strong) NetImageView *vipPlateImageView;
///
@property (nonatomic,strong) UIImageView *newUserImageView;
///
@@ -124,6 +166,8 @@ return view;\
@property (nonatomic, strong) CPCard *cpCard;
@property (nonatomic, strong) UIButton *cpListButton;
@property (nonatomic, strong) UICollectionView *nameplateCollectionView;
@end
@implementation XPMineUserInfoHeaderView
@@ -160,11 +204,41 @@ return view;\
numberOfLines = ceil(textRect.size.height / lineHeight);
}
height = kGetScaleWidth(540) + lineHeight * numberOfLines;
height = 190 + 260 + [self namePlateHeight:model.userNameplateList] + 170;
return height;
}
+ (CGFloat)namePlateHeight:(NSArray *)list {
CGFloat namePlateHeight = 0;
if (list.count > 0) {
// cell
CGFloat cellWidth = 70;
CGFloat cellHeight = 20;
// collectionView
CGFloat sidePadding = kGetScaleWidth(15) * 2; // 15
CGFloat itemSpacing = 4; // cell
CGFloat lineSpacing = 2; //
CGFloat collectionViewWidth = KScreenWidth - sidePadding;
// = collectionView -
CGFloat availableWidth = collectionViewWidth - sidePadding;
// cell
NSInteger itemsPerRow = floor((availableWidth) / (cellWidth + itemSpacing));
//
NSInteger rows = (list.count + itemsPerRow - 1) / itemsPerRow;
// = cell +
namePlateHeight = rows * cellHeight + (rows - 1) * lineSpacing;
}
return namePlateHeight;
}
#pragma mark - Private Method
- (void)setupUI {
self.backgroundColor = [UIColor clearColor];
@@ -191,6 +265,8 @@ return view;\
[self setupIDArea];
[self setupNameplateArea];
[self setupLocateArea];
[self setupCustomDesc];
@@ -337,7 +413,7 @@ return view;\
[stack addArrangedSubview:self.copyIdImageView];
[stack addArrangedSubview:self.experImageView];
[stack addArrangedSubview:self.charmImageView];
[stack addArrangedSubview:self.namePlateView];
[stack addArrangedSubview:self.vipPlateImageView];
[self.beautIDView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(24);
@@ -360,22 +436,19 @@ return view;\
make.size.mas_equalTo(CGSizeMake(36, 18));
}];
[self.namePlateView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(0);
make.height.mas_equalTo(18);
[self.vipPlateImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(24);
make.width.mas_equalTo(60);
}];
}
///
[self.namePlateView addSubview:self.nameplateImageView];
[self.namePlateView addSubview:self.nameplateLabel];
[self.nameplateImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(20);
make.top.mas_equalTo(0);
make.width.mas_equalTo(self.namePlateView);
}];
[self.nameplateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.bottom.mas_equalTo(self.nameplateImageView);
make.trailing.mas_equalTo(self.namePlateView).offset(-2);
- (void)setupNameplateArea {
[self.userInfoView addSubview:self.nameplateCollectionView];
[self.nameplateCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.nickStackView.mas_bottom).offset(30);
make.leading.mas_equalTo(self.userInfoView).offset(kGetScaleWidth(15));
make.trailing.mas_equalTo(self.userInfoView).offset(kGetScaleWidth(-15));
make.height.mas_equalTo(0);
}];
}
@@ -384,7 +457,7 @@ return view;\
[self.locateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(self.userInfoView).offset(kGetScaleWidth(15));
make.height.mas_equalTo(18);
make.top.mas_equalTo(self.nickStackView.mas_bottom).offset(30);
make.top.mas_equalTo(self.nameplateCollectionView.mas_bottom).offset(6);
}];
}
@@ -479,6 +552,18 @@ return view;\
}];
}
#pragma mark - UICollectionView Delegate & DataSource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.nameplateList.count;
}
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView
cellForItemAtIndexPath:(NSIndexPath *)indexPath {
NameplateCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"NameplateCell" forIndexPath:indexPath];
[cell updateCell:[self.nameplateList xpSafeObjectAtIndex:indexPath.row]];
return cell;
}
#pragma mark - SDPhotoBrowserDelegate
- (NSURL *)photoBrowser:(SDPhotoBrowser *)browser highQualityImageURLForIndex:(NSInteger)index {
if(browser.isAvatar == YES){
@@ -594,21 +679,11 @@ return view;\
}] ;
}
self.charmImageView.hidden = userInfo.userLevelVo.charmUrl.length <= 0;
if(userInfo.isCustomWord == YES){
if (userInfo.nameplatePic.length > 0) {
[self loadNamePlate:userInfo.nameplatePic];
self.namePlateView.hidden = NO;
if (userInfo.userVipInfoVO.nameplateUrl.length > 0) {
[self loadNamePlate:userInfo.userVipInfoVO.nameplateUrl];
self.vipPlateImageView.hidden = NO;
} else {
self.namePlateView.hidden = YES;
}
}else{
if (userInfo.nameplateWord.length > 0 && userInfo.nameplatePic.length > 0) {
[self loadNamePlate:userInfo.nameplatePic];
self.nameplateLabel.text = userInfo.nameplateWord;
self.namePlateView.hidden = NO;
} else {
self.namePlateView.hidden = YES;
}
self.vipPlateImageView.hidden = YES;
}
self.rechargeImageView.hidden = !_userInfo.isRechargeUser;
@@ -653,13 +728,13 @@ return view;\
}
- (void)loadNamePlate:(NSString *)imagePath {
[self.nameplateImageView loadImageWithUrl:imagePath completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
[self.vipPlateImageView loadImageWithUrl:imagePath completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
if (image) {
CGSize size = image.size;
[self.namePlateView mas_updateConstraints:^(MASConstraintMaker *make) {
[self.vipPlateImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(round(size.width * 18/size.height));
}];
self.nameplateImageView.image = image;
self.vipPlateImageView.image = image;
}
}];
}
@@ -700,8 +775,14 @@ return view;\
NSString *imagePath = [NSString stringWithFormat:@"cp_avatar_flag_lv_%ld", relationUser.cpLevel];
self.cpAvatarFlag.image = kImage(imagePath);
}
- (void)setNameplateList:(NSArray<NameplateModel *> *)nameplateList {
_nameplateList = nameplateList;
[self.nameplateCollectionView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo([XPMineUserInfoHeaderView namePlateHeight:nameplateList]);
}];
[self.nameplateCollectionView reloadData];
}
- (void)updateNameAndGenderInfo {
@@ -877,6 +958,9 @@ return view;\
_idLabel.textAlignment = NSTextAlignmentCenter;
_idLabel.userInteractionEnabled = YES;
_idLabel.clipsToBounds = NO;
_idLabel.userInteractionEnabled = YES;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(copyNameAction)];
[_idLabel addGestureRecognizer:tap];
}
return _idLabel;
}
@@ -1015,35 +1099,16 @@ return view;\
return _charmImageView;
}
- (UIView *)namePlateView {
if (!_namePlateView) {
_namePlateView = [[UIView alloc] init];
_namePlateView.backgroundColor = [UIColor clearColor];
_namePlateView.hidden = YES;
}
return _namePlateView;
}
- (NetImageView *)nameplateImageView {
if (!_nameplateImageView) {
- (NetImageView *)vipPlateImageView {
if (!_vipPlateImageView) {
NetImageConfig * config = [[NetImageConfig alloc] init];
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
config.imageType = ImageTypeUserCardLevel;
_nameplateImageView = [[NetImageView alloc] initWithConfig:config];
_nameplateImageView.userInteractionEnabled = YES;
_nameplateImageView.contentMode = UIViewContentModeScaleAspectFit;
_vipPlateImageView = [[NetImageView alloc] initWithConfig:config];
_vipPlateImageView.userInteractionEnabled = YES;
_vipPlateImageView.contentMode = UIViewContentModeScaleAspectFit;
}
return _nameplateImageView;
}
- (UILabel *)nameplateLabel {
if (!_nameplateLabel) {
_nameplateLabel = [[UILabel alloc] init];
_nameplateLabel.font = [UIFont systemFontOfSize:10];
_nameplateLabel.textAlignment = NSTextAlignmentCenter;
_nameplateLabel.textColor = [UIColor whiteColor];
}
return _nameplateLabel;
return _vipPlateImageView;
}
- (UIImageView *)newUserImageView {
@@ -1245,4 +1310,22 @@ return view;\
return _cpAvatarFlag;
}
- (UICollectionView *)nameplateCollectionView {
if (!_nameplateCollectionView) {
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.itemSize = CGSizeMake(72, 20);
layout.minimumLineSpacing = 2;
layout.minimumInteritemSpacing = 2;
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
_nameplateCollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
_nameplateCollectionView.backgroundColor = [UIColor clearColor];
_nameplateCollectionView.scrollEnabled = NO;
_nameplateCollectionView.delegate = self;
_nameplateCollectionView.dataSource = self;
_nameplateCollectionView.scrollEnabled = YES;
[_nameplateCollectionView registerClass:[NameplateCell class] forCellWithReuseIdentifier:@"NameplateCell"];
}
return _nameplateCollectionView;
}
@end

View File

@@ -231,10 +231,14 @@
[self.presenter changePreventTrace:switchStatus];
break;
case 2:
///
[self.presenter changePrivateChatLimit:switchStatus];
break;
case 3:
///
[self.presenter changeEnterHide:switchStatus];
break;
case 3:
case 4:
///
[self.presenter changePreventKick:switchStatus];
break;
@@ -289,11 +293,22 @@
[self switchUpdateEnd];
}
- (void)changePrivateChatLimitSuccess:(BOOL)switchStatus {
[self.userInfo.userVipInfoVO setPrivateChatLimit:switchStatus];
[self switchUpdateEnd];
}
- (void)changePrivateChatLimitFail {
[self switchUpdateEnd];
}
- (void)switchUpdateEnd {
[self.tableView reloadData];
self.tableView.userInteractionEnabled = YES;
}
#pragma mark -
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
return 20;
@@ -310,7 +325,7 @@
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 4;
return 5;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
@@ -329,12 +344,18 @@
cell.minLevel = 6;
break;
case 2:
//
cell.title = YMLocalizedString(@"1.0.18_25");
cell.switchStatus = self.userInfo.userVipInfoVO.privateChatLimit;
cell.minLevel = 7;
break;
case 3:
//
cell.title = YMLocalizedString(@"VipSettin_1.0.17_4");
cell.switchStatus = self.userInfo.userVipInfoVO.enterHide;
cell.minLevel = 7;
break;
case 3:
case 4:
//
cell.title = YMLocalizedString(@"VipSettin_1.0.17_5");
cell.switchStatus = self.userInfo.userVipInfoVO.preventKick;

View File

@@ -148,6 +148,10 @@ NS_ASSUME_NONNULL_BEGIN
/// 获取首页聚合排行榜
+(void)getHomeRanksCompletion:(HttpRequestHelperCompletion)completion;
+(void)getHomeSecondBannerCompletion:(HttpRequestHelperCompletion)completion
uid:(NSString *)uid
type:(NSString *)type;
@end
NS_ASSUME_NONNULL_END

View File

@@ -195,4 +195,8 @@
[self makeRequest:@"home/getRankSlideshow" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil];
}
+(void)getHomeSecondBannerCompletion:(HttpRequestHelperCompletion)completion uid:(NSString *)uid type:(NSString *)type {
[self makeRequest:@"home/second/banner" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, type, nil];
}
@end

View File

@@ -10,10 +10,14 @@
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSUInteger, HomeBannerInfoSkipType) {
/// APP 內功能跳轉
HomeBannerInfoSkipType_APP = 1,
/// 跳转房间
HomeBannerInfoSkipType_Room = 2,
/// 跳转h5
HomeBannerInfoSkipType_Web = 3,
/// 無跳轉
HomeBannerInfoSkipType_None = 100,
};
@interface HomeBannerInfoModel : PIBaseModel

View File

@@ -54,6 +54,7 @@
- (void)getHomeAllTopsData {
RACSubject *banner = [RACSubject subject];
RACSubject *banner_2 = [RACSubject subject];
RACSubject *menu = [RACSubject subject];
RACSubject *rank = [RACSubject subject];
@@ -61,6 +62,10 @@
return [RACSignal return:nil];
}];
RACSignal *bannerSignal_2 = [banner_2 catch:^RACSignal *(NSError *error) {
return [RACSignal return:nil];
}];
RACSignal *menuSignal = [menu catch:^RACSignal *(NSError *error) {
return [RACSignal return:nil];
}];
@@ -71,13 +76,15 @@
RACSignal *combinedSignal = [RACSignal combineLatest:@[bannerSignal, menuSignal, rankSignal]
reduce:^id(NSArray* bannerList, NSArray* menuList, NSArray *rankAvatars) {
return @[bannerList ?: [NSArray array],
menuList ?: [NSArray array],
rankAvatars ?: [NSArray array]];
return @[bannerList ?: @[],
menuList ?: @[],
rankAvatars ?: @[]];
}];
@kWeakify(self);
[[combinedSignal deliverOn:RACScheduler.mainThreadScheduler]
subscribeNext:^(NSArray *combinedValues) {
@kStrongify(self);
[[self getView] getHomeTopDataSuccess:[combinedValues xpSafeObjectAtIndex:0]
banners:[combinedValues xpSafeObjectAtIndex:1]
rankAvatars:[combinedValues xpSafeObjectAtIndex:2]];
@@ -112,6 +119,15 @@
[rank sendError:nil];
[rank sendCompleted];
}]];
// [Api getHomeSecondBannerCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
// NSArray * array = [HomeBannerInfoModel modelsWithArray:data.data];
// [banner_2 sendNext:array];
// [banner_2 sendCompleted];
// }fail:^(NSInteger code, NSString * _Nullable msg) {
// [banner_2 sendError:nil];
// [banner_2 sendCompleted];
// } errorToast:NO] uid:uid type:@"1"];
}
///

View File

@@ -21,21 +21,17 @@
/// @param page
- (void)getRecommendRoomList:(NSString *)tabId page:(NSInteger)page {
// NSString * uid = [AccountInfoStorage instance].getUid;
// NSString * pageStr = [NSString stringWithFormat:@"%d", page];
// NSString * pageSizeStr = [NSString stringWithFormat:@"%d", pageSize];
// [Api getNewRecommendListComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
// NSArray * array = [HomePlayRoomModel modelsWithArray:data.data];
// [[self getView] getHomeRecommendRoomListSuccess:array ];
// }fail:^(NSInteger code, NSString * _Nullable msg) {
// [[self getView] getHomeRecommendRoomListFail:msg ];
// }] uid:uid tabId:tabId pageNum:pageStr pageSize:pageSizeStr];
@kWeakify(self);
[Api getHomeTabRoomsCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
@kStrongify(self);
NSArray * array = [HomePlayRoomModel modelsWithArray:data.data];
[[self getView] getHomeRecommendRoomListSuccess:array];
if (page == 1
//&& [tabId isEqualToString: @"21"]
) {
[self loadSecondBanner];
}
}fail:^(NSInteger code, NSString * _Nullable msg) {
@kStrongify(self);
[[self getView] getHomeRecommendRoomListFail:msg ];
@@ -43,6 +39,19 @@
pageNum:[NSString stringWithFormat:@"%ld", page]
pageSize:@"50"
tabId:tabId];
}
- (void)loadSecondBanner {
@kWeakify(self);
[Api getHomeSecondBannerCompletion:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
@kStrongify(self);
if (code == 200) {
NSArray * array = [HomeBannerInfoModel modelsWithArray:data.data];
[[self getView] getHomeSecondBannerSuccess:array];
}
} uid:[AccountInfoStorage instance].getUid type:@"1"];
}
///

View File

@@ -29,6 +29,7 @@ NS_ASSUME_NONNULL_BEGIN
banners:(NSArray *)banners
rankAvatars:(NSArray *)rankAvatars;
- (void)getHomeRanksSuccess:(NSArray *)resourceList;
@end
NS_ASSUME_NONNULL_END

View File

@@ -13,6 +13,8 @@ NS_ASSUME_NONNULL_BEGIN
@optional
///首页推荐房间的
- (void)getHomeRecommendRoomListSuccess:(NSArray *)list;
- (void)getHomeSecondBannerSuccess:(NSArray *)banners;
///首页推荐房间失败
- (void)getHomeRecommendRoomListFail:(NSString *)message;
///请求更多个播房成功

View File

@@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface XPHomePartyViewController : MvpViewController<JXPagerViewListViewDelegate>
@property (nonatomic, copy) void(^scrollCallback)(UIScrollView *scrollView);
@property (nonatomic, copy) void(^didTapBannerItem)(HomeBannerInfoModel *itemModel);
@property (nonatomic, copy) void(^loadBannerInfo)(void);
//@property (nonatomic, copy) void(^loadBannerInfo)(void);
@property(nonatomic,strong) PIHomeCategoryTitleModel *tagModel;

View File

@@ -69,8 +69,11 @@
_bannerView.backgroundColor = [UIColor clearColor];
_bannerView.layer.cornerRadius = 12;
_bannerView.layer.masksToBounds = YES;
_bannerView.showPageControl = NO;
_bannerView.showPageControl = YES;
_bannerView.autoScrollTimeInterval = 5.0;
_bannerView.pageControlDotSize = CGSizeMake(3, 3);
_bannerView.pageDotColor = [UIColor lightGrayColor];
_bannerView.currentPageDotColor = [UIColor darkGrayColor];
_bannerView.bannerImageViewContentMode = UIViewContentModeScaleAspectFill;
if (isMSRTL()) {
for (UIView *subView in _bannerView.subviews) {
@@ -89,7 +92,6 @@
}
}
@end
@@ -245,23 +247,20 @@
}
- (void)sortDataSource {
if (!self.bannerInfoList || self.bannerInfoList.count == 0) {
return;
}
NSMutableArray *mutableArrayA = [self.datasource mutableCopy];
NSInteger insertIndex = 5;
// a 5 b
if (self.bannerInfoList.count > 0) {
if (mutableArrayA.count < insertIndex) {
[mutableArrayA addObject:self.bannerInfoList];
} else {
while (insertIndex < mutableArrayA.count) {
[mutableArrayA insertObject:self.bannerInfoList atIndex:insertIndex];
insertIndex += 6; // 5 arrayB 1
}
}
self.displayDatasource = mutableArrayA.mutableCopy;
[self.collectionView reloadData];
}
- (void)getHomeRecommendRoomListSuccess:(NSArray *)list{
@@ -272,19 +271,19 @@
if(self.page == 1){
self.datasource = [NSMutableArray arrayWithArray:list];
[self sortDataSource];
}else{
[self.datasource addObjectsFromArray:list];
}
if (!self.bannerInfoList) {
self.loadBannerInfo();
}
[self sortDataSource];
[self.collectionView reloadData];
[[NSNotificationCenter defaultCenter]postNotificationName:@"khomeVCRefreshComplete" object:nil];
}
- (void)getHomeSecondBannerSuccess:(NSArray *)banners {
self.bannerInfoList = banners;
[self sortDataSource];
}
- (void)getHomeRecommendRoomListFail:(NSString *)message{
[self.collectionView.mj_footer endRefreshing];
[[NSNotificationCenter defaultCenter]postNotificationName:@"khomeVCRefreshComplete" object:nil];

View File

@@ -75,6 +75,7 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
@property(nonatomic,strong) NSMutableDictionary *validListDict;
@property (nonatomic, copy) NSArray<HomeBannerInfoModel *> *bannerInfoList;
@property (nonatomic, copy) NSArray<HomeBannerInfoModel *> *secondBannerInfoList;
@end
@@ -204,12 +205,6 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
@kStrongify(self);
[self handleTapBannerItem:itemModel];
}];
@kWeakify(homeVC);
[homeVC setLoadBannerInfo:^{
@kStrongify(self);
@kStrongify(homeVC);
homeVC.bannerInfoList = self.bannerInfoList;
}];
}
-(void)openRoomNotification:(NSNotification *)notification{
@@ -338,12 +333,6 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
@kStrongify(self);
[self handleTapBannerItem:itemModel];
}];
@kWeakify(homeVC);
[homeVC setLoadBannerInfo:^{
@kStrongify(self);
@kStrongify(homeVC);
homeVC.bannerInfoList = self.bannerInfoList;
}];
[self.validListDict setObject:homeVC forKey:@(index)];
return homeVC;
}
@@ -495,20 +484,20 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
#pragma mark -
- (void)handleTapBannerItem:(HomeBannerInfoModel *)model {
switch (model.skipType) {
case HomeBannerInfoSkipType_Room:
{
case HomeBannerInfoSkipType_Room:{
if (model.skipUri.length > 0) {
[XPRoomViewController openRoom:model.skipUri viewController:self];
}
}
break;
case HomeBannerInfoSkipType_Web:
{
case HomeBannerInfoSkipType_Web:{
XPWebViewController *vc = [[XPWebViewController alloc] initWithRoomUID:nil];
vc.url = model.skipUri;
[self.navigationController pushViewController:vc animated:YES];
}
break;
case HomeBannerInfoSkipType_APP:
case HomeBannerInfoSkipType_None:
default:
break;
}

View File

@@ -33,7 +33,8 @@ typedef enum : NSUInteger {
@property (nonatomic, copy) NSString *url;
/// 0=免费1=付费2=自定义
@property (nonatomic, assign) RoomBGType type;
@property (nonatomic, assign) RoomBGStatus status; // -1=过期0=审核中1=通过2=不过审
/// -1=过期0=审核中1=通过2=不过审
@property (nonatomic, assign) RoomBGStatus status;
- (NSString *)remainDays;
- (NSString *)pricePerDays;

View File

@@ -87,7 +87,7 @@
extModel.experLevelSeq = userInfo.userLevelVo.experLevelSeq;
extModel.experUrl = userInfo.userLevelVo.experUrl;
extModel.newUser = userInfo.newUser;
extModel.vipIcon = userInfo.userVipInfoVO.vipIcon;
extModel.vipIcon = userInfo.userVipInfoVO.nameplateUrl;
extModel.fromUid = userInfo.fromUid;
extModel.fromType = userInfo.fromType;
extModel.fromNick = userInfo.fromNick;

View File

@@ -177,7 +177,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
[self.pkMenuButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(0);
make.size.mas_equalTo(itemSize);
make.size.mas_equalTo(itemSize_game_rocket);
}];
[self.gambleMenuButton mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -192,7 +192,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
[self.configEntranceMenuButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(0);
make.size.mas_equalTo(itemSize);
make.size.mas_equalTo(itemSize_game_rocket);
}];
[self.joinDatingView mas_makeConstraints:^(MASConstraintMaker *make) {

View File

@@ -7,13 +7,13 @@
#import <UIKit/UIKit.h>
@class AttachmentModel;
NS_ASSUME_NONNULL_BEGIN
@interface RoomHighValueGiftBannerAnimation : UIView
+ (void)display:(UIView *)superView
with:(id)attachment
tapToRoom:(BOOL)handleTapToRoom
with:(AttachmentModel *)attachment
complete:(void(^)(void))complete;
@end

View File

@@ -7,6 +7,13 @@
#import "RoomHighValueGiftBannerAnimation.h"
#import "SVGA.h"
#import "AttachmentModel.h"
#import "GiftReceiveInfoModel.h"
#import "XCCurrentVCStackManager.h"
#import "XPRoomViewController.h"
#import "RoomHostDelegate.h"
#import "RoomInfoModel.h"
#import "XPSkillCardPlayerManager.h"
@interface RoomHighValueGiftBannerAnimation ()
@@ -26,6 +33,8 @@
@property (nonatomic,strong) UILabel *giftCountLabel;
///
@property(nonatomic,strong) UIButton *goButton;
@property (nonatomic, assign) NSInteger roomUid;
@property (nonatomic, copy) NSString *bgSourceName;
@property (nonatomic, copy) void(^animationComplete)(void);
@@ -34,20 +43,48 @@
@implementation RoomHighValueGiftBannerAnimation
+ (void)display:(UIView *)superView
with:(id)attachment
tapToRoom:(BOOL)handleTapToRoom
with:(AttachmentModel *)attachment
complete:(void(^)(void))complete {
NSInteger height = kGetScaleWidth(110);
NSInteger y = kStatusBarHeight;
GiftReceiveInfoModel *giftNotifyInfo = [GiftReceiveInfoModel modelWithJSON:attachment.data];
__block RoomHighValueGiftBannerAnimation *banner = [[RoomHighValueGiftBannerAnimation alloc] initWithFrame:CGRectMake(KScreenWidth, y, KScreenWidth, height)];
banner.animationComplete = complete;
banner.senderAvatarView.imageUrl = giftNotifyInfo.sendUserAvatar;
banner.giftImageView.imageUrl = giftNotifyInfo.giftUrl;
banner.roomNameScrollLabel.text = giftNotifyInfo.roomTitle;
banner.senderScrollLabel.text = [NSString stringWithFormat:@"%@ %@ %@", giftNotifyInfo.sendUserNick, YMLocalizedString(@"XPSessionFindNewGreetListView3"), giftNotifyInfo.recvUserNick];
banner.giftNameLabel.text = giftNotifyInfo.giftName;
banner.giftCountLabel.text = [NSString stringWithFormat:@"x %ld", (long)giftNotifyInfo.giftNum];
banner.roomUid = giftNotifyInfo.roomUid;
banner.senderScrollLabel.text = @"roomUidinteger($int64) (query)";
banner.roomNameScrollLabel.text = @"roomUidinteger($int64) (query)";
banner.giftNameLabel.text = @"yijgish";
banner.giftCountLabel.text = @"x!0";
switch (giftNotifyInfo.bgLevel) {
case 1:
banner.bgSourceName = @"gift_normal_1";
break;
case 2:
banner.bgSourceName = @"gift_normal_2";
break;
case 3:
banner.bgSourceName = @"gift_normal_3";
break;
case 4:
banner.bgSourceName = @"gift_vip_1";
break;
case 5:
banner.bgSourceName = @"gift_vip_2";
break;
case 6:
banner.bgSourceName = @"gift_vip_3";
break;
default:
banner.bgSourceName = @"gift_normal_1";
break;
}
[superView addSubview:banner];
@@ -55,7 +92,7 @@
[UIView animateWithDuration:0.25 animations:^{
banner.frame = CGRectMake(0, y, KScreenWidth, height);
} completion:^(BOOL finished) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(112.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
banner.frame = CGRectMake(-KScreenWidth, y, KScreenWidth, height);
} completion:^(BOOL finished) {
@@ -69,13 +106,53 @@
}];
}
- (void)handleTapGo {
//
UIViewController * controllerView = [XCCurrentVCStackManager shareManager].getCurrentVC;
__block XPRoomViewController<RoomHostDelegate> *roomVC = nil;
[controllerView.navigationController.viewControllers enumerateObjectsUsingBlock:^(__kindof UIViewController * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
if ([obj isKindOfClass:[XPRoomViewController class]]) {
[controllerView.navigationController popToRootViewControllerAnimated:NO];
roomVC = obj;
*stop = YES;
}
}];
if (roomVC) {
//
if ([roomVC getRoomInfo].uid == self.roomUid) {
return;
}
__block NSString *targetRoomUid = @(self.roomUid).stringValue;
[TTPopup alertWithMessage:YMLocalizedString(@"Combo_10") confirmHandler:^{
[roomVC exitRoom];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[XPRoomViewController openRoom:targetRoomUid
viewController:[XCCurrentVCStackManager shareManager].getCurrentVC];
});
} cancelHandler:^{}];
} else {
[XPRoomViewController openRoom:@(self.roomUid).stringValue
viewController:[XCCurrentVCStackManager shareManager].getCurrentVC];
}
}
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self setupUI];
}
return self;
}
- (void)setBgSourceName:(NSString *)bgSourceName {
_bgSourceName = bgSourceName;
@kWeakify(self);
SVGAParser *parser = [[SVGAParser alloc] init];
[parser parseWithNamed:@"gift_VIP_1" inBundle:[NSBundle mainBundle] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
[parser parseWithNamed:self.bgSourceName
inBundle:[NSBundle mainBundle]
completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
@kStrongify(self);
self.svgaImageView.videoItem = videoItem;
[self.svgaImageView startAnimation];
@@ -83,8 +160,6 @@
// TODO:
}];
}
return self;
}
- (void)setupUI {
[self addSubview:self.backImageView];
@@ -113,7 +188,7 @@
[self addSubview:self.senderScrollLabel];
[self.senderScrollLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(38);
make.top.mas_equalTo(40);
make.leading.mas_equalTo(self.senderAvatarView.mas_trailing).offset(4);
make.trailing.mas_equalTo(self.giftImageView.mas_leading).offset(-4);
make.height.mas_equalTo(16);
@@ -121,7 +196,7 @@
[self addSubview:self.giftNameLabel];
[self.giftNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.senderScrollLabel.mas_bottom).offset(4);
make.top.mas_equalTo(self.senderScrollLabel.mas_bottom).offset(8);
make.leading.mas_equalTo(self.senderAvatarView.mas_trailing).offset(4);
make.height.mas_equalTo(16);
}];
@@ -138,7 +213,7 @@
[room mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(self.giftImageView.mas_trailing).offset(2);
make.top.mas_equalTo(self.giftImageView);
make.width.height.mas_equalTo(11);
make.width.height.mas_equalTo(16);
}];
[self addSubview:self.roomNameScrollLabel];
@@ -191,7 +266,8 @@
_senderScrollLabel.scrollDuration = 6.0;
_senderScrollLabel.textColor = [UIColor whiteColor];
_senderScrollLabel.fadeLength = 8.0f;
_senderScrollLabel.textAlignment = NSTextAlignmentCenter;
_senderScrollLabel.font = kFontMedium(11);
_senderScrollLabel.textAlignment = NSTextAlignmentLeft;
}
return _senderScrollLabel;
}
@@ -202,7 +278,8 @@
_roomNameScrollLabel.textColor = [UIColor whiteColor];
_roomNameScrollLabel.scrollDuration = 6.0;
_roomNameScrollLabel.fadeLength = 8.0f;
_roomNameScrollLabel.textAlignment = NSTextAlignmentCenter;
_roomNameScrollLabel.font = kFontMedium(11);
_roomNameScrollLabel.textAlignment = NSTextAlignmentLeft;
}
return _roomNameScrollLabel;
}
@@ -242,10 +319,23 @@
if(!_goButton){
_goButton = [UIButton new];
[_goButton setTitle:YMLocalizedString(@"XPAcrossRoomPKPanelView3") forState:UIControlStateNormal];
[_goButton setTitleColor:UIColorFromRGB(0x442a00) forState:UIControlStateNormal];
_goButton.titleLabel.font = kFontRegular(10);
_goButton.layer.cornerRadius = kGetScaleWidth(20)/2;
_goButton.layer.borderWidth = 1;
_goButton.layer.masksToBounds = YES;
//
CAGradientLayer *gradientLayer = [CAGradientLayer layer];
gradientLayer.colors = @[(__bridge id)UIColorFromRGB(0xFFFADE).CGColor,
(__bridge id)UIColorFromRGB(0xFFE184).CGColor];
gradientLayer.startPoint = CGPointMake(0.0, 0.5); //
gradientLayer.endPoint = CGPointMake(1.0, 0.5); //
gradientLayer.frame = CGRectMake(0, 0, 55, 20); //
//
[_goButton.layer insertSublayer:gradientLayer atIndex:0];
[_goButton addTarget:self
action:@selector(handleTapGo)
forControlEvents:UIControlEventTouchUpInside];
}
return _goButton;
}

View File

@@ -78,6 +78,7 @@
#import "MSRoomGameWebVC.h"
#import "GameUniversalBannerView.h"
#import "RoomHighValueGiftBannerAnimation.h"
@interface XPRoomAnimationView ()<
SVGAPlayerDelegate,
@@ -272,7 +273,8 @@ HWDMP4PlayDelegate>
return;
}
if (attachment.first == CustomMessageType_Gift && attachment.second == Custom_Message_Sub_Gift_ChannelNotify){///广
[self receiveBroadcastGift:attachment];
// [self receiveBroadcastGift:attachment];
[self receiveRoomGiftBanner:attachment];
} else if (attachment.first == CustomMessageType_Noble_VIP && attachment.second == Custom_Message_Sub_Room_Noble_LevelUp_Suspend) {///VIP
[self receiveNobleLevelUp:attachment];
}else if(attachment.first == CustomMessageType_LuckyBag && attachment.second == Custom_Message_Sub_Room_Gift_LuckBag_FullScree){
@@ -506,6 +508,9 @@ HWDMP4PlayDelegate>
case Custom_Message_Sub_CP_Binding:
[self playCPBinding:nextAttachment];
break;
case Custom_Message_Sub_Gift_ChannelNotify:
[self playRoomGiftBanner:nextAttachment];
break;
default:
break;
}
@@ -2641,6 +2646,24 @@ HWDMP4PlayDelegate>
}];
}
#pragma mark -
- (void)receiveRoomGiftBanner:(AttachmentModel *)obj {
[self.roomEffectModelsQueueV2 addObject:obj];
if (!self.isRoomEffectV2Displaying) {
[self processNextRoomEffectAttachment];
}
}
- (void)playRoomGiftBanner:(AttachmentModel *)obj {
@kWeakify(self);
[RoomHighValueGiftBannerAnimation display:self
with:obj
complete:^{
@kStrongify(self);
[self processNextRoomEffectAttachment];
}];
}
#pragma mark -
- (void)receiveRoomWishGiftCelebrate:(AttachmentModel *)attachment {
CGFloat x = random() % (int)(KScreenWidth - 200);

View File

@@ -14,7 +14,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface CustomRoomBGCell : UICollectionViewCell
@property (nonatomic, assign) BOOL isSelectedCell;
@property (nonatomic, copy) void(^handleTapPlayButton)(id obj);
@property (nonatomic, copy) void(^handleTapActionButton)(CustomRoomBGItemModel *obj);
@property (nonatomic, copy) void(^handleTapTrash)(CustomRoomBGItemModel *model);
+ (void)registerTo:(UICollectionView *)collectionView;
+ (CustomRoomBGCell *)reuseFrom:(UICollectionView *)collectionView

View File

@@ -29,6 +29,9 @@
@property (nonatomic, strong) SVGAImageView *svgaImageView;
@property (nonatomic, strong) SVGAParser *parser;
//@property (nonatomic, strong) SVGAVideoEntity *svgaEntity;
@property (nonatomic, strong) CAGradientLayer *actionButtonLayer;
@end
@implementation CustomRoomBGCell
@@ -113,7 +116,9 @@
}
- (void)updateActionButtonToRenew {
[self removeAllActionButtonSublayers];
[self.actionButton setTitle:YMLocalizedString(@"1.0.18_10") forState:UIControlStateNormal];
[self.actionButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
self.actionButton.backgroundColor = [UIColor colorWithWhite:1 alpha:0.2];
[self.actionButton setCornerRadius:10
corners:(kCALayerMinXMinYCorner |
@@ -122,10 +127,48 @@
kCALayerMaxXMaxYCorner)
borderWidth:1
borderColor:[UIColor whiteColor]];
self.actionButton.userInteractionEnabled = YES;
}
- (void)updateActionButtonToInReview {
[self removeAllActionButtonSublayers];
[self.actionButton setTitle:YMLocalizedString(@"1.0.18_18") forState:UIControlStateNormal];
[self.actionButton setTitleColor:UIColorFromRGB(0xff9741) forState:UIControlStateNormal];
self.actionButton.backgroundColor = UIColorRGBAlpha(0xff9741, 0.2);
[self.actionButton setCornerRadius:10
corners:(kCALayerMinXMinYCorner |
kCALayerMaxXMinYCorner |
kCALayerMinXMaxYCorner |
kCALayerMaxXMaxYCorner)
borderWidth:1
borderColor:UIColorFromRGB(0xff9741)];
self.actionButton.userInteractionEnabled = YES;
}
- (void)updateActionButtonToInReject {
[self removeAllActionButtonSublayers];
[self.actionButton setTitle:YMLocalizedString(@"1.0.18_19") forState:UIControlStateNormal];
[self.actionButton setTitleColor:UIColorFromRGB(0xff5656) forState:UIControlStateNormal];
self.actionButton.backgroundColor = UIColorRGBAlpha(0xff5656, 0.2);
[self.actionButton setCornerRadius:10
corners:(kCALayerMinXMinYCorner |
kCALayerMaxXMinYCorner |
kCALayerMinXMaxYCorner |
kCALayerMaxXMaxYCorner)
borderWidth:1
borderColor:UIColorFromRGB(0xff5656)];
self.actionButton.userInteractionEnabled = YES;
}
- (void)updateActionButtonToBuy {
[self removeAllActionButtonSublayers];
[self.actionButton setTitle:YMLocalizedString(@"1.0.18_9") forState:UIControlStateNormal];
[self.actionButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
if (!_actionButtonLayer) {
//
CAGradientLayer *gradientLayer = [CAGradientLayer layer];
gradientLayer.colors = @[(__bridge id)UIColorFromRGB(0xE29030).CGColor,
@@ -134,8 +177,13 @@
gradientLayer.endPoint = CGPointMake(0.0, 1.0); //
gradientLayer.frame = CGRectMake(0, 0, 72, 22); //
_actionButtonLayer = gradientLayer;
//
[self.actionButton.layer insertSublayer:gradientLayer atIndex:0];
[self.actionButton.layer insertSublayer:self.actionButtonLayer atIndex:0];
} else {
self.actionButtonLayer.hidden = NO;
}
[self.actionButton setCornerRadius:10
corners:(kCALayerMinXMinYCorner |
kCALayerMaxXMinYCorner |
@@ -147,6 +195,12 @@
self.actionButton.userInteractionEnabled = NO;
}
- (void)removeAllActionButtonSublayers {
if (self.actionButtonLayer) {
self.actionButtonLayer.hidden = YES;
}
}
- (void)setIsSelectedCell:(BOOL)isSelectedCell {
_isSelectedCell = isSelectedCell;
self.selectedStateView.hidden = !isSelectedCell;
@@ -180,6 +234,9 @@
case RoomBGStatus_Pass:
self.remainingDaysLabel.text = [cellModel remainDays];
self.remainingDaysLabel.hidden = [NSString isEmpty:[cellModel remainDays]];
if (![NSString isEmpty:cellModel.remainHour]) {
[self updateActionButtonToRenew];
}
break;
case RoomBGStatus_Rejected:
self.remainingDaysLabel.text = @"";
@@ -191,6 +248,37 @@
case RoomBGType_Custom:
[self layoutCustomUI];
[self setupBottomArea];
self.pricePerDayLabel.text = [cellModel pricePerDays];
[self displayGIFTag:NO];
[self displayPayRemainTag:cellModel.status == RoomBGStatus_Expired || cellModel.status == RoomBGStatus_Pass];
self.trashButton.hidden = NO;
switch (cellModel.status) {
case RoomBGStatus_Expired:
self.remainingDaysLabel.text = YMLocalizedString(@"1.0.18_7");
self.remainingDaysLabel.hidden = NO;
[self updateRemainLabel:YES];
[self updateActionButtonToRenew];
break;
case RoomBGStatus_Reviewing:
self.remainingDaysLabel.text = @"";
self.remainingDaysLabel.hidden = YES;
self.trashButton.hidden = YES;
[self updateActionButtonToInReview];
break;
case RoomBGStatus_Pass:
self.remainingDaysLabel.text = [cellModel remainDays];
self.remainingDaysLabel.hidden = [NSString isEmpty:[cellModel remainDays]];
[self updateRemainLabel:NO];
[self updateActionButtonToRenew];
break;
case RoomBGStatus_Rejected:
self.remainingDaysLabel.hidden = YES;
[self updateActionButtonToInReject];
break;
default:
break;
}
break;
default:
break;
@@ -296,19 +384,42 @@
}];
}
- (void)updateRemainLabel:(BOOL)isForExpired {
self.remainingDaysLabel.textColor = [UIColor whiteColor];
if (isForExpired) {
self.remainingDaysLabel.backgroundColor = UIColorFromRGB(0x696969);
} else {
self.remainingDaysLabel.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
}
}
#pragma mark -
- (void)didTapActionButton {
if (self.handleTapActionButton) {
self.handleTapActionButton(self.cellModel);
}
}
- (void)didTapPlayButton {
if (self.handleTapPlayButton) {
self.handleTapPlayButton(@"");
}
// if (self.handleTapPlayButton) {
// self.handleTapPlayButton(@"");
// }
}
- (void)didTapTrashButton {
TTAlertConfig *config = [[TTAlertConfig alloc]init];
config.title = YMLocalizedString(@"XPMineUserInfoAlbumViewController12");
config.message = YMLocalizedString(@"XPMineUserInfoAlbumViewController13");
@kWeakify(self);
[TTPopup alertWithConfig:config
showBorder:NO
confirmHandler:^{
@kStrongify(self);
if (self.handleTapTrash) {
self.handleTapTrash(self.cellModel);
}
}
cancelHandler:^{}];
}

View File

@@ -51,6 +51,9 @@
@property (nonatomic, assign) NSInteger customBGUsageHours;
@property (nonatomic, assign) NSInteger customBGUsageGolds;
@property (nonatomic, assign) NSInteger jumpToTab;
@property (nonatomic, assign) BOOL isCreating;
@end
@implementation CustomRoomBGContentViewController
@@ -62,6 +65,7 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.jumpToTab = -1;
self.currentSelectedTabIndex = 0;
self.currentSelectedItemIndex = 0;
@@ -76,7 +80,6 @@
self.freeBackgrounds = @[].mutableCopy;
self.customBackgrounds = @[].mutableCopy;
__block CustomRoomBGItemModel *currentModel = nil;
@kWeakify(self);
[self.presenter loadListOfRoomBG:self.roomUID
complete:^(CustomRoomBGModel *roomBGModel) {
@@ -85,9 +88,6 @@
self.customBGUsageGolds = roomBGModel.customGoldPrice;
for (CustomRoomBGItemModel *model in roomBGModel.itemList) {
if (model.isCur) {
currentModel = model;
}
switch (model.type) {
case RoomBGType_Free:
[self.freeBackgrounds addObject:model];
@@ -104,12 +104,24 @@
}
}
if (currentModel) {
[self updateTabButtonStatus:currentModel];
} else {
switch (self.jumpToTab) {
case 1:
[self didSelectedButton:self.freeButton];
break;
case 2:
[self didSelectedButton:self.payButton];
break;
case 3:
[self didSelectedButton:self.customButton];
break;
default:
[self didSelectedButton:self.freeButton];
break;
}
self.jumpToTab = -1;
[self.collectionView reloadData];
} failure:^{
@kStrongify(self);
@@ -118,6 +130,7 @@
}
- (void)updateTabButtonStatus:(CustomRoomBGItemModel *)model {
self.currentSelectedModel = nil;
self.currentSelectedTabIndex = model.type;
switch (model.type) {
case RoomBGType_Pay:
@@ -136,7 +149,7 @@
}
- (void)setupUI {
self.view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.3];
self.view.backgroundColor = [UIColor clearColor];
[self setupBackgroundContent];
[self setupTopButtons];
@@ -342,6 +355,7 @@
}
- (void)updatePreviewWith:(UIImage *)image {
self.isCreating = YES;
self.previewBackImageView.image = image;
[self.previewActionButton setTitle:YMLocalizedString(@"1.0.18_16") forState:UIControlStateNormal];
}
@@ -392,10 +406,15 @@
}
- (void)didTapActionButton {
if (self.isCreating) {
[self uploadBG];
} else {
[self updateRoomBG];
}
}
- (void)didTapCancelPreview {
self.isCreating = NO;
[self.previewArea removeFromSuperview];
}
@@ -406,18 +425,18 @@
}
switch (self.currentSelectedModel.type) {
case 0:
case RoomBGType_Free:
[self applyBG];
break;
case 1:
if (self.currentSelectedModel.status == 1 && [self.currentSelectedModel isAlreadyPay]) {
[self applyBG];
} else {
case RoomBGType_Pay:
[self buyBG];
}
break;
case 2:
case RoomBGType_Custom:
if (self.currentSelectedModel.status == RoomBGStatus_Pass) {
[self buyBG];
} else {
[self uploadBG];
}
break;
default:
@@ -437,10 +456,14 @@
}
- (void)uploadBG {
[self showLoading];
@kWeakify(self);
[self.presenter uploadRoomBG:self.roomUID photo:self.customSelectedImage complete:^{
@kStrongify(self);
// TODO: custom tab
[self hideHUD];
[self didTapCancelPreview];
self.jumpToTab = 3;
[self setupData];
} failure:^{
[self hideHUD];
@@ -458,6 +481,15 @@
failure:^{}];
}
- (void)removeBG:(CustomRoomBGItemModel *)model {
@kWeakify(self);
[self.presenter deleteRoomBG:self.roomUID itemID:@(model.id).stringValue complete:^{
@kStrongify(self);
//TODO: custom
[self setupData];
} failure:^{ }];
}
#pragma mark - UIImagePickerControllerDelegate
- (void)showNotPhoto:(NSString *)title content:(NSString *)content{
TTAlertConfig *config = [[TTAlertConfig alloc] init];
@@ -491,7 +523,6 @@
}];
}
#pragma mark -
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
switch (self.currentSelectedTabIndex) {
@@ -531,9 +562,18 @@
model:model
atIndexPath:indexPath];
@kWeakify(self);
[cell setHandleTapPlayButton:^(id _Nonnull obj) {
// [cell setHandleTapPlayButton:^(id _Nonnull obj) {
// @kStrongify(self);
// [self displayPreviewArea];
// }];
[cell setHandleTapActionButton:^(CustomRoomBGItemModel * _Nonnull obj) {
@kStrongify(self);
[self displayPreviewArea];
[self handleCellModelAction:obj isFromButton:YES];
}];
[cell setHandleTapTrash:^(CustomRoomBGItemModel * _Nonnull model) {
@kStrongify(self);
[self removeBG:model];
}];
return cell;
}
@@ -556,29 +596,9 @@
default:
break;
}
if (model) {
self.currentSelectedItemIndex = indexPath.row;
self.currentSelectedModel = model;
if (model.isCur) {
[collectionView reloadData];
return;
}
// TODO: buy preview
if (model.status == RoomBGStatus_Pass) {
if ([model isAlreadyPay]) {
[self applyBG];
} else {
self.currentSelectedItemIndex = indexPath.row;
[self displayPreviewArea];
[self updatePreviewArea:model];
// [collectionView reloadData];
}
} else {
self.currentSelectedItemIndex = indexPath.row;
[self displayPreviewArea];
[self updatePreviewArea:model];
// [collectionView reloadData];
}
}
[self handleCellModelAction:model isFromButton:NO];
}
- (void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath {
@@ -591,6 +611,62 @@
[bgCell pauseSVGA];
}
- (void)handleCellModelAction:(CustomRoomBGItemModel *)model isFromButton:(BOOL)isFromButton {
if (model) {
if (model.isCur && !isFromButton) {
return;
}
switch (model.type) {
case RoomBGType_Pay: {
if (model.status == RoomBGStatus_Pass) {
if ([model isAlreadyPay] && !isFromButton) {
[self applyBG];
} else {
[self displayPreviewArea];
[self updatePreviewArea:model];
}
} else {
[self displayPreviewArea];
[self updatePreviewArea:model];
}
}
break;
case RoomBGType_Free:
[self applyBG];
break;
case RoomBGType_Custom:
if (model.status == RoomBGStatus_Rejected) {
TTAlertConfig *config = [[TTAlertConfig alloc]init];
config.title = YMLocalizedString(@"1.0.18_20");
config.message = YMLocalizedString(@"1.0.18_23");
config.actionStyle = TTAlertActionConfirmStyle;
[TTPopup alertWithConfig:config
showBorder:NO
confirmHandler:^{}
cancelHandler:^{}];
} else if (model.status == RoomBGStatus_Reviewing) {
TTAlertConfig *config = [[TTAlertConfig alloc]init];
config.title = YMLocalizedString(@"1.0.18_20");
config.message = YMLocalizedString(@"1.0.18_21");
config.actionStyle = TTAlertActionConfirmStyle;
[TTPopup alertWithConfig:config
showBorder:NO
confirmHandler:^{}
cancelHandler:^{}];
} else if (model.status == RoomBGStatus_Pass) {
//
[self displayPreviewArea];
[self updatePreviewArea:model];
}
break;
default:
break;
}
}
}
#pragma mark -
- (UIButton *)dismissButton {
UIButton *b = [UIButton buttonWithType:UIButtonTypeCustom];
@@ -604,10 +680,26 @@
CGFloat height = kGetScaleWidth(323) + kSafeAreaBottomHeight;
UIView *v = [[UIView alloc] initWithFrame:CGRectMake(0, KScreenHeight - height, KScreenWidth, height)];
v.userInteractionEnabled = YES;
v.backgroundColor = [UIColor blackColor];
v.backgroundColor = [UIColor clearColor];
v.layer.cornerRadius = 16;
v.layer.maskedCorners = kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner;
v.layer.masksToBounds = YES;
//
UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]; // Light, Dark, ExtraLight
//
UIVisualEffectView *blurEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
//
blurEffectView.frame = CGRectMake(0, 0, KScreenWidth, kGetScaleWidth(180 + 32 + 32));
blurEffectView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; // 使
[v addSubview:blurEffectView];
[blurEffectView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(v);
}];
_bottomAreaBackGround = v;
}
return _bottomAreaBackGround;
@@ -831,7 +923,7 @@ forControlEvents:UIControlEventTouchUpInside];
_previewActionButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_previewActionButton setTitle:YMLocalizedString(@"1.0.18_15")
forState:UIControlStateNormal];
_previewActionButton.layer.cornerRadius = 11;
_previewActionButton.layer.cornerRadius = 19;
_previewActionButton.layer.masksToBounds = YES;
[_previewActionButton addTarget:self
action:@selector(didTapActionButton)

View File

@@ -112,7 +112,7 @@
[Api listOfRoomBackground:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
if (complete) {
CustomRoomBGModel *model = [CustomRoomBGModel modelWithJSON:data.data];
NSArray *sortItems = [model.itemList sortedArrayUsingDescriptors:@[[NSSortDescriptor sortDescriptorWithKey:@"id" ascending:YES]]];
NSArray *sortItems = [self __sortedArrayByCustomCriteria:model.itemList];
model.itemList = sortItems.copy;
complete(model);
}
@@ -127,4 +127,39 @@
roomUid:roomUID];
}
- (NSArray *)__sortedArrayByCustomCriteria:(NSArray <CustomRoomBGItemModel*> *)datas {
NSArray *sortedById = [datas sortedArrayUsingComparator:^NSComparisonResult(CustomRoomBGItemModel *obj1, CustomRoomBGItemModel *obj2) {
NSNumber *id1 = @(obj1.id);
NSNumber *id2 = @(obj2.id);
return [id1 compare:id2];
}];
// 2.
NSMutableArray *priority1Array = [NSMutableArray array];
NSMutableArray *priority2Array = [NSMutableArray array];
NSMutableArray *priority3Array = [NSMutableArray array];
for (CustomRoomBGItemModel *obj in sortedById) {
BOOL type = obj.status == RoomBGStatus_Pass;
BOOL isBuy = [obj isAlreadyPay];
if (type && isBuy) {
[priority1Array addObject:obj]; // 1type == 1 && isBuy == YES
} else if (type && !isBuy) {
[priority2Array addObject:obj]; // 2type == 1 && isBuy == NO
} else {
[priority3Array addObject:obj]; // 3
}
}
// 3.
NSMutableArray *finalArray = [NSMutableArray array];
[finalArray addObjectsFromArray:priority1Array];
[finalArray addObjectsFromArray:priority2Array];
[finalArray addObjectsFromArray:priority3Array];
return [finalArray copy];
}
@end

View File

@@ -81,7 +81,7 @@
extModel.experLevelSeq = userInfo.userLevelVo.experLevelSeq;
extModel.experUrl = userInfo.userLevelVo.experUrl;
extModel.newUser = userInfo.newUser;
extModel.vipIcon = userInfo.userVipInfoVO.vipIcon;
extModel.vipIcon = userInfo.userVipInfoVO.nameplateUrl;
extModel.androidBubbleUrl = userInfo.androidBubbleUrl;
extModel.iosBubbleUrl = userInfo.iosBubbleUrl;
extModel.fromSayHelloChannel = userInfo.fromSayHelloChannel;

View File

@@ -266,12 +266,18 @@
[attribute appendAttributedString:[self createLanguageImageAttribute:@"common_super_admin"]];
}
if (model.vipIcon) {//VIPicon
[attribute appendAttributedString:[self createUrlImageAttribute:model.vipIcon size:CGSizeMake(20, 20)]];
if (![NSString isEmpty:model.experUrl]) {
[attribute appendAttributedString:[self createUrlImageAttribute:model.experUrl]];
[attribute appendAttributedString:[self createSapceAttribute:2]];
}
if (model.experUrl) {
[attribute appendAttributedString:[self createUrlImageAttribute:model.experUrl]];
if (![NSString isEmpty:model.charmUrl]) {//
[attribute appendAttributedString:[self createUrlImageAttribute:model.charmUrl]];
[attribute appendAttributedString:[self createSapceAttribute:2]];
}
if (![NSString isEmpty:model.vipIcon]) {
[attribute appendAttributedString:[self createUrlImageAttribute:model.vipIcon]];
[attribute appendAttributedString:[self createSapceAttribute:2]];
}
if(model.isCustomWord == YES){
@@ -374,15 +380,22 @@
[attribute appendAttributedString:[self createSapceAttribute:2]];
}
if (extModel.vipIcon.length > 0) {//VIPicon
messageInfo.vipIcon = extModel.vipIcon;
[attribute appendAttributedString:[self createUrlImageAttribute:extModel.vipIcon size:CGSizeMake(20, 20)]];
[attribute appendAttributedString:[self createSapceAttribute:2]];
}
if (extModel.experUrl.length > 0) {//
[attribute appendAttributedString:[self createUrlImageAttribute:extModel.experUrl]];
[attribute appendAttributedString:[self createSapceAttribute:2]];
}
if (extModel.charmUrl.length > 0) {//
[attribute appendAttributedString:[self createUrlImageAttribute:extModel.charmUrl]];
[attribute appendAttributedString:[self createSapceAttribute:2]];
}
if (extModel.vipIcon.length > 0) {//VIPicon
messageInfo.vipIcon = extModel.vipIcon;
[attribute appendAttributedString:[self createUrlImageAttribute:extModel.vipIcon]];
[attribute appendAttributedString:[self createSapceAttribute:2]];
}
if(extModel.isCustomWord == YES){
if (extModel.inRoomNameplatePic.length > 0) {
[attribute appendAttributedString:[self createUrlImageAttribute:extModel.inRoomNameplatePic]];

View File

@@ -155,11 +155,6 @@
isCreator = member.type == NIMChatroomMemberTypeCreator;
isManager = member.type == NIMChatroomMemberTypeManager;
if (isCreator || isManager || isSuperAdmin) {
[array addObject:bgValue];
indexOfRoomAlbum += 1;
}
if ((isCreator || isManager || isSuperAdmin) && roomInfo.type != RoomType_MiniGame && roomInfo.type != RoomType_Anchor) {
[array addObject:roomPK];
indexOfRoomAlbum += 1;
@@ -188,6 +183,10 @@
}
[array addObject:trumpet];
[array addObject:giftEffect];
if (isCreator || isManager || isSuperAdmin) {
[array addObject:bgValue];
indexOfRoomAlbum += 1;
}
[array addObject:roomSetting];
[array addObject:clearScreen];

View File

@@ -120,7 +120,7 @@
extModel.experLevelSeq = userInfo.userLevelVo.experLevelSeq;
extModel.experUrl = userInfo.userLevelVo.experUrl;
extModel.newUser = userInfo.newUser;
extModel.vipIcon = userInfo.userVipInfoVO.vipIcon;
extModel.vipIcon = userInfo.userVipInfoVO.nameplateUrl;
extModel.androidBubbleUrl = userInfo.androidBubbleUrl;
extModel.iosBubbleUrl = userInfo.iosBubbleUrl;
extModel.fromSayHelloChannel = userInfo.fromSayHelloChannel;

View File

@@ -100,7 +100,7 @@
extModel.experLevelSeq = userInfo.userLevelVo.experLevelSeq;
extModel.experUrl = userInfo.userLevelVo.experUrl;
extModel.newUser = userInfo.newUser;
extModel.vipIcon = userInfo.userVipInfoVO.vipIcon;
extModel.vipIcon = userInfo.userVipInfoVO.nameplateUrl;
extModel.fromUid = userInfo.fromUid;
extModel.fromType = userInfo.fromType;
extModel.fromNick = userInfo.fromNick;

View File

@@ -67,7 +67,7 @@
extModel.experLevelSeq = userInfo.userLevelVo.experLevelSeq;
extModel.experUrl = userInfo.userLevelVo.experUrl;
extModel.newUser = userInfo.newUser;
extModel.vipIcon = userInfo.userVipInfoVO.vipIcon;
extModel.vipIcon = userInfo.userVipInfoVO.nameplateUrl;
extModel.androidBubbleUrl = userInfo.androidBubbleUrl;
extModel.iosBubbleUrl = userInfo.iosBubbleUrl;
extModel.fromSayHelloChannel = userInfo.fromSayHelloChannel;

View File

@@ -17,6 +17,7 @@ typedef enum : NSUInteger {
ComboAction_RemovePanel,
ComboAction_Error,
ComboAction_Combo_Count_Update,
ComboAction_Update_After_Send_Success
} ComboActionType;
typedef enum : NSUInteger {
@@ -30,6 +31,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface GiftComboManager : NSObject
@property (nonatomic, strong) GiftReceiveInfoModel *sendGiftReceiveInfo;
// 单例方法
+ (instancetype)sharedManager;

View File

@@ -460,7 +460,9 @@
GiftReceiveInfoModel *receive = [GiftReceiveInfoModel modelWithJSON:data.data];
receive.sourceType = [[dic objectForKey:@"giftSource"] integerValue];
receive.roomSendGiftType = [[dic objectForKey:@"giftType"] integerValue];
[self handleSendGiftSuccess:data];
NSArray *array = [allUIDs componentsSeparatedByString:@","];
receive.receiveGiftNumberUser = array.count;
[self handleSendGiftSuccess:receive sourceData:data];
} else {
self.errorMessage = msg;
self.actionCallback(ComboAction_RemovePanel);
@@ -478,15 +480,16 @@
uid:[AccountInfoStorage instance].getUid];
}
- (void)handleSendGiftSuccess:(BaseModel *)response {
- (void)handleSendGiftSuccess:(GiftReceiveInfoModel *)receive
sourceData:(BaseModel *)response {
if (self.actionCallback) {
self.actionCallback(ComboAction_Combo_Count_Update);
}
GiftReceiveInfoModel *receive = [GiftReceiveInfoModel modelWithJSON:response.data];
if (!receive) {
return;
self.sendGiftReceiveInfo = receive;
if (self.actionCallback) {
self.actionCallback(ComboAction_Update_After_Send_Success);
}
NSDictionary *tempDic = response.data;

View File

@@ -133,6 +133,10 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, assign) NSInteger comboCount;
@property (nonatomic, assign) NSInteger receiveGiftNumberUser;
@property (nonatomic, assign) NSInteger bgLevel; /// 1,2,3 对应非 VIP 背景456 对应 VIP 背景
- (NSInteger)receiveUserCount;
@end

View File

@@ -185,6 +185,17 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
case ComboAction_Error: {
[self showErrorToast:[[GiftComboManager sharedManager] loadErrorMessage]];
}
break;
case ComboAction_Update_After_Send_Success: {
GiftReceiveInfoModel *receiveInfo = [GiftComboManager sharedManager].sendGiftReceiveInfo;
if (receiveInfo.sourceType == GiftSourceType_Pack) {
///
[self.giftInfoView updatePackSource:receiveInfo numberUser:receiveInfo.receiveGiftNumberUser];
} else {
self.giftBarView.walletInfoModel = receiveInfo.userPurse;
}
}
break;
default:
break;
}
@@ -667,6 +678,7 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
break;
case GiftSegmentType_SuperLucky: {
if (!self.superGiftView.superview) {
self.superGiftView.giftModel = self.giftInfoView.lastSelectGift;
[self.view addSubview:self.superGiftView];
[self.superGiftView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.contentView.mas_top);
@@ -721,8 +733,8 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
case GiftSegmentType_SuperLucky: {
[self.constellationBanner removeFromSuperview];
[self.luckyBroadcastView removeFromSuperview];
if (!self.superGiftView.superview) {
self.superGiftView.giftModel = info;
if (!self.superGiftView.superview) {
[self.view addSubview:self.superGiftView];
[self.superGiftView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.contentView.mas_top);

View File

@@ -94,8 +94,13 @@
@property (nonatomic,strong) NetImageView *nameplateImageView;
///
@property (nonatomic,strong) UILabel *nameplateLabel;
///VIP
@property (nonatomic,strong) NetImageView *vipPlateImageView;
///ID
@property (nonatomic,strong) UILabel *idLabel;
@property (nonatomic, strong) UIButton *copyIDButton;
///
@property (nonatomic,strong) UIButton *reportButton;
@@ -175,6 +180,7 @@
[self.userInfoView addSubview:self.sexImageView];
[self.userInfoView addSubview:self.tagStackView];
[self.userInfoView addSubview:self.idLabel];
[self.userInfoView addSubview:self.copyIDButton];
[self.userInfoView addSubview:self.reportButton];
[self.userInfoView addSubview:self.closeButton];
///
@@ -182,6 +188,7 @@
[self.tagStackView addArrangedSubview:self.officialImageView];
[self.tagStackView addArrangedSubview:self.experImageView];
[self.tagStackView addArrangedSubview:self.charmImageView];
[self.tagStackView addArrangedSubview:self.vipPlateImageView];
[self.tagStackView addArrangedSubview:self.namePlateView];
///
[self.namePlateView addSubview:self.nameplateImageView];
@@ -302,6 +309,12 @@
make.top.mas_equalTo(self.tagStackView.mas_bottom).offset(3);
}];
[self.copyIDButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(self.idLabel.mas_trailing).offset(2);
make.centerY.mas_equalTo(self.idLabel);
make.size.mas_equalTo(CGSizeMake(14, 14));
}];
[self.closeButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(22, 22));
make.top.mas_equalTo(self.userInfoView).offset(5);
@@ -334,6 +347,10 @@
make.width.mas_equalTo(self.nameplateImageView.mas_width);
}];
[self.vipPlateImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(20);
make.width.mas_equalTo(60);
}];
[self.nameplateImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(20);
@@ -588,6 +605,13 @@
}
self.charmImageView.hidden = userInfo.userLevelVo.charmUrl.length <= 0;
if (userInfo.userVipInfoVO.nameplateUrl.length > 0) {
self.vipPlateImageView.hidden = NO;
self.vipPlateImageView.imageUrl = userInfo.userVipInfoVO.nameplateUrl;
} else {
self.vipPlateImageView.hidden = YES;
}
if (userInfo.nameplateWord.length>0 && userInfo.nameplatePic.length>0) {
self.nameplateImageView.imageUrl = userInfo.nameplatePic;
self.nameplateLabel.text = userInfo.nameplateWord;
@@ -595,14 +619,9 @@
} else {
self.namePlateView.hidden = YES;
}
NSString *text = [NSString stringWithFormat:YMLocalizedString(@"XPUserCardViewController0"), userInfo.erbanNo];
NSMutableAttributedString *textAtt = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%@ ",text] attributes:@{NSForegroundColorAttributeName:self.idLabel.textColor}];
NSTextAttachment * attachment = [[NSTextAttachment alloc] init];
UIImage *iconImage = [UIImage imageNamed:@"user_card_copy_id"];;
attachment.bounds = CGRectMake(0, roundf(self.idLabel.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;
self.idLabel.text = text;
NSString * headwearUrl= userInfo.headwearEffect.length > 0 ? userInfo.headwearEffect : userInfo.headwearPic;
self.headWearImageView.hidden = headwearUrl.length <= 0;
@@ -1405,6 +1424,18 @@
return _nameplateImageView;
}
- (NetImageView *)vipPlateImageView {
if (!_vipPlateImageView) {
NetImageConfig * config = [[NetImageConfig alloc] init];
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
config.imageType = ImageTypeUserCardLevel;
_vipPlateImageView = [[NetImageView alloc] initWithConfig:config];
_vipPlateImageView.userInteractionEnabled = YES;
_vipPlateImageView.contentMode = UIViewContentModeScaleAspectFit;
}
return _vipPlateImageView;
}
- (UILabel *)nameplateLabel {
if (!_nameplateLabel) {
_nameplateLabel = [[UILabel alloc] init];
@@ -1439,7 +1470,7 @@
if (!_idLabel) {
_idLabel = [[UILabel alloc] init];
_idLabel.font = [UIFont systemFontOfSize:10];
_idLabel.textColor = [DJDKMIMOMColor textThirdColor];
_idLabel.textColor = UIColorFromRGB(0x313131);
_idLabel.userInteractionEnabled = YES;
UITapGestureRecognizer *longPress = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(copyNameAction)];
@@ -1561,4 +1592,17 @@
return _vapParser;
}
- (UIButton *)copyIDButton {
if (!_copyIDButton) {
UIButton *b = [UIButton buttonWithType:UIButtonTypeCustom];
[b setImage:kImage(@"user_card_copy") forState:UIControlStateNormal];
[b addTarget:self
action:@selector(copyNameAction)
forControlEvents:UIControlEventTouchUpInside];
_copyIDButton = b;
}
return _copyIDButton;
}
@end

View File

@@ -92,8 +92,6 @@
#import "XPSendGiftView.h"
#import "RoomHighValueGiftBannerAnimation.h"
UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey;
UIKIT_EXTERN NSString * const kRoomMiniNotificationKey;
UIKIT_EXTERN NSString * kNewUserRechargeKey;
@@ -355,17 +353,14 @@ XPCandyTreeInsufficientBalanceViewDelegate>
[self setupForBoom];
#if DEBUG
UIButton *b = [UIButton buttonWithType:UIButtonTypeInfoLight];
b.frame = CGRectMake(100, 100, 100, 100);
[self.view addSubview:b];
[b addTarget:self action:@selector(test) forControlEvents:UIControlEventTouchUpInside];
// UIButton *b = [UIButton buttonWithType:UIButtonTypeInfoLight];
// b.frame = CGRectMake(100, 100, 100, 100);
// [self.view addSubview:b];
// [b addTarget:self action:@selector(test) forControlEvents:UIControlEventTouchUpInside];
#endif
}
- (void)test {
[RoomHighValueGiftBannerAnimation display:self.view
with:nil
tapToRoom:NO
complete:nil];
}
- (void)setupForBoom {

View File

@@ -626,7 +626,8 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
if (attachment.first == CustomMessageType_RedPacket) {
[self receiveRedPacketDealWithData:attachment];
} else if (attachment.first == CustomMessageType_Gift && attachment.second == Custom_Message_Sub_Gift_ChannelNotify){///广
[self receiveBroadcastGift:attachment];
// MARK:
// [self receiveBroadcastGift:attachment];
}else if(attachment.first == CustomMessageType_Version_Update && attachment.second == Custom_Message_Version_Update_Value){
NSString *osValue = attachment.data[@"updateOs"];
if([osValue isEqualToString:@"ios"] && [AccountInfoStorage instance].getUid.length > 0){
@@ -824,9 +825,21 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
itemVc.tabBarItem.selectedImage = [[UIImage imageNamed:selectedImageURL] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
}
// if ([imageURL hasPrefix:@"http"]) {
// itemVc.tabBarItem.image = [[[ClientConfig shareConfig] tabNormalImageImage:index] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
// }
if ([imageURL hasPrefix:@"http"]) {
UIImage *downloadedImage = [[ClientConfig shareConfig] tabNormalImageImage:index];
if (downloadedImage) {
itemVc.tabBarItem.image = [downloadedImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
} else {
itemVc.tabBarItem.image = [[UIImage imageNamed:imageURL] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
}
downloadedImage = [[ClientConfig shareConfig] tabSelectedImageImage:index];
if (downloadedImage) {
itemVc.tabBarItem.selectedImage = [downloadedImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
} else {
itemVc.tabBarItem.selectedImage = [[UIImage imageNamed:imageURL] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
}
}
BaseNavigationController *nav = [[BaseNavigationController alloc] initWithRootViewController:itemVc];
return nav;

View File

@@ -17,10 +17,31 @@
#import "MedalModel.h"
#import "RelationUserVO.h"
#import "GuildInfo.h"
#import "NameplateModel.h"
NS_ASSUME_NONNULL_BEGIN
//@interface NameplateModel : PIBaseModel
//
//@property (nonatomic, assign) NSInteger id;
//@property (nonatomic, assign) NSTimeInterval expireTime;
//@property (nonatomic, assign) NSInteger uid;
//@property (nonatomic, assign) NSInteger nameplateId;
//@property (nonatomic, copy) NSString *nameplateImage;
//@property (nonatomic, assign) NSInteger nameplateType;
//@property (nonatomic, assign) NSTimeInterval createTime;
//@property (nonatomic, assign) BOOL isCustomWord;
//@property (nonatomic, copy) NSString *remark;
//@property (nonatomic, copy) NSString *iconPic;
//@property (nonatomic, assign) NSInteger expireDays;
//@property (nonatomic, assign) NSTimeInterval updateTime;
//@property (nonatomic, copy) NSString *nameplateName;
//@property (nonatomic, copy) NSString *fixedWord;
//@property (nonatomic, copy) NSString *word;
//
//@end
@interface UserInfoModel : PIBaseModel
@property (nonatomic , assign) NSInteger bindType;
@@ -164,6 +185,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, strong) GuildInfo *guildInfo;
@property (nonatomic, copy) NSArray <NameplateModel *> *userNameplateList;
- (BOOL)isUserValid;
- (NSString *)userIDString;

View File

@@ -16,7 +16,7 @@
@"userLuckyBagGiftWall":UserGiftWallInfoModel.class,
@"dynamicInfo":MomentsInfoModel.class,
@"audioCard":XPSoundCardModel.class,
// @"medals":MedalModel.class
@"userNameplateList":NameplateModel.class
};
}

View File

@@ -38,6 +38,10 @@ NS_ASSUME_NONNULL_BEGIN
/// 是否防关注
@property (nonatomic, assign) BOOL preventFollow;
@property (nonatomic, assign) bool privateChatLimit;
@property (nonatomic, copy) NSString *nameplateUrl;
@end
NS_ASSUME_NONNULL_END

View File

@@ -3971,10 +3971,10 @@ ineHeadView12" = "الحمل";
"1.0.18_3" = "مخصصة";
"1.0.18_4" = "إنشاء جديد";
"1.0.18_5" = "يمكنك تخصيص ما يصل إلى 6 خلفيات";
"1.0.18_6" = "لا يمكنك تحميل أكثر من 6 صور في المرة الواحدة كخلفية مخصصة.
بمجرد إنشاء الخلفية، لا يمكن إلغاؤها.
"1.0.18_6" = "لا يمكنك تحميل أكثر من 6 صور في المرة الواحدة كخلفية مخصصة.\n
\nبمجرد إنشاء الخلفية، لا يمكن إلغاؤها.
سوف نراجع الخلفية التي تم تحميلها خلال 24 ساعة.
إذا تم رفض الخلفية، فسوف تتلقى استردادًا للعملات.";
\nإذا تم رفض الخلفية، فسوف تتلقى استردادًا للعملات.";
"1.0.18_7" = "انتهاء الصلاحية";
"1.0.18_8" = "أيام";
"1.0.18_9" = "شراء";
@@ -3993,3 +3993,9 @@ ineHeadView12" = "الحمل";
"1.0.18_22" = "تهانينا! تمت مراجعة خلفيتك. يمكنك الآن تخصيص غرفتك على الفور بالخلفية الجديدة.";
"1.0.18_23" = "عذرًا، لم تتم مراجعة خلفيتك. يرجى تحميل خلفية جديدة مرة أخرى.";
"1.0.18_24" = "شراء الخلفية";
"1.0.18_25" = "عدم الإزعاج";
"1.0.18_26" = "أنت والآخر لستما صديقين، لذا لا يمكنكما الدردشة بشكل خاص";
"1.0.18_27" = "كن في اي بي%@ بدون أي علاقة، يمكنك الدردشة مع المستخدمين بشكل خاص مجانًا كل يوم، جربه؟";
"1.0.18_28" = "كن في اي بي%@، يمكنك الحصول على %@ حصص كل يوم، والدردشة بشكل خاص مع المستخدمين مجانًا، جرب ذلك؟";
"1.0.18_29" = "لقد قمت بالدردشة مع 1000 شخص اليوم، يرجى المحاولة مرة أخرى غدًا.";
"1.0.18_30" = "%@كن في اي بي";

View File

@@ -3767,7 +3767,7 @@
"1.0.18_3" = "Custom";
"1.0.18_4" = "Create new";
"1.0.18_5" = "You can customize up to 6 backgrounds.";
"1.0.18_6" = "You can only upload up to 6 images at a time as a custom background. Once the background is created, it cannot be canceled. We will review the uploaded background within 24 hours. If the background is rejected, you will receive a refund of coins.";
"1.0.18_6" = "You can only upload up to 6 images at a time as a custom background. \nOnce the background is created, it cannot be canceled. \nWe will review the uploaded background within 24 hours. \nIf the background is rejected, you will receive a refund of coins.";
"1.0.18_7" = "Expired";
"1.0.18_8" = "Days";
"1.0.18_9" = "Buy";
@@ -3786,3 +3786,9 @@
"1.0.18_22" = "Congratulations! Your background has been reviewed. Now you can immediately personalize your room with the new background.";
"1.0.18_23" = "Sorry, your background has not been reviewed. Please upload a new background again.";
"1.0.18_24" = "Buy background";
"1.0.18_25" = "Do Not Disturb";
"1.0.18_26" = "You and the other are no friend, so you cannot chat privately.";
"1.0.18_27" = "Be %@ without any relationship, you can chat with users privately for free every day,try it?";
"1.0.18_28" = "Be %@, you can get %@ quotas every day, chat privately with users for free, try it?";
"1.0.18_29" = "You have chatted with 1,000 people today, please try again tomorrow.";
"1.0.18_30" = "Be VIP%@";

View File

@@ -3553,7 +3553,7 @@
"1.0.18_3" = "Özel";
"1.0.18_4" = "Yeni oluştur";
"1.0.18_5" = "En fazla 6 arka planı özelleştirebilirsiniz.";
"1.0.18_6" = "Özel arka plan olarak aynı anda en fazla 6 resim yükleyebilirsiniz. Arka plan oluşturulduktan sonra iptal edilemez. Yüklenen arka planı 24 saat içinde inceleyeceğiz. Arka plan reddedilirse, jeton iadesi alacaksınız.";
"1.0.18_6" = "Özel arka plan olarak aynı anda en fazla 6 resim yükleyebilirsiniz. \nArka plan oluşturulduktan sonra iptal edilemez. \nYüklenen arka planı 24 saat içinde inceleyeceğiz. \nArka plan reddedilirse, jeton iadesi alacaksınız.";
"1.0.18_7" = "Süresi doldu";
"1.0.18_8" = "Günler";
"1.0.18_9" = "Satın Al";
@@ -3572,3 +3572,9 @@
"1.0.18_22" = "Tebrikler! Arka planınız incelendi. Artık odanızı yeni arka planla hemen kişiselleştirebilirsiniz.";
"1.0.18_23" = "Üzgünüz, arka planınız incelenmedi. Lütfen tekrar yeni bir arka plan yükleyin.";
"1.0.18_24" = "Arkaplan satın al";
"1.0.18_25" = "Rahatsız Etmeyin";
"1.0.18_26" = "Sen ve diğerleri arkadaş değilsiniz, bu yüzden özel sohbet edemezsiniz.";
"1.0.18_27" = "Hiçbir ilişkiniz olmadan %@ olun, kullanıcılarla her gün ücretsiz olarak özel olarak sohbet edebilirsiniz, dener misiniz?";
"1.0.18_28" = "%@ olun, her gün %@ kota alabilirsiniz, kullanıcılarla özel olarak ücretsiz sohbet edebilirsiniz, dener misiniz?";
"1.0.18_29" = "Bugün 1000 kişiyle sohbet ettiniz, lütfen yarın tekrar deneyin.";
"1.0.18_30" = "VIP%@ olun";

View File

@@ -3423,7 +3423,7 @@
"1.0.18_3" = "自定義";
"1.0.18_4" = "創造新的";
"1.0.18_5" = "您最多可以自定義 6 個背景。";
"1.0.18_6" = "您一次最多只能上传 6 张图片作为自定义背景。 背景一旦创建,就无法取消。 我们将在 24 小时内审核上传的背景。 如果背景被拒绝,您将收到金币退款。";
"1.0.18_6" = "您一次最多只能上传 6 张图片作为自定义背景。\n 背景一旦创建,就无法取消。\n我们将在 24 小时内审核上传的背景。\n 如果背景被拒绝,您将收到金币退款。";
"1.0.18_7" = "過期";
"1.0.18_8" = "天";
"1.0.18_9" = "買";
@@ -3443,3 +3443,9 @@
"1.0.18_22" = "恭喜!您的背景已被審查。現在您可以立即使用新背景來個性化您的房間。";
"1.0.18_23" = "抱歉,您的背景尚未經過審核。請重新上傳新背景。";
"1.0.18_24" = "购买背景";
"1.0.18_25" = "請勿打擾";
"1.0.18_26" = "你和對方不是朋友,所以不能私聊。";
"1.0.18_27" = "成為%@,不用任何關係,每天都可以免費與用戶私聊,試試看嗎?";
"1.0.18_28" = "成為%@,每天可獲得%@個配額,免費與用戶私聊,試試看嗎?";
"1.0.18_29" = "你今天已經與1000人聊天請明天再試。";
"1.0.18_30" = "成為VIP%@";