From b4e1288a9b63eb820e9c9489c56aac4bf6b31067 Mon Sep 17 00:00:00 2001
From: Davin <591807572@qq.com>
Date: 星期三, 18 十二月 2024 14:34:16 +0800
Subject: [PATCH] feature 图片资源更新

---
 EZSDK/EZSDK/EZ/UIViewControllers/EZLivePlayViewController.m |   79 +++++++++++++++++++++++++++++++++++----
 1 files changed, 71 insertions(+), 8 deletions(-)

diff --git a/EZSDK/EZSDK/EZ/UIViewControllers/EZLivePlayViewController.m b/EZSDK/EZSDK/EZ/UIViewControllers/EZLivePlayViewController.m
index fc46471..295632f 100644
--- a/EZSDK/EZSDK/EZ/UIViewControllers/EZLivePlayViewController.m
+++ b/EZSDK/EZSDK/EZ/UIViewControllers/EZLivePlayViewController.m
@@ -284,6 +284,14 @@
     return _doorPlayerView;
 }
 
+- (void)viewWillAppear:(BOOL)animated {
+    [super viewWillAppear:animated];
+    if (self.navigationController) {
+        self.navigationController.navigationBar.hidden = NO;
+        [self.navigationController setNavigationBarHidden:NO];
+    }
+}
+
 - (void)viewDidAppear:(BOOL)animated {
     [super viewDidAppear:animated];
     self.navigationController.navigationBar.hidden = NO;//2021-02-01
@@ -501,7 +509,7 @@
     [self.ignoreButton setTitle:HDLEZLocallizedString(@"device_callout_ignore") forState:UIControlStateNormal];
     self.ignoreButton.imagePosition = HDLEZOPButtonImagePositionTop;
     self.ignoreButton.spacingBetweenImageAndTitle = 12.;
-    [self.answerButton setTitle:HDLEZLocallizedString(@"device_callout_answer") forState:UIControlStateNormal];
+    [self.answerButton setTitle:HDLEZLocallizedString(@"device_callout_answered") forState:UIControlStateNormal];
     self.answerButton.imagePosition = HDLEZOPButtonImagePositionTop;
     self.answerButton.spacingBetweenImageAndTitle = 12.;
     
@@ -512,11 +520,22 @@
     [self.fullSceneToolView configPlayStatus:YES soundOn:YES videoLevel:_cameraInfo.videoLevel toolOperation:^(HDLEZVideoFullSceneOperation operationType) {
         [weakSelf doorLockFullSceneOperation:operationType];
     }];
+    
+    // 鎸傛柇寮规
+    if (_isShowAlert) {
+        [self showCallOutAlertView];
+    } else {
+        [self hiddenCallOutAlertView];
+    }
 }
 
 /*寮�閿�
  */
 -(void)unlockDoor{
+    if (![self isSupportOneKeyUnlockDoor]) {    // 涓嶆敮鎸佷竴閿紑閿�
+        [UIView dd_showMessage:@"璇ヨ澶囦笉鏀寔涓�閿紑閿�"];
+        return;
+    }
     [HDLEZAlertInputView showInputAlertWithtitle:HDLEZLocallizedString(@"device_please_input_door_password") cancleTitle:HDLEZLocallizedString(@"device_temp_cancle") sureTitle:HDLEZLocallizedString(@"device_temp_sure") keyboardType:UIKeyboardTypeASCIICapableNumberPad cancleBlock:^{
         
     } sureBlock:^(NSString * _Nonnull content) {
@@ -864,7 +883,11 @@
     self.streamToken=tokenInfo.token;
     
     if (!_unlockButton.isEnabled) {
-        [_unlockButton setImage:[UIImage imageNamed:@"hdl_ez_ic_unlock"] forState:UIControlStateNormal];
+        if ([self isSupportOneKeyUnlockDoor]) {    // 鏀寔涓�閿紑閿�
+            [_unlockButton setImage:[UIImage imageNamed:@"hdl_ez_ic_unlock"] forState:UIControlStateNormal];
+        } else {
+            [_unlockButton setImage:[UIImage imageNamed:@"hdl_ez_ic_unlock_disable"] forState:UIControlStateNormal];
+        }
         _unlockButton.enabled=YES;
     }
 }
@@ -947,7 +970,7 @@
         [self.scrollView setTranslatesAutoresizingMaskIntoConstraints:NO];
         [self.playerView setTranslatesAutoresizingMaskIntoConstraints:NO];
         [NSLayoutConstraint deactivateConstraints:@[self.scrollViewTopMargin, self.scrollViewWHRatio, self.playerViewWHRatio, self.playerViewBottomMargin]];
-        self.scrollViewTopMargin = [NSLayoutConstraint constraintWithItem:self.scrollView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.topLayoutGuide attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-HDLEZ_APP_STATUS_BAR_HEIGHT];
+        self.scrollViewTopMargin = [NSLayoutConstraint constraintWithItem:self.scrollView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.topLayoutGuide attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-[self hdlEZStatusBarHeight]];
         self.scrollViewWHRatio = [NSLayoutConstraint constraintWithItem:self.scrollView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.scrollView attribute:NSLayoutAttributeHeight multiplier:HDLEZ_APP_SCREEN_WIDTH/HDLEZ_APP_SCREEN_HEIGHT constant:0];
         
         self.playerViewWHRatio = [NSLayoutConstraint constraintWithItem:self.playerView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.playerView attribute:NSLayoutAttributeHeight multiplier:self.doorPlayerAspectRatio constant:0];
@@ -984,6 +1007,10 @@
         NSNumber *value = [NSNumber numberWithInt:UIInterfaceOrientationLandscapeLeft];
         [[UIDevice currentDevice] setValue:value forKey:@"orientation"];
     }
+    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.25 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+        [self.largeButton setImage:[UIImage imageNamed:@"preview_enlarge_full"] forState:UIControlStateNormal];
+        [self.largeButton setImage:[UIImage imageNamed:@"preview_enlarge_full_btn_sel"] forState:UIControlStateHighlighted];
+    });
 }
 
 - (IBAction)largeBack:(id)sender
@@ -1036,6 +1063,10 @@
         NSNumber *value = [NSNumber numberWithInt:UIInterfaceOrientationPortrait];
         [[UIDevice currentDevice] setValue:value forKey:@"orientation"];
     }
+    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.25 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+        [self.largeButton setImage:[UIImage imageNamed:@"preview_enlarge"] forState:UIControlStateNormal];
+        [self.largeButton setImage:[UIImage imageNamed:@"preview_enlarge_btn_sel"] forState:UIControlStateHighlighted];
+    });
 }
 
 - (IBAction)capture:(id)sender
@@ -1429,18 +1460,30 @@
 - (IBAction)clickCalloutHangupAction:(id)sender {
     self.isShowAlert = NO;
     [self closeTalkView:self.talkCloseButton];
+    if (self.msgId && self.msgId.length > 0) {
+        [[EZHttpUtil sharedManager] updateAnswerStatusWithMsgId:self.msgId answerStatus:@"no_answer" completion:^(ResponseData * _Nonnull responseData) {
+            HDLEZLog(@"###########鎸傛柇####锛�%@", [responseData yy_modelToJSONString]);
+        }];
+    }
+    [self.navigationController popViewControllerAnimated:YES];
 }
 
 - (IBAction)clickCalloutIgnoreAction:(id)sender {
 //    [UIView dd_showMessage:@"蹇界暐寮�鍙戜腑..."];
     self.isShowAlert = NO;
     self.isAnswering = NO;
+    [self.navigationController popViewControllerAnimated:YES];
 }
 
 - (IBAction)clickCalloutAnswerAction:(id)sender {
     self.isShowAlert = NO;
     self.isAnswering = YES;
     [self talkButtonClicked:self.talkButton];
+    if (self.msgId && self.msgId.length > 0) {
+        [[EZHttpUtil sharedManager] updateAnswerStatusWithMsgId:self.msgId answerStatus:@"answer" completion:^(ResponseData * _Nonnull responseData) {
+            HDLEZLog(@"###########鎺ュ惉####锛�%@", [responseData yy_modelToJSONString]);
+        }];
+    }
 }
 
 
@@ -1574,7 +1617,7 @@
         }
     }
 //    CGFloat averageWidth = [UIScreen mainScreen].bounds.size.width/5.0;
-    UIImageView *lineImageView1 = [UIView dd_instanceVerticalLine:20 color:[UIColor grayColor]];
+    UIImageView *lineImageView1 = [UIView dd_instanceVerticalLine:20 color:HDLEZHEXCOLOR(0xFFFFFF, 0.16)];
 //    lineImageView1.frame = CGRectMake(averageWidth, 7, lineImageView1.frame.size.width, lineImageView1.frame.size.height);
     [self.toolBar addSubview:lineImageView1];
     [lineImageView1 mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -1583,7 +1626,7 @@
         make.width.mas_equalTo(lineImageView1.frame.size.width);
         make.height.mas_equalTo(lineImageView1.frame.size.height);
     }];
-    UIImageView *lineImageView2 = [UIView dd_instanceVerticalLine:20 color:[UIColor grayColor]];
+    UIImageView *lineImageView2 = [UIView dd_instanceVerticalLine:20 color:HDLEZHEXCOLOR(0xFFFFFF, 0.16)];
 //    lineImageView2.frame = CGRectMake(averageWidth * 2, 7, lineImageView2.frame.size.width, lineImageView2.frame.size.height);
     [self.toolBar addSubview:lineImageView2];
     [lineImageView2 mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -1592,7 +1635,7 @@
         make.width.mas_equalTo(lineImageView2.frame.size.width);
         make.height.mas_equalTo(lineImageView2.frame.size.height);
     }];
-    UIImageView *lineImageView3 = [UIView dd_instanceVerticalLine:20 color:[UIColor grayColor]];
+    UIImageView *lineImageView3 = [UIView dd_instanceVerticalLine:20 color:HDLEZHEXCOLOR(0xFFFFFF, 0.16)];
 //    lineImageView3.frame = CGRectMake(averageWidth * 3, 7, lineImageView3.frame.size.width, lineImageView3.frame.size.height);
     [self.toolBar addSubview:lineImageView3];
     [lineImageView3 mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -1601,7 +1644,7 @@
         make.width.mas_equalTo(lineImageView3.frame.size.width);
         make.height.mas_equalTo(lineImageView3.frame.size.height);
     }];
-    UIImageView *lineImageView4 = [UIView dd_instanceVerticalLine:20 color:[UIColor grayColor]];
+    UIImageView *lineImageView4 = [UIView dd_instanceVerticalLine:20 color:HDLEZHEXCOLOR(0xFFFFFF, 0.16)];
 //    lineImageView4.frame = CGRectMake(averageWidth * 4, 7, lineImageView4.frame.size.width, lineImageView4.frame.size.height);
     [self.toolBar addSubview:lineImageView4];
     [lineImageView4 mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -1766,7 +1809,7 @@
 #pragma Setter
 - (void)setIsShowAlert:(BOOL)isShowAlert {
     _isShowAlert = isShowAlert;
-    if (isShowAlert) {
+    if (_isShowAlert) {
         [self showCallOutAlertView];
     } else {
         [self hiddenCallOutAlertView];
@@ -1786,4 +1829,24 @@
     return YES;
 }
 
+- (CGFloat)hdlEZStatusBarHeight {
+    if (@available(iOS 13.0, *)) {
+        NSSet *set = [UIApplication sharedApplication].connectedScenes;
+        UIWindowScene *windowScene = [set anyObject];
+        UIStatusBarManager *statusBarManager = windowScene.statusBarManager;
+        return statusBarManager.statusBarFrame.size.height;
+    } else {
+        return [UIApplication sharedApplication].statusBarFrame.size.height;
+    }
+}
+
+/// 鏄惁鏀寔涓�閿紑閿�
+- (BOOL)isSupportOneKeyUnlockDoor {
+    BOOL isSupport = YES;
+    if (self.deviceInfo && self.deviceInfo.deviceType && ([self.deviceInfo.deviceType containsString:@"LT20VC"] || [self.deviceInfo.deviceType containsString:@"LT20VC"])) {
+        isSupport = NO;
+    }
+    return isSupport;
+}
+
 @end

--
Gitblit v1.8.0