From adc150efb13a0506f45a3c344c3ee2ef2dba8e90 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期四, 01 七月 2021 15:19:13 +0800
Subject: [PATCH] 合并嘉乐lc代码

---
 HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs |  206 +++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 164 insertions(+), 42 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs
index 9d16aef..36b8206 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs
@@ -13,6 +13,11 @@
         /// </summary>
         FrameLayout bodyView;
         /// <summary>
+        /// 褰撳墠
+        /// </summary>
+        VerticalScrolViewLayout bodyScrolView;
+
+        /// <summary>
         /// 澶村儚鍖哄煙
         /// </summary>
         FrameLayout headPortraitView;
@@ -142,7 +147,22 @@
         Button btnResetPasswordText;
         Button btnResetPasswordRight;
         #endregion
+
+
+        #region 涓汉閫夐」-鏂板浣忓畢
+        /// <summary>
+        /// 涓汉閫夐」-鏂板浣忓畢鍖哄煙
+        /// </summary>
+        FrameLayout addResidenceView;
+        /// <summary>
+        /// 鏂板浣忓畢鎻愮ず鏂囨湰
+        /// </summary>
+        Button btnAddResidenceText;
+        Button btnAddResidenceScan;
         #endregion
+
+        #endregion
+
         #endregion
 
         #region 瑙i攣璁剧疆鍖哄煙
@@ -170,7 +190,7 @@
         /// </summary>
         Action updataUserName;
 
-        public PersonalDataPage(Action upHeadImage,Action upUserName)
+        public PersonalDataPage(Action upHeadImage, Action upUserName)
         {
             updataHeadImage = upHeadImage;
             updataUserName = upUserName;
@@ -182,13 +202,27 @@
             bodyView.BackgroundColor = CSS_Color.BackgroundColor;
             new TopViewDiv(bodyView, Language.StringByID(StringId.PersonalCenter)).LoadTopView();
 
-            headPortraitView = new FrameLayout()
+            bodyScrolView = new VerticalScrolViewLayout()
             {
                 Y = Application.GetRealHeight(64),
+                VerticalScrollBarEnabled = false,
+                Height = Application.GetRealHeight(551),
+            };
+            bodyView.AddChidren(bodyScrolView);
+
+            if (MainPage.Increase)
+            {
+                bodyScrolView.Height = Application.GetRealHeight(541);
+            }
+
+            headPortraitView = new FrameLayout()
+            {
+                //Y = Application.GetRealHeight(64),
                 Height = Application.GetRealHeight(124),
                 BackgroundColor = CSS_Color.MainBackgroundColor,
             };
-            bodyView.AddChidren(headPortraitView);
+
+            bodyScrolView.AddChidren(headPortraitView);
 
             userHeadImageView = new ImageView()
             {
@@ -196,22 +230,27 @@
                 Width = Application.GetMinRealAverage(84),
                 Height = Application.GetMinRealAverage(84),
                 Radius = (uint)Application.GetMinRealAverage(42),
-                ImagePath = MainPage.LoginUser.headImagePagePath,
+                ImagePath = UserInfo.Current.headImagePagePath,
             };
             headPortraitView.AddChidren(userHeadImageView);
 
             #region 涓汉淇℃伅閫夐」鍖哄煙
+            var topPaddingView = new FrameLayout()
+            {
+                Height = Application.GetRealHeight(8)
+            };
+            bodyScrolView.AddChidren(topPaddingView);
+
             /// <summary>
             /// 涓汉淇℃伅閫夐」鍖哄煙
             /// </summary>
             optionListView = new VerticalScrolViewLayout()
             {
-                Y = headPortraitView.Bottom + Application.GetRealHeight(8),
                 Height = Application.GetRealHeight(51 * 6),
                 BackgroundColor = CSS_Color.MainBackgroundColor,
                 ScrollEnabled = false,
             };
-            bodyView.AddChidren(optionListView);
+            bodyScrolView.AddChidren(optionListView);
             #region 涓汉閫夐」-鍚嶅瓧鍖哄煙
             /// <summary>
             /// 涓汉閫夐」-鍚嶅瓧鍖哄煙
@@ -244,7 +283,7 @@
                 TextAlignment = TextAlignment.CenterRight,
                 TextColor = CSS_Color.PromptingColor1,
                 TextSize = CSS_FontSize.TextFontSize,
-                Text = string.IsNullOrEmpty(MainPage.LoginUser.userName) ? "涓嶆効鎰忛�忛湶濮撳悕鐨勭敤鎴�" : MainPage.LoginUser.userName
+                Text = string.IsNullOrEmpty(UserInfo.Current.userName) ? Language.StringByID(StringId.UsersWhoNameIsEmpty) : UserInfo.Current.userName
             };
             userNameView.AddChidren(btnUserName);
             /// <summary>
@@ -341,7 +380,7 @@
                 TextAlignment = TextAlignment.CenterRight,
                 TextColor = CSS_Color.PromptingColor1,
                 TextSize = CSS_FontSize.TextFontSize,
-                Text = string.IsNullOrEmpty(MainPage.LoginUser.userEmailInfo) ? Language.StringByID(StringId.Unbound) : MainPage.LoginUser.userEmailInfo
+                Text = GetBindAccountText(UserInfo.Current.userEmailInfo)
             };
             userEmailInfoView.AddChidren(btnUserEmailInfo);
             /// <summary>
@@ -390,7 +429,7 @@
                 TextAlignment = TextAlignment.CenterRight,
                 TextColor = CSS_Color.PromptingColor1,
                 TextSize = CSS_FontSize.TextFontSize,
-                Text = string.IsNullOrEmpty(MainPage.LoginUser.userMobileInfo) ? Language.StringByID(StringId.Unbound) : MainPage.LoginUser.userMobileInfo
+                Text = GetBindAccountText(UserInfo.Current.userMobileInfo)
             };
             userPhoneInfoView.AddChidren(btnUserPhoneInfo);
             /// <summary>
@@ -408,6 +447,7 @@
             optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
             #endregion
             #region 涓汉閫夐」-绗笁鏂规巿鏉冨尯鍩�
+            //2020-12-08 鏆傛椂闅愯棌绗笁鏂规巿鏉冨姛鑳�
             /// <summary>
             /// 涓汉閫夐」-绗笁鏂规巿鏉冨尯鍩�
             /// </summary>
@@ -415,7 +455,7 @@
             {
                 Height = Application.GetRealHeight(50),
             };
-            optionListView.AddChidren(thirdPartyAuthorizationView);
+            //optionListView.AddChidren(thirdPartyAuthorizationView);
             /// <summary>
             /// 绗笁鏂规巿鏉冩枃鏈彁绀轰俊鎭寜閽�
             /// </summary>
@@ -438,7 +478,6 @@
                 UnSelectedImagePath = "Public/Right.png",
             };
             thirdPartyAuthorizationView.AddChidren(btnThirdPartyAuthorizationRight);
-            optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
             #endregion
             #region 涓汉閫夐」-淇敼鐧诲綍瀵嗙爜鍖哄煙
             /// <summary>
@@ -455,7 +494,7 @@
             btnResetPasswordText = new Button()
             {
                 X = Application.GetRealWidth(16),
-                Width = Application.GetRealWidth(120),
+                Width = Application.GetRealWidth(220),
                 TextAlignment = TextAlignment.CenterLeft,
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = CSS_FontSize.SubheadingFontSize,
@@ -471,21 +510,68 @@
                 UnSelectedImagePath = "Public/Right.png",
             };
             resetPasswordView.AddChidren(btnResetPasswordRight);
-            //optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
+            optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
             #endregion
+
+            #region 涓汉閫夐」-娣诲姞浣忓畢
+            addResidenceView = new FrameLayout()
+            {
+                Height = Application.GetRealHeight(50),
+            };
+            optionListView.AddChidren(addResidenceView);
+            btnAddResidenceScan = new Button()
+            {
+                X = Application.GetRealWidth(319),
+                Gravity = Gravity.CenterVertical,
+                Width = Application.GetMinRealAverage(30),
+                Height = Application.GetMinRealAverage(30),
+                UnSelectedImagePath = "Public/ScanGrey.png",
+            };
+            addResidenceView.AddChidren(btnAddResidenceScan);
+            btnAddResidenceText = new Button()
+            {
+                X = Application.GetRealWidth(16),
+                TextAlignment = TextAlignment.CenterLeft,
+                TextColor = CSS_Color.FirstLevelTitleColor,
+                TextSize = CSS_FontSize.SubheadingFontSize,
+                TextID = StringId.AddResidence,
+            };
+            addResidenceView.AddChidren(btnAddResidenceText);
+
+            btnAddResidenceText.MouseUpEventHandler = (sender, e) =>
+            {
+                Scan.OpenScan((scanString) =>
+                {
+                    //鎵ц缁戝畾浣忓畢
+                    new BindingResidencePage().DoBindResidence(scanString);
+                });
+            };
+
+            #endregion
+
+
             #endregion
 
             #region 瑙i攣璁剧疆鍖哄煙
+            var topPaddingView2 = new FrameLayout()
+            {
+                Height = Application.GetRealHeight(8)
+            };
+            bodyScrolView.AddChidren(topPaddingView2);
             /// <summary>
             /// 瑙i攣璁剧疆鍖哄煙
             /// </summary>
             interpretationSettingsView = new FrameLayout()
             {
-                Y = optionListView.Bottom + Application.GetRealHeight(8),
                 BackgroundColor = CSS_Color.MainBackgroundColor,
-                Height = Application.GetRealHeight(65),
+                Height = Application.GetRealHeight(70),
             };
-            bodyView.AddChidren(interpretationSettingsView);
+            bodyScrolView.AddChidren(interpretationSettingsView);
+            if(Language.CurrentLanguage != "Chinese")
+            {
+                interpretationSettingsView.Height = Application.GetRealHeight(80);
+            }
+
             btnInterpretationSettingsTitle = new Button()
             {
                 X = Application.GetRealWidth(16),
@@ -496,15 +582,18 @@
                 TextID = StringId.InterpretationSettings,
             };
             interpretationSettingsView.AddChidren(btnInterpretationSettingsTitle);
+
             btnInterpretationSettingsTip = new Button()
             {
                 X = Application.GetRealWidth(16),
-                Y = btnInterpretationSettingsTitle.Bottom + Application.GetRealHeight(4),
+                Y = btnInterpretationSettingsTitle.Bottom,
                 Height = Application.GetRealHeight(32),
+                Width = Application.GetRealWidth(310),
                 TextAlignment = TextAlignment.TopLeft,
                 TextColor = CSS_Color.PromptingColor1,
                 TextSize = CSS_FontSize.TextFontSize,
-                TextID = StringId.AppUnlockSettingsTip
+                TextID = StringId.AppUnlockSettingsTip,
+                IsMoreLines = true,
             };
             interpretationSettingsView.AddChidren(btnInterpretationSettingsTip);
 
@@ -517,6 +606,26 @@
                 UnSelectedImagePath = "Public/Right.png",
             };
             interpretationSettingsView.AddChidren(btnInterpretationSettingsRight);
+            interpretationSettingsView.AddChidren(new LineView(interpretationSettingsView.Height));
+            #endregion
+
+            #region 鏈嶅姟鍣ㄤ俊鎭�
+            ListCellView myServerInfoCellView = new ListCellView()
+            {
+            };
+            bodyScrolView.AddChidren(myServerInfoCellView);
+            //璺宠浆鏈嶅姟鍣ㄤ俊鎭�
+            Action selectAction = () =>
+            {
+                var myServerInfoPage = new MyServerInfoPage();
+                MainPage.BasePageView.AddChidren(myServerInfoPage);
+                myServerInfoPage.LoadPage();
+                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+            };
+            myServerInfoCellView.GoAction = selectAction;
+            myServerInfoCellView.BtnTilte.Text = Language.StringByID(StringId.ServerInformation);
+            myServerInfoCellView.LineView.RemoveFromParent();
+
             #endregion
 
             btnLogout = new Button()
@@ -531,7 +640,7 @@
             };
             bodyView.AddChidren(btnLogout);
 
-            if(MainPage.Increase)
+            if (MainPage.Increase)
             {
                 btnLogout.Y = Application.GetRealHeight(613);
                 btnLogout.Height = Application.GetRealHeight(50);
@@ -539,45 +648,41 @@
             }
 
             LoadEventList();
+
         }
-
-
 
         /// <summary>
         /// 鍔犺浇鍥炬爣閫夋嫨閫夐」
         /// </summary>
         void LoadPictureOptionView()
         {
-            pictureOptionView = new FrameLayout()
+            var pictureBaseView = new FrameLayout()
             {
                 BackgroundColor = CSS_Color.DialogTransparentColor1,
+
             };
-            bodyView.AddChidren(pictureOptionView);
+            bodyView.AddChidren(pictureBaseView);
+
+            pictureOptionView = new FrameLayout()
+            {
+                Y = Application.GetRealHeight(495),
+                AnimateSpeed = 0.3f,
+                Animate = Animate.DownToUp,
+                Height = Application.GetRealHeight(200),
+            };
+            pictureBaseView.AddChidren(pictureOptionView);
+
 
             optionView = new VerticalScrolViewLayout()
             {
                 Gravity = Gravity.CenterHorizontal,
-                Y = Application.GetRealHeight(495),
                 Width = Application.GetRealWidth(343),
                 Height = Application.GetRealHeight(100),
                 BackgroundColor = CSS_Color.MainBackgroundColor,
                 Radius = (uint)Application.GetRealWidth(12),
-                AnimateSpeed = 0.3f,
-                Animate = Animate.DownToUp,
+                ScrollEnabled = false,
             };
             pictureOptionView.AddChidren(optionView);
-
-            //btnDefaultGallery = new Button()
-            //{
-            //    Height = Application.GetRealHeight(50),
-            //    TextAlignment = TextAlignment.Center,
-            //    TextColor = CSS_Color.TextualColor,
-            //    SelectedTextColor = CSS_Color.MainColor,
-            //    TextSize = CSS_FontSize.SubheadingFontSize,
-            //    TextID = StringId.DefaultGallery,
-            //};
-            //optionView.AddChidren(btnDefaultGallery);
-            //optionView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
 
             btnTakePicture = new Button()
             {
@@ -612,16 +717,33 @@
                 Width = Application.GetRealWidth(343),
                 Height = Application.GetRealHeight(50),
                 BackgroundColor = CSS_Color.MainBackgroundColor,
-                Radius = (uint)Application.GetRealWidth(6),
+                Radius = (uint)Application.GetRealWidth(12),
                 TextID = StringId.Cancel,
                 TextColor = CSS_Color.WarningColor,
-                Animate = Animate.DownToUp
+                TextSize = CSS_FontSize.SubheadingFontSize,
             };
             pictureOptionView.AddChidren(btnCancel);
 
-
-            LoadEvent_PictureOptionViewEventList();
+            LoadEvent_PictureOptionViewEventList(pictureBaseView);
         }
 
+        /// <summary>
+        /// 鑾峰彇缁戝畾璐﹀彿鏄剧ず鏂囨湰锛岀┖鐨勬椂鍊欐樉绀轰负鏈粦瀹�
+        /// </summary>
+        /// <param name="account"></param>
+        string GetBindAccountText(string account)
+        {
+            return string.IsNullOrEmpty(account) ? Language.StringByID(StringId.Unbound) : account;
+        }
+
+        /// <summary>
+        /// 鍒ゆ柇鏄惁涓烘湭缁戝畾
+        /// </summary>
+        /// <param name="account"></param>
+        /// <returns></returns>
+        bool CheckIfUnbound(string account)
+        {
+            return string.IsNullOrEmpty(account) || account == Language.StringByID(StringId.Unbound);
+        }
     }
 }

--
Gitblit v1.8.0