AchievementsdetailViewController.m 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. //
  2. // AchievementsdetailViewController.m
  3. // jitao
  4. //
  5. // Created by 罗云飞 on 2017/12/16.
  6. // Copyright © 2017年 罗云飞. All rights reserved.
  7. //
  8. #import "AchievementsdetailViewController.h"
  9. #import "AchievementsdetailCell.h"
  10. #import "ZZCarousel.h"
  11. #import "RequirementdescriptionCell.h"
  12. #import "ResultsDetailsModel.h"
  13. #import "CGPurchaseintentionViewController.h"
  14. #import "YBPopupMenu.h"
  15. #import "MyattentionViewController.h"
  16. #import "MyOrderViewController.h"
  17. #import "AchievementsReleaseViewController.h"
  18. #import "ReleaserequirementsViewController.h"
  19. #define TITLES @[@"我的关注", @"我的订单",@"发布成果",@"发布需求"]
  20. #define ICONS @[@"wdgz",@"wddd",@"fbcg",@"fbxq"]
  21. @interface AchievementsdetailViewController ()<ZZCarouselDelegate,UITableViewDelegate,UITableViewDataSource,YBPopupMenuDelegate>{
  22. UITableView *newtableView;
  23. NSMutableArray *dataArray;
  24. ZZCarousel *_headwheel;//广告图
  25. NSMutableArray *_headwheelArray;
  26. NSMutableArray *ResultsDetailArray;
  27. UIButton *followBT;
  28. }
  29. @property (strong ,nonatomic) UIButton * registerAccount;
  30. @end
  31. @implementation AchievementsdetailViewController
  32. - (void)viewDidLoad {
  33. [super viewDidLoad];
  34. [self setNavTitle:@"成果详情"];
  35. [self dataInitialization];
  36. [self resultsDetailsNetworkrequest];
  37. [self loadsView];
  38. // Do any additional setup after loading the view.
  39. }
  40. #pragma mark ---------成果详情关注网络请求-------
  41. - (void)followBTclick:(UIButton *)sender {
  42. if ([UserHelper isLogin]) {
  43. NSLog(@"%@",@"已登录");
  44. NSMutableDictionary *parameters = NewMutableDictionaryInit;
  45. // [parameters safeSetObject:[UserEntity sharedInstance].token forKey:@"uid"];
  46. /*
  47. 0-成果 1-需求 2-专家 3-政策 4-活动 5-其他
  48. */
  49. [parameters safeSetObject:@"0" forKey:@"type"];
  50. ResultsDetailsModel *model = ResultsDetailArray[0];
  51. [parameters safeSetObject:model.ID forKey:@"objectId"];
  52. //model.interest 0未关注 1已关注
  53. [parameters safeSetObject:model.interest forKey:@"interest"];
  54. [NetworkRequestManager requestGetWithInterfacePrefix:JT_interestAdd parameters:parameters onSuccess:^(id requestData) {
  55. [MBProgressHUD hideHUDForView:self.view];
  56. NSLog(@"服务器返回数据:%@",requestData);
  57. if ([requestData[@"error"] count] !=0) {
  58. for (NSDictionary *dic in requestData[@"error"]) {
  59. [MBProgressHUD showError:dic[@"message"] toView:self.view];
  60. }
  61. }else{
  62. if ([requestData[@"data"] isEqualToString:@"取消关注成功"]) {
  63. ResultsDetailsModel *model = ResultsDetailArray[0];
  64. NSInteger follownumber = [model.countInterest integerValue]-1;
  65. model.countInterest = [NSString stringWithFormat:@"%ld",follownumber];
  66. model.interest = @"0";
  67. [ResultsDetailArray removeAllObjects];
  68. [ResultsDetailArray addObject:model];
  69. [followBT setImage:[UIImage imageNamed:@"未关注"] forState:UIControlStateNormal];
  70. [MBProgressHUD showSuccess:@"哎呀,您取消关注啦!" toView:self.view];
  71. [newtableView reloadData];
  72. }else{
  73. ResultsDetailsModel *model = ResultsDetailArray[0];
  74. NSInteger follownumber = [model.countInterest integerValue]+1;
  75. model.countInterest = [NSString stringWithFormat:@"%ld",follownumber];
  76. model.interest = @"1";
  77. [ResultsDetailArray removeAllObjects];
  78. [ResultsDetailArray addObject:model];
  79. [followBT setImage:[UIImage imageNamed:@"已关注"] forState:UIControlStateNormal];
  80. [MBProgressHUD showSuccess:@"哎呀,您关注成功啦!" toView:self.view];
  81. [newtableView reloadData];
  82. }
  83. }
  84. } onFailure:^{
  85. [MBProgressHUD hideHUDForView:self.view];
  86. }];
  87. }else{
  88. NSLog(@"%@",@"未登录");
  89. NewLoginViewController *vc = [[NewLoginViewController alloc] init];
  90. [vc setLoginSuccess:^(NSString *string) {
  91. [self resultsDetailsNetworkrequest];
  92. NewPopViewController;
  93. }];
  94. NewPushViewController(vc);
  95. }
  96. }
  97. #pragma mark -------成果详情网络请求--------
  98. - (void)resultsDetailsNetworkrequest {
  99. [MBProgressHUD showLoadToView:self.view title:@"请稍后..."];
  100. NSMutableDictionary *parameters = NewMutableDictionaryInit;
  101. [parameters safeSetObject:_ID forKey:@"id"];
  102. [NetworkRequestManager requestGetWithInterfacePrefix:JT_achievementDetail parameters:parameters onSuccess:^(id requestData) {
  103. [MBProgressHUD hideHUDForView:self.view];
  104. NSLog(@"服务器返回数据:%@",requestData);
  105. if ([requestData[@"error"] count] !=0) {
  106. for (NSDictionary *dic in requestData[@"error"]) {
  107. [MBProgressHUD showError:dic[@"message"] toView:self.view];
  108. }
  109. }else{
  110. ResultsDetailsModel *model = [[ResultsDetailsModel alloc] initWithDictionary:requestData[@"data"] error:nil];
  111. [ResultsDetailArray addObject:model];
  112. if (model.technicalPictureUrls.count>0) {
  113. _headwheelArray = model.technicalPictureUrls;
  114. }else{
  115. [_headwheelArray addObject:@"ty"];
  116. }
  117. if ([model.interest isEqualToString:@"1"]) {
  118. [followBT setImage:[UIImage imageNamed:@"已关注"] forState:UIControlStateNormal];
  119. }else if([model.interest isEqualToString:@"0"]){
  120. [followBT setImage:[UIImage imageNamed:@"未关注"] forState:UIControlStateNormal];
  121. }
  122. [newtableView reloadData];
  123. [_headwheel reloadData];
  124. }
  125. } onFailure:^{
  126. [MBProgressHUD hideHUDForView:self.view];
  127. }];
  128. }
  129. - (void)dataInitialization {
  130. dataArray = NewMutableArrayInit;
  131. ResultsDetailArray = NewMutableArrayInit;
  132. [dataArray addObject:@"1"];
  133. [dataArray addObject:@"1"];
  134. _headwheelArray = [NSMutableArray array];
  135. }
  136. #pragma mark -----------提交购买意向--------
  137. - (void)submissionpurchaseclick:(UIButton *)sender {
  138. if ([UserHelper isLogin]) {
  139. NSLog(@"%@",@"已登录");
  140. ResultsDetailsModel *model = ResultsDetailArray[0];
  141. CGPurchaseintentionViewController *vc = [[CGPurchaseintentionViewController alloc] init];
  142. vc.ID = model.ID;
  143. vc.commodityType = @"1";
  144. NewPushViewController(vc);
  145. }else{
  146. NSLog(@"%@",@"未登录");
  147. NewLoginViewController *vc = [[NewLoginViewController alloc] init];
  148. [vc setLoginSuccess:^(NSString *string) {
  149. [self resultsDetailsNetworkrequest];
  150. NewPopViewController;
  151. }];
  152. NewPushViewController(vc);
  153. }
  154. }
  155. #pragma mark ----加载界面
  156. - (void)loadsView{
  157. [self.navgationBar addSubview:self.registerAccount];
  158. _registerAccount.sd_layout
  159. .widthIs(30)
  160. .rightSpaceToView(self.navgationBar, 10)
  161. .heightIs(44)
  162. .topSpaceToView(self.navgationBar, 18);
  163. [self.view addSubview:newtableView = [NewControlPackage tableViewInitWithFrame:CGRectMake(0, NavHeader, SCREEN_WIDTH, SCREEN_HEIGHT-NavHeader-44) backgroundColor:NewGroupTableViewBackgroundColor style:1 delegate:self dataSource:self showsHorizontalScrollIndicator:NO showsVerticalScrollIndicator:NO hidden:NO tag:100 userInteractionEnabled:YES]];
  164. newtableView.separatorStyle = NO;
  165. UIView *view = [UIView new];
  166. view.backgroundColor = NewWhiteColor;
  167. [self.view addSubview:view];
  168. view.sd_layout
  169. .bottomEqualToView(self.view)
  170. .heightIs(44)
  171. .widthIs(SCREEN_WIDTH);
  172. followBT = [UIButton new];
  173. followBT.backgroundColor = NewClearColor;
  174. NewTouchUpInside(followBT, followBTclick:);
  175. [view addSubview:followBT];
  176. followBT.sd_layout
  177. .leftEqualToView(view)
  178. .heightIs(44)
  179. .topEqualToView(view)
  180. .widthIs(44);
  181. UIButton *submissionpurchase = [UIButton new];
  182. [submissionpurchase setTitle:@"提交购买意向" forState:UIControlStateNormal];
  183. [submissionpurchase setTitleColor:NewWhiteColor forState:UIControlStateNormal];
  184. submissionpurchase.titleLabel.font = NewFont(15);
  185. submissionpurchase.titleLabel.textAlignment = NSTextAlignmentCenter;
  186. submissionpurchase.backgroundColor = NewRGBColor(252, 133, 52, 1);
  187. NewTouchUpInside(submissionpurchase, submissionpurchaseclick:);
  188. [view addSubview:submissionpurchase];
  189. submissionpurchase.sd_layout
  190. .rightEqualToView(view)
  191. .heightIs(44)
  192. .widthIs(fitScreenWidth(121));
  193. UIButton *negotiate = [UIButton new];
  194. [negotiate setTitle:@"洽 谈" forState:UIControlStateNormal];
  195. [negotiate setTitleColor:NewWhiteColor forState:UIControlStateNormal];
  196. negotiate.titleLabel.font = NewFont(15);
  197. negotiate.titleLabel.textAlignment = NSTextAlignmentCenter;
  198. negotiate.backgroundColor = NewButtonColor;
  199. NewTouchUpInside(negotiate, negotiateclick:);
  200. [view addSubview:negotiate];
  201. negotiate.sd_layout
  202. .rightSpaceToView(submissionpurchase, 1)
  203. .heightIs(44)
  204. .widthIs(fitScreenWidth(121));
  205. }
  206. #pragma mark-------------------------UITableView------------------------------------
  207. -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  208. {
  209. return 1;
  210. }
  211. //返回每段行数
  212. -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  213. {
  214. return dataArray.count;
  215. }
  216. -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  217. {
  218. static NSString *Cell = @"Cell";
  219. static NSString *Cell1 = @"Cell1";
  220. if (indexPath.row == 0) {
  221. AchievementsdetailCell * cell = [tableView dequeueReusableCellWithIdentifier:Cell];
  222. if (cell == nil) {
  223. cell = [[AchievementsdetailCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:Cell];
  224. }
  225. [cell setSelectionStyle:UITableViewCellSelectionStyleNone];//(这种是没有点击后的阴影效果)
  226. cell.accessoryType = UITableViewCellAccessoryNone;
  227. if (ResultsDetailArray.count>0) {
  228. [cell assignment:ResultsDetailArray[indexPath.row]];
  229. }
  230. return cell;
  231. }else if (indexPath.row == 1){
  232. RequirementdescriptionCell * cell = [tableView dequeueReusableCellWithIdentifier:Cell1];
  233. if (cell == nil) {
  234. cell = [[RequirementdescriptionCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:Cell1];
  235. }
  236. [cell setSelectionStyle:UITableViewCellSelectionStyleNone];//(这种是没有点击后的阴影效果)
  237. cell.accessoryType = UITableViewCellAccessoryNone;
  238. if (ResultsDetailArray.count>0) {
  239. cell.title.text = @"成果描述";
  240. [cell assignment:ResultsDetailArray[0]];
  241. }
  242. return cell;
  243. }
  244. return [[UITableViewCell alloc] init];
  245. }
  246. -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
  247. {
  248. if (indexPath.row == 0) {
  249. return 240;
  250. }else{
  251. if (ResultsDetailArray.count>0) {
  252. ResultsDetailsModel *model = ResultsDetailArray[0];
  253. if (model.introduction == NULL) {
  254. model.introduction = @"暂无成果描述";
  255. }
  256. CGFloat height = [NewUtils heightforString:model.introduction andWidth:SCREEN_WIDTH-30 fontSize:fitScreenWidth(13)];
  257. return height+70;
  258. }
  259. return 0;
  260. }
  261. }
  262. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  263. }
  264. - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
  265. return CGFLOAT_MIN;
  266. }
  267. - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
  268. return homeHeadImageHEIGHT;
  269. }
  270. - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
  271. if (!_headwheel) {
  272. _headwheel = nil;
  273. //创建轮播图
  274. _headwheel = [self headViewwheel:500];
  275. [_headwheel reloadData];
  276. }
  277. return _headwheel;
  278. }
  279. - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
  280. return [[UIView alloc] init];
  281. }
  282. #pragma mark-------------------------ZZCarousel轮播图片----------------------------------
  283. -(ZZCarousel*)headViewwheel:(NSInteger)tag
  284. {
  285. //self.navigationController.navigationBar.frame.size.height (SCREEN_WIDTH * 500 ) / 1080
  286. ZZCarousel* wheel = [[ZZCarousel alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH,homeHeadImageHEIGHT)];
  287. wheel.tag = tag;
  288. /*
  289. * carouseScrollTimeInterval --- 此属性为设置轮播多长时间滚动到下一张
  290. */
  291. wheel.carouseScrollTimeInterval = CarouselTime;
  292. // 代理
  293. wheel.delegate = self;
  294. /*
  295. * isAutoScroll --- 默认为NO,当为YES时 才能使轮播进行滚动
  296. */
  297. wheel.isAutoScroll = YES;
  298. /*
  299. * pageType --- 设置轮播样式 默认为系统样式。ZZCarousel 中封装了 两种样式,另外一种为数字样式
  300. */
  301. wheel.pageType = ZZCarouselPageTypeOfNone;
  302. /*
  303. * 设置UIPageControl 在轮播中的位置、系统默认的UIPageControl 的顶层颜色 和底层颜色已经背景颜色
  304. */
  305. if(wheel.tag == 500) {
  306. wheel.pageControlFrame = CGRectMake((SCREEN_WIDTH - 60 ) / 2, wheel.frame.size.height - 10, 60, 5);
  307. wheel.pageIndicatorTintColor = [UIColor whiteColor];
  308. wheel.currentPageIndicatorTintColor = NewRGBColor(191, 191, 191, 1);
  309. wheel.pageControlBackGroundColor = [UIColor whiteColor];
  310. /*
  311. * 设置数字样式的 UIPageControl 中的字体和字体颜色。 背景颜色仍然按照上面pageControlBackGroundColor属性来设置
  312. */
  313. wheel.pageControlOfNumberFont = [UIFont fontWithName:@"Helvetica-Bold" size:18];
  314. wheel.pageContolOfNumberFontColor = [UIColor whiteColor];
  315. }
  316. return wheel;
  317. }
  318. //ZZCarouselDelegate 轮播图片代理方法
  319. -(NSInteger)numberOfZZCarousel:(ZZCarousel *)wheel
  320. {
  321. return _headwheelArray.count;
  322. }
  323. //图片赋值
  324. -(ZZCarouselView *)zzcarousel:(UICollectionView *)zzcarousel viewForItemAtIndex:(NSIndexPath *)index itemsIndex:(NSInteger)itemsIndex identifire:(NSString *)identifire ZZCarousel:(ZZCarousel *)zZCarousel
  325. {
  326. /*
  327. * index参数 ※ 注意
  328. */
  329. ZZCarouselView *cell = [zzcarousel dequeueReusableCellWithReuseIdentifier:identifire forIndexPath:index];
  330. if (!cell) {
  331. cell = [[ZZCarouselView alloc]init];
  332. }
  333. // cell.title.text = [_imagesGroup objectAtIndex:indexPath.row];
  334. // [cell.imageView sd_setImageWithURL:[NSURL URLWithString:@"图片地址"]];
  335. /*
  336. * itemsIndex 参数 ※ 注意
  337. */
  338. if(zZCarousel.tag == 500){
  339. if(_headwheelArray.count > itemsIndex){
  340. //cell.imageView.contentMode = UIViewContentModeScaleAspectFill;
  341. // bannerListModel *model = _headwheelArray[itemsIndex];
  342. if ([_headwheelArray[0] isEqualToString:@"ty"]) {
  343. [cell.imageView sd_setImageWithURL:NewURL(@"") placeholderImage:NewImageNamed(@"ty")];
  344. }else{
  345. [cell.imageView sd_setImageWithURL:NewURL([_headwheelArray[itemsIndex] mosaicUrlPrefix]) placeholderImage:NewImageNamed(@"cgxqbj")];
  346. [cell.imageView setBackgroundColor:NewClearColor];
  347. }
  348. }else {
  349. [cell.imageView setImage:NewImageError_T];
  350. }
  351. }
  352. return cell;
  353. }
  354. //图片点击方法
  355. -(void)zzcarouselScrollView:(ZZCarousel *)zzcarouselScrollView didSelectItemAtIndex:(NSInteger)index
  356. {
  357. // if (![UserHelper isActived]) {
  358. // NewNoActivedHUD;
  359. // return;
  360. // }
  361. NSLog(@"%@",[NSString stringWithFormat:@"点击了 第%ld张 轮播图片",(long)index]);
  362. }
  363. - (void)negotiateclick:(UIButton *)sender {
  364. if ([UserHelper isLogin]) {
  365. NSLog(@"%@",@"已登录");
  366. if (ResultsDetailArray.count>0) {
  367. ResultsDetailsModel *model = ResultsDetailArray[0];
  368. if (model.easemobName == NULL) {
  369. model.easemobName = HXKF;
  370. }
  371. EaseMessageViewController *viewController = [[EaseMessageViewController alloc] initWithConversationChatter:model.easemobName conversationType:0];
  372. if ([model.easemobName isEqualToString:HXKF]) {
  373. viewController.title = @"客服在线";
  374. }else{
  375. viewController.title = model.easemobName;
  376. }
  377. viewController.hidesBottomBarWhenPushed = YES;
  378. [[NSNotificationCenter defaultCenter]postNotificationName:@"环信登录成功" object:nil];
  379. [self.navigationController pushViewController:viewController animated:YES];
  380. }
  381. }else{
  382. NSLog(@"%@",@"未登录");
  383. NewLoginViewController *vc = [[NewLoginViewController alloc] init];
  384. [vc setLoginSuccess:^(NSString *string) {
  385. [self resultsDetailsNetworkrequest];
  386. NewPopViewController;
  387. }];
  388. NewPushViewController(vc);
  389. }
  390. }
  391. - (UIButton *)registerAccount
  392. {
  393. if (!_registerAccount)
  394. {
  395. _registerAccount = [UIButton buttonWithType:UIButtonTypeCustom];
  396. // [_registerAccount setTitle:@"" forState:UIControlStateNormal];
  397. [_registerAccount setTitleColor:[UIColor colorWithString:@"#9A9A9A"] forState:UIControlStateNormal];
  398. [_registerAccount setBackgroundColor:[UIColor clearColor]];
  399. [_registerAccount setContentHorizontalAlignment:UIControlContentHorizontalAlignmentRight];
  400. [_registerAccount.titleLabel setFont:[UIFont systemFontOfSize:fitScreenWidth(14)]];
  401. [_registerAccount addTarget:self action:@selector(touchRegister:) forControlEvents:UIControlEventTouchUpInside];
  402. // [_registerAccount setupAutoSizeWithHorizontalPadding:5 buttonHeight:44];
  403. [_registerAccount setImage:NewImageNamed(@"gd") forState:UIControlStateNormal];
  404. }
  405. return _registerAccount;
  406. }
  407. - (void)touchRegister:(UIButton *)sender{
  408. [YBPopupMenu showRelyOnView:sender titles:TITLES icons:ICONS menuWidth:140 delegate:self];
  409. }
  410. #pragma mark - YBPopupMenuDelegate
  411. - (void)ybPopupMenuDidSelectedAtIndex:(NSInteger)index ybPopupMenu:(YBPopupMenu *)ybPopupMenu
  412. {
  413. NSLog(@"点击了 %@ 选项",TITLES[index]);
  414. if (index == 0) {
  415. if ([UserHelper isLogin]) {
  416. NSLog(@"%@",@"已登录");
  417. MyattentionViewController *vc = [[MyattentionViewController alloc] init];
  418. NewPushViewController(vc);
  419. }else{
  420. NSLog(@"%@",@"未登录");
  421. NewLoginViewController *vc = [[NewLoginViewController alloc] init];
  422. [vc setLoginSuccess:^(NSString *string) {
  423. [self resultsDetailsNetworkrequest];
  424. NewPopViewController;
  425. }];
  426. NewPushViewController(vc);
  427. }
  428. }else if (index == 1){
  429. if ([UserHelper isLogin]) {
  430. NSLog(@"%@",@"已登录");
  431. MyOrderViewController*vc = [[MyOrderViewController alloc] init];
  432. NewPushViewController(vc);
  433. }else{
  434. NSLog(@"%@",@"未登录");
  435. NewLoginViewController *vc = [[NewLoginViewController alloc] init];
  436. [vc setLoginSuccess:^(NSString *string) {
  437. [self resultsDetailsNetworkrequest];
  438. NewPopViewController;
  439. }];
  440. NewPushViewController(vc);
  441. }
  442. }else if (index == 2) {
  443. if ([UserHelper isLogin]) {
  444. NSLog(@"%@",@"已登录");
  445. AchievementsReleaseViewController *vc = [[AchievementsReleaseViewController alloc] init];
  446. NewPushViewController(vc);
  447. }else{
  448. NSLog(@"%@",@"未登录");
  449. NewLoginViewController *vc = [[NewLoginViewController alloc] init];
  450. [vc setLoginSuccess:^(NSString *string) {
  451. [self resultsDetailsNetworkrequest];
  452. NewPopViewController;
  453. }];
  454. NewPushViewController(vc);
  455. }
  456. }else if (index == 3){
  457. if ([UserHelper isLogin]) {
  458. NSLog(@"%@",@"已登录");
  459. ReleaserequirementsViewController *vc = [[ReleaserequirementsViewController alloc] init];
  460. NewPushViewController(vc);
  461. }else{
  462. NSLog(@"%@",@"未登录");
  463. NewLoginViewController *vc = [[NewLoginViewController alloc] init];
  464. [vc setLoginSuccess:^(NSString *string) {
  465. [self resultsDetailsNetworkrequest];
  466. NewPopViewController;
  467. }];
  468. NewPushViewController(vc);
  469. }
  470. }
  471. }
  472. - (void)didReceiveMemoryWarning {
  473. [super didReceiveMemoryWarning];
  474. // Dispose of any resources that can be recreated.
  475. }
  476. /*
  477. #pragma mark - Navigation
  478. // In a storyboard-based application, you will often want to do a little preparation before navigation
  479. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  480. // Get the new view controller using [segue destinationViewController].
  481. // Pass the selected object to the new view controller.
  482. }
  483. */
  484. @end