修复bug

This commit is contained in:
liyuhua
2024-05-23 11:25:18 +08:00
parent 8665848325
commit 5ddca74c84
9 changed files with 50 additions and 89 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -368,6 +368,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
///
-(void)cacheGiftDynamicEffectList:(NSSet *)list{
[UploadFile downloadGiftDynamicEffectWithList:list completion:^(BOOL isSuccess, NSMutableArray * _Nonnull failList) {
}];

View File

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