From 011b0cc918bfa0e36a9ad4a0f45c18b801815920 Mon Sep 17 00:00:00 2001 From: Davin <591807572@qq.com> Date: 星期四, 15 六月 2023 21:00:36 +0800 Subject: [PATCH] faeture 历史消息 --- EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZDeviceMsgListView.m | 48 +++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 43 insertions(+), 5 deletions(-) diff --git a/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZDeviceMsgListView.m b/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZDeviceMsgListView.m index a8e76b8..5fc3518 100644 --- a/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZDeviceMsgListView.m +++ b/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZDeviceMsgListView.m @@ -7,6 +7,14 @@ #import "HDLEZDeviceMsgListView.h" #import "HDLEZDeviceMsgCell.h" +#import "HDLEZVideoDoorMsgCell.h" + +@interface HDLEZDeviceMsgListView () + +@property (copy, nonatomic) void(^previewPic)(NSString *pictureUrl); + +@end + @implementation HDLEZDeviceMsgListView{ CGFloat cellHeight; } @@ -21,7 +29,7 @@ self.showsVerticalScrollIndicator=NO; self.delegate = self; self.dataSource = self; - cellHeight=65; + cellHeight=80; [self setSeparatorInset:UIEdgeInsetsZero]; // [self setLayoutMargins:UIEdgeInsetsZero]; } @@ -43,18 +51,48 @@ -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ HDLEZLog(@"鍒濆鍖朿ell"); - HDLEZDeviceMsgCell *cell = [tableView dequeueReusableCellWithIdentifier:@"HDLEZDeviceMsgCell"]; + HDLEZVideoDoorMsgCell *cell = [tableView dequeueReusableCellWithIdentifier:@"HDLEZVideoDoorMsgCell"]; if(cell == nil){ - cell=[[HDLEZDeviceMsgCell alloc]initWithFrame:CGRectMake(0, 0, self.frame.size.width, cellHeight)]; + cell=[[HDLEZVideoDoorMsgCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"HDLEZVideoDoorMsgCell"]; } - HDLEZDeviceMsgInfoModel *model=self.msgList[indexPath.row]; - cell.msgInfo=model; + [self configCell:cell indexPath:indexPath]; +// HDLEZDeviceMsgCell *cell = [tableView dequeueReusableCellWithIdentifier:@"HDLEZDeviceMsgCell"]; +// if(cell == nil){ +// cell=[[HDLEZDeviceMsgCell alloc]initWithFrame:CGRectMake(0, 0, self.frame.size.width, cellHeight)]; +// } +// HDLEZDeviceMsgInfoModel *model=self.msgList[indexPath.row]; +// cell.msgInfo=model; // HDLEZLog(@"鍒濆鍖朿ell ID:%@",model.extVisitorId); return cell; } +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + if (self.msgList.count <= indexPath.row) return; + HDLEZDeviceMsgInfoModel *messageModel = self.msgList[indexPath.row]; +#warning mock + NSString *tempPicUrl = @"https://upload-images.jianshu.io/upload_images/5809200-a99419bb94924e6d.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"; + if (self.previewPic) { + self.previewPic(tempPicUrl); + } +} + +#pragma mark - PublishMethod +- (void)previewPicture:(void(^)(NSString *pictureUrl))previewPic { + self.previewPic = previewPic; +} + +#pragma mark - PrivateMethod +- (void)configCell:(HDLEZVideoDoorMsgCell *)cell indexPath:(NSIndexPath *)indexPath { + if (self.msgList.count <= indexPath.row) return; + + HDLEZDeviceMsgInfoModel *messageModel = self.msgList[indexPath.row]; +#warning mock + NSString *tempPicUrl = @"https://upload-images.jianshu.io/upload_images/5809200-a99419bb94924e6d.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"; + [cell configMessageInfoWithTitle:messageModel.title deviceStatus:@"鏈帴鍚�" messageTime:messageModel.createTime messageImage:tempPicUrl]; +} + /*璁剧疆娑堟伅鍒楄〃鍊� */ -(void)setMsgList:(NSArray<HDLEZDeviceMsgInfoModel *> *)msgList{ -- Gitblit v1.8.0