From 372ebbd137d2951a7ac03b964d530d05ad7a5971 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期三, 15 三月 2023 18:17:04 +0800
Subject: [PATCH] 2023年03月15日18:16:54

---
 HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideDoorLockSend.cs |   66 ++++++++++++++++++++++-----------
 1 files changed, 44 insertions(+), 22 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideDoorLockSend.cs b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideDoorLockSend.cs
index 223108b..fe1a0f0 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideDoorLockSend.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideDoorLockSend.cs
@@ -36,7 +36,8 @@
         /// </summary>
         /// <param name="function">褰撳墠鐨勮澶�</param>
         /// <param name="action">鍥炶皟缁撴灉</param>
-        public void DelDevice(Function function, Action<bool> action)
+        /// <param name="tipType">鏄惁闇�瑕佹彁绀�,榛樿鎻愮ず</param>
+        public void DelDevice(Function function, Action<bool> action, TipType tipType = TipType.flicker)
         {
             new Thread(() =>
             {
@@ -47,7 +48,7 @@
                     d.Add("deviceSerial", function.sid);//绛夊悓闂ㄩ攣搴忓垪鍙�
                     d.Add("platform", 1);//骞冲彴
                     var responsePackNew = UI.Music.SendMethod.Current.RequestServerhomeId(d, NewAPI.Api_Post_DeleteDevice, "鍒犻櫎钀ょ煶闂ㄩ攣璁惧");
-                    if (!this.DataChecking(responsePackNew))
+                    if (!this.DataChecking(responsePackNew, tipType))
                     {
                         return;
                     }
@@ -68,6 +69,7 @@
         /// 鑾峰彇闂ㄩ攣鐘舵��(钀ょ煶瑙嗛闂ㄩ攣)
         /// </summary>
         /// <param name="function">褰撳墠鐨勮澶�</param>
+        /// <param name="tipType">鏄惁闇�瑕佹彁绀�,榛樿鎻愮ず</param>
         /// <param name="return">杩斿洖缁撴灉涓嶄細涓簄ull</param>
         public VideoDoorLockInfo GetVideoDoorLockState(Function function, TipType tipType = TipType.flicker)
         {
@@ -76,7 +78,7 @@
             d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             d.Add("deviceId", function.deviceId);
             var responsePackNew = UI.Music.SendMethod.Current.RequestServerhomeId(d, NewAPI.Api_Post_Lockstatus, "鑾峰彇钀ょ煶瑙嗛闂ㄩ攣鐘舵��");
-            if (!this.DataChecking(responsePackNew))
+            if (!this.DataChecking(responsePackNew,tipType))
             {
                 return new VideoDoorLockInfo();
             }
@@ -95,6 +97,7 @@
         /// 鑾峰彇鐢垫睜鐢甸噺(钀ょ煶瑙嗛闂ㄩ攣)
         /// </summary>
         /// <param name="function">褰撳墠鐨勮澶�</param>
+        /// <param name="tipType">鏄惁闇�瑕佹彁绀�,榛樿鎻愮ず</param>
         /// <param name="return">杩斿洖缁撴灉涓嶄細涓簄ull</param>
         public CellInfo GetCellValue(Function function, TipType tipType = TipType.flicker)
         {
@@ -102,7 +105,7 @@
             d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             d.Add("deviceId", function.deviceId);
             var responsePackNew = UI.Music.SendMethod.Current.RequestServerhomeId(d, NewAPI.Api_Post_Details, "鑾峰彇钀ょ煶闂ㄩ攣璁惧鐢甸噺");
-            if (!this.DataChecking(responsePackNew))
+            if (!this.DataChecking(responsePackNew,tipType))
             {
                 return new CellInfo();
             }
@@ -119,21 +122,22 @@
         /// 鑾峰彇闂ㄩ攣鐢ㄦ埛鍒楄〃(钀ょ煶瑙嗛闂ㄩ攣)
         /// </summary>
         /// <param name="function">褰撳墠鐨勮澶�</param>
-        ///    /// <param name="return">杩斿洖缁撴灉涓嶄細涓簄ull</param>
-        public List<UserInfo> GetVideoDoorLockUserListInfo(Function function, TipType tipType = TipType.flicker)
+        /// <param name="tipType">鏄惁闇�瑕佹彁绀�,榛樿鎻愮ず</param>
+        /// <param name="return">杩斿洖缁撴灉涓嶄細涓簄ull</param>
+        public List<UserVideoDoorLockInfo> GetVideoDoorLockUserListInfo(Function function, TipType tipType = TipType.flicker)
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
             d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             d.Add("deviceId", function.deviceId);
             var responsePackNew = UI.Music.SendMethod.Current.RequestServerhomeId(d, NewAPI.Api_Post_UserList, "鑾峰彇钀ょ煶闂ㄩ攣鐢ㄦ埛鍒楄〃");
-            if (!this.DataChecking(responsePackNew))
+            if (!this.DataChecking(responsePackNew, tipType))
             {
-                return new List<UserInfo>();
+                return new List<UserVideoDoorLockInfo>();
             }
-            var list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<UserInfo>>(responsePackNew.Data.ToString());
+            var list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<UserVideoDoorLockInfo>>(responsePackNew.Data.ToString());
             if (list == null)
             {
-                return new List<UserInfo>();
+                return new List<UserVideoDoorLockInfo>();
             }
             return list;
         }
@@ -141,15 +145,16 @@
         /// 鑾峰彇闂ㄩ攣璁惧鍒楄〃(钀ょ煶瑙嗛闂ㄩ攣)
         /// </summary>
         /// <param name="spk">鎸囧畾spk鑾峰彇</param>
-        /// <returns></returns>
-        public List<Function> GetVideoDoorLockDeviceList(string spk)
+        /// <param name="tipType">鏄惁闇�瑕佹彁绀�,榛樿鎻愮ず</param>
+        /// <returns>杩斿洖缁撴灉涓嶄細涓簄ull</returns>
+        public List<Function> GetVideoDoorLockDeviceList(string spk, TipType tipType = TipType.flicker)
         {
 
             Dictionary<string, object> d = new Dictionary<string, object>();
             d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             d.Add("spk", spk);
             var responsePackNew = UI.Music.SendMethod.Current.RequestServerhomeId(d, NewAPI.Api_Post_UserList, "鑾峰彇钀ょ煶闂ㄩ攣璁惧鍒楄〃");
-            if (!this.DataChecking(responsePackNew))
+            if (!this.DataChecking(responsePackNew, tipType))
             {
                 return new List<Function>();
             }
@@ -161,12 +166,26 @@
             return list;
         }
         /// <summary>
+        /// 鍏堣幏鍙栬悿鐭充簯瀛愯处鍙穞oken
+        /// </summary>
+        /// <param name="tipType">鏄惁闇�瑕佹彁绀�,榛樿鎻愮ず</param>
+        public string GetEZGetChildToken(TipType tipType = TipType.flicker)
+        {
+            //鍏堣幏鍙栬悿鐭充簯瀛愯处鍙穞oken
+            var responsePackNew = new HttpServerRequest().EZGetChildToken();
+            if (!this.DataChecking(responsePackNew, tipType))
+            {
+                return "";
+            }
+            return responsePackNew.Data.ToString();
+        }
+        /// <summary>
         /// 妫�楠屾暟鎹洖澶嶆垚鍔熸垨鑰呭け璐�
         /// </summary>
         /// <param name="responsePackNew">鍥炲鏁版嵁瀵硅薄</param>
-        /// <param name="tipType">鏄惁闇�瑕佹彁绀�,榛樿鎻愮ず</param>
+        /// <param name="tipType">鏄惁闇�瑕佹彁绀�</param>
         /// <returns></returns>
-        private bool DataChecking(ResponsePackNew responsePackNew, TipType tipType = TipType.flicker)
+        private bool DataChecking(ResponsePackNew responsePackNew, TipType tipType)
         {
             if (responsePackNew.Data == null || responsePackNew.Code != "0" || responsePackNew.Data.ToString() == "")
             {
@@ -175,14 +194,17 @@
                     if (responsePackNew == null)
                     {
                         responsePackNew = new ResponsePackNew { message = "娌″洖澶�,璇风‘璁ょ綉缁滄槸鍚︽甯�.", Code = "-1", };
-
                     }
-                    //new Tip()
-                    //{
-                    //    CloseTime = 1,
-                    //    Text = responsePackNew.message + "(" + responsePackNew.Code + ")",
-                    //    Direction = AMPopTipDirection.None,
-                    //}.Show(MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1));
+                    Application.RunOnMainThread(() =>
+                    {
+                        //new Tip()
+                        //{
+                        //    CloseTime = 1,
+                        //    Text = responsePackNew.message + "(" + responsePackNew.Code + ")",
+                        //    Direction = AMPopTipDirection.None,
+                        //}.Show(MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1));
+                        CommonMethod.Current.ShowTip(responsePackNew.message + "(" + responsePackNew.Code + ")");
+                    });
                 }
                 return false;
             }

--
Gitblit v1.8.0