From 48ba446936b51fffafa7c3600c0dadc6ac0e8c20 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期五, 10 七月 2020 10:52:13 +0800
Subject: [PATCH] 2020-07-10-01

---
 ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberSuccessForm.cs |  129 ++++++++++++++++++------------------------
 1 files changed, 55 insertions(+), 74 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberSuccessForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberSuccessForm.cs
index c72883a..ecdad76 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberSuccessForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberSuccessForm.cs
@@ -13,16 +13,16 @@
 
         /// <summary>
         /// 鐣岄潰鍏抽棴浜嬩欢
-        /// </summary>
-        public Action FormCloseEvent = null;
-        /// <summary>
-        /// 鎴愬憳璐﹀彿淇℃伅
         /// </summary>
-        private AccountInfoResult memberAccountResult = null;
+        public Action FormCloseEvent = null;
         /// <summary>
         /// 鎴愬憳淇℃伅
         /// </summary>
         private MemberInfoRes memberResult = null;
+        /// <summary>
+        /// 娓呯┖浜嬩欢
+        /// </summary>
+        private bool clearEvent = true;
 
         #endregion
 
@@ -31,22 +31,21 @@
         /// <summary>
         /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
         /// </summary>
-        /// <param name="i_accountInfoResult">鎴愬憳璐﹀彿淇℃伅</param>
-        /// <param name="i_memberResult">鎴愬憳淇℃伅</param>
-        public void ShowForm(AccountInfoResult i_accountInfoResult, MemberInfoRes i_memberResult)
-        {
-            this.memberAccountResult = i_accountInfoResult;
-            this.memberResult = i_memberResult;
-
-            //鍒濆鍖栦腑閮ㄦ帶浠�
-            this.InitMiddleFrame();
-        }
-
-
+        /// <param name="i_memberResult">鎴愬憳淇℃伅</param>
+        /// <param name="i_iconMark">澶村儚鐨凪ark</param>
+        public void ShowForm(MemberInfoRes i_memberResult, string i_iconMark)
+        {
+            this.memberResult = i_memberResult;
+
+            //鍒濆鍖栦腑閮ㄦ帶浠�
+            this.InitMiddleFrame(i_iconMark);
+        }
+
+
         /// <summary>
         /// 鍒濆鍖栦腑閮ㄦ帶浠�
-        /// </summary>
-        private void InitMiddleFrame()
+        /// </summary>
+        private void InitMiddleFrame(string i_iconMark)
         {
             //鑳屾櫙妗�
             var frame = new FrameLayout();
@@ -54,23 +53,35 @@
             frame.Height = Application.GetRealHeight(1097);
             frame.BackgroundColor = UserCenterColor.Current.White;
             frame.Gravity = Gravity.Center;
-            frame.Radius = (uint)Application.GetMinRealAverage(6);
+            frame.Radius = (uint)Application.GetRealHeight(17);
             bodyFrameLayout.AddChidren(frame);
 
             //鐢ㄦ埛鍥炬爣
-            var btnUserIcon = new PicViewControl(207, 207);
-            btnUserIcon.Y = Application.GetRealHeight(104);
+            string iconPath = System.IO.Path.Combine(UserCenterResourse.AccountOption.UserPictruePath, i_iconMark + ".png");
+            var btnUserIcon = new ImageView();
+            btnUserIcon.Height = this.GetPictrueRealSize(207);
+            btnUserIcon.Width = this.GetPictrueRealSize(207);
+            btnUserIcon.Radius = (uint)this.GetPictrueRealSize(207) / 2;
+            btnUserIcon.Y = Application.GetRealHeight(104);
             btnUserIcon.Gravity = Gravity.CenterHorizontal;
-            btnUserIcon.UnSelectedImagePath = "Center/Admin.png";
+            if (System.IO.File.Exists(iconPath) == true)
+            {
+                btnUserIcon.ImageBytes = Shared.IO.FileUtils.ReadFile(iconPath);
+            }
+            else
+            {
+                btnUserIcon.ImagePath = "Center/Admin.png";
+            }
             frame.AddChidren(btnUserIcon);
 
             //鏄电О
             var btnName = new NormalViewControl(frame.Width, Application.GetRealHeight(55), false);
-            btnName.TextAlignment = TextAlignment.Center;
-            btnName.Y = Application.GetRealHeight(334);
-            btnName.TextColor = UserCenterColor.Current.TextColor2;
-            btnName.TextSize = 16;
-            btnName.Text = memberResult.UserName;
+            btnName.IsBold = true;
+            btnName.TextAlignment = TextAlignment.Center;
+            btnName.Y = Application.GetRealHeight(334);
+            btnName.TextColor = UserCenterColor.Current.TextColor2;
+            btnName.TextSize = 16;
+            btnName.Text = memberResult.UserName;
             if (string.IsNullOrEmpty(memberResult.UserName) == true)
             {
                 btnName.Text = memberResult.Account;
@@ -79,51 +90,21 @@
 
             //鏉冮檺
             var btnAuthority = new NormalViewControl(frame.Width, Application.GetRealHeight(50), false);
-            btnAuthority.TextAlignment = TextAlignment.Center;
-            btnAuthority.Y = Application.GetRealHeight(400);
-            btnAuthority.TextColor = UserCenterColor.Current.TextGrayColor;
+            btnAuthority.TextAlignment = TextAlignment.Center;
+            btnAuthority.Y = Application.GetRealHeight(400);
+            btnAuthority.TextColor = UserCenterColor.Current.TextGrayColor1;
             btnAuthority.TextID = R.MyInternationalizationString.uMember;
             btnAuthority.TextSize = 12;
             frame.AddChidren(btnAuthority);
 
             //瀹舵棌鎴愬憳娣诲姞鎴愬姛
             var btnSuccess = new NormalViewControl(frame.Width, Application.GetRealHeight(82), false);
+            btnSuccess.IsBold = true;
             btnSuccess.Y = Application.GetRealHeight(547);
             btnSuccess.TextAlignment = TextAlignment.Center;
             btnSuccess.TextID = R.MyInternationalizationString.uAddMemberSuccess;
             btnSuccess.TextSize = 20;
             frame.AddChidren(btnSuccess);
-
-            //鎴块棿閲岄潰鏈夎澶囨墠浼氭樉绀哄叡浜澶囪彍鍗�
-            if (this.CheckIsCanShard() == true)
-            {
-                //閰嶇疆鍏变韩鍐呭
-                var btnmsg = new NormalViewControl(frame.Width, Application.GetRealHeight(50), false);
-                btnmsg.Y = Application.GetRealHeight(783);
-                btnmsg.TextSize = 12;
-                btnmsg.TextAlignment = TextAlignment.Center;
-                btnmsg.TextColor = UserCenterColor.Current.TextOrangeColor;
-                btnmsg.Text = Language.StringByID(R.MyInternationalizationString.uConfigureSharedContent);
-                btnmsg.ButtonClickEvent += (sender, e) =>
-                {
-                    //鍏堟竻绌哄叡浜枃浠跺す
-                    HdlShardLogic.Current.ClearShardDirectory();
-
-                    var memberInfo = new MemberShardInfoData();
-                    var form = new SharedContent.ConfigureNewSharedListRoomForm();
-                    this.AddFromAndRemoveNowForm(form, memberResult, memberInfo);
-                };
-                frame.AddChidren(btnmsg);
-
-                //搴曠嚎
-                int lineWidth = btnmsg.GetRealWidthByText(12);
-                var btnLine = new NormalViewControl(lineWidth, ControlCommonResourse.BottomLineHeight, false);
-                btnLine.BackgroundColor = UserCenterColor.Current.TextOrangeColor;
-                btnLine.Gravity = Gravity.CenterHorizontal;
-                btnLine.Y = btnmsg.Bottom - Application.GetRealHeight(10);
-                frame.AddChidren(btnLine);
-
-            }
 
             //瀹屾垚
             var btnFinish = new BottomClickButton(688);
@@ -132,28 +113,28 @@
             frame.AddChidren(btnFinish);
             btnFinish.ButtonClickEvent += (sender, e) =>
             {
+                this.clearEvent = false;
+
                 this.CloseForm();
+                FormCloseEvent?.Invoke();
+                FormCloseEvent = null;
             };
         }
 
         #endregion
 
-        #region 鈻� 涓�鑸柟娉昣__________________________
+        #region 鈻� 鐣岄潰鍏抽棴___________________________
 
         /// <summary>
-        /// 妫�娴嬭兘鍚﹀垎浜�
+        /// 鐣岄潰鍏抽棴
         /// </summary>
-        /// <returns></returns>
-        private bool CheckIsCanShard()
+        public override void CloseFormBefore()
         {
-            //foreach (var room in Shared.Common.Room.Lists)
-            //{
-            //    if (room.DeviceUIList.Count > 0)
-            //    {
-            //        return true;
-            //    }
-            //}
-            return false;
+            if (clearEvent == true)
+            {
+                FormCloseEvent = null;
+            }
+            base.CloseFormBefore();
         }
 
         #endregion

--
Gitblit v1.8.0