shareRecordViewController.m 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  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 showCancelAlearViewFun];
  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. //数据还原
  289. [_didSelectArr removeAllObjects];
  290. for (ShareRecordListModel* model in _ShareRecordMod.data) {
  291. model.isSelectType = NO;
  292. }
  293. isEditType = NO;
  294. _rightEditButton.hidden = NO;
  295. _ruleBottomButton.hidden = NO;
  296. self.backBtn.hidden = NO;
  297. _leftCancleButton.hidden = YES;
  298. _rightSelectAllButton.hidden = YES;
  299. _delRuleButton.hidden = YES;
  300. _cancelShareButton.hidden = YES;
  301. [self.tableView reloadData];
  302. }
  303. #pragma mark 设置按钮状态
  304. - (void)setBottomStateFun
  305. {
  306. CGFloat alpha = 0.5;
  307. BOOL canClickBut = NO;
  308. if(_didSelectArr.count >0){
  309. alpha =1.0;
  310. canClickBut = YES;
  311. }
  312. _delRuleButton.userInteractionEnabled = canClickBut;
  313. _delRuleButton.alpha = alpha;
  314. _cancelShareButton.userInteractionEnabled = canClickBut;
  315. _cancelShareButton.alpha = alpha;
  316. }
  317. #pragma mark 单个选中或者取消
  318. - (void)handleSelectOrNotDataBy:(NSInteger)row withSelect:(BOOL)select
  319. {
  320. if(row < _ShareRecordMod.data.count){
  321. ShareRecordListModel* model = _ShareRecordMod.data[row];
  322. model.isSelectType = !model.isSelectType;
  323. if(select){
  324. [_didSelectArr addObject:model];
  325. }
  326. else{
  327. [_didSelectArr removeObject:model];
  328. }
  329. [self setBottomStateFun];
  330. }
  331. }
  332. #pragma mark 全部选中或者取消全选
  333. - (void)selectAllOrNotBy:(BOOL)isSelectAll
  334. {
  335. [_didSelectArr removeAllObjects];
  336. for (ShareRecordListModel* model in _ShareRecordMod.data) {
  337. if(isSelectAll){
  338. model.isSelectType = YES;
  339. [_didSelectArr addObject:model];
  340. }
  341. else{
  342. model.isSelectType = NO;
  343. }
  344. }
  345. [self setBottomStateFun];
  346. [self.tableView reloadData];
  347. }
  348. #pragma mark 分享记录列表
  349. - (void)getShareFileListFun
  350. {
  351. NSMutableDictionary*paraDict = [NSMutableDictionary new];
  352. NSString *SNStr = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
  353. if(SNStr){
  354. [paraDict setValue:SNStr forKey:@"sn"];
  355. }
  356. else{
  357. return;;
  358. }
  359. [self showNewIndicatorWithCanBack:YES canTouch:NO];
  360. KWeakSelf
  361. [[netWorkManager shareInstance] CommonPostCallBackCode:queryShareRecordFun Parameters:paraDict success:^(id _Nonnull responseObject) {
  362. [weakSelf removeNewIndicator];
  363. weakSelf.ShareRecordMod = [[ShareRecordModel alloc] initWithDictionary:responseObject error:nil];
  364. if(weakSelf.ShareRecordMod && weakSelf.ShareRecordMod.status == 0){
  365. [weakSelf.tableView reloadData];
  366. }
  367. else{
  368. }
  369. } failure:^(NSError * _Nonnull error) {
  370. [weakSelf removeNewIndicator];
  371. }];
  372. }
  373. #pragma mark 取消分享
  374. - (void)showCancelAlearViewFun
  375. {
  376. NSString *tipStr = NSLocalizedString(@"cancel_share_Tip_msg",nil);
  377. KWeakSelf
  378. ComontAlretViewController *curAlretVC= [[ComontAlretViewController alloc] initWithTiTle:nil
  379. msg:tipStr
  380. imageStr:nil
  381. cancelTitle:NSLocalizedString(@"other_cancel",nil)
  382. okTitle:NSLocalizedString(@"other_confirm",nil) isOkBtnHighlight:YES
  383. didClickOk:^{
  384. [weakSelf cancelShareLinkFun];
  385. } didClickCancel:^{
  386. }];
  387. curAlretVC.modalPresentationStyle = UIModalPresentationCustom;
  388. [self presentViewController:curAlretVC animated:YES completion:^{
  389. curAlretVC.view.superview.backgroundColor = [UIColor clearColor];
  390. }];
  391. }
  392. #pragma mark 取消分享
  393. - (void)cancelShareLinkFun
  394. {
  395. NSMutableDictionary *paraDict = [NSMutableDictionary new];
  396. if(_didSelectArr){
  397. NSMutableArray *LinkIdArr = [NSMutableArray new];
  398. for (ShareRecordListModel* model in _didSelectArr) {
  399. if(!model.expirationStatus){
  400. [LinkIdArr addObject:model.addShareId];
  401. }
  402. }
  403. if(LinkIdArr.count == 0){
  404. [[iToast makeText:NSLocalizedString(@"cancel_share_suc_msg",nil)] show];
  405. return;
  406. }
  407. [paraDict setValue:LinkIdArr forKey:@"idList"];
  408. }
  409. [paraDict setValue:@1 forKey:@"expirationStatus"];
  410. KWeakSelf
  411. [self showNewIndicatorWithCanBack:NO canTouch:NO];
  412. [[netWorkManager shareInstance] CommonPostCallBackCode:updateShareInfoFun Parameters:paraDict success:^(id _Nonnull responseObject) {
  413. [weakSelf removeNewIndicator];
  414. SuperModel *model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
  415. if(model && model.code == 0){
  416. [[iToast makeText:NSLocalizedString(@"cancel_share_suc_msg",nil)] show];
  417. [weakSelf getShareFileListFun];
  418. }
  419. else{
  420. [[iToast makeText:NSLocalizedString(@"cancel_share_fail_msg",nil)] show];
  421. }
  422. } failure:^(NSError * _Nonnull error) {
  423. [weakSelf removeNewIndicator];
  424. [[iToast makeText:NSLocalizedString(@"cancel_share_fail_msg",nil)] show];
  425. }];
  426. }
  427. #pragma mark 删除分享
  428. - (void)showDeleteAlearViewFun
  429. {
  430. NSString *titleStr = NSLocalizedString(@"delete_share_title_msg",nil);
  431. NSString *tipStr = NSLocalizedString(@"delete_share_Tip_msg",nil);
  432. KWeakSelf
  433. ComontAlretViewController *curAlretVC= [[ComontAlretViewController alloc] initWithTiTle:titleStr
  434. msg:tipStr
  435. imageStr:nil
  436. cancelTitle:NSLocalizedString(@"other_cancel",nil)
  437. okTitle:NSLocalizedString(@"other_confirm",nil) isOkBtnHighlight:YES
  438. didClickOk:^{
  439. [weakSelf deleteShareLinkArrFun];
  440. } didClickCancel:^{
  441. }];
  442. curAlretVC.modalPresentationStyle = UIModalPresentationCustom;
  443. [self presentViewController:curAlretVC animated:YES completion:^{
  444. curAlretVC.view.superview.backgroundColor = [UIColor clearColor];
  445. }];
  446. }
  447. #pragma mark 删除分享
  448. - (void)deleteShareLinkArrFun
  449. {
  450. NSMutableDictionary *paraDict = [NSMutableDictionary new];
  451. if(_didSelectArr){
  452. NSMutableArray *LinkIdArr = [NSMutableArray new];
  453. for (ShareRecordListModel* model in _didSelectArr) {
  454. [LinkIdArr addObject:model.addShareId];
  455. }
  456. if(LinkIdArr.count == 0){
  457. [[iToast makeText:NSLocalizedString(@"delete_share_fail_msg",nil)] show];
  458. return;
  459. }
  460. [paraDict setValue:LinkIdArr forKey:@"idList"];
  461. }
  462. KWeakSelf
  463. [self showNewIndicatorWithCanBack:NO canTouch:NO];
  464. [[netWorkManager shareInstance] CommonPostCallBackCode:deleteShareListFun Parameters:paraDict success:^(id _Nonnull responseObject) {
  465. [weakSelf removeNewIndicator];
  466. SuperModel *model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
  467. if(model && model.code == 0){
  468. [[iToast makeText:NSLocalizedString(@"delete_share_suc_msg",nil)] show];
  469. [weakSelf getShareFileListFun];
  470. }
  471. else{
  472. [[iToast makeText:NSLocalizedString(@"delete_share_fail_msg",nil)] show];
  473. }
  474. } failure:^(NSError * _Nonnull error) {
  475. [weakSelf removeNewIndicator];
  476. [[iToast makeText:NSLocalizedString(@"delete_share_fail_msg",nil)] show];
  477. }];
  478. }
  479. #pragma mark 分享规则
  480. - (void)ruleBtnClick {
  481. //https://cliys.armclouding.com/h5/protocol/protocol.html?agreementCoding=YSZYHXY2002&type=1
  482. // [self gotoProtocolWKWebVCByPush:YES];
  483. CustomerWebViewController *vc = [[CustomerWebViewController alloc] init];
  484. vc.titleStr = NSLocalizedString(@"share_rule_title",nil);
  485. NSString *url = @"http://testprivacy.phone.armclouding.com:1801/h5/rule.html";
  486. if([CloudService rangeOfString:@"hiboxde.armclouding.com"].location != NSNotFound){
  487. url = @"";
  488. }
  489. vc.webUrl = url;
  490. [self.navigationController pushViewController:vc animated:YES];
  491. }
  492. @end