From eaaa2635f9ef5e431e00df922731a54c20cf7016 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期一, 31 七月 2023 19:41:58 +0800
Subject: [PATCH] 三相空开备份

---
 HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs |   25 +++++++++++++++++--------
 1 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs
index 2c1ce82..1ca1b0f 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs
@@ -86,7 +86,7 @@
                 d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
                 d.Add("deviceIds", functionIds);
                 var responsePackNew = RequestServerhomeId(d, NewAPI.Api_Post_RefreshDeviceStatus, "鍒锋柊璁惧鐘舵��");
-                if (!this.dataChecking(responsePackNew))
+                if (!this.DataChecking(responsePackNew))
                 {
                     return;
                 }
@@ -113,8 +113,9 @@
         /// 鑾峰彇褰撳墠鎾斁闊充箰鍒楄〃
         /// </summary>
         /// <param name="music">闊充箰鎾斁鍣�</param>
+        /// <param name="action">鍥炶皟</param>
         /// <returns></returns>
-        public void GetCurrentPalyList(Function music)
+        public void GetCurrentPalyList(Function music, Action action)
         {
             try
             {
@@ -122,7 +123,7 @@
                 d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
                 d.Add("deviceIds", new List<string> { music.deviceId });
                 var responsePackNew = RequestServerhomeId(d, NewAPI.Api_Post_PlayerList, "鑾峰彇闊充箰鍒楄〃");
-                if (!this.dataChecking(responsePackNew))
+                if (!this.DataChecking(responsePackNew))
                 {
                     return;
                 }
@@ -141,6 +142,13 @@
             }
             catch
             {
+            }
+            finally
+            {
+                Application.RunOnMainThread(() =>
+                {
+                    action();
+                });
             }
 
         }
@@ -165,7 +173,7 @@
                 }
                 d.Add("deviceInfos", new List<Dictionary<string, object>> { deviceIds });
                 var responsePackNew = RequestServerhomeId(d, NewAPI.Api_Post_GroupList, "鑾峰彇鍒楄〃鍚嶅垪琛�");
-                if (!this.dataChecking(responsePackNew))
+                if (!this.DataChecking(responsePackNew))
                 {
                     return new List<GroupList>();
                 }
@@ -230,7 +238,7 @@
                 d.Add("sidGroups", new List<Dictionary<string, object>> { d1 });
 
                 var responsePackNew = RequestServerhomeId(d, NewAPI.Api_Post_GroupPlayerList, "閫氳繃鍒楄〃鍚嶈幏鍙栨瓕鏇插垪琛�");
-                if (!this.dataChecking(responsePackNew))
+                if (!this.DataChecking(responsePackNew))
                 {
                     return new List<PalyerSongListInfo>();
                 }
@@ -274,10 +282,11 @@
         /// </summary>
         /// <param name="responsePackNew">鍥炲鏁版嵁瀵硅薄</param>
         /// <returns></returns>
-        private bool dataChecking(ResponsePackNew responsePackNew)
+        private bool DataChecking(ResponsePackNew responsePackNew)
         {
-            if (responsePackNew.Code != "0" || responsePackNew.Data == null || responsePackNew.Data.ToString() == "")
+            if (responsePackNew.Data == null||responsePackNew.Code != "0"  || responsePackNew.Data.ToString() == "")
             {
+                
                 return false;
             }
             return true;
@@ -290,7 +299,7 @@
         /// <param name="api_Url">璇锋眰鍦板潃(涓嶆槸缁濆鍦板潃)</param>
         /// <param name="tag">鏍囪->鎻忚堪鎺ュ彛(鑷畾涔�)</param>
         /// <returns></returns>
-        public ResponsePackNew RequestServerhomeId(object o, string api_Url, string tag, int mTimeout = 5)
+        public ResponsePackNew RequestServerhomeId(object o, string api_Url, string tag, int mTimeout = 15)
         {
             JObject jobject = JObject.Parse(Newtonsoft.Json.JsonConvert.SerializeObject(o));
             return UI2.Intelligence.Automation.Send.Current.RequestServerhomeId(jobject, api_Url, tag, mTimeout);

--
Gitblit v1.8.0