You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

107 lines
0 B

//
// CommMessageDetailsViewController.m
// LekangGuard
//
// Created by ecell on 2023/6/7.
//
#import "CommMessageDetailsViewController.h"
@interface CommMessageDetailsViewController ()
@property (nonatomic ,strong) UIScrollView *bgScrollView;
@end
@implementation CommMessageDetailsViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = KKWhiteColorColor;
self.zx_navTitle = self.viewType == 0 ? self.schModel.noticeSubject : self.jobModel.title;
UILabel *timeLabel = [UICommon ui_label:CGRectMake(15, iPhoneX_NavHeight+15, SCREEN_WIDTH-30, 18) lines:1 align:NSTextAlignmentCenter font:Font_(13) textColor:KKGrey121 text:self.viewType == 0 ? self.schModel.sendTime : self.jobModel.docPushTime Radius:0];
[self.view addSubview:timeLabel];
NSString *texts = self.viewType == 0 ? self.schModel.noticeMassage : self.jobModel.descriptions;
CGFloat hh = [UICommon GetTextWidth:texts ViewHeight:SCREEN_WIDTH-60 fontSize:Font_(15) type:@"h"].size.height;
CGFloat hhs = hh >= SCREEN_HEIGHT-timeLabel.bottom-45 ? SCREEN_HEIGHT-timeLabel.bottom-45 : hh+75;
[self.view addSubview:self.bgScrollView];
self.bgScrollView.frame = CGRectMake(15, timeLabel.bottom+15, SCREEN_WIDTH-30, hhs);
self.bgScrollView.contentSize = CGSizeMake(SCREEN_WIDTH-30, hh+75);
/// 内容
UILabel *textsLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentLeft font:Font_(15) textColor:KKTextBlackColor text:texts Radius:0];
[self.bgScrollView addSubview:textsLabel];
[textsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.view).inset(30);
make.top.equalTo(self.bgScrollView).offset(15);
}];
/// 发送人
UILabel *commLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentLeft font:Font_(13) textColor:UIColor.redColor text:@"" Radius:0];
commLabel.text = self.viewType == 0 ? self.schModel.noticeCreateOrgName : self.jobModel.teacherName;
[self.bgScrollView addSubview:commLabel];
[commLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.view.mas_right).inset(30);
make.top.equalTo(textsLabel.mas_bottom).offset(30);
}];
// [self setMessageRead];
}
//#pragma mark 消息已读
///// 消息已读
//- (void)setMessageRead
//{
// [UICommon MessageUpload:@"加载中"];
// NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
// NSString *url;
// if (self.viewType == 0)
// {
// url = F(@"%@%@", IsReade_GET_URL,self.schModel.noticeId);
// }
// else
// {
// url = HomeworkIsReade_GET_URL;
// [parameters setValue:self.jobModel.Id forKey:@"homeWorkId"];
// [parameters setValue:APIManager.sharedManager.userModel.userId forKey:@"stuOrFatherId"];
// }
// [[[APIManager sharedManager] APGET:url parameters:parameters resultClass:BaseModel.class] subscribeNext:^(id _Nullable x) {
// [UICommon HidenLoading];
//
// } error:^(NSError * _Nullable error) {
// NSDictionary *dic = error.userInfo;
// [UICommon MessageErrorText:dic[NSLocalizedDescriptionKey]];
// }];
//}
- (UIScrollView *)bgScrollView
{
if (!_bgScrollView)
{
_bgScrollView = [UIScrollView new];
_bgScrollView.backgroundColor = KKBackgroundGrey;
_bgScrollView.layer.cornerRadius = 5;
_bgScrollView.layer.masksToBounds = YES;
}
return _bgScrollView;
}
/*
#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