imageDetailsScrollViewController.m 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670
  1. //
  2. // imageDetailsScrollViewController.m
  3. // Private-X
  4. //
  5. // Created by xd h on 2024/5/16.
  6. //
  7. #import "imageDetailsScrollViewController.h"
  8. #import <SDCycleScrollView/SDCycleScrollView.h>
  9. #import "editTypeBottomView.h"
  10. #import "editShareView.h"
  11. #import "NASFilePicModel.h"
  12. #import "uploadFileRecordViewController.h"
  13. #import "previewLandscapeTopView.h"
  14. #import "previewLandscapeTopMoreView.h"
  15. #import "UIInterface+HXRotation.h"
  16. @interface imageDetailsScrollViewController ()
  17. {
  18. NSMutableArray *imageURLStringsGroup;
  19. }
  20. @property (nonatomic,strong) SDCycleScrollView *curScrollView;
  21. @property(nonatomic,strong) editTypeBottomView*curEditTypeBottomView;
  22. @property(nonatomic,assign) BOOL isPortraitType;//竖屏状态
  23. @property(nonatomic,strong) previewLandscapeTopView*previewLandscapeTopV;
  24. @property(nonatomic,strong) previewLandscapeTopMoreView*previewLandscapeTopMoreV;
  25. @property(nonatomic,strong) editShareView *editShareV;
  26. @property(nonatomic,assign) BOOL isHideMsgType;//隐藏上下信息
  27. @end
  28. @implementation imageDetailsScrollViewController
  29. - (void)viewDidLoad {
  30. [super viewDidLoad];
  31. // Do any additional setup after loading the view.
  32. [self.toolBar setHidden:YES];
  33. [self.navigationBar setHidden:YES];
  34. [self.navBarBGView setHidden:NO];
  35. self.navBarBGView.backgroundColor = [UIColor clearColor];
  36. self.titleLabel.textColor = [UIColor whiteColor];
  37. [self.backBtn setImage:[UIImage imageNamed:@"icon_white_back"] forState:UIControlStateNormal];
  38. [self.view setBackgroundColor:[UIColor blackColor]];
  39. [self drawAnyView];
  40. _isPortraitType = YES;
  41. //数据埋点
  42. [[netWorkManager shareInstance] DataEmbeddingPointBy:4 withEventValue:@"Image_preview"];
  43. }
  44. - (void)drawAnyView
  45. {
  46. // gradient
  47. CAGradientLayer *gl = [CAGradientLayer layer];
  48. gl.frame = CGRectMake(0,0,SCREEN_W,60 + AdaptTabHeight);
  49. gl.startPoint = CGPointMake(0.5, 0);
  50. gl.endPoint = CGPointMake(0.5, 1);
  51. gl.colors = @[(__bridge id)[UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:1.0].CGColor, (__bridge id)[UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.0].CGColor];
  52. gl.locations = @[@(0), @(1.0f)];
  53. //[self.layer addSublayer:gl];
  54. [self.navBarBGView.layer insertSublayer:gl atIndex:0];
  55. //横屏的头部
  56. _previewLandscapeTopV = [[previewLandscapeTopView alloc] init];
  57. [self.view addSubview:_previewLandscapeTopV];
  58. _previewLandscapeTopV.hidden = YES;
  59. [_previewLandscapeTopV mas_makeConstraints:^(MASConstraintMaker *make) {
  60. make.left.mas_equalTo(0);
  61. make.right.mas_equalTo(0);
  62. make.top.mas_equalTo(0);
  63. make.height.mas_equalTo(60);
  64. }];
  65. KWeakSelf
  66. _previewLandscapeTopV.didClickButton = ^(NSInteger tag) {
  67. [weakSelf didClickButInLandscapeTopFunBy:tag];
  68. };
  69. }
  70. - (void)viewDidAppear:(BOOL)animated
  71. {
  72. [super viewDidAppear:animated];
  73. [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
  74. ksharedAppDelegate.supportScreenRotateType = YES;
  75. //开始生成 设备旋转 通知
  76. [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
  77. //添加 设备旋转 通知
  78. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientChange:) name:UIDeviceOrientationDidChangeNotification object:nil];
  79. }
  80. - (void)viewWillDisappear:(BOOL)animated {
  81. [super viewWillDisappear:animated];
  82. [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDarkContent];
  83. ksharedAppDelegate.supportScreenRotateType = NO;
  84. //销毁 设备旋转 通知
  85. [[NSNotificationCenter defaultCenter] removeObserver:self
  86. name:UIDeviceOrientationDidChangeNotification
  87. object:nil];
  88. //结束 设备旋转通知
  89. [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
  90. //切换到竖屏
  91. [self hx_rotateToInterfaceOrientation:UIInterfaceOrientationPortrait];
  92. }
  93. - (BOOL)shouldAutorotate {
  94. return YES;
  95. }
  96. /// 如果不好用则copy VC中 加一下
  97. - (UIInterfaceOrientationMask)supportedInterfaceOrientations {
  98. return UIInterfaceOrientationMaskAllButUpsideDown;
  99. }
  100. /**屏幕旋转的通知回调*/
  101. - (void)orientChange:(NSNotification *)noti {
  102. UIDeviceOrientation orient = [UIDevice currentDevice].orientation;
  103. switch (orient) {
  104. case UIDeviceOrientationPortrait:
  105. NSLog(@"竖直屏幕");
  106. if(!_isPortraitType){
  107. [self screenLandscapeToPortraitFun];
  108. }
  109. break;
  110. case UIDeviceOrientationLandscapeLeft:
  111. NSLog(@"手机左转");
  112. if(_isPortraitType){
  113. [self screenPortraitToLandscapeFun];
  114. }
  115. break;
  116. case UIDeviceOrientationPortraitUpsideDown:
  117. // NSLog(@"手机竖直");
  118. break;
  119. case UIDeviceOrientationLandscapeRight:
  120. NSLog(@"手机右转");
  121. if(_isPortraitType){
  122. [self screenPortraitToLandscapeFun];
  123. }
  124. break;
  125. case UIDeviceOrientationUnknown:
  126. //NSLog(@"未知");
  127. break;
  128. case UIDeviceOrientationFaceUp:
  129. //NSLog(@"手机屏幕朝上");
  130. break;
  131. case UIDeviceOrientationFaceDown:
  132. //NSLog(@"手机屏幕朝下");
  133. break;
  134. default:
  135. break;
  136. }
  137. }
  138. #pragma mark 竖屏转横屏
  139. - (void)screenPortraitToLandscapeFun{
  140. _isPortraitType = NO;
  141. _curEditTypeBottomView.hidden = YES;
  142. self.navBarBGView.hidden = YES;
  143. _previewLandscapeTopV.hidden = NO;
  144. [self didClickScreenFun:NO];
  145. [_previewLandscapeTopV mas_remakeConstraints:^(MASConstraintMaker *make) {
  146. make.left.mas_equalTo(0);
  147. make.right.mas_equalTo(0);
  148. make.top.mas_equalTo(0);
  149. make.height.mas_equalTo(60);
  150. }];
  151. if(_editShareV){
  152. _editShareV.isPortraitType = _isPortraitType;
  153. }
  154. if(_editShareV.secretShareView)
  155. {
  156. _editShareV.secretShareView.isPortraitType = _isPortraitType;
  157. }
  158. [self handleScreenRotateFun];
  159. }
  160. #pragma mark 屏幕旋转 图片偏移问题
  161. - (void)handleScreenRotateFun
  162. {
  163. [_curScrollView mas_remakeConstraints:^(MASConstraintMaker *make) {
  164. make.left.mas_equalTo(0.0);
  165. make.right.mas_equalTo(0.0);
  166. make.top.mas_equalTo(0.0);
  167. make.bottom.mas_equalTo(0.0);
  168. }];
  169. [_curScrollView.mainView mas_remakeConstraints:^(MASConstraintMaker *make) {
  170. make.left.mas_equalTo(0.0);
  171. make.right.mas_equalTo(0.0);
  172. make.top.mas_equalTo(0.0);
  173. make.bottom.mas_equalTo(0.0);
  174. }];
  175. KWeakSelf
  176. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.05 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  177. //[self->_curScrollView adjustWhenControllerViewWillAppera];
  178. [weakSelf handleScreenRotateSecondFun];
  179. });
  180. }
  181. - (void)handleScreenRotateSecondFun
  182. {
  183. NSInteger curIndex = _index;
  184. HLog(@"curIndexcurIndex 222:%ld",curIndex)
  185. [_curScrollView removeFromSuperview];
  186. self.totalDataArr = _totalDataArr;
  187. [self->_curScrollView makeScrollViewScrollToIndex:curIndex];
  188. }
  189. #pragma mark 横屏转竖屏
  190. - (void)screenLandscapeToPortraitFun{
  191. _isPortraitType = YES;
  192. _curEditTypeBottomView.hidden = NO;
  193. self.navBarBGView.hidden = NO;
  194. _previewLandscapeTopV.hidden = YES;
  195. [self didClickScreenFun:NO];
  196. if(_editShareV){
  197. _editShareV.isPortraitType = _isPortraitType;
  198. }
  199. if(_editShareV.secretShareView)
  200. {
  201. _editShareV.secretShareView.isPortraitType = _isPortraitType;
  202. }
  203. [self handleScreenRotateFun];
  204. }
  205. #pragma mark 用户点击分享
  206. - (void)gotoShareViewFun
  207. {
  208. _editShareV = [[editShareView alloc] init];
  209. NASFilePicDataArrModel *dataModel = _totalDataArr[_index];
  210. _editShareV.didSelectListArr = [NSMutableArray arrayWithArray:@[dataModel]];
  211. _editShareV.shareFileType = @"2";
  212. [self.view addSubview:_editShareV];
  213. _editShareV.isPortraitType = _isPortraitType;
  214. [_editShareV mas_makeConstraints:^(MASConstraintMaker *make) {
  215. make.left.mas_equalTo(0);
  216. make.right.mas_equalTo(0);
  217. make.bottom.mas_equalTo(0);
  218. make.top.mas_equalTo(0);
  219. }];
  220. KWeakSelf
  221. _editShareV.didClickCloseFun = ^{
  222. [weakSelf clearShareAboutViewFun];
  223. };
  224. }
  225. #pragma mark 清理分享相关页面
  226. - (void)clearShareAboutViewFun
  227. {
  228. if(_editShareV.secretShareView){
  229. _editShareV.secretShareView = nil;
  230. }
  231. _editShareV = nil;
  232. }
  233. - (void)setTotalDataArr:(NSMutableArray *)totalDataArr
  234. {
  235. _totalDataArr = totalDataArr;
  236. imageURLStringsGroup = [NSMutableArray new];
  237. for (NASFilePicDataArrModel*dataModel in _totalDataArr) {
  238. NSString * URLString = [[NSString alloc] initWithFormat:@"%@getFile?path=%@",ksharedAppDelegate.NASFileByBoxService,dataModel.path];
  239. URLString = [URLString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
  240. [imageURLStringsGroup addObject:URLString];
  241. }
  242. //HLog(@"URLString:\n%@",imageURLStringsGroup);
  243. if(_curScrollView){
  244. [_curScrollView removeFromSuperview];
  245. _curScrollView = nil;
  246. }
  247. _curScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectZero imageURLStringsGroup:imageURLStringsGroup];
  248. _curScrollView.autoScroll = NO;
  249. _curScrollView.infiniteLoop = NO;
  250. _curScrollView.bannerImageViewContentMode = UIViewContentModeScaleAspectFit;
  251. //_curScrollView.placeholderImage = [UIImage imageNamed:@"uploadFile_image"];
  252. //[self.view addSubview:_curScrollView];
  253. [self.view insertSubview:_curScrollView belowSubview:self.navBarBGView];
  254. _curScrollView.backgroundColor = [UIColor blackColor];
  255. [_curScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
  256. make.left.mas_equalTo(0);
  257. make.right.mas_equalTo(0);
  258. //make.top.equalTo(self.navBarBGView.mas_bottom).offset(0);
  259. make.top.mas_equalTo(0);
  260. //make.bottom.mas_equalTo(-(60+ AdaptTabHeight));
  261. make.bottom.mas_equalTo(0);
  262. }];
  263. KWeakSelf
  264. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  265. [self->_curScrollView makeScrollViewScrollToIndex:self->_index];
  266. [weakSelf setTitleLabelTextFunBy:self->_index];
  267. [weakSelf cycleScrollViewDidScrollToIndex:self->_index];
  268. self->_curScrollView.hidden = NO;
  269. });
  270. _curScrollView.itemDidScrollOperationBlock = ^(NSInteger currentIndex) {
  271. //屏幕旋转 这里回调 而且值差几个
  272. if(currentIndex + 1 == weakSelf.index
  273. ||currentIndex -1 == weakSelf.index){
  274. weakSelf.index = currentIndex;
  275. }
  276. HLog(@"curIndexcurIndex 1111:%ld --%ld",currentIndex,weakSelf.index)
  277. [weakSelf setTitleLabelTextFunBy:currentIndex];
  278. [weakSelf cycleScrollViewDidScrollToIndex:currentIndex];
  279. };
  280. _curScrollView.clickItemOperationBlock = ^(NSInteger currentIndex) {
  281. self->_isHideMsgType = !self->_isHideMsgType;
  282. [weakSelf didClickScreenFun:self->_isHideMsgType];
  283. };
  284. if(_curEditTypeBottomView){
  285. [_curEditTypeBottomView removeFromSuperview];
  286. _curEditTypeBottomView = nil;
  287. }
  288. _curEditTypeBottomView = [[editTypeBottomView alloc] init];
  289. _curEditTypeBottomView.isBlackType = YES;
  290. [self.view addSubview:_curEditTypeBottomView];
  291. //_curEditTypeBottomView.hidden = YES;
  292. //_curEditTypeBottomView.backgroundColor = [UIColor greenColor];
  293. if(!_isPortraitType){
  294. _curEditTypeBottomView.hidden = YES;
  295. }
  296. [_curEditTypeBottomView mas_makeConstraints:^(MASConstraintMaker *make) {
  297. make.left.mas_equalTo(0);
  298. make.right.mas_equalTo(0);
  299. make.bottom.mas_equalTo(0);
  300. make.height.mas_equalTo(60 + AdaptTabHeight);
  301. }];
  302. //KWeakSelf
  303. #pragma mark 编辑状态的 下载 分享 删除 响应事件
  304. _curEditTypeBottomView.didClickButtonFun = ^(NSInteger tag) {
  305. if(tag==1){
  306. //[[iToast makeText:@"点击下载"] show];
  307. [weakSelf gotoDownLoadFileFun];
  308. }
  309. else if(tag==2){
  310. [weakSelf gotoShareViewFun];
  311. }
  312. else if(tag==3){
  313. //[[iToast makeText:@"点击删除"] show];
  314. [weakSelf showDeleteAlearViewFun];
  315. }
  316. };
  317. }
  318. - (void)setTitleLabelTextFunBy:(NSInteger)index
  319. {
  320. if(index >=0 && index < _totalDataArr.count){
  321. NASFilePicDataArrModel *dataModel = _totalDataArr[index];
  322. self.titleLabel.text = dataModel.name;
  323. _previewLandscapeTopV.titleLabel.text = dataModel.name;
  324. }
  325. }
  326. #pragma mark 删除图片
  327. - (void)showDeleteAlearViewFun
  328. {
  329. NSString *titleStr = NSLocalizedString(@"delete_file_title_msg",nil);
  330. NSString *tipStr = NSLocalizedString(@"delete_file_tip_msg",nil);
  331. KWeakSelf
  332. ComontAlretViewController *curAlretVC= [[ComontAlretViewController alloc] initWithTiTle:titleStr
  333. msg:tipStr
  334. imageStr:nil
  335. cancelTitle:NSLocalizedString(@"other_cancel",nil)
  336. okTitle:NSLocalizedString(@"other_confirm",nil) isOkBtnHighlight:YES
  337. didClickOk:^{
  338. [weakSelf delFileListFun];
  339. } didClickCancel:^{
  340. }];
  341. curAlretVC.modalPresentationStyle = UIModalPresentationCustom;
  342. [self presentViewController:curAlretVC animated:YES completion:^{
  343. curAlretVC.view.superview.backgroundColor = [UIColor clearColor];
  344. }];
  345. }
  346. #pragma mark 删除文件数据
  347. - (void)delFileListFun
  348. {
  349. NSMutableDictionary*paraDict = [NSMutableDictionary new];
  350. NSString *deleteFilePath = @"";
  351. if(_index >=0 && _index < _totalDataArr.count){
  352. NASFilePicDataArrModel *dataModel = _totalDataArr[_index];
  353. NSArray *pathArr = @[dataModel.path];
  354. deleteFilePath = dataModel.path;
  355. //NSArray *pathArr = @[dataModel.path,dataModel.path];
  356. [paraDict setValue:pathArr forKey:@"path"];
  357. }
  358. [self showNewIndicatorWithCanBack:YES canTouch:NO];
  359. //NSString*code = [[NSString alloc] initWithFormat:@"delFile?path=%@",paraDict[@"path"]]; //delFile?path=[/storage/emulated/0/Download/IMG_6464.HEIC]
  360. KWeakSelf //@"delFile"
  361. [[netWorkManager shareInstance] cloudPhonePostCallBackCode:@"delFile" Parameters:paraDict success:^(id _Nonnull responseObject) {
  362. [weakSelf removeNewIndicator];
  363. SuperModel *model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
  364. if(model && model.status == 0){
  365. [[iToast makeText:NSLocalizedString(@"delete_file_suc_msg",nil)] show];
  366. if(weakSelf.didNeedDeleteFile){
  367. weakSelf.didNeedDeleteFile(deleteFilePath);
  368. }
  369. [weakSelf didDeleteSucFun];
  370. [weakSelf.navigationController popViewControllerAnimated:YES];
  371. }
  372. else{
  373. }
  374. } failure:^(NSError * _Nonnull error) {
  375. [weakSelf removeNewIndicator];
  376. }];
  377. //数据埋点
  378. [[netWorkManager shareInstance] DataEmbeddingPointBy:3 withEventValue:@"Image_delete"];
  379. }
  380. #pragma mark 删除成功
  381. - (void)didDeleteSucFun
  382. {
  383. //删除最近文件
  384. if(_index >=0 && _index < _totalDataArr.count){
  385. NASFilePicDataArrModel *dataModel = _totalDataArr[_index];
  386. [[lastFileManager shareManager] deleteFileInfoWithUrl:dataModel.path];
  387. }
  388. [_totalDataArr removeAllObjects];
  389. }
  390. - (void)gotoDownLoadFileFun
  391. {
  392. if(_index >=0 && _index < _totalDataArr.count){
  393. NASFilePicDataArrModel *dataModel = _totalDataArr[_index];
  394. couldPhoneFileModel* fileModel = [couldPhoneFileModel new];
  395. fileModel.fileType = dataModel.type;
  396. fileModel.path = dataModel.path;
  397. fileModel.name = dataModel.name;
  398. fileModel.length = dataModel.size;
  399. NSMutableArray *arr = [NSMutableArray new];
  400. [arr addObject:fileModel];
  401. //切换到竖屏
  402. [self hx_rotateToInterfaceOrientation:UIInterfaceOrientationPortrait];
  403. uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
  404. [self.navigationController pushViewController:vc animated:YES];
  405. vc.isDownloadingType = YES;
  406. [vc gotoDownloadFile:arr];
  407. }
  408. }
  409. - (void)setCanShareType:(BOOL)canShareType
  410. {
  411. _canShareType = canShareType;
  412. [_curEditTypeBottomView setCanShaewFunBy:canShareType];
  413. }
  414. #pragma mark 图片滑动
  415. - (void)cycleScrollViewDidScrollToIndex:(NSInteger)index{
  416. if(index >=0 && index < _totalDataArr.count){
  417. NASFilePicDataArrModel *dataModel = _totalDataArr[index];
  418. lastFileModel *lastFileMod = [lastFileModel new];
  419. lastFileMod.path = dataModel.path;
  420. lastFileMod.name = dataModel.name;
  421. lastFileMod.time = dataModel.time;
  422. lastFileMod.size = dataModel.size;
  423. lastFileMod.duration = dataModel.duration;
  424. lastFileMod.type = @".jpg";
  425. lastFileMod.lastPreTime = [iTools getNowTimeStamp];
  426. [[lastFileManager shareManager] saveFileInfoWith:lastFileMod with:dataModel.path];
  427. }
  428. }
  429. #pragma mark 横屏时点击顶部按钮
  430. - (void)didClickButInLandscapeTopFunBy:(NSInteger)tag
  431. {
  432. if(tag == 1){
  433. [self backBtnPressed];
  434. }
  435. else if(tag == 2){
  436. [self showPreviewLandscapeTopMoreViewFun];
  437. }
  438. else if(tag == 3){//分享
  439. [self gotoShareViewFun];
  440. }
  441. }
  442. #pragma mark 删除横屏的 more
  443. - (void)deletePreviewLandscapeTopMoreViewFun
  444. {
  445. [_previewLandscapeTopMoreV removeFromSuperview];
  446. _previewLandscapeTopMoreV = nil;
  447. }
  448. #pragma mark 点开了横屏的 more
  449. - (void)showPreviewLandscapeTopMoreViewFun
  450. {
  451. [self deletePreviewLandscapeTopMoreViewFun];
  452. _previewLandscapeTopMoreV = [[previewLandscapeTopMoreView alloc] init];
  453. [self.view addSubview:_previewLandscapeTopMoreV];
  454. [_previewLandscapeTopMoreV mas_makeConstraints:^(MASConstraintMaker *make) {
  455. make.left.mas_equalTo(0);
  456. make.right.mas_equalTo(0);
  457. make.top.mas_equalTo(0);
  458. make.bottom.mas_equalTo(0);
  459. }];
  460. KWeakSelf
  461. _previewLandscapeTopMoreV.didClickButtonFun = ^(NSInteger tag) {
  462. if(tag==10){
  463. //[[iToast makeText:@"点击下载"] show];
  464. //切换到竖屏
  465. [weakSelf hx_rotateToInterfaceOrientation:UIInterfaceOrientationPortrait];
  466. [weakSelf screenLandscapeToPortraitFun];
  467. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  468. [weakSelf gotoDownLoadFileFun];
  469. });
  470. }
  471. else if(tag==11){
  472. //[[iToast makeText:@"点击删除"] show];
  473. [weakSelf showDeleteAlearViewFun];
  474. }
  475. };
  476. }
  477. #pragma mark 点开了屏幕
  478. - (void)didClickScreenFun:(BOOL)isHideMsgType
  479. {
  480. _isHideMsgType = isHideMsgType;
  481. if(isHideMsgType){//处理隐藏
  482. if(_isPortraitType){
  483. CGRect BottomViewRect = _curEditTypeBottomView.frame;
  484. CGRect fixBottomViewRect = CGRectMake(BottomViewRect.origin.x, BottomViewRect.origin.y + BottomViewRect.size.height, BottomViewRect.size.width, BottomViewRect.size.height);
  485. CGRect navBarBGViewRect = self.navBarBGView.frame;
  486. CGRect fixNavBarBGViewRect = CGRectMake(navBarBGViewRect.origin.x, navBarBGViewRect.origin.y - navBarBGViewRect.size.height, navBarBGViewRect.size.width, navBarBGViewRect.size.height);
  487. [UIView animateWithDuration:0.3 animations:^{
  488. self->_curEditTypeBottomView.frame = fixBottomViewRect;
  489. self.navBarBGView.frame = fixNavBarBGViewRect;
  490. } completion:^(BOOL finished) {
  491. self->_curEditTypeBottomView.hidden = YES;
  492. self.navBarBGView.hidden = YES;
  493. //frame 还原
  494. self->_curEditTypeBottomView.frame = BottomViewRect;
  495. self.navBarBGView.frame = navBarBGViewRect;
  496. }];
  497. }
  498. else{
  499. CGRect TopViewRect = _previewLandscapeTopV.frame;
  500. CGRect fixTopViewRect = CGRectMake(TopViewRect.origin.x, TopViewRect.origin.y - TopViewRect.size.height, TopViewRect.size.width, TopViewRect.size.height);
  501. [UIView animateWithDuration:0.3 animations:^{
  502. self->_previewLandscapeTopV.frame = fixTopViewRect;
  503. } completion:^(BOOL finished) {
  504. self->_previewLandscapeTopV.hidden = YES;
  505. //frame 还原
  506. self->_previewLandscapeTopV.frame = TopViewRect;
  507. }];
  508. }
  509. }
  510. else{//处理显示
  511. if(_isPortraitType){
  512. CGRect BottomViewRect = _curEditTypeBottomView.frame;
  513. CGRect fixBottomViewRect = CGRectMake(BottomViewRect.origin.x, BottomViewRect.origin.y + BottomViewRect.size.height, BottomViewRect.size.width, BottomViewRect.size.height);
  514. CGRect navBarBGViewRect = self.navBarBGView.frame;
  515. CGRect fixNavBarBGViewRect = CGRectMake(navBarBGViewRect.origin.x, navBarBGViewRect.origin.y - navBarBGViewRect.size.height, navBarBGViewRect.size.width, navBarBGViewRect.size.height);
  516. self->_curEditTypeBottomView.frame = fixBottomViewRect;
  517. self.navBarBGView.frame = fixNavBarBGViewRect;
  518. [UIView animateWithDuration:0.3 animations:^{
  519. //frame 还原
  520. self->_curEditTypeBottomView.frame = BottomViewRect;
  521. self.navBarBGView.frame = navBarBGViewRect;
  522. } completion:^(BOOL finished) {
  523. self->_curEditTypeBottomView.hidden = NO;
  524. self.navBarBGView.hidden = NO;
  525. }];
  526. }
  527. else{
  528. _previewLandscapeTopV.hidden = NO;
  529. CGRect topViewRect = _previewLandscapeTopV.frame;
  530. CGRect fixTopViewRect = CGRectMake(topViewRect.origin.x, topViewRect.origin.y - topViewRect.size.height, topViewRect.size.width, topViewRect.size.height);
  531. self->_previewLandscapeTopV.frame = fixTopViewRect;
  532. [UIView animateWithDuration:0.3 animations:^{
  533. //frame 还原
  534. self->_previewLandscapeTopV.frame = topViewRect;
  535. } completion:^(BOOL finished) {
  536. self->_previewLandscapeTopV.hidden = NO;
  537. }];
  538. }
  539. }
  540. }
  541. @end