|
@@ -275,9 +275,12 @@
|
|
|
[[UIApplication sharedApplication] openURL:URL];
|
|
|
|
|
|
}
|
|
|
- else{
|
|
|
+ else if(tag == 10){
|
|
|
[self showCancelAlearViewFun];
|
|
|
- }
|
|
|
+ }
|
|
|
+ else if(tag == 11){
|
|
|
+ [self copyShareLinkFun];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- (void)viewWillAppear:(BOOL)animated
|
|
@@ -294,15 +297,21 @@
|
|
|
if(!_dataModel.expirationStatus){
|
|
|
_cancelShareLinkButton.hidden = NO;
|
|
|
_shareLinkCopyButton.hidden = NO;
|
|
|
+
|
|
|
+ //失效时间
|
|
|
+ NSString *tipStr = NSLocalizedString(@"copy_share_link_Invalid_tip3",nil);
|
|
|
+ _shareEndDateLabel.text = [[NSString alloc] initWithFormat:@"%@: %@",tipStr,_dataModel.expirationTime];
|
|
|
}
|
|
|
else{
|
|
|
_cancelShareLinkButton.hidden = YES;
|
|
|
_shareLinkCopyButton.hidden = YES;
|
|
|
+
|
|
|
+ //失效时间
|
|
|
+ NSString *tipStr = NSLocalizedString(@"copy_share_link_Invalid_tip3",nil);
|
|
|
+ NSString *tipStr2 = NSLocalizedString(@"copy_share_link_Invalid_tip",nil);
|
|
|
+ _shareEndDateLabel.text = [[NSString alloc] initWithFormat:@"%@: %@",tipStr,tipStr2];
|
|
|
}
|
|
|
|
|
|
- //失效时间
|
|
|
- NSString *tipStr = NSLocalizedString(@"copy_share_link_Invalid_tip3",nil);
|
|
|
- _shareEndDateLabel.text = [[NSString alloc] initWithFormat:@"%@: %@",tipStr,_dataModel.expirationTime];
|
|
|
|
|
|
ShareFileDataModel *fileModel = _dataModel.fileListVOS.firstObject;
|
|
|
NSString *titleStr = [[NSString alloc] initWithFormat:@"%@%@%ld%@",fileModel.fileName,NSLocalizedString(@"share_file_more_tip",nil), _dataModel.fileListVOS.count,NSLocalizedString(@"share_file_Numbers_tip",nil)];
|
|
@@ -398,6 +407,7 @@
|
|
|
SuperModel *model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
|
|
|
if(model && model.code == 0){
|
|
|
[[iToast makeText:NSLocalizedString(@"cancel_share_suc_msg",nil)] show];
|
|
|
+ [weakSelf getShareOneFileListFun];
|
|
|
}
|
|
|
else{
|
|
|
[[iToast makeText:NSLocalizedString(@"cancel_share_fail_msg",nil)] show];
|
|
@@ -408,4 +418,81 @@
|
|
|
[[iToast makeText:NSLocalizedString(@"cancel_share_fail_msg",nil)] show];
|
|
|
}];
|
|
|
}
|
|
|
+
|
|
|
+#pragma mark 分享信息重新获取
|
|
|
+- (void)getShareOneFileListFun
|
|
|
+{
|
|
|
+ _dataModel.expirationStatus = 1;
|
|
|
+ [self handleDataFun];
|
|
|
+
|
|
|
+ if(_didCancelShareLinkFun){
|
|
|
+ _didCancelShareLinkFun();
|
|
|
+ }
|
|
|
+
|
|
|
+// NSMutableDictionary*paraDict = [NSMutableDictionary new];
|
|
|
+//
|
|
|
+// if(_dataModel.token){
|
|
|
+// [paraDict setValue:_dataModel.token forKey:@"token"];
|
|
|
+// }
|
|
|
+//
|
|
|
+// if(_dataModel.addShareId){
|
|
|
+// [paraDict setValue:_dataModel.addShareId forKey:@"id"];
|
|
|
+// }
|
|
|
+//
|
|
|
+// if(_dataModel.extractionCode){
|
|
|
+// [paraDict setValue:_dataModel.extractionCode forKey:@"extractionCode"];
|
|
|
+// }
|
|
|
+//
|
|
|
+// KWeakSelf
|
|
|
+// [[netWorkManager shareInstance] CommonPostCallBackCode:queryOneShareInfoFun Parameters:paraDict success:^(id _Nonnull responseObject) {
|
|
|
+//
|
|
|
+// ShareRecordListModel*model = [[ShareRecordListModel alloc] initWithDictionary:responseObject error:nil];
|
|
|
+// if(model && model.status == 0){
|
|
|
+// weakSelf.dataModel = model;
|
|
|
+// [weakSelf handleDataFun];
|
|
|
+// }
|
|
|
+// else{
|
|
|
+//
|
|
|
+// }
|
|
|
+// } failure:^(NSError * _Nonnull error) {
|
|
|
+//
|
|
|
+// }];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)copyShareLinkFun
|
|
|
+{
|
|
|
+ if(_dataModel.fileListVOS.count <=0 ){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ ShareFileDataModel *dataModel = _dataModel.fileListVOS.firstObject;
|
|
|
+
|
|
|
+ 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)];
|
|
|
+
|
|
|
+ if(_dataModel.fileListVOS.count == 1){
|
|
|
+ copyStr1 = [[NSString alloc] initWithFormat:@"%@%@",NSLocalizedString(@"share_secret_titile_1",nil),dataModel.fileName];
|
|
|
+ }
|
|
|
+
|
|
|
+ if(_dataModel.platformType == 4) {
|
|
|
+ copyStr1 = [[NSString alloc] initWithFormat:@"%@%@",NSLocalizedString(@"share_secret_titile_1",nil),copyStr1];
|
|
|
+ }
|
|
|
+
|
|
|
+ NSString *serUrl = @"http://192.168.12.253:8080/#/pages/fileSharing/index?token=";
|
|
|
+ NSString *shareUrl = [[NSString alloc] initWithFormat:@"%@%@",serUrl,_dataModel.token];
|
|
|
+ NSString *copyStr2 = [[NSString alloc] initWithFormat:@"%@%@",NSLocalizedString(@"share_secret_titile_2",nil),shareUrl];
|
|
|
+
|
|
|
+ NSString *copyStr3 = [[NSString alloc] initWithFormat:@"%@%@",NSLocalizedString(@"share_secret_titile_3",nil),_dataModel.extractionCode];
|
|
|
+ NSString *copyStr4 = NSLocalizedString(@"share_secret_titile_4",nil);
|
|
|
+
|
|
|
+
|
|
|
+ NSString *copyTotalStr = [[NSString alloc] initWithFormat:@"%@\n%@\n%@\n%@",copyStr1,copyStr2,copyStr3,copyStr4];
|
|
|
+ if(_dataModel.platformType != 4) {
|
|
|
+ copyTotalStr = [[NSString alloc] initWithFormat:@"%@\n%@\n%@",copyStr1,copyStr2,copyStr4];
|
|
|
+ }
|
|
|
+
|
|
|
+ UIPasteboard* pasteboard = [UIPasteboard generalPasteboard];
|
|
|
+ pasteboard.string = copyTotalStr;
|
|
|
+
|
|
|
+ [[iToast makeText:NSLocalizedString(@"copy_share_link_suc_tip",nil)] show];
|
|
|
+}
|
|
|
@end
|