From 02ef7fd8315dfa7a5d8d3ddc0d04a3d4625dc0b5 Mon Sep 17 00:00:00 2001 From: wxr <wxr@hdlchina.com.cn> Date: 星期一, 02 九月 2024 16:56:34 +0800 Subject: [PATCH] 增加面板地暖SPK;增加安卓金茂热水器,光伏储能切图 --- HDL_ON/Common/ApiUtlis.cs | 30 ++++++++++++++++++++++++------ 1 files changed, 24 insertions(+), 6 deletions(-) diff --git a/HDL_ON/Common/ApiUtlis.cs b/HDL_ON/Common/ApiUtlis.cs index 09393f6..9040806 100644 --- a/HDL_ON/Common/ApiUtlis.cs +++ b/HDL_ON/Common/ApiUtlis.cs @@ -72,6 +72,8 @@ /// 涓嬭浇鏁版嵁瀹屾垚鏍囪 /// </summary> public bool DownloadDataComplete = false; + + public bool hadInternet = true; /// <summary> /// 涓嬭浇鏁版嵁 /// </summary> @@ -97,20 +99,19 @@ string code = StateCode.SUCCESS; Inverter.Ins.H5Page = null;//閲嶇疆鍏変紡椤甸潰 - var downloadDataThread = new System.Threading.Thread(() => { try { //澧炲姞3绉掍簯鏈嶅姟鍣ㄨ繛鎺ユ娴嬶紝杩炰笉涓婃湇鍔″櫒鐨勬椂鍊欎笉鍒锋柊鏁版嵁 + hadInternet = true; var dataList = new List<GlobalRegionListRes>(); var requestJson = HttpUtil.GetSignRequestJson(new GetRegionListObj() { regionMark = HttpUtil.RegionMark }); - Console.WriteLine(DateTime.Now); - var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_GlobalRegionList, requestJson, HttpUtil.GlobalRequestHttpsHost,"",3); - Console.WriteLine(DateTime.Now); + var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_GlobalRegionList, requestJson, HttpUtil.GlobalRequestHttpsHost, "", 3); if (revertObj == null || revertObj.Code != StateCode.SUCCESS) { DownloadDataComplete = true; + hadInternet = false; try { var spatialInfoDataBytes = FileUtlis.Files.ReadFile("SpatialInfoData"); @@ -146,12 +147,30 @@ return; } + else + { + hadInternet = true; + } } catch (Exception ex) { MainPage.Log($"Error锛氫笅杞芥暟鎹�1锛歿ex.Message}"); DownloadDataComplete = true; return; + } + finally + { + if (!hadInternet) + { + Application.RunOnMainThread(() => + { + if (waitPage != null) + { + waitPage.Hide(); + waitPage.RemoveFromParent(); + } + }); + } } MainPage.Log($"杩涘叆璇诲彇浜戠鏁版嵁绾跨▼"); //===================鍒锋柊Token======================= @@ -281,8 +300,7 @@ if (deviceResult.Code == StateCode.SUCCESS) { FunctionList.List.ClearDatas(); - //MainPage.Log($"============璁惧============寮�濮�" + FunctionList.List.Functions.Count); - //MainPage.Log($"璇诲彇璁惧淇℃伅鎴愬姛"); + MainPage.Log($"璇诲彇璁惧淇℃伅鎴愬姛"); MainPage.Log($"sid鍒楄〃鑾峰彇====\r\n" , deviceResult.Data.ToString()); var deviceList = JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString()); if (deviceList == null) -- Gitblit v1.8.0