From 413b74eb37fa6b9e7ae38b22e8d777a74bd7a972 Mon Sep 17 00:00:00 2001
From: Davin <591807572@qq.com>
Date: 星期三, 21 六月 2023 15:09:03 +0800
Subject: [PATCH] feature 门锁历史记录UI调整

---
 EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZDeviceMsgListView.m |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZDeviceMsgListView.m b/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZDeviceMsgListView.m
index 5fc3518..f1f1cdc 100644
--- a/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZDeviceMsgListView.m
+++ b/EZSDK/EZSDK/EZ/TempPassword/Views/HDLEZDeviceMsgListView.m
@@ -30,6 +30,9 @@
         self.delegate = self;
         self.dataSource = self;
         cellHeight=80;
+        self.rowHeight = UITableViewAutomaticDimension;
+        self.estimatedRowHeight = 80;
+        [self registerClass:[HDLEZVideoDoorMsgCell class] forCellReuseIdentifier:@"HDLEZVideoDoorMsgCell"];
         [self setSeparatorInset:UIEdgeInsetsZero];
 //        [self setLayoutMargins:UIEdgeInsetsZero];
     }
@@ -46,12 +49,12 @@
 }
 
 -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
-    return cellHeight;
+    return UITableViewAutomaticDimension;
 }
 
 -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
     HDLEZLog(@"鍒濆鍖朿ell");
-    HDLEZVideoDoorMsgCell *cell = [tableView dequeueReusableCellWithIdentifier:@"HDLEZVideoDoorMsgCell"];
+    HDLEZVideoDoorMsgCell *cell = [tableView dequeueReusableCellWithIdentifier:@"HDLEZVideoDoorMsgCell" forIndexPath:indexPath];
     if(cell == nil){
         cell=[[HDLEZVideoDoorMsgCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"HDLEZVideoDoorMsgCell"];
     }
@@ -71,10 +74,8 @@
 - (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);
+        self.previewPic(messageModel.imageUrl);
     }
 }
 
@@ -88,9 +89,16 @@
     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];
+    NSString *stataus = @"";
+    if (indexPath.row == 0) {
+        stataus = @"鏈帴";
+    } else if (indexPath.row == 1) {
+        stataus = @"宸叉帴";
+    }
+    [cell configMessageInfoWithTitle:messageModel.title deviceStatus:stataus messageTime:messageModel.createTime messageImage:indexPath.row != 0 ? messageModel.imageUrl : @""];
+    [cell showSpearator:(self.msgList.count != indexPath.row + 1)];
 }
 
 /*璁剧疆娑堟伅鍒楄〃鍊�

--
Gitblit v1.8.0