From 46af47e8d94f78dc7b52dd013f5f8b142299886d Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期四, 30 三月 2023 12:00:00 +0800
Subject: [PATCH] 2023年03月30日11:59:41

---
 HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/CommonMethod.cs |   92 ++++++++++++++++++++++++++++++---------------
 1 files changed, 61 insertions(+), 31 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/CommonMethod.cs b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/CommonMethod.cs
index 1d9736b..6613907 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/CommonMethod.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/CommonMethod.cs
@@ -2,6 +2,7 @@
 using HDL_ON.Entity;
 using System.Collections.Generic;
 using Shared;
+using HDL_ON.DAL.Server;
 #if __IOS__
 #else
 using Com.Videogo.Hdl;
@@ -278,7 +279,65 @@
         {
             return VideDoorLockSend.Current.GetVideoDoorLockLockModelsList();
         }
+        /// <summary>
+        /// 闂ㄩ攣鎺ㄩ��
+        /// </summary>
+        /// <param name="pushMessageType"></param>
+        /// <param name="jPushMessageInfo"></param>
+        public void DoorLockPush(JPushMessageInfo jpushMessageInfo)
+        {
+            this.MainThread(() =>
+            {
+                if (string.IsNullOrEmpty(jpushMessageInfo.expantContent)) return;
+                //{ "deviceSid":"J92513662","type":"opendoormsg","extDevId":"J92513662","deviceId":"1641010144999936001","spk":"security.door.ezviz"}
+                var expantContent = Newtonsoft.Json.JsonConvert.DeserializeObject<ExpantContent>(jpushMessageInfo.expantContent);
+                if (expantContent == null)
+                {
+                    return;
+                }
+                if (expantContent.spk != SPK.VideoDoorLock)
+                {
+                    return;
+                }
+                if (jpushMessageInfo.messageType.Contains(PushMessageType.DOOR_BELL.ToString()))
+                {
+                    ///鎵撳紑瑙嗛闂ㄩ攣
+                    this.SkipRTVActivity(expantContent.devSerial, expantContent.deviceId, expantContent.spk, true);
+                }
+                else if (jpushMessageInfo.messageType.Contains(PushMessageType.Alarm.ToString()))
+                {
+                    //浣庣數閲忔帹閫�
+                    this.UpdateDoorLockState(PushMessageType.Alarm);
+                }
+                else if (jpushMessageInfo.messageType.Contains(PushMessageType.Prompt.ToString()))
+                {
+                    //寮�闂ㄦ帹閫�
+                    this.UpdateDoorLockState(PushMessageType.Prompt);
+                }
+            });
 
+        }
+        /// <summary>
+        /// 鏇存柊寮�閿佸浘鏍囧拰鐢垫睜鐘舵��
+        /// </summary>
+        private void UpdateDoorLockState(PushMessageType pushMessageType)
+        {
+            int childrenCount = MainPage.BasePageView.ChildrenCount - 1;
+            for (int i = childrenCount; childrenCount > i; i--)
+            {
+                View view = MainPage.BasePageView.GetChildren(i);
+                if (view is VideoDoorLockPage)
+                {
+                    VideoDoorLockPage videoDoorLockPage = (VideoDoorLockPage)view;
+                    if (videoDoorLockPage != null)
+                    {
+                        videoDoorLockPage.UpdateState(pushMessageType);
+                    }
+
+                }
+            }
+
+        }
         /// <summary>
         /// 鑾峰彇钀ょ煶瑙嗛銆愰棬閿併�戝垪琛�
         /// </summary>
@@ -292,37 +351,6 @@
 #endif
             return list;
         }
-
-        /// <summary>
-        /// 鏇存柊寮�閿佸浘鏍囧拰鐢垫睜鐘舵��
-        /// </summary>
-        public void UpdateDoorLockState(PushMessageType pushMessageType, string homeId, string spk, string stateContent)
-        {
-            if (spk != SPK.VideoDoorLock)
-            {
-                return;
-            }
-            this.MainThread(() =>
-            {
-                int childrenCount = MainPage.BasePageView.ChildrenCount - 1;
-                for (int i = childrenCount; childrenCount > i; i--)
-                {
-                    View view = MainPage.BasePageView.GetChildren(i);
-                    if (view is VideoDoorLockPage)
-                    {
-                        VideoDoorLockPage videoDoorLockPage = (VideoDoorLockPage)view;
-                        if (videoDoorLockPage != null)
-                        {
-                            videoDoorLockPage.UpdateState(pushMessageType);
-                        }
-
-                    }
-                }
-            });
-
-        }
-
-
         #region  --------- 鍔熻兘鏂囦欢淇濆瓨锛屽垹闄� --------
         /// <summary>
         /// 淇濆瓨鏈湴鏂囦欢
@@ -482,6 +510,8 @@
                 new PublicAssmebly().TipMsgAutoClose(msg, false, time * 1000);
             });
         }
+
+     
         #endregion
         /// <summary>
         /// 寮规绫诲瀷

--
Gitblit v1.8.0