From 2e12a9190f431565e576d0b05866366d15bcc9ae Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 23 六月 2022 11:07:37 +0800 Subject: [PATCH] 修复场景闪退问题 --- HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs | 27 ++++++++++++++++++--------- 1 files changed, 18 insertions(+), 9 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs index 70026c6..0fde19f 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs @@ -12,7 +12,7 @@ { public class SendMethod { - private static SendMethod sMethod=null; + private static SendMethod sMethod = null; public static SendMethod mMethod { get @@ -44,11 +44,12 @@ { new System.Threading.Thread(() => { - DriverLayer.Control.Ins.SendWriteCommand(function, dic); + DriverLayer.Control.Ins.SendWriteCommand(function, dic,false,0); }) { IsBackground = true }.Start(); } - + //璁板綍姝屾洸鎾斁鏃堕棿 + private int songPlayTime = -1; /// <summary> /// 鑾峰彇璁惧鏈�鏂扮殑鐘舵�� /// </summary> @@ -57,8 +58,8 @@ { try { - // RefreshDeviceStatus(functionIds); - a31Music.LastDateTime = DateTime.Now; + //RefreshDeviceStatus(functionIds); + //a31Music.LastDateTime = DateTime.Now; ///浠庣紦瀛橀噷闈㈡煡鎵鹃煶涔愭挱鏀惧櫒瀵硅薄<缂撳瓨鏁版嵁鏀跺埌鎺ㄩ�佽繃鏉ョ殑鐘舵�佷細鏇存柊缂撳瓨鏁版嵁> var allLocalFuntion = FunctionList.List.GetDeviceFunctionList(); var localFunction = allLocalFuntion.Find((obj) => obj.sid == sid); @@ -68,6 +69,13 @@ } ///鏇存柊鐨勬暟鎹� a31Music.functionMusic = localFunction; + if (int.Parse(A31MusicModel.Current.functionMusic.GetAttrState(UI2.FuntionControlView.Music.KeyProperty.playing_time)) != songPlayTime) + { + ///姝屾洸璁板綍鏃堕棿鍜屽綋鍓嶆椂闂翠笉涓�鏍凤紝绔嬪嵆鏇存柊鏁版嵁鍙嶉鏃堕棿 + a31Music.LastDateTime = DateTime.Now; + ///姝屾洸璁板綍鏃堕棿鍜屽綋鍓嶆椂闂翠笉涓�鏍凤紝绔嬪嵆鏇存柊姝屾洸鎾斁鏃堕棿 + songPlayTime = int.Parse(A31MusicModel.Current.functionMusic.GetAttrState(UI2.FuntionControlView.Music.KeyProperty.playing_time)); + } } catch { } @@ -89,6 +97,7 @@ { return; } + } catch { } } @@ -121,7 +130,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 (responsePackNew.Code != "0"||responsePackNew.Data == null ||responsePackNew.Data.ToString() == "") + if (responsePackNew.Code != "0" || responsePackNew.Data == null || responsePackNew.Data.ToString() == "") { return; } @@ -130,7 +139,7 @@ var palyLists = Newtonsoft.Json.JsonConvert.DeserializeObject<List<PalyListInfo>>(str); if (palyLists == null) { - palyLists =new List<PalyListInfo>(); + palyLists = new List<PalyListInfo>(); } if (palyLists.Count > 0) { @@ -143,12 +152,12 @@ } } - + /// <summary> ///璇锋眰鏈嶅姟鍣紙涓庝綇瀹呮湁鍏�:渚嬪锛沨omeId锛� /// </summary> /// <returns></returns> - public ResponsePackNew RequestServerhomeId(object o, string api_Url, int mTimeout = 5) + public ResponsePackNew RequestServerhomeId(object o, string api_Url, int mTimeout = 5) { var requestJson = HttpUtil.GetSignRequestJson(o); return HttpUtil.RequestHttpsPostFroHome(api_Url, requestJson, mTimeout); -- Gitblit v1.8.0