萤石云 iOSSDK,移植跨平台相关工程
Davin
2024-12-18 b4e1288a9b63eb820e9c9489c56aac4bf6b31067
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//
//  HDLFVVisitorRecordView.m
//  Ezviz
//
//  Created by 陈启扬 on 2022/4/29.
//  Copyright © 2022 hdl. All rights reserved.
//
 
#import "HDLEZVisitorRecordView.h"
#import "HDLEZVisitorRecordCell.h"
@implementation HDLEZVisitorRecordView{
    CGFloat cellHeight;
}
 
-(instancetype)init{
    self = [super init];
    if (self) {
        self.backgroundColor = HDLEZ_COLOR_VIEW_BACKGROUND;
 
        self.separatorStyle = NO;
        self.showsVerticalScrollIndicator=NO;
        self.delegate = self;
        self.dataSource = self;
        cellHeight=92;//根据长度调整
        [self setSeparatorInset:UIEdgeInsetsZero];
//        [self setLayoutMargins:UIEdgeInsetsZero];
    }
    
    return  self;
}
 
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}
 
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.temPList.count;
}
 
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return cellHeight;
}
 
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    HDLEZLog(@"初始化cell");
    HDLEZVisitorRecordCell *cell = [tableView dequeueReusableCellWithIdentifier:@"HDLFVVisitorRecordCell"];
    if(cell == nil){
        cell=[[HDLEZVisitorRecordCell alloc]initWithFrame:CGRectMake(0, 0, self.frame.size.width, cellHeight)];
    }
//    cell.title=HDLEZLocallizedString(@"Visitor Invitation Record");
    HDLEZTemInfoModel *model=self.temPList[indexPath.row];
    cell.tempInfo=model;
    HDLEZLog(@"初始化cell ID:%@",model.extVisitorId);
 
//    cell.describe=@"时间:2022年4月29日 16:00 ~ 2022年5月20日 16:00";
//    cell.describe=[NSString stringWithFormat:@"%@: %@ ~ %@",HDLEZLocallizedString(@"Time"),[self turnDate:model.beginTime],[self turnDate:model.endTime]];
    return cell;
 
}
 
//-(NSString *)turnDate:(NSString*)dateStr{
//    return   [HDLEZConstants turnDateString:dateStr toFormater:[NSString stringWithFormat:@"yyyy%@MM%@dd%@ HH:mm",HDLEZLocallizedString(@"Y"),HDLEZLocallizedString(@"M"),HDLEZLocallizedString(@"D")]];
//}
 
 
 
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    if (self.choseDelegate&&[self.choseDelegate respondsToSelector:@selector(visitorRecordViewdidSelectRecord:)]) {//代理
        [self.choseDelegate visitorRecordViewdidSelectRecord:self.temPList[indexPath.row]];
    }
}
 
 
-(void)setTemPList:(NSArray<HDLEZTemInfoModel *> *)temPList{
    _temPList=temPList;
    [self reloadData];
}
@end