shareRecordViewController.m 21 KB

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