From e89fc7322f0199a9d46ec70ae850ab1a41b0fe3e Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期六, 19 十二月 2020 13:12:41 +0800
Subject: [PATCH] 2020-12-19 1.1.iOS和Android 获取天气失败问题,修复调整处理。 2.Android增加网络监听事件,和iOS封装统一监听处理接口。

---
 HDL_ON/Common/HDLCommon.cs |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/HDL_ON/Common/HDLCommon.cs b/HDL_ON/Common/HDLCommon.cs
old mode 100755
new mode 100644
index 02943ea..2ef00d9
--- a/HDL_ON/Common/HDLCommon.cs
+++ b/HDL_ON/Common/HDLCommon.cs
@@ -6,6 +6,7 @@
 using HDL_ON.UI;
 using HDL_ON.Entity;
 using System.Threading;
+using HDL_ON.DriverLayer;
 
 namespace HDL_ON
 {
@@ -381,6 +382,35 @@
         {
             return string.IsNullOrEmpty(userName) ? Language.StringByID(StringId.UsersWhoNameIsEmpty) : userName;
         }
+
+
+        /// <summary>
+        /// 鐩戝惉缃戠粶鍙樺寲鍚庡鐞嗕簨浠�
+        /// 鍒锋柊缃戠粶鐘舵��
+        /// </summary>
+        /// <param name="internetStatus">缃戠粶鍙樺寲</param>
+        /// <param name="IsEnterBackground">鏄惁杩涘叆浜嗗悗鍙�</param>
+        public void UpdateInternetStatus(int internetStatus, bool IsEnterBackground = false)
+        {
+            MainPage.Log($"缃戠粶鐘舵�佸彉鍖栵紝褰撳墠缃戠粶:{internetStatus} 鏄惁鍚庡彴:{IsEnterBackground.ToString()}");
+
+            if (internetStatus == 0)//娌℃湁缃戠粶杩炴帴 0
+            {
+                Control.Ins.GatewayOnline = false;
+                Control.Ins.IsRemote = false;
+                MainPage.InternetStatus = 0;
+            }
+            else if (internetStatus == 1)//3,4G鐨勭綉缁滆繛鎺� 1
+            {
+                Control.Ins.SearchLoaclGateway();
+                MainPage.InternetStatus = 1;
+            }
+            else if (internetStatus == 2)//WiFi缃戠粶
+            {
+                Control.Ins.SearchLoaclGateway();
+                MainPage.InternetStatus = 2;
+            }
+        }
         #endregion
     }
 }

--
Gitblit v1.8.0