// // ReleaserequirementsViewController.m // jitao // // Created by 罗云飞 on 2018/1/16. // Copyright © 2018年 罗云飞. All rights reserved. // #import "ReleaserequirementsViewController.h" #import "ResultsdescriptionCell.h" #import "ResultsTitleCell.h" #import "TechnicaltypeCell.h" #import "ReleaseresultsCell.h" #import "HangYeCell.h" #import "Hangyemodel.h" #import "PickerChoiceView.h" #import "NewPickerChoiceView.h" #import "UrgentCell.h" #import "CGPTCell.h" #import "NewChoiceFileController.h" @interface ReleaserequirementsViewController (){ UITableView *newtableView; BOOL isseemore;//查看更多 NSMutableArray *titledataArray; NSMutableArray *arr; NSString *descriptionStr; NSString *resultsTitleStr; NSString *industryStr;//行业类型1 UI展示 NSString *industryStr1;//行业类型2 UI展示 NSString *industryStr3;//行业类型1 NSString *industryStr4;//行业类型1 NSString *ID; NSMutableArray *CGPTdataArray; NewChoiceFileController *cont; NSString *TechnicaltypeStr111; NSString *LocationStr; NSString *JiajiStr; NSString *XuanShangStr; NSString *technicalPictureUrl; } @property (strong, nonatomic)NSMutableArray * middataArry; @property (strong, nonatomic)NSMutableArray * midArry; @property (strong, nonatomic)NSMutableArray * midArry2; @property (strong, nonatomic)NSMutableArray * middataArry2; @end @implementation ReleaserequirementsViewController - (void)viewDidLoad { [super viewDidLoad]; [self setNavTitle:@"发布需求"]; [self dataInitialization]; [self loadsView]; // Do any additional setup after loading the view. } - (NSMutableArray *)midArry2{ if (!_midArry2) { _midArry2 = [NSMutableArray arrayWithCapacity:0]; } return _midArry2; } - (NSMutableArray *)midArry{ if (!_midArry) { _midArry = [NSMutableArray arrayWithCapacity:0]; } return _midArry; } - (NSMutableArray *)middataArry{ if (!_middataArry) { _middataArry = NewMutableArrayInit; } return _middataArry; } - (NSMutableArray *)middataArry2{ if (!_middataArry2) { _middataArry2 = NewMutableArrayInit; } return _middataArry2; } - (void)Networkrequest:(NSString *)level pid:(NSString*)pid { NSMutableDictionary *dic = [NSMutableDictionary new]; [dic safeSetObject:level forKey:@"level"]; [dic safeSetObject:pid forKey:@"pid"]; [NetworkRequestManager requestGetWithInterfacePrefix:JT_getField 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{ [self.midArry removeAllObjects]; [self.middataArry removeAllObjects]; for (NSDictionary *dic in requestData[@"data"]) { Hangyemodel *model = [[Hangyemodel alloc] initWithDictionary:dic error:nil]; [self.middataArry addObject:model]; [self.midArry addObject:model.name]; } } } onFailure:^{ }]; } - (void)Networkrequestlevel:(NSString *)level pid:(NSString*)pid { NSMutableDictionary *dic = [NSMutableDictionary new]; [dic safeSetObject:level forKey:@"level"]; [dic safeSetObject:pid forKey:@"pid"]; [NetworkRequestManager requestGetWithInterfacePrefix:JT_getField 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{ [self.midArry2 removeAllObjects]; [self.middataArry2 removeAllObjects]; for (NSDictionary *dic in requestData[@"data"]) { Hangyemodel *model = [[Hangyemodel alloc] initWithDictionary:dic error:nil]; [self.middataArry2 addObject:model]; [self.midArry2 addObject:model.name]; } } } onFailure:^{ }]; } - (void)dataInitialization { isseemore = YES; titledataArray = [NSMutableArray arrayWithObjects:@"需求描述",@"需求标题",@"需求类型",@"其他",@"需求配图", nil]; arr = NewMutableArrayInit; CGPTdataArray = NewMutableArrayInit; for (int i = 0; i<6; i++) { NSMutableDictionary *dic = [NSMutableDictionary new]; switch (i) { case 0: [dic setObject:@"技术购买" forKey:@"name"]; [dic setObject:@"0" forKey:@"state"]; [dic setObject:@"0" forKey:@"number"]; [arr addObject:dic]; break; case 1: [dic setObject:@"技术设备类" forKey:@"name"]; [dic setObject:@"0" forKey:@"state"]; [dic setObject:@"1" forKey:@"number"]; [arr addObject:dic]; break; case 2: [dic setObject:@"技术方案" forKey:@"name"]; [dic setObject:@"0" forKey:@"state"]; [dic setObject:@"2" forKey:@"number"]; [arr addObject:dic]; break; case 3: [dic setObject:@"技术攻关型" forKey:@"name"]; [dic setObject:@"0" forKey:@"state"]; [dic setObject:@"3" forKey:@"number"]; [arr addObject:dic]; break; case 4: [dic setObject:@"技术咨询型" forKey:@"name"]; [dic setObject:@"0" forKey:@"state"]; [dic setObject:@"4" forKey:@"number"]; [arr addObject:dic]; break; case 5: [dic setObject:@"技术人才型" forKey:@"name"]; [dic setObject:@"0" forKey:@"state"]; [dic setObject:@"5" forKey:@"number"]; [arr addObject:dic]; break; default: break; } } } - (void)loadsView{ cont = [[NewChoiceFileController alloc]init]; cont.view.backgroundColor = NewClearColor; [self.view addSubview:cont.view]; [self.view sendSubviewToBack:cont.view]; [self.view addSubview:newtableView = [NewControlPackage tableViewInitWithFrame:CGRectMake(0, NavHeader, SCREEN_WIDTH, SCREEN_HEIGHT-NavHeader-44) backgroundColor:NewLineGrayColor style:UITableViewStyleGrouped delegate:self dataSource:self showsHorizontalScrollIndicator:NO showsVerticalScrollIndicator:NO hidden:NO tag:100 userInteractionEnabled:YES]]; newtableView.separatorStyle = NO; // newtableView.estimatedRowHeight = 0; // newtableView.estimatedSectionFooterHeight = 0; // newtableView.estimatedSectionHeaderHeight = 0; UIView *view = [UIView new]; view.backgroundColor = NewWhiteColor; [self.view addSubview:view]; view.sd_layout .bottomEqualToView(self.view) .heightIs(44) .widthIs(SCREEN_WIDTH); UIButton *submissionpurchase = [UIButton new]; [submissionpurchase setTitle:@"现在发布" forState:UIControlStateNormal]; [submissionpurchase setTitleColor:NewWhiteColor forState:UIControlStateNormal]; submissionpurchase.titleLabel.font = NewFont(15); submissionpurchase.titleLabel.textAlignment = NSTextAlignmentCenter; submissionpurchase.backgroundColor = NewRGBColor(252, 133, 52, 1); NewTouchUpInside(submissionpurchase, submissionpurchaseclick:); [view addSubview:submissionpurchase]; submissionpurchase.sd_layout .rightEqualToView(view) .heightIs(44) .widthIs(fitScreenWidth(121)); UIButton *negotiate = [UIButton new]; [negotiate setTitle:@"取消" forState:UIControlStateNormal]; [negotiate setTitleColor:NewWhiteColor forState:UIControlStateNormal]; negotiate.titleLabel.font = NewFont(15); negotiate.titleLabel.textAlignment = NSTextAlignmentCenter; negotiate.backgroundColor = NewButtonColor; NewTouchUpInside(negotiate, negotiateclick:); [view addSubview:negotiate]; negotiate.sd_layout .rightSpaceToView(submissionpurchase, 1) .heightIs(44) .widthIs(fitScreenWidth(121)); } #pragma mark-------------------------UITableView------------------------------------ -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 5; } //返回每段行数 -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { if (section == 0||section == 1||section == 2) { return 1; }else if (section == 3){ return 4; }else if (section == 4){ return 1; } return 3; } -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *Cell = @"Cell"; static NSString *Cell1 = @"Cell1"; static NSString *Cell2 = @"Cell2"; static NSString *Cell3 = @"Cell3"; static NSString *Cell4 = @"Cell4"; // static NSString *Cell5 = @"Cell5"; static NSString *Cell6 = @"Cell6"; // static NSString *Cell7 = @"Cell7"; // static NSString *Cell8 = @"Cell8"; static NSString *Cell9 = @"Cell9"; if (indexPath.section == 0) { ResultsdescriptionCell * cell = [tableView dequeueReusableCellWithIdentifier:Cell]; if (cell == nil) { cell = [[ResultsdescriptionCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:Cell]; } [cell setSelectionStyle:UITableViewCellSelectionStyleNone];//(这种是没有点击后的阴影效果) cell.accessoryType = UITableViewCellAccessoryNone; // [cell assignment:dataArray[indexPath.row]]; cell.backgroundColor = NewLineGrayColor; cell.textview.delegate = self; if (descriptionStr) { cell.textview.text = descriptionStr; }else{ cell.textview.text = @"请描述您的需求~"; } return cell; }else if (indexPath.section == 1){ ResultsTitleCell * cell = [tableView dequeueReusableCellWithIdentifier:Cell1]; if (cell == nil) { cell = [[ResultsTitleCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:Cell1]; } [cell setSelectionStyle:UITableViewCellSelectionStyleNone];//(这种是没有点击后的阴影效果) cell.accessoryType = UITableViewCellAccessoryNone; cell.backgroundColor = NewLineGrayColor; [cell.textfield addTarget:self action:@selector(textFieldEditingChanged:) forControlEvents:UIControlEventEditingChanged]; cell.textfield.tag = 100; cell.textfield.placeholder = @"请为您的需求标题配个标题吧~"; return cell; }else if (indexPath.section == 2){ TechnicaltypeCell* cell = [tableView dequeueReusableCellWithIdentifier:Cell3]; if (cell == nil) { cell = [[TechnicaltypeCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:Cell3]; } [cell setSelectionStyle:UITableViewCellSelectionStyleNone];//(这种是没有点击后的阴影效果) cell.accessoryType = UITableViewCellAccessoryNone; cell.backgroundColor = NewLineGrayColor; //防止出现collerview滚动 [cell.CollView reloadData]; //获取到数据后刷新 cell.CollView.scrollEnabled = NO; if (isseemore) { cell.CollView.frame = CGRectMake(0, 0, SCREEN_WIDTH, 60); }else{ cell.CollView.frame = CGRectMake(0, 0, SCREEN_WIDTH, 150); } cell.delegateColl = self; [cell reloadDatas:arr]; return cell; }else if (indexPath.section == 3){ if (indexPath.row == 0) { ReleaseresultsCell * cell = [tableView dequeueReusableCellWithIdentifier:Cell2]; if (cell == nil) { cell = [[ReleaseresultsCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:Cell2]; } [cell setSelectionStyle:UITableViewCellSelectionStyleNone];//(这种是没有点击后的阴影效果) cell.accessoryType = UITableViewCellAccessoryNone; cell.backgroundColor = NewWhiteColor; cell.title.text = @"所在地"; cell.view.frame = CGRectMake(60, 10, SCREEN_WIDTH-60-15, fitScreenWidth(44)); [cell.textfield addTarget:self action:@selector(textFieldEditingChanged:) forControlEvents:UIControlEventEditingChanged]; cell.textfield.tag = 101; return cell; }else if (indexPath.row == 1){ HangYeCell* cell = [tableView dequeueReusableCellWithIdentifier:Cell6]; if (cell == nil) { cell = [[HangYeCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:Cell6]; } [cell setSelectionStyle:UITableViewCellSelectionStyleNone];//(这种是没有点击后的阴影效果) cell.accessoryType = UITableViewCellAccessoryNone; cell.backgroundColor = NewWhiteColor; NewTouchUpInside(cell.industry, industryclick:); NewTouchUpInside(cell.industry1, industryclick:); if (industryStr) { [cell.industry setTitle:industryStr forState:UIControlStateNormal]; }else{ [cell.industry setTitle:@"行业" forState:UIControlStateNormal]; } if (industryStr1) { [cell.industry1 setTitle:industryStr1 forState:UIControlStateNormal]; }else{ [cell.industry1 setTitle:@"行业类型" forState:UIControlStateNormal]; } return cell; }else if (indexPath.row == 2||indexPath.row == 3){ if (indexPath.row == 2) { Cell4 = @"cell7"; }else{ Cell4 = @"cell8"; } UrgentCell* cell = [tableView dequeueReusableCellWithIdentifier:Cell4]; if (cell == nil) { cell = [[UrgentCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:Cell4]; } [cell setSelectionStyle:UITableViewCellSelectionStyleNone];//(这种是没有点击后的阴影效果) cell.accessoryType = UITableViewCellAccessoryNone; cell.backgroundColor = NewWhiteColor; if (indexPath.row == 2) { cell.title.text = @"加 急"; cell.Company.text = @"天"; cell.textfield.tag = 103; }else{ cell.title.text = @"悬 赏"; cell.Company.text = @"万元"; cell.textfield.tag = 104; } [cell.textfield addTarget:self action:@selector(textFieldEditingChanged:) forControlEvents:UIControlEventEditingChanged]; return cell; } }else if (indexPath.section == 4){ CGPTCell * cell = [tableView dequeueReusableCellWithIdentifier:Cell9]; if (cell == nil) { cell = [[CGPTCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:Cell9]; } [cell setSelectionStyle:UITableViewCellSelectionStyleNone];//(这种是没有点击后的阴影效果) cell.accessoryType = UITableViewCellAccessoryNone; cell.backgroundColor = NewWhiteColor; cell.CollView.scrollEnabled = NO; [cell.CollView reloadData]; // if (CGPTdataArray.count>2) { cell.CollView.frame = CGRectMake(0, 0.6, SCREEN_WIDTH, 240); // }else{ // cell.CollView.frame = CGRectMake(0, 0.6, SCREEN_WIDTH, 120); // } cell.delegateColl = self; [cell reloadDatas:CGPTdataArray]; return cell; } return [[UITableViewCell alloc] init]; } -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.section == 0) {//成果描述 return fitScreenWidth(134); }else if (indexPath.section == 1){//成果标题 return fitScreenWidth(64); }else if (indexPath.section == 2){//技术类型 if (isseemore) { return 40; }else{ return 70; } }else if (indexPath.section == 3){//其他 if (indexPath.row == 0||indexPath.row == 1) { return 10+fitScreenWidth(44)+5; } return fitScreenWidth(44); }else if (indexPath.section == 4){ // if (CGPTdataArray.count>2) { return 240; // }else{ // return 120; // } } return fitScreenWidth(44); } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ } // tableView 如果是Gruop类型的话,section之间的间距变宽,执行返回高度的同时还需要执行return UIView的代理 - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ if (section == 0) { return fitScreenWidth(44)+10; } return fitScreenWidth(44); } - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{ return CGFLOAT_MIN; } - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { static NSString * identy = @"head"; UITableViewHeaderFooterView * hf = [tableView dequeueReusableHeaderFooterViewWithIdentifier:identy]; NSLog(@"%li",section); hf = [[UITableViewHeaderFooterView alloc]initWithReuseIdentifier:identy]; UIView * view = [[UIView alloc]init]; view.backgroundColor = [UIColor whiteColor]; if (section == 0) { view.frame = CGRectMake(0, 10, SCREEN_WIDTH, fitScreenWidth(44)); }else{ view.frame = CGRectMake(0, 0, SCREEN_WIDTH, fitScreenWidth(44)); } [hf addSubview:view]; UILabel *line = [UILabel new]; line.backgroundColor = NewButtonColor; ViewRadius(line, 1); [view addSubview:line]; line.sd_layout .leftSpaceToView(view, 15) .centerYEqualToView(view) .heightIs(fitScreenWidth(18)) .widthIs(3); UILabel *title = [UILabel new]; [title setText:titledataArray[section]]; [title setFont:NewFont(fitScreenWidth(13))]; [title setSingleLineAutoResizeWithMaxWidth:0]; [view addSubview:title]; title.sd_layout .leftSpaceToView(line, 7) .heightIs(fitScreenWidth(44)) .topEqualToView(view) .centerYEqualToView(view); UIButton *seemore = [UIButton new]; [seemore setBackgroundColor:NewWhiteColor]; [seemore setImage:[UIImage imageNamed:@"上"] forState:UIControlStateNormal]; [seemore setImage:[UIImage imageNamed:@"下"] forState:UIControlStateSelected]; NewTouchUpInside(seemore, seemoreclick:); [view addSubview:seemore]; seemore.sd_layout .rightSpaceToView(view, 10) .heightIs(view.height) .widthIs(30) .centerYEqualToView(view); UIButton *gengduo = [UIButton new]; [gengduo setTitle:@"查看更多" forState:UIControlStateNormal]; gengduo.titleLabel.font = NewFont(fitScreenWidth(12)); [gengduo setTitleColor:[UIColor colorWithString:@"#A1A1A1"] forState:UIControlStateNormal]; [gengduo setupAutoSizeWithHorizontalPadding:0 buttonHeight:30]; // NewTouchUpInside(gengduo, seemoreclick:); [view addSubview:gengduo]; gengduo.sd_layout .rightSpaceToView(seemore, 0) .heightIs(30) .centerYEqualToView(view); if (section == 2) { seemore.hidden = NO; gengduo.hidden = NO; }else{ seemore.hidden = YES; gengduo.hidden = YES; } UILabel *line1 = [UILabel new]; line1.backgroundColor = NewLineGrayColor; [view addSubview:line1]; line1.sd_layout .leftEqualToView(view) .heightIs(0.6) .rightEqualToView(view) .bottomEqualToView(view); UILabel *line2 = [UILabel new]; line2.backgroundColor = NewLineGrayColor; [view addSubview:line2]; line2.sd_layout .leftEqualToView(view) .heightIs(0.6) .rightEqualToView(view) .topEqualToView(view); if (section == 4) { line1.hidden = NO; line2.hidden = NO; }else{ line1.hidden = YES; line2.hidden = YES; } return hf; } - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { return [[UIView alloc] init]; } #pragma mark - UITextView获得焦点之后,并且已经是第一响应者 -(void)textViewDidBeginEditing:(UITextView *)textView { // NSLog(@"UITextView获得焦点之后,并且已经是第一响应者"); if ([textView.text isEqualToString:@"请描述您的需求~"]) { textView.text = @""; textView.textColor = NewGrayColor; } } #pragma mark - UITextView失去焦点之后 -(void)textViewDidEndEditing:(UITextView *)textView { //NSLog(@"UITextView失去焦点"); if ([textView.text isEqualToString:@""] || textView.text.length == 0) { textView.text = @"请描述您的需求~"; textView.textColor = NewRGBColor(199, 199, 205, 1); } } #pragma mark - 详细地址限制字数 -(void)textViewDidChangeSelection:(UITextView *)textView { if(textView.text.length > 500){ textView.text = [textView.text substringWithRange:NSMakeRange(0,500)]; } if (textView.text.length > 0) { NSLog(@"textView.text:%@",textView.text); if ([textView.text isEqualToString:@"请描述您的需求~"]) { descriptionStr = @""; }else{ descriptionStr = nil; descriptionStr = textView.text; } } } #pragma mark - 代理用来接收点击的是第几个 -(void)ClickCooRow :(NSInteger)CellRow; { printf("\n点击的是==========%ld\n",CellRow); for (int i = 0; i50) { UITextRange *markedRange = [textField markedTextRange]; if (markedRange) { return; } NSRange range = [textField.text rangeOfComposedCharacterSequenceAtIndex:50]; textField.text = [textField.text substringToIndex:range.location]; [self.view makeToast:@"标题最多输入50个字哦~" duration:1.5 position:CSToastPositionCenter]; } resultsTitleStr = textField.text; NSLog(@"%@",resultsTitleStr); }else if (textField.tag == 103){ NSLog(@"加急%@天",textField.text); JiajiStr = textField.text; }else if (textField.tag == 104){ NSLog(@"悬赏%@万",textField.text); XuanShangStr = textField.text; }else if (textField.tag == 101){ if ([textField.text length]>30) { UITextRange *markedRange = [textField markedTextRange]; if (markedRange) { return; } NSRange range = [textField.text rangeOfComposedCharacterSequenceAtIndex:30]; textField.text = [textField.text substringToIndex:range.location]; [self.view makeToast:@"所在地最多输入30个字哦~" duration:1.5 position:CSToastPositionCenter]; } LocationStr = textField.text; NSLog(@"%@",LocationStr); } } - (void)industryclick:(UIButton *)sender { if (sender.tag == 100) { sender.userInteractionEnabled = NO; [self Networkrequest:@"1" pid:@"0"]; if (_midArry.count>0) { PickerChoiceView *picker = [[PickerChoiceView alloc]initWithFrame:self.view.bounds]; picker.delegate = self; picker.selectLb.text = @"行业"; picker.customArr = _midArry; [self.view addSubview:picker]; } sender.userInteractionEnabled = YES; }else{ if (ID) { sender.userInteractionEnabled = NO; if (_midArry2.count>0) { NewPickerChoiceView *picker = [[NewPickerChoiceView alloc]initWithFrame:self.view.bounds]; picker.delegate = self; picker.selectLb.text = @"行业"; picker.customArr = _midArry2; [self.view addSubview:picker]; } sender.userInteractionEnabled = YES; }else{ [MBProgressHUD showSuccess:@"请先选择行业~" toView:self.view]; } } } #pragma mark -------- 行业类型 ---------- - (void)PickerSelectorIndixString:(NSString *)str{ NSLog(@"%@",str); industryStr = str; NSIndexPath *indexPath = [NSIndexPath indexPathForRow:1 inSection:3]; [newtableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone]; for (int i = 0; i0) { // [wself avatarImageReplacement:imagePath]; [CGPTdataArray addObject:imagePath]; NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:4]; [newtableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone]; } }]; } - (void)hahahaha:(NSInteger)tag{ [CGPTdataArray removeObjectAtIndex:tag]; NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:4]; [newtableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone]; } #pragma mark -----发布成果网络请求-------- - (void)submissionpurchaseclick:(UIButton *)sender { NSLog(@"成果描述:%@",descriptionStr); NSLog(@"成果标题:%@",resultsTitleStr); NSLog(@"技术类型:%@",TechnicaltypeStr111); NSLog(@"所在地:%@",LocationStr); NSLog(@"行业:%@",industryStr); NSLog(@"行业类型:%@",industryStr1); NSLog(@"加急:%@",JiajiStr); NSLog(@"悬赏:%@",XuanShangStr); if (!descriptionStr) { [MBProgressHUD showError:@"请输入需求描述" toView:self.view]; return; } if (!resultsTitleStr) { [MBProgressHUD showError:@"请输入需求名称" toView:self.view]; return; } if (!TechnicaltypeStr111) { [MBProgressHUD showError:@"请选择需求类型" toView:self.view]; return; } if (!LocationStr) { [MBProgressHUD showError:@"请输入所在地" toView:self.view]; return; } if (!industryStr3) { [MBProgressHUD showError:@"请选择行业" toView:self.view]; return; } if (!industryStr4) { [MBProgressHUD showError:@"请选择行业类型" toView:self.view]; return; } if (CGPTdataArray.count<0) { [MBProgressHUD showError:@"请选择需求配图" toView:self.view]; return; } NSMutableDictionary *parameters = NewMutableDictionaryInit; [parameters safeSetObject:resultsTitleStr forKey:@"name"];//需求名称 [parameters safeSetObject:descriptionStr forKey:@"problemDes"];//成果描述 [parameters safeSetObject:TechnicaltypeStr111 forKey:@"demandType"];//需求类型 [parameters safeSetObject:LocationStr forKey:@"employerAddress"];//所在地 [parameters safeSetObject:industryStr3 forKey:@"industryCategoryA"];//行业1(传入行业的ID) [parameters safeSetObject:industryStr4 forKey:@"industryCategoryB"];//行业2(传入行业的ID) [parameters safeSetObject:JiajiStr forKey:@"urgentDays"];//加急天数 [parameters safeSetObject:XuanShangStr forKey:@"urgentMoney"];//加急金额(悬赏) NSString *url1; NSString *url2; NSString *url3; for (int i = 0; i