From c1863db0158fb6c2a1cd96686d514c98c1073937 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期五, 17 一月 2020 11:58:18 +0800
Subject: [PATCH] 2020-01-17

---
 Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountLogin.cs |   37 ++++++++++++++++++++++++-------------
 1 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountLogin.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountLogin.cs
index e231673..bb6eed1 100644
--- a/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountLogin.cs
+++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountLogin.cs
@@ -79,7 +79,7 @@
             };
 #if DEBUG
             //Text = "18926269190@189.cn"
-            etAccount.Text = "721343314@qq.com";
+            //etAccount.Text = "721343314@qq.com";
 #endif
 
             accountView.AddChidren (etAccount);
@@ -95,8 +95,13 @@
             }
             var accountList = accountListDB.account;
 
-            
+            //鑷姩濉啓璐﹀彿
+            if (string.IsNullOrEmpty (account)) {
+                if (accountList.Count > 0) {
+                    etAccount.Text = accountList [accountList.Count - 1];
+                }
 
+            }
             var accountListView = new VerticalScrolViewLayout () {
                 Width = Application.GetRealWidth (500),
                 Height = Application.GetRealHeight (85 * 2),
@@ -136,8 +141,8 @@
                 Y = etPasswrod.Y + Application.GetRealHeight (12),
                 Width = Application.GetRealWidth (73),
                 Height = Application.GetRealHeight (60),
-                UnSelectedImagePath = "CrabtreeAdd/ShowPW.png",
-                SelectedImagePath = "CrabtreeAdd/HidePW.png",
+                UnSelectedImagePath = "CrabtreeAdd/HidePW.png",
+                SelectedImagePath = "CrabtreeAdd/ShowPW.png", 
                 BorderColor = SkinStyle.Current.Transparent,
                 BorderWidth = 2,
                 Radius = 1
@@ -428,14 +433,21 @@
             var revertObj = MainPage.RequestHttps (API.Login, requestJson);
             if (revertObj.StateCode.ToUpper() == "SUCCESS") {
 
-                if (!accountListDB.account.Contains (account)) {
-                    accountListDB.account.Add (account);
-                    accountListDB.SaveAccountListDB ();
+                //if (!accountListDB.account.Contains (account)) {
+                //    accountListDB.account.Add (account);
+                //    accountListDB.SaveAccountListDB ();
+                //}
+
+                if (accountListDB.account.Contains (account)) {
+                    accountListDB.account.Remove (account);
                 }
+                accountListDB.account.Add (account);
+                accountListDB.SaveAccountListDB ();
 
                 var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<UserLoginRes> (revertObj.ResponseData.ToString ());
                 var revertData = responseDataObj;
                 MainPage.LoginUser = new UserInfo {
+                    LoginToken = revertData.Token,
                     ID = revertData.UserId,
                     MainUserId = revertData.MainUserId,
                     AccountType = revertData.UserType,
@@ -446,7 +458,7 @@
                     Name = revertData.Contact,
                     Guid = revertData.Guid,
                     MD5PWD = revertData.MD5PWD,
-
+                    
 
                 };
                 //var se = new service.hdlcontrol.com_push.WebServicePush ();
@@ -464,7 +476,8 @@
                     //    //褰撲綇瀹呬负绌烘椂鍏堟彁绀虹敤鎴锋柊寤轰綇瀹�
                     //} else {
                     var revertRoomData = mResidenceRes.PageData;
-  
+                    UserConfig.Instance.HomeLists = revertRoomData;
+
                     if (UserConfig.Instance.CurrentRegion == null) {
                         if (revertRoomData != null && revertRoomData.Count > 0) {
                             var bFind = false;
@@ -584,12 +597,10 @@
         {
             UserConfig.Instance.SaveUserConfig ();
             MainPage.LoginUser.LastTime = DateTime.Now;
-            //MainPage.IsOtherDevicesLogin = false;
-
             if (UserConfig.Instance.CheckHomeGatewaysNotEmpty ()) {
-                UserConfig.Instance.HomeLists = revertRoomData;
+                //UserConfig.Instance.HomeLists = revertRoomData;
                 MainPage.LoginUser.SaveUserInfo ();
-                UserConfig.Instance.SaveUserConfig ();
+                //UserConfig.Instance.SaveUserConfig ();
                 Scene.Refresh ();
                 A31MusicModel.Refresh ();
                 Application.RunOnMainThread (() => {

--
Gitblit v1.8.0