SystemDetailViewController.m 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. //
  2. // SystemDetailViewController.m
  3. // jitao
  4. //
  5. // Created by 罗云飞 on 2017/12/22.
  6. // Copyright © 2017年 罗云飞. All rights reserved.
  7. //
  8. #import "SystemDetailViewController.h"
  9. #import "SystemDetailModel.h"
  10. @interface SystemDetailViewController (){
  11. SystemDetailModel *model;
  12. }
  13. @end
  14. @implementation SystemDetailViewController
  15. - (void)viewDidLoad {
  16. [super viewDidLoad];
  17. [self setNavTitle:@"系统消息"];
  18. [self networkrequest];
  19. // Do any additional setup after loading the view.
  20. }
  21. - (void)networkrequest {
  22. NSMutableDictionary *dic = NewMutableDictionaryInit;
  23. [dic safeSetObject:_messageId forKey:@"messageId"];
  24. [NetworkRequestManager requestGetWithInterfacePrefix:JT_readMessage parameters:dic onSuccess:^(id requestData) {
  25. if ([requestData[@"error"] count] !=0) {
  26. for (NSDictionary *dic in requestData[@"error"]) {
  27. [MBProgressHUD showError:dic[@"message"] toView:self.view];
  28. }
  29. }else{
  30. model = [[SystemDetailModel alloc] initWithDictionary:requestData[@"data"] error:nil];
  31. [self loadsview];
  32. }
  33. } onFailure:^{
  34. }];
  35. }
  36. #pragma mark ----加载视图----
  37. - (void)loadsview {
  38. UILabel *line = [UILabel new];
  39. line.backgroundColor = NewLineGrayColor;
  40. [self.view addSubview:line];
  41. line.sd_layout
  42. .leftEqualToView(self.view)
  43. .heightIs(10)
  44. .rightEqualToView(self.view)
  45. .topSpaceToView(self.view, NavHeader);
  46. UILabel *tishi = [UILabel new];
  47. tishi.text = [NSString stringWithFormat:@"提示 %@",model.createTime];
  48. tishi.font = NewFont(fitScreenWidth(13));
  49. tishi.textColor = [UIColor colorWithString:@"#9A9A9A"];
  50. [tishi setSingleLineAutoResizeWithMaxWidth:0];
  51. [self.view addSubview:tishi];
  52. tishi.sd_layout
  53. .leftSpaceToView(self.view, 15)
  54. .heightIs(15)
  55. .topSpaceToView(line, 15);
  56. UILabel *neirong = [UILabel new];
  57. neirong.text = model.body;
  58. neirong.font = NewFont(fitScreenWidth(14));
  59. neirong.numberOfLines = 0;
  60. [self.view addSubview:neirong];
  61. neirong.sd_layout
  62. .leftSpaceToView(self.view, 15)
  63. .topSpaceToView(tishi, 15)
  64. .autoHeightRatio(0)
  65. .rightSpaceToView(self.view, 15);
  66. }
  67. - (void)didReceiveMemoryWarning {
  68. [super didReceiveMemoryWarning];
  69. // Dispose of any resources that can be recreated.
  70. }
  71. /*
  72. #pragma mark - Navigation
  73. // In a storyboard-based application, you will often want to do a little preparation before navigation
  74. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  75. // Get the new view controller using [segue destinationViewController].
  76. // Pass the selected object to the new view controller.
  77. }
  78. */
  79. @end