| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- //
- // SystemDetailViewController.m
- // jitao
- //
- // Created by 罗云飞 on 2017/12/22.
- // Copyright © 2017年 罗云飞. All rights reserved.
- //
- #import "SystemDetailViewController.h"
- #import "SystemDetailModel.h"
- @interface SystemDetailViewController (){
- SystemDetailModel *model;
- }
- @end
- @implementation SystemDetailViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
- [self setNavTitle:@"系统消息"];
- [self networkrequest];
- // Do any additional setup after loading the view.
- }
- - (void)networkrequest {
- NSMutableDictionary *dic = NewMutableDictionaryInit;
- [dic safeSetObject:_messageId forKey:@"messageId"];
- [NetworkRequestManager requestGetWithInterfacePrefix:JT_readMessage parameters:dic onSuccess:^(id requestData) {
- if ([requestData[@"error"] count] !=0) {
- for (NSDictionary *dic in requestData[@"error"]) {
- [MBProgressHUD showError:dic[@"message"] toView:self.view];
- }
- }else{
- model = [[SystemDetailModel alloc] initWithDictionary:requestData[@"data"] error:nil];
- [self loadsview];
- }
- } onFailure:^{
-
- }];
- }
- #pragma mark ----加载视图----
- - (void)loadsview {
- UILabel *line = [UILabel new];
- line.backgroundColor = NewLineGrayColor;
- [self.view addSubview:line];
-
- line.sd_layout
- .leftEqualToView(self.view)
- .heightIs(10)
- .rightEqualToView(self.view)
- .topSpaceToView(self.view, NavHeader);
-
- UILabel *tishi = [UILabel new];
- tishi.text = [NSString stringWithFormat:@"提示 %@",model.createTime];
- tishi.font = NewFont(fitScreenWidth(13));
- tishi.textColor = [UIColor colorWithString:@"#9A9A9A"];
- [tishi setSingleLineAutoResizeWithMaxWidth:0];
- [self.view addSubview:tishi];
-
- tishi.sd_layout
- .leftSpaceToView(self.view, 15)
- .heightIs(15)
- .topSpaceToView(line, 15);
-
- UILabel *neirong = [UILabel new];
- neirong.text = model.body;
- neirong.font = NewFont(fitScreenWidth(14));
- neirong.numberOfLines = 0;
- [self.view addSubview:neirong];
-
- neirong.sd_layout
- .leftSpaceToView(self.view, 15)
- .topSpaceToView(tishi, 15)
- .autoHeightRatio(0)
- .rightSpaceToView(self.view, 15);
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
- }
- /*
- #pragma mark - Navigation
- // In a storyboard-based application, you will often want to do a little preparation before navigation
- - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
- // Get the new view controller using [segue destinationViewController].
- // Pass the selected object to the new view controller.
- }
- */
- @end
|