// // ModelVC.m // JSJPCoach // // Created by apple on 2017/3/22. // Copyright © 2017年 Danson. All rights reserved. // #import "ModelVC.h" #import "ModelLeftCell.h" #import "ModelRightCell.h" #import "ModelTVHeaderView.h" #import "PriceCell.h" static BOOL isOpen = YES;//@lee-mark:实操是否开放 @interface ModelVC () { UIScrollView *mainScroll; //实时 UIButton *keErBtn, *keSanBtn; UITableView *priceTableView; UITableViewCell *priceCell; NSArray *moneyArr; NSString *keMuString; NSString *priceString; NSString *coachOrderIdStr; //预约 UITableView *leftTableView; UITableView *rightTableView; NSArray *planArray; NSDictionary *planDic; BOOL _isScrollDown; NSInteger _selectIndex; NSInteger rightIndex; NSMutableArray *_btnArray; NSInteger btnIndex; NSString *RO_STATUS; } @end @implementation ModelVC - (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor whiteColor]; planArray = [NSArray array]; _selectIndex = 0; rightIndex = -1; //默认选择实时0元 btnIndex = 2; priceString = @"免费"; UIImageView *backImageView = [[UIImageView alloc] initWithFrame:kFrame]; backImageView.image = [UIImage imageNamed:@"bgImage"]; [self.view addSubview:backImageView]; CGFloat x,y,w,h; //完成按钮 x = 20; y = kSize.height - kSize.height/6.0; h = kSize.height/6.0 - 20; if (h > 80) { h = 80; y += (kSize.height/6.0 - 100)/2.0; } w = h/1.46; y += (h - w)/2 + 5; h = w; UIButton *modelBtn = [UIButton buttonWithType:UIButtonTypeCustom]; modelBtn.frame = setDIYFrame; [modelBtn setRound]; modelBtn.backgroundColor = RGB_COLOR(145, 160, 175); [modelBtn setTitle:@"完成" textColor:[UIColor blackColor] font:Font16 fotState:UIControlStateNormal]; [modelBtn target:self Tag:1]; [self.view addSubview:modelBtn]; //返回按钮 UIButton *backlBtn = [UIButton buttonWithType:UIButtonTypeCustom]; backlBtn.backgroundColor = RGB_COLOR(145, 160, 175); [backlBtn setTitle:@"返回" textColor:[UIColor blackColor] font:Font16 fotState:UIControlStateNormal]; [backlBtn target:self Tag:0]; [self.view addSubview:backlBtn]; [backlBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.right.mas_equalTo(self.view).mas_offset(-20); make.bottom.mas_equalTo(self.view).mas_offset(- (kSize.height - (modelBtn.y + modelBtn.height))); make.size.mas_equalTo(modelBtn.size); backlBtn.layer.cornerRadius = modelBtn.width / 2.0; backlBtn.layer.masksToBounds = YES; }]; // w = kSize.width - 2*x; h = y - kNavOffSet; y = kSegmentHeight; UIImageView *bgImage = [[UIImageView alloc] setxywh]; bgImage.backgroundColor = [UIColor colorWithWhite:.7 alpha:.2]; [self.view addSubview:bgImage]; h = 40; UILabel *label = [[UILabel alloc] setxywh]; [label setText:@"带教类型" Font:Font17 TextColor:[UIColor whiteColor] Alignment:NSTextAlignmentCenter]; [self.view addSubview:label]; [label addViewWithRect:CGRectMake(x + 30, y + 19, w/2.0 - 80, 1) Color:[UIColor colorWithWhite:.7 alpha:.5]]; [label addViewWithRect:CGRectMake(kSize.width/2.0 + 50, y + 19, w/2.0 - 80, 1) Color:[UIColor colorWithWhite:.7 alpha:.5]]; // x += 30; y += h; h = h*1.3; w = kSize.width - 2*x; UIView *btnBar = [[UIView alloc] setxywh];//16 24 50 btnBar.backgroundColor = RGB_COLOR(16, 24, 50); [btnBar borderColor:[UIColor colorWithWhite:.7 alpha:.2] width:1 cornorRadios:h/2.0]; [self.view addSubview:btnBar]; // NSArray *titleArray = @[@"实时",@"预约",@"模拟"]; NSArray *titleArray = (self.modelPageType == RQModelPageTypeSubscribe)? @[@"预约"] : @[@"预约",@"模拟"]; w = w/(titleArray.count); _btnArray = [NSMutableArray arrayWithCapacity:titleArray.count]; for (int i = 0; i < titleArray.count; i ++) { UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(w*i,5,w,h - 10)]; [button borderColor:RGB_COLOR(16, 24, 50) width:1 cornorRadios:h/2.0 - 5]; [button setTitle:[titleArray objectAtIndex:i] textColor:[UIColor whiteColor] font:Font18 fotState:UIControlStateNormal]; [button target:self Tag:i + 2]; [btnBar addSubview:button]; [_btnArray addObject:button]; button.backgroundColor = (i == 0 && !isOpen)? [UIColor grayColor] : [UIColor clearColor]; button.enabled = !(i == 0 && !isOpen); if (i == !isOpen? 1 : 0) { button.selected = YES; button.backgroundColor = defGreen; btnIndex = button.tag; } } // x = 20; w = kSize.width - 2*x; y += h + 20; h = modelBtn.y - y - kStatusHeight; mainScroll = [[UIScrollView alloc] setxywh]; mainScroll.contentSize = CGSizeMake(titleArray.count*w, h); [mainScroll setShowsHorizontalScrollIndicator:NO]; [mainScroll setPagingEnabled:YES]; [mainScroll setDecelerationRate:.2]; mainScroll.delegate = self; [self.view addSubview:mainScroll]; UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, w, h)]; if (isOpen) { // [mainScroll addSubview:view]; } UIView *scrollView1 = view; view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, w, h)]; [mainScroll addSubview:view]; UIView *scrollView2 = view; view = [[UIView alloc] initWithFrame:CGRectMake(w, 0, w, h)]; [mainScroll addSubview:view]; //UIView *scrollView3 = view; //实时 x = 10; y = 20; w = (w-20)/3.0; h = 30; label = [[UILabel alloc] setxywh]; [label setText:@"培训科目:" Font:Font17 TextColor:newTitleColor Alignment:NSTextAlignmentLeft]; [scrollView1 addSubview:label]; x += w; keMuString = @"2"; UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; button.frame = setDIYFrame; [button setImage:[UIImage imageNamed:@"selectAll"] Tit:@"科目二" Font:Font16 State:UIControlStateNormal]; [button setImage:[UIImage imageNamed:@"selectedAll"] forState:UIControlStateSelected]; [button setTitleColor:newTitleColor forState:UIControlStateNormal]; [button setTitleColor:defGreen forState:UIControlStateSelected]; [button target:self Tag:5]; [scrollView1 addSubview:button]; button.selected = YES; keErBtn = button; x += w; button = [UIButton buttonWithType:UIButtonTypeCustom]; button.frame = setDIYFrame; [button setImage:[UIImage imageNamed:@"selectAll"] Tit:@"科目三" Font:Font16 State:UIControlStateNormal]; [button setImage:[UIImage imageNamed:@"selectedAll"] forState:UIControlStateSelected]; [button setTitleColor:newTitleColor forState:UIControlStateNormal]; [button setTitleColor:defGreen forState:UIControlStateSelected]; [button target:self Tag:6]; [scrollView1 addSubview:button]; keSanBtn = button; x = 10; y += h + 20; w = scrollView1.width - 2*x; label = [[UILabel alloc] setxywh]; [label setText:@"培训价格:" Font:Font17 TextColor:newTitleColor Alignment:NSTextAlignmentLeft]; [scrollView1 addSubview:label]; [label addViewWithRect:CGRectMake(x, y+h, w, 1) Color:backGroundColor]; y += h + 1; h = scrollView1.height - y; UITableView *tableView = [[UITableView alloc] initWithFrame:setDIYFrame style:UITableViewStyleGrouped]; tableView.backgroundColor = [UIColor clearColor]; tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLineEtched; tableView.delegate = self; tableView.dataSource = self; tableView.estimatedSectionHeaderHeight = 0; tableView.estimatedSectionFooterHeight = 0; [scrollView1 addSubview:tableView]; priceTableView = tableView; //预约 x = y = 0; w = 90; if (kSize.width > 320.0) { w = 110; } h = scrollView2.height; leftTableView = [[UITableView alloc] initWithFrame:setDIYFrame style:UITableViewStylePlain]; leftTableView.backgroundColor = [UIColor clearColor]; leftTableView.delegate = self; leftTableView.dataSource = self; leftTableView.rowHeight = 60; leftTableView.estimatedSectionHeaderHeight = 0; leftTableView.estimatedSectionFooterHeight = 0; leftTableView.showsVerticalScrollIndicator = NO; leftTableView.tableFooterView = [UIView new]; [scrollView2 addSubview:leftTableView]; x += w; w = scrollView1.width - w; rightTableView = [[UITableView alloc] initWithFrame:setDIYFrame style:UITableViewStyleGrouped]; rightTableView.backgroundColor = [UIColor clearColor]; rightTableView.delegate = self; rightTableView.dataSource = self; rightTableView.rowHeight = 80; rightTableView.estimatedSectionHeaderHeight = 0; rightTableView.estimatedSectionFooterHeight = 0; rightTableView.showsVerticalScrollIndicator = NO; rightTableView.separatorColor = [UIColor clearColor]; [scrollView2 addSubview:rightTableView]; //模拟 //数据获取 [self getTrainPrice]; [self getPlanInfos]; } - (void)btnClick:(UIButton *)sender { if (sender.tag == 0) { [self dismissViewControllerAnimated:YES completion:nil]; return; } if (sender.tag == 1) { //如果没有有效的选择 就提示是否确定 123 "实时",@"预约",@"模拟" NSString *audioString = @"您已选择模拟带教"; if (btnIndex == 1) { if (priceString.length < 1) { //未选择价格 UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"请选择实时带教价格,否则将无法开始带教" delegate:nil cancelButtonTitle:@"确认" otherButtonTitles:nil, nil]; [alert show]; return; } NSDictionary *dic = @{@"subject":keMuString,@"price":priceString,@"periodType":@"1"}; _superVC.periodType = 1; _superVC.periodDic = dic; audioString = [NSString stringWithFormat:@"您已选择%@实时带教",[keMuString isEqualToString:@"2"] ? @"科目二":@"科目三"]; } if (btnIndex == 2) { if (![planDic isKindOfClass:[NSDictionary class]] || planDic.count < 1) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:self.modelPageType == RQModelPageTypeSubscribe? @"请选择将要签退的学员,否则将无法签退" : @"请选择将要带教的学员,否则将无法开始带教" delegate:nil cancelButtonTitle:@"确认" otherButtonTitles:nil, nil]; [alert show]; return; } if (RO_STATUS) { if (RO_STATUS.length > 0 && self.modelPageType == RQModelPageTypeDefault) { ShowMsg(@"您已带教该预约!"); [Tools playAudioWithString:@"您已带教该预约!"]; return; }else if (self.modelPageType == RQModelPageTypeSubscribe) { if ([RO_STATUS isEqualToString:@"0"]) { if (_coachOrderBlock) { _coachOrderBlock(planDic); } }else if ([RO_STATUS isEqualToString:@"1"]) { [Tools playAudioWithString:@"该学员已签退"]; } } } _superVC.periodType = 2; _superVC.periodDic = planDic; audioString = self.modelPageType == RQModelPageTypeSubscribe? [NSString stringWithFormat:@"您已选择签退学员为%@",planDic[@"userName"]] : [NSString stringWithFormat:@"您已选择预约模式,带教学员为%@",planDic[@"userName"]]; //userName } if (btnIndex == 3) { _superVC.periodType = 3; } [self dismissViewControllerAnimated:NO completion:^{ [Tools playAudioWithString:audioString]; }]; return; } // 123 "实时",@"预约",@"模拟" if (sender.tag > 0 && sender.tag < 4) { if (sender.tag == btnIndex) { return; } //UI 改变 UIButton *btn = (UIButton *)_btnArray[btnIndex - 2]; btn.backgroundColor = [UIColor clearColor]; btnIndex = sender.tag; btn = (UIButton *)_btnArray[btnIndex - 2]; btn.backgroundColor = defGreen; //改变显示的内容 [mainScroll setContentOffset:CGPointMake(mainScroll.width * (btnIndex - 2), mainScroll.contentOffset.y) animated:NO]; } if (sender.tag == 5) { if (keSanBtn.isSelected == YES) { keSanBtn.selected = NO; } keErBtn.selected = YES; keMuString = @"2"; } if (sender.tag == 6) { if (keErBtn.isSelected == YES) { keErBtn.selected = NO; } keSanBtn.selected = YES; keMuString = @"3"; } } #pragma mark tableView -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // if (rightTableView == tableView) { // // return planArray.count; // } if (priceTableView == tableView) { return 1; } if (planArray.count == 0) { return 0; } return 1; } -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { if (priceTableView == tableView) { return moneyArr.count + 1; } if (leftTableView == tableView) { return planArray.count; } if (rightTableView == tableView) { if (planArray.count > _selectIndex) { NSArray *stuArray = [planArray[_selectIndex] objectForKey:@"reserveInfoList"]; if (stuArray) { return stuArray.count; } } // if (planArray.count > 0) { // NSArray *stuArray = [planArray[section] objectForKey:@"reserveInfoList"]; // if (stuArray) { // return stuArray.count; // } // } } return 0; } -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { //左边表 if (leftTableView == tableView) { ModelLeftCell *cell = [tableView dequeueReusableCellWithIdentifier:@"leftCell"]; if (cell == nil) { cell = [[ModelLeftCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"leftCell"]; } NSDictionary *dic = planArray[indexPath.row]; cell.timeLabel.text = dic[@"PI_TIMES"]; cell.priceLabel.text = [NSString stringWithFormat:@"¥%@元/时",dic[@"PI_MONEY"]]; return cell; } //右边表 if (rightTableView == tableView) { ModelRightCell *cell = [tableView dequeueReusableCellWithIdentifier:@"rightCell"]; if (cell == nil) { cell = [[ModelRightCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"rightCell"]; } NSDictionary *dic = [[planArray[_selectIndex] objectForKey:@"reserveInfoList"] objectAtIndex:indexPath.row]; cell.dataDic = dic; return cell; } //表示是价格选择的表 PriceCell *cell = [tableView dequeueReusableCellWithIdentifier:@"priceCell"]; if (cell == nil) { cell = [[[NSBundle mainBundle] loadNibNamed:@"PriceCell" owner:nil options:nil] firstObject]; cell.backgroundColor = [UIColor clearColor]; cell.selectionStyle = UITableViewCellSelectionStyleNone; } NSDictionary *dic; if (indexPath.row == 0) { NSString *carType = @""; if (moneyArr.count > 0) { carType = [[moneyArr firstObject] objectForKey:@"CSI_VEHICLETYPE"]; } dic = @{@"CSI_PRICE":@"免费",@"CSI_VEHICLETYPE":carType,@"CSI_TRAINNINGTIME":@"0"}; }else{ dic = moneyArr[indexPath.row - 1]; } [cell.indexLabel setText:[NSString stringWithFormat:@"%d、",(int)indexPath.row + 1] Font:Font16 TextColor:newTitleColor Alignment:NSTextAlignmentRight]; cell.priceDic = dic; return cell; } -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if (priceTableView == tableView) { if (indexPath.row == 0) { priceString = @"免费"; }else{ NSDictionary *dic = moneyArr[indexPath.row - 1]; priceString = dic[@"CSI_PRICE"]; } UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; [cell.textLabel setTextColor:defGreen]; if (priceCell) { [priceCell.textLabel setTextColor:newTitleColor]; } priceCell = cell; } if (leftTableView == tableView) { if (_selectIndex == indexPath.row) { return; } _selectIndex = indexPath.row; [leftTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:_selectIndex inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:YES]; // [rightTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:_selectIndex] atScrollPosition:UITableViewScrollPositionTop animated:YES]; //去掉右边的选中效果 planDic = nil; [rightTableView reloadData]; // if (rightIndex != -1) { // NSIndexPath *rightSelectIndex = [NSIndexPath indexPathForRow:rightIndex inSection:0]; // ModelRightCell *cell = [rightTableView cellForRowAtIndexPath:rightSelectIndex]; // [cell setSelected:NO animated:NO]; // } } if (rightTableView == tableView) { rightIndex = indexPath.row; NSDictionary *planDict = planArray[_selectIndex]; NSDictionary *stuDic = [[planDict objectForKey:@"reserveInfoList"] objectAtIndex:indexPath.row]; RO_STATUS = stuDic[@"RO_STATUS"]; coachOrderIdStr = stuDic[@"RO_ID"]; planDic = @{@"subject":planDict[@"PI_KM"],@"price":planDict[@"PI_MONEY"],@"userId":stuDic[@"RI_USER"],@"rid":stuDic[@"RI_ID"],@"periodType":@"2",@"userName":stuDic[@"RI_USER_NAME"],@"RO_ID":stuDic[@"RO_ID"]}; } } //-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section //{ // if (rightTableView == tableView) { // ModelTVHeaderView *headView = [tableView dequeueReusableHeaderFooterViewWithIdentifier:@"headView"]; // if (headView == nil) { // headView = [[ModelTVHeaderView alloc] initWithReuseIdentifier:@"headView"]; // headView.contentView.backgroundColor = newBackGroundColor; // } // // NSDictionary *dic = planArray[section]; // headView.textLabel.text = dic[@"PI_TIMES"]; // return headView; // } // // return nil; //} -(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { // if (rightTableView == tableView) { // return 25; // } return 0.1; } -(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { return 0.1; } /* 哈哈哈哈 这些瓜皮 // TableView分区标题即将展示 - (void)tableView:(UITableView *)tableView willDisplayHeaderView:(nonnull UIView *)view forSection:(NSInteger)section { // 当前的tableView是RightTableView,RightTableView滚动的方向向上,RightTableView是用户拖拽而产生滚动的((主要判断RightTableView用户拖拽而滚动的,还是点击LeftTableView而滚动的) if ((rightTableView == tableView) && !_isScrollDown && rightTableView.dragging) { [self selectRowAtIndexPath:section]; } } // TableView分区标题展示结束 - (void)tableView:(UITableView *)tableView didEndDisplayingHeaderView:(UIView *)view forSection:(NSInteger)section { // 当前的tableView是RightTableView,RightTableView滚动的方向向下,RightTableView是用户拖拽而产生滚动的((主要判断RightTableView用户拖拽而滚动的,还是点击LeftTableView而滚动的) if ((rightTableView == tableView) && _isScrollDown && rightTableView.dragging) { [self selectRowAtIndexPath:section + 1]; } } // 当拖动右边TableView的时候,处理左边TableView - (void)selectRowAtIndexPath:(NSInteger)index { if (index > planArray.count - 1) { return; } [leftTableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0] animated:YES scrollPosition:UITableViewScrollPositionTop]; } */ #pragma mark UISrcollViewDelegate // 标记一下RightTableView的滚动方向,是向上还是向下 //- (void)scrollViewDidScroll:(UIScrollView *)scrollView //{ // static CGFloat lastOffsetY = 0; // // UITableView *tableView = (UITableView *) scrollView; // if (rightTableView == tableView) // { // _isScrollDown = lastOffsetY < scrollView.contentOffset.y; // lastOffsetY = scrollView.contentOffset.y; // } //} -(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{ if (mainScroll == scrollView) { NSInteger pInd = (int)(scrollView.contentOffset.x / scrollView.width); NSLog(@"%ld %ld",(long)pInd,(long)btnIndex); if (pInd == btnIndex) { return;//滑动不足切换页面 }else if (pInd == 0 && btnIndex == 3 && !isOpen) { return; } UIButton *btn = (UIButton *)_btnArray[btnIndex - 2]; btn.backgroundColor = [UIColor clearColor]; btnIndex = pInd + 2; btn = (UIButton *)_btnArray[btnIndex - 2]; btn.backgroundColor = defGreen; } } #pragma mark 数据请求 //获取价格 -(void)getTrainPrice { [priceTableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:UITableViewScrollPositionTop]; NSMutableArray *arr=[NSMutableArray array]; [arr addPro:@"schoolId" Value:defUser.userDict[@"jxbh"]]; [arr addPro:@"dqbh" Value:defUser.userDict[@"cityId"]]; NSString* method = @"getPrice"; [jiaPeiManager requestAnythingWithURL:method array:arr data:nil completion:^(NSDictionary * dict) { //NSLog(@"获取价格-->%@->%@",arr,dict); if (!dict) { return ; } if ( [dict[@"code"] isEqualToString:@"1"]) { return ; } moneyArr = dict[@"body"]; [priceTableView reloadData]; [priceTableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:UITableViewScrollPositionTop]; }]; } //获取计划订单信息 - (void)getPlanInfos { [LoadingView showHUD]; if (![Util connectedToNetWork]) { showMsgUnconnect(); return; } NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:@"yyyy-MM-dd"]; NSString *dateString = [formatter stringFromDate:[NSDate date]]; NSMutableArray *arr=[NSMutableArray array]; [arr addPro:@"userId" Value:defUser.sfzmhm]; [arr addPro:@"time" Value:dateString]; [arr addPro:@"isPage" Value:@""]; [arr addPro:@"pageSize" Value:@""]; [arr addPro:@"currentPage" Value:@""]; [arr addPro:@"status" Value:@"1"]; NSString* method = @"getCoachReserveInfos"; [jiaPeiManager requestAnythingWithURL:method array:arr data:nil completion:^(NSDictionary * root) { //NSLog(@"我的预约-->%@---->%@",arr,root); if (!root) { [LoadingView removeHUD]; return ; } if ([root[@"code"] isEqualToString:@"1"]) { [LoadingView removeHUD]; ShowMsg(root[@"body"]); return; } planArray = root[@"body"]; if (self.modelPageType == RQModelPageTypeSubscribe) { NSMutableArray *plansArray = [NSMutableArray array]; [planArray.rac_sequence.signal subscribeNext:^(NSMutableDictionary *dic) { NSArray *reserveInfoListArr = dic[@"reserveInfoList"]; NSMutableArray *arr = [NSMutableArray array]; [[reserveInfoListArr.rac_sequence.signal filter:^BOOL(NSDictionary *dic0) { return [dic0[@"RO_STATUS"] isEqualToString:@"0"]; }] subscribeNext:^(NSDictionary *dic1) { [arr addObject:dic1]; } completed:^{ [dic setObject:arr forKey:@"reserveInfoList"]; if (arr.count > 0) { [plansArray addObject:dic]; } }]; } completed:^{ dispatch_async(dispatch_get_main_queue(), ^{ planArray = plansArray; [leftTableView reloadData]; //默认选择第一行 if (planArray.count > 0) { [leftTableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:YES scrollPosition:UITableViewScrollPositionTop]; } [rightTableView reloadData]; [LoadingView removeHUD]; }); }]; }else { [leftTableView reloadData]; //默认选择第一行 if (planArray.count > 0) { [leftTableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:YES scrollPosition:UITableViewScrollPositionTop]; } [rightTableView reloadData]; [LoadingView removeHUD]; } }]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } - (RQModelPageType)modelPageType { if (!_modelPageType) { _modelPageType = RQModelPageTypeDefault; } return _modelPageType; } - (void)initWithCoachOrderBlock:(CoachOrderBlock)coachOrderBlock { _coachOrderBlock = coachOrderBlock; } @end