shareRecordViewController.m 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. //
  2. // shareRecordViewController.m
  3. // 双子星云手机
  4. //
  5. // Created by xd h on 2024/5/14.
  6. //
  7. #import "shareRecordViewController.h"
  8. #import "shareRecordTableViewCell.h"
  9. #import "shareRecordDetailsHWViewController.h"
  10. #import "ShareRecordModel.h"
  11. @interface shareRecordViewController ()<UITableViewDelegate,UITableViewDataSource,DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
  12. {
  13. BOOL isEditType;
  14. }
  15. @property (nonatomic, strong) UITableView *tableView;
  16. @property (nonatomic, strong) UIButton *ruleBottomButton;
  17. @property (nonatomic, strong) UIButton *delRuleButton;
  18. @property (nonatomic, strong) UIButton *cancelShareButton;
  19. @property (nonatomic, strong) UIButton *rightEditButton;
  20. @property (nonatomic, strong) UIButton *leftCancleButton;
  21. @property (nonatomic, strong) UIButton *rightSelectAllButton;
  22. @property (nonatomic, strong) ShareRecordModel * ShareRecordMod;
  23. @property (nonatomic, strong) NSMutableArray *didSelectArr;
  24. @end
  25. @implementation shareRecordViewController
  26. - (void)viewDidLoad {
  27. [super viewDidLoad];
  28. // Do any additional setup after loading the view.
  29. [self.toolBar setHidden:YES];
  30. [self.navigationBar setHidden:YES];
  31. [self.navBarBGView setHidden:NO];
  32. self.navBarBGView.backgroundColor = [UIColor whiteColor];
  33. //[self.view setBackgroundColor:[UIColor hwColor:@"#F5F7FA"]];
  34. [self.view setBackgroundColor:[UIColor whiteColor]];
  35. self.titleLabel.text = NSLocalizedString(@"my_set_no_share",nil);
  36. _didSelectArr = [NSMutableArray new];
  37. [self drawAnyView];
  38. [self getShareFileListFun];
  39. }
  40. - (void)drawAnyView{
  41. [self initNavHeadUIFun];
  42. [self.view addSubview:self.tableView];
  43. [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
  44. make.left.mas_equalTo(0);
  45. make.right.mas_equalTo(0);
  46. make.bottom.mas_equalTo(-(60 + safeArea));
  47. make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
  48. }];
  49. _ruleBottomButton = [[UIButton alloc] init];
  50. [_ruleBottomButton setTitle:NSLocalizedString(@"share_rule_but_title",nil) forState:UIControlStateNormal];
  51. [_ruleBottomButton setTitleColor:[UIColor hwColor:@"#01B7EA"] forState:UIControlStateNormal];
  52. _ruleBottomButton.titleLabel.font = [UIFont boldSystemFontOfSize:14.0];
  53. [_ruleBottomButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
  54. _ruleBottomButton.tag = 1;
  55. [self.view addSubview:_ruleBottomButton];
  56. _ruleBottomButton.layer.cornerRadius = 8;
  57. _ruleBottomButton.layer.masksToBounds = YES;
  58. _ruleBottomButton.backgroundColor = [UIColor whiteColor];
  59. _ruleBottomButton.layer.borderWidth = 1;
  60. _ruleBottomButton.layer.borderColor = [UIColor hwColor:@"#01B7EA"].CGColor;
  61. [_ruleBottomButton mas_makeConstraints:^(MASConstraintMaker *make) {
  62. make.left.mas_equalTo(15);
  63. make.right.mas_equalTo(-15);
  64. make.bottom.mas_equalTo(-(safeArea));
  65. make.height.mas_equalTo(48);
  66. }];
  67. _delRuleButton = [[UIButton alloc] init];
  68. [_delRuleButton setTitle:NSLocalizedString(@"share_del_record",nil) forState:UIControlStateNormal];
  69. [_delRuleButton setTitleColor:HW0A132BColor forState:UIControlStateNormal];
  70. _delRuleButton.titleLabel.font = [UIFont boldSystemFontOfSize:14.0];
  71. [_delRuleButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
  72. _delRuleButton.tag = 10;
  73. [self.view addSubview:_delRuleButton];
  74. _delRuleButton.layer.cornerRadius = 8;
  75. _delRuleButton.layer.masksToBounds = YES;
  76. _delRuleButton.backgroundColor = [UIColor hwColor:@"#E3E8F1"];
  77. _delRuleButton.hidden = YES;
  78. [_delRuleButton mas_makeConstraints:^(MASConstraintMaker *make) {
  79. make.left.mas_equalTo(15);
  80. make.right.equalTo(self.view.mas_centerX).offset(-10);
  81. make.bottom.mas_equalTo(-(safeArea));
  82. make.height.mas_equalTo(48);
  83. }];
  84. _cancelShareButton = [[UIButton alloc] init];
  85. CGFloat w_btn = SCREEN_W/2.0 -15 -10;
  86. // gradient
  87. CAGradientLayer *gl = [CAGradientLayer layer];
  88. gl.frame = CGRectMake(0,0,w_btn,48.f);
  89. gl.startPoint = CGPointMake(0, 0.5);
  90. gl.endPoint = CGPointMake(1, 0.5);
  91. gl.colors = @[(__bridge id)HW0CDEFDColor.CGColor, (__bridge id)HW058DFBColor.CGColor];
  92. gl.locations = @[@(0), @(1.0f)];
  93. [_cancelShareButton.layer addSublayer:gl];
  94. [_cancelShareButton setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
  95. [_cancelShareButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:(UIControlEventTouchUpInside)];
  96. [_cancelShareButton setTitle:NSLocalizedString(@"cancel_share_title",nil) forState:(UIControlStateNormal)];
  97. [_cancelShareButton.titleLabel setFont:[UIFont systemFontOfSize:14.f]];
  98. [_cancelShareButton.layer setCornerRadius:8.f];
  99. _cancelShareButton.clipsToBounds = YES;
  100. _cancelShareButton.tag = 11;
  101. [self.view addSubview:_cancelShareButton];
  102. _cancelShareButton.hidden = YES;
  103. [_cancelShareButton mas_makeConstraints:^(MASConstraintMaker *make) {
  104. make.right.mas_equalTo(-15);
  105. make.left.equalTo(self.view.mas_centerX).offset(10);
  106. make.bottom.mas_equalTo(-(safeArea));
  107. make.height.mas_equalTo(48);
  108. }];
  109. }
  110. - (void)initNavHeadUIFun
  111. {
  112. _rightEditButton = [[UIButton alloc] init];
  113. [_rightEditButton setTitle:NSLocalizedString(@"edit_common",nil) forState:UIControlStateNormal];
  114. _rightEditButton.tag = 2;
  115. [_rightEditButton setTitleColor:[UIColor hwColor:@"#01B7EA" alpha:1.0] forState:UIControlStateNormal];
  116. _rightEditButton.titleLabel.font = [UIFont systemFontOfSize:16.0];
  117. _rightEditButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
  118. [_rightEditButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
  119. [self.navBarBGView addSubview:_rightEditButton];
  120. [_rightEditButton mas_makeConstraints:^(MASConstraintMaker *make) {
  121. make.width.mas_equalTo(80);
  122. make.height.mas_equalTo(40);
  123. make.right.mas_equalTo(-15);
  124. make.centerY.mas_equalTo(self.titleLabel.mas_centerY);
  125. }];
  126. _leftCancleButton = [[UIButton alloc] init];
  127. [_leftCancleButton setTitleColor:[UIColor hwColor:@"#01B7EA" alpha:1.0] forState:UIControlStateNormal];
  128. _leftCancleButton.titleLabel.font = [UIFont systemFontOfSize:18.0];
  129. _leftCancleButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
  130. [_leftCancleButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
  131. _leftCancleButton.tag = 3;
  132. [_leftCancleButton setTitle:NSLocalizedString(@"other_cancel",nil) forState:UIControlStateNormal];
  133. [self.navBarBGView addSubview:_leftCancleButton];
  134. _leftCancleButton.hidden = YES;
  135. [_leftCancleButton mas_makeConstraints:^(MASConstraintMaker *make) {
  136. make.width.mas_equalTo(80);
  137. make.left.mas_equalTo(15);
  138. make.height.mas_equalTo(30);
  139. make.centerY.mas_equalTo(self.titleLabel.mas_centerY);
  140. }];
  141. _rightSelectAllButton = [[UIButton alloc] init];
  142. [_rightSelectAllButton setImage:[UIImage imageNamed:@"edit_select_all_h"] forState:UIControlStateSelected];
  143. [_rightSelectAllButton setImage:[UIImage imageNamed:@"edit_select_all_n"] forState:UIControlStateNormal];
  144. [_rightSelectAllButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
  145. _rightSelectAllButton.tag = 4;
  146. [self.navBarBGView addSubview:_rightSelectAllButton];
  147. _rightSelectAllButton.hidden = YES;
  148. [_rightSelectAllButton mas_makeConstraints:^(MASConstraintMaker *make) {
  149. make.width.mas_equalTo(80);
  150. make.right.mas_equalTo(0);
  151. make.height.mas_equalTo(30);
  152. make.centerY.mas_equalTo(self.titleLabel.mas_centerY);
  153. }];
  154. }
  155. #pragma mark - 懒加载
  156. - (UITableView *)tableView{
  157. if (!_tableView) {
  158. _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, SCREEN_H - TABBARHEIGHT) style:UITableViewStylePlain];
  159. _tableView.delegate = self;
  160. _tableView.dataSource = self;
  161. _tableView.showsVerticalScrollIndicator = NO;
  162. _tableView.showsHorizontalScrollIndicator = NO;
  163. // _tableView.contentInset = UIEdgeInsetsMake(-H_STATE_BAR, 0, 0, 0);
  164. [_tableView setSeparatorStyle:(UITableViewCellSeparatorStyleNone)];
  165. [_tableView setSeparatorColor:[UIColor clearColor]];
  166. [_tableView setBackgroundColor:[UIColor clearColor]];
  167. [_tableView setTableFooterView:[UIView new]];
  168. [_tableView setBounces:YES];
  169. if (@available(iOS 15.0, *)) {
  170. _tableView.sectionHeaderTopPadding = 0;
  171. }
  172. //空数据引入第三方开源处理
  173. _tableView.emptyDataSetSource = self;
  174. _tableView.emptyDataSetDelegate = self;
  175. }
  176. return _tableView;
  177. }
  178. #pragma mark - 列表委托
  179. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
  180. return 1;
  181. }
  182. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  183. if (_ShareRecordMod && _ShareRecordMod.data.count>0) {
  184. return _ShareRecordMod.data.count;
  185. }
  186. return 0;
  187. }
  188. - (shareRecordTableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  189. __block NSInteger row = indexPath.row;
  190. static NSString *identifier = @"shareRecordTableViewCell";
  191. shareRecordTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];
  192. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  193. if (!cell){
  194. cell = [[shareRecordTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
  195. [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
  196. [cell setBackgroundColor:[UIColor clearColor]];
  197. [cell setAccessoryType:(UITableViewCellAccessoryNone)];
  198. }
  199. cell.isEditType = isEditType;
  200. if(row < _ShareRecordMod.data.count){
  201. ShareRecordListModel* model = _ShareRecordMod.data[row];
  202. cell.dataModel = model;
  203. KWeakSelf
  204. cell.didClickSwitch = ^(BOOL SwitchOn) {
  205. [weakSelf handleSelectOrNotDataBy:row withSelect:SwitchOn];
  206. };
  207. }
  208. return cell;
  209. }
  210. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  211. return 70;
  212. }
  213. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  214. NSInteger row = indexPath.row;
  215. if(isEditType){
  216. return;
  217. }
  218. shareRecordDetailsHWViewController *vc = [shareRecordDetailsHWViewController new];
  219. [self.navigationController pushViewController:vc animated:YES];
  220. if(row < _ShareRecordMod.data.count){
  221. ShareRecordListModel* model = _ShareRecordMod.data[row];
  222. vc.dataModel = model;
  223. }
  224. KWeakSelf
  225. vc.didCancelShareLinkFun = ^{
  226. [weakSelf getShareFileListFun];
  227. };
  228. }
  229. #pragma mark 空数据
  230. - (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView {
  231. NSString *imageName = @"common_no_data_pic";
  232. return [UIImage imageNamed:imageName];
  233. }
  234. - (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView {
  235. NSString *text = NSLocalizedString(@"common_no_data_tip",nil);
  236. NSDictionary *attributes = @{NSFontAttributeName: [UIFont systemFontOfSize:16.0f],
  237. NSForegroundColorAttributeName: HW999999Color};
  238. return [[NSAttributedString alloc] initWithString:text attributes:attributes];
  239. }
  240. //调整图片位置
  241. - (CGFloat)verticalOffsetForEmptyDataSet:(UIScrollView *)scrollView {
  242. return -150;
  243. }
  244. - (void)didClickButtonFun:(UIButton*)but
  245. {
  246. NSInteger tag = but.tag;
  247. if(tag == 1){
  248. [[iToast makeText:@"分享规则"] show];
  249. }
  250. else if(tag == 2){
  251. [self setEditTypeFun];
  252. }
  253. else if(tag == 3){
  254. [self cancelEditTypeFun];
  255. }
  256. else if(tag == 4){
  257. but.selected = !but.selected;
  258. [self selectAllOrNotBy:but.selected];
  259. }
  260. else if(tag == 10){//删除分享
  261. [self showDeleteAlearViewFun];
  262. }
  263. else if(tag == 11){//取消分享
  264. [self cancelShareLinkFun];
  265. }
  266. }
  267. #pragma mark 进入编辑
  268. - (void)setEditTypeFun
  269. {
  270. isEditType = YES;
  271. _rightEditButton.hidden = YES;
  272. _ruleBottomButton.hidden = YES;
  273. self.backBtn.hidden = YES;
  274. _leftCancleButton.hidden = NO;
  275. _rightSelectAllButton.hidden = NO;
  276. _delRuleButton.hidden = NO;
  277. _delRuleButton.userInteractionEnabled = NO;
  278. _delRuleButton.alpha = 0.5;
  279. _cancelShareButton.hidden = NO;
  280. _cancelShareButton.userInteractionEnabled = NO;
  281. _cancelShareButton.alpha = 0.5;
  282. [self.tableView reloadData];
  283. }
  284. #pragma mark 取消编辑
  285. - (void)cancelEditTypeFun
  286. {
  287. isEditType = NO;
  288. _rightEditButton.hidden = NO;
  289. _ruleBottomButton.hidden = NO;
  290. self.backBtn.hidden = NO;
  291. _leftCancleButton.hidden = YES;
  292. _rightSelectAllButton.hidden = YES;
  293. _delRuleButton.hidden = YES;
  294. _cancelShareButton.hidden = YES;
  295. [self.tableView reloadData];
  296. }
  297. #pragma mark 设置按钮状态
  298. - (void)setBottomStateFun
  299. {
  300. CGFloat alpha = 0.5;
  301. BOOL canClickBut = NO;
  302. if(_didSelectArr.count >0){
  303. alpha =1.0;
  304. canClickBut = YES;
  305. }
  306. _delRuleButton.userInteractionEnabled = canClickBut;
  307. _delRuleButton.alpha = alpha;
  308. _cancelShareButton.userInteractionEnabled = canClickBut;
  309. _cancelShareButton.alpha = alpha;
  310. }
  311. #pragma mark 单个选中或者取消
  312. - (void)handleSelectOrNotDataBy:(NSInteger)row withSelect:(BOOL)select
  313. {
  314. if(row < _ShareRecordMod.data.count){
  315. ShareRecordListModel* model = _ShareRecordMod.data[row];
  316. model.isSelectType = !model.isSelectType;
  317. if(select){
  318. [_didSelectArr addObject:model];
  319. }
  320. else{
  321. [_didSelectArr removeObject:model];
  322. }
  323. [self setBottomStateFun];
  324. }
  325. }
  326. #pragma mark 全部选中或者取消全选
  327. - (void)selectAllOrNotBy:(BOOL)isSelectAll
  328. {
  329. [_didSelectArr removeAllObjects];
  330. for (ShareRecordListModel* model in _ShareRecordMod.data) {
  331. if(isSelectAll){
  332. model.isSelectType = YES;
  333. [_didSelectArr addObject:model];
  334. }
  335. else{
  336. model.isSelectType = NO;
  337. }
  338. }
  339. [self setBottomStateFun];
  340. [self.tableView reloadData];
  341. }
  342. #pragma mark 分享记录列表
  343. - (void)getShareFileListFun
  344. {
  345. NSMutableDictionary*paraDict = [NSMutableDictionary new];
  346. NSString *SNStr = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
  347. if(SNStr){
  348. [paraDict setValue:SNStr forKey:@"sn"];
  349. }
  350. else{
  351. return;;
  352. }
  353. [self showNewIndicatorWithCanBack:YES canTouch:NO];
  354. KWeakSelf
  355. [[netWorkManager shareInstance] CommonPostCallBackCode:queryShareRecordFun Parameters:paraDict success:^(id _Nonnull responseObject) {
  356. [weakSelf removeNewIndicator];
  357. weakSelf.ShareRecordMod = [[ShareRecordModel alloc] initWithDictionary:responseObject error:nil];
  358. if(weakSelf.ShareRecordMod && weakSelf.ShareRecordMod.status == 0){
  359. [weakSelf.tableView reloadData];
  360. }
  361. else{
  362. }
  363. } failure:^(NSError * _Nonnull error) {
  364. [weakSelf removeNewIndicator];
  365. }];
  366. }
  367. #pragma mark 取消分享
  368. - (void)showCancelAlearViewFun
  369. {
  370. NSString *tipStr = NSLocalizedString(@"cancel_share_Tip_msg",nil);
  371. KWeakSelf
  372. ComontAlretViewController *curAlretVC= [[ComontAlretViewController alloc] initWithTiTle:nil
  373. msg:tipStr
  374. imageStr:nil
  375. cancelTitle:NSLocalizedString(@"other_cancel",nil)
  376. okTitle:NSLocalizedString(@"other_confirm",nil) isOkBtnHighlight:YES
  377. didClickOk:^{
  378. [weakSelf cancelShareLinkFun];
  379. } didClickCancel:^{
  380. }];
  381. curAlretVC.modalPresentationStyle = UIModalPresentationCustom;
  382. [self presentViewController:curAlretVC animated:YES completion:^{
  383. curAlretVC.view.superview.backgroundColor = [UIColor clearColor];
  384. }];
  385. }
  386. #pragma mark 取消分享
  387. - (void)cancelShareLinkFun
  388. {
  389. NSMutableDictionary *paraDict = [NSMutableDictionary new];
  390. if(_didSelectArr){
  391. NSMutableArray *LinkIdArr = [NSMutableArray new];
  392. for (ShareRecordListModel* model in _didSelectArr) {
  393. if(!model.expirationStatus){
  394. [LinkIdArr addObject:model.addShareId];
  395. }
  396. }
  397. if(LinkIdArr.count == 0){
  398. [[iToast makeText:NSLocalizedString(@"cancel_share_suc_msg",nil)] show];
  399. return;
  400. }
  401. [paraDict setValue:LinkIdArr forKey:@"idList"];
  402. }
  403. [paraDict setValue:@1 forKey:@"expirationStatus"];
  404. KWeakSelf
  405. [self showNewIndicatorWithCanBack:NO canTouch:NO];
  406. [[netWorkManager shareInstance] CommonPostCallBackCode:updateShareInfoFun Parameters:paraDict success:^(id _Nonnull responseObject) {
  407. [weakSelf removeNewIndicator];
  408. SuperModel *model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
  409. if(model && model.code == 0){
  410. [[iToast makeText:NSLocalizedString(@"cancel_share_suc_msg",nil)] show];
  411. [weakSelf getShareFileListFun];
  412. }
  413. else{
  414. [[iToast makeText:NSLocalizedString(@"cancel_share_fail_msg",nil)] show];
  415. }
  416. } failure:^(NSError * _Nonnull error) {
  417. [weakSelf removeNewIndicator];
  418. [[iToast makeText:NSLocalizedString(@"cancel_share_fail_msg",nil)] show];
  419. }];
  420. }
  421. #pragma mark 删除分享
  422. - (void)showDeleteAlearViewFun
  423. {
  424. NSString *titleStr = NSLocalizedString(@"delete_share_title_msg",nil);
  425. NSString *tipStr = NSLocalizedString(@"delete_share_Tip_msg",nil);
  426. KWeakSelf
  427. ComontAlretViewController *curAlretVC= [[ComontAlretViewController alloc] initWithTiTle:titleStr
  428. msg:tipStr
  429. imageStr:nil
  430. cancelTitle:NSLocalizedString(@"other_cancel",nil)
  431. okTitle:NSLocalizedString(@"other_confirm",nil) isOkBtnHighlight:YES
  432. didClickOk:^{
  433. [weakSelf deleteShareLinkArrFun];
  434. } didClickCancel:^{
  435. }];
  436. curAlretVC.modalPresentationStyle = UIModalPresentationCustom;
  437. [self presentViewController:curAlretVC animated:YES completion:^{
  438. curAlretVC.view.superview.backgroundColor = [UIColor clearColor];
  439. }];
  440. }
  441. #pragma mark 删除分享
  442. - (void)deleteShareLinkArrFun
  443. {
  444. NSMutableDictionary *paraDict = [NSMutableDictionary new];
  445. if(_didSelectArr){
  446. NSMutableArray *LinkIdArr = [NSMutableArray new];
  447. for (ShareRecordListModel* model in _didSelectArr) {
  448. [LinkIdArr addObject:model.addShareId];
  449. }
  450. if(LinkIdArr.count == 0){
  451. [[iToast makeText:NSLocalizedString(@"delete_share_fail_msg",nil)] show];
  452. return;
  453. }
  454. [paraDict setValue:LinkIdArr forKey:@"idList"];
  455. }
  456. KWeakSelf
  457. [self showNewIndicatorWithCanBack:NO canTouch:NO];
  458. [[netWorkManager shareInstance] CommonPostCallBackCode:deleteShareListFun Parameters:paraDict success:^(id _Nonnull responseObject) {
  459. [weakSelf removeNewIndicator];
  460. SuperModel *model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
  461. if(model && model.code == 0){
  462. [[iToast makeText:NSLocalizedString(@"delete_share_suc_msg",nil)] show];
  463. [weakSelf getShareFileListFun];
  464. }
  465. else{
  466. [[iToast makeText:NSLocalizedString(@"delete_share_fail_msg",nil)] show];
  467. }
  468. } failure:^(NSError * _Nonnull error) {
  469. [weakSelf removeNewIndicator];
  470. [[iToast makeText:NSLocalizedString(@"delete_share_fail_msg",nil)] show];
  471. }];
  472. }
  473. @end