|
|
@@ -265,7 +265,19 @@
|
|
|
|
|
|
- (void)didClickButtonFun:(UIButton*)but
|
|
|
{
|
|
|
+ NSInteger tag = but.tag;
|
|
|
|
|
|
+ if(tag == 1){
|
|
|
+ NSString *serUrl = @"http://192.168.12.253:8080/#/pages/fileSharing/index?token=";
|
|
|
+ NSString *shareUrl = [[NSString alloc] initWithFormat:@"%@%@",serUrl,_dataModel.token];
|
|
|
+
|
|
|
+ NSURL *URL = [NSURL URLWithString:shareUrl];
|
|
|
+ [[UIApplication sharedApplication] openURL:URL];
|
|
|
+
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ [self showCancelAlearViewFun];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- (void)viewWillAppear:(BOOL)animated
|
|
|
@@ -346,4 +358,54 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+#pragma mark 取消分享
|
|
|
+- (void)showCancelAlearViewFun
|
|
|
+{
|
|
|
+ NSString *tipStr = NSLocalizedString(@"cancel_share_Tip_msg",nil);
|
|
|
+
|
|
|
+ KWeakSelf
|
|
|
+ ComontAlretViewController *curAlretVC= [[ComontAlretViewController alloc] initWithTiTle:nil
|
|
|
+ msg:tipStr
|
|
|
+ imageStr:nil
|
|
|
+ cancelTitle:NSLocalizedString(@"other_cancel",nil)
|
|
|
+ okTitle:NSLocalizedString(@"other_confirm",nil) isOkBtnHighlight:YES
|
|
|
+ didClickOk:^{
|
|
|
+
|
|
|
+ [weakSelf cancelShareLinkFun];
|
|
|
+ } didClickCancel:^{
|
|
|
+
|
|
|
+ }];
|
|
|
+
|
|
|
+ curAlretVC.modalPresentationStyle = UIModalPresentationCustom;
|
|
|
+
|
|
|
+ [self presentViewController:curAlretVC animated:YES completion:^{
|
|
|
+ curAlretVC.view.superview.backgroundColor = [UIColor clearColor];
|
|
|
+ }];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)cancelShareLinkFun
|
|
|
+{
|
|
|
+ NSMutableDictionary *paraDict = [NSMutableDictionary new];
|
|
|
+ if(_dataModel.addShareId){
|
|
|
+ [paraDict setValue:_dataModel.addShareId forKey:@"id"];
|
|
|
+ }
|
|
|
+ [paraDict setValue:@1 forKey:@"expirationStatus"];
|
|
|
+
|
|
|
+ KWeakSelf
|
|
|
+ [self showNewIndicatorWithCanBack:NO canTouch:NO];
|
|
|
+ [[netWorkManager shareInstance] CommonPostCallBackCode:updateShareInfoFun Parameters:paraDict success:^(id _Nonnull responseObject) {
|
|
|
+ [weakSelf removeNewIndicator];
|
|
|
+ SuperModel *model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
|
|
|
+ if(model && model.code == 0){
|
|
|
+ [[iToast makeText:NSLocalizedString(@"cancel_share_suc_msg",nil)] show];
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ [[iToast makeText:NSLocalizedString(@"cancel_share_fail_msg",nil)] show];
|
|
|
+ }
|
|
|
+
|
|
|
+ } failure:^(NSError * _Nonnull error) {
|
|
|
+ [weakSelf removeNewIndicator];
|
|
|
+ [[iToast makeText:NSLocalizedString(@"cancel_share_fail_msg",nil)] show];
|
|
|
+ }];
|
|
|
+}
|
|
|
@end
|