NasSearchAppViewController.m 21 KB

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