JLChen
2021-08-06 edc0f0a0439f9e5a11593e21a4779fa6dbcbe49d
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
80
81
82
83
84
85
86
87
88
89
90
91
//
//  CameraListCell.m
//  EZOpenSDKDemo
//
//  Created by DeJohn Dong on 15/10/27.
//  Copyright © 2015年 Ezviz. All rights reserved.
//
 
#import "DeviceListCell.h"
#import "DDKit.h"
 
#import "UIImageView+WebCache.h"
 
@implementation DeviceListCell
 
- (void)setDeviceInfo:(EZDeviceInfo *)deviceInfo
{
    NSLog(@"deviceInfo is %@", deviceInfo);
    _deviceInfo = deviceInfo;
    
    if (_deviceInfo.status == 1)
    {
        self.offlineIcon.hidden = YES;
    }
    else
    {
        self.offlineIcon.hidden = NO;
    }
    
    if ([deviceInfo.category isEqualToString:@"KW1"]||[deviceInfo.deviceType isEqualToString:@"DS-3LHL10"]) {
        self.videoTalkButton.hidden = NO;
    }
    else {
        self.videoTalkButton.hidden = YES;
    }
    
    self.nameLabel.text = [NSString stringWithFormat:@"%@",deviceInfo.deviceName];
//        self.cameraImageView.contentMode =  UIViewContentModeScaleAspectFill;
    [self.cameraImageView sd_setImageWithURL:[NSURL URLWithString:@""] placeholderImage:[UIImage imageNamed:@"device_bg"]];
//    [self.cameraImageView sd_setImageWithURL:[NSURL URLWithString:deviceInfo.deviceCover] placeholderImage:[UIImage imageNamed:@"device_bg"]];
    
//    [EZOPENSDK capturePicture:cameraInfo.deviceSerial channelNo:cameraInfo.channelNo completion:^(NSString *url, NSError *error) {
//        if(!error){
//            [self.cameraImageView sd_setImageWithURL:[NSURL URLWithString:url]];
//        }
//    }];
//    [EZOPENSDK cap]
    
//    //2021-05-08 隐藏录像按钮
//    self.recordButton.hidden = YES;
    
    self.messageButton.hidden = NO;
    self.settingButton.hidden = NO;
    
    if (self.isShared)
    {
        self.messageButton.hidden = YES;
        self.settingButton.hidden = YES;
    }
    [self.contentView dd_addSeparatorWithType:ViewSeparatorTypeBottom];
}
 
- (IBAction)go2Play:(id)sender
{
    [self.parentViewController performSelector:@selector(go2Play:) withObject:_deviceInfo];
}
 
- (IBAction)go2Record:(id)sender
{
    [self.parentViewController performSelector:@selector(go2Record:) withObject:_deviceInfo];
}
 
- (IBAction)go2Setting:(id)sender
{
    [self.parentViewController performSelector:@selector(go2Setting:) withObject:_deviceInfo];
}
 
- (IBAction)go2Message:(id)sender
{
    [self.parentViewController performSelector:@selector(go2Message:) withObject:_deviceInfo];
}
 
- (IBAction)go2VideoTalk:(id)sender {
    [self.parentViewController performSelector:@selector(go2VideoTalk:) withObject:_deviceInfo];
}
 
//- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
//    NSLog(@"touches = %@, event = %@", touches, event);
//}
 
@end