CommonHomeVC.m 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525
  1. //
  2. // CommonHomeVC.m
  3. // smartRhino
  4. //
  5. // Created by niuzhen on 2020/4/28.
  6. // Copyright © 2020 tederen. All rights reserved.
  7. //
  8. #import "CommonHomeVC.h"
  9. #import "CommonListCell.h"
  10. #import "MyTDGroupView.h"
  11. #import "GHRefreshCollectionView.h"
  12. #import "CommonBarCell.h"
  13. #import "CommonBarModel.h"
  14. #import "CommonWorkVC.h"
  15. #import "CommonToolVC.h"
  16. #import "MyFavoriteVC.h"
  17. #import "CommonNoteVC.h"
  18. #import "ChatMsgListCell.h"
  19. #import "ChatMsgCollectionCell.h"
  20. #import "MoveViewController.h"
  21. @interface CommonHomeVC ()<UITableViewDelegate,UITableViewDataSource,UICollectionViewDelegate,UICollectionViewDataSource>
  22. @property (weak, nonatomic) IBOutlet UIView *NavBar;
  23. @property (strong, nonatomic) UIView *HeadView;
  24. @property (strong, nonatomic) UITableView *tableView;
  25. @property (strong, nonatomic) MyTDGroupView *SearchView;
  26. @property (strong, nonatomic) GHRefreshCollectionView *collectionView;
  27. @property (strong, nonatomic) NSMutableArray *collectionDataSource;
  28. @property (strong, nonatomic) NSMutableArray *dataArray;
  29. @property (nonatomic,assign) NSInteger currentPage;
  30. @property (nonatomic,assign) NSInteger totalPage;
  31. @end
  32. @implementation CommonHomeVC
  33. - (UIView *)HeadView
  34. {
  35. if (!_HeadView) {
  36. _HeadView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 46)];
  37. _HeadView.backgroundColor = [UIColor whiteColor];
  38. }
  39. return _HeadView;
  40. }
  41. //- (void)setTableRefresh
  42. //{
  43. // WS(weakSelf);
  44. // self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
  45. // [weakSelf headRefresh];
  46. // }];
  47. // self.tableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
  48. // [weakSelf footerRefresh];
  49. // }];
  50. // [self.tableView.mj_header beginRefreshing];
  51. //}
  52. //- (void)headRefresh{
  53. // self.currentPage = 1;
  54. // self.totalPage = 1;
  55. // [self.dataArray removeAllObjects];
  56. // [self getDataList];
  57. //}
  58. //- (void)footerRefresh{
  59. // self.currentPage += 1;
  60. // if (self.totalPage == self.dataArray.count) {
  61. // self.currentPage --;
  62. // [self.tableView.mj_footer resetNoMoreData];
  63. // return ;
  64. // }
  65. // [self getDataList];
  66. //}
  67. - (void)viewWillAppear:(BOOL)animated
  68. {
  69. [super viewWillAppear:animated];
  70. [self getDataList];
  71. }
  72. - (void)viewDidLoad {
  73. [super viewDidLoad];
  74. // [self setTableRefresh];
  75. self.fd_prefersNavigationBarHidden = YES;
  76. self.view.backgroundColor = UIColorHex(0xffffff);
  77. self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
  78. [self.HeadView addSubview:self.SearchView];
  79. [self.SearchView mas_makeConstraints:^(MASConstraintMaker *make) {
  80. make.top.mas_offset(5);
  81. make.left.right.mas_equalTo(self.HeadView);
  82. make.height.mas_offset(36);
  83. }];
  84. [self.view addSubview:self.tableView];
  85. [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
  86. make.left.right.mas_equalTo(self.view);
  87. make.top.mas_equalTo(self.NavBar.mas_bottom);
  88. if (@available(iOS 11.0, *)) {
  89. make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
  90. } else {
  91. make.bottom.equalTo(self.view.mas_bottom);
  92. }
  93. }];
  94. self.tableView.tableHeaderView = self.HeadView;
  95. [self setBarData];
  96. [self.SearchView.button setAction:^{
  97. NSLog(@"点击搜索");
  98. }];
  99. self.tableView.delegate = self;
  100. self.tableView.dataSource = self;
  101. self.tableView.backgroundColor = [UIColor clearColor];
  102. }
  103. - (void)getDataList {
  104. WS(weakSelf);
  105. SHOWLOADING
  106. [self.dataArray removeAllObjects];
  107. [[HttpManager sharedHttpManager] POSTUrl:Host(API_Collection_List) parameters:@{@"FolderId":@(0),@"Page":@(1),@"PerPage":@(99999999),@"VisitUserId":@(0)} responseStyle:JOSN success:^(id _Nonnull responseObject) {
  108. REMOVESHOW
  109. MyFavoriteModel *listModel = [[MyFavoriteModel alloc] initWithDictionary:responseObject error:nil];
  110. weakSelf.totalPage = listModel.Total;
  111. [weakSelf.dataArray addObjectsFromArray:listModel.Items];
  112. for (MyFavoriteSubModel *model in weakSelf.dataArray) {
  113. if (model.CollectionType == CollectModel_Text) {
  114. model.CollectionType = CollectModel_Aritle;
  115. }
  116. if (model.CollectionType == CollectModel_meet) {
  117. model.CollectionType = CollectModel_meetMian;
  118. }
  119. }
  120. [weakSelf changeMessageStatusWithNumber:weakSelf.dataArray.count];
  121. dispatch_async(dispatch_get_main_queue(), ^{
  122. [weakSelf.tableView reloadData];
  123. });
  124. } failure:^(NSError * _Nonnull error) {
  125. REMOVESHOW
  126. }];
  127. }
  128. - (BOOL)hidesBottomBarWhenPushed{
  129. return NO;
  130. }
  131. #pragma mark - UITableViewDelegate
  132. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
  133. return 2;
  134. }
  135. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  136. switch (section) {
  137. case 0:{
  138. return 1;
  139. }break;
  140. default:{
  141. return self.dataArray.count;
  142. }break;
  143. }
  144. }
  145. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  146. switch (indexPath.section) {
  147. case 0:{
  148. return 74.f;
  149. }break;
  150. default:{
  151. return UITableViewAutomaticDimension;
  152. }break;
  153. }
  154. }
  155. - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
  156. {
  157. switch (section) {
  158. case 0:{
  159. return 0.f;
  160. }break;
  161. default:{
  162. return 36.f;
  163. }break;
  164. }
  165. }
  166. - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
  167. {
  168. switch (section) {
  169. case 0:{
  170. UIView * view = [UIView new];
  171. return view;
  172. }break;
  173. default:{
  174. UIView * view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 36)];
  175. view.backgroundColor = UIColorHex(0xF5F5F5);
  176. UILabel * label = [UILabel new];
  177. label.font = [UIFont systemFontOfSize:14];
  178. label.textColor = UIColorHex(0x888888);
  179. label.text = @"最新收藏";
  180. [view addSubview:label];
  181. [label mas_makeConstraints:^(MASConstraintMaker *make) {
  182. make.left.mas_offset(15);
  183. make.centerY.mas_equalTo(view);
  184. }];
  185. return view;
  186. }break;
  187. }
  188. }
  189. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  190. switch (indexPath.section) {
  191. case 0:
  192. {
  193. ChatMsgListCell *cell = [ChatMsgListCell configCell1:tableView indexPath:indexPath];
  194. [cell.cell1ContentBgView addSubview:self.collectionView];
  195. self.collectionView.frame = CGRectMake(0, 0, SCREEN_WIDTH, cell.cell1ContentBgView.height);
  196. [self.collectionView reloadData];
  197. return cell;
  198. }
  199. break;
  200. default:
  201. {
  202. CommonListCell *cell = [CommonListCell configCell1:tableView indexPath:indexPath];
  203. MyFavoriteSubModel * model = [self.dataArray objectAtIndex:indexPath.row];
  204. [cell setCell1Data:model];
  205. return cell;
  206. }
  207. break;
  208. }
  209. }
  210. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  211. [tableView deselectRowAtIndexPath:indexPath animated:YES];
  212. }
  213. #pragma mark - load
  214. - (UITableView *)tableView
  215. {
  216. if (!_tableView) {
  217. _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
  218. _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
  219. }
  220. return _tableView;
  221. }
  222. - (MyTDGroupView *)SearchView
  223. {
  224. if (!_SearchView) {
  225. _SearchView = [[MyTDGroupView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 36)];
  226. }
  227. return _SearchView;
  228. }
  229. -(NSMutableArray *)dataArray{
  230. if(!_dataArray){
  231. _dataArray = [[NSMutableArray alloc] init];
  232. }
  233. return _dataArray;
  234. }
  235. -(NSMutableArray *)collectionDataSource{
  236. if(!_collectionDataSource){
  237. _collectionDataSource = [[NSMutableArray alloc] init];
  238. }
  239. return _collectionDataSource;
  240. }
  241. - (GHRefreshCollectionView *)collectionView {
  242. if (!_collectionView) {
  243. UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
  244. layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
  245. layout.sectionInset = UIEdgeInsetsMake(0, 0, 0, 0);
  246. _collectionView = [[GHRefreshCollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
  247. _collectionView.delegate = self;
  248. _collectionView.dataSource = self;
  249. _collectionView.showsHorizontalScrollIndicator = NO;
  250. [_collectionView registerNib:[UINib nibWithNibName:@"ChatMsgCollectionCell" bundle:nil] forCellWithReuseIdentifier:@"ChatMsgCollectionCell"];
  251. _collectionView.backgroundColor = [UIColor whiteColor];
  252. }
  253. return _collectionView;
  254. }
  255. #pragma mark UICollectionView
  256. - (NSInteger)numberOfSectionsInCollectionView:(GHRefreshCollectionView *)collectionView{
  257. return 1;
  258. }
  259. /**********************************************************************/
  260. #pragma mark -UICollectionViewDataSource
  261. /**********************************************************************/
  262. - (NSInteger)collectionView:(GHRefreshCollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
  263. return self.collectionDataSource.count;
  264. }
  265. - (UICollectionViewCell *)collectionView:(GHRefreshCollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
  266. {
  267. MoreAppInfoModel *bean = [self.collectionDataSource objectAtIndex:indexPath.item];
  268. ChatMsgCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"ChatMsgCollectionCell" forIndexPath:indexPath];
  269. cell.cell0IconImg.image = [UIImage imageNamed:bean.imgName];
  270. cell.cell0TitleLabel.text = bean.title;
  271. cell.imagH.constant = 25.f;
  272. cell.imagW.constant = 25.f;
  273. cell.titleConstant.constant = 8.f;
  274. switch (indexPath.item) {
  275. case 0:
  276. {
  277. cell.cell0ReadNumLabel.hidden = YES;
  278. NSString * count = @"0";
  279. cell.cell0ReadNumLabel.text = count;
  280. UILabel * label = [UILabel new];
  281. label.font = [UIFont systemFontOfSize:12];
  282. label.text = count;
  283. CGFloat width = [label sizeThatFits:CGSizeMake(SCREEN_WIDTH, 16)].width;
  284. if ((width + 5) < 16) {
  285. cell.constant.constant = 16;
  286. }else{
  287. cell.constant.constant = width + 8;
  288. }
  289. }
  290. break;
  291. case 1:
  292. {
  293. cell.cell0ReadNumLabel.hidden = YES;
  294. NSString * count = @"0";
  295. cell.cell0ReadNumLabel.text = count;
  296. UILabel * label = [UILabel new];
  297. label.font = [UIFont systemFontOfSize:12];
  298. label.text = count;
  299. CGFloat width = [label sizeThatFits:CGSizeMake(SCREEN_WIDTH, 16)].width;
  300. if ((width + 5) < 16) {
  301. cell.constant.constant = 16;
  302. }else{
  303. cell.constant.constant = width + 8;
  304. }
  305. }
  306. break;
  307. case 2:
  308. {
  309. cell.cell0ReadNumLabel.hidden = YES;
  310. NSString * count = @"0";
  311. cell.cell0ReadNumLabel.text = count;
  312. UILabel * label = [UILabel new];
  313. label.font = [UIFont systemFontOfSize:12];
  314. label.text = count;
  315. CGFloat width = [label sizeThatFits:CGSizeMake(SCREEN_WIDTH, 16)].width;
  316. if ((width + 5) < 16) {
  317. cell.constant.constant = 16;
  318. }else{
  319. cell.constant.constant = width + 8;
  320. }
  321. }
  322. break;
  323. case 3:
  324. {
  325. cell.cell0ReadNumLabel.hidden = YES;
  326. NSString * count = @"0";
  327. cell.cell0ReadNumLabel.text = count;
  328. UILabel * label = [UILabel new];
  329. label.font = [UIFont systemFontOfSize:12];
  330. label.text = count;
  331. CGFloat width = [label sizeThatFits:CGSizeMake(SCREEN_WIDTH, 16)].width;
  332. if ((width + 5) < 16) {
  333. cell.constant.constant = 16;
  334. }else{
  335. cell.constant.constant = width + 8;
  336. }
  337. }
  338. break;
  339. default:
  340. {
  341. cell.cell0ReadNumLabel.hidden = YES ;
  342. }
  343. break;
  344. }
  345. cell.cell0MengCengView.hidden = YES;
  346. return cell;
  347. }
  348. /****************************************************/
  349. #pragma mark --UICollectionViewDelegateFlowLayout
  350. /****************************************************/
  351. - (CGSize)collectionView:(GHRefreshCollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
  352. {
  353. CGFloat width = (SCREEN_WIDTH - 20) / self.collectionDataSource.count;
  354. CGFloat height = 80;
  355. return CGSizeMake(width, height);
  356. }
  357. -(UIEdgeInsets)collectionView:(GHRefreshCollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section
  358. {
  359. CGFloat W = 10;
  360. return UIEdgeInsetsMake(0,W,0,W);
  361. }
  362. - (CGFloat)collectionView:(GHRefreshCollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section{
  363. return 0;
  364. }
  365. - (CGFloat)collectionView:(GHRefreshCollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section{
  366. return 0;
  367. }
  368. - (void)collectionView:(GHRefreshCollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
  369. [collectionView deselectItemAtIndexPath:indexPath animated:YES];
  370. switch (indexPath.item) {
  371. case 0:
  372. {
  373. MyFavoriteVC *vc = [MyFavoriteVC initMyFavoriteVC];
  374. vc.listType = MyFavoriteListLevelTypeA;
  375. vc.FolderId = 0;
  376. vc.operationStateEnum = OperationStateEnum0;
  377. vc.myTitle = @"我的收藏";
  378. vc.hidesBottomBarWhenPushed = YES;
  379. [self.navigationController pushViewController:vc animated:YES];
  380. }
  381. break;
  382. case 1:
  383. {
  384. CommonNoteVC * vc = [CommonNoteVC initCommonNoteVC];
  385. vc.hidesBottomBarWhenPushed = YES;
  386. [self.navigationController pushViewController:vc animated:YES];
  387. }
  388. break;
  389. case 2:
  390. {
  391. CommonToolVC * vc = [CommonToolVC initCommonToolVC];
  392. vc.hidesBottomBarWhenPushed = YES;
  393. [self.navigationController pushViewController:vc animated:YES];
  394. }
  395. break;
  396. default:
  397. {
  398. CommonWorkVC * vc = [CommonWorkVC initCommonWorkVC];
  399. vc.hidesBottomBarWhenPushed = YES;
  400. [self.navigationController pushViewController:vc animated:YES];
  401. }
  402. break;
  403. }
  404. }
  405. - (void)setBarData
  406. {
  407. [self.collectionDataSource removeAllObjects];
  408. NSArray * titleArray = @[@"收藏",@"笔记",@"工具箱",@"工作台"];
  409. NSArray * imageArray = @[@"Common_collect",@"Common_note",@"Common_gjxiang",@"Common_gztai"];
  410. for (NSInteger i = 0; i < titleArray.count; i ++) {
  411. MoreAppInfoModel * model = [[MoreAppInfoModel alloc] init];
  412. model.title = titleArray[i];
  413. model.imgName = imageArray[i];
  414. [self.collectionDataSource addObject:model];
  415. }
  416. }
  417. #pragma Mark 左滑按钮 iOS8以上
  418. - (nullable UISwipeActionsConfiguration *)tableView:(UITableView *)tableView trailingSwipeActionsConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(ios(11.0)) API_UNAVAILABLE(tvos){
  419. if (indexPath.section == 0) {
  420. UISwipeActionsConfiguration *actions = [UISwipeActionsConfiguration configurationWithActions:@[]];
  421. actions.performsFirstActionWithFullSwipe = NO;
  422. return actions;
  423. }else{
  424. WEAKSELF
  425. MyFavoriteSubModel * model = [self.dataArray objectAtIndex:indexPath.row];
  426. UIContextualAction *action1 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleNormal title:@"转发" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
  427. [tableView setEditing:NO animated:YES];
  428. }];
  429. action1.backgroundColor = UIColorHex(#FF923A);
  430. UIContextualAction *action2 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleNormal title:model.IsTop ? @"取消置顶" :@"置顶" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
  431. [weakSelf topFind:model];
  432. }];
  433. action2.backgroundColor = UIColorHex(#9BA9CB);
  434. UIContextualAction *action3 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleNormal title:@"移动" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
  435. [weakSelf launchMoveVC:@[@(model.Id)].mutableCopy];
  436. }];
  437. action3.backgroundColor = UIColorHex(#589AF1);
  438. UIContextualAction *action4 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive title:@"删除" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
  439. [tableView setEditing:NO animated:YES];
  440. UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:nil message:@"确认删除" preferredStyle:UIAlertControllerStyleAlert];
  441. UIAlertAction *ok = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
  442. [weakSelf.tableView reloadData];
  443. }];
  444. [ok setValue:k9 forKey:@"_titleTextColor"];
  445. UIAlertAction *noOk = [UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
  446. [weakSelf deleteFind:@[model].mutableCopy indexPath:indexPath];
  447. }];
  448. [alertVC addAction:ok];
  449. [alertVC addAction:noOk];
  450. completionHandler(YES);
  451. [weakSelf presentViewController:alertVC animated:YES completion:nil];
  452. }];
  453. action4.backgroundColor = UIColorHex(#F64A33);
  454. UISwipeActionsConfiguration *actions = [UISwipeActionsConfiguration configurationWithActions:@[action4,action3,action2,action1]];
  455. actions.performsFirstActionWithFullSwipe = NO;
  456. return actions;
  457. }
  458. }
  459. - (void)topFind:(MyFavoriteSubModel*)findModel{
  460. WEAKSELF
  461. [[HttpManager sharedHttpManager] PUTUrl:[NSString stringWithFormat:@"%@%@%ld",BaseUrl,API_APP_Collection_Top,(long)findModel.MiddleId] parameters:@{} success:^(id _Nonnull responseObject) {
  462. [weakSelf getDataList];
  463. } failure:^(NSError * _Nonnull error) {
  464. SHOWERROR([ZYCTool handerResultData:error]);
  465. }];
  466. }
  467. - (void)deleteFind:(NSMutableArray<MyFavoriteSubModel *>*)findModelArray indexPath:(NSIndexPath *)indexPath{
  468. NSMutableArray *MiddleIds = [NSMutableArray array];
  469. for (MyFavoriteSubModel *model in findModelArray) {
  470. [MiddleIds addObject:@(model.Id)];
  471. }
  472. NSMutableDictionary *dic = [[NSMutableDictionary alloc]init];
  473. [dic setValue:MiddleIds forKey:@"MiddleIds"];
  474. [dic setValue:@(3) forKey:@"FolderType"];
  475. WS(weakSelf);
  476. UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:nil message:@"确认删除" preferredStyle:UIAlertControllerStyleAlert];
  477. UIAlertAction *ok = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
  478. dispatch_async(dispatch_get_main_queue(), ^{
  479. [weakSelf.tableView reloadData];
  480. });
  481. }];
  482. [ok setValue:k9 forKey:@"_titleTextColor"];
  483. UIAlertAction *noOk = [UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
  484. [[HttpManager sharedHttpManager] POSTUrl:Host(API_Find_DeleteRecord) parameters:dic responseStyle:DATA success:^(id _Nonnull responseObject) {
  485. [weakSelf getDataList];
  486. } failure:^(NSError * _Nonnull error) {
  487. SHOWERROR([ZYCTool handerResultData:error]);
  488. }];
  489. }];
  490. [alertVC addAction:ok];
  491. [alertVC addAction:noOk];
  492. [self presentViewController:alertVC animated:YES completion:nil];
  493. }
  494. - (void)launchMoveVC:(NSMutableArray<NSNumber*>*)selectIDArray{
  495. MoveViewController * vc = [MoveViewController initMoveViewController];
  496. vc.TypeId = CreateCollectionType;
  497. vc.collectType = CollectHanderType_Move;
  498. vc.ParentId = 0;
  499. vc.FolderIds = selectIDArray;
  500. vc.titleStr = @"移动";
  501. [self.navigationController pushViewController:vc animated:YES];
  502. }
  503. @end