// // 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; } @property (weak, nonatomic) IBOutlet UILabel *coachNameLab; @property (weak, nonatomic) IBOutlet UILabel *tslxLab; @property (weak, nonatomic) IBOutlet UILabel *timeLab; @property (weak, nonatomic) IBOutlet UITextView *textView; @end @implementation ShowCommentVC - (void)viewDidLoad { [super viewDidLoad]; // [self myInit]; // self.view.backgroundColor = backGroundColor; self.title = @"我的投诉"; [self configNavigationBar]; [self getOrderComplaintsById]; } -(void)myInit { CGFloat x,y,w,h; x = 20; y = 20; w = kSize.width - 2*x; h = 30; timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(x, y, w, h)]; [timeLabel setText:@"" Font:Font17 TextColor:contentTextColor Alignment:NSTextAlignmentRight]; [self.view addSubview:timeLabel]; [timeLabel addViewWithRect:CGRectMake(10, y+h, kSize.width - 20, 1)]; y += h + 10; h = 30; remarkLabel = [[UILabel alloc] initWithFrame:CGRectMake(x, y, w, h)]; [remarkLabel setText:@"" Font:Font17 TextColor:kTitleColor Alignment:NSTextAlignmentLeft]; [self.view addSubview:remarkLabel]; [self getOrderComplaintsById]; } #pragma mark 数据请求 -(void)getOrderComplaintsById { if (![Util connectedToNetWork]) { return; } NSMutableArray *arr=[NSMutableArray array]; [arr addPro:@"classId" Value:self.classID]; [arr addPro:@"userId" Value:defUser.userDict[@"outId"]]; NSString* method = @"getOrderComplaintsByClassId"; [MBProgressHUD showLoadToView:self.view]; [jiaPeiManager requestAnythingWithURL:method array:arr data:nil completion:^(NSDictionary * root) { [MBProgressHUD hideHUDForView:self.view]; //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 *contentString = [NSString stringWithFormat:@"投诉内容:%@",dic[@"RC_MARK"]]; // if ([dic[@"RC_MARK"] length] < 1) { // contentString = @"投诉内容:暂无"; // } // remarkLabel.height = [contentString heightForWid:kSize.width - 40 Font:Font17] + 10; // remarkLabel.text = contentString; self.coachNameLab.text = dic[@"RC_COACH_NAME"]; self.tslxLab.text = dic[@"RT_TITLE"]; self.timeLab.text = [dic[@"RC_CRDATE"] substringToIndex:16]; self.textView.text = dic[@"RC_MARK"]; }]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } @end