// // ShowCommentVC.m // jiaPei // // Created by apple on 16/6/27. // Copyright © 2016年 JCZ. All rights reserved. // #import "ShowCommentVC.h" @interface ShowCommentVC () { UILabel *timeLabel; UILabel *remarkLabel; UILabel *tslxLabel; } @end @implementation ShowCommentVC - (void)viewDidLoad { [super viewDidLoad]; [self myInit]; } -(void)myInit { self.view.backgroundColor = backGroundColor; self.title = @"学员投诉"; [self configNavBar]; CGFloat x,y,w,h,wid; x = 20; y = 20 + kNavOffSet; w = kSize.width - 2*x; h = 30; timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(x, y, w, h)]; [timeLabel setText:@"" Font:Font16 TextColor:contentTextColor Alignment:NSTextAlignmentRight]; [self.view addSubview:timeLabel]; [timeLabel addViewWithRect:CGRectMake(10, y+h, kSize.width - 20, 1)]; y += h + 10; wid = 90; UILabel *tslx = [[UILabel alloc]initWithFrame:CGRectMake(x, y, wid, h)]; [tslx setText:@"投诉类型:" Font:Font16 TextColor:titleColor Alignment:NSTextAlignmentLeft]; [self.view addSubview:tslx]; x += wid+5; w -= wid; h = 60; tslxLabel = [[UILabel alloc] initWithFrame:CGRectMake(x, y, w, h)]; tslxLabel.numberOfLines = 0; [tslxLabel setText:@"" Font:Font16 TextColor:titleColor Alignment:NSTextAlignmentLeft]; [self.view addSubview:tslxLabel]; x = 20; y += h + 10; h = 30; UILabel *tsnrLab = [[UILabel alloc]initWithFrame:CGRectMake(x, y, wid, h)]; [tsnrLab setText:@"投诉内容:" Font:Font16 TextColor:titleColor Alignment:NSTextAlignmentLeft]; [self.view addSubview:tsnrLab]; x += wid+5; h = 150; remarkLabel = [[UILabel alloc] initWithFrame:CGRectMake(x, y, w, h)]; remarkLabel.numberOfLines = 0; [remarkLabel setText:@"" Font:Font16 TextColor:titleColor Alignment:NSTextAlignmentLeft]; [self.view addSubview:remarkLabel]; [self getOrderComplaintsById]; } #pragma mark 数据请求 -(void)getOrderComplaintsById { [LoadingView showHUD]; if (![Util connectedToNetWork]) { return; } NSMutableArray *arr=[NSMutableArray array]; [arr addPro:@"classId" Value:_classID]; [arr addPro:@"userId" Value:_stuId];//传outid NSString* method = @"getOrderComplaintsByClassId"; [jiaPeiManager requestAnythingWithURL:method array:arr data:nil completion:^(NSDictionary * root) { RemoveHUD(); //执行同步并取得结果 //NSLog(@"投诉内容-->%@-->%@",arr,root); if (!root) { ShowMsgFailed(); return; } if ([root[@"code"] isEqualToString:@"1"]) { ShowMsg(root[@"body"]); return; } NSDictionary *dic = root[@"body"]; timeLabel.text = [dic[@"RC_CRDATE"] substringToIndex:16]; NSString *titleString = [NSString stringWithFormat:@"%@",dic[@"RT_TITLE"]]; if ([dic[@"RT_TITLE"] length] < 1) { titleString = @"暂无"; } tslxLabel.height = [titleString heightForWid:kSize.width - 40 - 95 Font:Font16]; tslxLabel.text = titleString; NSString *contentString = [NSString stringWithFormat:@"%@",dic[@"RC_MARK"]]; if ([dic[@"RC_MARK"] length] < 1) { contentString = @"暂无"; } remarkLabel.height = [contentString heightForWid:kSize.width - 40 - 95 Font:Font16]; remarkLabel.text = contentString; }]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } @end