From 74a9ba8e9a2df9c39f9c2eb212a5ac889a055cd4 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期二, 03 十二月 2019 10:47:51 +0800
Subject: [PATCH] 优化UI细节(请合并最新代码)
---
ZigbeeApp/Shared/Phone/UserView/HomePage.cs | 39 ++++++++++++++++++++-------------------
1 files changed, 20 insertions(+), 19 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserView/HomePage.cs b/ZigbeeApp/Shared/Phone/UserView/HomePage.cs
index 835452c..be5e2ba 100755
--- a/ZigbeeApp/Shared/Phone/UserView/HomePage.cs
+++ b/ZigbeeApp/Shared/Phone/UserView/HomePage.cs
@@ -4,7 +4,7 @@
namespace Shared.Phone.UserView
{
/// <summary>
- /// Home page.
+ /// Home page.绗簩鐗堝憖
/// </summary>
public class HomePage : PageLayout
{
@@ -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.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,19 +92,19 @@
//鐧诲綍澶辫触锛屼篃鐩存帴杩涘叆涓婚〉
new System.Threading.Thread(async () =>
{
- 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();
});
@@ -124,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>
@@ -146,9 +152,6 @@
Source = source,
Company = company
};
- //灏嗙鐞嗗憳鏍囪瘑澶嶅師
- Config.Instance.isAdministrator = false;
-
var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj);
var revertObj = await CommonPage.Instance.RequestHttpsZigbeeAsync("ZigbeeUsers/Login", System.Text.Encoding.UTF8.GetBytes(requestJson));
if (revertObj == null)
@@ -165,15 +168,13 @@
return -1;
}
//鍒濆鍖栫鐞嗗憳鏉冮檺淇℃伅(閲岄潰鏈夌壒娈婂垽鏂簡,鍙互鐩存帴璋冪敤)
- await UserCenter.UserCenterLogic.InitAdministratorInfo();
+ await UserCenter.UserCenterLogic.InitAdminConnectMqttInfo();
var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.UserLoginRes>(revertObj.ResponseData.ToString());
var revertData = responseDataObj;
- Config.Instance.UserID = revertData.UserID;
- Config.Instance.MasterID = revertData.MainUserID;
- Config.Instance.AccountType = revertData.UserType;
Config.Instance.Account = revertData.Account;
Config.Instance.Password = password;
+ Config.Instance.MD5PWD = revertData.MD5PWD;
Config.Instance.Guid = revertData.Guid;
Config.Instance.MqttKey = revertData.MqttKey;
Config.Instance.LoginDateTime = DateTime.Now;
--
Gitblit v1.8.0