ShowCommentVC.m 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. UILabel *tslxLabel;
  14. }
  15. @end
  16. @implementation ShowCommentVC
  17. - (void)viewDidLoad {
  18. [super viewDidLoad];
  19. [self myInit];
  20. }
  21. -(void)myInit
  22. {
  23. self.view.backgroundColor = backGroundColor;
  24. self.title = @"学员投诉";
  25. [self configNavBar];
  26. CGFloat x,y,w,h,wid;
  27. x = 20;
  28. y = 20 + kNavOffSet;
  29. w = kSize.width - 2*x;
  30. h = 30;
  31. timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(x, y, w, h)];
  32. [timeLabel setText:@"" Font:Font16 TextColor:contentTextColor Alignment:NSTextAlignmentRight];
  33. [self.view addSubview:timeLabel];
  34. [timeLabel addViewWithRect:CGRectMake(10, y+h, kSize.width - 20, 1)];
  35. y += h + 10;
  36. wid = 90;
  37. UILabel *tslx = [[UILabel alloc]initWithFrame:CGRectMake(x, y, wid, h)];
  38. [tslx setText:@"投诉类型:" Font:Font16 TextColor:titleColor Alignment:NSTextAlignmentLeft];
  39. [self.view addSubview:tslx];
  40. x += wid+5;
  41. w -= wid;
  42. h = 60;
  43. tslxLabel = [[UILabel alloc] initWithFrame:CGRectMake(x, y, w, h)];
  44. tslxLabel.numberOfLines = 0;
  45. [tslxLabel setText:@"" Font:Font16 TextColor:titleColor Alignment:NSTextAlignmentLeft];
  46. [self.view addSubview:tslxLabel];
  47. x = 20;
  48. y += h + 10;
  49. h = 30;
  50. UILabel *tsnrLab = [[UILabel alloc]initWithFrame:CGRectMake(x, y, wid, h)];
  51. [tsnrLab setText:@"投诉内容:" Font:Font16 TextColor:titleColor Alignment:NSTextAlignmentLeft];
  52. [self.view addSubview:tsnrLab];
  53. x += wid+5;
  54. h = 150;
  55. remarkLabel = [[UILabel alloc] initWithFrame:CGRectMake(x, y, w, h)];
  56. remarkLabel.numberOfLines = 0;
  57. [remarkLabel setText:@"" Font:Font16 TextColor:titleColor Alignment:NSTextAlignmentLeft];
  58. [self.view addSubview:remarkLabel];
  59. [self getOrderComplaintsById];
  60. }
  61. #pragma mark 数据请求
  62. -(void)getOrderComplaintsById
  63. {
  64. [LoadingView showHUD];
  65. if (![Util connectedToNetWork]) {
  66. return;
  67. }
  68. NSMutableArray *arr=[NSMutableArray array];
  69. [arr addPro:@"classId" Value:_classID];
  70. [arr addPro:@"userId" Value:_stuId];//传outid
  71. NSString* method = @"getOrderComplaintsByClassId";
  72. [jiaPeiManager requestAnythingWithURL:method array:arr data:nil completion:^(NSDictionary * root) {
  73. RemoveHUD();
  74. //执行同步并取得结果
  75. //NSLog(@"投诉内容-->%@-->%@",arr,root);
  76. if (!root) {
  77. ShowMsgFailed();
  78. return;
  79. }
  80. if ([root[@"code"] isEqualToString:@"1"]) {
  81. ShowMsg(root[@"body"]);
  82. return;
  83. }
  84. NSDictionary *dic = root[@"body"];
  85. timeLabel.text = [dic[@"RC_CRDATE"] substringToIndex:16];
  86. NSString *titleString = [NSString stringWithFormat:@"%@",dic[@"RT_TITLE"]];
  87. if ([dic[@"RT_TITLE"] length] < 1) {
  88. titleString = @"暂无";
  89. }
  90. tslxLabel.height = [titleString heightForWid:kSize.width - 40 - 95 Font:Font16];
  91. tslxLabel.text = titleString;
  92. NSString *contentString = [NSString stringWithFormat:@"%@",dic[@"RC_MARK"]];
  93. if ([dic[@"RC_MARK"] length] < 1) {
  94. contentString = @"暂无";
  95. }
  96. remarkLabel.height = [contentString heightForWid:kSize.width - 40 - 95 Font:Font16];
  97. remarkLabel.text = contentString;
  98. }];
  99. }
  100. - (void)didReceiveMemoryWarning {
  101. [super didReceiveMemoryWarning];
  102. }
  103. @end