shareRecordDetailsHWViewController.m 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  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. _checkShareLinkButton.hidden = YES;
  346. }
  347. else{
  348. _shareEndDateLabel.text = _dataModel.expirationTime;
  349. }
  350. }
  351. ShareFileDataModel *fileModel = _dataModel.fileListVOS.firstObject;
  352. NSString *titleStr = [[NSString alloc] initWithFormat:@"%@%@%ld%@",fileModel.fileName,NSLocalizedString(@"share_file_more_tip",nil), _dataModel.fileListVOS.count,NSLocalizedString(@"share_file_Numbers_tip",nil)];
  353. if(_dataModel.fileListVOS.count == 1){
  354. titleStr = fileModel.fileName;
  355. }
  356. _shareTitleLabel.text = titleStr;
  357. _shareBeginDateLabel.text = _dataModel.createTime;
  358. NSString *serUrl = shareService;
  359. NSString *shareUrl = [[NSString alloc] initWithFormat:@"%@%@",serUrl,_dataModel.token];
  360. _shareQRCodeImageView.image = [self generateQRCodeWithInputMessage:shareUrl Width:168 Height:168];
  361. _extractCodeTip2Lab.text = _dataModel.extractionCode;
  362. _remainingNumberLabel.text = [[NSString alloc] initWithFormat:@"%ld",_dataModel.remainingNumber];
  363. CGFloat whiteBgViewH = 558;
  364. if(_dataModel.platformType == 4){
  365. if (_dataModel.reportStatus) {
  366. _reportTipLabel.hidden = NO;
  367. _reportLabel.hidden = NO;
  368. }
  369. else{
  370. _reportTipLabel.hidden = YES;
  371. _reportLabel.hidden = YES;
  372. whiteBgViewH -= 30;
  373. }
  374. [_whiteBgView mas_remakeConstraints:^(MASConstraintMaker *make) {
  375. make.left.mas_equalTo(15);
  376. //make.right.mas_equalTo(-15);
  377. make.width.mas_equalTo(SCREEN_W - 30);
  378. //make.top.equalTo(self.navBarBGView.mas_bottom).offset(40.f);
  379. make.top.mas_equalTo(40);
  380. make.height.mas_equalTo(whiteBgViewH);
  381. }];
  382. }
  383. else{
  384. _extractCodeTipLab.hidden = YES;
  385. _extractCodeTip2Lab.hidden = YES;
  386. whiteBgViewH -= 30;
  387. if (_dataModel.reportStatus) {
  388. _reportTipLabel.hidden = NO;
  389. _reportLabel.hidden = NO;
  390. [_reportTipLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
  391. make.left.mas_equalTo(32);
  392. make.width.mas_equalTo(80);
  393. make.top.equalTo(_remainingNumberLabel.mas_bottom).offset(10);
  394. make.height.mas_equalTo(20);
  395. }];
  396. [_reportLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
  397. make.left.mas_equalTo(_reportTipLabel.mas_right);
  398. make.right.mas_equalTo(-20);
  399. make.top.equalTo(_reportTipLabel.mas_top);
  400. make.height.mas_equalTo(20);
  401. }];
  402. }
  403. else{
  404. _reportTipLabel.hidden = YES;
  405. _reportLabel.hidden = YES;
  406. whiteBgViewH -= 30;
  407. }
  408. [_whiteBgView mas_remakeConstraints:^(MASConstraintMaker *make) {
  409. make.left.mas_equalTo(15);
  410. //make.right.mas_equalTo(-15);
  411. make.width.mas_equalTo(SCREEN_W - 30);
  412. //make.top.equalTo(self.navBarBGView.mas_bottom).offset(40.f);
  413. make.top.mas_equalTo(40);
  414. make.height.mas_equalTo(whiteBgViewH);
  415. }];
  416. }
  417. _BgScrollView.contentSize = CGSizeMake(SCREEN_W, 40 + whiteBgViewH + 75);
  418. }
  419. #pragma mark 取消分享
  420. - (void)showCancelAlearViewFun
  421. {
  422. NSString *tipStr = NSLocalizedString(@"cancel_share_Tip_msg",nil);
  423. KWeakSelf
  424. ComontAlretViewController *curAlretVC= [[ComontAlretViewController alloc] initWithTiTle:nil
  425. msg:tipStr
  426. imageStr:nil
  427. cancelTitle:NSLocalizedString(@"other_cancel",nil)
  428. okTitle:NSLocalizedString(@"other_confirm",nil) isOkBtnHighlight:YES
  429. didClickOk:^{
  430. [weakSelf cancelShareLinkFun];
  431. } didClickCancel:^{
  432. }];
  433. curAlretVC.modalPresentationStyle = UIModalPresentationCustom;
  434. [self presentViewController:curAlretVC animated:YES completion:^{
  435. curAlretVC.view.superview.backgroundColor = [UIColor clearColor];
  436. }];
  437. }
  438. - (void)cancelShareLinkFun
  439. {
  440. NSMutableDictionary *paraDict = [NSMutableDictionary new];
  441. if(_dataModel.addShareId){
  442. //[paraDict setValue:_dataModel.addShareId forKey:@"id"];
  443. [paraDict setValue:@[_dataModel.addShareId] forKey:@"idList"];
  444. }
  445. [paraDict setValue:@1 forKey:@"expirationStatus"];
  446. KWeakSelf
  447. [self showNewIndicatorWithCanBack:NO canTouch:NO];
  448. [[netWorkManager shareInstance] CommonPostCallBackCode:updateShareInfoFun Parameters:paraDict success:^(id _Nonnull responseObject) {
  449. [weakSelf removeNewIndicator];
  450. SuperModel *model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
  451. if(model && model.code == 0){
  452. [[iToast makeText:NSLocalizedString(@"cancel_share_suc_msg",nil)] show];
  453. [weakSelf getShareOneFileListFun];
  454. }
  455. else{
  456. [[iToast makeText:NSLocalizedString(@"cancel_share_fail_msg",nil)] show];
  457. }
  458. } failure:^(NSError * _Nonnull error) {
  459. [weakSelf removeNewIndicator];
  460. [[iToast makeText:NSLocalizedString(@"cancel_share_fail_msg",nil)] show];
  461. }];
  462. }
  463. #pragma mark 取消分享信息重新获取
  464. - (void)getShareOneFileListFun
  465. {
  466. _dataModel.expirationStatus = 1;
  467. [self handleDataFun];
  468. if(_didCancelShareLinkFun){
  469. _didCancelShareLinkFun();
  470. }
  471. }
  472. - (void)copyShareLinkFun
  473. {
  474. if(_dataModel.fileListVOS.count <=0 ){
  475. return;
  476. }
  477. ShareFileDataModel *dataModel = _dataModel.fileListVOS.firstObject;
  478. 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)];
  479. if(_dataModel.fileListVOS.count == 1){
  480. copyStr1 = [[NSString alloc] initWithFormat:@"%@%@",NSLocalizedString(@"share_secret_titile_1",nil),dataModel.fileName];
  481. }
  482. if(_dataModel.platformType == 4) {
  483. copyStr1 = [[NSString alloc] initWithFormat:@"%@%@",NSLocalizedString(@"share_secret_titile_1",nil),copyStr1];
  484. }
  485. NSString *serUrl = shareService;
  486. NSString *shareUrl = [[NSString alloc] initWithFormat:@"%@%@",serUrl,_dataModel.token];
  487. NSString *copyStr2 = [[NSString alloc] initWithFormat:@"%@%@",NSLocalizedString(@"share_secret_titile_2",nil),shareUrl];
  488. NSString *copyStr3 = [[NSString alloc] initWithFormat:@"%@%@",NSLocalizedString(@"share_secret_titile_3",nil),_dataModel.extractionCode];
  489. NSString *copyStr4 = NSLocalizedString(@"share_secret_titile_4",nil);
  490. NSString *copyTotalStr = [[NSString alloc] initWithFormat:@"%@\n%@\n%@\n%@",copyStr1,copyStr2,copyStr3,copyStr4];
  491. if(_dataModel.platformType != 4) {
  492. copyTotalStr = [[NSString alloc] initWithFormat:@"%@\n%@\n%@",copyStr1,copyStr2,copyStr4];
  493. }
  494. UIPasteboard* pasteboard = [UIPasteboard generalPasteboard];
  495. pasteboard.string = copyTotalStr;
  496. [[iToast makeText:NSLocalizedString(@"copy_share_link_suc_tip",nil)] show];
  497. }
  498. @end