From cc8749fe1d158ee21670bde77fad237be2f0c416 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期五, 08 一月 2021 11:47:06 +0800
Subject: [PATCH] 2021-01-08 1.去掉无关文件

---
 Crabtree/SmartHome/UI/SimpleControl/Phone/Register/SubaccountListView.cs |   65 +++++++++++++++++++++++++++-----
 1 files changed, 54 insertions(+), 11 deletions(-)

diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/SubaccountListView.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/SubaccountListView.cs
index 66a2c6d..c86f459 100644
--- a/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/SubaccountListView.cs
+++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/SubaccountListView.cs
@@ -58,6 +58,11 @@
             topView.AddChidren (ItemButton);
             #endregion
 
+            //2020-07-01
+            if (UserConfig.Instance.CurrentRegion != null && !string.IsNullOrEmpty (UserConfig.Instance.CurrentRegion.Name)) {
+                NameButton.Text = UserConfig.Instance.CurrentRegion.Name;
+            }
+
             EventHandler<MouseEventArgs> addSubaccountHandler = (sender, e) => {
                 modifySubaccount (null);
             };
@@ -73,7 +78,7 @@
             Button btnUserIcon = new Button () {
                 X = Application.GetRealWidth (27),
                 Width = Application.GetRealWidth (96),
-                Height = Application.GetRealHeight (96),
+                Height = Application.GetRealWidth (96),
                 Gravity = Gravity.CenterVertical,
                 Radius = 5,
                 BorderColor = SkinStyle.Current.Transparent,
@@ -109,13 +114,34 @@
 
             VerticalScrolViewLayout contentView = new VerticalScrolViewLayout () {
                 Y = topUserMsgView.Bottom,
-                Height = Application.GetRealHeight (1136) - topUserMsgView.Bottom,
+                Height = Application.GetRealHeight (1136-80) - topUserMsgView.Bottom,
                 BackgroundColor = SkinStyle.Current.ViewColor,
                 ScrollEnabled = false,
             };
             AddChidren (contentView);
 
-         
+            //#region
+            ////褰撳墠浣忓畢
+            //FrameLayout homeView = new FrameLayout () {
+            //    Height = Application.GetRealHeight (100),
+            //    BackgroundColor = SkinStyle.Current.Transparent
+            //};
+            //contentView.AddChidren (homeView);
+
+            //Button btnHomeText = new Button () {
+            //    X = Application.GetRealWidth (40),
+            //    Width = Application.GetRealWidth (600),
+            //    //TextID = R.MyInternationalizationString.Subaccount,
+            //    TextAlignment = TextAlignment.CenterLeft,
+            //    TextColor = SkinStyle.Current.TextColor1,
+            //};
+            //homeView.AddChidren (btnHomeText);
+
+            //if (UserConfig.Instance.CurrentRegion != null && !string.IsNullOrEmpty (UserConfig.Instance.CurrentRegion.Name)) {
+            //    btnHomeText.Text = "Current residence: " + UserConfig.Instance.CurrentRegion.Name;
+            //}
+            //#endregion
+
             FrameLayout subaccountView = new FrameLayout () {
                 Height = Application.GetRealHeight (50),
                 BackgroundColor = SkinStyle.Current.MainColor
@@ -145,6 +171,23 @@
 
             addSubaccountList ();
 
+            addTipView ();
+        }
+
+        void addTipView () {
+            var TipView = new Button () {
+                Width = LayoutParams.MatchParent,
+                Y = Application.GetRealHeight (Application.DesignHeight - 80),
+                Height = Application.GetRealHeight (80),
+                BackgroundColor = 0xFFFFFFE0,
+                TextSize = 11,
+                TextColor = 0xFF1F1F1F,
+                TextAlignment = TextAlignment.Center,
+                IsMoreLines = true,
+                Text = "Manage the member list of the current residence and share it to other accounts. \n Tips: You need to add the registered member account.",
+
+            };
+            AddChidren (TipView);
         }
 
         void addSubaccountList ()
@@ -225,8 +268,8 @@
 
      
                                 var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (requestObj);
-                                var revertObj = MainPage.RequestHttps (API.DeletedSubAccount, requestJson, true);
-                                if (revertObj.StateCode.ToUpper() == "SUCCESS") {
+                                var revertObj = MainPage.RequestHttps (API.DeletedSubAccount, requestJson);
+                                if (revertObj.StateCode.ToUpper() == StateCode.SUCCESS) {
                                     Application.RunOnMainThread (() => {
                                         subaccountList.Remove (subaccount);
                                         addSubaccountList ();
@@ -418,7 +461,7 @@
                             //var requestObj = new EditSubAccountObj () { Id = subaccount.UserID, Email = addSubaccount, Password = addSubaccountPassword, Remark = addSubaccountReamrk };
                             //var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (requestObj);
                             //var revertObj = MainPage.RequestHttps ("EditSubAccount", requestJson, true);
-                            //if (revertObj.StateCode.ToUpper() == "SUCCESS") {
+                            //if (revertObj.StateCode.ToUpper() == StateCode.SUCCESS) {
                             //    Application.RunOnMainThread (() => {
                             //        addSubaccountList ();
                             //        dialog.Close ();
@@ -433,15 +476,15 @@
                             };
                             var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (requestObj);
 
-                            var revertObj = MainPage.RequestHttps (API.BindSubAccount, requestJson, true);
-                            if (revertObj.StateCode.ToUpper () == "SUCCESS") {
+                            var revertObj = MainPage.RequestHttps (API.BindSubAccount, requestJson);
+                            if (revertObj.StateCode.ToUpper () == StateCode.SUCCESS) {
                                 var requestObj2 = new GetSubAccountByDistributedMarkObj () {
                                     DistributedMark = UserConfig.Instance.CurrentRegion.Id,
                                 };
                                 //var requestObj2 = new GetSubAccountListObj ();
                                 var requesetJson2 = Newtonsoft.Json.JsonConvert.SerializeObject (requestObj2);
-                                var requesetRevertObj2 = MainPage.RequestHttps (API.GetSubAccountByDistributedMark, requesetJson2, true);
-                                if (requesetRevertObj2.StateCode.ToUpper () == "SUCCESS") {
+                                var requesetRevertObj2 = MainPage.RequestHttps (API.GetSubAccountByDistributedMark, requesetJson2);
+                                if (requesetRevertObj2.StateCode.ToUpper () == StateCode.SUCCESS) {
                                     var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SubAccountRes>> (requesetRevertObj2.ResponseData.ToString ());
                                     subaccountList = responseDataObj;
                                     Application.RunOnMainThread (() => {
@@ -463,7 +506,7 @@
                             new Alert ("", Language.StringByID (R.MyInternationalizationString.FailureToServer),
                                        Language.StringByID (R.MyInternationalizationString.Close)).Show ();
                         });
-                        Console.WriteLine (ex.ToString());
+                        Utlis.WriteLine (ex.ToString());
                     } finally {
                         Application.RunOnMainThread (() => {
                             MainPage.Loading.Hide ();

--
Gitblit v1.8.0