| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193 |
- //
- // AmoytechniqueViewController.m
- // jitao
- //
- // Created by 罗云飞 on 2018/2/5.
- // Copyright © 2018年 罗云飞. All rights reserved.
- // 淘技
- #import "AmoytechniqueViewController.h"
- #import "YBPopupMenu.h"
- #import "MyattentionViewController.h"
- #import "AchievementsReleaseViewController.h"
- #import "MyOrderViewController.h"
- #import "AchievementsReleaseViewController.h"
- #import "ReleaserequirementsViewController.h"
- #import "ZZCarousel.h"
- #import "AssetsCollectionViewCell.h"
- #import "HeadlinesCollectionViewCell.h"
- #import "GBTopLineViewModel.h"
- #import "GBTopLineView.h"
- #import "ImmediatelyCollectionViewCell.h"
- #import "JiTaoRecommendCollectionViewCell.h"
- #import "RecommendedresultsCell.h"
- #import "ExpertCollectionViewCell.h"
- #import "HomeDataModel.h"
- #import "HomeRecommendedModel.h"
- #import "HomedemandModel.h"
- #import "TechnologyModel.h"
- #import "CarouselModel.h"
- #import "KnowledgeproductionModel.h"
- #import "HomeExpertModel.h"
- #import "AchievementsdetailViewController.h"
- #import "DemanddetailViewController.h"
- #import "ExpertdetailsViewController.h"
- #import "ScienceAchievementsViewController.h"
- #import "SciencedemandViewController.h"
- #import "ScienceexpertViewController.h"
- #import "DemanddetailViewController.h"
- #import "ExpertdetailsViewController.h"
- #import "HighidentificationViewController.h"
- #define TITLES @[@"我的关注", @"我的订单",@"发布成果",@"发布需求"]
- #define ICONS @[@"wdgz",@"wddd",@"fbcg",@"fbxq"]
- @interface AmoytechniqueViewController ()<YBPopupMenuDelegate,UICollectionViewDataSource,UICollectionViewDelegate,ZZCarouselDelegate>{
- UICollectionView *mainCollectionView;
- UICollectionViewFlowLayout *flowLayout;
- NSMutableArray *dataArray;
- UICollectionReusableView *headerView;
- ZZCarousel *_headwheel;//广告图
- NSMutableArray *_headwheelArray;
- UILabel *label1;
- UIImageView *_topIndicatorView;
- NSMutableArray *_titleLabelArray;
- NSInteger status;
- NSMutableArray *JTheadlinesArray;
- NSMutableArray *JTKnowledgeArray;
- NSMutableArray *Achievements;//成果数组
- NSMutableArray *demandArray;//需求数组
- NSMutableArray *expertArray;//专家数组
-
- }
- @property (strong ,nonatomic) UIButton * registerAccount;
- @property(nonatomic,strong)NSMutableArray*dataArr;
- @property (nonatomic,strong) GBTopLineView *TopLineView;
- @end
- @implementation AmoytechniqueViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
- [self setNavTitle:@"淘技"];
- [self dataInitialization];
- [self loadsView];
- [self Networkrequest];
- [self RecommendedNetworkrequest:@"1"];
- [self addRefreshing];
- // Do any additional setup after loading the view.
- }
- #pragma mark - 上拉下拉初始化
- - (void)addRefreshing
- {
- __weak typeof(self) weakSelf = self;
- __weak UICollectionView *newvc = mainCollectionView;
- newvc.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
-
- if ([NetworkRequestManager connectedToNetwork]) {
- // [weakSelf CarouselNetworkrequest:newvc.mj_header];
- // [weakSelf VarietyNetworkrequest:newvc.mj_header];
- // [weakSelf BusinessProjectNetworkrequest:newvc.mj_header];
- [weakSelf Networkrequest];
- [weakSelf RecommendedNetworkrequest:[NSString stringWithFormat:@"%i",status+1]];
- [newvc.mj_header endRefreshing];
- }else{
- [newvc.mj_header endRefreshing];
- }
- }];
- }
- - (void)dismiss:(id)object
- {
- if ([object isKindOfClass:[MJRefreshNormalHeader class]]) {
-
- __weak UICollectionView *newvc = mainCollectionView;
- [newvc.mj_header endRefreshing];
-
- }else {
- [MBProgressHUD hideHUDForView:self.view];
- }
- }
- - (void)RecommendedNetworkrequest:(NSString *)type {
- NSMutableDictionary *dic = [NSMutableDictionary new];
- [dic safeSetObject:type forKey:@"type"];
- [NetworkRequestManager requestGetWithInterfacePrefix:JT_getHomeRecommended parameters:dic onSuccess:^(id requestData) {
- NSLog(@"服务器返回数据 :%@",requestData);
- if ([requestData[@"error"] count] !=0) {
- for (NSDictionary *dic in requestData[@"error"]) {
- [MBProgressHUD showError:dic[@"message"] toView:self.view];
- }
- }else{
- if ([type isEqualToString:@"1"]) {
- [Achievements removeAllObjects];
- for (NSDictionary *dic in requestData[@"data"]) {
- HomeRecommendedModel*model = [[HomeRecommendedModel alloc] initWithDictionary:dic error:nil];
- [Achievements addObject:model];
- [mainCollectionView reloadSections:[NSIndexSet indexSetWithIndex:3]];
- }
- }else if ([type isEqualToString:@"2"]){
- [demandArray removeAllObjects];
- for (NSDictionary *dic in requestData[@"data"]) {
- HomedemandModel*model = [[HomedemandModel alloc] initWithDictionary:dic error:nil];
- [demandArray addObject:model];
- [mainCollectionView reloadSections:[NSIndexSet indexSetWithIndex:3]];
- }
- }else if ([type isEqualToString:@"3"]){
- [expertArray removeAllObjects];
- for (NSDictionary *dic in requestData[@"data"]) {
- HomeExpertModel*model = [[HomeExpertModel alloc] initWithDictionary:dic error:nil];
- [expertArray addObject:model];
- [mainCollectionView reloadSections:[NSIndexSet indexSetWithIndex:3]];
- }
- }
- }
- } onFailure:^{
-
- }];
- }
- - (void)Networkrequest {
- NSMutableDictionary *dic = [NSMutableDictionary new];
- [NetworkRequestManager requestGetWithInterfacePrefix:JT_getHomePageData parameters:dic onSuccess:^(id requestData) {
- NSLog(@"服务器返回数据 :%@",requestData);
- if ([requestData[@"error"] count] !=0) {
- for (NSDictionary *dic in requestData[@"error"]) {
- [MBProgressHUD showError:dic[@"message"] toView:self.view];
- }
- }else{
- [_headwheelArray removeAllObjects];
- for (NSDictionary *dic in requestData[@"data"][@"homeImg"]) {
- CarouselModel *model = [[CarouselModel alloc] initWithDictionary:dic error:nil];
- [_headwheelArray addObject:model];
- }
-
- _headwheel?[_headwheel reloadData]:nil;
- for (NSDictionary *dic in requestData[@"data"][@"advertising"]) {
- HomeDataModel*model = [[HomeDataModel alloc] initWithDictionary:dic error:nil];
- [JTheadlinesArray addObject:model];
- }
- [JTKnowledgeArray removeAllObjects];
- for (NSDictionary *dic in requestData[@"data"][@"achievemend"]) {
- KnowledgeproductionModel*model = [[KnowledgeproductionModel alloc] initWithDictionary:dic error:nil];
- [JTKnowledgeArray addObject:model];
- }
-
- [_dataArr removeAllObjects];
- for (int i=0; i<JTheadlinesArray.count; i++) {
- HomeDataModel*homemodel = JTheadlinesArray[i];
- GBTopLineViewModel *model = [[GBTopLineViewModel alloc]init];
- // model.type = homemodel.type;
- model.titleArray = homemodel.ads;
- [_dataArr addObject:model];
- }
- [mainCollectionView reloadData];
- }
- } onFailure:^{
-
- }];
- }
- #pragma mark - 数据初始化
- -(void)dataInitialization
- {
- expertArray = NewMutableArrayInit;
- JTKnowledgeArray = NewMutableArrayInit;
- demandArray = NewMutableArrayInit;
- Achievements = NewMutableArrayInit;
- JTheadlinesArray = NewMutableArrayInit;
- status = 0;
- _titleLabelArray = NewMutableArrayInit;
- _dataArr=[[NSMutableArray alloc]init];
- dataArray = NewMutableArrayInit;
- [dataArray addObject:@"1"];
- _headwheelArray = [NSMutableArray new];
- }
- #pragma mark ----加载界面
- - (void)loadsView{
- [self.navgationBar addSubview:self.registerAccount];
- _registerAccount.sd_layout
- .widthIs(30)
- .rightSpaceToView(self.navgationBar, 10)
- .heightIs(44)
- .topSpaceToView(self.navgationBar, 18);
- [self.view addSubview:mainCollectionView = [NewControlPackage collectionViewInitWithFrame:CGRectMake(0.0, NavHeader, SCREEN_WIDTH, SCREEN_HEIGHT-TABBAR_HEIGHT-NavHeader) delegate:self dataSource:self backgroundColor:NewWhiteColor scrollEnabled:YES alwaysBounceVertical:YES alwaysBounceHorizontal:NO showsHorizontalScrollIndicator:NO showsVerticalScrollIndicator:NO collectionViewFlowLayout:flowLayout sectionInset:UIEdgeInsetsMake(0, 0, 0, 0) headerReference:CGSizeMake(0, 0) footerReference:CGSizeMake(0, 0) minimumInteritemSpacing:0 minimumLineSpacing:0 scrollDirection:0 hidden:NO tag:105 userInteractionEnabled:YES]];
- [mainCollectionView registerClass:[AssetsCollectionViewCell class] forCellWithReuseIdentifier:@"HomeRootVCCell"];
- [mainCollectionView registerClass:[HeadlinesCollectionViewCell class] forCellWithReuseIdentifier:@"HomeRootVCCell1"];
- [mainCollectionView registerClass:[ImmediatelyCollectionViewCell class] forCellWithReuseIdentifier:@"HomeRootVCCell2"];
- [mainCollectionView registerClass:[JiTaoRecommendCollectionViewCell class] forCellWithReuseIdentifier:@"HomeRootVCCell3"];
- [mainCollectionView registerClass:[RecommendedresultsCell class] forCellWithReuseIdentifier:@"HomeRootVCCell4"];
- [mainCollectionView registerClass:[ExpertCollectionViewCell class] forCellWithReuseIdentifier:@"HomeRootVCCell5"];
- [mainCollectionView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"HomeRootVCHeaderView"];
- [mainCollectionView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"HomeRootVCHeaderView1"];
- [mainCollectionView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"HomeRootVCHeaderView2"];
- [mainCollectionView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"HomeRootVCHeaderView3"];
-
- }
- - (UICollectionReusableView *) collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
- {
- UICollectionReusableView *reusableview = nil;
- UICollectionReusableView *reusableview1 = nil;
- UICollectionReusableView *reusableview2 = nil;
- UICollectionReusableView *reusableview3 = nil;
- if (indexPath.section == 0) {
- if (kind == UICollectionElementKindSectionHeader)
- {
- if (!headerView) {
- headerView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"HomeRootVCHeaderView" forIndexPath:indexPath];
- headerView.backgroundColor = NewClearColor;
- if (!_headwheel) {
- _headwheel = nil;
- //创建轮播图
- _headwheel = [self headViewwheel:500];
- [headerView addSubview:_headwheel];
- [_headwheel reloadData];
- }
- UIView *view = [[UIView alloc] init];
- view.backgroundColor = NewRedColor;
- [headerView addSubview:view];
-
- view.sd_layout
- .topSpaceToView(_headwheel, 0)
- .heightIs(64)
- .widthIs(SCREEN_WIDTH);
-
- UIButton *button1 = [UIButton new];
- button1.backgroundColor = [UIColor whiteColor];
- NewTouchUpInside(button1, button1click:);
- [view addSubview:button1];
-
- button1.sd_layout
- .leftEqualToView(view)
- .widthIs(view.width/3)
- .heightIs(64);
-
- UIImageView *image = [UIImageView new];
- image.backgroundColor = NewClearColor;
- [image setImage:NewImageNamed(@"mcg")];
- [button1 addSubview:image];
-
- image.sd_layout
- .centerYEqualToView(button1)
- .heightIs(45)
- .widthIs(44)
- .leftSpaceToView(button1, 15);
-
- UILabel *titlelaber = [UILabel new];
- titlelaber.text = @"买成果";
- titlelaber.font = NewFont(15);
- [titlelaber setSingleLineAutoResizeWithMaxWidth:0];
- [button1 addSubview:titlelaber];
-
- titlelaber.sd_layout
- .leftSpaceToView(image, 10)
- .heightIs(20)
- .centerYEqualToView(button1);
- UIButton *button2 = [UIButton new];
- button2.backgroundColor = [UIColor whiteColor];
- NewTouchUpInside(button2, button2click:);
- [view addSubview:button2];
-
- button2.sd_layout
- .leftSpaceToView(button1, 0)
- .widthIs(view.width/3)
- .heightIs(64);
-
- UIImageView *image1 = [UIImageView new];
- image1.backgroundColor = NewClearColor;
- [image1 setImage:NewImageNamed(@"axq")];
- [button2 addSubview:image1];
-
- image1.sd_layout
- .centerYEqualToView(button2)
- .heightIs(45)
- .widthIs(44)
- .leftSpaceToView(button2, 15);
-
- UILabel *titlelaber1 = [UILabel new];
- titlelaber1.text = @"按需求";
- titlelaber1.font = NewFont(15);
- [titlelaber setSingleLineAutoResizeWithMaxWidth:0];
- [button2 addSubview:titlelaber1];
-
- titlelaber1.sd_layout
- .leftSpaceToView(image1, 10)
- .heightIs(20)
- .centerYEqualToView(button2);
-
- UIButton *button3 = [UIButton new];
- button3.backgroundColor = [UIColor whiteColor];
- NewTouchUpInside(button3, button3click:);
- [view addSubview:button3];
-
- button3.sd_layout
- .rightEqualToView(view)
- .widthIs(view.width/3)
- .heightIs(64);
-
- UIImageView *image2 = [UIImageView new];
- image2.backgroundColor = NewClearColor;
- [image2 setImage:NewImageNamed(@"zzj")];
- [button3 addSubview:image2];
-
- image2.sd_layout
- .centerYEqualToView(button3)
- .heightIs(45)
- .widthIs(44)
- .leftSpaceToView(button3, 15);
-
- UILabel *titlelaber2 = [UILabel new];
- titlelaber2.text = @"找专家";
- titlelaber2.font = NewFont(15);
- [titlelaber2 setSingleLineAutoResizeWithMaxWidth:0];
- [button3 addSubview:titlelaber2];
-
- titlelaber2.sd_layout
- .leftSpaceToView(image2, 10)
- .heightIs(20)
- .centerYEqualToView(button3);
-
- //
- UILabel *line = [UILabel new];
- line.backgroundColor = NewRGBColor(236, 236, 236, 1);
- [headerView addSubview:line];
- line.sd_layout
- .widthIs(SCREEN_WIDTH)
- .heightIs(10)
- .topSpaceToView(view, 0);
-
- UIView *headview1 = [UIView new];
- headview1.backgroundColor = [UIColor whiteColor];
- [headerView addSubview:headview1];
-
- headview1.sd_layout
- .leftEqualToView(headerView)
- .heightIs(44)
- .rightEqualToView(headerView)
- .topSpaceToView(line, 0);
-
- UILabel *line1 = [UILabel new];
- line1.backgroundColor = NewButtonColor;
- ViewRadius(line1, 1.5);
- [headview1 addSubview:line1];
-
- line1.sd_layout
- .leftSpaceToView(headview1, 15)
- .heightIs(18)
- .widthIs(3)
- .centerYEqualToView(headview1);
-
- UILabel *headtitle = [UILabel new];
- headtitle.text = @"知 产";
- headtitle.font = NewBFont(15);
- [headtitle setSingleLineAutoResizeWithMaxWidth:0];
- [headview1 addSubview:headtitle];
-
- headtitle.sd_layout
- .leftSpaceToView(line1, 10)
- .heightIs(15)
- .centerYEqualToView(headview1);
-
- UILabel *headtitle1 = [UILabel new];
- headtitle1.text = @"聚焦潜力价值项目";
- headtitle1.font = NewFont(13);
- headtitle1.textColor = [UIColor colorWithString:@"#9A9A9A"];
- [headtitle1 setSingleLineAutoResizeWithMaxWidth:0];
- [headview1 addSubview:headtitle1];
-
- headtitle1.sd_layout
- .leftSpaceToView(headtitle, 8)
- .heightIs(13)
- .centerYEqualToView(headview1);
-
- UIButton *CKGD = [UIButton new];
- CKGD.backgroundColor = NewWhiteColor;
- NewTouchUpInside(CKGD, CKGDclick:);
- [headview1 addSubview:CKGD];
-
- CKGD.sd_layout
- .rightEqualToView(headview1)
- .heightIs(44)
- .topEqualToView(headview1)
- .widthIs(80);
-
- UIImageView *backimage = [UIImageView new];
- [backimage setImage:[UIImage imageNamed:@"括号"]];
- [CKGD addSubview:backimage];
-
- backimage.sd_layout
- .centerYEqualToView(CKGD)
- .heightIs(13)
- .widthIs(7)
- .rightSpaceToView(CKGD, 15);
-
- UILabel *cjgdlabel = [UILabel new];
- cjgdlabel.text = @"查看更多";
- cjgdlabel.font = NewFont(fitScreenWidth(12));
- cjgdlabel.textColor = [UIColor colorWithString:@"#9A9A9A"];
- [cjgdlabel setSingleLineAutoResizeWithMaxWidth:0];
- [CKGD addSubview:cjgdlabel];
-
- cjgdlabel.sd_layout
- .rightSpaceToView(backimage, 5)
- .heightIs(15)
- .centerYEqualToView(CKGD);
-
- }
- reusableview = headerView;
- }
- return reusableview;
- }else if(indexPath.section == 1){
- if (kind == UICollectionElementKindSectionHeader)
- {
- UICollectionReusableView *view = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"HomeRootVCHeaderView1" forIndexPath:indexPath];
- view.backgroundColor = NewRGBColor(236, 236, 236, 1);
- reusableview1 = view;
- }
- return reusableview1;
- }else if(indexPath.section == 2){
- if (kind == UICollectionElementKindSectionHeader)
- {
- UICollectionReusableView *view = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"HomeRootVCHeaderView2" forIndexPath:indexPath];
- view.backgroundColor = NewRGBColor(236, 236, 236, 1);
- reusableview2 = view;
- }
- return reusableview2;
- }else{
- if (kind == UICollectionElementKindSectionHeader)
- {
- UICollectionReusableView *view = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"HomeRootVCHeaderView3" forIndexPath:indexPath];
- view.backgroundColor = NewWhiteColor;
-
- UIView *bgview = [UIView new];
- bgview.backgroundColor = NewWhiteColor;
- [view addSubview:bgview];
-
- bgview.sd_layout
- .leftEqualToView(view)
- .rightEqualToView(view)
- .topSpaceToView(view, 0)
- .heightIs(44);
-
- UILabel *line1 = [UILabel new];
- line1.backgroundColor = NewButtonColor;
- ViewRadius(line1, 1.5);
- [bgview addSubview:line1];
-
- line1.sd_layout
- .leftSpaceToView(bgview, 15)
- .heightIs(18)
- .widthIs(3)
- .centerYEqualToView(bgview);
-
- UILabel *headtitle = [UILabel new];
- headtitle.text = @"技淘推荐";
- headtitle.font = NewBFont(15);
- [headtitle setSingleLineAutoResizeWithMaxWidth:0];
- [bgview addSubview:headtitle];
-
- headtitle.sd_layout
- .leftSpaceToView(line1, 10)
- .heightIs(15)
- .centerYEqualToView(bgview);
-
- UILabel *headtitle1 = [UILabel new];
- headtitle1.text = @"最新最热专家成果,深度解签企业困惑";
- headtitle1.font = NewFont(13);
- headtitle1.textColor = [UIColor colorWithString:@"#9A9A9A"];
- [headtitle1 setSingleLineAutoResizeWithMaxWidth:0];
- [bgview addSubview:headtitle1];
-
- headtitle1.sd_layout
- .leftSpaceToView(headtitle, 8)
- .heightIs(13)
- .centerYEqualToView(bgview);
-
- UIView *sliderView = [UIView new];
- sliderView.backgroundColor = NewRGBColor(236, 236, 236, 1);
- [view addSubview:sliderView];
-
- sliderView.sd_layout
- .leftEqualToView(view)
- .rightEqualToView(view)
- .heightIs(40)
- .topSpaceToView(bgview, 0);
- NSArray *arr = @[@"成果",@"需求",@"专家"];
- [_titleLabelArray removeAllObjects];
- for (int i=0; i<arr.count; i++) {
- CGFloat titleLabelWidth = SCREEN_WIDTH/3;
- label1 = [[UILabel alloc] initWithFrame:CGRectMake(titleLabelWidth * i, 0, titleLabelWidth, 40)];
- label1.text = arr[i];
- label1.userInteractionEnabled = YES;
- label1.tag = i+100;
- label1.font = [UIFont systemFontOfSize:14];
- label1.textAlignment = NSTextAlignmentCenter;
- [_titleLabelArray addObject:label1];
- UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dealTap:)];
- [label1 addGestureRecognizer:tap];
- [sliderView addSubview:label1];
- }
- //添加提示视图
- _topIndicatorView = [[UIImageView alloc] init];
- CGFloat indicatorViewW = label1.frame.size.width/2;
- CGFloat indicatorViewCenterX = label1.center.x;
-
- _topIndicatorView.frame = CGRectMake(indicatorViewCenterX - indicatorViewW / 2, 38, indicatorViewW, 2);
- _topIndicatorView.backgroundColor = NewButtonColor;
- [sliderView addSubview:_topIndicatorView];
-
- [self topScrollViewShowPage:(int)status];
- reusableview3 = view;
- }
- return reusableview3;
- }
- }
- -(void)dealTap:(UITapGestureRecognizer *)tap
- {
- int page = (int)tap.view.tag - 100;
- [self topScrollViewShowPage:page];
- NSLog(@"%i",page);
- status = page;
- [self RecommendedNetworkrequest:[NSString stringWithFormat:@"%i",status+1]];
- [UIView performWithoutAnimation:^{
- [mainCollectionView reloadSections:[NSIndexSet indexSetWithIndex:3]];
- }];
- }
- -(void)topScrollViewShowPage:(int)page
- {
- for (UILabel *label in _titleLabelArray) {
- label.textColor = [UIColor blackColor];
- }
- UILabel *selectLabel = _titleLabelArray[page];
- selectLabel.textColor = NewButtonColor;
-
- [UIView animateWithDuration:0.2 animations:^{
- CGFloat indicatorViewW = selectLabel.frame.size.width/2;
- CGFloat indicatorViewCenterX = selectLabel.center.x;
- _topIndicatorView.frame = CGRectMake(indicatorViewCenterX - indicatorViewW / 2, 38, indicatorViewW, 2);
- }];
- }
- #pragma mark----买成果----
- - (void)button1click:(UIButton *)sender {
- NSLog(@"买成果");
- ScienceAchievementsViewController *vc = [[ScienceAchievementsViewController alloc] init];
- NewPushViewController(vc);
- }
- #pragma mark----按需求----
- - (void)button2click:(UIButton *)sender {
- NSLog(@"按需求");
- SciencedemandViewController *vc = [[SciencedemandViewController alloc] init];
- NewPushViewController(vc);
- }
- #pragma mark----找专家----
- - (void)button3click:(UIButton *)sender {
- ScienceexpertViewController *vc = [[ScienceexpertViewController alloc] init];
- NewPushViewController(vc);
- }
- #pragma mark----在线评估----
- - (void)assessmentBTclick:(UIButton*)sender{
- HighidentificationViewController *vc = [[HighidentificationViewController alloc] init];
- vc.ID = @"182d1324-c63d-419e-95aa-8d6f90a7bd7b";
- NewPushViewController(vc);
- }
- #pragma mark----项目创投----
- - (void)projectventureBTclick:(UIButton*)sender{
- ScienceAchievementsViewController *vc = [[ScienceAchievementsViewController alloc] init];
- NewPushViewController(vc);
- }
- #pragma mark----发布需求----
- - (void)releaserequirementsBTclick:(UIButton*)sender{
- // if ([UserHelper isLogin]) {
- NSLog(@"%@",@"已登录");
- ReleaserequirementsViewController *vc = [[ReleaserequirementsViewController alloc] init];
- NewPushViewController(vc);
- // }else{
- // NSLog(@"%@",@"未登录");
- // NewLoginViewController *vc = [[NewLoginViewController alloc] init];
- // [vc setLoginSuccess:^(NSString *string) {
- // NewDismissNavigationController;
- // }];
- // NewPresentNavigationController(vc);
- // }
- }
- #pragma mark----发布成果----
- - (void)releaseresultsBTBTclick:(UIButton*)sender{
- if ([UserHelper isLogin]) {
- NSLog(@"%@",@"已登录");
- AchievementsReleaseViewController *vc = [[AchievementsReleaseViewController alloc] init];
- NewPushViewController(vc);
- }else{
- NSLog(@"%@",@"未登录");
- NewLoginViewController *vc = [[NewLoginViewController alloc] init];
- [vc setLoginSuccess:^(NSString *string) {
- NewPopViewController;
- }];
- NewPushViewController(vc);
- }
- }
- - (void)CKGDclick:(UIButton *)sender {
- NSLog(@"查看更多");
- ScienceAchievementsViewController *vc = [[ScienceAchievementsViewController alloc] init];
- NewPushViewController(vc);
- }
- //头视图高度
- - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section
- {
- if (section == 0) {
- return CGSizeMake(SCREEN_WIDTH, 169+64+10+44);
- }else if (section == 1){
- return CGSizeMake(SCREEN_WIDTH, 10);
- }else if (section == 2){
- return CGSizeMake(SCREEN_WIDTH, 10);
- }else if(section == 3){
- return CGSizeMake(SCREEN_WIDTH, 84);
- }
- return CGSizeMake(SCREEN_WIDTH, 40);
- }
- //单元格大小
- -(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
- {
- if (indexPath.section == 0) {
- return CGSizeMake(SCREEN_WIDTH/2-20, 140);
- }else if (indexPath.section == 1){
- return CGSizeMake(SCREEN_WIDTH, 162);
- }else if (indexPath.section == 2){
- return CGSizeMake(SCREEN_WIDTH, 114);
- }else if (indexPath.section == 3){
- if (status == 0) {
- if (indexPath.row == Achievements.count-1) {
- return CGSizeMake(SCREEN_WIDTH, 137+44);
- }else{
- return CGSizeMake(SCREEN_WIDTH, 137);
- }
- }else if(status == 1){
- if (indexPath.row == demandArray.count-1) {
- return CGSizeMake(SCREEN_WIDTH, 132+44);
- }else{
- return CGSizeMake(SCREEN_WIDTH, 132);
- }
- }else{
- if (indexPath.row == expertArray.count-1) {
- return CGSizeMake(SCREEN_WIDTH, 120+44);
- }else{
- return CGSizeMake(SCREEN_WIDTH, 120);
- }
- }
- }
- return CGSizeMake(SCREEN_WIDTH, 10);
- }
- //定义每个UICollectionView 的 margin 边距 上左下右
- - (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section
- {
- if (section == 0) {
- return UIEdgeInsetsMake(10, 15, 0, 15);
- }else{
- return UIEdgeInsetsMake(0, 0, 0, 0);
- }
- }
- -(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView
- {
- return 4;
- }
- -(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
- {
- if (section == 0) {
- return JTKnowledgeArray.count;
- }else if (section == 1){
- return 1;
- }else if (section == 2){
- return 1;
- }else if (section == 3){
- if (status == 0) {
- return Achievements.count;
- }else if (status == 1){
- return demandArray.count;
- }
- return expertArray.count;
- }
- return dataArray.count;
- }
- -(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
- {
- if (indexPath.section == 0) {
- AssetsCollectionViewCell*cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"HomeRootVCCell" forIndexPath:indexPath];
- if (JTKnowledgeArray.count>0) {
- [cell assignment:JTKnowledgeArray[indexPath.row]];
- cell.backgroundColor = NewWhiteColor;
- }
- return cell;
- }else if (indexPath.section == 1){
- HeadlinesCollectionViewCell*cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"HomeRootVCCell1" forIndexPath:indexPath];
- if (JTheadlinesArray.count>0) {
- cell.backgroundColor = NewWhiteColor;
-
- _TopLineView = [[GBTopLineView alloc]initWithFrame:CGRectMake(65, 0, SCREEN_WIDTH-65, 91)];
- _TopLineView.backgroundColor = [UIColor whiteColor];
- __weak __typeof(self)weakSelf = self;
- _TopLineView.clickBlock = ^(NSInteger index){
- GBTopLineViewModel *model = weakSelf.dataArr[index];
- // NSLog(@"%@,%@",model.type,model.title);
- };
- [cell addSubview:_TopLineView];
- [_TopLineView setVerticalShowDataArr:_dataArr];
-
- UIImageView *zcjd = [UIImageView new];
- [zcjd setImage:NewImageNamed(@"zcjx")];
- zcjd.backgroundColor = NewClearColor;
- [cell addSubview:zcjd];
-
- zcjd.sd_layout
- .leftSpaceToView(cell, 20)
- .topSpaceToView(cell, 20)
- .heightIs(92/2)
- .widthIs(100/2);
-
- UIImageView *lineimage = [UIImageView new];
- [lineimage setImage:NewImageNamed(@"zcbx")];
- [cell addSubview:lineimage];
-
- lineimage.sd_layout
- .topSpaceToView(cell, 20)
- .heightIs(100/2)
- .leftSpaceToView(zcjd, 15)
- .widthIs(1);
-
- UILabel *line = [UILabel new];
- line.backgroundColor = NewLineGrayColor;
- [cell addSubview:line];
-
- line.sd_layout
- .leftEqualToView(cell)
- .rightEqualToView(cell)
- .heightIs(0.8)
- .topSpaceToView(_TopLineView, 0);
-
- UILabel *line1 = [UILabel new];
- line1.backgroundColor = NewLineGrayColor;
- [cell addSubview:line1];
-
- line1.sd_layout
- .leftSpaceToView(cell, SCREEN_WIDTH/2)
- .widthIs(0.8)
- .topSpaceToView(line, 0)
- .bottomEqualToView(cell);
-
- UIButton *assessmentBT = [UIButton new];
- assessmentBT.backgroundColor = NewWhiteColor;
- NewTouchUpInside(assessmentBT, assessmentBTclick:);
- [cell addSubview:assessmentBT];
-
- assessmentBT.sd_layout
- .leftEqualToView(cell)
- .topSpaceToView(line, 0)
- .bottomEqualToView(cell)
- .rightSpaceToView(line1, 0);
-
- UIImageView *assessmentimage = [UIImageView new];
- [assessmentimage setImage:NewImageNamed(@"zxpg")];
- assessmentimage.backgroundColor = NewClearColor;
- [assessmentBT addSubview:assessmentimage];
-
- assessmentimage.sd_layout
- .centerYEqualToView(assessmentBT)
- .heightIs(23)
- .widthIs(33)
- .leftSpaceToView(assessmentBT, 15);
-
- UILabel *pinggu = [UILabel new];
- [pinggu setText:@"在线评估"];
- pinggu.font = NewFont(14);
- [pinggu setSingleLineAutoResizeWithMaxWidth:0];
- [assessmentBT addSubview:pinggu];
-
- pinggu.sd_layout
- .leftSpaceToView(assessmentimage, 10)
- .heightIs(14)
- .topEqualToView(assessmentimage);
-
- UILabel *liaojie = [UILabel new];
- liaojie.text = @"立即了解您的技术价值";
- liaojie.font = NewFont(12);
- [liaojie setSingleLineAutoResizeWithMaxWidth:0];
- liaojie.textColor = [UIColor colorWithString:@"#9A9A9A"];
- [assessmentBT addSubview:liaojie];
-
- liaojie.sd_layout
- .leftEqualToView(pinggu)
- .heightIs(12)
- .topSpaceToView(pinggu, 5);
-
-
- UIButton *projectventureBT = [UIButton new];
- projectventureBT.backgroundColor = NewWhiteColor;
- NewTouchUpInside(projectventureBT, projectventureBTclick:);
- [cell addSubview:projectventureBT];
-
- projectventureBT.sd_layout
- .leftSpaceToView(line1, 0)
- .topSpaceToView(line, 0)
- .bottomEqualToView(cell)
- .rightEqualToView(cell);
-
- UIImageView *assessmentimage1 = [UIImageView new];
- [assessmentimage1 setImage:NewImageNamed(@"xmct")];
- assessmentimage1.backgroundColor = NewClearColor;
- [projectventureBT addSubview:assessmentimage1];
-
- assessmentimage1.sd_layout
- .centerYEqualToView(projectventureBT)
- .heightIs(25)
- .widthIs(28)
- .leftSpaceToView(projectventureBT, 15);
-
- UILabel *xiangmu = [UILabel new];
- [xiangmu setText:@"项目创投"];
- xiangmu.font = NewFont(14);
- [xiangmu setSingleLineAutoResizeWithMaxWidth:0];
- [projectventureBT addSubview:xiangmu];
-
- xiangmu.sd_layout
- .leftSpaceToView(assessmentimage1, 10)
- .heightIs(14)
- .topEqualToView(assessmentimage1);
-
- UILabel *liebian = [UILabel new];
- liebian.text = @"让资产迅速裂变";
- liebian.font = NewFont(12);
- [liebian setSingleLineAutoResizeWithMaxWidth:0];
- liebian.textColor = [UIColor colorWithString:@"#9A9A9A"];
- [projectventureBT addSubview:liebian];
-
- liebian.sd_layout
- .leftEqualToView(xiangmu)
- .heightIs(12)
- .topSpaceToView(xiangmu, 5);
-
- }
- return cell;
- }else if (indexPath.section == 2){
- ImmediatelyCollectionViewCell*cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"HomeRootVCCell2" forIndexPath:indexPath];
- if (dataArray.count>0) {
- cell.backgroundColor = NewWhiteColor;
- NewTouchUpInside(cell.releaserequirementsBT, releaserequirementsBTclick:);
- NewTouchUpInside(cell.releaseresultsBT, releaseresultsBTBTclick:);
- }
- return cell;
- }else if (indexPath.section == 3){
- if (status == 0) {
- JiTaoRecommendCollectionViewCell*cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"HomeRootVCCell3" forIndexPath:indexPath];
- if (Achievements.count>0) {
- cell.backgroundColor = NewWhiteColor;
- [cell assignment:Achievements[indexPath.row]];
- if (indexPath.row == Achievements.count-1) {
- cell.line4.hidden = NO;
- cell.seemoreBT.hidden = NO;
- }else{
- cell.line4.hidden = YES;
- cell.seemoreBT.hidden = YES;
- }
- cell.seemoreBT.tag = 100;
- NewTouchUpInside(cell.seemoreBT, seemoreBTclick:);
- }
- return cell;
- }else if (status == 1){
- RecommendedresultsCell*cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"HomeRootVCCell4" forIndexPath:indexPath];
- if (demandArray.count>0) {
- cell.backgroundColor = NewWhiteColor;
- [cell assignment:demandArray[indexPath.row]];
- if (indexPath.row == demandArray.count-1) {
- cell.line3.hidden = YES;
- cell.line4.hidden = NO;
- cell.seemoreBT.hidden = NO;
- }else{
- cell.line4.hidden = YES;
- cell.line3.hidden = NO;
- cell.seemoreBT.hidden = YES;
- }
- cell.seemoreBT.tag = 101;
- NewTouchUpInside(cell.seemoreBT, seemoreBTclick:);
- }
- return cell;
- }else if (status == 2){
- ExpertCollectionViewCell*cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"HomeRootVCCell5" forIndexPath:indexPath];
- if (expertArray.count>0) {
- cell.backgroundColor = NewWhiteColor;
- [cell assignment:expertArray[indexPath.row]];
- if (indexPath.row == expertArray.count-1) {
- cell.line3.hidden = YES;
- cell.line4.hidden = NO;
- cell.seemoreBT.hidden = NO;
- }else{
- cell.line4.hidden = YES;
- cell.line3.hidden = NO;
- cell.seemoreBT.hidden = YES;
- }
- cell.seemoreBT.tag = 102;
- NewTouchUpInside(cell.seemoreBT, seemoreBTclick:);
- }
- return cell;
- }
-
- }
- return [[UICollectionViewCell alloc] init];
- }
- -(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
- {
- if (indexPath.section == 0) {
- KnowledgeproductionModel *model = JTKnowledgeArray[indexPath.row];
- AchievementsdetailViewController *vc = [[AchievementsdetailViewController alloc] init];
- vc.ID = model.ID;
- NewPushViewController(vc);
- }
- if (indexPath.section == 3) {
- if (status == 0) {
- KnowledgeproductionModel *model = Achievements[indexPath.row];
- AchievementsdetailViewController *vc = [[AchievementsdetailViewController alloc] init];
- vc.ID = model.ID;
- NewPushViewController(vc);
- }else if (status == 1){
- HomedemandModel*model = demandArray[indexPath.row];
- DemanddetailViewController *vc = [[DemanddetailViewController alloc] init];
- vc.ID = model.ID;
- NewPushViewController(vc);
- }else if (status == 2){
- HomeExpertModel*model = expertArray[indexPath.row];
- ExpertdetailsViewController *vc = [[ExpertdetailsViewController alloc] init];
- vc.uid = model.ID;
- NewPushViewController(vc);
- }
- NSLog(@"%lo",indexPath.row);
- }
- }
- - (UIButton *)registerAccount
- {
- if (!_registerAccount)
- {
- _registerAccount = [UIButton buttonWithType:UIButtonTypeCustom];
- // [_registerAccount setTitle:@"" forState:UIControlStateNormal];
- [_registerAccount setTitleColor:[UIColor colorWithString:@"#9A9A9A"] forState:UIControlStateNormal];
- [_registerAccount setBackgroundColor:[UIColor clearColor]];
- [_registerAccount setContentHorizontalAlignment:UIControlContentHorizontalAlignmentRight];
- [_registerAccount.titleLabel setFont:[UIFont systemFontOfSize:fitScreenWidth(14)]];
- [_registerAccount addTarget:self action:@selector(touchRegister:) forControlEvents:UIControlEventTouchUpInside];
- // [_registerAccount setupAutoSizeWithHorizontalPadding:5 buttonHeight:44];
- [_registerAccount setImage:NewImageNamed(@"gd") forState:UIControlStateNormal];
- }
- return _registerAccount;
- }
- - (void)touchRegister:(UIButton *)sender{
- [YBPopupMenu showRelyOnView:sender titles:TITLES icons:ICONS menuWidth:140 delegate:self];
- }
- #pragma mark - YBPopupMenuDelegate
- - (void)ybPopupMenuDidSelectedAtIndex:(NSInteger)index ybPopupMenu:(YBPopupMenu *)ybPopupMenu
- {
- NSLog(@"点击了 %@ 选项",TITLES[index]);
- if (index == 0) {
- if ([UserHelper isLogin]) {
- NSLog(@"%@",@"已登录");
- MyattentionViewController *vc = [[MyattentionViewController alloc] init];
-
- NewPushViewController(vc);
- }else{
- NSLog(@"%@",@"未登录");
- NewLoginViewController *vc = [[NewLoginViewController alloc] init];
- [vc setLoginSuccess:^(NSString *string) {
- NewPopViewController;
- }];
- NewPushViewController(vc);
- }
- }else if (index == 1){
- if ([UserHelper isLogin]) {
- NSLog(@"%@",@"已登录");
- MyOrderViewController*vc = [[MyOrderViewController alloc] init];
- NewPushViewController(vc);
- }else{
- NSLog(@"%@",@"未登录");
- NewLoginViewController *vc = [[NewLoginViewController alloc] init];
- [vc setLoginSuccess:^(NSString *string) {
- NewPopViewController;
- }];
- NewPushViewController(vc);
- }
- }else if (index == 2) {
- if ([UserHelper isLogin]) {
- NSLog(@"%@",@"已登录");
- AchievementsReleaseViewController *vc = [[AchievementsReleaseViewController alloc] init];
- NewPushViewController(vc);
- }else{
- NSLog(@"%@",@"未登录");
- NewLoginViewController *vc = [[NewLoginViewController alloc] init];
- [vc setLoginSuccess:^(NSString *string) {
- NewPopViewController;
- }];
- NewPushViewController(vc);
- }
- }else if (index == 3){
- // if ([UserHelper isLogin]) {
- NSLog(@"%@",@"已登录");
- ReleaserequirementsViewController *vc = [[ReleaserequirementsViewController alloc] init];
- NewPushViewController(vc);
- // }else{
- // NSLog(@"%@",@"未登录");
- // NewLoginViewController *vc = [[NewLoginViewController alloc] init];
- // [vc setLoginSuccess:^(NSString *string) {
- // NewDismissNavigationController;
- // }];
- // NewPresentNavigationController(vc);
- // }
- }
- }
- #pragma mark-------------------------ZZCarousel轮播图片----------------------------------
- -(ZZCarousel*)headViewwheel:(NSInteger)tag
- {
- //self.navigationController.navigationBar.frame.size.height (SCREEN_WIDTH * 500 ) / 1080
- ZZCarousel* wheel = [[ZZCarousel alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH,169)];
- wheel.tag = tag;
- /*
- * carouseScrollTimeInterval --- 此属性为设置轮播多长时间滚动到下一张
- */
- wheel.carouseScrollTimeInterval = CarouselTime;
- // 代理
- wheel.delegate = self;
-
- /*
- * isAutoScroll --- 默认为NO,当为YES时 才能使轮播进行滚动
- */
- wheel.isAutoScroll = YES;
-
- /*
- * pageType --- 设置轮播样式 默认为系统样式。ZZCarousel 中封装了 两种样式,另外一种为数字样式
- */
- wheel.pageType = ZZCarouselPageTypeOfNone;
-
- /*
- * 设置UIPageControl 在轮播中的位置、系统默认的UIPageControl 的顶层颜色 和底层颜色已经背景颜色
- */
- if(wheel.tag == 500) {
-
- wheel.pageControlFrame = CGRectMake((SCREEN_WIDTH - 60 ) / 2, wheel.frame.size.height - 10, 60, 5);
-
- wheel.pageIndicatorTintColor = [UIColor whiteColor];
- wheel.currentPageIndicatorTintColor = NewRGBColor(191, 191, 191, 1);
- wheel.pageControlBackGroundColor = [UIColor whiteColor];
-
- /*
- * 设置数字样式的 UIPageControl 中的字体和字体颜色。 背景颜色仍然按照上面pageControlBackGroundColor属性来设置
- */
- wheel.pageControlOfNumberFont = [UIFont fontWithName:@"Helvetica-Bold" size:18];
- wheel.pageContolOfNumberFontColor = [UIColor whiteColor];
- }
- return wheel;
-
- }
- //ZZCarouselDelegate 轮播图片代理方法
- -(NSInteger)numberOfZZCarousel:(ZZCarousel *)wheel
- {
- return _headwheelArray.count;
- }
- //图片赋值
- -(ZZCarouselView *)zzcarousel:(UICollectionView *)zzcarousel viewForItemAtIndex:(NSIndexPath *)index itemsIndex:(NSInteger)itemsIndex identifire:(NSString *)identifire ZZCarousel:(ZZCarousel *)zZCarousel
- {
- /*
- * index参数 ※ 注意
- */
- ZZCarouselView *cell = [zzcarousel dequeueReusableCellWithReuseIdentifier:identifire forIndexPath:index];
-
- if (!cell) {
- cell = [[ZZCarouselView alloc]init];
- }
- // cell.title.text = [_imagesGroup objectAtIndex:indexPath.row];
- // [cell.imageView sd_setImageWithURL:[NSURL URLWithString:@"图片地址"]];
-
- /*
- * itemsIndex 参数 ※ 注意
- */
-
- if(zZCarousel.tag == 500){
-
- if(_headwheelArray.count > itemsIndex){
- CarouselModel *model = _headwheelArray[itemsIndex];
- [cell.imageView sd_setImageWithURL:NewURL([model.imgUrl mosaicUrlPrefix]) placeholderImage:NewImageNamed(@"banner")];
-
- }else {
- [cell.imageView setImage:NewImageError_T];
- }
- }
- return cell;
- }
- //图片点击方法
- -(void)zzcarouselScrollView:(ZZCarousel *)zzcarouselScrollView didSelectItemAtIndex:(NSInteger)index
- {
- NSLog(@"%@",[NSString stringWithFormat:@"点击了 第%ld张 轮播图片",(long)index]);
- if (_headwheelArray.count>0) {
- CarouselModel *model = _headwheelArray[index];
- if ([model.type isEqualToString:@"成果"]) {
- AchievementsdetailViewController *vc = [[AchievementsdetailViewController alloc] init];
- vc.ID = model.ID;
- NewPushViewController(vc);
- }else if ([model.type isEqualToString:@"需求"]){
- DemanddetailViewController *vc = [[DemanddetailViewController alloc] init];
- vc.ID = model.ID;
- NewPushViewController(vc);
- }else if ([model.type isEqualToString:@"专家"]){
- ExpertdetailsViewController *vc = [[ExpertdetailsViewController alloc] init];
- vc.uid = model.ID;
- NewPushViewController(vc);
- }
- }
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
- }
- #pragma mark------查看更多成果 需求 专家---------
- - (void)seemoreBTclick:(UIButton *)sender {
- if (sender.tag == 100) {
- NSLog(@"查看更多成果");
- ScienceAchievementsViewController *vc = [[ScienceAchievementsViewController alloc] init];
- NewPushViewController(vc);
- }else if (sender.tag == 101){
- NSLog(@"查看更多需求");
- SciencedemandViewController *vc = [[SciencedemandViewController alloc] init];
- NewPushViewController(vc);
- }else if (sender.tag == 102){
- NSLog(@"查看更多专家");
- ScienceexpertViewController *vc = [[ScienceexpertViewController alloc] init];
- NewPushViewController(vc);
- }
- }
- /*
- #pragma mark - Navigation
- // In a storyboard-based application, you will often want to do a little preparation before navigation
- - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
- // Get the new view controller using [segue destinationViewController].
- // Pass the selected object to the new view controller.
- }
- */
- @end
|