ShowCommentVC.m 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. //
  2. // ShowCommentVC.m
  3. // jiaPei
  4. //
  5. // Created by apple on 16/6/27.
  6. // Copyright © 2016年 JCZ. All rights reserved.
  7. //
  8. #import "ShowCommentVC.h"
  9. @interface ShowCommentVC ()
  10. {
  11. UILabel *timeLabel;
  12. UILabel *remarkLabel;
  13. }
  14. @property (weak, nonatomic) IBOutlet UILabel *coachNameLab;
  15. @property (weak, nonatomic) IBOutlet UILabel *tslxLab;
  16. @property (weak, nonatomic) IBOutlet UILabel *timeLab;
  17. @property (weak, nonatomic) IBOutlet UITextView *textView;
  18. @end
  19. @implementation ShowCommentVC
  20. - (void)viewDidLoad {
  21. [super viewDidLoad];
  22. // [self myInit];
  23. // self.view.backgroundColor = backGroundColor;
  24. self.title = @"我的投诉";
  25. [self configNavigationBar];
  26. [self getOrderComplaintsById];
  27. }
  28. -(void)myInit
  29. {
  30. CGFloat x,y,w,h;
  31. x = 20;
  32. y = 20;
  33. w = kSize.width - 2*x;
  34. h = 30;
  35. timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(x, y, w, h)];
  36. [timeLabel setText:@"" Font:Font17 TextColor:contentTextColor Alignment:NSTextAlignmentRight];
  37. [self.view addSubview:timeLabel];
  38. [timeLabel addViewWithRect:CGRectMake(10, y+h, kSize.width - 20, 1)];
  39. y += h + 10;
  40. h = 30;
  41. remarkLabel = [[UILabel alloc] initWithFrame:CGRectMake(x, y, w, h)];
  42. [remarkLabel setText:@"" Font:Font17 TextColor:kTitleColor Alignment:NSTextAlignmentLeft];
  43. [self.view addSubview:remarkLabel];
  44. [self getOrderComplaintsById];
  45. }
  46. #pragma mark 数据请求
  47. -(void)getOrderComplaintsById
  48. {
  49. if (![Util connectedToNetWork]) {
  50. return;
  51. }
  52. NSMutableArray *arr=[NSMutableArray array];
  53. [arr addPro:@"classId" Value:self.classID];
  54. [arr addPro:@"userId" Value:defUser.userDict[@"outId"]];
  55. NSString* method = @"getOrderComplaintsByClassId";
  56. [MBProgressHUD showLoadToView:self.view];
  57. [jiaPeiManager requestAnythingWithURL:method array:arr data:nil completion:^(NSDictionary * root) {
  58. [MBProgressHUD hideHUDForView:self.view];
  59. //NSLog(@"投诉内容-->%@-->%@",arr,root);
  60. if (!root) {
  61. ShowMsgFailed();
  62. return;
  63. }
  64. if ([root[@"code"] isEqualToString:@"1"]) {
  65. ShowMsg(root[@"body"]);
  66. return;
  67. }
  68. NSDictionary *dic = root[@"body"];
  69. // timeLabel.text = [dic[@"RC_CRDATE"] substringToIndex:16];
  70. //
  71. // NSString *contentString = [NSString stringWithFormat:@"投诉内容:%@",dic[@"RC_MARK"]];
  72. // if ([dic[@"RC_MARK"] length] < 1) {
  73. // contentString = @"投诉内容:暂无";
  74. // }
  75. // remarkLabel.height = [contentString heightForWid:kSize.width - 40 Font:Font17] + 10;
  76. // remarkLabel.text = contentString;
  77. self.coachNameLab.text = dic[@"RC_COACH_NAME"];
  78. self.tslxLab.text = dic[@"RT_TITLE"];
  79. self.timeLab.text = [dic[@"RC_CRDATE"] substringToIndex:16];
  80. self.textView.text = dic[@"RC_MARK"];
  81. }];
  82. }
  83. - (void)didReceiveMemoryWarning {
  84. [super didReceiveMemoryWarning];
  85. }
  86. @end