shareRecordDetailsHWViewController.m 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. //
  2. // shareRecordDetailsHWViewController.m
  3. // 双子星云手机
  4. //
  5. // Created by xd h on 2024/5/15.
  6. //
  7. #import "shareRecordDetailsHWViewController.h"
  8. @interface shareRecordDetailsHWViewController ()
  9. @property (nonatomic,strong)UIScrollView *BgScrollView;
  10. @property (nonatomic,strong)UIView *whiteBgView;
  11. @property (nonatomic,strong)UILabel *shareTitleLabel;
  12. @property (nonatomic,strong)UILabel *shareBeginDateLabel;
  13. @property (nonatomic,strong)UIImageView *shareQRCodeImageView;
  14. @property (nonatomic,strong)UIButton*checkShareLinkButton;
  15. @property (nonatomic,strong)UIImageView*lineImageView;//分割线
  16. @property (nonatomic,strong)UILabel *shareEndDateLabel;//失效日期
  17. @property (nonatomic,strong)UILabel *remainingNumberLabel;//剩余次数
  18. @property (nonatomic,strong)UILabel *extractCodeTipLab;//提取码
  19. @property (nonatomic,strong)UILabel *extractCodeTip2Lab;//提取码
  20. @property (nonatomic,strong)UILabel *reportTipLabel;//被投诉封禁
  21. @property (nonatomic,strong)UILabel *reportLabel;//被投诉封禁
  22. @property (nonatomic,strong)UIButton*cancelShareLinkButton;
  23. @property (nonatomic,strong)UIButton*shareLinkCopyButton;
  24. @end
  25. @implementation shareRecordDetailsHWViewController
  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.titleLabel.text = NSLocalizedString(@"share_record_title",nil);
  35. [self drawAnyView];
  36. }
  37. - (void)drawAnyView{
  38. _BgScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, NAVIHEIGHT + AdaptNaviHeight, SCREEN_W, SCREEN_H - NAVIHEIGHT- AdaptNaviHeight)];
  39. //_BgScrollView.backgroundColor = [UIColor greenColor];
  40. //_BgScrollView.contentSize = CGSizeMake(SCREEN_W, 0);
  41. [self.view addSubview:_BgScrollView];
  42. // [_BgScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
  43. // make.left.mas_equalTo(0);
  44. // make.right.mas_equalTo(0);
  45. // make.top.equalTo(self.navBarBGView.mas_bottom).offset(0.f);
  46. // make.bottom.mas_equalTo(0);
  47. // }];
  48. //
  49. _whiteBgView = [[UIView alloc] init];
  50. _whiteBgView.backgroundColor = [UIColor whiteColor];
  51. [_BgScrollView addSubview:_whiteBgView];
  52. _whiteBgView.layer.cornerRadius = 8;
  53. _whiteBgView.layer.masksToBounds = YES;
  54. [_whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
  55. make.left.mas_equalTo(15);
  56. //make.right.mas_equalTo(-15);
  57. make.width.mas_equalTo(SCREEN_W - 30);
  58. //make.top.equalTo(self.navBarBGView.mas_bottom).offset(40.f);
  59. make.top.mas_equalTo(40);
  60. make.height.mas_equalTo(558);
  61. }];
  62. //文件夹图标
  63. UIImageView *folderImageView = [[UIImageView alloc] init];
  64. folderImageView.image = [UIImage imageNamed:@"uploadFile_file_icon"];
  65. folderImageView.backgroundColor = [UIColor whiteColor];
  66. [_BgScrollView addSubview:folderImageView];
  67. folderImageView.layer.cornerRadius = 44;
  68. folderImageView.layer.masksToBounds = YES;
  69. [folderImageView mas_makeConstraints:^(MASConstraintMaker *make) {
  70. //make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
  71. make.top.mas_equalTo(10.f);
  72. make.centerX.mas_equalTo(_BgScrollView.mas_centerX);
  73. make.width.mas_equalTo(88);
  74. make.height.mas_equalTo(88);
  75. }];
  76. _shareTitleLabel = [[UILabel alloc] init];
  77. //_shareTitleLabel.text = @"banner.png等多个文件";
  78. _shareTitleLabel.textAlignment = NSTextAlignmentCenter;
  79. _shareTitleLabel.textColor = HW0A132BColor;
  80. _shareTitleLabel.font = [UIFont systemFontOfSize:14.0];
  81. [_whiteBgView addSubview:_shareTitleLabel];
  82. [_shareTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  83. make.top.equalTo(folderImageView.mas_bottom).offset(5.f);
  84. make.left.mas_equalTo(15);
  85. make.right.mas_equalTo(-15);
  86. make.height.mas_equalTo(20);
  87. }];
  88. _shareBeginDateLabel = [[UILabel alloc] init];
  89. //_shareBeginDateLabel.text = @"2024/04/25 19:45";
  90. _shareBeginDateLabel.textAlignment = NSTextAlignmentCenter;
  91. _shareBeginDateLabel.textColor = HW666666Color;
  92. _shareBeginDateLabel.font = [UIFont systemFontOfSize:12.0];
  93. [_whiteBgView addSubview:_shareBeginDateLabel];
  94. [_shareBeginDateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  95. make.top.equalTo(_shareTitleLabel.mas_bottom).offset(25.f);
  96. make.left.mas_equalTo(15);
  97. make.right.mas_equalTo(-15);
  98. make.height.mas_equalTo(15);
  99. }];
  100. UIImageView *QRCodeEdgingImageView = [[UIImageView alloc] init];
  101. QRCodeEdgingImageView.image = [UIImage imageNamed:@"share_QRCode_edging"];
  102. [_whiteBgView addSubview:QRCodeEdgingImageView];
  103. [QRCodeEdgingImageView mas_makeConstraints:^(MASConstraintMaker *make) {
  104. make.top.equalTo(_shareBeginDateLabel.mas_bottom).offset(10.f);
  105. //make.centerX.mas_equalTo(self.view.mas_centerX);
  106. make.centerX.mas_equalTo(_whiteBgView.mas_centerX);
  107. make.width.mas_equalTo(208);
  108. make.height.mas_equalTo(208);
  109. }];
  110. _shareQRCodeImageView = [[UIImageView alloc] init];
  111. //_shareQRCodeImageView.backgroundColor = [UIColor lightGrayColor];
  112. [QRCodeEdgingImageView addSubview:_shareQRCodeImageView];
  113. [_shareQRCodeImageView mas_makeConstraints:^(MASConstraintMaker *make) {
  114. make.top.mas_equalTo(20);
  115. make.bottom.mas_equalTo(-20);
  116. make.left.mas_equalTo(20);
  117. make.right.mas_equalTo(-20);
  118. }];
  119. //_shareQRCodeImageView.image = [self generateQRCodeWithInputMessage:@"http://baidu.com" Width:168 Height:168];
  120. _checkShareLinkButton = [[UIButton alloc] init];
  121. [_checkShareLinkButton setTitle:NSLocalizedString(@"check_share_link_title",nil) forState:UIControlStateNormal];
  122. [_checkShareLinkButton setTitleColor:[UIColor hwColor:@"#01B7EA"] forState:UIControlStateNormal];
  123. _checkShareLinkButton.titleLabel.font = [UIFont systemFontOfSize:14.0];
  124. [_checkShareLinkButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
  125. _checkShareLinkButton.tag = 1;
  126. [_whiteBgView addSubview:_checkShareLinkButton];
  127. [_checkShareLinkButton mas_makeConstraints:^(MASConstraintMaker *make) {
  128. make.left.mas_equalTo(15);
  129. make.right.mas_equalTo(-15);
  130. make.top.equalTo(QRCodeEdgingImageView.mas_bottom).offset(0.f);
  131. make.height.mas_equalTo(30);
  132. }];
  133. //分割线 347 /32
  134. CGFloat lineW = SCREEN_W - 30;
  135. CGFloat lineH = (lineW*32.0)/347.0;
  136. _lineImageView = [[UIImageView alloc] init];
  137. //_lineImageView.backgroundColor = [UIColor lightGrayColor];
  138. _lineImageView.image = [UIImage imageNamed:@"nas_share_Divider_img"];
  139. [_whiteBgView addSubview:_lineImageView];
  140. [_lineImageView mas_makeConstraints:^(MASConstraintMaker *make) {
  141. make.top.equalTo(_checkShareLinkButton.mas_bottom).offset(8);
  142. make.height.mas_equalTo(lineH);
  143. make.left.mas_equalTo(0);
  144. make.right.mas_equalTo(0);
  145. }];
  146. //失效时间
  147. UILabel *shareEndDateTipLab = [[UILabel alloc] init];
  148. shareEndDateTipLab.font = [UIFont systemFontOfSize:14.f];
  149. [shareEndDateTipLab setTextColor:[UIColor hwColor:@"#999999"]];
  150. shareEndDateTipLab.text = NSLocalizedString(@"copy_share_link_Invalid_tip3",nil);
  151. [_whiteBgView addSubview:shareEndDateTipLab];
  152. [shareEndDateTipLab mas_makeConstraints:^(MASConstraintMaker *make) {
  153. make.left.mas_equalTo(32);
  154. make.width.mas_equalTo(80);
  155. make.top.equalTo(_lineImageView.mas_bottom).offset(8);
  156. make.height.mas_equalTo(20);
  157. }];
  158. _shareEndDateLabel = [[UILabel alloc] init];
  159. //_shareEndDateLabel.text = @"2024/04/25 19:45";
  160. //_shareEndDateLabel.textAlignment = NSTextAlignmentCenter;
  161. _shareEndDateLabel.textColor = HW0A132BColor;
  162. _shareEndDateLabel.font = [UIFont boldSystemFontOfSize:14.0];
  163. [_whiteBgView addSubview:_shareEndDateLabel];
  164. //_shareEndDateLabel.backgroundColor = [UIColor greenColor];
  165. [_shareEndDateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  166. make.left.mas_equalTo(shareEndDateTipLab.mas_right);
  167. make.right.mas_equalTo(0);
  168. make.top.mas_equalTo(shareEndDateTipLab.mas_top);
  169. make.height.mas_equalTo(20);
  170. }];
  171. //剩余次数
  172. UILabel *remainingNumberTipLabel = [[UILabel alloc] init];
  173. remainingNumberTipLabel.font = [UIFont systemFontOfSize:14.f];
  174. [remainingNumberTipLabel setTextColor:[UIColor hwColor:@"#999999"]];
  175. remainingNumberTipLabel.text = NSLocalizedString(@"share_number_remainingNumber_tip",nil);
  176. [_whiteBgView addSubview:remainingNumberTipLabel];
  177. [remainingNumberTipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  178. make.left.mas_equalTo(32);
  179. make.width.mas_equalTo(80);
  180. make.top.equalTo(shareEndDateTipLab.mas_bottom).offset(10);
  181. make.height.mas_equalTo(20);
  182. }];
  183. _remainingNumberLabel = [[UILabel alloc] init];
  184. _remainingNumberLabel.font = [UIFont boldSystemFontOfSize:14.f];
  185. _remainingNumberLabel.text = @"80";
  186. [_remainingNumberLabel setTextColor:HW0A132BColor];
  187. [_whiteBgView addSubview:_remainingNumberLabel];
  188. [_remainingNumberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  189. make.left.mas_equalTo(remainingNumberTipLabel.mas_right);
  190. make.right.mas_equalTo(-20);
  191. make.top.equalTo(remainingNumberTipLabel.mas_top);
  192. make.height.mas_equalTo(20);
  193. }];
  194. //提取码
  195. _extractCodeTipLab = [[UILabel alloc] init];
  196. _extractCodeTipLab.font = [UIFont systemFontOfSize:14.f];
  197. [_extractCodeTipLab setTextColor:[UIColor hwColor:@"#999999"]];
  198. _extractCodeTipLab.text = NSLocalizedString(@"share_Extract_code_tip",nil);
  199. [_whiteBgView addSubview:_extractCodeTipLab];
  200. [_extractCodeTipLab mas_makeConstraints:^(MASConstraintMaker *make) {
  201. make.left.mas_equalTo(32);
  202. make.width.mas_equalTo(80);
  203. make.top.equalTo(remainingNumberTipLabel.mas_bottom).offset(10);
  204. make.height.mas_equalTo(20);
  205. }];
  206. _extractCodeTip2Lab = [[UILabel alloc] init];
  207. _extractCodeTip2Lab.font = [UIFont boldSystemFontOfSize:14.f];
  208. [_extractCodeTip2Lab setTextColor:HW0A132BColor];
  209. [_whiteBgView addSubview:_extractCodeTip2Lab];
  210. [_extractCodeTip2Lab mas_makeConstraints:^(MASConstraintMaker *make) {
  211. make.left.mas_equalTo(_extractCodeTipLab.mas_right);
  212. make.right.mas_equalTo(-20);
  213. make.top.equalTo(_extractCodeTipLab.mas_top);
  214. make.height.mas_equalTo(20);
  215. }];
  216. //封禁原因
  217. _reportTipLabel = [[UILabel alloc] init];
  218. _reportTipLabel.font = [UIFont systemFontOfSize:14.f];
  219. [_reportTipLabel setTextColor:[UIColor hwColor:@"#999999"]];
  220. _reportTipLabel.text = NSLocalizedString(@"share_report_tip1",nil);
  221. [_whiteBgView addSubview:_reportTipLabel];
  222. [_reportTipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  223. make.left.mas_equalTo(32);
  224. make.width.mas_equalTo(80);
  225. make.top.equalTo(_extractCodeTipLab.mas_bottom).offset(10);
  226. make.height.mas_equalTo(20);
  227. }];
  228. _reportLabel = [[UILabel alloc] init];
  229. _reportLabel.font = [UIFont boldSystemFontOfSize:14.f];
  230. _reportLabel.text = NSLocalizedString(@"share_report_tip2",nil);
  231. [_reportLabel setTextColor:HW0A132BColor];
  232. [_whiteBgView addSubview:_reportLabel];
  233. [_reportLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  234. make.left.mas_equalTo(_reportTipLabel.mas_right);
  235. make.right.mas_equalTo(-20);
  236. make.top.equalTo(_reportTipLabel.mas_top);
  237. make.height.mas_equalTo(20);
  238. }];
  239. CGFloat shareButW = (SCREEN_W - 20 -20 -15)/2.0;
  240. _cancelShareLinkButton = [[UIButton alloc] init];
  241. [_cancelShareLinkButton setTitle:NSLocalizedString(@"cancel_share_title",nil) forState:UIControlStateNormal];
  242. [_cancelShareLinkButton setTitleColor:HW0A132BColor forState:UIControlStateNormal];
  243. _cancelShareLinkButton.titleLabel.font = [UIFont systemFontOfSize:14.0];
  244. [_cancelShareLinkButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
  245. _cancelShareLinkButton.tag = 10;
  246. [_BgScrollView addSubview:_cancelShareLinkButton];
  247. _cancelShareLinkButton.layer.cornerRadius = 8;
  248. _cancelShareLinkButton.layer.masksToBounds = YES;
  249. _cancelShareLinkButton.backgroundColor = [UIColor hwColor:@"#E3E8F1"];
  250. [_cancelShareLinkButton mas_makeConstraints:^(MASConstraintMaker *make) {
  251. make.left.mas_equalTo(20);
  252. make.width.mas_equalTo(shareButW);
  253. make.top.equalTo(_whiteBgView.mas_bottom).offset(25);
  254. make.height.mas_equalTo(48);
  255. }];
  256. _shareLinkCopyButton = [[UIButton alloc] init];
  257. CGFloat w_btn = shareButW;//SCREEN_W-130 -15 -10 -15;
  258. // gradient
  259. CAGradientLayer *gl = [CAGradientLayer layer];
  260. gl.frame = CGRectMake(0,0,w_btn,48.f);
  261. gl.startPoint = CGPointMake(0, 0.5);
  262. gl.endPoint = CGPointMake(1, 0.5);
  263. gl.colors = @[(__bridge id)HW0CDEFDColor.CGColor, (__bridge id)HW058DFBColor.CGColor];
  264. gl.locations = @[@(0), @(1.0f)];
  265. [_shareLinkCopyButton.layer addSublayer:gl];
  266. [_shareLinkCopyButton setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
  267. [_shareLinkCopyButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:(UIControlEventTouchUpInside)];
  268. [_shareLinkCopyButton setTitle:NSLocalizedString(@"copy_share_link_title",nil) forState:(UIControlStateNormal)];
  269. [_shareLinkCopyButton.titleLabel setFont:[UIFont systemFontOfSize:14.f]];
  270. [_shareLinkCopyButton.layer setCornerRadius:8.f];
  271. _shareLinkCopyButton.clipsToBounds = YES;
  272. _shareLinkCopyButton.tag = 11;
  273. [_BgScrollView addSubview:_shareLinkCopyButton];
  274. [_shareLinkCopyButton mas_makeConstraints:^(MASConstraintMaker *make) {
  275. //make.right.mas_equalTo(-20);
  276. make.left.equalTo(_cancelShareLinkButton.mas_right).offset(15);
  277. make.width.mas_equalTo(w_btn);
  278. make.top.equalTo(_cancelShareLinkButton.mas_top).offset(0);
  279. make.height.mas_equalTo(48);
  280. }];
  281. }
  282. // 生成二维码
  283. - (UIImage *)generateQRCodeWithInputMessage:(NSString *)inputMessage
  284. Width:(CGFloat)width
  285. Height:(CGFloat)height{
  286. NSData *inputData = [inputMessage dataUsingEncoding:NSUTF8StringEncoding];
  287. CIFilter *filter = [CIFilter filterWithName:@"CIQRCodeGenerator"];
  288. [filter setValue:inputData forKey:@"inputMessage"];
  289. // [filter setValue:@"H" forKey:@"inputCorrectionLevel"]; // 设置二维码不同级别的容错率
  290. CIImage *ciImage = filter.outputImage;
  291. // 消除模糊
  292. CGFloat scaleX = MIN(width, height)/ciImage.extent.size.width;
  293. CGFloat scaleY = MIN(width, height)/ciImage.extent.size.height;
  294. ciImage = [ciImage imageByApplyingTransform:CGAffineTransformScale(CGAffineTransformIdentity, scaleX, scaleY)];
  295. UIImage *returnImage = [UIImage imageWithCIImage:ciImage];
  296. return returnImage;
  297. }
  298. - (void)didClickButtonFun:(UIButton*)but
  299. {
  300. NSInteger tag = but.tag;
  301. if(tag == 1){
  302. NSString *serUrl = shareService;
  303. NSString *shareUrl = [[NSString alloc] initWithFormat:@"%@%@",serUrl,_dataModel.token];
  304. NSURL *URL = [NSURL URLWithString:shareUrl];
  305. [[UIApplication sharedApplication] openURL:URL];
  306. }
  307. else if(tag == 10){
  308. [self showCancelAlearViewFun];
  309. }
  310. else if(tag == 11){
  311. [self copyShareLinkFun];
  312. }
  313. }
  314. - (void)viewWillAppear:(BOOL)animated
  315. {
  316. [super viewWillAppear:animated];
  317. [self handleDataFun];
  318. }
  319. //- (void)setDataModel:(ShareRecordListModel *)dataModel
  320. - (void)handleDataFun
  321. {
  322. //_dataModel = dataModel;
  323. if(!_dataModel.expirationStatus && !_dataModel.reportStatus){
  324. _cancelShareLinkButton.hidden = NO;
  325. _shareLinkCopyButton.hidden = NO;
  326. if(_dataModel.expirationDay== 0)
  327. {
  328. NSString *expDateStr = NSLocalizedString(@"share_expiration_date_forever",nil);
  329. _shareEndDateLabel.text = expDateStr;
  330. }
  331. else{
  332. //失效时间
  333. _shareEndDateLabel.text = _dataModel.expirationTime;
  334. }
  335. }
  336. else{
  337. _cancelShareLinkButton.hidden = YES;
  338. _shareLinkCopyButton.hidden = YES;
  339. //失效时间
  340. //NSString *tipStr2 = NSLocalizedString(@"copy_share_link_Invalid_tip",nil);
  341. //_shareEndDateLabel.text = tipStr2;
  342. //_shareEndDateLabel.textColor = [UIColor hwColor:@"#DD4E4E"];
  343. if(_dataModel.reportStatus){
  344. _shareEndDateLabel.text = _dataModel.reportTime;
  345. }
  346. else{
  347. _shareEndDateLabel.text = _dataModel.expirationTime;
  348. }
  349. }
  350. ShareFileDataModel *fileModel = _dataModel.fileListVOS.firstObject;
  351. NSString *titleStr = [[NSString alloc] initWithFormat:@"%@%@%ld%@",fileModel.fileName,NSLocalizedString(@"share_file_more_tip",nil), _dataModel.fileListVOS.count,NSLocalizedString(@"share_file_Numbers_tip",nil)];
  352. if(_dataModel.fileListVOS.count == 1){
  353. titleStr = fileModel.fileName;
  354. }
  355. _shareTitleLabel.text = titleStr;
  356. _shareBeginDateLabel.text = _dataModel.createTime;
  357. NSString *serUrl = shareService;
  358. NSString *shareUrl = [[NSString alloc] initWithFormat:@"%@%@",serUrl,_dataModel.token];
  359. _shareQRCodeImageView.image = [self generateQRCodeWithInputMessage:shareUrl Width:168 Height:168];
  360. _extractCodeTip2Lab.text = _dataModel.extractionCode;
  361. CGFloat whiteBgViewH = 558;
  362. if(_dataModel.platformType == 4){
  363. if (_dataModel.reportStatus) {
  364. _reportTipLabel.hidden = NO;
  365. _reportLabel.hidden = NO;
  366. }
  367. else{
  368. _reportTipLabel.hidden = YES;
  369. _reportLabel.hidden = YES;
  370. whiteBgViewH -= 30;
  371. }
  372. [_whiteBgView mas_remakeConstraints:^(MASConstraintMaker *make) {
  373. make.left.mas_equalTo(15);
  374. //make.right.mas_equalTo(-15);
  375. make.width.mas_equalTo(SCREEN_W - 30);
  376. //make.top.equalTo(self.navBarBGView.mas_bottom).offset(40.f);
  377. make.top.mas_equalTo(40);
  378. make.height.mas_equalTo(whiteBgViewH);
  379. }];
  380. }
  381. else{
  382. _extractCodeTipLab.hidden = YES;
  383. _extractCodeTip2Lab.hidden = YES;
  384. whiteBgViewH -= 30;
  385. if (_dataModel.reportStatus) {
  386. _reportTipLabel.hidden = NO;
  387. _reportLabel.hidden = NO;
  388. [_reportTipLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
  389. make.left.mas_equalTo(32);
  390. make.width.mas_equalTo(80);
  391. make.top.equalTo(_remainingNumberLabel.mas_bottom).offset(10);
  392. make.height.mas_equalTo(20);
  393. }];
  394. [_reportLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
  395. make.left.mas_equalTo(_reportTipLabel.mas_right);
  396. make.right.mas_equalTo(-20);
  397. make.top.equalTo(_reportTipLabel.mas_top);
  398. make.height.mas_equalTo(20);
  399. }];
  400. }
  401. else{
  402. _reportTipLabel.hidden = YES;
  403. _reportLabel.hidden = YES;
  404. whiteBgViewH -= 30;
  405. }
  406. [_whiteBgView mas_remakeConstraints:^(MASConstraintMaker *make) {
  407. make.left.mas_equalTo(15);
  408. //make.right.mas_equalTo(-15);
  409. make.width.mas_equalTo(SCREEN_W - 30);
  410. //make.top.equalTo(self.navBarBGView.mas_bottom).offset(40.f);
  411. make.top.mas_equalTo(40);
  412. make.height.mas_equalTo(whiteBgViewH);
  413. }];
  414. }
  415. _BgScrollView.contentSize = CGSizeMake(SCREEN_W, 40 + whiteBgViewH + 75);
  416. }
  417. #pragma mark 取消分享
  418. - (void)showCancelAlearViewFun
  419. {
  420. NSString *tipStr = NSLocalizedString(@"cancel_share_Tip_msg",nil);
  421. KWeakSelf
  422. ComontAlretViewController *curAlretVC= [[ComontAlretViewController alloc] initWithTiTle:nil
  423. msg:tipStr
  424. imageStr:nil
  425. cancelTitle:NSLocalizedString(@"other_cancel",nil)
  426. okTitle:NSLocalizedString(@"other_confirm",nil) isOkBtnHighlight:YES
  427. didClickOk:^{
  428. [weakSelf cancelShareLinkFun];
  429. } didClickCancel:^{
  430. }];
  431. curAlretVC.modalPresentationStyle = UIModalPresentationCustom;
  432. [self presentViewController:curAlretVC animated:YES completion:^{
  433. curAlretVC.view.superview.backgroundColor = [UIColor clearColor];
  434. }];
  435. }
  436. - (void)cancelShareLinkFun
  437. {
  438. NSMutableDictionary *paraDict = [NSMutableDictionary new];
  439. if(_dataModel.addShareId){
  440. //[paraDict setValue:_dataModel.addShareId forKey:@"id"];
  441. [paraDict setValue:@[_dataModel.addShareId] forKey:@"idList"];
  442. }
  443. [paraDict setValue:@1 forKey:@"expirationStatus"];
  444. KWeakSelf
  445. [self showNewIndicatorWithCanBack:NO canTouch:NO];
  446. [[netWorkManager shareInstance] CommonPostCallBackCode:updateShareInfoFun Parameters:paraDict success:^(id _Nonnull responseObject) {
  447. [weakSelf removeNewIndicator];
  448. SuperModel *model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
  449. if(model && model.code == 0){
  450. [[iToast makeText:NSLocalizedString(@"cancel_share_suc_msg",nil)] show];
  451. [weakSelf getShareOneFileListFun];
  452. }
  453. else{
  454. [[iToast makeText:NSLocalizedString(@"cancel_share_fail_msg",nil)] show];
  455. }
  456. } failure:^(NSError * _Nonnull error) {
  457. [weakSelf removeNewIndicator];
  458. [[iToast makeText:NSLocalizedString(@"cancel_share_fail_msg",nil)] show];
  459. }];
  460. }
  461. #pragma mark 取消分享信息重新获取
  462. - (void)getShareOneFileListFun
  463. {
  464. _dataModel.expirationStatus = 1;
  465. [self handleDataFun];
  466. if(_didCancelShareLinkFun){
  467. _didCancelShareLinkFun();
  468. }
  469. }
  470. - (void)copyShareLinkFun
  471. {
  472. if(_dataModel.fileListVOS.count <=0 ){
  473. return;
  474. }
  475. ShareFileDataModel *dataModel = _dataModel.fileListVOS.firstObject;
  476. NSString *copyStr1 = [[NSString alloc] initWithFormat:@"%@%@%@%ld%@",NSLocalizedString(@"share_secret_titile_1_1",nil),dataModel.fileName,NSLocalizedString(@"share_file_more_tip",nil), _dataModel.fileListVOS.count,NSLocalizedString(@"share_file_Numbers_tip",nil)];
  477. if(_dataModel.fileListVOS.count == 1){
  478. copyStr1 = [[NSString alloc] initWithFormat:@"%@%@",NSLocalizedString(@"share_secret_titile_1",nil),dataModel.fileName];
  479. }
  480. if(_dataModel.platformType == 4) {
  481. copyStr1 = [[NSString alloc] initWithFormat:@"%@%@",NSLocalizedString(@"share_secret_titile_1",nil),copyStr1];
  482. }
  483. NSString *serUrl = shareService;
  484. NSString *shareUrl = [[NSString alloc] initWithFormat:@"%@%@",serUrl,_dataModel.token];
  485. NSString *copyStr2 = [[NSString alloc] initWithFormat:@"%@%@",NSLocalizedString(@"share_secret_titile_2",nil),shareUrl];
  486. NSString *copyStr3 = [[NSString alloc] initWithFormat:@"%@%@",NSLocalizedString(@"share_secret_titile_3",nil),_dataModel.extractionCode];
  487. NSString *copyStr4 = NSLocalizedString(@"share_secret_titile_4",nil);
  488. NSString *copyTotalStr = [[NSString alloc] initWithFormat:@"%@\n%@\n%@\n%@",copyStr1,copyStr2,copyStr3,copyStr4];
  489. if(_dataModel.platformType != 4) {
  490. copyTotalStr = [[NSString alloc] initWithFormat:@"%@\n%@\n%@",copyStr1,copyStr2,copyStr4];
  491. }
  492. UIPasteboard* pasteboard = [UIPasteboard generalPasteboard];
  493. pasteboard.string = copyTotalStr;
  494. [[iToast makeText:NSLocalizedString(@"copy_share_link_suc_tip",nil)] show];
  495. }
  496. @end