From 2d414e3b007f750cdad4f9e4a7c04db696bca5e4 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期四, 23 四月 2020 16:13:59 +0800
Subject: [PATCH] 2020-04-23 1.优化远程连接提示,改为Loading方案,防止连接过程用户点击重连图标。 2.点击网络检测图标会判断,是否正在远程连接,如果是,会弹窗提示用户”正在远程连接,是否仍要重新检测“。 3.Help 增加隐藏长按功能,长按后,可以开启远程过程异常弹窗提示。长按后关闭。
---
Crabtree/SmartHome/UI/SimpleControl/Phone/Guide/GuideAddGateway.cs | 46 +++++++++++++++++++++++++---------------------
1 files changed, 25 insertions(+), 21 deletions(-)
diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/Guide/GuideAddGateway.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/Guide/GuideAddGateway.cs
index 5213ea0..1a363c3 100644
--- a/Crabtree/SmartHome/UI/SimpleControl/Phone/Guide/GuideAddGateway.cs
+++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/Guide/GuideAddGateway.cs
@@ -303,7 +303,7 @@
goNext = CheckIfGoNext (common);
} catch (Exception ex) {
- Console.WriteLine (ex.Message);
+ Utlis.WriteLine (ex.Message);
} finally {
Application.RunOnMainThread (() => {
MainPage.Loading.Hide ();
@@ -312,13 +312,13 @@
CommonPage.FindGatewayChilrenIPAddress = common.IPAddress;
inThisView = false;
if (inView != null) {
- Console.WriteLine ("inView != null");
+ Utlis.WriteLine ("inView != null");
var deviceListView = new GuideSettingGateway (common);
(inView.Parent as PageLayout).AddChidren (deviceListView);
deviceListView.ShowPage ();
(inView.Parent as PageLayout).PageIndex = (inView.Parent as PageLayout).ChildrenCount - 1;
} else {
- Console.WriteLine ("inView == null");
+ Utlis.WriteLine ("inView == null");
UserHomePage.FrameLayoutMain.AddChidren (UserMiddle.guidePageView);
var guide = new GuideAddResidence ();
UserMiddle.guidePageView.AddChidren (guide);
@@ -345,14 +345,16 @@
static bool inThisView = false;
- Alert checkInternetAlert = new Alert ("", "Your phone in not connected to WIFI network, please connet", "Close", "Search again");
- Alert confirmAlert = new Alert ("", "Please make sure gateway is powered up and comect to WiFi router.", "Close", "Search again");
- Alert confirmAlert1 = new Alert ("", "If not all the gateways are in the list,you can search again.", "Close", "Search again");
- Alert wrongPasswordAlert = new Alert ("", ErrorCode.GatewayPasswordError, "Close", "Search again");
+ //Alert checkInternetAlert = new Alert ("", "Your phone in not connected to WIFI network, please connet", "Close", "Search again");
+ //Alert confirmAlert = new Alert ("", "Please make sure gateway is powered up and comect to WiFi router.", "Close", "Search again");
+ //Alert confirmAlert1 = new Alert ("", "If not all the gateways are in the list,you can search again.", "Close", "Search again");
+ //Alert wrongPasswordAlert = new Alert ("", ErrorCode.GatewayPasswordError, "Close", "Search again");
void SearchGatewayList ()
{
if (UserConfig.Instance.internetStatus == 0 || UserConfig.Instance.internetStatus == 1) {
+ Alert checkInternetAlert = new Alert ("", "Your phone in not connected to WIFI network, please connet", "Close", "Search again");
+
checkInternetAlert.Show ();
checkInternetAlert.ResultEventHandler += (dsss, eee) => {
@@ -401,7 +403,7 @@
}
Control control = new Control ();
- Console.WriteLine ("缁勬挱鎼滅储缃戝叧锛屾悳绱㈠湴鍧�鏄�:" + CommonPage.EndPoint.ToString () + " " + CommonPage.GateWayList.Count);
+ Utlis.WriteLine ("缁勬挱鎼滅储缃戝叧锛屾悳绱㈠湴鍧�鏄�:" + CommonPage.EndPoint.ToString () + " " + CommonPage.GateWayList.Count);
control.Send (new Target () {
IPEndPoint = CommonPage.EndPoint,
Command = Command.ReadGateway,
@@ -410,7 +412,7 @@
AddData = ms.ToArray ()
}, SendCount.Zero, false);
- Console.WriteLine ("骞挎挱鎼滅储缃戝叧锛屾悳绱㈠湴鍧�鏄�:" + new Net.NetWiFi ().BroadcastIpAddress.ToString () + " " + CommonPage.GateWayList.Count);
+ Utlis.WriteLine ("骞挎挱鎼滅储缃戝叧锛屾悳绱㈠湴鍧�鏄�:" + new Net.NetWiFi ().BroadcastIpAddress.ToString () + " " + CommonPage.GateWayList.Count);
control.Send (new Target () {
IPEndPoint = new System.Net.IPEndPoint (new Net.NetWiFi ().BroadcastIpAddress, 6000),
Command = Command.ReadGateway,
@@ -430,7 +432,7 @@
CommonPage.LocalPhoneFindDevice = false;
#endregion
} catch (Exception ex) {
- Console.WriteLine (ex.ToString ());
+ Utlis.WriteLine (ex.ToString ());
} finally {
Application.RunOnMainThread (() => {
if (CommonPage.GateWayList.Count == 0) {
@@ -443,6 +445,8 @@
} else {
if (this != null && this.Parent != null) {
if (inThisView) {// this.Parent.GetChildren (this.Parent.ChildrenCount - 1) == this) {
+ Alert confirmAlert1 = new Alert ("", "If not all the gateways are in the list,you can search again.", "Close", "Search again");
+
confirmAlert1.Show ();
confirmAlert1.ResultEventHandler += (ddf, ddd) => {
MainPage.Loading.Hide ();
@@ -468,19 +472,18 @@
if (UserConfig.Instance.IsLocalEncrypt) {
//瀵嗙爜妫�楠屾纭�
if (UserConfig.Instance.EncryptedPasswordCorrect) {
-
- inView.confirmAlert.Show ();
- inView.confirmAlert.ResultEventHandler += (ddf, ddd) => {
+ Alert confirmAlert = new Alert ("", "Please make sure gateway is powered up and comect to WiFi router.", "Close", "Search again");
+ confirmAlert.Show ();
+ confirmAlert.ResultEventHandler += (ddf, ddd) => {
MainPage.Loading.Hide ();
if (ddd) {
inView.SearchGatewayList ();
}
};
} else {
-
-
- inView.wrongPasswordAlert.Show ();
- inView.wrongPasswordAlert.ResultEventHandler += (ddf, ddd) => {
+ Alert wrongPasswordAlert = new Alert ("", ErrorCode.GatewayPasswordError, "Close", "Search again");
+ wrongPasswordAlert.Show ();
+ wrongPasswordAlert.ResultEventHandler += (ddf, ddd) => {
MainPage.Loading.Hide ();
if (ddd) {
inView.SearchGatewayList ();
@@ -489,8 +492,9 @@
}
} else {
- inView.confirmAlert.Show ();
- inView.confirmAlert.ResultEventHandler += (ddf, ddd) => {
+ Alert confirmAlert = new Alert ("", "Please make sure gateway is powered up and comect to WiFi router.", "Close", "Search again");
+ confirmAlert.Show ();
+ confirmAlert.ResultEventHandler += (ddf, ddd) => {
MainPage.Loading.Hide ();
if (ddd) {
inView.SearchGatewayList ();
@@ -584,7 +588,7 @@
// UserConfig.Instance.IsLocalEncrypt = true;
// //string aseKeyStr = CommonPage.MyEncodingUTF8.GetString (AseKeyBytes);
// //UserConfig.Instance.LocalEncryptKey = aseKeyStr;
- // System.Console.WriteLine ($"============>LocalEncryptKey 鍔犲瘑鎴愬姛Key涓猴細{UserConfig.Instance.LocalEncryptKey}");
+ // Utlis.WriteLine ($"============>LocalEncryptKey 鍔犲瘑鎴愬姛Key涓猴細{UserConfig.Instance.LocalEncryptKey}");
//}
var backBytes = Control.ControlBytesSendHasReturn (Command.Read_APP_Data_STORE_1D5C_CMD, common.SubnetID, common.DeviceID, new byte [] { });
@@ -621,7 +625,7 @@
}
//淇敼鎴愬姛,璁剧疆鏈湴涓哄姞瀵嗘柟寮�
UserConfig.Instance.IsLocalEncrypt = true;
- //System.Console.WriteLine ($"============>LocalEncryptKey 鍔犲瘑鎴愬姛Key涓猴細{UserConfig.Instance.LocalEncryptKey}");
+ //Utlis.WriteLine ($"============>LocalEncryptKey 鍔犲瘑鎴愬姛Key涓猴細{UserConfig.Instance.LocalEncryptKey}");
}
goNext = true;
--
Gitblit v1.8.0