1.0.19 feat:个性化房间背景-free 部分 / 首页支持 API 更新 UI
This commit is contained in:
21
YuMi/Assets.xcassets/1.0.18/gift_banner_room.imageset/Contents.json
vendored
Normal file
21
YuMi/Assets.xcassets/1.0.18/gift_banner_room.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "切图 54@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
YuMi/Assets.xcassets/1.0.18/gift_banner_room.imageset/切图 54@3x.png
vendored
Normal file
BIN
YuMi/Assets.xcassets/1.0.18/gift_banner_room.imageset/切图 54@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 611 B |
@@ -13,9 +13,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
+ (instancetype)shareConfig;
|
||||
///初始化
|
||||
- (void)clientInit;
|
||||
//TODO: 直接使用model吧 下个版本改
|
||||
|
||||
/// iOS第三方登录是否需要绑定手机号
|
||||
@property (nonatomic,assign) BOOL iOSPhoneBind;;
|
||||
@property (nonatomic,assign) BOOL iOSPhoneBind;
|
||||
/// 是否开启了糖果树
|
||||
@property (nonatomic,assign) BOOL openCandyTree;
|
||||
///配置信息
|
||||
@@ -43,6 +43,22 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)addHeartBratTimer;
|
||||
///重置心跳定时器
|
||||
- (void)resetHeartBratTimer;
|
||||
|
||||
|
||||
- (UIColor *)bgColor;
|
||||
- (UIImage *)navBGImage;
|
||||
- (UIImage *)tabbarBGImage;
|
||||
- (NSString *)tabName:(NSInteger)tabIndex;
|
||||
- (NSString *)tabNormalImage:(NSInteger)tabIndex;
|
||||
- (NSString *)tabSelectedImage:(NSInteger)tabIndex;
|
||||
|
||||
@property (nonatomic, copy) NSString *reloadNavigationAreaImageKey;
|
||||
@property (nonatomic, strong) UIImage *navigationAreaBG;
|
||||
|
||||
@property (nonatomic, copy) void(^updateTabbarBG)(UIImage *image);
|
||||
@property (nonatomic, copy) void(^updateNormalTabImage)(UIImage *normalImage, NSInteger index);
|
||||
@property (nonatomic, copy) void(^updateSelectedTabImage)(UIImage *selectImage, NSInteger index);
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -23,18 +23,27 @@
|
||||
}
|
||||
///重试的次数 10次 如果你还是失败的话 那就算了 没办法了
|
||||
@property (nonatomic,assign) int retryCount;
|
||||
|
||||
@property (nonatomic, strong) NSMutableArray *normalTabImageSource;
|
||||
@property (nonatomic, strong) NSMutableArray *selectedTabImageSource;
|
||||
@property (nonatomic, strong) NetImageView *normalTabImageLoader;
|
||||
@property (nonatomic, strong) NetImageView *selectedTabImageLoader;
|
||||
@property (nonatomic, strong) NetImageView *tabbarBGImageLoader;
|
||||
@property (nonatomic, strong) NetImageView *navigationAreaBGImageLoader;
|
||||
|
||||
@end
|
||||
|
||||
@implementation ClientConfig
|
||||
|
||||
+ (instancetype)shareConfig {
|
||||
static dispatch_once_t onceToken;
|
||||
static ClientConfig * config;
|
||||
dispatch_once(&onceToken, ^{
|
||||
config = [[ClientConfig alloc] init];
|
||||
static dispatch_once_t onceToken;
|
||||
static ClientConfig * config;
|
||||
dispatch_once(&onceToken, ^{
|
||||
config = [[ClientConfig alloc] init];
|
||||
config.isTF = [ClientConfig isTestFlight];
|
||||
});
|
||||
return config;
|
||||
config.reloadNavigationAreaImageKey = @"今天光线很好";
|
||||
});
|
||||
return config;
|
||||
}
|
||||
|
||||
+(BOOL)isTestFlight{
|
||||
@@ -43,34 +52,37 @@
|
||||
BOOL isTestFlight = ([receiptURLString containsString:@"sandboxReceipt"] || [receiptURLString containsString:@"_MASReceipt/receipt"]);
|
||||
return isTestFlight;
|
||||
}
|
||||
|
||||
- (void)clientInit {
|
||||
@kWeakify(self);
|
||||
[Api clientInitConfig:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
[Api clientInitConfig:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
if (code == 200) {
|
||||
self.retryCount = 0;
|
||||
NSDictionary * initData = data.data;
|
||||
self.iOSPhoneBind = [initData[@"iosPhoneBind"] boolValue];
|
||||
//糖果树配置
|
||||
self.openCandyTree = [initData[@"openBoxSwitch"] boolValue];
|
||||
self.openCandyTreeLimitLevel = [initData[@"openBoxSwitchLevelNo"] intValue];
|
||||
ClientDataModel * model = [ClientDataModel modelWithDictionary:data.data];
|
||||
self.configInfo = model;
|
||||
if (code == 200) {
|
||||
self.retryCount = 0;
|
||||
|
||||
ClientDataModel * model = [ClientDataModel modelWithDictionary:data.data];
|
||||
|
||||
self.iOSPhoneBind = model.iosPhoneBind;
|
||||
|
||||
//糖果树配置
|
||||
self.openCandyTree = model.openBoxSwitch;
|
||||
self.openCandyTreeLimitLevel = model.openBoxSwitchLevelNo;
|
||||
|
||||
//表情包
|
||||
NSString *json = initData[@"faceJson"][@"json"];
|
||||
NSString *json = model.faceJson.json;
|
||||
NSString *deJson = [DESEncrypt decryptUseDES:json key:KeyWithType(KeyType_FacePwdEncode)];
|
||||
NSDictionary *faceInitData = [deJson toJSONObject];
|
||||
model.faceInitData = faceInitData;
|
||||
model.faceInitData = faceInitData;
|
||||
if (faceInitData) {
|
||||
[XPRoomFaceTool shareFaceTool].version = [NSString stringWithFormat:@"%@",faceInitData[@"version"]];
|
||||
[XPRoomFaceTool shareFaceTool].zipMd5 = [[NSString stringWithFormat:@"%@",faceInitData[@"zipMd5"]] uppercaseString];
|
||||
[XPRoomFaceTool shareFaceTool].zipUrl = [NSString stringWithFormat:@"%@",faceInitData[@"zipUrl"]];
|
||||
///表情的数据保存本地
|
||||
[[XPRoomFaceTool shareFaceTool] saveFaceInfoList:faceInitData];
|
||||
///开始下载
|
||||
[[XPRoomFaceTool shareFaceTool] downFaceData];
|
||||
///表情的数据保存本地
|
||||
[[XPRoomFaceTool shareFaceTool] saveFaceInfoList:faceInitData];
|
||||
///开始下载
|
||||
[[XPRoomFaceTool shareFaceTool] downFaceData];
|
||||
}
|
||||
NSString *trtcAppId = [NSString stringWithFormat:@"%@",initData[@"trtcAppId"]];
|
||||
NSString *trtcAppId = @(model.trtcAppId).stringValue;
|
||||
NSString *curTtcKey = [[NSUserDefaults standardUserDefaults]valueForKey:@"kTrtcAppId"];
|
||||
if(curTtcKey == nil){
|
||||
if(trtcAppId != nil){
|
||||
@@ -85,21 +97,206 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
//是否展示公屏
|
||||
NSString *serverVer = initData[@"appStoreAuditNoticeVersion"];
|
||||
NSString *shortVer = [YYUtility appVersion];
|
||||
BOOL isHigh = [NSString versionCompareOldStr:serverVer andNewStr:shortVer];
|
||||
model.appStoreAuditNoticeVersion = isHigh;
|
||||
self.configInfo = model;
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"reloadnewtab" object:nil];
|
||||
//是否展示公屏
|
||||
NSString *serverVer = model.appStoreAuditNoticeVersion;
|
||||
NSString *shortVer = [YYUtility appVersion];
|
||||
model.hideNoticeVersion = [NSString versionCompareOldStr:serverVer andNewStr:shortVer];
|
||||
|
||||
} else {
|
||||
if (self.retryCount < 10) {
|
||||
[self clientInit];
|
||||
self.retryCount+=1;
|
||||
}
|
||||
}
|
||||
}];
|
||||
self.configInfo = model;
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"reloadAfterLoadConfig" object:nil];
|
||||
|
||||
[self prepareCustomUI];
|
||||
|
||||
} else {
|
||||
if (self.retryCount < 10) {
|
||||
[self clientInit];
|
||||
self.retryCount+=1;
|
||||
}
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)prepareCustomUI {
|
||||
NSArray *defaultArray = @[@"", @"", @"", @"", @""];
|
||||
self.normalTabImageSource = defaultArray.mutableCopy;
|
||||
self.selectedTabImageSource = defaultArray.mutableCopy;
|
||||
|
||||
#if DEBUG
|
||||
self.configInfo.appUiSetting.homeSelectIcon = @"https://cdn-icons-png.flaticon.com/128/18174/18174161.png";
|
||||
self.configInfo.appUiSetting.homeUnSelectIcon = @"";
|
||||
self.configInfo.appUiSetting.gameSelectIcon = @"";
|
||||
self.configInfo.appUiSetting.gameUnSelectIcon = @"https://cdn-icons-png.flaticon.com/128/18174/18174164.png";
|
||||
self.configInfo.appUiSetting.dynamicSelectIcon = @"https://cdn-icons-png.flaticon.com/128/18174/18174165.png";
|
||||
self.configInfo.appUiSetting.dynamicUnSelectIcon = @"https://cdn-icons-png.flaticon.com/128/18174/18174166.png";
|
||||
self.configInfo.appUiSetting.msgSelectIcon = @"";
|
||||
self.configInfo.appUiSetting.msgUnSelectIcon = @"https://cdn-icons-png.flaticon.com/128/18174/18174168.png";
|
||||
self.configInfo.appUiSetting.mineSelectIcon = @"https://cdn-icons-png.flaticon.com/128/18174/18174169.png";
|
||||
self.configInfo.appUiSetting.mineUnSelectIcon = @" ";
|
||||
|
||||
self.configInfo.appUiSetting.headIcon = @"https://wx1.moyu.im/mw2000/4e093a49ly1hvbccotkj8j23jm2g8e84.jpg";
|
||||
self.configInfo.appUiSetting.navbar = @"https://wx2.moyu.im/mw600/008ElFOcly1hvbe8wq5tkj318g0totuv.jpg";
|
||||
|
||||
self.configInfo.appUiSetting.settingStatus = arc4random()%2;
|
||||
|
||||
#endif
|
||||
|
||||
if (self.configInfo && self.configInfo.appUiSetting && self.configInfo.appUiSetting.settingStatus == 1) {
|
||||
NSArray *unselectIcons = @[
|
||||
self.configInfo.appUiSetting.homeUnSelectIcon ?: @"",
|
||||
self.configInfo.appUiSetting.gameUnSelectIcon ?: @"",
|
||||
self.configInfo.appUiSetting.dynamicUnSelectIcon ?: @"",
|
||||
self.configInfo.appUiSetting.msgUnSelectIcon ?: @"",
|
||||
self.configInfo.appUiSetting.mineUnSelectIcon ?: @""
|
||||
];
|
||||
|
||||
NSArray *selectIcons = @[
|
||||
self.configInfo.appUiSetting.homeSelectIcon ?: @"",
|
||||
self.configInfo.appUiSetting.gameSelectIcon ?: @"",
|
||||
self.configInfo.appUiSetting.dynamicSelectIcon ?: @"",
|
||||
self.configInfo.appUiSetting.msgSelectIcon ?: @"",
|
||||
self.configInfo.appUiSetting.mineSelectIcon ?: @""
|
||||
];
|
||||
|
||||
self.normalTabImageSource = unselectIcons.mutableCopy;
|
||||
self.selectedTabImageSource = selectIcons.mutableCopy;
|
||||
|
||||
[self loadNavigationAreaBG];
|
||||
[self loadTabbarBG];
|
||||
} else {
|
||||
if (self.updateTabbarBG) {
|
||||
self.updateTabbarBG(kImage(@"tab_bar_bg"));
|
||||
}
|
||||
}
|
||||
|
||||
[self loadNormalTabImage:0];
|
||||
[self loadSelectedTabImage:0];
|
||||
}
|
||||
|
||||
- (UIImage *)navigationAreaBG {
|
||||
if (!_navigationAreaBG) {
|
||||
return kImage(@"home_top_bg");
|
||||
} else {
|
||||
return _navigationAreaBG;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)loadNavigationAreaBG {
|
||||
if (!_navigationAreaBGImageLoader) {
|
||||
_navigationAreaBGImageLoader = [[NetImageView alloc] init];
|
||||
}
|
||||
|
||||
@kWeakify(self);
|
||||
[self.navigationAreaBGImageLoader loadImageWithUrl:self.configInfo.appUiSetting.headIcon
|
||||
completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
|
||||
@kStrongify(self);
|
||||
self.navigationAreaBG = image;
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:self.reloadNavigationAreaImageKey object:[image resizeTo:CGSizeMake(1125, 420)]];
|
||||
} fail:^(NSError * _Nonnull error) {}];
|
||||
}
|
||||
|
||||
- (void)loadTabbarBG {
|
||||
|
||||
if (!_tabbarBGImageLoader) {
|
||||
_tabbarBGImageLoader = [[NetImageView alloc] init];
|
||||
}
|
||||
|
||||
@kWeakify(self);
|
||||
[self.tabbarBGImageLoader loadImageWithUrl:self.configInfo.appUiSetting.navbar
|
||||
completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
|
||||
@kStrongify(self);
|
||||
if (self.updateTabbarBG) {
|
||||
self.updateTabbarBG(image);
|
||||
}
|
||||
} fail:^(NSError * _Nonnull error) {
|
||||
@kStrongify(self);
|
||||
if (self.updateTabbarBG) {
|
||||
self.updateTabbarBG(kImage(@"tab_bar_bg"));
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)loadNormalTabImage:(NSInteger)index {
|
||||
if (index >= self.normalTabImageSource.count) {
|
||||
return;
|
||||
}
|
||||
|
||||
NSString *normalURLString = self.normalTabImageSource[index];
|
||||
if ([normalURLString isEmpty]) {
|
||||
self.updateNormalTabImage([UIImage imageNamed:[self tabNormalImage:index]], index);
|
||||
[self loadNormalTabImage:index + 1];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
dispatch_group_t downloadGroup = dispatch_group_create();
|
||||
__block UIImage *normalImage = nil;
|
||||
|
||||
if (!self.normalTabImageLoader) {
|
||||
self.normalTabImageLoader = [[NetImageView alloc] init];
|
||||
}
|
||||
|
||||
dispatch_group_enter(downloadGroup);
|
||||
[self.normalTabImageLoader loadImageWithUrl:normalURLString
|
||||
completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
|
||||
normalImage = image;
|
||||
dispatch_group_leave(downloadGroup);
|
||||
}
|
||||
fail:^(NSError * _Nonnull error) {
|
||||
dispatch_group_leave(downloadGroup);
|
||||
}];
|
||||
|
||||
// 当两个图片都下载完成后回调
|
||||
@kWeakify(self);
|
||||
dispatch_group_notify(downloadGroup, dispatch_get_main_queue(), ^{
|
||||
@kStrongify(self);
|
||||
if (normalImage && self.updateNormalTabImage) {
|
||||
self.updateNormalTabImage([normalImage resizeTo:CGSizeMake(25, 25)],
|
||||
index);
|
||||
}
|
||||
[self loadNormalTabImage:index + 1];
|
||||
});
|
||||
}
|
||||
|
||||
- (void)loadSelectedTabImage:(NSInteger)index {
|
||||
if (index >= self.selectedTabImageSource.count) {
|
||||
return;
|
||||
}
|
||||
|
||||
NSString *selectedURLString = self.selectedTabImageSource[index];
|
||||
if ([selectedURLString isEmpty]) {
|
||||
self.updateSelectedTabImage([UIImage imageNamed:[self tabSelectedImage:index]], index);
|
||||
[self loadSelectedTabImage:index + 1];
|
||||
return;
|
||||
}
|
||||
|
||||
dispatch_group_t downloadGroup = dispatch_group_create();
|
||||
__block UIImage *selectedImage = nil;
|
||||
|
||||
if (!self.selectedTabImageLoader) {
|
||||
self.selectedTabImageLoader = [[NetImageView alloc] init];
|
||||
}
|
||||
|
||||
dispatch_group_enter(downloadGroup);
|
||||
[self.selectedTabImageLoader loadImageWithUrl:selectedURLString
|
||||
completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
|
||||
selectedImage = image;
|
||||
dispatch_group_leave(downloadGroup);
|
||||
}
|
||||
fail:^(NSError * _Nonnull error) {
|
||||
dispatch_group_leave(downloadGroup);
|
||||
}];
|
||||
|
||||
// 当两个图片都下载完成后回调
|
||||
@kWeakify(self);
|
||||
dispatch_group_notify(downloadGroup, dispatch_get_main_queue(), ^{
|
||||
@kStrongify(self);
|
||||
if (selectedImage && self.updateSelectedTabImage) {
|
||||
self.updateSelectedTabImage([selectedImage resizeTo:CGSizeMake(25, 25)],
|
||||
index);
|
||||
}
|
||||
[self loadSelectedTabImage:index + 1];
|
||||
});
|
||||
}
|
||||
|
||||
- (void)addHeartBratTimer {
|
||||
@@ -120,4 +317,51 @@
|
||||
}
|
||||
|
||||
|
||||
- (UIColor *)bgColor {
|
||||
if (self.configInfo && self.configInfo.appUiSetting.settingStatus == 1) {
|
||||
|
||||
}
|
||||
|
||||
return [DJDKMIMOMColor colorWithHexString:@"#FCF4DF"];
|
||||
}
|
||||
- (UIImage *)navBGImage {
|
||||
if (self.configInfo && self.configInfo.appUiSetting.settingStatus == 1) {
|
||||
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (UIImage *)tabbarBGImage {
|
||||
if (self.configInfo && self.configInfo.appUiSetting.settingStatus == 1) {
|
||||
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSString *)tabName:(NSInteger)tabIndex {
|
||||
return @[YMLocalizedString(@"TabbarViewController2"),
|
||||
YMLocalizedString(@"TabbarViewController6"),
|
||||
YMLocalizedString(@"TabbarViewController3"),
|
||||
YMLocalizedString(@"TabbarViewController4"),
|
||||
YMLocalizedString(@"TabbarViewController5")][tabIndex];
|
||||
}
|
||||
|
||||
- (NSString *)tabNormalImage:(NSInteger)tabIndex {
|
||||
return @[@"tab_gameHome_normal",
|
||||
@"tab_gameHome_game_normal",
|
||||
@"tab_monents_normal",
|
||||
@"tab_message_normal",
|
||||
@"tab_mine_normal"][tabIndex];
|
||||
}
|
||||
|
||||
- (NSString *)tabSelectedImage:(NSInteger)tabIndex {
|
||||
return @[@"tab_gameHome_selected",
|
||||
@"tab_gameHome_game_selected",
|
||||
@"tab_monents_select",
|
||||
@"tab_message_selected",
|
||||
@"tab_mine_selected"][tabIndex];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -16,13 +16,48 @@ typedef NS_ENUM(NSInteger, FaceLivenessStrategy) {
|
||||
FaceLivenessStrategy_Guide = 2,
|
||||
};
|
||||
|
||||
@interface FaceJson : PIBaseModel
|
||||
|
||||
@property (nonatomic, assign) NSInteger status;
|
||||
@property (nonatomic, assign) NSInteger id;
|
||||
@property (nonatomic, assign) NSTimeInterval createTime;
|
||||
@property (nonatomic, copy) NSString *json;
|
||||
@property (nonatomic, assign) NSInteger version;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface AppUISetting : PIBaseModel
|
||||
|
||||
@property (nonatomic, assign) NSInteger settingStatus;
|
||||
|
||||
@property (nonatomic, copy) NSString *headIcon;
|
||||
@property (nonatomic, copy) NSString *navbar;
|
||||
@property (nonatomic, copy) NSString *backgroundColor;
|
||||
@property (nonatomic, copy) NSString *homeSelectIcon;
|
||||
@property (nonatomic, copy) NSString *homeUnSelectIcon;
|
||||
@property (nonatomic, copy) NSString *gameSelectIcon;
|
||||
@property (nonatomic, copy) NSString *gameUnSelectIcon;
|
||||
@property (nonatomic, copy) NSString *dynamicSelectIcon;
|
||||
@property (nonatomic, copy) NSString *dynamicUnSelectIcon;
|
||||
@property (nonatomic, copy) NSString *msgSelectIcon;
|
||||
@property (nonatomic, copy) NSString *msgUnSelectIcon;
|
||||
@property (nonatomic, copy) NSString *mineSelectIcon;
|
||||
@property (nonatomic, copy) NSString *mineUnSelectIcon;
|
||||
@property (nonatomic, copy) NSString *selectBar;
|
||||
|
||||
@end
|
||||
|
||||
@interface ClientDataModel : PIBaseModel
|
||||
|
||||
@property (nonatomic, strong) AppUISetting *appUiSetting;
|
||||
|
||||
///首页tag 配置
|
||||
@property (nonatomic,strong) NSArray<NSString *> *homeTabList;
|
||||
///房间表情的数据
|
||||
@property (nonatomic,copy) NSDictionary *faceInitData;
|
||||
///是否隐藏房间公告
|
||||
@property (nonatomic,assign) BOOL appStoreAuditNoticeVersion;
|
||||
@property (nonatomic,assign) BOOL hideNoticeVersion;
|
||||
//进入房间拉取N条聊天数据
|
||||
@property(nonatomic, assign) NSInteger roomMessageCount;
|
||||
///发现萌新展示等级
|
||||
@@ -61,6 +96,16 @@ typedef NS_ENUM(NSInteger, FaceLivenessStrategy) {
|
||||
///转赠手续费率
|
||||
@property (nonatomic,assign) double giveDiamondRate;
|
||||
|
||||
@property (nonatomic, assign) BOOL iosPhoneBind;
|
||||
@property (nonatomic, assign) BOOL openBoxSwitch;
|
||||
@property (nonatomic, assign) NSInteger openBoxSwitchLevelNo;
|
||||
|
||||
@property (nonatomic, strong) FaceJson *faceJson;
|
||||
|
||||
@property (nonatomic, assign) NSInteger trtcAppId;
|
||||
|
||||
@property (nonatomic, copy) NSString *appStoreAuditNoticeVersion;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -7,6 +7,15 @@
|
||||
|
||||
#import "ClientDataModel.h"
|
||||
#import "XPAdImageTool.h"
|
||||
|
||||
@implementation FaceJson
|
||||
|
||||
@end
|
||||
|
||||
@implementation AppUISetting
|
||||
|
||||
@end
|
||||
|
||||
@implementation ClientDataModel
|
||||
|
||||
- (void)setSplashVo:(AdvertiseModel *)splashVo {
|
||||
@@ -17,4 +26,5 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
@@ -43,8 +43,8 @@ typedef NS_ENUM(NSUInteger, GradientType) {
|
||||
+ (UIImage *)waterImageWithImage:(UIImage *)image waterImage:(UIImage *)waterImage waterImageRect:(CGRect)rect;
|
||||
|
||||
+ (CGSize)sizeWithImageOriginSize:(CGSize)originSize
|
||||
minSize:(CGSize)imageMinSize
|
||||
maxSize:(CGSize)imageMaxSize;
|
||||
minSize:(CGSize)imageMinSize
|
||||
maxSize:(CGSize)imageMaxSize;
|
||||
|
||||
///裁剪图片
|
||||
- (UIImage *)cutImage:(CGSize)newSize;
|
||||
@@ -57,4 +57,7 @@ typedef NS_ENUM(NSUInteger, GradientType) {
|
||||
+ (NSString *)getImageTypeWithImageData: (NSData *)data;
|
||||
+(UIImage *)getLanguageImage:(NSString *)image;
|
||||
+(NSString *)getLanguageText:(NSString *)image;
|
||||
|
||||
- (UIImage *)resizeTo:(CGSize)size;
|
||||
|
||||
@end
|
||||
|
@@ -364,6 +364,13 @@
|
||||
return scaleImage;
|
||||
}
|
||||
|
||||
- (UIImage *)resizeTo:(CGSize)size {
|
||||
UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:size];
|
||||
return [renderer imageWithActions:^(UIGraphicsImageRendererContext * _Nonnull context) {
|
||||
[self drawInRect:CGRectMake(0, 0, size.width, size.height)];
|
||||
}];
|
||||
}
|
||||
|
||||
- (UIImage *)cropRightAndBottomPixels:(NSUInteger)pixels {
|
||||
// 获取原图像的大小
|
||||
CGSize originalSize = self.size;
|
||||
|
@@ -110,7 +110,7 @@
|
||||
@kWeakify(self);
|
||||
[self sd_setImageWithURL:[NSURL URLWithString:self.innerConfigUrl]
|
||||
placeholderImage:self.config.placeHolder
|
||||
options:SDWebImageRetryFailed
|
||||
options:SDWebImageRetryFailed | SDWebImageQueryMemoryData | SDWebImageQueryDiskDataSync
|
||||
completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
|
||||
@kStrongify(self);
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
|
@@ -55,9 +55,6 @@
|
||||
} access_token:accountModel.access_token issue_type:@"multi"];
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
dispatch_group_notify(group, dispatch_get_main_queue(), ^{
|
||||
[XNDJTDDLoadingTool hideOnlyView:VC.view];
|
||||
if ([[AccountInfoStorage instance] getTicket].length <= 0 || userInfo == nil) {
|
||||
|
@@ -125,7 +125,7 @@ typedef NS_ENUM(NSUInteger, CustomMessageType) {
|
||||
///通用飘屏
|
||||
CustomMessageType_General_Floating_Screen = 107,
|
||||
///聊天大厅上头条
|
||||
CustomMessageType_Chat_Hall_Headlinesn = 108,
|
||||
CustomMessageType_Chat_Hall_Headlines = 108,
|
||||
///游戏
|
||||
CustomMessageType_Chat_Room_Game = 109,
|
||||
///家族新协议
|
||||
@@ -136,6 +136,9 @@ typedef NS_ENUM(NSUInteger, CustomMessageType) {
|
||||
|
||||
///游戏陪玩开黑
|
||||
CustomMessageType_Game_Order = 112,
|
||||
|
||||
///房間背景更新
|
||||
CustomMessageType_Custom_Room_Background = 113,
|
||||
};
|
||||
|
||||
|
||||
@@ -682,10 +685,10 @@ typedef NS_ENUM(NSUInteger, CustomMessageTypeGeneralFloatingScreen) {
|
||||
Custom_Message_Sub_General_Floating_Screen_All_Room = 1072,//全部房间
|
||||
};
|
||||
///聊天大厅上头条
|
||||
//CustomMessageType_Chat_Hall_Headlinesn = 108,
|
||||
typedef NS_ENUM(NSUInteger, CustomMessageTypeChatHallHeadlinesn) {
|
||||
//CustomMessageType_Chat_Hall_Headlines = 108,
|
||||
typedef NS_ENUM(NSUInteger, CustomMessageTypeChatHallHeadlines) {
|
||||
///所有房间
|
||||
Custom_Message_Sub_Chat_Hall_Headlinesn = 1081,//单房间
|
||||
Custom_Message_Sub_Chat_Hall_Headlines = 1081,//单房间
|
||||
|
||||
};
|
||||
//CustomMessageType_Chat_Room_Game = 109,
|
||||
@@ -728,6 +731,12 @@ typedef NS_ENUM(NSUInteger, CustomMessageTypeCPGift) {
|
||||
Custom_Message_Sub_CP_Binding = 643, // 绑定
|
||||
};
|
||||
|
||||
///开黑邀请
|
||||
typedef NS_ENUM(NSUInteger, CustomMessageTypeCustomRoomBackground) {
|
||||
///所有房间
|
||||
Custom_Message_Sub_Custom_Room_Background = 1131
|
||||
};
|
||||
|
||||
@interface AttachmentModel : PIBaseModel<NIMCustomAttachment>
|
||||
|
||||
@property (nonatomic, strong) id data;
|
||||
|
@@ -25,7 +25,6 @@
|
||||
@property (nonatomic, strong) JXPagerView *pagingView;
|
||||
@property (nonatomic, strong) NSArray<NSString *> *titles;
|
||||
@property (nonatomic,strong) UIView *headView;
|
||||
@property (nonatomic,strong) UIImageView *headBgImageView;
|
||||
|
||||
@property (nonatomic,strong) SessionListViewController *sessionListVC;
|
||||
///好友
|
||||
@@ -46,7 +45,7 @@
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
[self setupTopTheme];
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
@@ -58,24 +57,35 @@
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
|
||||
- (void)setupTopTheme {
|
||||
__block UIImageView *theme = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, kGetScaleWidth(140))];
|
||||
theme.image = [[ClientConfig shareConfig] navigationAreaBG];// [UIImage imageNamed:@"home_top_bg"];
|
||||
theme.contentMode = UIViewContentModeScaleAspectFit;
|
||||
[self.view addSubview:theme];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:[ClientConfig shareConfig].reloadNavigationAreaImageKey
|
||||
object:nil
|
||||
queue:[NSOperationQueue mainQueue]
|
||||
usingBlock:^(NSNotification * _Nonnull notification) {
|
||||
if ([notification.object isKindOfClass:[UIImage class]]) {
|
||||
theme.image = (UIImage *)notification.object;
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)initSubViews {
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(getTabBarItemBadge:)
|
||||
name:@"kGetTabBarItemBadge"
|
||||
object:nil];
|
||||
|
||||
self.view.backgroundColor = [DJDKMIMOMColor colorWithHexString:@"#FCF4DF"];
|
||||
self.view.backgroundColor = [[ClientConfig shareConfig] bgColor];
|
||||
|
||||
self.headView = [UIView new];
|
||||
|
||||
[self.view addSubview:self.headBgImageView];
|
||||
[self.view addSubview:self.pagingView];
|
||||
}
|
||||
- (void)initSubViewConstraints {
|
||||
[self.headBgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.top.trailing.equalTo(self.view);
|
||||
make.height.mas_equalTo(kGetScaleWidth(140));
|
||||
}];
|
||||
|
||||
[self.pagingView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.trailing.equalTo(self.view);
|
||||
@@ -207,13 +217,7 @@
|
||||
}
|
||||
return _pagingView;
|
||||
}
|
||||
-(UIImageView *)headBgImageView{
|
||||
if (!_headBgImageView){
|
||||
_headBgImageView = [UIImageView new];
|
||||
_headBgImageView.image = [UIImage imageNamed:@"home_top_bg"];
|
||||
}
|
||||
return _headBgImageView;
|
||||
}
|
||||
|
||||
- (XPMineAttentionViewController *)attentionVC {
|
||||
if (!_attentionVC) {
|
||||
_attentionVC = [[XPMineAttentionViewController alloc] init];
|
||||
|
@@ -111,7 +111,7 @@ UIKIT_EXTERN NSString *kRequestTicket;
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
self.view.backgroundColor = [DJDKMIMOMColor colorWithHexString:@"#FCF4DF"];
|
||||
self.view.backgroundColor = [[ClientConfig shareConfig] bgColor];
|
||||
[self setupTopTheme];
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
@@ -119,10 +119,19 @@ UIKIT_EXTERN NSString *kRequestTicket;
|
||||
}
|
||||
|
||||
- (void)setupTopTheme {
|
||||
UIImageView *theme = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, kGetScaleWidth(140))];
|
||||
theme.image = [UIImage imageNamed:@"home_top_bg"];
|
||||
__block UIImageView *theme = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, kGetScaleWidth(140))];
|
||||
theme.image = [[ClientConfig shareConfig] navigationAreaBG];// [UIImage imageNamed:@"home_top_bg"];
|
||||
theme.contentMode = UIViewContentModeScaleAspectFit;
|
||||
[self.view addSubview:theme];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:[ClientConfig shareConfig].reloadNavigationAreaImageKey
|
||||
object:nil
|
||||
queue:[NSOperationQueue mainQueue]
|
||||
usingBlock:^(NSNotification * _Nonnull notification) {
|
||||
if ([notification.object isKindOfClass:[UIImage class]]) {
|
||||
theme.image = (UIImage *)notification.object;
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
|
@@ -65,15 +65,24 @@
|
||||
}
|
||||
|
||||
- (void)setupTopTheme {
|
||||
UIImageView *theme = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, kGetScaleWidth(140))];
|
||||
theme.image = [UIImage imageNamed:@"home_top_bg"];
|
||||
__block UIImageView *theme = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, kGetScaleWidth(140))];
|
||||
theme.image = [[ClientConfig shareConfig] navigationAreaBG];// [UIImage imageNamed:@"home_top_bg"];
|
||||
theme.contentMode = UIViewContentModeScaleAspectFit;
|
||||
[self.view addSubview:theme];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:[ClientConfig shareConfig].reloadNavigationAreaImageKey
|
||||
object:nil
|
||||
queue:[NSOperationQueue mainQueue]
|
||||
usingBlock:^(NSNotification * _Nonnull notification) {
|
||||
if ([notification.object isKindOfClass:[UIImage class]]) {
|
||||
theme.image = (UIImage *)notification.object;
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.view.backgroundColor = [DJDKMIMOMColor colorWithHexString:@"#FCF4DF"];
|
||||
self.view.backgroundColor = [[ClientConfig shareConfig] bgColor];
|
||||
|
||||
[self.view addSubview:self.navView];
|
||||
[self.view addSubview:self.listContainerView];
|
||||
|
@@ -389,7 +389,7 @@
|
||||
}
|
||||
|
||||
- (NSUInteger)heightForPinSectionHeaderInPagerView:(JXPagerView *)pagerView {
|
||||
return kGetScaleWidth(50);
|
||||
return kGetScaleWidth(40);
|
||||
}
|
||||
|
||||
- (UIView *)viewForPinSectionHeaderInPagerView:(JXPagerView *)pagerView {
|
||||
@@ -486,12 +486,12 @@
|
||||
|
||||
_titleView.listContainer = (id<JXCategoryViewListContainer>)self.pagingView.listContainerView;
|
||||
|
||||
JXCategoryIndicatorImageView *indicator = [[JXCategoryIndicatorImageView alloc] init];
|
||||
indicator.indicatorImageView.image = [UIImage imageNamed:@"ms_login_choose_phone_icon"];
|
||||
indicator.indicatorImageViewSize = CGSizeMake(kGetScaleWidth(24), kGetScaleWidth(24));
|
||||
indicator.verticalMargin = -kGetScaleWidth(4);
|
||||
indicator.contentMode = UIViewContentModeScaleAspectFit;
|
||||
_titleView.indicators = @[indicator];
|
||||
// JXCategoryIndicatorImageView *indicator = [[JXCategoryIndicatorImageView alloc] init];
|
||||
// indicator.indicatorImageView.image = [UIImage imageNamed:@"ms_login_choose_phone_icon"];
|
||||
// indicator.indicatorImageViewSize = CGSizeMake(kGetScaleWidth(24), kGetScaleWidth(24));
|
||||
// indicator.verticalMargin = -kGetScaleWidth(4);
|
||||
// indicator.contentMode = UIViewContentModeScaleAspectFit;
|
||||
// _titleView.indicators = @[indicator];
|
||||
}
|
||||
return _titleView;
|
||||
}
|
||||
|
@@ -55,7 +55,7 @@
|
||||
|
||||
- (void)setup {
|
||||
|
||||
self.view.backgroundColor = [DJDKMIMOMColor colorWithHexString:@"#FCF4DF"];
|
||||
self.view.backgroundColor = [[ClientConfig shareConfig] bgColor];
|
||||
|
||||
[self setupTopTheme];
|
||||
[self setupTopControl];
|
||||
@@ -88,10 +88,19 @@
|
||||
}
|
||||
|
||||
- (void)setupTopTheme {
|
||||
UIImageView *theme = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, kGetScaleWidth(140))];
|
||||
theme.image = [UIImage imageNamed:@"home_top_bg"];
|
||||
__block UIImageView *theme = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, kGetScaleWidth(140))];
|
||||
theme.image = [[ClientConfig shareConfig] navigationAreaBG];// [UIImage imageNamed:@"home_top_bg"];
|
||||
theme.contentMode = UIViewContentModeScaleAspectFit;
|
||||
[self.view addSubview:theme];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:[ClientConfig shareConfig].reloadNavigationAreaImageKey
|
||||
object:nil
|
||||
queue:[NSOperationQueue mainQueue]
|
||||
usingBlock:^(NSNotification * _Nonnull notification) {
|
||||
if ([notification.object isKindOfClass:[UIImage class]]) {
|
||||
theme.image = (UIImage *)notification.object;
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setupTopControl {
|
||||
|
@@ -315,7 +315,7 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
|
||||
return self.headView;
|
||||
}
|
||||
- (NSUInteger)heightForPinSectionHeaderInPagerView:(JXPagerView *)pagerView {
|
||||
return kGetScaleWidth(50);
|
||||
return kGetScaleWidth(40);
|
||||
}
|
||||
- (UIView *)viewForPinSectionHeaderInPagerView:(JXPagerView *)pagerView {
|
||||
return self.titleView;
|
||||
@@ -533,12 +533,12 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
|
||||
|
||||
_titleView.listContainer = (id<JXCategoryViewListContainer>)self.pagingView.listContainerView;
|
||||
|
||||
JXCategoryIndicatorImageView * indicator = [[JXCategoryIndicatorImageView alloc] init];
|
||||
indicator.indicatorImageView.image = kImage(@"ms_login_choose_phone_icon");
|
||||
indicator.indicatorImageViewSize = CGSizeMake(kGetScaleWidth(24), kGetScaleWidth(24));
|
||||
indicator.verticalMargin = -kGetScaleWidth(4);
|
||||
indicator.contentMode = UIViewContentModeScaleAspectFit;
|
||||
_titleView.indicators = @[indicator];
|
||||
// JXCategoryIndicatorImageView * indicator = [[JXCategoryIndicatorImageView alloc] init];
|
||||
// indicator.indicatorImageView.image = kImage(@"ms_login_choose_phone_icon");
|
||||
// indicator.indicatorImageViewSize = CGSizeMake(kGetScaleWidth(24), kGetScaleWidth(24));
|
||||
// indicator.verticalMargin = -kGetScaleWidth(4);
|
||||
// indicator.contentMode = UIViewContentModeScaleAspectFit;
|
||||
// _titleView.indicators = @[indicator];
|
||||
}
|
||||
return _titleView;
|
||||
}
|
||||
|
@@ -17,8 +17,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic, assign) BOOL isCur;
|
||||
@property (nonatomic, assign) NSInteger remainHour;
|
||||
@property (nonatomic, copy) NSString *url;
|
||||
@property (nonatomic, copy) NSString *type;
|
||||
@property (nonatomic, copy) NSString *status;
|
||||
@property (nonatomic, assign) NSInteger type; // 0=免费,1=付费,2=自定义
|
||||
@property (nonatomic, assign) NSInteger status; // -1=过期,0=审核中,1=通过,2=不过审
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -22,7 +22,8 @@
|
||||
///礼物
|
||||
@property (nonatomic,strong) NetImageView *giftImageView;
|
||||
///礼物内容
|
||||
@property (nonatomic,strong) UILabel *giftContentLabel;
|
||||
@property (nonatomic,strong) UILabel *giftNameLabel;
|
||||
@property (nonatomic,strong) UILabel *giftCountLabel;
|
||||
///去围观
|
||||
@property(nonatomic,strong) UIButton *goButton;
|
||||
|
||||
@@ -40,20 +41,28 @@
|
||||
NSInteger height = kGetScaleWidth(110);
|
||||
NSInteger y = kStatusBarHeight;
|
||||
|
||||
RoomHighValueGiftBannerAnimation *banner = [[RoomHighValueGiftBannerAnimation alloc] initWithFrame:CGRectMake(KScreenWidth, y, KScreenWidth, height)];
|
||||
__block RoomHighValueGiftBannerAnimation *banner = [[RoomHighValueGiftBannerAnimation alloc] initWithFrame:CGRectMake(KScreenWidth, y, KScreenWidth, height)];
|
||||
banner.animationComplete = complete;
|
||||
|
||||
banner.senderScrollLabel.text = @"roomUidinteger($int64) (query)";
|
||||
banner.roomNameScrollLabel.text = @"roomUidinteger($int64) (query)";
|
||||
banner.giftNameLabel.text = @"yijgish";
|
||||
banner.giftCountLabel.text = @"x!0";
|
||||
|
||||
[superView addSubview:banner];
|
||||
|
||||
@kWeakify(banner);
|
||||
[UIView animateWithDuration:0.25 animations:^{
|
||||
banner.frame = CGRectMake(0, y, KScreenWidth, height);
|
||||
} completion:^(BOOL finished) {
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(112.5 * 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) {
|
||||
@kStrongify(banner);
|
||||
if (banner.animationComplete) {
|
||||
banner.animationComplete();
|
||||
}
|
||||
[banner removeFromSuperview];
|
||||
}];
|
||||
});
|
||||
@@ -101,6 +110,50 @@
|
||||
make.trailing.mas_equalTo(kGetScaleWidth(-106));
|
||||
make.size.mas_equalTo(CGSizeMake(46, 46));
|
||||
}];
|
||||
|
||||
[self addSubview:self.senderScrollLabel];
|
||||
[self.senderScrollLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(38);
|
||||
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);
|
||||
}];
|
||||
|
||||
[self addSubview:self.giftNameLabel];
|
||||
[self.giftNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.senderScrollLabel.mas_bottom).offset(4);
|
||||
make.leading.mas_equalTo(self.senderAvatarView.mas_trailing).offset(4);
|
||||
make.height.mas_equalTo(16);
|
||||
}];
|
||||
|
||||
[self addSubview:self.giftCountLabel];
|
||||
[self.giftCountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.giftNameLabel);
|
||||
make.leading.mas_equalTo(self.giftNameLabel.mas_trailing).offset(7);
|
||||
make.height.mas_equalTo(22);
|
||||
}];
|
||||
|
||||
UIImageView *room = [[UIImageView alloc] initWithImage:kImage(@"gift_banner_room")];
|
||||
[self addSubview:room];
|
||||
[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);
|
||||
}];
|
||||
|
||||
[self addSubview:self.roomNameScrollLabel];
|
||||
[self.roomNameScrollLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(room);
|
||||
make.leading.mas_equalTo(room.mas_trailing).offset(2);
|
||||
make.trailing.mas_equalTo(self).offset(-34);
|
||||
}];
|
||||
|
||||
[self addSubview:self.goButton];
|
||||
[self.goButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(self.giftImageView.mas_trailing).offset(8);
|
||||
make.top.mas_equalTo(self.roomNameScrollLabel.mas_bottom).offset(1);
|
||||
make.size.mas_equalTo(CGSizeMake(55, 20));
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
@@ -136,6 +189,7 @@
|
||||
if(!_senderScrollLabel){
|
||||
_senderScrollLabel = [[MarqueeLabel alloc] init];
|
||||
_senderScrollLabel.scrollDuration = 6.0;
|
||||
_senderScrollLabel.textColor = [UIColor whiteColor];
|
||||
_senderScrollLabel.fadeLength = 8.0f;
|
||||
_senderScrollLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
@@ -145,6 +199,7 @@
|
||||
- (MarqueeLabel *)roomNameScrollLabel{
|
||||
if(!_roomNameScrollLabel){
|
||||
_roomNameScrollLabel = [[MarqueeLabel alloc] init];
|
||||
_roomNameScrollLabel.textColor = [UIColor whiteColor];
|
||||
_roomNameScrollLabel.scrollDuration = 6.0;
|
||||
_roomNameScrollLabel.fadeLength = 8.0f;
|
||||
_roomNameScrollLabel.textAlignment = NSTextAlignmentCenter;
|
||||
@@ -165,13 +220,22 @@
|
||||
return _giftImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)giftContentLabel {
|
||||
if (!_giftContentLabel) {
|
||||
_giftContentLabel = [[UILabel alloc] init];
|
||||
_giftContentLabel.textColor = UIColorFromRGB(0xFFE468);
|
||||
_giftContentLabel.font = kFontHeavy(16);
|
||||
- (UILabel *)giftNameLabel {
|
||||
if (!_giftNameLabel) {
|
||||
_giftNameLabel = [[UILabel alloc] init];
|
||||
_giftNameLabel.textColor = UIColorFromRGB(0xFFE468);
|
||||
_giftNameLabel.font = kFontMedium(11);
|
||||
}
|
||||
return _giftContentLabel;
|
||||
return _giftNameLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)giftCountLabel {
|
||||
if (!_giftCountLabel) {
|
||||
_giftCountLabel = [[UILabel alloc] init];
|
||||
_giftCountLabel.textColor = UIColorFromRGB(0xFFE468);
|
||||
_giftCountLabel.font = kFontMedium(17);
|
||||
}
|
||||
return _giftCountLabel;
|
||||
}
|
||||
|
||||
- (UIButton *)goButton{
|
||||
|
@@ -7,14 +7,19 @@
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@class CustomRoomBGItemModel;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface CustomRoomBGCell : UICollectionViewCell
|
||||
|
||||
@property (nonatomic, assign) BOOL isSelectedCell;
|
||||
@property (nonatomic, copy) void(^handleTapPlayButton)(id obj);
|
||||
|
||||
+ (void)registerTo:(UICollectionView *)collectionView;
|
||||
+ (CustomRoomBGCell *)reuseFrom:(UICollectionView *)collectionView atIndexPath:(NSIndexPath *)indexPath;
|
||||
+ (CustomRoomBGCell *)reuseFrom:(UICollectionView *)collectionView
|
||||
model:(CustomRoomBGItemModel *)model
|
||||
atIndexPath:(NSIndexPath *)indexPath;
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -6,6 +6,7 @@
|
||||
//
|
||||
|
||||
#import "CustomRoomBGCell.h"
|
||||
#import "CustomRoomBGItemModel.h"
|
||||
|
||||
@interface CustomRoomBGCell ()
|
||||
|
||||
@@ -20,19 +21,31 @@
|
||||
@property (nonatomic, strong) UIButton *playButton;
|
||||
@property (nonatomic, strong) UIButton *trashButton;
|
||||
|
||||
@property (nonatomic, strong) CustomRoomBGItemModel *cellModel;
|
||||
|
||||
@end
|
||||
|
||||
@implementation CustomRoomBGCell
|
||||
|
||||
+ (void)registerTo:(UICollectionView *)collectionView {
|
||||
NSString *cellID_free = [NSString stringWithFormat:@"%@%@", NSStringFromClass([self class]), @(0)];
|
||||
NSString *cellID_pay = [NSString stringWithFormat:@"%@%@", NSStringFromClass([self class]), @(1)];
|
||||
NSString *cellID_custom = [NSString stringWithFormat:@"%@%@", NSStringFromClass([self class]), @(2)];
|
||||
[collectionView registerClass:[self class]
|
||||
forCellWithReuseIdentifier:NSStringFromClass([self class])];
|
||||
forCellWithReuseIdentifier:cellID_pay];
|
||||
[collectionView registerClass:[self class]
|
||||
forCellWithReuseIdentifier:cellID_free];
|
||||
[collectionView registerClass:[self class]
|
||||
forCellWithReuseIdentifier:cellID_custom];
|
||||
}
|
||||
|
||||
+ (CustomRoomBGCell *)reuseFrom:(UICollectionView *)collectionView
|
||||
model:(CustomRoomBGItemModel *)model
|
||||
atIndexPath:(NSIndexPath *)indexPath {
|
||||
CustomRoomBGCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([self class])
|
||||
NSString *cellID = [NSString stringWithFormat:@"%@%@", NSStringFromClass([self class]), @(model.type)];
|
||||
CustomRoomBGCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:cellID
|
||||
forIndexPath:indexPath];
|
||||
cell.cellModel = model;
|
||||
return cell;
|
||||
}
|
||||
|
||||
@@ -43,19 +56,33 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)setupUI {
|
||||
[self.contentView addSubview:self.bgImageView];
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.leading.trailing.mas_equalTo(self.contentView);
|
||||
make.height.mas_equalTo(kGetScaleWidth(180));
|
||||
}];
|
||||
|
||||
[self.contentView addSubview:self.selectedStateView];
|
||||
[self.selectedStateView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self.bgImageView);
|
||||
}];
|
||||
- (void)setIsSelectedCell:(BOOL)isSelectedCell {
|
||||
_isSelectedCell = isSelectedCell;
|
||||
self.selectedStateView.hidden = !isSelectedCell;
|
||||
}
|
||||
|
||||
- (void)setCellModel:(CustomRoomBGItemModel *)cellModel {
|
||||
_cellModel = cellModel;
|
||||
self.bgImageView.imageUrl = cellModel.url;
|
||||
self.isSelectedCell = cellModel.isCur;
|
||||
switch (cellModel.type) {
|
||||
case 0:
|
||||
[self layoutFreeUI];
|
||||
break;
|
||||
case 1:
|
||||
[self layoutPayUI];
|
||||
[self setupBottomArea];
|
||||
break;
|
||||
case 2:
|
||||
[self layoutCustomUI];
|
||||
[self setupBottomArea];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)layoutFreeUI {
|
||||
[self.contentView addSubview:self.remainingDaysLabel];
|
||||
[self.remainingDaysLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.leading.mas_equalTo(6);
|
||||
@@ -63,10 +90,15 @@
|
||||
make.width.mas_greaterThanOrEqualTo(50);
|
||||
}];
|
||||
|
||||
[self.contentView addSubview:self.trashButton];
|
||||
[self.trashButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.trailing.top.mas_equalTo(self.contentView).inset(6);
|
||||
make.size.mas_equalTo(CGSizeMake(24, 19));
|
||||
self.remainingDaysLabel.text = YMLocalizedString(@"1.0.18_17");
|
||||
}
|
||||
|
||||
- (void)layoutPayUI {
|
||||
[self.contentView addSubview:self.remainingDaysLabel];
|
||||
[self.remainingDaysLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.leading.mas_equalTo(6);
|
||||
make.height.mas_equalTo(20);
|
||||
make.width.mas_greaterThanOrEqualTo(50);
|
||||
}];
|
||||
|
||||
[self.contentView addSubview:self.playButton];
|
||||
@@ -81,8 +113,34 @@
|
||||
make.trailing.mas_equalTo(self.playButton.mas_leading).offset(-6);
|
||||
make.size.mas_equalTo(CGSizeMake(27, 19));
|
||||
}];
|
||||
}
|
||||
|
||||
[self setupBottomArea];
|
||||
- (void)layoutCustomUI {
|
||||
[self.contentView addSubview:self.remainingDaysLabel];
|
||||
[self.remainingDaysLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.leading.mas_equalTo(6);
|
||||
make.height.mas_equalTo(20);
|
||||
make.width.mas_greaterThanOrEqualTo(50);
|
||||
}];
|
||||
|
||||
[self.contentView addSubview:self.trashButton];
|
||||
[self.trashButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.trailing.top.mas_equalTo(self.contentView).inset(6);
|
||||
make.size.mas_equalTo(CGSizeMake(24, 19));
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setupUI {
|
||||
[self.contentView addSubview:self.bgImageView];
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.leading.trailing.mas_equalTo(self.contentView);
|
||||
make.height.mas_equalTo(kGetScaleWidth(180));
|
||||
}];
|
||||
|
||||
[self.contentView addSubview:self.selectedStateView];
|
||||
[self.selectedStateView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self.bgImageView);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setupBottomArea {
|
||||
@@ -98,7 +156,7 @@
|
||||
UIImageView *gold = [self goldIcon];
|
||||
[stack addArrangedSubview:gold];
|
||||
[gold mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(20, 20));
|
||||
make.size.mas_equalTo(CGSizeMake(22, 22));
|
||||
}];
|
||||
|
||||
[stack addArrangedSubview:self.pricePerDayLabel];
|
||||
@@ -134,7 +192,7 @@
|
||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||
config.placeHolder = [UIImageConstant defaultEmptyPlaceholder];
|
||||
_bgImageView = [[NetImageView alloc] initWithConfig:config];
|
||||
_bgImageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
_bgImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
_bgImageView.layer.masksToBounds = YES;
|
||||
_bgImageView.layer.cornerRadius = 10;
|
||||
}
|
||||
@@ -149,7 +207,7 @@
|
||||
_selectedStateView.layer.borderColor = UIColorFromRGB(0xFF8C03).CGColor;
|
||||
_selectedStateView.layer.borderWidth = 2;
|
||||
_selectedStateView.layer.masksToBounds = YES;
|
||||
// _selectedStateView.hidden = YES;
|
||||
_selectedStateView.hidden = YES;
|
||||
}
|
||||
return _selectedStateView;
|
||||
}
|
||||
|
@@ -7,12 +7,16 @@
|
||||
|
||||
#import "MvpViewController.h"
|
||||
|
||||
@class RoomInfoModel;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface CustomRoomBGContentViewController : MvpViewController
|
||||
|
||||
@property (nonatomic, strong) RoomInfoModel *roomInfo;
|
||||
@property (nonatomic, copy) NSString *roomUID;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -9,6 +9,7 @@
|
||||
#import "SVGA.h"
|
||||
#import "CustomRoomBGCell.h"
|
||||
#import "CustomRoomBGPresenter.h"
|
||||
#import "XPRoomSettingPresenter.h"
|
||||
|
||||
@interface CustomRoomBGContentViewController () <UICollectionViewDelegateFlowLayout, UICollectionViewDataSource>
|
||||
|
||||
@@ -30,6 +31,18 @@
|
||||
@property (nonatomic, strong) UIButton *previewActionButton;
|
||||
@property (nonatomic, strong) UIButton *cancelPreviewButton;
|
||||
|
||||
@property (nonatomic, strong) NSMutableArray *payBackgrounds;
|
||||
@property (nonatomic, strong) NSMutableArray *freeBackgrounds;
|
||||
@property (nonatomic, strong) NSMutableArray *customBackgrounds;
|
||||
|
||||
@property (nonatomic, assign) NSInteger currentSelectedTabIndex;
|
||||
@property (nonatomic, assign) NSInteger currentSelectedItemIndex;
|
||||
@property (nonatomic, strong) CustomRoomBGItemModel *currentSelectedModel;
|
||||
|
||||
@property (nonatomic, strong) UIView *previewArea;
|
||||
@property (nonatomic, strong) UIImageView *previewGold;
|
||||
@property (nonatomic, strong) UILabel *previewPricePerDay;
|
||||
|
||||
@end
|
||||
|
||||
@implementation CustomRoomBGContentViewController
|
||||
@@ -41,6 +54,13 @@
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
self.currentSelectedTabIndex = 0;
|
||||
self.currentSelectedItemIndex = 0;
|
||||
|
||||
self.payBackgrounds = @[].mutableCopy;
|
||||
self.freeBackgrounds = @[].mutableCopy;
|
||||
self.customBackgrounds = @[].mutableCopy;
|
||||
|
||||
[self setupUI];
|
||||
[self didSelectedButton:self.freeButton];
|
||||
|
||||
@@ -48,13 +68,22 @@
|
||||
}
|
||||
|
||||
- (void)setupData {
|
||||
// @kWeakify(self);
|
||||
@kWeakify(self);
|
||||
[self.presenter loadListOfRoomBG:self.roomUID
|
||||
complete:^(NSArray<CustomRoomBGItemModel *> * _Nonnull list) {
|
||||
@kStrongify(self);
|
||||
for (CustomRoomBGItemModel *model in list) {
|
||||
if (model.goldPrice == 0) {
|
||||
[self.freeBackgrounds addObject:model];
|
||||
} else {
|
||||
[self.payBackgrounds addObject:model];
|
||||
}
|
||||
}
|
||||
|
||||
[self.collectionView reloadData];
|
||||
} failure:^{
|
||||
// @kStrongify(self);
|
||||
// [self didTapEmptySpace];
|
||||
@kStrongify(self);
|
||||
[self didTapEmptySpace];
|
||||
}];
|
||||
}
|
||||
|
||||
@@ -91,9 +120,9 @@
|
||||
}
|
||||
|
||||
- (void)setupTopButtons {
|
||||
self.freeButton = [self bgCategoryButton:101];
|
||||
self.payButton = [self bgCategoryButton:102];
|
||||
self.customButton = [self bgCategoryButton:103];
|
||||
self.freeButton = [self bgCategoryButton:100];
|
||||
self.payButton = [self bgCategoryButton:101];
|
||||
self.customButton = [self bgCategoryButton:102];
|
||||
|
||||
[self.view addSubview:self.freeButton];
|
||||
[self.freeButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -139,12 +168,23 @@
|
||||
|
||||
#pragma mark -
|
||||
- (void)updateDataSource:(NSInteger)tag {
|
||||
|
||||
self.currentSelectedTabIndex = tag - 100;
|
||||
self.currentSelectedItemIndex = 0;
|
||||
[self.collectionView reloadData];
|
||||
|
||||
switch (tag) {
|
||||
case 101:
|
||||
|
||||
case 100:
|
||||
self.emptyStateView.hidden = YES;
|
||||
break;
|
||||
case 101:
|
||||
self.emptyStateView.hidden = self.payBackgrounds.count != 0;
|
||||
break;
|
||||
case 102:
|
||||
self.emptyStateView.hidden = self.customBackgrounds.count != 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
self.emptyStateView.hidden = YES;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -152,8 +192,9 @@
|
||||
- (void)displayPreviewArea {
|
||||
UIView *view = [self previewMask];
|
||||
[self.view addSubview:view];
|
||||
self.previewArea = view;
|
||||
|
||||
[self.view addSubview:self.previewBottomBackground];
|
||||
[view addSubview:self.previewBottomBackground];
|
||||
|
||||
[self.previewBottomBackground addSubview:self.previewTipsContentLabel];
|
||||
[self.previewTipsContentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -161,60 +202,89 @@
|
||||
make.leading.trailing.mas_equalTo(self.previewBottomBackground).inset(15);
|
||||
}];
|
||||
|
||||
UIImageView *gold = [self goldIcon];
|
||||
[self.previewBottomBackground addSubview:gold];
|
||||
[gold mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
[self.previewBottomBackground addSubview:self.previewGold];
|
||||
[self.previewGold mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.previewBottomBackground).offset(103);
|
||||
make.leading.mas_equalTo(self.previewBottomBackground).offset(15);
|
||||
make.size.mas_equalTo(CGSizeMake(26, 26));
|
||||
}];
|
||||
|
||||
UILabel *pricePerDay = [self pricePerDayLabel];
|
||||
[self.previewBottomBackground addSubview:pricePerDay];
|
||||
[pricePerDay mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(gold);
|
||||
make.leading.mas_equalTo(gold.mas_trailing).offset(4);
|
||||
[self.previewBottomBackground addSubview:self.previewPricePerDay];
|
||||
[self.previewPricePerDay mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self.previewGold);
|
||||
make.leading.mas_equalTo(self.previewGold.mas_trailing).offset(4);
|
||||
}];
|
||||
|
||||
[self.previewBottomBackground addSubview:self.previewActionButton];
|
||||
[self.previewActionButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(gold);
|
||||
make.trailing.mas_equalTo(self.previewBottomBackground).offset(15);
|
||||
make.top.mas_equalTo(self.previewBottomBackground).offset(103);
|
||||
make.trailing.mas_equalTo(self.previewBottomBackground).offset(-15);
|
||||
make.size.mas_equalTo(CGSizeMake(120, 38));
|
||||
}];
|
||||
|
||||
[self.view addSubview:self.previewFrontImageView];
|
||||
[view addSubview:self.previewFrontImageView];
|
||||
[self.previewFrontImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.previewBottomBackground.mas_top).offset(-16);
|
||||
make.top.mas_equalTo(100);
|
||||
make.leading.trailing.mas_equalTo(self.view).inset(64);
|
||||
make.leading.trailing.mas_equalTo(view).inset(64);
|
||||
}];
|
||||
|
||||
[self.view insertSubview:self.previewBackImageView belowSubview:self.previewFrontImageView];
|
||||
[view insertSubview:self.previewBackImageView belowSubview:self.previewFrontImageView];
|
||||
[self.previewBackImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self.previewFrontImageView);
|
||||
}];
|
||||
|
||||
[self.view insertSubview:self.previewBackSvgaView belowSubview:self.previewFrontImageView];
|
||||
[view insertSubview:self.previewBackSvgaView belowSubview:self.previewFrontImageView];
|
||||
[self.previewBackSvgaView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self.previewFrontImageView);
|
||||
}];
|
||||
|
||||
SVGAParser *_parser = [SVGAParser new];
|
||||
@kWeakify(self);
|
||||
[_parser parseWithNamed:@"Combo_Boom"
|
||||
inBundle:nil
|
||||
completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
|
||||
@kStrongify(self);
|
||||
// self.svgaVideoEntity = videoItem;
|
||||
self.previewBackSvgaView.loops = 0;
|
||||
// self.previewBackSvgaView.clearsAfterStop = NO;
|
||||
self.previewBackSvgaView.videoItem = videoItem;
|
||||
[self.previewBackSvgaView startAnimation];
|
||||
} failureBlock:^(NSError * _Nullable error) {
|
||||
NSLog(@"%@", error);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)updatePreviewArea:(CustomRoomBGItemModel *)model {
|
||||
|
||||
self.currentSelectedModel = model;
|
||||
|
||||
BOOL isSvga = [model.url hasSuffix:@"svga"];
|
||||
self.previewBackImageView.hidden = isSvga;
|
||||
self.previewBackSvgaView.hidden = !isSvga;
|
||||
|
||||
switch (model.type) {
|
||||
case 0:
|
||||
[self.previewPricePerDay removeFromSuperview];
|
||||
[self.previewGold removeFromSuperview];
|
||||
[self.previewActionButton setTitle:YMLocalizedString(@"1.0.18_15") forState:UIControlStateNormal];
|
||||
break;
|
||||
case 1:
|
||||
[self.previewActionButton setTitle:YMLocalizedString(@"1.0.18_16") forState:UIControlStateNormal];
|
||||
break;
|
||||
case 2:
|
||||
[self.previewActionButton setTitle:YMLocalizedString(@"1.0.18_16") forState:UIControlStateNormal];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (model.type == 0) {
|
||||
|
||||
}
|
||||
|
||||
if (isSvga) {
|
||||
SVGAParser *_parser = [SVGAParser new];
|
||||
@kWeakify(self);
|
||||
[_parser parseWithURL:[NSURL URLWithString:model.url] completionBlock:^(SVGAVideoEntity * _Nullable videoItem) {
|
||||
@kStrongify(self);
|
||||
self.previewBackSvgaView.loops = 0;
|
||||
self.previewBackSvgaView.videoItem = videoItem;
|
||||
[self.previewBackSvgaView startAnimation];
|
||||
} failureBlock:^(NSError * _Nullable error) {
|
||||
NSLog(@"%@", error);
|
||||
}];
|
||||
|
||||
} else {
|
||||
self.previewBackImageView.imageUrl = model.url;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
- (void)didTapEmptySpace {
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
@@ -231,34 +301,111 @@
|
||||
}
|
||||
|
||||
- (void)didTapCreate {
|
||||
if (self.currentSelectedModel.type == 0) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
- (void)didTapHelp {
|
||||
|
||||
TTAlertConfig *config = [[TTAlertConfig alloc]init];
|
||||
config.title = YMLocalizedString(@"UserDetail_CP_Toast_0");
|
||||
config.message = YMLocalizedString(@"1.0.18_6");
|
||||
config.actionStyle = TTAlertActionConfirmStyle;
|
||||
[TTPopup alertWithConfig:config
|
||||
showBorder:NO
|
||||
confirmHandler:^{}
|
||||
cancelHandler:^{}];
|
||||
}
|
||||
|
||||
- (void)didTapActionButton {
|
||||
|
||||
[self updateRoomBG];
|
||||
}
|
||||
|
||||
- (void)didTapCancelPreview {
|
||||
|
||||
[self.previewArea removeFromSuperview];
|
||||
}
|
||||
|
||||
|
||||
- (void)updateRoomBG {
|
||||
@kWeakify(self);
|
||||
[self.presenter useRoomBG:self.roomUID
|
||||
itemID:@(self.currentSelectedModel.id).stringValue
|
||||
complete:^{
|
||||
// MARK: RoomVC 會接受云信通知
|
||||
} failure:^{
|
||||
|
||||
}];
|
||||
}
|
||||
#pragma mark -
|
||||
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
|
||||
return 10;
|
||||
switch (self.currentSelectedTabIndex) {
|
||||
case 0:
|
||||
return self.freeBackgrounds.count;
|
||||
break;
|
||||
case 1:
|
||||
return self.payBackgrounds.count;
|
||||
break;
|
||||
case 2:
|
||||
return self.customBackgrounds.count;
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
CustomRoomBGCell *cell = [CustomRoomBGCell reuseFrom:collectionView atIndexPath:indexPath];
|
||||
@kWeakify(self);
|
||||
[cell setHandleTapPlayButton:^(id _Nonnull obj) {
|
||||
@kStrongify(self);
|
||||
CustomRoomBGItemModel *model;
|
||||
switch (self.currentSelectedTabIndex) {
|
||||
case 0:
|
||||
model = [self.freeBackgrounds xpSafeObjectAtIndex:indexPath.row];
|
||||
break;
|
||||
case 1:
|
||||
model = [self.payBackgrounds xpSafeObjectAtIndex:indexPath.row];
|
||||
break;
|
||||
case 2:
|
||||
model = [self.customBackgrounds xpSafeObjectAtIndex:indexPath.row];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (model) {
|
||||
CustomRoomBGCell *cell = [CustomRoomBGCell reuseFrom:collectionView
|
||||
model:model
|
||||
atIndexPath:indexPath];
|
||||
@kWeakify(self);
|
||||
[cell setHandleTapPlayButton:^(id _Nonnull obj) {
|
||||
@kStrongify(self);
|
||||
[self displayPreviewArea];
|
||||
}];
|
||||
return cell;
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
CustomRoomBGItemModel *model;
|
||||
switch (self.currentSelectedTabIndex) {
|
||||
case 0:
|
||||
model = [self.freeBackgrounds xpSafeObjectAtIndex:indexPath.row];
|
||||
break;
|
||||
case 1:
|
||||
model = [self.payBackgrounds xpSafeObjectAtIndex:indexPath.row];
|
||||
break;
|
||||
case 2:
|
||||
model = [self.customBackgrounds xpSafeObjectAtIndex:indexPath.row];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (model) {
|
||||
self.currentSelectedItemIndex = indexPath.row;
|
||||
[self displayPreviewArea];
|
||||
}];
|
||||
return cell;
|
||||
[self updatePreviewArea:model];
|
||||
[collectionView reloadData];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
@@ -324,8 +471,8 @@ forControlEvents:UIControlEventTouchUpInside];
|
||||
CAGradientLayer *gradientLayer = [CAGradientLayer layer];
|
||||
gradientLayer.colors = @[(__bridge id)UIColorFromRGB(0xE29030).CGColor,
|
||||
(__bridge id)UIColorFromRGB(0xFCC074).CGColor];
|
||||
gradientLayer.startPoint = CGPointMake(0.5, 0.0); // 顶部中央
|
||||
gradientLayer.endPoint = CGPointMake(0.5, 1.0); // 底部中央
|
||||
gradientLayer.startPoint = CGPointMake(0.0, 0.0); // 顶部中央
|
||||
gradientLayer.endPoint = CGPointMake(0.0, 1.0); // 底部中央
|
||||
gradientLayer.frame = button.bounds; // 设置渐变图层大小
|
||||
|
||||
// 将渐变图层添加到按钮图层
|
||||
@@ -366,7 +513,7 @@ forControlEvents:UIControlEventTouchUpInside];
|
||||
make.top.mas_equalTo(imageView.mas_bottom).offset(6);
|
||||
make.height.mas_equalTo(22);
|
||||
}];
|
||||
|
||||
v.hidden = YES;
|
||||
_emptyStateView = v;
|
||||
}
|
||||
return _emptyStateView;
|
||||
@@ -469,16 +616,20 @@ forControlEvents:UIControlEventTouchUpInside];
|
||||
return _previewTipsContentLabel;
|
||||
}
|
||||
|
||||
- (UIImageView *)goldIcon {
|
||||
UIImageView *gold = [[UIImageView alloc] initWithImage:kImage(@"moli_money_icon")];
|
||||
return gold;
|
||||
- (UIImageView *)previewGold {
|
||||
if (!_previewGold) {
|
||||
_previewGold = [[UIImageView alloc] initWithImage:kImage(@"moli_money_icon")];
|
||||
}
|
||||
return _previewGold;
|
||||
}
|
||||
|
||||
- (UILabel *)pricePerDayLabel {
|
||||
UILabel *label = [UILabel labelInitWithText:YMLocalizedString(@"1.0.18_14")
|
||||
font:kFontMedium(16)
|
||||
textColor:UIColorFromRGB(0xFF8C03)];
|
||||
return label;
|
||||
- (UILabel *)previewPricePerDay {
|
||||
if (!_previewPricePerDay) {
|
||||
_previewPricePerDay = [UILabel labelInitWithText:YMLocalizedString(@"1.0.18_14")
|
||||
font:kFontMedium(16)
|
||||
textColor:UIColorFromRGB(0xFF8C03)];
|
||||
}
|
||||
return _previewPricePerDay;
|
||||
}
|
||||
|
||||
- (UIButton *)previewActionButton {
|
||||
@@ -491,6 +642,17 @@ forControlEvents:UIControlEventTouchUpInside];
|
||||
[_previewActionButton addTarget:self
|
||||
action:@selector(didTapActionButton)
|
||||
forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
// 创建渐变图层
|
||||
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];
|
||||
}
|
||||
return _previewActionButton;
|
||||
}
|
||||
@@ -507,13 +669,13 @@ forControlEvents:UIControlEventTouchUpInside];
|
||||
- (NSString *)titleForTag:(NSInteger)tag {
|
||||
NSString *title = @"";
|
||||
switch (tag) {
|
||||
case 101:
|
||||
case 100:
|
||||
title = YMLocalizedString(@"1.0.18_1");
|
||||
break;
|
||||
case 102:
|
||||
case 101:
|
||||
title = YMLocalizedString(@"1.0.18_2");
|
||||
break;
|
||||
case 103:
|
||||
case 102:
|
||||
title = YMLocalizedString(@"1.0.18_3");
|
||||
break;
|
||||
default:
|
||||
|
@@ -236,7 +236,7 @@
|
||||
return [self createGeneralPublicScreenAttribute:attachment messageInfo:messageInfo];
|
||||
}else if(first == CustomMessageType_Super_Gift){
|
||||
return [self createGeneralPublicScreenAttribute:attachment messageInfo:messageInfo];
|
||||
}else if(first == CustomMessageType_Chat_Hall_Headlinesn && attachment.second == Custom_Message_Sub_Chat_Hall_Headlinesn){
|
||||
}else if(first == CustomMessageType_Chat_Hall_Headlines && attachment.second == Custom_Message_Sub_Chat_Hall_Headlines){
|
||||
|
||||
}
|
||||
|
||||
|
@@ -658,7 +658,7 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey";
|
||||
|
||||
///用户进入房间显示 房间话题
|
||||
- (void)createUserEnterRoomAddRoomTopicMessage {
|
||||
if ([ClientConfig shareConfig].configInfo.appStoreAuditNoticeVersion == YES) {
|
||||
if ([ClientConfig shareConfig].configInfo.hideNoticeVersion == YES) {
|
||||
return;
|
||||
}
|
||||
RoomInfoModel * roomInfo = self.hostDelegate.getRoomInfo;
|
||||
|
@@ -505,6 +505,7 @@ UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey;
|
||||
case RoomMoreMenuType_Room_Type_Background: {
|
||||
[self dismissViewControllerAnimated:NO completion:nil];
|
||||
CustomRoomBGContentViewController *vc = [[CustomRoomBGContentViewController alloc] init];
|
||||
vc.roomInfo = self.roomInfo;
|
||||
vc.roomUID = [NSString stringWithFormat:@"%ld", self.roomInfo.uid];
|
||||
vc.modalPresentationStyle = UIModalPresentationOverFullScreen;
|
||||
[self.hostDelegate.getCurrentNav presentViewController:vc
|
||||
|
@@ -44,7 +44,7 @@
|
||||
}
|
||||
|
||||
-(void)installUI{
|
||||
self.view.backgroundColor = [DJDKMIMOMColor colorWithHexString:@"#FCF4DF"];
|
||||
self.view.backgroundColor = [[ClientConfig shareConfig] bgColor];
|
||||
[self setupTopTheme];
|
||||
|
||||
[self.view addSubview:self.headView];
|
||||
@@ -52,10 +52,19 @@
|
||||
}
|
||||
|
||||
- (void)setupTopTheme {
|
||||
UIImageView *theme = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, kGetScaleWidth(140))];
|
||||
theme.image = [UIImage imageNamed:@"home_top_bg"];
|
||||
__block UIImageView *theme = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, kGetScaleWidth(140))];
|
||||
theme.image = [[ClientConfig shareConfig] navigationAreaBG];// [UIImage imageNamed:@"home_top_bg"];
|
||||
theme.contentMode = UIViewContentModeScaleAspectFit;
|
||||
[self.view addSubview:theme];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:[ClientConfig shareConfig].reloadNavigationAreaImageKey
|
||||
object:nil
|
||||
queue:[NSOperationQueue mainQueue]
|
||||
usingBlock:^(NSNotification * _Nonnull notification) {
|
||||
if ([notification.object isKindOfClass:[UIImage class]]) {
|
||||
theme.image = (UIImage *)notification.object;
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)installConstraints{
|
||||
|
@@ -300,7 +300,7 @@
|
||||
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
[[self getView] updateRoomInfoFail:msg];
|
||||
} showLoading:YES] params:params];
|
||||
} showLoading:YES errorToast:YES] params:params];
|
||||
} else if(member.type == NIMTeamMemberTypeManager) {
|
||||
@kWeakify(self);
|
||||
[Api managerUpdateRoomInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
|
@@ -348,7 +348,6 @@ XPCandyTreeInsufficientBalanceViewDelegate>
|
||||
[self.presenter getRoomSuperAdmin:self.roomUid];
|
||||
|
||||
[XPSkillCardPlayerManager shareInstance].isInRoom = YES;
|
||||
|
||||
[self startCheckOnlineCountTimer];
|
||||
|
||||
[CountDownHelper shareHelper].delegate = self;
|
||||
@@ -2044,6 +2043,12 @@ XPCandyTreeInsufficientBalanceViewDelegate>
|
||||
[self.presenter getFreeGiftData];
|
||||
[[NSNotificationCenter defaultCenter]postNotificationName:kFreeGiftCountdownNotification object:nil userInfo:@{@"updateGiftInfo":attachment.data ?: @""}];
|
||||
}
|
||||
} else if (attachment.first == CustomMessageType_Custom_Room_Background) {
|
||||
if (attachment.second == Custom_Message_Sub_Custom_Room_Background) {
|
||||
// TODO: 更新 背景
|
||||
self.roomInfo.backPic = @"https://tva1.moyu.im/mw600/9f0b0dd5ly1hvacrep5fhj20jg0t60w4.jpg";
|
||||
[self.backContainerView onRoomUpdate];
|
||||
}
|
||||
}
|
||||
[self.messageContainerView handleNIMCustomMessage:message];
|
||||
}
|
||||
|
@@ -135,6 +135,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
@end
|
||||
|
||||
@implementation TabbarViewController
|
||||
|
||||
- (void)dealloc{
|
||||
[[NSNotificationCenter defaultCenter]removeObserver:self];
|
||||
[[NIMSDK sharedSDK].loginManager removeDelegate:self];
|
||||
@@ -142,25 +143,22 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
[[NIMSDK sharedSDK].systemNotificationManager removeDelegate:self];
|
||||
[[NIMSDK sharedSDK].broadcastManager removeDelegate:self];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
self.tabBarController.tabBar.translucent = NO;
|
||||
|
||||
[self.presenter autoLogin];
|
||||
[self configTheme];
|
||||
[self initTabs:NO];
|
||||
|
||||
if([ClientConfig shareConfig].isLoad == NO){
|
||||
[[ClientConfig shareConfig] clientInit];
|
||||
[ClientConfig shareConfig].isLoad = YES;
|
||||
}
|
||||
[[ClientConfig shareConfig] clientInit];
|
||||
|
||||
[[NIMSDK sharedSDK].loginManager addDelegate:self];
|
||||
[[NIMSDK sharedSDK].chatManager addDelegate:self];
|
||||
[[NIMSDK sharedSDK].systemNotificationManager addDelegate:self];
|
||||
[[NIMSDK sharedSDK].broadcastManager addDelegate:self];
|
||||
|
||||
|
||||
[self networkReachability];
|
||||
[self.view addSubview:self.roomMineView];
|
||||
|
||||
@@ -170,7 +168,10 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
[self configRoomMiniNView:note.userInfo];
|
||||
}];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:@"reloadnewtab" object:nil queue:nil usingBlock:^(NSNotification * _Nonnull note) {
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:@"reloadAfterLoadConfig"
|
||||
object:nil
|
||||
queue:nil
|
||||
usingBlock:^(NSNotification * _Nonnull note) {
|
||||
@kStrongify(self);
|
||||
if (self.isInitReload == NO) {
|
||||
[self initTabs:YES];
|
||||
@@ -181,10 +182,28 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showAnchorCardKey:) name:kTabShowAnchorCardKey object:nil];
|
||||
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(switchLanguage:) name:@"kSwitchLanguage" object:nil];
|
||||
|
||||
[[ClientConfig shareConfig] setUpdateNormalTabImage:^(UIImage * _Nonnull normalImage, NSInteger index) {
|
||||
@kStrongify(self);
|
||||
BaseNavigationController *vc = [self.viewControllers xpSafeObjectAtIndex:index];
|
||||
vc.tabBarItem.image = [normalImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
|
||||
}];
|
||||
|
||||
[[ClientConfig shareConfig] setUpdateSelectedTabImage:^(UIImage * _Nonnull selectImage, NSInteger index) {
|
||||
@kStrongify(self);
|
||||
BaseNavigationController *vc = [self.viewControllers xpSafeObjectAtIndex:index];
|
||||
vc.tabBarItem.selectedImage = [selectImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
|
||||
}];
|
||||
|
||||
[[ClientConfig shareConfig] setUpdateTabbarBG:^(UIImage * _Nonnull image) {
|
||||
@kStrongify(self);
|
||||
[self configTheme:image];
|
||||
}];
|
||||
|
||||
[[RoomBoomManager sharedManager] registerBoomBanner:^(id _Nonnull sth) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[RoomBoomBannerAnimation display:kWindow
|
||||
with:sth tapToRoom:YES
|
||||
with:sth
|
||||
tapToRoom:YES
|
||||
complete:^{}];
|
||||
});
|
||||
} target:self];
|
||||
@@ -219,8 +238,6 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
return _presenter;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** 登录成功(通过token且换取ticket后)。
|
||||
|
||||
1. 登录云信。
|
||||
@@ -232,7 +249,6 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
[self.presenter getUserInfo];
|
||||
[[UploadFile share]initQCloud];
|
||||
|
||||
|
||||
///检查更新
|
||||
[self.presenter getVersionUpdate];
|
||||
|
||||
@@ -250,7 +266,9 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
XPAdImageTool.shareImageTool.isImLogin = YES;
|
||||
|
||||
if ([self hadLaunchApp] && [self canShowAnchorCard]) {
|
||||
@kWeakify(self);
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
@kStrongify(self);
|
||||
if (self.view.window && self.isViewLoaded) {
|
||||
[self.presenter getAnchorCardInfo];
|
||||
}
|
||||
@@ -361,8 +379,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
[self completeUserInfo];
|
||||
}
|
||||
|
||||
-(void)getAuthorizationCodeInfoWithPhoneSuccess:(BOOL)flag{
|
||||
|
||||
-(void)getAuthorizationCodeInfoWithPhoneSuccess:(BOOL)flag {
|
||||
if(flag == NO){
|
||||
XPLoginAuthCodeVC *vc = [[XPLoginAuthCodeVC alloc]init];
|
||||
vc.delegate = self;
|
||||
@@ -372,6 +389,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
}
|
||||
[self completeUserInfo];
|
||||
}
|
||||
|
||||
#pragma mark - XPLoginAuthCodeVCDelegate
|
||||
- (void)bindCodeSuccess{
|
||||
[self completeUserInfo];
|
||||
@@ -391,10 +409,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
self.isFirstReachability = YES;
|
||||
NSArray *allResourceList = data.data;
|
||||
NSSet *allResourceSet = [[NSSet alloc] initWithArray:allResourceList];
|
||||
NSMutableArray *allResourceURLs = @[@"https://image.hfighting.com/fenjie2.mp4",
|
||||
@"https://image.hfighting.com/treasure_fairy_ten.mp4",
|
||||
@"https://image.hfighting.com/hecheng3.mp4",
|
||||
@"https://image.hfighting.com/treasure_fairy_one.mp4"].mutableCopy;
|
||||
NSMutableArray *allResourceURLs = @[].mutableCopy;
|
||||
for (NSString *url in allResourceSet) {
|
||||
NSString *encodingUrl = [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet];
|
||||
[allResourceURLs addObject:encodingUrl];
|
||||
@@ -452,34 +467,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
// [self.presenter clientStartApp];
|
||||
}
|
||||
#pragma mark - 网络状态监听
|
||||
- (void)networkReachability{
|
||||
// @kWeakify(self);
|
||||
// [[AFNetworkReachabilityManager sharedManager] startMonitoring];
|
||||
// [[AFNetworkReachabilityManager sharedManager] setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
|
||||
// @kStrongify(self);
|
||||
// switch (status) {
|
||||
// case AFNetworkReachabilityStatusUnknown:
|
||||
// self.isFirstReachability = YES;
|
||||
// break;
|
||||
// case AFNetworkReachabilityStatusNotReachable:
|
||||
// self.isFirstReachability = YES;
|
||||
// break;
|
||||
// case AFNetworkReachabilityStatusReachableViaWWAN:
|
||||
// case AFNetworkReachabilityStatusReachableViaWiFi:
|
||||
// {
|
||||
// if (self.isFirstReachability) {
|
||||
// [[NSNotificationCenter defaultCenter] postNotificationName:kNetworkReachabilityKey object:nil userInfo:nil];
|
||||
// [self.presenter autoLogin];
|
||||
// [[ClientConfig shareConfig] clientInit];
|
||||
// }
|
||||
// self.isFirstReachability = YES;
|
||||
// }
|
||||
// break;
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
// }];
|
||||
}
|
||||
- (void)networkReachability{}
|
||||
|
||||
#pragma mark - BaseMvpProtocol
|
||||
- (void)tokenInvalid {
|
||||
@@ -694,7 +682,6 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
//判断是否在房间
|
||||
__block BOOL isInRoom;
|
||||
|
||||
|
||||
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController.viewControllers enumerateObjectsUsingBlock:^(__kindof UIViewController * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if ([obj isKindOfClass:[XPRoomViewController class]]) {
|
||||
*stop = YES;
|
||||
@@ -740,45 +727,39 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)configTheme {
|
||||
UIImage *backgroundImage = [UIImage imageNamed:@"tab_bar_bg"];
|
||||
[[UITabBar appearance] setBackgroundImage:backgroundImage];
|
||||
|
||||
[[UITabBar appearance] setShadowImage:[[UIImage alloc]init]];
|
||||
- (void)configTheme:(UIImage *)image {
|
||||
if (image == nil) {
|
||||
image = kImage(@"tab_bar_bg");
|
||||
}
|
||||
[self.tabBar setBackgroundImage:image];
|
||||
[self.tabBar setShadowImage:[[UIImage alloc]init]];
|
||||
if (@available(iOS 10.0, *)) {
|
||||
[[UITabBar appearance] setUnselectedItemTintColor:[DJDKMIMOMColor tabbarNormalColor]];
|
||||
[self.tabBar setUnselectedItemTintColor:[DJDKMIMOMColor tabbarNormalColor]];
|
||||
}
|
||||
|
||||
if (@available(iOS 13, *)) {
|
||||
UITabBarAppearance *tabBarAppearance = [UITabBarAppearance new];
|
||||
tabBarAppearance.backgroundImage = backgroundImage;
|
||||
[[UITabBar appearance] setStandardAppearance:tabBarAppearance];
|
||||
tabBarAppearance.backgroundImage = image;
|
||||
[self.tabBar setStandardAppearance:tabBarAppearance];
|
||||
if (@available(iOS 15, *)) {
|
||||
[[UITabBar appearance] setScrollEdgeAppearance:tabBarAppearance];
|
||||
[self.tabBar setScrollEdgeAppearance:tabBarAppearance];
|
||||
}
|
||||
}
|
||||
|
||||
// UIImageView *backgroundImageView = [[UIImageView alloc] initWithFrame:self.tabBar.bounds];
|
||||
// backgroundImageView.image = image;
|
||||
// backgroundImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
// backgroundImageView.clipsToBounds = YES;
|
||||
//
|
||||
// // 将 UIImageView 插入到 UITabBar 的最底层
|
||||
// [self.tabBar insertSubview:backgroundImageView atIndex:0];
|
||||
}
|
||||
|
||||
- (void)initTabs:(BOOL)isLogin {
|
||||
self.viewControllers = nil;
|
||||
NSArray *normalImageNames = @[@"tab_gameHome_normal",
|
||||
@"tab_gameHome_game_normal",
|
||||
@"tab_monents_normal",
|
||||
@"tab_message_normal",
|
||||
@"tab_mine_normal"];
|
||||
NSArray *selectImageNames = @[@"tab_gameHome_selected",
|
||||
@"tab_gameHome_game_selected",
|
||||
@"tab_monents_select",
|
||||
@"tab_message_selected",
|
||||
@"tab_mine_selected"];
|
||||
NSArray *tabLabels = @[YMLocalizedString(@"TabbarViewController2"),
|
||||
YMLocalizedString(@"TabbarViewController6"),
|
||||
YMLocalizedString(@"TabbarViewController3"),
|
||||
YMLocalizedString(@"TabbarViewController4"),
|
||||
YMLocalizedString(@"TabbarViewController5")];
|
||||
// 创建视图控制器数组
|
||||
NSMutableArray *viewControllers = [NSMutableArray arrayWithCapacity:normalImageNames.count];
|
||||
for (NSInteger i = 0; i < normalImageNames.count; i++) {
|
||||
NSMutableArray *viewControllers = [[NSMutableArray alloc] initWithCapacity:5];
|
||||
for (NSInteger i = 0; i < 5; i++) {
|
||||
UIViewController *viewController;
|
||||
if (isLogin) {
|
||||
switch (i) {
|
||||
@@ -817,12 +798,11 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
viewController = [[XPBlankViewController alloc] init];
|
||||
}
|
||||
// 创建并设置标签栏项
|
||||
[self createTabBarItem:viewController
|
||||
title:tabLabels[i]
|
||||
image:normalImageNames[i]
|
||||
selectedImage:selectImageNames[i]];
|
||||
|
||||
[viewControllers addObject:viewController];
|
||||
[viewControllers addObject:[self createTabBarItem:viewController
|
||||
title:[[ClientConfig shareConfig] tabName:i]
|
||||
image:[[ClientConfig shareConfig] tabNormalImage:i]
|
||||
selectedImage:[[ClientConfig shareConfig] tabSelectedImage:i]
|
||||
index:i]];
|
||||
}
|
||||
// 设置视图控制器数组和默认选择项
|
||||
self.viewControllers = [viewControllers copy];
|
||||
@@ -831,15 +811,16 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
|
||||
- (BaseNavigationController *)createTabBarItem:(UIViewController *)itemVc
|
||||
title:(NSString *)title
|
||||
image:(NSString *)image
|
||||
selectedImage:(NSString *)selectedImage {
|
||||
itemVc.title = @"" ;
|
||||
itemVc.tabBarItem.image = [[UIImage imageNamed:image] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
|
||||
itemVc.tabBarItem.selectedImage = [[UIImage imageNamed:selectedImage] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
|
||||
image:(NSString *)imageURL
|
||||
selectedImage:(NSString *)selectedImageURL
|
||||
index:(NSInteger)index {
|
||||
|
||||
itemVc.title = @"";
|
||||
[itemVc.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:UIColorFromRGB(0x1F1B4F)}
|
||||
forState:UIControlStateSelected];
|
||||
[itemVc.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:UIColorFromRGB(0xB8B7C7)}
|
||||
forState:UIControlStateNormal];
|
||||
|
||||
BaseNavigationController *nav = [[BaseNavigationController alloc] initWithRootViewController:itemVc];
|
||||
return nav;
|
||||
}
|
||||
|
@@ -79,9 +79,6 @@
|
||||
self.navigationBar.standardAppearance = appearance;
|
||||
self.navigationBar.scrollEdgeAppearance = appearance;
|
||||
}
|
||||
|
||||
UIImage *backgroundImage = [UIImage imageNamed:@"tab_bar_bg"];
|
||||
[[UITabBar appearance] setBackgroundImage:backgroundImage];
|
||||
}
|
||||
|
||||
#pragma mark - UIGestureRecognizerDelegate
|
||||
|
@@ -6,6 +6,7 @@
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "ClientConfig.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
@@ -33,7 +33,9 @@ static UploadFile* manager;
|
||||
}
|
||||
|
||||
-(void)initQCloud{
|
||||
@kWeakify(self);
|
||||
[Api getQCloudInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
if (code == 200){
|
||||
UploadFileModel *fileModel = [UploadFileModel modelWithDictionary:data.data];
|
||||
self.fileModel = fileModel;
|
||||
|
@@ -41,6 +41,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
+(NSString *)getCountryCode;
|
||||
///产生唯一的key,用于图片或文件上传
|
||||
+ (NSString *)createUUID;
|
||||
|
||||
+ (BOOL)isEmpty:(NSString *)string;
|
||||
- (BOOL)isEmpty;
|
||||
@end
|
||||
|
||||
|
||||
|
@@ -330,4 +330,17 @@
|
||||
return [result MD5String];
|
||||
|
||||
}
|
||||
|
||||
+ (BOOL)isEmpty:(NSString *)string {
|
||||
if (string == nil || [string isKindOfClass:[NSNull class]]) {
|
||||
return YES;
|
||||
}
|
||||
NSString *trimmedString = [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
||||
return trimmedString.length == 0;
|
||||
}
|
||||
|
||||
- (BOOL)isEmpty {
|
||||
return [NSString isEmpty:self];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -3981,4 +3981,5 @@ ineHeadView12" = "الحمل";
|
||||
"1.0.18_13" = "Are you sure you want to buy?";
|
||||
"1.0.18_14" = "1000/15Days";
|
||||
"1.0.18_15" = "Submit";
|
||||
"1.0.18_15" = "Confirm";
|
||||
"1.0.18_16" = "Confirm";
|
||||
"1.0.18_17" = "Original";
|
||||
|
@@ -3777,4 +3777,5 @@
|
||||
"1.0.18_13" = "Are you sure you want to buy?";
|
||||
"1.0.18_14" = "1000/15Days";
|
||||
"1.0.18_15" = "Submit";
|
||||
"1.0.18_15" = "Confirm";
|
||||
"1.0.18_16" = "Confirm";
|
||||
"1.0.18_17" = "Original";
|
||||
|
@@ -3563,4 +3563,5 @@
|
||||
"1.0.18_13" = "Are you sure you want to buy?";
|
||||
"1.0.18_14" = "1000/15Days";
|
||||
"1.0.18_15" = "Submit";
|
||||
"1.0.18_15" = "Confirm";
|
||||
"1.0.18_16" = "Confirm";
|
||||
"1.0.18_17" = "Original";
|
||||
|
@@ -3434,5 +3434,6 @@
|
||||
"1.0.18_13" = "Are you sure you want to buy?";
|
||||
"1.0.18_14" = "1000/15Days";
|
||||
"1.0.18_15" = "Submit";
|
||||
"1.0.18_15" = "Confirm";
|
||||
"1.0.18_16" = "Confirm";
|
||||
"1.0.18_17" = "Original";
|
||||
|
||||
|
Reference in New Issue
Block a user