From 919317aa27e2a35a18b5773dbe7d8eb48d3150cd Mon Sep 17 00:00:00 2001
From: lss <316519258@qq.com>
Date: 星期一, 28 九月 2020 13:23:35 +0800
Subject: [PATCH] 2020.9.28   新增思必驰音箱

---
 ZigbeeApp/Shared/Phone/UserView/HomePage.cs |   31 +++++++++++++------------------
 1 files changed, 13 insertions(+), 18 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserView/HomePage.cs b/ZigbeeApp/Shared/Phone/UserView/HomePage.cs
index 8503e8e..7072a40 100755
--- a/ZigbeeApp/Shared/Phone/UserView/HomePage.cs
+++ b/ZigbeeApp/Shared/Phone/UserView/HomePage.cs
@@ -53,28 +53,30 @@
             if (Config.Instance.IsLogin)
             {
                 //鏄剧ず鍚姩椤�
-                this.ShowLoginLoadView();
                 CommonPage.Loading.Start();
 
                 UserCenter.HdlThreadLogic.Current.RunThread(() =>
                 {
                     //鐧诲綍
                     var loginSuccess = LoginByPWDAsync(Config.Instance.Account, Config.Instance.Password);
-
                     //鐧诲綍鎴愬姛,鎴栬�呮病鏈夌綉缁滈兘鍙互鐧诲綍
                     if (loginSuccess == 1 || loginSuccess == 2)
                     {
-                        var homes = UserCenter.HdlResidenceLogic.Current.GetHomeListsFromDb();
+                        var homes = UserCenter.HdlResidenceLogic.Current.GetHomeListsFromDb(true);
                         //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
-                        UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread();
+                        bool result = UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread();
                         //鍚姩ZigBee
                         ZigBee.Common.Application.Init();
 
                         UserCenter.HdlThreadLogic.Current.RunMain(() =>
                         {
                             CommonPage.Instance.RemoveViewByTag("Login");
-                            UserPage.Instance.ReFreshControl();
                             CommonPage.Loading.Hide();
+                            if (result == true)
+                            {
+                                //false:寮�鍚簡璋冭瘯鍔熻兘
+                                UserPage.Instance.ReFreshControl();
+                            }
                         });
                     }
                     else
@@ -104,16 +106,6 @@
             }
         }
 
-        /// <summary>
-        /// 鏄剧ず鍚姩椤�
-        /// </summary>
-        public void ShowLoginLoadView()
-        {
-            var loginLoad = new LoginLoading { };
-            CommonPage.Instance.AddChidren(loginLoad);
-            loginLoad.Show();
-        }
-
         /// <summary>
         /// 1:鐧诲綍鎴愬姛 0:瀵嗙爜閿欒 -1:鍏朵粬寮傚父 2:鏃犳硶鑱旂綉
         /// </summary>
@@ -128,9 +120,7 @@
             var requestObj = new SendDataToServer.LoginObj
             {
                 Account = account,
-                Password = password,
-                Source = source,
-                Company = company
+                Password = password
             };
             var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj);
             //鐧婚檰鎺ュ彛鐗规畩,闇�瑕佸揩涓�鐐硅闂�,璁剧疆3绉掕秴鏃�
@@ -187,6 +177,11 @@
                 //璐﹀彿涓嶅瓨鍦�
                 isLoginSuccess = 0;
             }
+            else if (stateCodeStr == "BERESTRICT")
+            {
+                //姝よ处鍙锋棤鏉冪櫥褰�
+                isLoginSuccess = 0;
+            }
             return isLoginSuccess;
         }
     }

--
Gitblit v1.8.0