// // mineViewController.m // Private-X // // Created by xd h on 2024/6/21. // #import "mineViewController.h" #import "MineCommonUsedView.h" #import "privacyModeViewController.h" #import "TipsQRCodeForChangeDeviceViewController.h" #import "AboutViewController.h" #import "clearCacheAlretViewController.h" #import "inputPWDViewController.h" #import "customerServiceViewController.h" #import "customDownloadCacheManager.h" #import "CustomerWebViewController.h" #import "audioPlayingView.h" #import "DFPlayer.h" #import "audioPlayerViewController.h" #import "scanToPCLoginViewController.h" #import "PCLoginViewController.h" #import "cloudPhoneModelViewController.h" #import "recordViewController.h" @interface mineViewController () @property(nonatomic,strong)UIButton *netButton; @property(nonatomic,strong)UILabel *snLabel; @property(nonatomic,strong)UIButton *snCopyButton; @property(nonatomic,strong)MineCommonUsedView *MineCommonUsedV; @end @implementation mineViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. [self.view setBackgroundColor:HWF5F7FAColor]; [self.toolBar setHidden:YES]; [self.navigationBar setHidden:YES]; [self.navBarBGView setHidden:YES]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(PCLoginDidPopFun) name:showTabbarNotification object:nil]; [self drawAnyView]; } - (void)drawAnyView{ //顶底底部图片 UIImageView *topImageV = [UIImageView new]; topImageV.image = [UIImage imageNamed:@"Nas_top_img"]; [self.view addSubview:topImageV]; [topImageV mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(0); make.left.mas_equalTo(0); make.right.mas_equalTo(0); make.height.mas_equalTo(280.0*AUTOSCALE); }]; UIButton *pcScanButton = [[UIButton alloc] init]; [pcScanButton setImage:[UIImage imageNamed:@"pc_scan_icon"] forState:UIControlStateNormal]; pcScanButton.tag = 100; [pcScanButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:pcScanButton]; [pcScanButton mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(50); make.right.mas_equalTo(-15); make.width.mas_equalTo(40); make.height.mas_equalTo(40); }]; CGFloat tipImageTop = 50 + 40; //商标图片 UIImageView *TipImageV = [UIImageView new]; TipImageV.image = [UIImage imageNamed:@"mine_head_icon"]; [self.view addSubview:TipImageV]; [TipImageV mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(tipImageTop); make.left.mas_equalTo(16); make.width.mas_equalTo(48); make.height.mas_equalTo(48); }]; _snLabel = [[UILabel alloc] init]; _snLabel.font = [UIFont boldSystemFontOfSize:14.0]; _snLabel.textColor = [UIColor hwColor:@"#0A132B"]; //_fileNamelabel.backgroundColor = [UIColor greenColor]; [self.view addSubview:_snLabel]; [_snLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(TipImageV.mas_right).offset(5); make.right.mas_equalTo(-16); //make.centerY.mas_equalTo(TipImageV.mas_centerY).offset(0); make.top.mas_equalTo(TipImageV.mas_top).offset(0); make.height.mas_equalTo(20); }]; // UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(copySnFun)]; // [_snLabel addGestureRecognizer:tap]; _snCopyButton = [[UIButton alloc] init]; _snCopyButton.tag = 1; [_snCopyButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:_snCopyButton]; //_snCopyButton.backgroundColor = [UIColor redColor]; [_snCopyButton mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(_snLabel.mas_left); make.top.equalTo(_snLabel.mas_top).offset(-5); make.right.mas_equalTo(_snLabel.mas_right); make.bottom.equalTo(_snLabel.mas_bottom).offset(2); }]; _netButton = [[UIButton alloc] init]; [_netButton setImage:[UIImage imageNamed:@"mine_net_icon"] forState:UIControlStateNormal]; [_netButton setTitleColor:[UIColor hwColor:@"#058DFB"] forState:UIControlStateNormal]; _netButton.titleLabel.font = [UIFont systemFontOfSize:12.0]; //[_netButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside]; _netButton.userInteractionEnabled = NO; [self.view addSubview:_netButton]; _netButton.layer.cornerRadius = 12; _netButton.layer.borderWidth = 1.5; _netButton.layer.borderColor = [UIColor hwColor:@"#058DFB"].CGColor; _netButton.layer.masksToBounds = YES; [_netButton mas_makeConstraints:^(MASConstraintMaker *make) { //make.width.mas_equalTo(58); make.width.mas_equalTo(70); make.height.mas_equalTo(24); make.left.equalTo(TipImageV.mas_right).offset(5); make.bottom.mas_equalTo(TipImageV.mas_bottom).offset(0); }]; //常用功能 _MineCommonUsedV = [[MineCommonUsedView alloc] init]; [self.view addSubview:_MineCommonUsedV]; [_MineCommonUsedV mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(TipImageV.mas_bottom).offset(15); make.left.mas_equalTo(0); make.right.mas_equalTo(0); make.height.mas_equalTo(210); }]; KWeakSelf _MineCommonUsedV.didClickButtonFun = ^(NSInteger tag) { [weakSelf didClickCommonUsedFunBy:tag]; }; } #pragma mark 点击常用模块模块 - (void)didClickCommonUsedFunBy:(NSInteger)tag { if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable) { [[iToast makeText:NSLocalizedString(@"phone_network_fail_Tips",nil)] show]; return; } switch (tag) { case 10:{//隐私模式 inputPWDViewController *nextVC = [inputPWDViewController new]; nextVC.isCheckPwdType = YES; [self pushViewController:nextVC animated:YES]; KWeakSelf nextVC.didInputRightPwdFun = ^{ [weakSelf gotoPrivacyModeVCFun]; }; } break; // case 11:{//云手机模式 // cloudPhoneModelViewController *nextVC = [cloudPhoneModelViewController new]; // [self pushViewController:nextVC animated:YES]; // } // break; // case 12:{//帮助与反馈 // // CustomerWebViewController *vc = [[CustomerWebViewController alloc] init]; // vc.titleStr = NSLocalizedString(@"mine_help_title",nil); // NSString *url = [[NSString alloc] initWithFormat:@"%@/problemFeedback/#/pages/fileSharing/problem/index?sn=",CloudService]; // vc.webUrl = [[NSString alloc] initWithFormat:@"%@%@",url,ksharedAppDelegate.DeviceThirdIdMod.data.changeSn]; // [self pushViewController:vc animated:YES]; // // //数据埋点 // [[netWorkManager shareInstance] DataEmbeddingPointBy:2 withEventValue:@"Help_feedback"]; // // } break; case 11:{//更换手机 TipsQRCodeForChangeDeviceViewController *nextVC = [TipsQRCodeForChangeDeviceViewController new]; [self pushViewController:nextVC animated:YES]; break; } case 12:{//联系客服 customerServiceViewController *vc = [customerServiceViewController new]; [self pushViewController:vc animated:YES]; } break; case 13:{//清理缓存 [self clickClearCacheButtonFun]; } case 14:{//版本信息 AboutViewController *nextVC = [[AboutViewController alloc] init]; nextVC.getSysInfo = ^{ [[webRtcManager shareManager] getSysInfoFun]; }; [self pushViewController:nextVC animated:YES]; } break; case 15:{//录音机 recordViewController *vc = [[recordViewController alloc] init]; [self pushViewController:vc animated:YES]; } break; // case 17:{//新手引导 // CustomerWebViewController *vc = [[CustomerWebViewController alloc] init]; // vc.titleStr = NSLocalizedString(@"mine_newuser_title",nil); // NSString *url = [[NSString alloc] initWithFormat:@"%@/warrantyService/index.html#/novice",CloudService]; // vc.webUrl = url; // [self pushViewController:vc animated:YES]; // } // break; // case 17:{ // [[iToast makeText:@"点击了注销"] show]; // } // break; default: break; } } #pragma mark 去设置隐私 - (void)gotoPrivacyModeVCFun { privacyModeViewController *nextVC = [[privacyModeViewController alloc] init]; [self pushViewController:nextVC animated:YES]; } #pragma mark 清理缓存相关 - (void)clickClearCacheButtonFun { KWeakSelf /*弹窗提示清除缓存*/ clearCacheAlretViewController *nextVC = [[clearCacheAlretViewController alloc] initWithTiTle:NSLocalizedString(@"my_set_no_clear_cache",nil) msg:NSLocalizedString(@"clear_cache_tip",nil) imageStr:nil cancelTitle:NSLocalizedString(@"other_cancel",nil) okTitle:NSLocalizedString(@"other_clear",nil) isOkBtnHighlight:YES didClickOk:^(BOOL isSelect) { [weakSelf handleClearCacheFunWith:isSelect]; } didClickCancel:^{ }]; nextVC.modalPresentationStyle = UIModalPresentationCustom; [self presentViewController:nextVC animated:YES completion:^{ nextVC.view.superview.backgroundColor = [UIColor clearColor]; }]; } - (void)handleClearCacheFunWith:(BOOL)isSelectFileTransfer { [self ClearCommonCacheFun:isSelectFileTransfer]; //数据埋点 [[netWorkManager shareInstance] DataEmbeddingPointBy:2 withEventValue:@"Clear_cache"]; } - (void)ClearCommonCacheFun:(BOOL)isSelectFileTransfer { NSString *ruiyunLogPath = [NSString stringWithFormat:@"%@/logs/debug_0.log",CachesPatch]; long logSize1 = [iTools fileSizeAtPath:ruiyunLogPath]; [[NSFileManager defaultManager] removeItemAtPath:ruiyunLogPath error:nil]; NSString *appLogPath = [NSString stringWithFormat:@"%@/logs/app.log",CachesPatch]; long logSize2 = [iTools fileSizeAtPath:appLogPath]; [[NSFileManager defaultManager] removeItemAtPath:appLogPath error:nil]; // NSString *downLoadThumbnailPath = [NSString stringWithFormat:@"%@/DownLoadThumbnail",CachesPatch]; long logSize3 = [iTools folderSizeAtPath:downLoadThumbnailPath]; [[NSFileManager defaultManager] removeItemAtPath:downLoadThumbnailPath error:nil]; NSString *downLoadNasDowmPath = [customDownloadCacheManager getFullDirector]; long logSize4 = [iTools folderSizeAtPath:downLoadNasDowmPath]; [[NSFileManager defaultManager] removeItemAtPath:downLoadNasDowmPath error:nil]; long clearTotal = logSize1 + logSize2 + logSize3 +logSize4 ; if(isSelectFileTransfer){ [self clearCacheByFileTransferFun:clearTotal]; } else{ [self showClearAllTipBy:clearTotal]; } } - (void)showClearAllTipBy:(long)clearTotal { long clearTotalK = clearTotal /1024; NSString *tipStr1 = NSLocalizedString(@"my_set_no_clear_finish",nil); NSString *tipStr2 = @""; if(clearTotalK > 1024*1024){ tipStr2 = [[NSString alloc] initWithFormat:@"%.02fGB",clearTotalK/1024.0/1024.0]; } else if(clearTotalK > 1024){ tipStr2 = [[NSString alloc] initWithFormat:@"%.02fMB",clearTotalK/1024.0]; } else //if(clearTotalK > 0) { tipStr2 = [[NSString alloc] initWithFormat:@"%ldKB",clearTotalK]; } NSString *tipfullStr = [[NSString alloc] initWithFormat:@"%@%@",tipStr1,tipStr2]; //提示语 [[iToast makeText:tipfullStr] show]; } - (void)clearCacheByFileTransferFun:(long)clearTotal { //清理图片 BOOL needReUploadingType = NO; NSString *ImagePath = [NSString stringWithFormat:@"%@/Image",CachesPatch]; long imageAllSize = [iTools folderSizeAtPath:ImagePath]; // if([uploadFileManager shareInstance].curUploadFileDataModel // && [uploadFileManager shareInstance].curUploadFileDataModel.curUploadFileType == uploadFileTypeImage // && [uploadFileManager shareInstance].curUploadFileDataModel.curUploadStateType == uploadStateUploading){ // // [uploadFileManager shareInstance].curUploadFileDataModel.curUploadStateType = uploadStateSuspend; // needReUploadingType = YES; // } [[NSFileManager defaultManager] removeItemAtPath:ImagePath error:nil]; // if(needReUploadingType){ // dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ // [uploadFileManager shareInstance].curUploadFileDataModel.curUploadStateType = uploadStateUploading; // }); // } //清理视频文件 NSString *videoPath = [NSString stringWithFormat:@"%@/Video",CachesPatch]; long vide0AllSizeBeforeClear = [iTools folderSizeAtPath:videoPath]; NSString *backupsingVideoName = nil; if([nasBackupsManager shareInstance].curPhotosBackupsTaskMod && [nasBackupsManager shareInstance].curPhotosBackupsTaskMod.curUploadFileType == uploadFileTypeVideo){ backupsingVideoName = [nasBackupsManager shareInstance].curPhotosBackupsTaskMod.filename; } NSString *uploadingVideoName = nil; // if([uploadFileManager shareInstance].curUploadFileDataModel // && [uploadFileManager shareInstance].curUploadFileDataModel.curUploadFileType == uploadFileTypeVideo){ // uploadingVideoName = [uploadFileManager shareInstance].curUploadFileDataModel.filename; // } if(backupsingVideoName || uploadingVideoName){ NSMutableString *fileName = [NSMutableString new]; if(backupsingVideoName){ [fileName appendString:backupsingVideoName]; } if(uploadingVideoName){ if(fileName.length > 0){ [fileName appendString:@"|"]; } [fileName appendString:uploadingVideoName]; } [self deleteFilesInDirectoryAtPath:videoPath withOutFileName:fileName]; } else{ [[NSFileManager defaultManager] removeItemAtPath:videoPath error:nil]; } long vide0AllSizeAfterClear = [iTools folderSizeAtPath:videoPath]; //清理下载中 NSString *downLoadingPath = [NSString stringWithFormat:@"%@/DownLoadFlie",CachesPatch]; long downLoadingSizeBeforeClear = [iTools folderSizeAtPath:downLoadingPath]; // NSString *downLoadingFileName = nil; // if([downloadManager shareInstance].curDownloadFileModel // && ([downloadManager shareInstance].curDownloadFileModel.curDownloadStateType == downloadStateUploading // ||[downloadManager shareInstance].curDownloadFileModel.curDownloadStateType == downloadStateSuspend)){ // downLoadingFileName = [[downloadManager shareInstance].curDownloadFileModel getFileNameFun]; // // [self deleteFilesInDirectoryAtPath:downLoadingPath withOutFileName:downLoadingFileName]; // } // else{ // [[NSFileManager defaultManager] removeItemAtPath:downLoadingPath error:nil]; // } [[NSFileManager defaultManager] removeItemAtPath:downLoadingPath error:nil]; long downLoadingSizeAfterClear = [iTools folderSizeAtPath:downLoadingPath]; //清理数据库表 完成的 //下载完成 NSMutableString* where = [[NSMutableString alloc] initWithString:@"where "]; NSString *curStr = [NSString stringWithFormat:@"%@=%@ or %@=%@ ",bg_sqlKey(@"curDownloadStateType"),bg_sqlValue([NSNumber numberWithInt:downloadStateDone]),bg_sqlKey(@"curDownloadStateType"),bg_sqlValue([NSNumber numberWithInt:downloadStateFail])]; [where appendString:curStr]; [couldPhoneFileModel bg_deleteAsync:download_tableName where:where complete:^(BOOL isSuccess) { }]; //上传完成 NSMutableString* where2 = [[NSMutableString alloc] initWithString:@"where "]; NSString *curStr2 = [NSString stringWithFormat:@"%@=%@ or %@=%@ ",bg_sqlKey(@"curUploadStateType"),bg_sqlValue([NSNumber numberWithInt:uploadStateDone]), bg_sqlKey(@"curUploadStateType"),bg_sqlValue([NSNumber numberWithInt:uploadStateFail])]; [where2 appendString:curStr2]; [uploadFileDataModel bg_deleteAsync:upLoadFile_image_tableName where:where2 complete:^(BOOL isSuccess) { }]; //清理音频播放缓存 NSString *audioPlayPath = [NSString stringWithFormat:@"%@/%@",DocumentPath,@"playAudioCache"];; long audioPlayAllSize = [iTools folderSizeAtPath:audioPlayPath]; [[NSFileManager defaultManager] removeItemAtPath:audioPlayPath error:nil]; //清理文件APP NSString *fileAPPPath = kSHPath_FileAPP; long fileAppPathClear = [iTools folderSizeAtPath:fileAPPPath]; [[NSFileManager defaultManager] removeItemAtPath:fileAPPPath error:nil]; long curTotolSize = (downLoadingSizeBeforeClear - downLoadingSizeAfterClear) + (vide0AllSizeBeforeClear - vide0AllSizeAfterClear) + imageAllSize + clearTotal + audioPlayAllSize + fileAppPathClear; [self showClearAllTipBy:curTotolSize]; } - (BOOL)deleteFilesInDirectoryAtPath:(NSString *)path withOutFileName:(NSString*)fileNames { NSFileManager *fileManager = [NSFileManager defaultManager]; NSArray *fileNameArr = [fileNames componentsSeparatedByString:@"|"]; // 使用NSDirectoryEnumerator遍历目录 NSDirectoryEnumerator *directoryEnumerator = [fileManager enumeratorAtPath:path]; NSString *fileName; while ((fileName = [directoryEnumerator nextObject])) { BOOL canDelType = YES; for (NSString*noDelfileName in fileNameArr) { if([noDelfileName isEqualToString:fileName]){ canDelType = NO; break; } } if(canDelType){ NSString *filePath = [path stringByAppendingPathComponent:fileName]; // 如果是文件,则删除它 if ([fileManager fileExistsAtPath:filePath]) { BOOL success = [fileManager removeItemAtPath:filePath error:nil]; if (!success) { // 如果删除失败,返回NO并处理错误 return NO; } } } } // 所有文件都成功删除,返回YES return YES; } #pragma mark 数据设置 - (void)setDataFun { NSString *SNLeftStr = [[NSString alloc] initWithFormat:@"SN:%@",ksharedAppDelegate.DeviceThirdIdMod.data.changeSn]; NSString *SNMidStr = @" | "; NSString *SNRightStr = NSLocalizedString(@"common_copy",nil); NSString *fullTitle = [[NSString alloc] initWithFormat:@"%@%@%@",SNLeftStr,SNMidStr,SNRightStr]; NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:fullTitle]; NSRange midRange = NSMakeRange([fullTitle rangeOfString:SNMidStr].location, [fullTitle rangeOfString:SNMidStr].length); UIColor *midColor =[UIColor hwColor:@"#828D9A" alpha:1.0]; [attrStr addAttribute:NSForegroundColorAttributeName value:midColor range:midRange]; NSRange rightRange = NSMakeRange([fullTitle rangeOfString:SNRightStr].location, [fullTitle rangeOfString:SNRightStr].length); UIColor *rightColor =[UIColor hwColor:@"#058DFB" alpha:1.0]; [attrStr addAttribute:NSForegroundColorAttributeName value:rightColor range:rightRange]; _snLabel.attributedText = attrStr; NSString *NetButText = NSLocalizedString(@"mine_net_LAN",nil); if(![pingManager shareManager].isPingOk){ NetButText = NSLocalizedString(@"mine_net_WAN",nil); } RTCDataChannelState state = [webRtcManager shareManager].channelState; if(state != RTCDataChannelStateOpen ||!ksharedAppDelegate.isWebSockLinkOKAginType//断开了 ) { NetButText = NSLocalizedString(@"mine_net_unLink",nil); } [_netButton setTitle:NetButText forState:UIControlStateNormal]; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [self setDataFun]; [self handelAudioPlayingViewFun]; } - (void)viewWillDisappear:(BOOL)animated{ [super viewWillDisappear:animated]; } - (void)pushViewController:(UIViewController*)vc animated:(BOOL)animated { [self.navigationController pushViewController:vc animated:animated]; } #pragma mark 处理音频播放中的视图状态 - (void)handelAudioPlayingViewFun { audioPlayingView * audioPlayingV = [audioPlayingView sharedInstance]; if([DFPlayer sharedPlayer].state == DFPlayerStateBuffering ||[DFPlayer sharedPlayer].state == DFPlayerStatePlaying ||[DFPlayer sharedPlayer].state == DFPlayerStatePause){//播放中 [self showAudioPlayingViewFun]; } else{ [self hideAudioPlayingViewFun]; } KWeakSelf audioPlayingV.didClickButtonFun = ^(NSInteger tag) { if(tag == 1){ [weakSelf hideAudioPlayingViewFun]; } else if(tag == 5){ [weakSelf AudioPlayingGotoAudioPlayerVCFun]; } }; } - (void)AudioPlayingGotoAudioPlayerVCFun{ audioPlayerViewController *vc = [audioPlayerViewController new]; vc.isfirstEnterType = NO; [self.navigationController pushViewController:vc animated:YES]; } #pragma mark 显示音频播放中的视图 - (void)showAudioPlayingViewFun { audioPlayingView * audioPlayingV = [audioPlayingView sharedInstance]; [self.view addSubview:audioPlayingV]; if([DFPlayer sharedPlayer].state == DFPlayerStatePlaying){ [audioPlayingV startRotatingImage]; } else if ([DFPlayer sharedPlayer].state == DFPlayerStatePause){ [audioPlayingV stopRotatingImage]; } [audioPlayingV mas_makeConstraints:^(MASConstraintMaker *make) { make.height.mas_equalTo(49); make.left.mas_equalTo(0); make.right.mas_equalTo(0); make.bottom.mas_equalTo(-TABBARHEIGHT); }]; } #pragma mark 隐藏音频播放中的视图 - (void)hideAudioPlayingViewFun { // audioPlayingView * audioPlayingV = [audioPlayingView sharedInstance]; // [audioPlayingV removeFromSuperview]; } #pragma mark 点击PC 扫码登录 - (void)didClickButtonFun:(UIButton*)but { NSInteger tag = but.tag; if(tag == 100){ //test code // [self getPCloginFun]; scanToPCLoginViewController *nextVC = [scanToPCLoginViewController new]; [self.navigationController pushViewController:nextVC animated:YES]; } else if(tag == 1){ [self copySnFun]; } } #pragma mark 复制SN - (void)copySnFun { NSString *snStr = ksharedAppDelegate.DeviceThirdIdMod.data.changeSn; UIPasteboard * Pasteboard = [UIPasteboard generalPasteboard]; Pasteboard.string = snStr; NSString *tipStr = NSLocalizedString(@"sn_copy_suc",nil); [[iToast makeText:tipStr] show]; } #pragma mark PC 获取码登录 -(void)getPCloginFun { NSMutableDictionary *paraDict = [NSMutableDictionary new]; KWeakSelf [[netWorkManager shareInstance] CommonGetWithCallBackCode:@"/box/login/addAndGetOne" Parameters:paraDict success:^(id _Nonnull responseObject){ SuperModel *ShareMarkMod = [[SuperModel alloc] initWithDictionary:responseObject error:nil]; if(ShareMarkMod){ [weakSelf scanToPCloginFunWithID:responseObject[@"data"][@"boxLoginId"]]; } } failure:^(NSError * _Nonnull error) { }]; } #pragma mark PC 扫码登录 -(void)scanToPCloginFunWithID:(NSString*)idStr { NSString *changSN = ksharedAppDelegate.DeviceThirdIdMod.data.changeSn; NSMutableDictionary *paraDict = [NSMutableDictionary new]; [paraDict setValue:@1 forKey:@"status"]; [paraDict setValue:idStr forKey:@"boxLoginId"]; [paraDict setValue:changSN forKey:@"sn"]; KWeakSelf [[netWorkManager shareInstance] CommonPostCallBackCode:updatePCLoginStateFun Parameters:paraDict success:^(id _Nonnull responseObject){ SuperModel *curModel = [[SuperModel alloc] initWithDictionary:responseObject error:nil]; if(curModel && curModel.status == 0){ [weakSelf gotoNextVCFunWithID:idStr]; } else { if(curModel.msg){ [[iToast makeText:curModel.msg] show]; } else{ [[iToast makeText:@"扫码信息错误"] show]; } [weakSelf.navigationController popViewControllerAnimated:YES]; } } failure:^(NSError * _Nonnull error) { //[[iToast makeText:@"扫码信息错误"] show]; [weakSelf.navigationController popViewControllerAnimated:YES]; }]; } #pragma mark 跳转下个界面 - (void)gotoNextVCFunWithID:(NSString*)idStr { PCLoginViewController *nextVC = [PCLoginViewController new]; nextVC.loginIdString = idStr; [self.navigationController pushViewController:nextVC animated:YES]; } #pragma mark Pc登录页面Pop出来 - (void)PCLoginDidPopFun { dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self showTabbarFun]; }); } @end