Skip to content

Commit cac9e8c

Browse files
committed
「分享中」文件夹 & 移动文件夹
1 parent c5ca2c1 commit cac9e8c

27 files changed

+270
-55
lines changed

Coding_iOS.xcodeproj/project.pbxproj

+30
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,12 @@
169169
4E1A22851AB172C400CFC14F /* ProjectItemsCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E1A22841AB172C400CFC14F /* ProjectItemsCell.m */; };
170170
4E1A22881AB1731600CFC14F /* ProjectDescriptionCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E1A22871AB1731600CFC14F /* ProjectDescriptionCell.m */; };
171171
4E1A228B1AB1844F00CFC14F /* EaseGitButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E1A228A1AB1844F00CFC14F /* EaseGitButton.m */; };
172+
4E1D99161DCAE67D00BAE585 /* icon_file_folder_out@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E1D99121DCAE67D00BAE585 /* icon_file_folder_out@2x.png */; };
173+
4E1D99171DCAE67D00BAE585 /* icon_file_folder_out@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E1D99131DCAE67D00BAE585 /* icon_file_folder_out@3x.png */; };
174+
4E1D99181DCAE67D00BAE585 /* icon_file_folder_share@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E1D99141DCAE67D00BAE585 /* icon_file_folder_share@2x.png */; };
175+
4E1D99191DCAE67D00BAE585 /* icon_file_folder_share@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E1D99151DCAE67D00BAE585 /* icon_file_folder_share@3x.png */; };
176+
4E1D991C1DCAE69600BAE585 /* icon_file_share_logo@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E1D991A1DCAE69600BAE585 /* icon_file_share_logo@2x.png */; };
177+
4E1D991D1DCAE69600BAE585 /* icon_file_share_logo@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E1D991B1DCAE69600BAE585 /* icon_file_share_logo@3x.png */; };
172178
4E217F0C1A70EDC700F6DF88 /* SVModalWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E217EF91A70EDC700F6DF88 /* SVModalWebViewController.m */; };
173179
4E217F0D1A70EDC700F6DF88 /* SVWebViewController.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 4E217EFA1A70EDC700F6DF88 /* SVWebViewController.bundle */; };
174180
4E217F0E1A70EDC700F6DF88 /* SVWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E217EFC1A70EDC700F6DF88 /* SVWebViewController.m */; };
@@ -222,6 +228,7 @@
222228
4E3DB53C1BFDD0F40062BA52 /* task_activity_icon_add_watcher@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E3DB53A1BFDD0F40062BA52 /* task_activity_icon_add_watcher@2x.png */; };
223229
4E3DB53D1BFDD0F40062BA52 /* task_activity_icon_MergeRequestBean@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E3DB53B1BFDD0F40062BA52 /* task_activity_icon_MergeRequestBean@2x.png */; };
224230
4E44DCFA1D81486600E7F9AF /* HelpViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E44DCF91D81486600E7F9AF /* HelpViewController.m */; };
231+
4E4969401DCB0BCE0065028E /* FileShare.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E49693F1DCB0BCE0065028E /* FileShare.m */; };
225232
4E4972DC1BB52A8300F3AC15 /* tipIcon_TweetComment@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E4972DB1BB52A8300F3AC15 /* tipIcon_TweetComment@2x.png */; };
226233
4E4972DF1BB535B400F3AC15 /* tipIcon_ProjectTweet@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E4972DD1BB535B400F3AC15 /* tipIcon_ProjectTweet@2x.png */; };
227234
4E4972E01BB535B400F3AC15 /* tipIcon_ProjectTweetComment@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E4972DE1BB535B400F3AC15 /* tipIcon_ProjectTweetComment@2x.png */; };
@@ -1417,6 +1424,12 @@
14171424
4E1A22871AB1731600CFC14F /* ProjectDescriptionCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProjectDescriptionCell.m; sourceTree = "<group>"; };
14181425
4E1A22891AB1844F00CFC14F /* EaseGitButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EaseGitButton.h; sourceTree = "<group>"; };
14191426
4E1A228A1AB1844F00CFC14F /* EaseGitButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EaseGitButton.m; sourceTree = "<group>"; };
1427+
4E1D99121DCAE67D00BAE585 /* icon_file_folder_out@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_file_folder_out@2x.png"; sourceTree = "<group>"; };
1428+
4E1D99131DCAE67D00BAE585 /* icon_file_folder_out@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_file_folder_out@3x.png"; sourceTree = "<group>"; };
1429+
4E1D99141DCAE67D00BAE585 /* icon_file_folder_share@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_file_folder_share@2x.png"; sourceTree = "<group>"; };
1430+
4E1D99151DCAE67D00BAE585 /* icon_file_folder_share@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_file_folder_share@3x.png"; sourceTree = "<group>"; };
1431+
4E1D991A1DCAE69600BAE585 /* icon_file_share_logo@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_file_share_logo@2x.png"; sourceTree = "<group>"; };
1432+
4E1D991B1DCAE69600BAE585 /* icon_file_share_logo@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_file_share_logo@3x.png"; sourceTree = "<group>"; };
14201433
4E217EF81A70EDC700F6DF88 /* SVModalWebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVModalWebViewController.h; sourceTree = "<group>"; };
14211434
4E217EF91A70EDC700F6DF88 /* SVModalWebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SVModalWebViewController.m; sourceTree = "<group>"; };
14221435
4E217EFA1A70EDC700F6DF88 /* SVWebViewController.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = SVWebViewController.bundle; sourceTree = "<group>"; };
@@ -1488,6 +1501,8 @@
14881501
4E3DB53B1BFDD0F40062BA52 /* task_activity_icon_MergeRequestBean@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "task_activity_icon_MergeRequestBean@2x.png"; sourceTree = "<group>"; };
14891502
4E44DCF81D81486600E7F9AF /* HelpViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HelpViewController.h; sourceTree = "<group>"; };
14901503
4E44DCF91D81486600E7F9AF /* HelpViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HelpViewController.m; sourceTree = "<group>"; };
1504+
4E49693E1DCB0BCE0065028E /* FileShare.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileShare.h; sourceTree = "<group>"; };
1505+
4E49693F1DCB0BCE0065028E /* FileShare.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileShare.m; sourceTree = "<group>"; };
14911506
4E4972DB1BB52A8300F3AC15 /* tipIcon_TweetComment@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tipIcon_TweetComment@2x.png"; sourceTree = "<group>"; };
14921507
4E4972DD1BB535B400F3AC15 /* tipIcon_ProjectTweet@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tipIcon_ProjectTweet@2x.png"; sourceTree = "<group>"; };
14931508
4E4972DE1BB535B400F3AC15 /* tipIcon_ProjectTweetComment@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tipIcon_ProjectTweetComment@2x.png"; sourceTree = "<group>"; };
@@ -4933,6 +4948,12 @@
49334948
4E4D6AC01B252CD400FD2E49 /* icon_code_tree@2x.png */,
49344949
4EA679171A14BFA0001A0324 /* icon_file_folder_default@2x.png */,
49354950
4EA679181A14BFA0001A0324 /* icon_file_folder_normal@2x.png */,
4951+
4E1D99121DCAE67D00BAE585 /* icon_file_folder_out@2x.png */,
4952+
4E1D99131DCAE67D00BAE585 /* icon_file_folder_out@3x.png */,
4953+
4E1D99141DCAE67D00BAE585 /* icon_file_folder_share@2x.png */,
4954+
4E1D99151DCAE67D00BAE585 /* icon_file_folder_share@3x.png */,
4955+
4E1D991A1DCAE69600BAE585 /* icon_file_share_logo@2x.png */,
4956+
4E1D991B1DCAE69600BAE585 /* icon_file_share_logo@3x.png */,
49364957
4E07D30B1A4A9F45009EDDF2 /* btn_file_cancel@2x.png */,
49374958
4E07D30C1A4A9F45009EDDF2 /* btn_file_reDo@2x.png */,
49384959
4E07D3121A4D3CA6009EDDF2 /* icon_user_monkey@2x.png */,
@@ -5187,6 +5208,8 @@
51875208
4EA679121A1466A6001A0324 /* ProjectFiles.m */,
51885209
4EA679081A1461C3001A0324 /* ProjectFile.h */,
51895210
4EA679091A1461C3001A0324 /* ProjectFile.m */,
5211+
4E49693E1DCB0BCE0065028E /* FileShare.h */,
5212+
4E49693F1DCB0BCE0065028E /* FileShare.m */,
51905213
4E38CF601A7B7C99005536C0 /* CodeBranchOrTag.h */,
51915214
4E38CF611A7B7C99005536C0 /* CodeBranchOrTag.m */,
51925215
0A6E6BAB1AB08540004C0107 /* TweetSendLocation.h */,
@@ -5908,6 +5931,7 @@
59085931
8EA6D1A819E240C40076D59C /* xtsegment_bordor_left@2x.png in Resources */,
59095932
4EB52F5C1C7C5C4F00B5EBEA /* task_resource_reference_MergeRequestBean@2x.png in Resources */,
59105933
8E525C8A19F7E3F800496B34 /* blankpage_image_loadFail@2x.png in Resources */,
5934+
4E1D99161DCAE67D00BAE585 /* icon_file_folder_out@2x.png in Resources */,
59115935
4E6CBE591D8FBDF500644086 /* messageProjectFollows@2x.png in Resources */,
59125936
4E095A7E1B6B1E40008DC439 /* calendar_0xF24B4B@2x.png in Resources */,
59135937
4E5D13091C0ECB3400985AEB /* tweet_btn_comment@2x.png in Resources */,
@@ -6099,6 +6123,7 @@
60996123
13FB5D3A1CA17A6400EE127C /* PR_push@2x.png in Resources */,
61006124
4E54C24E1D90E05400A61023 /* tipIcon_ProjectTopicCommentVote@2x.png in Resources */,
61016125
4EF17EE41B3C3112003CDD2D /* intro_tip_4@2x.png in Resources */,
6126+
4E1D991D1DCAE69600BAE585 /* icon_file_share_logo@3x.png in Resources */,
61026127
4EAE06C01B7B51AF00179F4B /* file_activity_icon_create@2x.png in Resources */,
61036128
8EA6D18F19E240C40076D59C /* tasks_all@2x.png in Resources */,
61046129
13FB5D451CA17A6400EE127C /* merge-request coding@2x.png in Resources */,
@@ -6134,6 +6159,7 @@
61346159
4EAECBC41C44CB860096CA74 /* member_cell_edit_remove@2x.png in Resources */,
61356160
4E095A181D9534CB00E63D9E /* intro_page_unselected@3x.png in Resources */,
61366161
134116F41CB54AF8005E6550 /* PR_TaskResource@2x.png in Resources */,
6162+
4E1D991C1DCAE69600BAE585 /* icon_file_share_logo@2x.png in Resources */,
61376163
8EA6D17619E240C40076D59C /* placeholder_monkey_round_25@2x.png in Resources */,
61386164
4E2DB34A1BA6AEB4002F27C4 /* coding_emoji_gif_05@2x.png in Resources */,
61396165
8E97CEAD1A0C7E26006F9AD7 /* coding_emoji_22@2x.png in Resources */,
@@ -6273,6 +6299,7 @@
62736299
13FB5D4F1CA17A6400EE127C /* PRReviewer@2x.png in Resources */,
62746300
4E0022A61B7362EF005308DE /* intro_page0_ip4@2x.png in Resources */,
62756301
4E53EB591AFB090E0034FE1C /* nav_page_selected@2x.png in Resources */,
6302+
4E1D99171DCAE67D00BAE585 /* icon_file_folder_out@3x.png in Resources */,
62766303
8E97CEB31A0C7E26006F9AD7 /* coding_emoji_28@2x.png in Resources */,
62776304
4EF17EE61B3C3112003CDD2D /* intro_tip_5@2x.png in Resources */,
62786305
8EA6D17A19E240C40076D59C /* placeholder_monkey_round_50@2x.png in Resources */,
@@ -6361,6 +6388,7 @@
63616388
4E217F0D1A70EDC700F6DF88 /* SVWebViewController.bundle in Resources */,
63626389
4EC480121C2A909D005F1772 /* register_step_ed@3x.png in Resources */,
63636390
4E38CF641A7B8DD4005536C0 /* icon_triangle@2x.png in Resources */,
6391+
4E1D99191DCAE67D00BAE585 /* icon_file_folder_share@3x.png in Resources */,
63646392
4E4D6AC81B252F4800FD2E49 /* icon_add_comment@2x.png in Resources */,
63656393
4E0022A71B7362EF005308DE /* intro_page0_ip5@2x.png in Resources */,
63666394
8E872D0019EFEFF7002C8F34 /* tweet_more_comment_icon@2x.png in Resources */,
@@ -6369,6 +6397,7 @@
63696397
4E72F8331B15B811001B6CE6 /* gif_mark@2x.png in Resources */,
63706398
4EC5AD921A258DF8006FA97C /* icon_file_cell_delete@2x.png in Resources */,
63716399
8EA6D1F719E240C40076D59C /* MJPhotoBrowser.bundle in Resources */,
6400+
4E1D99181DCAE67D00BAE585 /* icon_file_folder_share@2x.png in Resources */,
63726401
4E217F121A70EDC700F6DF88 /* SVWebViewControllerActivityChrome@2x.png in Resources */,
63736402
4E217F161A70EDC700F6DF88 /* SVWebViewControllerActivitySafari@2x.png in Resources */,
63746403
4EF17EE21B3C3112003CDD2D /* intro_tip_3@2x.png in Resources */,
@@ -6840,6 +6869,7 @@
68406869
8EA6D13219E240C40076D59C /* RegisterViewController.m in Sources */,
68416870
923399661C00441700F29E04 /* ShopBanner.m in Sources */,
68426871
8EF643C519FF7E2900F7EEB0 /* TitleRImageMoreCell.m in Sources */,
6872+
4E4969401DCB0BCE0065028E /* FileShare.m in Sources */,
68436873
4ED6181B1C3A72AE0017946C /* ShopMutileValueCell.m in Sources */,
68446874
4E217F151A70EDC700F6DF88 /* SVWebViewControllerActivitySafari.m in Sources */,
68456875
4E8D5D5A1B45295D00B70936 /* HOTPGenerator.m in Sources */,

Coding_iOS/Controllers/FileListViewController.m

+41-11
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ - (void)configToolBar{
148148
if (!_myToolBar) {
149149
EaseToolBarItem *item1 = [EaseToolBarItem easeToolBarItemWithTitle:@" 新建文件夹" image:@"button_file_createFolder_enable" disableImage:@"button_file_createFolder_unable"];
150150
EaseToolBarItem *item2 = [EaseToolBarItem easeToolBarItemWithTitle:@" 上传文件" image:@"button_file_upload_enable" disableImage:nil];
151-
item1.enabled = [self canCreatNewFolder];
152151
_myToolBar = [EaseToolBar easeToolBarWithItems:@[item1, item2]];
153152
_myToolBar.delegate = self;
154153
[self.view addSubview:_myToolBar];
@@ -174,14 +173,14 @@ - (void)configToolBar{
174173
if (_myTableView.isEditing) {
175174
_myToolBar.hidden = YES;
176175
_myEditToolBar.hidden = NO;
177-
178-
179176
}else{
180177
_myToolBar.hidden = NO;
181178
_myEditToolBar.hidden = YES;
182179

183180
EaseToolBarItem *item1 = [_myToolBar itemOfIndex:0];
184181
item1.enabled = [self canCreatNewFolder];
182+
EaseToolBarItem *item2 = [_myToolBar itemOfIndex:1];
183+
item2.enabled = [self canUploadNewFile];
185184
}
186185

187186
UIEdgeInsets contentInsets = UIEdgeInsetsMake(0.0, 0.0,CGRectGetHeight(_myToolBar.frame), 0.0);
@@ -190,7 +189,11 @@ - (void)configToolBar{
190189
}
191190

192191
- (BOOL)canCreatNewFolder{
193-
return (self.curFolder == nil || (self.curFolder.parent_id.intValue == 0 && self.curFolder.file_id.intValue != 0));
192+
return (self.curFolder == nil || (self.curFolder.parent_id.intValue == 0 && ![_curFolder isDefaultFolder] && ![_curFolder isShareFolder]));
193+
}
194+
195+
- (BOOL)canUploadNewFile{
196+
return ![self.curFolder isShareFolder];
194197
}
195198

196199
- (void)refresh{
@@ -565,7 +568,10 @@ - (NSArray *)rightButtonsWithObj:(id)obj{
565568
NSMutableArray *rightUtilityButtons = [NSMutableArray new];
566569
if ([obj isKindOfClass:[ProjectFolder class]]) {
567570
ProjectFolder *folder = (ProjectFolder *)obj;
568-
if (![folder isDefaultFolder]) {
571+
if (![folder isDefaultFolder] && ![folder isShareFolder]) {
572+
if (folder.sub_folders.count <= 0) {
573+
[rightUtilityButtons sw_addUtilityButtonWithColor:kColorDDD icon:[UIImage imageNamed:@"icon_file_cell_move"]];
574+
}
569575
[rightUtilityButtons sw_addUtilityButtonWithColor:[UIColor colorWithHexString:@"0xe6e6e6"] icon:[UIImage imageNamed:@"icon_file_cell_rename"]];
570576
[rightUtilityButtons sw_addUtilityButtonWithColor:kColorBrandRed icon:[UIImage imageNamed:@"icon_file_cell_delete"]];
571577
}
@@ -603,11 +609,13 @@ - (void)swipeableTableViewCell:(SWTableViewCell *)cell didTriggerRightUtilityBut
603609
NSIndexPath *indexPath = [self.myTableView indexPathForCell:cell];
604610
if (indexPath.row < _curFolder.sub_folders.count && indexPath.row >= _uploadFiles.count) {
605611
ProjectFolder *folder = [_curFolder.sub_folders objectAtIndex:indexPath.row - _uploadFiles.count];
606-
if (index == 0) {
612+
NSInteger buttonCount = cell.rightUtilityButtons.count;
613+
if (index == buttonCount - 3) {//移动
614+
[self moveFolder:folder fromFolder:self.curFolder];
615+
}else if (index == buttonCount - 2) {//重命名
607616
[self renameFolder:folder];
608-
}else{
617+
}else{//删除
609618
__weak typeof(self) weakSelf = self;
610-
611619
UIActionSheet *actionSheet = [UIActionSheet bk_actionSheetCustomWithTitle:[NSString stringWithFormat:@"确定要删除文件夹:%@",folder.name] buttonTitles:nil destructiveTitle:@"确认删除" cancelTitle:@"取消" andDidDismissBlock:^(UIActionSheet *sheet, NSInteger index) {
612620
if (index == 0) {
613621
[weakSelf deleteFolder:folder];
@@ -757,13 +765,35 @@ - (void)moveFiles:(NSArray *)files fromFolder:(ProjectFolder *)folder{
757765
}
758766
__weak typeof(self) weakSelf = self;
759767
FolderToMoveViewController *vc = [[FolderToMoveViewController alloc] init];
760-
vc.toMovedFileIdList = fileIdList;
768+
vc.fromFolder = folder;
769+
vc.toMovedIdList = fileIdList;
770+
vc.curProject = self.curProject;
771+
vc.rootFolders = self.rootFolders;
772+
vc.curFolder = nil;
773+
vc.moveToFolderBlock = ^(ProjectFolder *curFolder, NSArray *toMovedIdList){
774+
[weakSelf changeEditStateToEditing:NO];
775+
[[Coding_NetAPIManager sharedManager] request_MoveFiles:toMovedIdList toFolder:curFolder andBlock:^(id data, NSError *error) {
776+
if (data) {
777+
[weakSelf refreshRootFolders];
778+
}
779+
}];
780+
};
781+
UINavigationController *nav = [[BaseNavigationController alloc] initWithRootViewController:vc];
782+
[self presentViewController:nav animated:YES completion:nil];
783+
}
784+
785+
- (void)moveFolder:(ProjectFolder *)movedFolder fromFolder:(ProjectFolder *)folder{
786+
__weak typeof(self) weakSelf = self;
787+
FolderToMoveViewController *vc = [[FolderToMoveViewController alloc] init];
788+
vc.isMoveFolder = YES;
789+
vc.fromFolder = folder;
790+
vc.toMovedIdList = @[movedFolder.file_id];
761791
vc.curProject = self.curProject;
762792
vc.rootFolders = self.rootFolders;
763793
vc.curFolder = nil;
764-
vc.moveToFolderBlock = ^(ProjectFolder *curFolder, NSArray *toMovedFileIdList){
794+
vc.moveToFolderBlock = ^(ProjectFolder *curFolder, NSArray *toMovedIdList){
765795
[weakSelf changeEditStateToEditing:NO];
766-
[[Coding_NetAPIManager sharedManager] request_MoveFiles:toMovedFileIdList toFolder:curFolder andBlock:^(id data, NSError *error) {
796+
[[Coding_NetAPIManager sharedManager] request_MoveFolder:toMovedIdList.firstObject toFolder:curFolder inProject:weakSelf.curProject andBlock:^(id data, NSError *error) {
767797
if (data) {
768798
[weakSelf refreshRootFolders];
769799
}

Coding_iOS/Controllers/FileViewController.m

+6-6
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ - (void)goToEditFile{
314314
- (void)goToShareFileLink{
315315
__weak typeof(self) weakSelf = self;
316316
UIActionSheet *actionSheet;
317-
if (_curFile.share_url.length > 0) {
317+
if (_curFile.share) {
318318
actionSheet = [UIActionSheet bk_actionSheetCustomWithTitle:@"该链接适用于所有人,无需登录" buttonTitles:@[@"拷贝链接", @"关闭共享"] destructiveTitle:nil cancelTitle:@"取消" andDidDismissBlock:^(UIActionSheet *sheet, NSInteger index) {
319319
if (index == 0) {
320320
[weakSelf doCopyShareUrl];
@@ -333,8 +333,8 @@ - (void)goToShareFileLink{
333333
}
334334

335335
- (void)doCopyShareUrl{
336-
if (_curFile.share_url.length > 0) {
337-
[[UIPasteboard generalPasteboard] setString:_curFile.share_url];
336+
if (_curFile.share) {
337+
[[UIPasteboard generalPasteboard] setString:_curFile.share.url];
338338
[NSObject showHudTipStr:@"链接已拷贝到粘贴板"];
339339
}else{
340340
[NSObject showHudTipStr:@"文件还未打开共享"];
@@ -345,18 +345,18 @@ - (void)doOpenAndCopyShareUrl{
345345
__weak typeof(self) weakSelf = self;
346346
[[Coding_NetAPIManager sharedManager] request_OpenShareOfFile:_curFile andBlock:^(id data, NSError *error) {
347347
if (data) {
348-
weakSelf.curFile.share_url = data;
348+
weakSelf.curFile.share = [FileShare instanceWithUrl:data];
349349
[weakSelf doCopyShareUrl];
350350
}
351351
}];
352352
}
353353

354354
- (void)doCloseShareUrl{
355-
NSString *hashStr = [[_curFile.share_url componentsSeparatedByString:@"/"] lastObject];
355+
NSString *hashStr = [[_curFile.share.url componentsSeparatedByString:@"/"] lastObject];
356356
__weak typeof(self) weakSelf = self;
357357
[[Coding_NetAPIManager sharedManager] request_CloseShareHash:hashStr andBlock:^(id data, NSError *error) {
358358
if (data) {
359-
weakSelf.curFile.share_url = nil;
359+
weakSelf.curFile.share = nil;
360360
[NSObject showHudTipStr:@"共享链接已关闭"];
361361
}
362362
}];

0 commit comments

Comments
 (0)