修复bug
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#import "XPLoginInputView.h"
|
||||
#import "XPLoginAraeViewController.h"
|
||||
#import "XPForgetPwdViewController.h"
|
||||
#import "PISwitchingEnvironmentVC.h"
|
||||
|
||||
UIKIT_EXTERN NSString * const kYouMiNumberCountKey;
|
||||
NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
|
||||
@@ -111,6 +112,11 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
|
||||
[super viewDidLoad];
|
||||
[self createUI];
|
||||
[self racBind];
|
||||
#ifdef DEBUG
|
||||
[self setSwitchingEnvironmentVC];
|
||||
#else
|
||||
#endif
|
||||
|
||||
self.selectType = 0;
|
||||
NSString *code = [NSString getCountryCode];
|
||||
self.pi_phoneAreaCode = [code stringByReplacingOccurrencesOfString:@"+" withString:@""];
|
||||
@@ -347,7 +353,25 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
|
||||
}
|
||||
|
||||
}
|
||||
-(void)setSwitchingEnvironmentVC{
|
||||
UIButton *but = [UIButton new];
|
||||
[but setTitle:@"切换环境" forState:UIControlStateNormal];
|
||||
[but setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
|
||||
[self.view addSubview:but];
|
||||
[but addTarget:self action:@selector(switchingEnvironmentVCAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
[but mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.trailing.mas_equalTo(-kGetScaleWidth(30));
|
||||
make.top.mas_equalTo(kStatusBarHeight+20);
|
||||
}];
|
||||
|
||||
}
|
||||
-(void)switchingEnvironmentVCAction{
|
||||
#ifdef DEBUG
|
||||
PISwitchingEnvironmentVC *vc = [PISwitchingEnvironmentVC new];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
#else
|
||||
#endif
|
||||
}
|
||||
- (void)setConfigPrivacyAlertView {
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
NSString *isShow = [defaults objectForKey:kYouMiNumberCountKey];
|
||||
|
@@ -238,6 +238,10 @@
|
||||
if (classStr) {
|
||||
if (![self.messageContent isKindOfClass:NSClassFromString(classStr)]) {
|
||||
self.messageContent = [[NSClassFromString(classStr) alloc] init];
|
||||
if([self.messageContent isKindOfClass:[MessageContentCustomView class]]){
|
||||
MessageContentCustomView *messageContent = (MessageContentCustomView *)self.messageContent;
|
||||
messageContent.delegate = self;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
NSAssert(classStr != nil, @"message should not be nil");
|
||||
|
@@ -56,7 +56,10 @@
|
||||
NIMUser * userInfo = users.firstObject;
|
||||
self.nameLabel.text = userInfo.userInfo.nickName;
|
||||
NSString *avatarUrl = userInfo.userInfo.avatarUrl;
|
||||
self.avatarImageView.imageUrl = avatarUrl;
|
||||
self.avatarImageView.image = nil;
|
||||
[self.avatarImageView loadImageWithUrl:avatarUrl completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
|
||||
self.avatarImageView.image = image;
|
||||
}];
|
||||
[self.nameLabel sizeToFit];
|
||||
}
|
||||
}];
|
||||
@@ -64,7 +67,10 @@
|
||||
} else {
|
||||
NSString *avatarUrl = user.userInfo.avatarUrl;
|
||||
self.nameLabel.text = user.userInfo.nickName;
|
||||
self.avatarImageView.imageUrl = avatarUrl;
|
||||
self.avatarImageView.image = nil;
|
||||
[self.avatarImageView loadImageWithUrl:avatarUrl completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
|
||||
self.avatarImageView.image = image;
|
||||
}];
|
||||
[self.nameLabel sizeToFit];
|
||||
}
|
||||
NSString *messageTitle = [NIMMessageUtils messageContent:recent.lastMessage];
|
||||
|
@@ -86,7 +86,7 @@
|
||||
@property (nonatomic, assign) NSInteger roomUid;
|
||||
@property (nonatomic,strong) WalletInfoModel * infoModel;
|
||||
@property(nonatomic,strong) UIButton *rankBtn;
|
||||
@property(nonatomic,assign) BOOL pi_IsNative;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPNobleCenterViewController
|
||||
@@ -105,7 +105,7 @@
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
self.pi_IsNative = YES;
|
||||
|
||||
[[NIMSDK sharedSDK].systemNotificationManager addDelegate:self];
|
||||
[self requestHttp];
|
||||
[self initSubViews];
|
||||
@@ -209,16 +209,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if(self.pi_IsNative == NO){
|
||||
XPWebViewController *vc = [[XPWebViewController alloc]init];
|
||||
NSString *channel = @"p";
|
||||
channel = [NSString stringWithFormat:@"%@a",channel];
|
||||
channel = [NSString stringWithFormat:@"%@y",channel];
|
||||
NSString *url = [NSString stringWithFormat:URLWithType(kChannelUrl),channel,@"5",[YYUtility deviceID]];
|
||||
vc.url = url;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
[XNDJTDDLoadingTool showOnlyView:kWindow];
|
||||
@@ -266,15 +257,8 @@
|
||||
[self.presenter getNobleChargeProductListWithChannelType:@"9"];
|
||||
[self getWalletInfo];
|
||||
|
||||
@kWeakify(self);
|
||||
[Api requestMineChannel:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
if(code == 200){
|
||||
if(data.data[@"isNative"] != nil){
|
||||
self.pi_IsNative = [data.data[@"isNative"] boolValue];
|
||||
}
|
||||
}
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
-(void)getWalletInfo{
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
|
@@ -90,45 +90,8 @@
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
#ifdef DEBUG
|
||||
[self showLoading];
|
||||
[Api requestMineChannel:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
[self hideHUD];
|
||||
if(code == 200){
|
||||
if(data.data[@"isNative"] != nil){
|
||||
BOOL is = [data.data[@"isNative"] boolValue];
|
||||
[self initWebView:is];
|
||||
}
|
||||
} else {
|
||||
[self initWebView:YES];
|
||||
}
|
||||
}];
|
||||
#else
|
||||
if(isEnterprise == YES){
|
||||
[self showLoading];
|
||||
[Api requestMineChannel:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
[self hideHUD];
|
||||
if(code == 200){
|
||||
if(data.data[@"isNative"] != nil){
|
||||
BOOL is = [data.data[@"isNative"] boolValue];
|
||||
[self initWebView:is];
|
||||
}
|
||||
return;
|
||||
}
|
||||
[self initWebView:YES];
|
||||
}];
|
||||
return;
|
||||
}else{
|
||||
[self initWebView:NO];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
-(void)initWebView:(BOOL)is{
|
||||
if(is == YES){
|
||||
[self createUI];
|
||||
[self initHttpData];
|
||||
return;
|
||||
}
|
||||
[self createUI];
|
||||
[self initHttpData];
|
||||
}
|
||||
- (void)createUI {
|
||||
self.view.backgroundColor = [UIColor whiteColor];
|
||||
|
@@ -72,7 +72,7 @@
|
||||
@property (nonatomic,strong) XPFirstRechargeCollectionView *rechargeView;
|
||||
@property (nonatomic,strong) FirstRechargeModel *currentInfo;
|
||||
@property (nonatomic,copy) NSString *orderId;
|
||||
@property(nonatomic,assign) BOOL pi_IsNative;
|
||||
|
||||
@end
|
||||
@implementation XPFirstRechargeView
|
||||
|
||||
@@ -115,14 +115,7 @@
|
||||
} channelType:@"3"];
|
||||
[self checkTranscationIds];
|
||||
|
||||
[Api requestMineChannel:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
if(code == 200){
|
||||
if(data.data[@"isNative"] != nil){
|
||||
self.pi_IsNative = [data.data[@"isNative"] boolValue];
|
||||
}
|
||||
}
|
||||
}];
|
||||
|
||||
}
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
@@ -494,13 +487,7 @@
|
||||
|
||||
- (void)rechargeButtonAction {
|
||||
|
||||
if(self.pi_IsNative == NO){
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(rechargeHandle)]){
|
||||
[self.delegate rechargeHandle];
|
||||
}
|
||||
[self backAction];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (self.currentInfo == nil|| self.currentInfo.chargeProdId == nil) {
|
||||
return;
|
||||
|
@@ -2226,15 +2226,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
#pragma mark - XPFirstRechargeViewDelegate
|
||||
-(void)rechargeHandle{
|
||||
|
||||
XPWebViewController * vc =[[XPWebViewController alloc] initWithCustomizeNav:YES];
|
||||
NSString *channel = @"p";
|
||||
channel = [NSString stringWithFormat:@"%@a",channel];
|
||||
channel = [NSString stringWithFormat:@"%@y",channel];
|
||||
NSString *url = [NSString stringWithFormat:URLWithType(kChannelUrl),channel,@"6",[YYUtility deviceID]];
|
||||
vc.url = url;
|
||||
vc.isPush = YES;
|
||||
vc.modalPresentationStyle = UIModalPresentationFullScreen;
|
||||
[self presentViewController:vc animated:YES completion:nil];
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@@ -368,6 +368,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
|
||||
///缓存新的礼物动效数据
|
||||
-(void)cacheGiftDynamicEffectList:(NSSet *)list{
|
||||
|
||||
[UploadFile downloadGiftDynamicEffectWithList:list completion:^(BOOL isSuccess, NSMutableArray * _Nonnull failList) {
|
||||
|
||||
}];
|
||||
|
@@ -293,7 +293,7 @@ static UploadFile* manager;
|
||||
NSFileManager *fileMgr = [[NSFileManager alloc] init];
|
||||
[fileMgr createDirectoryAtPath:filePath withIntermediateDirectories:YES attributes:nil error:nil];
|
||||
dispatch_group_enter(requestGroup);
|
||||
NSURL *url = [NSURL URLWithString:[encodingUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]];
|
||||
NSURL *url = [NSURL URLWithString:encodingUrl ];
|
||||
NSURLRequest *request = [NSURLRequest requestWithURL :url];
|
||||
NSURLSessionDownloadTask *download = [manager downloadTaskWithRequest:request progress:^(NSProgress * _Nonnull downloadProgress) {
|
||||
} destination:^NSURL * _Nonnull(NSURL * _Nonnull targetPath, NSURLResponse * _Nonnull response) {
|
||||
@@ -315,7 +315,7 @@ static UploadFile* manager;
|
||||
NSLog(@"下载有失败,失败数:%ld,成功数:%ld,总数:%ld",failList.count,list.count - failList.count,list.count);
|
||||
}else{
|
||||
NSLog(@"下载全部完成,总数:%ld",list.count);
|
||||
completion(NO,nil);
|
||||
completion(YES,nil);
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user