| | |
| | | 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]; |
| | | } |
| | |
| | | } |
| | | |
| | | -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ |
| | | return cellHeight; |
| | | return UITableViewAutomaticDimension; |
| | | } |
| | | |
| | | -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ |
| | | HDLEZLog(@"初始化cell"); |
| | | HDLEZVideoDoorMsgCell *cell = [tableView dequeueReusableCellWithIdentifier:@"HDLEZVideoDoorMsgCell"]; |
| | | HDLEZVideoDoorMsgCell *cell = [tableView dequeueReusableCellWithIdentifier:@"HDLEZVideoDoorMsgCell" forIndexPath:indexPath]; |
| | | if(cell == nil){ |
| | | cell=[[HDLEZVideoDoorMsgCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"HDLEZVideoDoorMsgCell"]; |
| | | } |
| | |
| | | - (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); |
| | | } |
| | | } |
| | | |
| | |
| | | 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)]; |
| | | } |
| | | |
| | | /*设置消息列表值 |