| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249 |
- //
- // NASViewController.m
- // 双子星云手机
- //
- // Created by xd h on 2024/6/19.
- //
- #import "NASViewController.h"
- #import "NASMySpaceView.h"
- #import "NASCommonUsedView.h"
- #import "shareSecretTableViewCell.h"
- #import "NASLastFileView.h"
- #import "previewImageOrVideoViewController.h"
- #import "previewAudioOrDocumentViewController.h"
- #import "previewFileAndFolderViewController.h"
- #import "shareRecordViewController.h"
- #import "backupsOptionViewController.h"
- #import "fileTransfeSetViewController.h"
- #import "uploadFileRecordViewController.h"
- #import "previewToUploadFileView.h"
- #import "NASMySpaceViewController.h"
- #import "NasPreviewVideoViewController.h"
- #import "lastFileManager.h"
- #import "lastFileTableViewCell.h"
- #import "nasLastFileViewController.h"
- #import "audioPlayerViewController.h"
- #import "videoPlayByAVPlayerViewController.h"
- #import "imageDetailsScrollViewController.h"
- #import "queryShareModel.h"
- #import "imageVersionRenewTipView.h"
- #import "HWVersionModel.h"
- #import "HaveNewVersionView.h"
- #import "newerGuideView.h"
- #import "CustomerWebViewController.h"
- #import "noticeModel.h"
- #import "HaveNoticeView.h"
- #import "audioPlayingView.h"
- #import "DFPlayer.h"
- #import "queryShareReportMarkModel.h"
- @interface NASViewController ()<UITableViewDelegate,UITableViewDataSource>
- {
- BOOL canShareType;
-
- UIImageView *welcomeImageV;//弃用
- UIView* rightRedView;//
- BOOL hadUploadTaskType;
- BOOL hadDownloadTaskType;
-
- BOOL didGetSysInfoType;//是否收到过系统信息用在---用来判断是否要走弹框流程
- NSInteger tryLinkNum;
- }
- @property (nonatomic,strong)UITableView*tableView;
- @property (nonatomic, strong) UIView*tableHeadView;
- @property (nonatomic, strong) NASMySpaceView* NASMySpaceV;
- @property (nonatomic, strong) NASCommonUsedView* NASCommonUsedV;
- @property (nonatomic,strong)NASLastFileView*NASLastFileV;
- @property (nonatomic,strong) NSMutableArray *lastFileDataArr;
- @end
- @implementation NASViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view.
-
- [self.view setBackgroundColor:HWF5F7FAColor];
-
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(getExtraFilesDoneFun:) name:getExtraFilesDoneNotification object:nil];
-
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(getCouldPhoneSysInfoFun:) name:getCouldPhoneSysInfoNotification object:nil];
-
- [self.toolBar setHidden:YES];
- [self.navigationBar setHidden:YES];
- [self.navBarBGView setHidden:YES];
-
- [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);
- }];
-
- // NSString *welcomeImageStr = @"nas_welcome_cs";
- // //欢迎
- // //en-US 英文 ja-JP 日文
- // NSArray *arLanguages = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"];
- // NSLog(@"arLanguages:%@",arLanguages);
- // ///获取设备当前地区的代码和APP语言环境
- // NSString *languageCode = [NSLocale preferredLanguages][0];
- //
- // //目前支持 中文(简体 繁体) 英文 日语
- // if([languageCode rangeOfString:@"zh-Hans"].location != NSNotFound)
- // {
- // welcomeImageStr = @"nas_welcome_cs";
- // }
- // else if([languageCode rangeOfString:@"zh-Hant"].location != NSNotFound)
- // {
- // welcomeImageStr = @"nas_welcome_ct";
- // }
- // else{
- // welcomeImageStr = @"nas_welcome_en";
- // }
-
- CGFloat imageTopY = 54.0;
- welcomeImageV = [UIImageView new];
- welcomeImageV.hidden = YES;
- //welcomeImageV.image = [UIImage imageNamed:welcomeImageStr];
- [self.view addSubview:welcomeImageV];
-
- [welcomeImageV mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(imageTopY);
- make.left.mas_equalTo(16);
- make.width.mas_equalTo(210);
- make.height.mas_equalTo(24);
- }];
-
- UILabel *welcomelabel = [[UILabel alloc] init];
- welcomelabel.text = NSLocalizedString(@"NAS_top_welcome_title",nil);
- welcomelabel.textColor = [UIColor hwColor:@"#0A132B"];
- welcomelabel.font = [UIFont boldSystemFontOfSize:18.0];
- [self.view addSubview:welcomelabel];
-
- [welcomelabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(imageTopY);
- make.left.mas_equalTo(16);
- make.width.mas_equalTo(240);
- make.height.mas_equalTo(24);
- }];
-
- //添加按钮
- UIButton *addButton = [[UIButton alloc] init];
- [addButton setImage:[UIImage imageNamed:@"nas_add_icon"] forState:UIControlStateNormal];
- addButton.tag = 1;
- [addButton addTarget:self action:@selector(didClickHeadButtonFun:) forControlEvents:UIControlEventTouchUpInside];
- [self.view addSubview:addButton];
-
- [addButton mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerY.equalTo(welcomeImageV.mas_centerY).offset(0);
- make.right.mas_equalTo(-10);
- make.width.mas_equalTo(40);
- make.height.mas_equalTo(40);
- }];
-
- UIButton *rightTransferListButton = [[UIButton alloc] init];
- //[rightTransferListButton setImage:[UIImage imageNamed:@"icon_file_transfer"] forState:UIControlStateNormal];
- [rightTransferListButton setImage:[UIImage imageNamed:@"icon_file_transfer"] forState:UIControlStateNormal];
- rightTransferListButton.tag = 2;
- [rightTransferListButton addTarget:self action:@selector(didClickHeadButtonFun:) forControlEvents:UIControlEventTouchUpInside];
- [self.view addSubview:rightTransferListButton];
-
- [rightTransferListButton mas_makeConstraints:^(MASConstraintMaker *make) {
- //make.top.mas_equalTo(imageTopY);
- make.centerY.equalTo(welcomeImageV.mas_centerY).offset(0);
- make.right.equalTo(addButton.mas_left).offset(0);
- make.width.mas_equalTo(40);
- make.height.mas_equalTo(40);
- }];
-
- rightRedView = [[UIView alloc] init];
- rightRedView.backgroundColor = [UIColor hwColor:@"#DD4E4E" alpha:1.0];
- [rightTransferListButton addSubview:rightRedView];
- rightRedView.layer.cornerRadius = 7;
- rightRedView.hidden = YES;
-
- [rightRedView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.width.mas_equalTo(14);
- make.height.mas_equalTo(14);
- make.right.mas_equalTo(0);
- make.top.mas_equalTo(6);
- }];
-
- [self.view addSubview:self.tableView];
- [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(0);
- make.right.mas_equalTo(0);
- make.top.equalTo(welcomeImageV.mas_bottom).offset(20);
- make.bottom.mas_equalTo(-TABBARHEIGHT);
- }];
-
- _tableHeadView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 165+ 15 +120 +54 + 15)];
- //_tableHeadView.backgroundColor = [UIColor hwColor:@"#F6F8FA"];
- _tableHeadView.backgroundColor = [UIColor clearColor];
- self.tableView.tableHeaderView = _tableHeadView;
-
-
- //我的空间
- _NASMySpaceV = [[NASMySpaceView alloc] init];
- [_tableHeadView addSubview:_NASMySpaceV];
-
- [_NASMySpaceV mas_makeConstraints:^(MASConstraintMaker *make) {
- //make.top.equalTo(welcomeImageV.mas_bottom).offset(20);
- make.top.mas_equalTo(0);
- make.left.mas_equalTo(0);
- make.right.mas_equalTo(0);
- make.height.mas_equalTo(165);
- }];
-
- //常用功能
- _NASCommonUsedV = [[NASCommonUsedView alloc] init];
- [_tableHeadView addSubview:_NASCommonUsedV];
-
- [_NASCommonUsedV mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.equalTo(_NASMySpaceV.mas_bottom).offset(15);
- make.left.mas_equalTo(0);
- make.right.mas_equalTo(0);
- make.height.mas_equalTo(120);
- }];
-
- //最近文件
- [_tableHeadView addSubview:self.NASLastFileV];
- [self.NASLastFileV mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.equalTo(_NASCommonUsedV.mas_bottom).offset(15);
- make.left.mas_equalTo(0);
- make.right.mas_equalTo(0);
- make.height.mas_equalTo(54);
- }];
-
- BOOL isShowLastFileType = [HWDataManager getBoolWithKey:Const_last_file_show];
- self.NASLastFileV.eyeButton.selected = !isShowLastFileType;
-
- //tableFooterView
- NSString *text = NSLocalizedString(@"NAS_bottom_tip",nil);
- UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 50)];
- label.text = [[NSString alloc] initWithFormat:@"- %@ -",text];
- label.textColor = [UIColor hwColor:@"#959799"];
- label.font = [UIFont systemFontOfSize:12];
- label.textAlignment = NSTextAlignmentCenter;
- self.tableView.tableFooterView = label;
-
- KWeakSelf
- _NASMySpaceV.didClickButtonFun = ^(NSInteger tag) {
- [weakSelf didClickMySpaceFunBy:tag];
- };
-
- _NASCommonUsedV.didClickButtonFun = ^(NSInteger tag) {
- [weakSelf didClickCommonUsedFunBy:tag];
- };
-
- self.NASLastFileV.didClickButtonFun = ^(NSInteger tag) {
- [weakSelf didClickLastFileFunBy:tag];
- };
-
- [self setMySpaceDataFun];
- }
- #pragma mark - 懒加载
- - (UITableView *)tableView{
- if (!_tableView) {
- _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 0, 0) style:UITableViewStylePlain];
- _tableView.delegate = self;
- _tableView.dataSource = self;
- _tableView.showsVerticalScrollIndicator = NO;
- _tableView.showsHorizontalScrollIndicator = NO;
- // _tableView.contentInset = UIEdgeInsetsMake(-H_STATE_BAR, 0, 0, 0);
- [_tableView setSeparatorStyle:(UITableViewCellSeparatorStyleNone)];
- [_tableView setSeparatorColor:[UIColor clearColor]];
- //[_tableView setBackgroundColor:[UIColor hwColor:@"#FFFFFF"]];
- [_tableView setBackgroundColor:[UIColor clearColor]];
- //[_tableView setTableFooterView:[UIView new]];
- [_tableView setBounces:YES];
-
- if (@available(iOS 15.0, *)) {
- _tableView.sectionHeaderTopPadding = 0;
- }
-
- _tableView.layer.cornerRadius = 8;
- _tableView.layer.masksToBounds = YES;
- }
-
- return _tableView;
- }
- - (NASLastFileView*)NASLastFileV
- {
- if(!_NASLastFileV){
- _NASLastFileV = [NASLastFileView new];
- }
- return _NASLastFileV;
- }
- #pragma mark - 列表委托
- - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
- return 1;
- }
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
- if(!_lastFileDataArr){
- return 0;
- }
- return _lastFileDataArr.count;
- }
- - (lastFileTableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
-
- __block NSInteger row = indexPath.row;
- static NSString *identifier = @"lastFileTableViewCell";
-
- lastFileTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- if (!cell){
- cell = [[lastFileTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
- [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
- [cell setBackgroundColor:[UIColor clearColor]];
- [cell setAccessoryType:(UITableViewCellAccessoryNone)];
- [cell hideCheckButtonBy:YES];
- }
-
- if(row < _lastFileDataArr.count){
- lastFileModel* dataModel = _lastFileDataArr[row];
- cell.curLastFileModel = dataModel;
-
- // KWeakSelf
- // cell.didClickSwitch = ^(BOOL SwitchOn) {
- // //[weakSelf userCheckFilePreviewByRow:row];
- // };
-
- cell.cellBgView.layer.mask = nil;
- if(row == _lastFileDataArr.count -1){
- /*下圆角*/
- UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-32 , 84)
- byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight
- cornerRadii:CGSizeMake(12, 12)];
- CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
- maskLayer.frame = cell.cellBgView.bounds;
- maskLayer.path = maskPath.CGPath;
- cell.cellBgView.layer.mask = maskLayer;
- }
- }
-
- return cell;
- }
- - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
- return 84;
- }
- - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
- {
- NSInteger row = indexPath.row;
-
- if(row < _lastFileDataArr.count){
- lastFileModel* dataModel = _lastFileDataArr[row];
-
- if([dataModel.type isEqualToString:@"video"]){
- videoPlayByAVPlayerViewController *vc = [videoPlayByAVPlayerViewController new];
- vc.VideoDataMode = (NASFileAndFolderDataModel*)dataModel;
- [self.navigationController pushViewController:vc animated:YES];
- }
- else if([dataModel.type isEqualToString:@"audio"]){
-
- // NSMutableArray *audioDataArr = [NSMutableArray new];
- // NSInteger index = 0;
- //
- // for (int i=0; i<_lastFileDataArr.count; i++) {
- // lastFileModel* audioDataModel = _lastFileDataArr[i];
- // if([audioDataModel.type isEqualToString:@"audio"]){
- //
- // if(i == row){
- // index = audioDataArr.count;
- // }
- //
- // [audioDataArr addObject:audioDataModel];
- // }
- // }
-
- audioPlayerViewController *vc = [audioPlayerViewController new];
- vc.isfirstEnterType = YES;
- vc.outSideDataModel = (NASFileAudioDataModel *)dataModel;
- [self.navigationController pushViewController:vc animated:YES];
-
- KWeakSelf
- vc.didNeedDeleteFile = ^(NSString * _Nonnull filePath) {
- [weakSelf getLastFileDataFun];
- };
- }
- else if([dataModel.type containsString:@"jpg"]){
-
- NSMutableArray *jpgDataArr = [NSMutableArray new];
- NSInteger index = 0;
-
- for (int i=0; i<_lastFileDataArr.count; i++) {
- lastFileModel* jpgDataModel = _lastFileDataArr[i];
- if([jpgDataModel.type containsString:@"jpg"]){
- if(i == row){
- index = jpgDataArr.count;
- }
- [jpgDataArr addObject:jpgDataModel];
- }
- }
-
- imageDetailsScrollViewController *vc = [imageDetailsScrollViewController new];
- vc.index = index;
- vc.totalDataArr = jpgDataArr;
- [self.navigationController pushViewController:vc animated:YES];
- vc.canShareType = canShareType;
-
- }
- }
- }
- #pragma mark 点击头部
- - (void)didClickHeadButtonFun:(UIButton*)but
- {
- if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable)
- {
- [[iToast makeText:NSLocalizedString(@"phone_network_fail_Tips",nil)] show];
- return;
- }
-
- NSInteger tag = but.tag;
-
- switch (tag) {
- case 1:
- {
- if(ksharedAppDelegate.DisabledFileTransferType){
- if(ksharedAppDelegate.isImageNewFor130){
- [[iToast makeText:NSLocalizedString(@"File_Transfer_Disable_tip",nil)] show];
- }
- else{
- [[iToast makeText:NSLocalizedString(@"File_Transfer_Disable_tip2",nil)] show];
- }
- return;
- }
-
- [self userDidClickUploadViewFun];
- }
- break;
- case 2:
- {
- uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
- [self pushViewController:vc animated:YES];
- }
- break;
-
- default:
- break;
- }
- }
- #pragma mark 点击我的空间模块
- - (void)didClickMySpaceFunBy:(NSInteger)tag
- {
- // if(tag ==1 ){
- // if(!ksharedAppDelegate.cloudPhoneExtraFileListMod){
- // //链接了
- // tryLinkNum ++;
- // [[webSocketManager shareInstance] getExtraFilesListFun];
- //
- // if(tryLinkNum >= 3){
- // tryLinkNum = 0;
- // [[iToast makeText:NSLocalizedString(@"box_link_error_show_tip",nil)] show];
- // return;
- // }
- //
- // KWeakSelf
- // dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
- // [weakSelf didClickMySpaceFunBy:tag];
- // });
- // return;
- // }
- // }
-
- if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable)
- {
- [[iToast makeText:NSLocalizedString(@"phone_network_fail_Tips",nil)] show];
- return;
- }
-
- // if (!ksharedAppDelegate.isWebSockLinkOKAginType) {//未链接
- // [[iToast makeText:NSLocalizedString(@"box_link_error_show_tip",nil)] show];
- // return;
- // }
-
- if(ksharedAppDelegate.DisabledFileTransferType){
- if(ksharedAppDelegate.isImageNewFor130){
- [[iToast makeText:NSLocalizedString(@"File_Transfer_Disable_tip",nil)] show];
- }
- else{
- [[iToast makeText:NSLocalizedString(@"File_Transfer_Disable_tip2",nil)] show];
- }
- return;
- }
-
- tryLinkNum = 0;
- switch (tag)
- {
- case 1:
- {
- NASMySpaceViewController *vc = [NASMySpaceViewController new];
- [self pushViewController:vc animated:YES];
- }
- break;
- case 10:{
- previewImageOrVideoViewController *vc = [previewImageOrVideoViewController new];
- vc.isPhotoType = YES;
- [self pushViewController:vc animated:YES];
- }
- break;
- case 11:{
- // previewImageOrVideoViewController *vc = [previewImageOrVideoViewController new];
- // vc.isPhotoType = NO;
- // [self pushViewController:vc animated:YES];
-
- NasPreviewVideoViewController *vc = [NasPreviewVideoViewController new];
- [self pushViewController:vc animated:YES];
- }
- break;
- case 12:{
- previewAudioOrDocumentViewController *vc = [previewAudioOrDocumentViewController new];
- vc.isAudioType = YES;
- [self pushViewController:vc animated:YES];
- }
- break;
- case 13:{
- previewFileAndFolderViewController *vc = [previewFileAndFolderViewController new];
- [self pushViewController:vc animated:YES];
- }
- break;
-
- default:
- break;
- }
- }
- #pragma mark 点击常用模块模块
- - (void)didClickCommonUsedFunBy:(NSInteger)tag
- {
- if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable)
- {
- [[iToast makeText:NSLocalizedString(@"phone_network_fail_Tips",nil)] show];
- return;
- }
-
- // if (!ksharedAppDelegate.isWebSockLinkOKAginType) {//未链接
- // [[iToast makeText:NSLocalizedString(@"box_link_error_show_tip",nil)] show];
- // return;
- // }
-
- switch (tag)
- {
- case 10:{
- backupsOptionViewController *vc = [backupsOptionViewController new];
- [self pushViewController:vc animated:YES];
- }
- break;
- case 11:
- {
- // if(!ksharedAppDelegate.isWebSockLinkOKAginType){
- // [[iToast makeText:NSLocalizedString(@"check_could_phone_state",nil)] show];
- // return;
- // }
- fileTransfeSetViewController *nextVC = [fileTransfeSetViewController new];
- [self pushViewController:nextVC animated:YES];
- }
- break;
- case 12:{
- shareRecordViewController *vc = [shareRecordViewController new];
- [self pushViewController:vc animated:YES];
- [self.NASCommonUsedV setRedPointShow:NO];
- [self updateShareBeMarkFun];
- }
- break;
-
- default:
- break;
- }
- }
- #pragma mark 点击最近文件模块
- - (void)didClickLastFileFunBy:(NSInteger)tag
- {
- if(tag == 2){
- [self getLastFileDataFun];
- }
- else if (tag ==1){
- nasLastFileViewController *vc = [nasLastFileViewController new];
- [self pushViewController:vc animated:YES];
- }
- }
- #pragma mark 用户点击上传文件
- - (void)userDidClickUploadViewFun
- {
- [self hideTabbarFun];
- previewToUploadFileView *previewToUploadFileV = [[previewToUploadFileView alloc] init];
- [self.view addSubview:previewToUploadFileV];
-
- [previewToUploadFileV mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(0);
- make.right.mas_equalTo(0);
- make.bottom.mas_equalTo(10);
- make.top.mas_equalTo(0);
- }];
-
- KWeakSelf
- previewToUploadFileV.didClickButtonFun = ^(NSInteger tag) {
- [weakSelf gotoUploadFileFunWith:tag];
- };
-
- previewToUploadFileV.didClickCloseFun = ^{
- [weakSelf showTabbarFun];
- };
- }
- #pragma mark 调整文件上传
- - (void)gotoUploadFileFunWith:(NSInteger)tag
- {
- uploadImageOrVideoViewController *vc = [uploadImageOrVideoViewController new];
- if(tag ==10){
- vc.isPhotoType = YES;
- }
- else{
- vc.isPhotoType = NO;
- }
- [self pushViewController:vc animated:YES];
- }
- #pragma mark 获取到云机磁盘相关信息
- - (void)getExtraFilesDoneFun:(NSNotification*)not
- {
- // mainBlock(^{
- // [self setMySpaceDataFun];
- // });
-
- [self getExtraFilesByFrpHttpFun];
- }
- #pragma mark 走frp方案 获取云机磁盘信息
- - (void)getExtraFilesByFrpHttpFun
- {
- NSMutableDictionary*paraDict = [NSMutableDictionary new];
-
- KWeakSelf
- [[netWorkManager shareInstance] cloudPhoneGETCallBackCode:@"getExtra" Parameters:paraDict success:^(id _Nonnull responseObject) {
-
- cloudPhoneExtraFileListModel *model = [[cloudPhoneExtraFileListModel alloc] initWithDictionary:responseObject error:nil];
- if(model && model.status == 0){
- ksharedAppDelegate.cloudPhoneExtraFileListMod = model;
- [weakSelf setMySpaceDataFun];
- }
- } failure:^(NSError * _Nonnull error) {
- [weakSelf setMySpaceDataFun];
- }];
-
- }
- #pragma mark 设置我的空间信息
- - (void)setMySpaceDataFun
- {
- if(ksharedAppDelegate.cloudPhoneExtraFileListMod){
- [_NASMySpaceV setProgressFun];
- }
- else{
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
- //[self setMySpaceDataFun];
- [self getExtraFilesByFrpHttpFun];
- });
- }
- }
- #pragma mark 获取到云机系统相关基本信息
- - (void)getCouldPhoneSysInfoFun:(NSNotification*)not
- {//弹框流程 优先级:强制盒子更新弹窗 > APP版本更新弹窗 > 新手引导弹窗 > 通知公告弹窗
-
- if(didGetSysInfoType){//弹框流程已经走过
- return;
- }
-
- didGetSysInfoType = YES;
-
- if(ksharedAppDelegate.isNeedShowImageNewType){//强制盒子更新弹窗
- mainBlock(^{
- [self showImageViewRenewTipViewFun];
- });
-
- }
- }
- - (void)viewWillAppear:(BOOL)animated{
- [super viewWillAppear:animated];
- [self getLastFileDataFun];
-
- [self queryShareSwitchFunFun];
- [self queryShareBeMarkFun];
-
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
- [self checkFileTransferTask];
- });
-
- [self beginShowAlertFun];
-
- [self handelAudioPlayingViewFun];
-
- [self showTabbarFun];
-
- //尝试修复偶现获取不到磁盘空间问题
- [self getExtraFilesByFrpHttpFun];
- }
- - (void)viewWillDisappear:(BOOL)animated{
- [super viewWillDisappear:animated];
-
- }
- - (void)pushViewController:(UIViewController*)vc animated:(BOOL)animated
- {
- [self.navigationController pushViewController:vc animated:animated];
- //[self hideTabbarFun];
- }
- - (void)showTabbarFun
- {
- // 显示 tab bar
- self.tabBarController.tabBar.hidden = NO;
- }
- - (void)hideTabbarFun
- {
- // 隐藏 tab bar
- self.tabBarController.tabBar.hidden = YES;
- }
- #pragma mark 获取最近文件数据
- - (void)getLastFileDataFun
- {
- _lastFileDataArr = [lastFileManager shareManager].lastFileListArr;
- //HLog(@"%@",_lastFileDataArr);
-
- BOOL isShowLastFileType = [HWDataManager getBoolWithKey:Const_last_file_show];
- if(!isShowLastFileType){
- _tableHeadView.frame = CGRectMake(0, 0, SCREEN_W, 165+ 15 +120 +54 + 15);
-
- [self.NASLastFileV mas_remakeConstraints:^(MASConstraintMaker *make) {
- make.top.equalTo(_NASCommonUsedV.mas_bottom).offset(15);
- make.left.mas_equalTo(0);
- make.right.mas_equalTo(0);
- make.height.mas_equalTo(54);
- }];
-
- self.NASLastFileV.notDataImageV.hidden = YES;
- self.NASLastFileV.notDataLabel.hidden = YES;
-
- //全圆角
- UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-32 , 54)
- byRoundingCorners:UIRectCornerAllCorners
- cornerRadii:CGSizeMake(12, 12)];
- CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
- maskLayer.frame = self.NASLastFileV.bounds;
- maskLayer.path = maskPath.CGPath;
- self.NASLastFileV.whiteBgView.layer.mask = nil;
- self.NASLastFileV.whiteBgView.layer.mask = maskLayer;
-
- _lastFileDataArr = [NSMutableArray new];
-
- }
- else if(_lastFileDataArr.count > 0){
- _tableHeadView.frame = CGRectMake(0, 0, SCREEN_W, 165+ 15 +120 +54 + 15);
-
- [self.NASLastFileV mas_remakeConstraints:^(MASConstraintMaker *make) {
- make.top.equalTo(_NASCommonUsedV.mas_bottom).offset(15);
- make.left.mas_equalTo(0);
- make.right.mas_equalTo(0);
- make.height.mas_equalTo(54);
- }];
-
- self.NASLastFileV.notDataImageV.hidden = YES;
- self.NASLastFileV.notDataLabel.hidden = YES;
-
- /*上圆角*/
- UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W- 32 , 54)
- byRoundingCorners:UIRectCornerTopLeft|UIRectCornerTopRight
- cornerRadii:CGSizeMake(12, 12)];
- CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
- maskLayer.frame = CGRectMake(0, 0, SCREEN_W -32, 54);
- maskLayer.path = maskPath.CGPath;
- self.NASLastFileV.whiteBgView.layer.mask = nil;
- self.NASLastFileV.whiteBgView.layer.mask = maskLayer;
-
- }
- else{
- _tableHeadView.frame = CGRectMake(0, 0, SCREEN_W, 165+ 15 +120 +254 + 15);
-
- [self.NASLastFileV mas_remakeConstraints:^(MASConstraintMaker *make) {
- make.top.equalTo(_NASCommonUsedV.mas_bottom).offset(15);
- make.left.mas_equalTo(0);
- make.right.mas_equalTo(0);
- make.height.mas_equalTo(254);
- }];
-
- self.NASLastFileV.notDataImageV.hidden = NO;
- self.NASLastFileV.notDataLabel.hidden = NO;
-
- //全圆角
- UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-32 , 254)
- byRoundingCorners:UIRectCornerAllCorners
- cornerRadii:CGSizeMake(12, 12)];
- CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
- maskLayer.frame = self.NASLastFileV.bounds;
- maskLayer.path = maskPath.CGPath;
- self.NASLastFileV.whiteBgView.layer.mask = nil;
- self.NASLastFileV.whiteBgView.layer.mask = maskLayer;
- }
-
-
- KWeakSelf
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
- [weakSelf.tableView reloadData];
- });
-
- }
- #pragma mark 获取分享开关
- -(void)queryShareSwitchFunFun
- {
- NSMutableDictionary *paraDict = [NSMutableDictionary new];
-
- [paraDict setValue:@7 forKey:@"type"];
-
- //KWeakSelf
- [[netWorkManager shareInstance] CommonGetWithCallBackCode:queryShareSwitchFun Parameters:paraDict success:^(id _Nonnull responseObject){
- queryShareModel *queryShareMod = [[queryShareModel alloc] initWithDictionary:responseObject error:nil];
- if(queryShareMod){
- self->canShareType = queryShareMod.data.configValue;
- //[weakSelf.curEditTypeBottomView setCanShaewFunBy:queryShareMod.data.configValue];
- }
-
- } failure:^(NSError * _Nonnull error) {
- }];
- }
- - (void)checkFileTransferTask
- {//有个偶现的闪退在BGFMDB
-
- [[nasUploadFileManager shareInstance] checkHadUploadTaskWithComplete:^(BOOL isSuccess) {
- self->hadUploadTaskType = isSuccess;
- [self setRightButtonRedTypeFun];
- }];
-
- KWeakSelf
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
- [[nasDownloadFileManager shareInstance] checkHadDownloadTaskWithComplete:^(BOOL isSuccess) {
- self->hadDownloadTaskType = isSuccess;
- [weakSelf setRightButtonRedTypeFun];
- }];
- });
-
- }
- - (void)setRightButtonRedTypeFun
- {
- mainBlock(^{
- if(self->hadUploadTaskType || self->hadDownloadTaskType){
- self->rightRedView.hidden = NO;
- }
- else{
- self->rightRedView.hidden = YES;
- }
- });
- }
- #pragma mark 是否有新的分享被封禁
- -(void)queryShareBeMarkFun
- {
- NSMutableDictionary *paraDict = [NSMutableDictionary new];
-
- KWeakSelf
- [[netWorkManager shareInstance] CommonGetWithCallBackCode:queryShareReportMarkFun Parameters:paraDict success:^(id _Nonnull responseObject){
- queryShareReportMarkModel *ShareMarkMod = [[queryShareReportMarkModel alloc] initWithDictionary:responseObject error:nil];
- if(ShareMarkMod){
- [weakSelf.NASCommonUsedV setRedPointShow:ShareMarkMod.data.reportMark];
- }
-
- } failure:^(NSError * _Nonnull error) {
- }];
- }
- #pragma mark 修改分享被封禁的mark状态()
- -(void)updateShareBeMarkFun
- {
- NSMutableDictionary *paraDict = [NSMutableDictionary new];
-
- //KWeakSelf
- [[netWorkManager shareInstance] CommonPostCallBackCode:updateShareReportMarkFun Parameters:paraDict success:^(id _Nonnull responseObject){
- // SuperModel *ShareMarkMod = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
- // if(ShareMarkMod){
- //
- // }
-
- } failure:^(NSError * _Nonnull error) {
- }];
- }
- #pragma mark 弹框流程
- //优先级:1.强制盒子更新弹窗
- // 2.APP版本更新弹窗 > 新手引导弹窗 > 通知公告弹窗
- - (void)beginShowAlertFun
- {
- //1.隐私模式密码界面 3秒检测一次是否输入完成密码了
- if(!ksharedAppDelegate.isFirstInputPwdDone){
- KWeakSelf
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
- [weakSelf beginShowAlertFun];
- });
-
- return;
- }
-
- //2. 强制盒子更新弹窗
- if(!didGetSysInfoType){
- [[webRtcManager shareManager] getSysInfoFun];
- }
-
- //3. APP版本更新弹窗
- [self checkVersionFun];
- }
- #pragma mark 弹框流程 1 强制盒子更新弹窗
- - (void)showImageViewRenewTipViewFun
- {
- //密码框界面 拦着 不给弹出
- if(ksharedAppDelegate.isDidShowPwdType){
- //didGetSysInfoType = NO;
- KWeakSelf
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
- [weakSelf showImageViewRenewTipViewFun];
- });
-
- return;
- }
-
- imageVersionRenewTipView * RenewTipView = [[imageVersionRenewTipView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, SCREEN_H)];
- [ksharedAppDelegate.window addSubview:RenewTipView];
- //[self.view bringSubviewToFront:RenewTipView];
- }
- #pragma mark 弹框流程 2 APP版本更新弹窗
- - (void)checkVersionFun
- {
- [self getVersion];
- }
- #pragma mark- 网络请求
- - (void)getVersion {
-
- //密码框界面 拦着 不给弹出
- if(!ksharedAppDelegate.isFirstInputPwdDone){
- return;
- }
-
- NSMutableDictionary *paraDict = [NSMutableDictionary dictionary];
- [paraDict setValue:@"ios" forKey:@"type"];
- [paraDict setValue:@"skyworth" forKey:@"source"];
-
- [[netWorkManager shareInstance] CommonGetWithCallBackCode:upgradeNewVersion Parameters:paraDict success:^(id _Nonnull responseObject) {
- //HLog(@"%@", responseObject);
- SuperModel *model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
- if (model && model.status == 0) {
- HWVersionModel *model = [HWVersionModel mj_objectWithKeyValues:responseObject[@"data"]];
- [self checkVersion:model];
- }
- else
- {
- [self checkVersion:nil];
- }
- } failure:^(NSError * _Nonnull error) {
- HLog(@"%@", error);
- [self checkVersion:nil];
- }];
- }
- - (void)checkVersion:(HWVersionModel*)versionModel {
-
- if(!versionModel){//版本信息错误 检测新手弹框流程
- [self showNewerGuideFun];
- return;
- }
-
- // NSString *currentVersion = [NSBundle mainBundle].infoDictionary[@"CFBundleVersion"];
- NSString *currentVersion = [NSBundle mainBundle].infoDictionary[@"CFBundleShortVersionString"];
- NSString *newVersion = [versionModel.versionNumber stringByReplacingOccurrencesOfString:@"v" withString:@""]; //去掉v
- newVersion = [newVersion stringByReplacingOccurrencesOfString:@"V" withString:@""]; //去掉v
- //HLog(@"%@---%@", newVersion, currentVersion);
- if ([currentVersion compare:newVersion options:NSNumericSearch] == NSOrderedSame) { // 本地版本号 == 服务器版本号
- [self showNewerGuideFun];
- }else if ([currentVersion compare:newVersion options:NSNumericSearch] == NSOrderedDescending) { // 本地版本号 > 服务器版本号 (异常情况)
- [HWDataManager setBoolWithKey:Const_haveVersion value:NO];
- [self showNewerGuideFun];
- }else { // 本地版本号 < 服务器版本号 (有新版本)
- [self showNewVersion:versionModel];
- [HWDataManager setBoolWithKey:Const_haveVersion value:YES];
- };
- }
- - (void)showNewVersion:(HWVersionModel*)versionModel {
-
- HaveNewVersionView *haveNewVersionView = [HaveNewVersionView shardInstance];
- if (haveNewVersionView.isShow) {
- return;
- }
-
- //此版本点击过稍后再试
- NSString *preVersionstr = [HWDataManager getStringWithKey:Const_did_show_version_and_click_wait];
- if(preVersionstr && [versionModel.versionNumber isEqualToString:preVersionstr]){
- [self showNewerGuideFun];
- return;
- }
-
- haveNewVersionView.versionModel = versionModel;
- haveNewVersionView.isContinueCheckAlert = NO; // 是否继续走下一步弹窗检测流程
- [haveNewVersionView setBackgroundColor:RGBACOLOR(0, 0, 0, 0.5)];
- [ksharedAppDelegate.window addSubview:haveNewVersionView];
- haveNewVersionView.isShow = YES;
-
- if(!versionModel.necessary){
- haveNewVersionView.deleteBtn.hidden = NO;
- }
-
- [haveNewVersionView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(0);
- make.left.mas_equalTo(0);
- make.right.mas_equalTo(0);
- make.bottom.mas_equalTo(0);
- }];
- haveNewVersionView.alpha = 0.0;
- [UIView animateWithDuration:0.3 delay:0.0 options:UIViewAnimationOptionCurveEaseIn animations:^ {
- haveNewVersionView.alpha = 1.0;
- KyoLog(@"in animate start");
- } completion:^(BOOL finished) {
- KyoLog(@"in animate completion");
- }];
-
- KWeakSelf
- haveNewVersionView.closeViewFun = ^{
- [weakSelf showNewerGuideFun];
- };
- }
- #pragma mark 弹框流程 3 新手引导弹窗
- - (void)showNewerGuideFun
- {
- BOOL didShow = [HWDataManager getBoolWithKey:@"Const_did_show_newer_Guide"];
-
- if(didShow){
- [self getLastNoticeFun];
- return;
- }
-
- newerGuideView *guideView = [[newerGuideView alloc] init];
- [ksharedAppDelegate.window addSubview:guideView];
-
- [guideView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(0);
- make.left.mas_equalTo(0);
- make.right.mas_equalTo(0);
- make.bottom.mas_equalTo(0);
- }];
-
-
- KWeakSelf
- guideView.didClickButtonFun = ^(NSInteger tag) {
- [weakSelf didiClickNewerButtonFunBy:tag];
- };
-
- }
- #pragma mark 新手引导点击事件
- - (void)didiClickNewerButtonFunBy:(NSInteger)tag
- {
- [HWDataManager setBoolWithKey:@"Const_did_show_newer_Guide" value:YES];
-
- if(tag ==1){
- [self getLastNoticeFun];
- }
- else if(tag ==2 || tag == 10){
- CustomerWebViewController *vc = [[CustomerWebViewController alloc] init];
- vc.titleStr = NSLocalizedString(@"mine_newuser_title",nil);
- NSString *url = [[NSString alloc] initWithFormat:@"%@/warrantyService/index.html#/novice?isNovice=true",CloudService];
- if(tag == 10){
- url = [url stringByReplacingOccurrencesOfString:@"?isNovice=true" withString:@""];
- }
-
- vc.webUrl = url;
- [self pushViewController:vc animated:YES];
-
- KWeakSelf
- vc.didClickBackFun = ^{
- [weakSelf getLastNoticeFun];
- };
- }
- }
- #pragma mark 弹框流程 4 通知公告弹窗
- - (void)getLastNoticeFun
- {
-
- NSMutableDictionary *paraDict = [NSMutableDictionary dictionary];
- [paraDict setValue:@"Private-X" forKey:@"productType"];
- [paraDict setValue:@"ios" forKey:@"type"];
-
- [[netWorkManager shareInstance] CommonPostCallBackCode:queryOneNotice Parameters:paraDict success:^(id _Nonnull responseObject) {
-
- noticeModel *model = [[noticeModel alloc] initWithDictionary:responseObject error:nil];
- //test code
- // model.status = 0;
- // model.data = [noticeDataModel new];
- // model.data.curNoticeId = @"1111";
- // model.data.title = @"版本升级通知公告";
- // model.data.content = @"1.偶现挤下线问题";
- // model.data.content = @"1.偶现挤下线问题\n2.本地网络弹框\n3.访问相册权限之类的系统弹框会触发进入后台流程---显示输入密码框\n4.上传偶现UI刷新异常(数据库是正常的)\n5.偶现上传文件损坏\n6.链接不稳定问题(websock偶尔会不断重连\n7.进入设置页面读取数据偶现闪退!!!!\n8.本地网络弹框\n9.访问相册权限之类的系统弹框会触发进入后台流程---显示输入密码框\n10.上传偶现UI刷新异常(数据库是正常的)\n11.偶现上传文件损坏\n12.链接不稳定问题(websock偶尔会不断重连)\n13.进入设置页面读取数据偶现闪退!!!!\n14.本地网络弹框\n15.访问相册权限之类的系统弹框会触发进入后台流程\n16.上传偶现UI刷新异常(数据库是正常的)";//\n17.偶现上传文件损坏\n18.链接不稳定问题(websock偶尔会不断重连\n19.进入设置页面读取数据偶现闪退!!!!\n20.本地网络弹框\n21.访问相册权限之类的系统弹框会触发进入后台流程\n22.上传偶现UI刷新异常(数据库是正常的)\n23.偶现上传文件损坏\n24.链接不稳定问题(websock偶尔会不断重连)\n25.进入设置页面读取数据偶现闪退!!!!\n26.本地网络弹框\n27.访问相册权限之类的系统弹框会触发进入后台流程\n28.上传偶现UI刷新异常(数据库是正常的)\n29.偶现上传文件损坏\n30.链接不稳定问题(websock偶尔会不断重连)\n31.进入设置页面读取数据偶现闪退!!!!";
-
- if (model && model.data && model.status == 0) {
- [self showHaveNoticeViewBy:model];
- }
- else
- {
-
- }
- } failure:^(NSError * _Nonnull error) {
- HLog(@"%@", error);
- }];
- }
- - (void)showHaveNoticeViewBy:(noticeModel*)model
- {
- HaveNoticeView * noticeView = [HaveNoticeView shardInstance];
- NSString * preShowID = [HWDataManager getStringWithKey:Const_did_show_Notice_ID];
-
- if(noticeView.isShow
- || !model
- || [preShowID isEqualToString:model.data.curNoticeId]){
- return;
- }
-
- noticeView.curNoticeModel = model;
-
- //异常处理
- if(![iTools getKeyWindow]){
- return;
- }
-
- [[iTools getKeyWindow] addSubview:noticeView];
-
- [noticeView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(0);
- make.left.mas_equalTo(0);
- make.right.mas_equalTo(0);
- make.bottom.mas_equalTo(0);
- }];
-
- noticeView.alpha = 0.0;
- [UIView animateWithDuration:0.3 delay:0.0 options:UIViewAnimationOptionCurveEaseIn animations:^ {
- noticeView.alpha = 1.0;
- } completion:^(BOOL finished) {
- }];
-
- }
- #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];
-
- [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);
- }];
-
- [self.tableView mas_remakeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(0);
- make.right.mas_equalTo(0);
- make.top.equalTo(welcomeImageV.mas_bottom).offset(20);
- make.bottom.mas_equalTo(-TABBARHEIGHT -49);
- }];
-
- }
- #pragma mark 隐藏音频播放中的视图
- - (void)hideAudioPlayingViewFun
- {
- // audioPlayingView * audioPlayingV = [audioPlayingView sharedInstance];
- // [audioPlayingV removeFromSuperview];
-
- [self.tableView mas_remakeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(0);
- make.right.mas_equalTo(0);
- make.top.equalTo(welcomeImageV.mas_bottom).offset(20);
- make.bottom.mas_equalTo(-TABBARHEIGHT);
- }];
- }
- @end
|