From 77e52ec080dd90c67aef9ea69c82e2c90130874f Mon Sep 17 00:00:00 2001 From: wxr <wxr@hdlchina.com.cn> Date: 星期一, 28 十月 2024 10:44:57 +0800 Subject: [PATCH] Update RegisterPageBLL.cs --- HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs | 54 +++++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 39 insertions(+), 15 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs index 7aed7ce..11bdd88 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs @@ -77,8 +77,9 @@ /// <summary> /// 鍒锋柊璁惧鐘舵�� /// </summary> + /// <param name="tipType">鏄惁闇�瑕佹彁绀�,榛樿鎻愮ず</param> /// <returns></returns> - public void RefreshDeviceStatus(List<string> functionIds) + public void RefreshDeviceStatus(List<string> functionIds,TipType tipType = TipType.flicker) { try { @@ -86,7 +87,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, tipType)) { return; } @@ -114,8 +115,9 @@ /// </summary> /// <param name="music">闊充箰鎾斁鍣�</param> /// <param name="action">鍥炶皟</param> + /// <param name="tipType">鏄惁闇�瑕佹彁绀�,榛樿鎻愮ず</param> /// <returns></returns> - public void GetCurrentPalyList(Function music, Action action) + public void GetCurrentPalyList(Function music, Action action, TipType tipType = TipType.flicker) { try { @@ -123,7 +125,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,tipType)) { return; } @@ -157,8 +159,9 @@ /// </summary> /// <param name="music"></param> /// <param name="source">闊充箰婧愪负null,鏀寔澶氫釜婧愯幏鍙�</param> + /// <param name="tipType">鏄惁闇�瑕佹彁绀�,榛樿鎻愮ず</param> /// <returns></returns> - public List<GroupList> GetMultipleSourceListName(Function music, string source) + public List<GroupList> GetMultipleSourceListName(Function music, string source,TipType tipType=TipType.flicker) { try { @@ -173,7 +176,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, tipType)) { return new List<GroupList>(); } @@ -209,7 +212,7 @@ return groupList.Count > 0 ? groupList[0] : new GroupList(); } - + /// <summary> @@ -218,8 +221,9 @@ /// <param name="music"></param> /// <param name="listName">鍒楄〃鍚�</param> /// <param name="source">闊充箰婧�</param> + /// <param name="tipType">鏄惁闇�瑕佹彁绀�,榛樿鎻愮ず</param> /// <returns></returns> - public List<PalyerSongListInfo> GetMultipleSongListM(Function music, string listName, string source) + public List<PalyerSongListInfo> GetMultipleSongListM(Function music, string listName, string source, TipType tipType= TipType.flicker) { try { @@ -238,7 +242,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, tipType)) { return new List<PalyerSongListInfo>(); } @@ -265,9 +269,9 @@ /// <param name="listName">鍒楄〃鍚�</param> /// <param name="source">闊充箰婧�</param> /// <returns></returns> - public SongList GetSingleSongList(Function music, string listName, string source) + public SongList GetSingleSongList(Function music, string listName, string source, TipType tipType= TipType.flicker) { - List<PalyerSongListInfo> listInfos = this.GetMultipleSongListM(music, listName, source); + List<PalyerSongListInfo> listInfos = this.GetMultipleSongListM(music, listName, source, tipType); if (listInfos.Count == 0) { return new SongList(); @@ -277,20 +281,40 @@ return songList; } + + /// <summary> /// <summary> /// 妫�楠屾暟鎹洖澶嶆垚鍔熸垨鑰呭け璐� /// </summary> /// <param name="responsePackNew">鍥炲鏁版嵁瀵硅薄</param> + /// <param name="tipType">鏄惁闇�瑕佹彁绀�</param> /// <returns></returns> - private bool DataChecking(ResponsePackNew responsePackNew) + private bool DataChecking(ResponsePackNew responsePackNew, TipType tipType) { - if (responsePackNew.Data == null||responsePackNew.Code != "0" || responsePackNew.Data.ToString() == "") + if (responsePackNew.Data == null || responsePackNew.Code != "0" || responsePackNew.Data.ToString() == "") { - + if (TipType.flicker == tipType) + { + if (responsePackNew == null) + { + responsePackNew = new ResponsePackNew { message = "娌″洖澶�,璇风‘璁ょ綉缁滄槸鍚︽甯�.", Code = "-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 + ")", 3); + }); + } return false; } return true; } + /// <summary> ///璇锋眰鏈嶅姟鍣紙涓庝綇瀹呮湁鍏�:渚嬪锛沨omeId锛� @@ -299,7 +323,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 = 10) { 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