NasSearchAppViewController.m 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  1. //
  2. // NasSearchAppViewController.m
  3. // 双子星云手机
  4. //
  5. // Created by xd h on 2025/6/17.
  6. //
  7. #import "NasSearchAppViewController.h"
  8. #import "searchBarSecondTypeView.h"
  9. #import "searchListModel.h"
  10. #import "couldPhoneFileListModel.h"
  11. #import "downloadManager.h"
  12. #import "uploadFileRecordViewController.h"
  13. #import "UIScrollView+EmptyDataSet.h"
  14. #import "downLoadPreViewCell.h"
  15. #import "editTypeHeadView.h"
  16. #import "editTypeBottomView.h"
  17. #import "editShareView.h"
  18. #import "netWorkManager.h"
  19. #import "queryShareModel.h"
  20. #import "editAPPBottomView.h"
  21. @interface NasSearchAppViewController ()<UITableViewDelegate,UITableViewDataSource,DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
  22. {
  23. BOOL canShareType;
  24. }
  25. @property (nonatomic, strong) UITableView *tableView;
  26. @property(nonatomic,assign) BOOL isEditType;
  27. @property(nonatomic,strong) editTypeHeadView*curEditTypeHeadView;
  28. @property(nonatomic,strong) editAPPBottomView*curEditTypeBottomView;
  29. @property(nonatomic,strong) searchBarSecondTypeView* searchBarSecondTypeV;//
  30. @property (nonatomic, strong) NSMutableArray*didSelectListArr;//选中的数据
  31. @property (nonatomic, strong) NSMutableArray*curSearchListArr;//搜索(过滤)的数据
  32. @property (nonatomic, copy) NSString *searchKeyWord;//搜索关键字
  33. @property (nonatomic, strong) UIView *tableViewHead;
  34. @property (nonatomic, strong) UILabel *tableViewHeadLabel;
  35. @end
  36. @implementation NasSearchAppViewController
  37. - (void)viewDidLoad {
  38. [super viewDidLoad];
  39. // Do any additional setup after loading the view.
  40. [self.toolBar setHidden:YES];
  41. [self.navigationBar setHidden:YES];
  42. [self.navBarBGView setHidden:NO];
  43. self.navBarBGView.backgroundColor = [UIColor whiteColor];
  44. [self.view setBackgroundColor:[UIColor whiteColor]];
  45. [self drawAnyView];
  46. _didSelectListArr = [NSMutableArray new];
  47. _curSearchListArr = [NSMutableArray new];
  48. //数据埋点
  49. //[[netWorkManager shareInstance] DataEmbeddingPointBy:2 withEventValue:@"Video"];
  50. }
  51. - (void)drawAnyView{
  52. _searchBarSecondTypeV = [[searchBarSecondTypeView alloc] init];
  53. [self.view addSubview:_searchBarSecondTypeV];
  54. [_searchBarSecondTypeV mas_makeConstraints:^(MASConstraintMaker *make) {
  55. make.centerY.equalTo(self.backBtn.mas_centerY).offset(0);
  56. make.height.mas_equalTo(32.0);
  57. make.left.mas_equalTo(52.0);
  58. //make.right.mas_equalTo(-48.0);
  59. make.right.mas_equalTo(0.0);
  60. }];
  61. KWeakSelf
  62. _searchBarSecondTypeV.didClickSearchFun = ^(NSString * _Nonnull searchText) {
  63. //HLog(@"1111:%@",searchText)
  64. weakSelf.searchKeyWord = searchText;
  65. [weakSelf.curSearchListArr removeAllObjects];
  66. [weakSelf searchListDataFun];
  67. };
  68. _curEditTypeHeadView = [[editTypeHeadView alloc] init];
  69. _curEditTypeHeadView.hidden = YES;
  70. [self.navBarBGView addSubview:_curEditTypeHeadView];
  71. [_curEditTypeHeadView mas_makeConstraints:^(MASConstraintMaker *make) {
  72. make.left.mas_equalTo(0);
  73. make.right.mas_equalTo(0);
  74. make.bottom.mas_equalTo(0);
  75. make.height.mas_equalTo(NAVIHEIGHT - AdaptNaviHeight);
  76. }];
  77. #pragma mark 编辑状态的 取消 和全选按钮 响应事件
  78. _curEditTypeHeadView.didClickButtonFun = ^(NSInteger tag) {
  79. if(tag==1){
  80. [weakSelf userCancelEditTypeFun];
  81. }
  82. };
  83. _curEditTypeHeadView.didClickSelectAllFun = ^(UIButton * _Nonnull but) {
  84. [weakSelf didClickSelectAllButton:but];
  85. };
  86. _curEditTypeBottomView = [[editAPPBottomView alloc] init];
  87. _curEditTypeBottomView.hidden = YES;
  88. _curEditTypeBottomView.isCanDeleteType = _isCanDeleteType;
  89. [self.view addSubview:_curEditTypeBottomView];
  90. [_curEditTypeBottomView mas_makeConstraints:^(MASConstraintMaker *make) {
  91. make.left.mas_equalTo(0);
  92. make.right.mas_equalTo(0);
  93. make.bottom.mas_equalTo(0);
  94. make.height.mas_equalTo(60 + AdaptTabHeight);
  95. }];
  96. #pragma mark 编辑状态的 下载 分享 删除 响应事件
  97. _curEditTypeBottomView.didClickButtonFun = ^(NSInteger tag) {
  98. if(tag==1){
  99. [weakSelf gotoDownLoadFileFun];
  100. }
  101. else if(tag==2){
  102. [weakSelf gotoShareViewFun];
  103. }
  104. else if(tag==3){
  105. [weakSelf showDeleteAlearViewFun];
  106. }
  107. };
  108. [self.view addSubview:self.tableView];
  109. [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
  110. make.left.mas_equalTo(0);
  111. make.right.mas_equalTo(0);
  112. //make.bottom.mas_equalTo(-(safeArea));
  113. make.bottom.mas_equalTo(0);
  114. make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
  115. }];
  116. self.tableView.hidden = YES;
  117. _tableViewHead = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 30)];
  118. _tableViewHead.backgroundColor = [UIColor whiteColor];
  119. //self.tableView.tableHeaderView = _tableViewHead;
  120. _tableViewHeadLabel = [[UILabel alloc] init];
  121. _tableViewHeadLabel.textColor = [UIColor hwColor:@"#0A132B"];
  122. _tableViewHeadLabel.font = [UIFont systemFontOfSize:12.0];
  123. _tableViewHeadLabel.text = NSLocalizedString(@"Search_Total_result",nil);
  124. [_tableViewHead addSubview:_tableViewHeadLabel];
  125. [_tableViewHeadLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  126. make.left.mas_equalTo(15.0);
  127. make.right.mas_equalTo(0.0);
  128. make.top.mas_equalTo(0.0);
  129. make.bottom.mas_equalTo(0.0);
  130. }];
  131. }
  132. #pragma mark - 懒加载
  133. - (UITableView *)tableView{
  134. if (!_tableView) {
  135. _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, SCREEN_H - TABBARHEIGHT) style:UITableViewStylePlain];
  136. _tableView.delegate = self;
  137. _tableView.dataSource = self;
  138. _tableView.showsVerticalScrollIndicator = NO;
  139. _tableView.showsHorizontalScrollIndicator = NO;
  140. // _tableView.contentInset = UIEdgeInsetsMake(-H_STATE_BAR, 0, 0, 0);
  141. [_tableView setSeparatorStyle:(UITableViewCellSeparatorStyleNone)];
  142. [_tableView setSeparatorColor:[UIColor clearColor]];
  143. [_tableView setBackgroundColor:[UIColor clearColor]];
  144. [_tableView setTableFooterView:[UIView new]];
  145. [_tableView setBounces:YES];
  146. if (@available(iOS 15.0, *)) {
  147. _tableView.sectionHeaderTopPadding = 0;
  148. }
  149. //空数据引入第三方开源处理
  150. _tableView.emptyDataSetSource = self;
  151. _tableView.emptyDataSetDelegate = self;
  152. }
  153. return _tableView;
  154. }
  155. #pragma mark - 列表委托
  156. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
  157. return 1;
  158. }
  159. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  160. return _curSearchListArr.count;
  161. }
  162. - (downLoadPreViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  163. __block NSInteger row = indexPath.row;
  164. static NSString *identifier = @"downLoadPreViewCell";
  165. downLoadPreViewCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];
  166. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  167. if (!cell){
  168. cell = [[downLoadPreViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
  169. [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
  170. [cell setBackgroundColor:[UIColor clearColor]];
  171. [cell setAccessoryType:(UITableViewCellAccessoryNone)];
  172. [cell.bgViewLayer removeFromSuperlayer];
  173. [cell.titleLabel2 setHidden:NO];
  174. [cell.rightImage setHidden:YES];
  175. [cell.lineView setHidden:YES];
  176. [cell.checkButton setHidden:NO];
  177. }
  178. if(row < _curSearchListArr.count){
  179. getInstalledAppModel* dataModel = _curSearchListArr[row];
  180. cell.curGetInstalledAppMod = dataModel;
  181. KWeakSelf
  182. cell.didClickSwitch = ^(BOOL SwitchOn) {
  183. [weakSelf userCheckFilePreviewByRow:row];
  184. };
  185. }
  186. return cell;
  187. }
  188. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  189. return 70;
  190. }
  191. #pragma mark 空数据
  192. - (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView {
  193. NSString *imageName = @"common_no_data_pic";
  194. return [UIImage imageNamed:imageName];
  195. }
  196. - (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView {
  197. NSString *text = NSLocalizedString(@"Search_nodata_tip",nil);
  198. NSDictionary *attributes = @{NSFontAttributeName: [UIFont systemFontOfSize:16.0f],
  199. NSForegroundColorAttributeName: HW999999Color};
  200. return [[NSAttributedString alloc] initWithString:text attributes:attributes];
  201. }
  202. //调整图片位置
  203. - (CGFloat)verticalOffsetForEmptyDataSet:(UIScrollView *)scrollView {
  204. return -150;
  205. }
  206. #pragma mark 用户长按图片进入编辑
  207. - (void)setViewEditTypeFun
  208. {
  209. _isEditType = YES;
  210. _searchBarSecondTypeV.hidden = YES;
  211. //[self.tableView reloadData];
  212. _curEditTypeHeadView.hidden = NO;
  213. _curEditTypeBottomView.hidden = NO;
  214. [self RefreshAllUIFun];
  215. }
  216. #pragma mark 用户取消编辑编辑
  217. - (void)userCancelEditTypeFun
  218. {
  219. //数据还原
  220. for (getInstalledAppModel*model in _didSelectListArr) {
  221. model.isSelectType = NO;
  222. }
  223. [_didSelectListArr removeAllObjects];
  224. _isEditType = NO;
  225. _searchBarSecondTypeV.hidden = NO;
  226. //[self.tableView reloadData];
  227. _curEditTypeHeadView.hidden = YES;
  228. _curEditTypeBottomView.hidden = YES;
  229. [self RefreshAllUIFun];
  230. }
  231. #pragma mark 更新UI界面
  232. - (void)RefreshAllUIFun
  233. {
  234. [self.tableView reloadData];
  235. KWeakSelf
  236. [self.tableView mas_remakeConstraints:^(MASConstraintMaker *make) {
  237. make.left.mas_equalTo(0);
  238. make.right.mas_equalTo(0);
  239. if(weakSelf.isEditType){
  240. make.bottom.equalTo(weakSelf.curEditTypeBottomView.mas_top).offset(0.0);
  241. }
  242. else{
  243. make.bottom.mas_equalTo(0);
  244. }
  245. make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
  246. }];
  247. }
  248. - (void)userCheckFilePreviewByRow:(NSInteger)row
  249. {
  250. if(row < _curSearchListArr.count){
  251. getInstalledAppModel* dataModel = _curSearchListArr[row];
  252. if(dataModel.isSelectType){
  253. [_didSelectListArr removeObject:dataModel];
  254. }
  255. else{
  256. [_didSelectListArr addObject:dataModel];
  257. }
  258. dataModel.isSelectType = !dataModel.isSelectType;
  259. [self setEditTypeTitleFun];
  260. }
  261. }
  262. - (void)didClickSelectAllButton:(UIButton*)button
  263. {
  264. //button.selected = !button.selected;
  265. [_didSelectListArr removeAllObjects];
  266. for (getInstalledAppModel* dataModel in _curSearchListArr) {
  267. if(!button.selected){
  268. dataModel.isSelectType = button.selected;
  269. }
  270. else{
  271. [_didSelectListArr addObject:dataModel];
  272. dataModel.isSelectType = button.selected;
  273. }
  274. }
  275. [self.tableView reloadData];
  276. [self setEditTypeTitleFun];
  277. }
  278. #pragma mark 设置选中标题
  279. - (void)setEditTypeTitleFun
  280. {
  281. [_curEditTypeHeadView setTitleLabetextByNumbers:_didSelectListArr.count];
  282. if(_didSelectListArr.count > 0){
  283. [self setViewEditTypeFun];
  284. }
  285. else{
  286. [self userCancelEditTypeFun];
  287. }
  288. }
  289. #pragma mark 用户点击分享
  290. - (void)gotoShareViewFun
  291. {
  292. if (_didSelectListArr.count > 5) {
  293. [[iToast makeText:NSLocalizedString(@"share_max_count_tip2",nil)] show];
  294. return;
  295. }
  296. NSMutableArray *changeModelArr = [NSMutableArray new];
  297. for (getInstalledAppModel* dataModel in _didSelectListArr) {
  298. NASFilePicDataArrModel *model = [NASFilePicDataArrModel new];
  299. model.type = @"apk";//dataModel.fileType;
  300. model.path = dataModel.path;
  301. model.name = dataModel.name;
  302. if(dataModel.size > 0){
  303. model.size = dataModel.size;
  304. }
  305. else{
  306. model.size = dataModel.length;
  307. }
  308. model.time = dataModel.time;
  309. [changeModelArr addObject:model];
  310. }
  311. editShareView *editShareV = [[editShareView alloc] init];
  312. editShareV.didSelectListArr = changeModelArr;
  313. editShareV.shareFileType = @"3";
  314. [self.view addSubview:editShareV];
  315. [editShareV mas_makeConstraints:^(MASConstraintMaker *make) {
  316. make.left.mas_equalTo(0);
  317. make.right.mas_equalTo(0);
  318. make.bottom.mas_equalTo(0);
  319. make.top.mas_equalTo(0);
  320. }];
  321. }
  322. - (void)viewWillAppear:(BOOL)animated
  323. {
  324. [super viewWillAppear:animated];
  325. }
  326. - (void)viewDidAppear:(BOOL)animated{
  327. [super viewDidAppear:animated];
  328. [self showDownloadTipFun];
  329. if(!_curSearchListArr || _curSearchListArr.count == 0){
  330. [self queryShareSwitchFunFun];
  331. [self queryTVSwitchFunFun];
  332. }
  333. }
  334. - (void)viewWillDisappear:(BOOL)animated{
  335. [super viewWillDisappear:animated];
  336. //[self removeNewIndicator];
  337. [self removeNewIndicatorHaveStr];
  338. }
  339. - (void)gotoDownloadloadFileRecordFun
  340. {
  341. uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
  342. [self.navigationController pushViewController:vc animated:YES];
  343. vc.isDownloadingType = YES;
  344. //[vc gotoDownloadFile:_downloadFileBottomV.indexPathsForSelectedItems];
  345. }
  346. - (void)showDownloadTipFun
  347. {
  348. BOOL didReadUploadTipType = [HWDataManager getBoolWithKey:Const_file_downLoad_need_read];
  349. if(didReadUploadTipType){
  350. return;
  351. }
  352. //KWeakSelf
  353. /*弹窗提示恢复出厂*/
  354. ComontAlretViewController *nextVC = [[ComontAlretViewController alloc] initWithTiTle:@""
  355. msg:NSLocalizedString(@"upload_download_need_read_msg",nil)
  356. imageStr:@""
  357. cancelTitle:NSLocalizedString(@"guide_set_pwd_guide_know",nil)
  358. okTitle:@""
  359. isOkBtnHighlight:NO
  360. didClickOk:^{
  361. } didClickCancel:^{
  362. [HWDataManager setBoolWithKey:Const_file_downLoad_need_read value:YES];
  363. }];
  364. nextVC.modalPresentationStyle = UIModalPresentationCustom;
  365. [self presentViewController:nextVC animated:YES completion:^{
  366. nextVC.view.superview.backgroundColor = [UIColor clearColor];
  367. }];
  368. }
  369. - (void)didiClikRightButGotoTransferListFun:(UIButton*)but
  370. {
  371. uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
  372. [self.navigationController pushViewController:vc animated:YES];
  373. }
  374. #pragma mark 获取文件数据
  375. - (void)searchListDataFun
  376. {
  377. if(!_searchKeyWord || _searchKeyWord.length == 0){
  378. return;
  379. }
  380. for (getInstalledAppModel* model in _totalAPPListModel.data) {
  381. if ([model.name containsString:_searchKeyWord]) {
  382. [_curSearchListArr addObject:model];
  383. }
  384. }
  385. if (_curSearchListArr.count == 0) {
  386. self.tableView.tableHeaderView = nil;
  387. }
  388. else{
  389. if(!self.tableView.tableHeaderView){
  390. self.tableView.hidden = NO;
  391. self.tableView.tableHeaderView = _tableViewHead;
  392. }
  393. NSString *str = [[NSString alloc] initWithFormat:@"%@(%ld)",NSLocalizedString(@"Search_Total_result",nil),_curSearchListArr.count];
  394. _tableViewHeadLabel.text = str;
  395. }
  396. [self RefreshAllUIFun];
  397. }
  398. #pragma mark 文件下载
  399. - (void)gotoDownLoadFileFun
  400. {
  401. if(_didSelectListArr.count == 0){
  402. [[iToast makeText:@""] show];
  403. return;
  404. }
  405. NSMutableArray *arr = [NSMutableArray new];
  406. for (getInstalledAppModel *dataModel in _didSelectListArr) {
  407. couldPhoneFileModel* fileModel = [couldPhoneFileModel new];
  408. fileModel.fileType = dataModel.fileType;
  409. fileModel.path = dataModel.path;
  410. fileModel.name = dataModel.name;
  411. if (dataModel.size) {
  412. fileModel.length = dataModel.size;
  413. }
  414. else{
  415. fileModel.length = dataModel.length;
  416. }
  417. //fileModel.time = dataModel.duration;
  418. [arr addObject:fileModel];
  419. }
  420. uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
  421. [self.navigationController pushViewController:vc animated:YES];
  422. vc.isDownloadingType = YES;
  423. [vc gotoDownloadFile:arr];
  424. }
  425. #pragma mark 删除图片
  426. - (void)showDeleteAlearViewFun
  427. {
  428. NSString *titleStr = NSLocalizedString(@"delete_file_title_msg",nil);
  429. NSString *tipStr = NSLocalizedString(@"delete_file_tip_msg",nil);
  430. KWeakSelf
  431. ComontAlretViewController *curAlretVC= [[ComontAlretViewController alloc] initWithTiTle:titleStr
  432. msg:tipStr
  433. imageStr:@""
  434. cancelTitle:NSLocalizedString(@"other_cancel",nil)
  435. okTitle:NSLocalizedString(@"other_confirm",nil) isOkBtnHighlight:YES
  436. didClickOk:^{
  437. [weakSelf delFileListFun];
  438. } didClickCancel:^{
  439. }];
  440. curAlretVC.modalPresentationStyle = UIModalPresentationCustom;
  441. [self presentViewController:curAlretVC animated:YES completion:^{
  442. curAlretVC.view.superview.backgroundColor = [UIColor clearColor];
  443. }];
  444. }
  445. #pragma mark 删除文件数据
  446. - (void)delFileListFun
  447. {
  448. NSMutableDictionary*paraDict = [NSMutableDictionary new];
  449. NSMutableArray *pathArr = [NSMutableArray new];
  450. for (getInstalledAppModel *dataModel in _didSelectListArr) {
  451. [pathArr addObject:dataModel.path];
  452. }
  453. [paraDict setValue:pathArr forKey:@"path"];
  454. [self showNewIndicatorWithCanBack:YES canTouch:NO];
  455. //NSString*code = [[NSString alloc] initWithFormat:@"delFile?path=%@",paraDict[@"path"]]; //delFile?path=[/storage/emulated/0/Download/IMG_6464.HEIC]
  456. KWeakSelf //@"delFile"
  457. [[netWorkManager shareInstance] cloudPhonePostCallBackCode:@"delFile" Parameters:paraDict success:^(id _Nonnull responseObject) {
  458. [weakSelf removeNewIndicator];
  459. SuperModel *model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
  460. if(model && model.status == 0){
  461. [[iToast makeText:NSLocalizedString(@"delete_file_suc_msg",nil)] show];
  462. [weakSelf didDeleteSucFun];
  463. }
  464. else{
  465. }
  466. } failure:^(NSError * _Nonnull error) {
  467. [weakSelf removeNewIndicator];
  468. }];
  469. //数据埋点
  470. [[netWorkManager shareInstance] DataEmbeddingPointBy:3 withEventValue:@"Video_delete"];
  471. }
  472. #pragma mark 删除成功
  473. - (void)didDeleteSucFun
  474. {
  475. //删除最近文件
  476. //apk没最近文件
  477. //2.删除已经获取到的网络数据
  478. [self deleteNetDataByDeleteSucFun];
  479. [_didSelectListArr removeAllObjects];
  480. [self setEditTypeTitleFun];
  481. }
  482. #pragma mark 删除成功后 对应删除原来获取的网络数据
  483. - (void)deleteNetDataByDeleteSucFun
  484. {
  485. //1.处理传入的全部数据
  486. NSMutableArray *afterFilterArr = [NSMutableArray new];
  487. for (getInstalledAppModel *model in _totalAPPListModel.data) {
  488. if (!model.isSelectType) {
  489. [afterFilterArr addObject:model];
  490. }
  491. }
  492. _totalAPPListModel.data = (NSArray<getInstalledAppModel>*)afterFilterArr;
  493. //2.重新搜索
  494. [_curSearchListArr removeAllObjects];
  495. [self searchListDataFun];
  496. }
  497. #pragma mark 获取分享开关
  498. -(void)queryShareSwitchFunFun
  499. {
  500. NSMutableDictionary *paraDict = [NSMutableDictionary new];
  501. [paraDict setValue:@3 forKey:@"type"];
  502. KWeakSelf
  503. [[netWorkManager shareInstance] CommonGetWithCallBackCode:queryShareSwitchFun Parameters:paraDict success:^(id _Nonnull responseObject){
  504. queryShareModel *queryShareMod = [[queryShareModel alloc] initWithDictionary:responseObject error:nil];
  505. if(queryShareMod){
  506. self->canShareType = queryShareMod.data.configValue;
  507. weakSelf.curEditTypeBottomView.isCanShareType = self->canShareType;
  508. }
  509. } failure:^(NSError * _Nonnull error) {
  510. }];
  511. }
  512. #pragma mark 获取安装到TV开关
  513. -(void)queryTVSwitchFunFun
  514. {
  515. NSMutableDictionary *paraDict = [NSMutableDictionary new];
  516. [paraDict setValue:@"tv_switch_button" forKey:@"configKey"];
  517. KWeakSelf
  518. [[netWorkManager shareInstance] CommonGetWithCallBackCode:querySwitchButton Parameters:paraDict success:^(id _Nonnull responseObject){
  519. queryShareModel *queryShareMod = [[queryShareModel alloc] initWithDictionary:responseObject error:nil];
  520. if(queryShareMod){
  521. BOOL canInstallToTVType = queryShareMod.data.configValue;
  522. weakSelf.curEditTypeBottomView.isCanInstallToTVType = canInstallToTVType;
  523. }
  524. } failure:^(NSError * _Nonnull error) {
  525. }];
  526. }
  527. @end