wjc
2023-03-28 f46be160caed45c67e8980173d29ed48d525a4d3
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;