shareRecordViewController.m 22 KB

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