From 54c202bd4867092fca2bc6f96bec0cfd1056a46a Mon Sep 17 00:00:00 2001 From: mac <user@users-MacBook-Pro.local> Date: 星期一, 06 十一月 2023 11:24:20 +0800 Subject: [PATCH] 2023年11月06日11:23:46 --- HDL_ON/Common/ApiUtlis.cs | 67 ++++++++++++++++++++++++++++++--- 1 files changed, 61 insertions(+), 6 deletions(-) diff --git a/HDL_ON/Common/ApiUtlis.cs b/HDL_ON/Common/ApiUtlis.cs index 46b4178..c04aa5a 100644 --- a/HDL_ON/Common/ApiUtlis.cs +++ b/HDL_ON/Common/ApiUtlis.cs @@ -104,6 +104,19 @@ code = Ins.HttpRequest.RefreshToken(); if (code != StateCode.SUCCESS) { + if (waitPage != null) + { + Application.RunOnMainThread(() => + { + try + { + waitPage.Hide(); + waitPage.RemoveFromParent(); + waitPage = null; + } + catch { } + }); + } MainPage.Log($"鍒锋柊token澶辫触"); return; } @@ -112,6 +125,19 @@ code = Ins.HttpRequest.GetHomePager(); if (code != StateCode.SUCCESS) { + if (waitPage != null) + { + Application.RunOnMainThread(() => + { + try + { + waitPage.Hide(); + waitPage.RemoveFromParent(); + waitPage = null; + } + catch { } + }); + } MainPage.Log($"鍒锋柊浣忓畢淇℃伅澶辫触"); return; } @@ -120,6 +146,19 @@ code = Ins.HttpRequest.GetUserInfo(); if (code != StateCode.SUCCESS) { + if (waitPage != null) + { + Application.RunOnMainThread(() => + { + try + { + waitPage.Hide(); + waitPage.RemoveFromParent(); + waitPage = null; + } + catch { } + }); + } MainPage.Log($"鍒锋柊涓汉淇℃伅澶辫触"); return; } @@ -178,7 +217,7 @@ FunctionList.List.ClearDatas(); //MainPage.Log($"============璁惧============寮�濮�" + FunctionList.List.Functions.Count); //MainPage.Log($"璇诲彇璁惧淇℃伅鎴愬姛"); - //MainPage.Log($"sid鍒楄〃鑾峰彇====" + deviceResult.Data.ToString()); + MainPage.Log($"sid鍒楄〃鑾峰彇====\r\n" , deviceResult.Data.ToString()); var deviceList = JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString()); if (deviceList == null) { @@ -257,8 +296,10 @@ string videoList = videoInfo.Data.ToString(); FunctionList.List.videoIntercom = JsonConvert.DeserializeObject<List<UI.UI2.FuntionControlView.Video.Video>>(videoList); - foreach (var video in FunctionList.List.videoIntercom) + for(int i =0;i< FunctionList.List.videoIntercom.Count;i++) { + var video = FunctionList.List.videoIntercom[i]; + if (video.interphoneType == InterphoneType.IMOUVISIAL.ToString()) { UI.UI2.PersonalCenter.PirDevice.PirSend.LcSubAccessToken = video.subAccountToken; @@ -272,11 +313,23 @@ } else if (video.interphoneType == InterphoneType.FREEVIEW.ToString()) { +#if __IOS__ + try + { + FunctionList.List.videoIntercom.Remove(video); + --i; + }catch(Exception ex) + { + MainPage.Log($"ios 鍏ㄨ閫氬紓甯� : {ex.Message}"); + } + +#else //涓哄叏瑙嗛�氬彲瑙嗗璁� - //DB_ResidenceData.Instance.SupportFacePass = true; - //Entity.DB_ResidenceData.Instance.SupportVisitorManage = true; - //Entity.DB_ResidenceData.Instance.SupportFVDevice = true; - //isInterphoneType_FREEVIEW = true; + DB_ResidenceData.Instance.SupportFacePass = true; + Entity.DB_ResidenceData.Instance.SupportVisitorManage = true; + Entity.DB_ResidenceData.Instance.SupportFVDevice = true; + isInterphoneType_FREEVIEW = true; +#endif } } } @@ -354,6 +407,7 @@ } + //======================缇ゆ帶==================== if (DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl) { var pack = Ins.HttpRequest.GetGroupControlList(); @@ -386,6 +440,7 @@ } readSidList.Clear(); } + //FunctionList.List.Functions.AddRange(FunctionList.List.groupControls); } if (readSidList.Count > 0) { -- Gitblit v1.8.0