DownFileViewController.m 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524
  1. //
  2. // DownFileViewController.m
  3. // smartRhino
  4. //
  5. // Created by tederen on 2019/11/8.
  6. // Copyright © 2019 tederen. All rights reserved.
  7. //
  8. #import "DownFileViewController.h"
  9. #import "NoteBookShareVC.h"
  10. #import "SendInfoGroupVC.h"
  11. #import "DrawerView.h"
  12. #import "TabBarController.h"
  13. #import "MyTDGroupViewController.h"
  14. #import "FavoritesViewController.h"
  15. #import "MyTDTopicViewController.h"
  16. #import <Social/Social.h>
  17. #import "MoveViewController.h"
  18. #import "ShareListVC.h"
  19. @interface DownFileViewController ()<WKNavigationDelegate,WKUIDelegate,NoteBookShareVCDelegate>
  20. //@property (nonatomic, strong) UIImageView *imagview;
  21. //@property (nonatomic, strong) UIView *labelView;
  22. @property (nonatomic, strong) UIView *myFooterView;
  23. @property (nonatomic, strong) TDButton *otherButton;
  24. @property (nonatomic, strong) TDButton *shareButton;
  25. @property (strong, nonatomic) NoteBookShareVC * noteBookShareVC;
  26. @property (nonatomic, strong) WKWebView *webView;
  27. @property (nonatomic, strong) DrawerView *drawerView;
  28. @property(nonatomic,strong) UIDocumentInteractionController *documentInteractionController;
  29. // 分割
  30. @property(nonatomic,strong) UIView *sepView;
  31. @property(nonatomic,strong) NSData *fileData;
  32. @end
  33. @implementation DownFileViewController
  34. - (void)viewDidLoad {
  35. [super viewDidLoad];
  36. [self.view addSubview:self.myFooterView];
  37. [self.myFooterView mas_makeConstraints:^(MASConstraintMaker *make) {
  38. make.left.right.mas_equalTo(self.view);
  39. make.height.mas_offset(50);
  40. if (@available(iOS 11.0, *)) {
  41. make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
  42. } else {
  43. make.bottom.equalTo(self.view.mas_bottom);
  44. }
  45. }];
  46. [self.view addSubview:self.sepView];
  47. [self.sepView mas_makeConstraints:^(MASConstraintMaker *make) {
  48. make.left.right.equalTo(self.view);
  49. make.bottom.equalTo(self.myFooterView.mas_top);
  50. make.height.mas_equalTo(6);
  51. }];
  52. [self.view layoutIfNeeded];
  53. [self.view addSubview:self.webView];
  54. [self.webView mas_makeConstraints:^(MASConstraintMaker *make) {
  55. make.left.right.mas_equalTo(self.view);
  56. make.top.mas_equalTo(self.myNavigationBar.mas_bottom);
  57. make.bottom.equalTo(self.sepView.mas_top);
  58. }];
  59. self.myNavigationBar.titleLabel.text = self.model.Title;
  60. [[UtilsTools getWindow] addSubview:self.noteBookShareVC.view];
  61. NSString * url = [self.model.Url stringByRemovingPercentEncoding];
  62. if ([url hasSuffix:@".txt"]) {
  63. NSString * body = [NSString stringWithContentsOfURL:[NSURL URLWithString:self.model.Url] encoding:NSUTF8StringEncoding error:nil];
  64. NSString* responseStr = [NSString stringWithFormat:
  65. @"<HTML>"
  66. "<head>"
  67. "<title>Text View</title>"
  68. "</head>"
  69. "<BODY>"
  70. "<pre>"
  71. "%@"
  72. "</pre>"
  73. "</BODY>"
  74. "</HTML>",
  75. body];
  76. [self.webView loadHTMLString:responseStr baseURL:nil];
  77. }else{
  78. [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.model.Url]]];
  79. }
  80. self.fileData = [NSData dataWithContentsOfURL:[NSURL URLWithString:url]];
  81. }
  82. - (void)openFileWithURL:(NSURL *)URL
  83. {
  84. NSLog(@"now open %@",URL);
  85. if (URL) {
  86. // Initialize Document Interaction Controller
  87. self.documentInteractionController = [UIDocumentInteractionController
  88. interactionControllerWithURL:URL];
  89. // Configure Document Interaction Controller
  90. self.documentInteractionController.delegate = self;
  91. // Preview File
  92. [self.documentInteractionController presentPreviewAnimated:YES];
  93. }
  94. }
  95. #pragma mark - button hander
  96. - (void)otherButtonHander{
  97. [self SystermOpenFile];
  98. // [self shareBtClick];
  99. }
  100. #pragma mark - Social 框架
  101. - (void)share3{
  102. // 判断服务是否可用
  103. [SLComposeViewController isAvailableForServiceType:SLServiceTypeSinaWeibo];
  104. if (![SLComposeViewController isAvailableForServiceType:SLServiceTypeSinaWeibo]) {
  105. NSLog(@"设置界面设置自己的账号");
  106. return;
  107. }
  108. // 弹出分享内容输入界面
  109. SLComposeViewController *cc = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeSinaWeibo];
  110. [cc setInitialText:@"测试文字"]; // 初始化文字
  111. [cc addImage:[UIImage imageNamed:@"zhujun"]]; // 配图
  112. cc.completionHandler = ^(SLComposeViewControllerResult reulst) {
  113. if (reulst == SLComposeViewControllerResultDone) {
  114. NSLog(@"用户发送成功");
  115. } else {
  116. NSLog(@"用户发送失败");
  117. }
  118. };
  119. [self presentViewController:cc animated:YES completion:nil];
  120. // 额外设置
  121. }
  122. - (void)shareBtClick
  123. {
  124. NSString *textToShare = @"同岑";
  125. UIImage *imageToShare = [UIImage imageNamed:@"AppIcon"];
  126. NSURL *urlToShare = [NSURL URLWithString:self.model.Url];
  127. // 分享的图片不能为空
  128. NSArray *activityItems = @[textToShare, imageToShare, urlToShare];
  129. UIActivityViewController *activityVC = [[UIActivityViewController alloc]initWithActivityItems:activityItems applicationActivities:nil];
  130. // 排除(UIActivityTypeAirDrop)AirDrop 共享、(UIActivityTypePostToFacebook)Facebook
  131. activityVC.excludedActivityTypes = @[UIActivityTypePostToFacebook, UIActivityTypeAirDrop];
  132. [self presentViewController:activityVC animated:YES completion:nil];
  133. // 通过block接收结果处理
  134. UIActivityViewControllerCompletionWithItemsHandler completionHandler = ^(UIActivityType __nullable activityType, BOOL completed, NSArray * __nullable returnedItems, NSError * __nullable activityError){
  135. if (completed) {
  136. // [self showAlertViewWithMsg:@"恭喜你,分享成功!"];
  137. }else{
  138. // [self showAlertViewWithMsg:@"很遗憾,分享失败!"];
  139. }
  140. };
  141. activityVC.completionWithItemsHandler = completionHandler;
  142. }
  143. #pragma mark - 调用系统其他app 打开文件
  144. - (void)SystermOpenFile{
  145. WS(weakSelf);
  146. NSURL *url = [NSURL URLWithString:self.model.Url];
  147. NSURLRequest *request = [NSURLRequest requestWithURL:url];
  148. AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
  149. NSURLSessionDownloadTask *downloadTask = [manager downloadTaskWithRequest:request progress:^(NSProgress * _Nonnull downloadProgress) {
  150. NSLog(@"下载进度:%.0f%", downloadProgress.fractionCompleted * 100);
  151. } destination:^NSURL * _Nonnull(NSURL * _Nonnull targetPath, NSURLResponse * _Nonnull response) {
  152. NSString *downloadPath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject];
  153. //打开文件管理器
  154. NSFileManager *fileManager = [NSFileManager defaultManager];
  155. //创建Download目录
  156. [fileManager createDirectoryAtPath:downloadPath withIntermediateDirectories:YES attributes:nil error:nil];
  157. //拼接文件路径
  158. NSString *filePath = [downloadPath stringByAppendingPathComponent:response.suggestedFilename];
  159. //返回文件位置的URL路径
  160. dispatch_async(dispatch_get_main_queue(), ^{
  161. weakSelf.documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:filePath]];
  162. [weakSelf.documentInteractionController setDelegate:weakSelf];
  163. [weakSelf.documentInteractionController presentOpenInMenuFromRect:CGRectZero inView:weakSelf.view animated:YES];
  164. });
  165. return [NSURL fileURLWithPath:filePath];
  166. } completionHandler:^(NSURLResponse * _Nonnull response, NSURL * _Nullable filePath, NSError * _Nullable error) {
  167. NSLog(@"下载完成");
  168. }];
  169. [downloadTask resume];
  170. }
  171. #pragma mark - 调用系统 打开文件分享文件
  172. - (void)systermShare{
  173. NSString *shareTitle = @"分享的标题";
  174. UIImage *shareImage = [UIImage imageNamed:@"me"];
  175. NSURL *shareUrl = [NSURL URLWithString:@"https://www.jianshu.com/u/acdcce712303"];
  176. NSArray *activityItems = @[shareTitle,
  177. shareImage,
  178. shareUrl]; // 必须要提供url 才会显示分享标签否则只显示图片
  179. UIActivityViewController *activityVC = [[UIActivityViewController alloc]
  180. initWithActivityItems:activityItems
  181. applicationActivities:nil];
  182. activityVC.excludedActivityTypes = [self excludetypes];
  183. activityVC.completionWithItemsHandler = ^(UIActivityType _Nullable activityType,
  184. BOOL completed,
  185. NSArray * _Nullable returnedItems,
  186. NSError * _Nullable activityError) {
  187. NSLog(@"activityType: %@,\n completed: %d,\n returnedItems:%@,\n activityError:%@",activityType,completed,returnedItems,activityError);
  188. };
  189. [self presentViewController:activityVC animated:YES completion:nil];
  190. }
  191. -(NSArray *)excludetypes{
  192. NSMutableArray *excludeTypesM = [NSMutableArray arrayWithArray:@[//UIActivityTypePostToFacebook,
  193. UIActivityTypePostToTwitter,
  194. UIActivityTypePostToWeibo,
  195. UIActivityTypeMessage,
  196. UIActivityTypeMail,
  197. UIActivityTypePrint,
  198. UIActivityTypeCopyToPasteboard,
  199. UIActivityTypeAssignToContact,
  200. UIActivityTypeSaveToCameraRoll,
  201. UIActivityTypeAddToReadingList,
  202. UIActivityTypePostToFlickr,
  203. UIActivityTypePostToVimeo,
  204. UIActivityTypePostToTencentWeibo,
  205. UIActivityTypeAirDrop,
  206. UIActivityTypeOpenInIBooks]];
  207. if ([[UIDevice currentDevice].systemVersion floatValue] >= 11.0) {
  208. if (@available(iOS 11.0, *)) {
  209. [excludeTypesM addObject:UIActivityTypeMarkupAsPDF];
  210. } else {
  211. // Fallback on earlier versions
  212. }
  213. }
  214. return excludeTypesM;
  215. }
  216. - (void)backButtonAction2:(UIButton *)sender {
  217. [self secondBarButtonItems];
  218. }
  219. - (void)secondBarButtonItems{
  220. [[UtilsTools getWindow] addSubview:self.drawerView];
  221. WS(weakSelf);
  222. self.drawerView.SelectDrawerBlock = ^(NSIndexPath * _Nonnull indexPath) {
  223. if ([weakSelf.navigationController.viewControllers count] > 1) {
  224. [weakSelf.navigationController popToRootViewControllerAnimated:NO];
  225. }
  226. if (indexPath.section == 0) {
  227. [[TabBarController sharedTabBarController] setSelectedIndex:indexPath.row];
  228. }else{
  229. ///@"站内信", @"通知", @"收藏",@"笔记", @"设置"
  230. switch (indexPath.row) {
  231. case 0:
  232. {
  233. [[TabBarController sharedTabBarController] setSelectedIndex:2];
  234. }
  235. break;
  236. case 1:
  237. {
  238. [[TabBarController sharedTabBarController] setSelectedIndex:2];
  239. }
  240. break;
  241. default:
  242. {
  243. [[TabBarController sharedTabBarController] setSelectedIndex:3];
  244. }
  245. break;
  246. }
  247. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  248. [[NSNotificationCenter defaultCenter] postNotificationName:DRAWERPUSHVC object:nil userInfo:@{VCINDEX:@(indexPath.row)}];
  249. });
  250. }
  251. };
  252. self.drawerView.frame = CGRectMake(0,0, SCREEN_WIDTH, SCREEN_HEIGHT);
  253. }
  254. - (DrawerView *)drawerView {
  255. if(!_drawerView) {
  256. _drawerView = [[DrawerView alloc] init];
  257. }
  258. return _drawerView;
  259. }
  260. - (TDButton *)otherButton{
  261. if (!_otherButton) {
  262. _otherButton = [[TDButton alloc]init];
  263. [_otherButton setTitle:@"其他应用打开" forState:UIControlStateNormal];
  264. [_otherButton setTitleColor:UIColorHex(666666) forState:UIControlStateNormal];
  265. [_otherButton setImage:IMG(@"更多") forState:UIControlStateNormal];
  266. [_otherButton addTarget:self action:@selector(otherButtonHander) forControlEvents:UIControlEventTouchUpInside];
  267. [[_otherButton titleLabel] setFont:[UIFont systemFontOfSize:15]];
  268. [_otherButton layoutButtonWithEdgeInsetsStyle:GLButtonEdgeInsetsStyleTop imageTitleSpace:5];
  269. }
  270. return _otherButton;
  271. }
  272. - (TDButton *)shareButton{
  273. if (!_shareButton) {
  274. _shareButton = [[TDButton alloc]init];
  275. [_shareButton setTitle:@"转发" forState:UIControlStateNormal];
  276. [_shareButton setTitleColor:UIColorHex(666666) forState:UIControlStateNormal];
  277. [_shareButton setImage:IMG(@"转发") forState:UIControlStateNormal];
  278. [[_shareButton titleLabel] setFont:[UIFont systemFontOfSize:15]];
  279. [_shareButton addTarget:self action:@selector(shareButtonHander) forControlEvents:UIControlEventTouchUpInside];
  280. [_shareButton layoutButtonWithEdgeInsetsStyle:GLButtonEdgeInsetsStyleTop imageTitleSpace:10];
  281. }
  282. return _shareButton;
  283. }
  284. - (UIView *)myFooterView{
  285. if(!_myFooterView){
  286. _myFooterView = [UIView new];
  287. [_myFooterView addSubview:self.otherButton];
  288. [_myFooterView addSubview:self.shareButton];
  289. [self.otherButton mas_makeConstraints:^(MASConstraintMaker *make) {
  290. make.left.equalTo(self.myFooterView).offset(40);
  291. make.centerY.equalTo(self.myFooterView);
  292. make.width.mas_equalTo(120);
  293. make.height.mas_equalTo(50);
  294. }];
  295. [self.shareButton mas_makeConstraints:^(MASConstraintMaker *make) {
  296. make.right.equalTo(self.myFooterView).offset(-20);
  297. make.centerY.equalTo(self.myFooterView);
  298. make.width.mas_equalTo(120);
  299. make.height.mas_equalTo(50);
  300. }];
  301. }
  302. return _myFooterView;
  303. }
  304. - (WKWebView *)webView {
  305. if (!_webView) {
  306. // 进行配置控制器
  307. WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc] init];
  308. // 实例化对象
  309. configuration.userContentController = [WKUserContentController new];
  310. // 调用JS方法
  311. // [configuration.userContentController addScriptMessageHandler:self name:@"uploadPersonImage"];
  312. //window.webkit.messageHandlers.uploadPersonImage.postMessage({body: 'goodsId=1212'}); js调用
  313. // 进行偏好设置
  314. WKPreferences *preferences = [WKPreferences new];
  315. preferences.javaScriptEnabled = YES;
  316. preferences.javaScriptCanOpenWindowsAutomatically = YES;
  317. preferences.minimumFontSize = 40.0;
  318. configuration.preferences = preferences;
  319. _webView = [[WKWebView alloc] init];
  320. // _webView = [[WKWebView alloc] initWithFrame:CGRectMake(0,kNavigationHeight,kGXScreenWidth,kGXScreenHeigh - kNavigationHeight - 71 - self.sepView.height) configuration:configuration];
  321. _webView.navigationDelegate = self;
  322. _webView.opaque = NO;
  323. // _webView.backgroundColor = [UIColor whiteColor];
  324. if (@available(ios 11.0,*)){ _webView.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;}
  325. }
  326. return _webView;
  327. }
  328. // 页面开始加载时调用
  329. -(void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation{
  330. SHOWLOADING
  331. }
  332. // 当内容开始返回时调用
  333. - (void)webView:(WKWebView *)webView didCommitNavigation:(WKNavigation *)navigation{
  334. REMOVESHOW
  335. }
  336. // 页面加载完成之后调用
  337. - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation{//这里修改导航栏的标题,动态改变
  338. REMOVESHOW
  339. }
  340. // 页面加载失败时调用
  341. - (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation{
  342. [webView reload];
  343. }
  344. -(UIView *)sepView {
  345. if (!_sepView) {
  346. _sepView = [UIView new];
  347. _sepView.backgroundColor = kColorFromRGB(0xeeeeee);
  348. }
  349. return _sepView;
  350. }
  351. #pragma mark -转发
  352. - (void)shareButtonHander{
  353. [self.noteBookShareVC initNoteBookShareData];
  354. self.noteBookShareVC.view.hidden = !self.noteBookShareVC.view.hidden;
  355. }
  356. - (NoteBookShareVC *)noteBookShareVC{
  357. if (_noteBookShareVC == nil) {
  358. _noteBookShareVC = [NoteBookShareVC initNoteBookShareVC];
  359. [_noteBookShareVC.view setHidden:YES];
  360. _noteBookShareVC.delegate = self;
  361. }
  362. return _noteBookShareVC;
  363. }
  364. -(void)userSelectType:(NSString *)typeName WithIndexPath:(NSIndexPath *)indexPath{
  365. self.noteBookShareVC.view.hidden = !self.noteBookShareVC.view.hidden;
  366. if ([typeName isEqualToString:@"发给微信好友"]) {
  367. [self returnToWechatSession];
  368. }else if ([typeName isEqualToString:@"发到朋友圈"]){
  369. [self returnToWechatTimeLine];
  370. }else if ([typeName isEqualToString:@"发到微博"]){
  371. [self returnToSina];
  372. }else if ([typeName isEqualToString:@"发给QQ好友"]){
  373. [self returnToQQ];
  374. }else if ([typeName isEqualToString:@"发到消息"]){
  375. [self returnToMessage];
  376. }else if ([typeName isEqualToString:@"发到小组"]){
  377. [self returnToGroup];
  378. }else if ([typeName isEqualToString:@"发到笔记"]){
  379. [self returnToNote];
  380. }else if ([typeName isEqualToString:@"发到话题"]){
  381. [self returnToTopic];
  382. }else{
  383. }
  384. }
  385. - (void)returnToWechatSession
  386. {
  387. if (self.fileData) {
  388. [self shareWebPageToPlatformType:UMSocialPlatformType_WechatSession];
  389. }else{
  390. SHOWERROR(@"文件下载中");
  391. }
  392. }
  393. - (void)returnToWechatTimeLine
  394. {
  395. if (self.fileData) {
  396. [self shareWebPageToPlatformType:UMSocialPlatformType_WechatTimeLine];
  397. }else{
  398. SHOWERROR(@"文件下载中");
  399. }
  400. }
  401. - (void)returnToSina
  402. {
  403. if (self.fileData) {
  404. [self shareWebPageToPlatformType:UMSocialPlatformType_Sina];
  405. }else{
  406. SHOWERROR(@"文件下载中");
  407. }
  408. }
  409. - (void)returnToQQ
  410. {
  411. if (self.fileData) {
  412. [self shareWebPageToPlatformType:UMSocialPlatformType_QQ];
  413. }else{
  414. SHOWERROR(@"文件下载中");
  415. }
  416. }
  417. - (void)shareWebPageToPlatformType:(UMSocialPlatformType)platformType
  418. {
  419. //创建分享消息对象
  420. UMSocialMessageObject *messageObject = [UMSocialMessageObject messageObject];
  421. messageObject.title = self.model.Title;
  422. //创建文件内容对象
  423. UMShareFileObject * fileObject = [UMShareFileObject shareObjectWithTitle:self.model.Title descr:@"" thumImage:[UIImage imageNamed:[ZYCTool getFileNameImage:self.model.Url]]];
  424. fileObject.fileData = self.fileData;
  425. fileObject.fileExtension = [self.model.Url pathExtension];
  426. //分享消息对象设置分享内容对象
  427. messageObject.shareObject = fileObject;
  428. //调用分享接口
  429. [[UMSocialManager defaultManager] shareToPlatform:platformType messageObject:messageObject currentViewController:self completion:^(id data, NSError *error) {
  430. if (error) {
  431. SHOWERROR([ZYCTool handerResultData:error]);
  432. NSLog(@"************Share fail with error %@*********",error);
  433. }else{
  434. NSLog(@"response data is %@",data);
  435. }
  436. }];
  437. }
  438. - (void)returnToMessage
  439. {
  440. ShareListVC * vc = [ShareListVC initShareListVC];
  441. FlowAttachmentsModel * fModel = self.model;
  442. if (fModel.SoureTypeId != 301) {
  443. fModel.MinUrl = @"";
  444. }
  445. vc.sendModel = fModel;
  446. vc.isReturn = YES;
  447. [self.navigationController pushViewController:vc animated:YES];
  448. }
  449. - (void)returnToGroup
  450. {
  451. MyTDGroupViewController * vc = [[MyTDGroupViewController alloc] init];
  452. vc.type = CollectModel_Group;
  453. FlowAttachmentsModel * fModel = self.model;
  454. if (fModel.SoureTypeId != 301) {
  455. fModel.MinUrl = @"";
  456. }
  457. vc.sendModel = fModel;
  458. vc.isReturn = YES;
  459. [self.navigationController pushViewController:vc animated:YES];
  460. }
  461. - (void)returnToNote
  462. {
  463. MyTDTopicCreateVC * vc = [MyTDTopicCreateVC initMyTDTopicCreateVC];
  464. vc.type = CollectModel_NoteBook;
  465. FlowAttachmentsModel * fModel = self.model;
  466. if (fModel.SoureTypeId != 301) {
  467. fModel.MinUrl = @"";
  468. }
  469. vc.sendModel = fModel;
  470. vc.isReturn = YES;
  471. [self.navigationController pushViewController:vc animated:YES];
  472. }
  473. - (void)returnToTopic
  474. {
  475. MyTDTopicCreateVC * vc = [MyTDTopicCreateVC initMyTDTopicCreateVC];
  476. vc.type = CollectModel_NewTopic;
  477. FlowAttachmentsModel * fModel = self.model;
  478. if (fModel.SoureTypeId != 301) {
  479. fModel.MinUrl = @"";
  480. }
  481. vc.sendModel = fModel;
  482. vc.isReturn = YES;
  483. [self.navigationController pushViewController:vc animated:YES];
  484. }
  485. @end