From b74c052b43d7c4a830386940a036eb7c2ec9abc2 Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期二, 14 一月 2020 13:37:26 +0800
Subject: [PATCH] 2020-1-14-01
---
ZigbeeApp/Shared/Phone/UserView/HomePage.cs | 35 +++++++++++++++++------------------
1 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserView/HomePage.cs b/ZigbeeApp/Shared/Phone/UserView/HomePage.cs
index 11eef73..1be601f 100755
--- a/ZigbeeApp/Shared/Phone/UserView/HomePage.cs
+++ b/ZigbeeApp/Shared/Phone/UserView/HomePage.cs
@@ -49,10 +49,9 @@
}
};
- //*******寰呮敼*****
- UserPage.Instance.Fresh();
if (Config.Instance.IsLogin)
{
+ ShowLoginLoadView();
CommonPage.Loading.Start();
Action action = async () =>
{
@@ -62,19 +61,18 @@
{
new System.Threading.Thread(async () =>
{
- //鍚姩ZigBee
- ZigBee.Common.Application.Init();
//鐧诲綍鎴愬姛
- var homes = await House.GetHomeLists();
-
+ var homes = await House.GetHomeLists();
+ //鍚姩ZigBee
+ ZigBee.Common.Application.Init();
//鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread();
- Room.CanInitAllRoom = true;
Room.InitAllRoom();
Application.RunOnMainThread(() =>
{
+ CommonPage.Instance.RemoveViewByTag("Login");
UserPage.Instance.Fresh();
CommonPage.Loading.Hide();
});
@@ -94,20 +92,19 @@
//鐧诲綍澶辫触锛屼篃鐩存帴杩涘叆涓婚〉
new System.Threading.Thread(async () =>
{
- //鍚姩ZigBee
- ZigBee.Common.Application.Init();
-
//鐧诲綍鎴愬姛
- var homes = await House.GetHomeLists();
+ var homes = await House.GetHomeLists();
+ //鍚姩ZigBee
+ ZigBee.Common.Application.Init();
//鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread();
- Room.CanInitAllRoom = true;
Room.InitAllRoom();
Application.RunOnMainThread(() =>
{
+ CommonPage.Instance.RemoveViewByTag("Login");
UserPage.Instance.Fresh();
CommonPage.Loading.Hide();
});
@@ -125,6 +122,14 @@
Shared.Common.CommonPage.Instance.AddChidren(accountLogin);
accountLogin.Show();
}
+ }
+
+
+ public void ShowLoginLoadView()
+ {
+ var loginLoad = new LoginLoading { };
+ CommonPage.Instance.AddChidren(loginLoad);
+ loginLoad.Show();
}
/// <summary>
@@ -162,8 +167,6 @@
{
return -1;
}
- //鍒濆鍖栫鐞嗗憳鏉冮檺淇℃伅(閲岄潰鏈夌壒娈婂垽鏂簡,鍙互鐩存帴璋冪敤)
- await UserCenter.UserCenterLogic.InitAdminConnectMqttInfo();
var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.UserLoginRes>(revertObj.ResponseData.ToString());
var revertData = responseDataObj;
@@ -171,11 +174,7 @@
Config.Instance.Password = password;
Config.Instance.MD5PWD = revertData.MD5PWD;
Config.Instance.Guid = revertData.Guid;
- Config.Instance.MqttKey = revertData.MqttKey;
Config.Instance.LoginDateTime = DateTime.Now;
- Config.Instance.ConnectZigbeeMqttBrokerPwd = revertData.ConnectZigbeeMqttBrokerPwd;
- Config.Instance.ConnectZigbeeMqttClientId = revertData.ConnectZigbeeMqttClientId;
- Config.Instance.ZigbeeMqttBrokerLoadSubDomain = revertData.ZigbeeMqttBrokerLoadSubDomain;
if (Config.Instance.AccountList.Find((obj) => obj == revertData.Account) == null)
{
Config.Instance.AccountList.Add(revertData.Account);
--
Gitblit v1.8.0