移除不使用内容
This commit is contained in:
@@ -11,13 +11,10 @@
|
||||
#import "DESEncrypt.h"
|
||||
#import "YUMIConstant.h"
|
||||
#import <MJExtension/MJExtension.h>
|
||||
#import "XPRoomFaceTool.h"
|
||||
#import "NSString+Utils.h"
|
||||
#import "YYUtility.h"
|
||||
#import "XPWeakTimer.h"
|
||||
#import "Api+Main.h"
|
||||
#import "ChatFaceVo.h"
|
||||
#import "PublicRoomManager.h"
|
||||
|
||||
@interface ClientConfig ()
|
||||
///重试的次数 10次 如果你还是失败的话 那就算了 没办法了
|
||||
@@ -74,16 +71,7 @@
|
||||
NSString *json = model.faceJson.json;
|
||||
NSString *deJson = [DESEncrypt decryptUseDES:json key:KeyWithType(KeyType_FacePwdEncode)];
|
||||
NSDictionary *faceInitData = [deJson toJSONObject];
|
||||
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];
|
||||
}
|
||||
|
||||
NSString *trtcAppId = @(model.trtcAppId).stringValue;
|
||||
NSString *curTtcKey = [[NSUserDefaults standardUserDefaults]valueForKey:@"kTrtcAppId"];
|
||||
if(curTtcKey == nil){
|
||||
@@ -99,7 +87,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
//是否展示公屏
|
||||
|
||||
NSString *serverVer = model.appStoreAuditNoticeVersion;
|
||||
NSString *shortVer = [YYUtility appVersion];
|
||||
model.hideNoticeVersion = [NSString versionCompareOldStr:serverVer andNewStr:shortVer];
|
||||
@@ -107,8 +95,6 @@
|
||||
self.configInfo = model;
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"reloadAfterLoadConfig" object:nil];
|
||||
|
||||
[self requestFaceTabNewList];
|
||||
} else {
|
||||
if (self.retryCount < 10) {
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
@@ -120,14 +106,6 @@
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)requestFaceTabNewList {
|
||||
[Api faceTabNewList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code == 200) {
|
||||
[[XPRoomFaceTool shareFaceTool] cacheChatFaces:data.data];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)clientConfig:(void(^)(void))finish {
|
||||
@kWeakify(self);
|
||||
[Api clientConfig:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
@@ -135,140 +113,11 @@
|
||||
if (code == 200) {
|
||||
self.uiSetting = [AppUISetting modelWithJSON:data.data[@"appUiSetting"]];
|
||||
}
|
||||
// 无论如何都开始构建 tab image path 数组并进入首页
|
||||
[self prepareCustomUI];
|
||||
|
||||
if (finish) {
|
||||
finish();
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)prepareCustomUI {
|
||||
NSArray *defaultArray = @[@"", @"", @"", @"", @""];
|
||||
self.normalTabImageSource = defaultArray.mutableCopy;
|
||||
self.selectedTabImageSource = defaultArray.mutableCopy;
|
||||
|
||||
if (self.uiSetting) {
|
||||
NSArray *unselectIcons = @[
|
||||
self.uiSetting.homeUnSelectIcon ?: @"",
|
||||
self.uiSetting.gameUnSelectIcon ?: @"",
|
||||
self.uiSetting.dynamicUnSelectIcon ?: @"",
|
||||
self.uiSetting.msgUnSelectIcon ?: @"",
|
||||
self.uiSetting.mineUnSelectIcon ?: @""
|
||||
];
|
||||
|
||||
NSArray *selectIcons = @[
|
||||
self.uiSetting.homeSelectIcon ?: @"",
|
||||
self.uiSetting.gameSelectIcon ?: @"",
|
||||
self.uiSetting.dynamicSelectIcon ?: @"",
|
||||
self.uiSetting.msgSelectIcon ?: @"",
|
||||
self.uiSetting.mineSelectIcon ?: @""
|
||||
];
|
||||
|
||||
self.normalTabImageSource = unselectIcons.mutableCopy;
|
||||
self.selectedTabImageSource = selectIcons.mutableCopy;
|
||||
|
||||
[self loadNavigationAreaBG];
|
||||
[self loadTabbarBG];
|
||||
[self loadBGColor];
|
||||
} else {
|
||||
if (self.updateTabbarBG) {
|
||||
self.updateTabbarBG(kImage(@"tab_bar_bg"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (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.uiSetting.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.uiSetting.navbar
|
||||
completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
|
||||
@kStrongify(self);
|
||||
self.tabbarBGImage = image;
|
||||
if (self.updateTabbarBG) {
|
||||
self.updateTabbarBG(image);
|
||||
}
|
||||
} fail:^(NSError * _Nonnull error) {
|
||||
@kStrongify(self);
|
||||
if (self.updateTabbarBG) {
|
||||
self.updateTabbarBG(kImage(@"tab_bar_bg"));
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)loadBGColor {
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:self.reloadNavigationAreaImageKey
|
||||
object:nil];
|
||||
}
|
||||
|
||||
- (UIColor *)bgColor {
|
||||
if (self.uiSetting && ![NSString isEmpty:self.uiSetting.backgroundColor]) {
|
||||
return [DJDKMIMOMColor colorWithHexString:self.uiSetting.backgroundColor];
|
||||
}
|
||||
|
||||
return [DJDKMIMOMColor colorWithHexString:@"#FCF4DF"];
|
||||
}
|
||||
|
||||
- (NSString *)tabName:(NSInteger)tabIndex {
|
||||
return @[YMLocalizedString(@"TabbarViewController2"),
|
||||
YMLocalizedString(@"TabbarViewController6"),
|
||||
YMLocalizedString(@"TabbarViewController3"),
|
||||
YMLocalizedString(@"TabbarViewController4"),
|
||||
YMLocalizedString(@"TabbarViewController5")][tabIndex];
|
||||
}
|
||||
|
||||
- (NSString *)loadDefaultNormalTabImageName:(NSInteger)tabIndex {
|
||||
return @[@"tab_gameHome_normal",
|
||||
@"tab_gameHome_game_normal",
|
||||
@"tab_monents_normal",
|
||||
@"tab_message_normal",
|
||||
@"tab_mine_normal"][tabIndex];
|
||||
}
|
||||
|
||||
- (NSString *)loadDefaultSelectedTabImageName:(NSInteger)tabIndex {
|
||||
return @[@"tab_gameHome_selected",
|
||||
@"tab_gameHome_game_selected",
|
||||
@"tab_monents_select",
|
||||
@"tab_message_selected",
|
||||
@"tab_mine_selected"][tabIndex];
|
||||
}
|
||||
|
||||
- (NSString *)loadConfigNormalTabImagePath:(NSInteger)tabIndex {
|
||||
return [self.normalTabImageSource xpSafeObjectAtIndex:tabIndex];
|
||||
}
|
||||
|
||||
- (NSString *)loadConfigSelectedTabImagePath:(NSInteger)tabIndex {
|
||||
return [self.selectedTabImageSource xpSafeObjectAtIndex:tabIndex];
|
||||
}
|
||||
|
||||
- (BOOL)shouldDisplayCaptcha {
|
||||
return [self.configInfo captchaSwitch];
|
||||
}
|
||||
|
||||
@end
|
||||
|
Reference in New Issue
Block a user