// // TrainPriceDetail.m // LN_School // // Created by EchoShacolee on 2017/4/19. // Copyright © 2017年 Danson. All rights reserved. // #import "TrainPriceDetail.h" #import "EditPriceVC.h" @interface TrainPriceDetail () @end @implementation TrainPriceDetail - (void)viewDidLoad { [super viewDidLoad]; self.navigationItem.title = @"培训价格详情"; [self setSegmentControllWithTitles:@[@"基本信息"] isBttomBar:YES]; [self createBottomBarWithtoolTitles:@[@"删除",@"修改"]]; [self getData]; } -(void)setData{ _keysArr = @[ @[@"所属机构",@"JXMC"], @[@"培训车型",@"CSI_VEHICLETYPE"], @[@"收费模式",@"CSI_CHARGEMODE"], @[@"培训时段",@"CSI_TRAINNINGTIME"], @[@"付费模式",@"CSI_PAYMODE"], @[@"金额",@"CSI_PRICE"], @[@"班型名称",@"CSI_CLASSCURR"], @[@"培训模式",@"CSI_TRAINNINGMODE"], @[@"培训部分及方式 ",@"CSI_SUBJECT"], @[@"服务内容",@"CSI_SERVICE"], @[@"编号",@"CSI_SEQ"], @[@"备案时间",@"CSI_RECORD_DATE"], ]; [super setData]; } #pragma mark 创建BottomBarButton -(void)createBottomBarWithtoolTitles:(NSArray *)toolTitles{ float widthBtn = (kSize.width-1*toolTitles.count+1)/toolTitles.count; float HeightBth = JOb_DETAIL_BOTTOMBAR_HEIGHT; for (int i=0; i"]) { status = @""; } cell.detailTextLabel.text = status; }else{ cell.detailTextLabel.text = [NSString stringWithFormat:@"%@",self.dataSource[_keysArr[indexPath.row][1]]]; } return cell; } #pragma mark 数据请求 -(void)getData{ NSMutableDictionary *dic = [NSMutableDictionary dictionary]; [dic setObject:_theId forKey:@"id"]; [self getDataWithDic:dic method:@"viewPrice" block:^(NSDictionary *successDic) { self.dataSource = successDic[@"body"]; [_tableViews[0] reloadData]; }]; } -(void)delPrice{ NSMutableDictionary *dic = [NSMutableDictionary dictionary]; [dic setObject:_theId forKey:@"ids"]; [dic setObject:defUser.userDict[@"id"] forKey:@"userId"]; [self getDataWithDic:dic method:@"delPrice" block:^(NSDictionary *successDic) { ShowMsg(@"删除成功!"); [self.navigationController popViewControllerAnimated:YES]; }]; } -(void)willEditPrice{ EditPriceVC * vc = [[EditPriceVC alloc]init]; vc.theDic = self.dataSource; vc.type = @"2"; vc.blcok = ^{ [self getData]; }; [self navPushHideTabbarToVC:vc]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } /* #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