shareRecordDetailsHWViewController.m 20 KB

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