From 65bcedda4d8e3ff6500dbf59a4e607d96e469375 Mon Sep 17 00:00:00 2001
From: tzy <hxb@hdlchina.com.cn>
Date: 星期二, 25 五月 2021 15:47:15 +0800
Subject: [PATCH] 初步完成过户的功能

---
 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferInputPage.cs |  265 ++++++++++++++++++++++++++--------------------------
 1 files changed, 133 insertions(+), 132 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferInputPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferInputPage.cs
index 6ad0dcc..286f85a 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferInputPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferInputPage.cs
@@ -1,159 +1,160 @@
 锘縰sing System;
 using Shared;
 using HDL_ON.UI.CSS;
+using HDL_ON.Stan;
 
 namespace HDL_ON.UI
 {
     /// <summary>
     /// 杩囨埛杈撳叆璐﹀彿鐣岄潰
     /// </summary>
-    public class TransferInputPage : FrameLayout
+    public class TransferInputPage : EditorCommonForm
     {
-        /// <summary>
-        /// 
-        /// </summary>
-        FrameLayout bodyView;
+        #region 鈻� 鍙橀噺澹版槑___________________________
 
-        public TransferInputPage()
+        #endregion
+
+        #region 鈻� 鍒濆鍖朹____________________________
+
+        /// <summary>
+        /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+        /// </summary>
+        public void ShowForm()
         {
-            bodyView = this;
+            //杩囨埛
+            base.SetTitleText(Language.StringByID(StringId.Transfer));
+
+            //鍒濆鍖栦腑閮ㄤ俊鎭�
+            this.InitMiddleFrame();
         }
 
         /// <summary>
-        /// 
+        /// 鍒濆鍖栦腑閮ㄤ俊鎭�
         /// </summary>
-        public void LoadPage()
+        private void InitMiddleFrame()
         {
-            BackgroundColor = CSS_Color.BackgroundColor;
+            //娓呯┖bodyFrame
+            this.ClearBodyFrame();
 
-            new TopViewDiv(bodyView, Language.StringByID(StringId.Transfer)).LoadTopView();
+            //鐧借壊鑳屾櫙
+            var frameBack = new FrameLayout();
+            frameBack.Y = Application.GetRealHeight(8);
+            frameBack.BackgroundColor = CSS_Color.MainBackgroundColor;
+            bodyFrameLayout.AddChidren(frameBack);
 
-            #region 璐﹀彿濉啓
-            var accountView = new FrameLayout()
+            //璇疯緭鍏ユ帴鏀舵柟璐﹀彿
+            var rowInput = new FrameRowControl();
+            rowInput.Height = Application.GetRealHeight(50);
+            frameBack.AddChidren(rowInput);
+            //鍥炬爣
+            rowInput.AddLeftIcon(24, "LoginIcon/AccountIcon.png");
+            //杈撳叆妗�
+            var txtInput = rowInput.AddLeftInput(string.Empty, 300);
+            txtInput.PlaceholderText = Language.StringByID(StringId.PleaseInputReceiverAccount);
+            //搴曠嚎
+            rowInput.AddBottomLine();
+            //鍙樻洿瀹瑰櫒楂樺害
+            frameBack.Height = rowInput.Bottom + Application.GetRealHeight(10);
+
+            //杩囨埛
+            var btnMigrate = new BottomClickButton(220);
+            btnMigrate.TextID = StringId.Transfer;
+            btnMigrate.Y = frameBack.Bottom + Application.GetRealHeight(79);
+            bodyFrameLayout.AddChidren(btnMigrate);
+            btnMigrate.ButtonClickEvent += (sender, e) =>
             {
-                Y = Application.GetRealHeight(72),
-                Height = Application.GetRealHeight(50),
-                BackgroundColor = CSS_Color.MainBackgroundColor
-            };
-            bodyView.AddChidren(accountView);
+                string account = txtInput.Text.Trim();
+                if (account == string.Empty)
+                {
+                    return;
+                }
+                if (account == UserInfo.Current.userEmailInfo || account == UserInfo.Current.userMobileInfo)
+                {
+                    //涓嶈兘鑷繁杩囨埛缁欒嚜宸�
+                    HdlMessageLogic.Current.ShowMassage(ShowMsgType.Tip, Language.StringByID(StringId.YouCannotTransferOwnershipToYourself));
+                    return;
+                }
+                //鎼滅储璐﹀彿淇℃伅
+                var accountInfo = this.SearchAccountInfoByAccount(account);
+                if (accountInfo == null)
+                {
+                    return;
+                }
 
-            var btnAccountIcon = new Button()
+                this.CloseForm();
+
+                var form = new TransferUserConfirmPage();
+                form.AddForm(accountInfo);
+            };
+
+            //鎵弿浜岀淮鐮�
+            var btnQrcode = new NormalViewControl(220, 32, true);
+            btnQrcode.Y = btnMigrate.Bottom + Application.GetRealWidth(6);
+            btnQrcode.TextColor = CSS_Color.MainColor;
+            btnQrcode.Gravity = Gravity.CenterHorizontal;
+            btnQrcode.TextAlignment = TextAlignment.Center;
+            btnQrcode.TextID = StringId.ScanQRCoden;
+            bodyFrameLayout.AddChidren(btnQrcode);
+            btnQrcode.ButtonClickEvent += (sender, e) =>
             {
-                X = Application.GetRealWidth(16),
-                Gravity = Gravity.CenterVertical,
-                Width = Application.GetMinRealAverage(24),
-                Height = Application.GetMinRealAverage(24),
-                UnSelectedImagePath = "LoginIcon/AccountIcon.png",
+                Scan.OpenScan((scanString) =>
+                {
+                    if (string.IsNullOrEmpty(scanString) == true)
+                    {
+                        return;
+                    }
+                    if (scanString == UserInfo.Current.userEmailInfo || scanString == UserInfo.Current.userMobileInfo)
+                    {
+                        //涓嶈兘鑷繁杩囨埛缁欒嚜宸�
+                        HdlMessageLogic.Current.ShowMassage(ShowMsgType.Tip, Language.StringByID(StringId.YouCannotTransferOwnershipToYourself));
+                        return;
+                    }
+                    //鎼滅储璐﹀彿淇℃伅
+                    var accountInfo = this.SearchAccountInfoByAccount(scanString);
+                    if (accountInfo == null)
+                    {
+                        return;
+                    }
+                    this.CloseForm();
+
+                    var form = new TransferUserConfirmPage();
+                    form.AddForm(accountInfo);
+                });
             };
-            accountView.AddChidren(btnAccountIcon);
-
-            var etAccount = new EditText()
-            {
-                X = Application.GetRealWidth(52),
-                Width = Application.GetRealWidth(307),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = CSS_Color.FirstLevelTitleColor,
-                TextSize = CSS_FontSize.TextFontSize,
-                PlaceholderTextColor = CSS_Color.PromptingColor1,
-                PlaceholderText = "璇疯緭鍏ユ帴鏀舵柟璐﹀彿",
-            };
-            accountView.AddChidren(etAccount);
-
-            var btnLine = new Button()
-            {
-                BackgroundColor = CSS_Color.DividingLineColor,
-                Height = Application.GetRealHeight(1),
-                Y = accountView.Height - Application.GetRealHeight(1),
-                X = Application.GetRealWidth(16),
-                Width = Application.GetRealWidth(343),
-            };
-            accountView.AddChidren(btnLine);
-            #endregion
-
-            #region 璐﹀彿濉啓
-            var accountConfirmView = new FrameLayout()
-            {
-                Y = accountView.Bottom,
-                Height = Application.GetRealHeight(50),
-                BackgroundColor = CSS_Color.MainBackgroundColor
-            };
-            bodyView.AddChidren(accountConfirmView);
-
-            var btnAccountConfirmIcon = new Button()
-            {
-                X = Application.GetRealWidth(16),
-                Gravity = Gravity.CenterVertical,
-                Width = Application.GetMinRealAverage(24),
-                Height = Application.GetMinRealAverage(24),
-                UnSelectedImagePath = "LoginIcon/AccountIcon.png",
-            };
-            accountConfirmView.AddChidren(btnAccountConfirmIcon);
-
-            var etAccountConfirm = new EditText()
-            {
-                X = Application.GetRealWidth(52),
-                Width = Application.GetRealWidth(307),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = CSS_Color.FirstLevelTitleColor,
-                TextSize = CSS_FontSize.TextFontSize,
-                PlaceholderTextColor = CSS_Color.PromptingColor1,
-                PlaceholderText = "璇峰啀娆¤緭鍏ユ帴鏀舵柟璐﹀彿",
-            };
-            accountConfirmView.AddChidren(etAccountConfirm);
-
-            //var btnLine2 = new Button()
-            //{
-            //    BackgroundColor = CSS_Color.DividingLineColor,
-            //    Height = Application.GetRealHeight(1),
-            //    Y = accountConfirmView.Height - Application.GetRealHeight(1),
-            //};
-            //accountConfirmView.AddChidren(btnLine2);
-            #endregion
-
-            var btnTip = new Button()
-            {
-                Y = accountConfirmView.Bottom + Application.GetRealHeight(12),
-                X = Application.GetRealWidth(16),
-                Width = Application.GetRealWidth(343),
-                TextAlignment = TextAlignment.TopLeft,
-                TextColor = CSS_Color.AuxiliaryColor2,
-                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-                Text = "*璇风‘璁よ处鍙锋棤璇紝鍦ㄦ暟鎹浆绉昏繃绋嬩腑涓嶅彲鍙栨秷鎿嶄綔",
-                IsMoreLines = true
-
-            };
-            bodyView.AddChidren(btnTip);
-
-            var btnConfirm = new ConfirmButton()
-            {
-                Y = Application.GetRealHeight(251),
-                Text = "杩囨埛",
-            };
-            bodyView.AddChidren(btnConfirm);
-
-            btnConfirm.MouseUpEventHandler = (sender, e) => {
-                var skipPage = new TransferUserConfirmPage();
-                MainPage.BasePageView.AddChidren(skipPage);
-                skipPage.LoadPage();
-                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
-            };
-
-            Button btnEmailOption = new Button()
-            {
-                Y = btnConfirm.Bottom + Application.GetRealWidth(6),
-                Width = Application.GetRealWidth(220),
-                Height = Application.GetRealWidth(32),
-                TextSize = CSS_FontSize.TextFontSize,
-                TextColor = CSS_Color.MainColor,
-                Gravity = Gravity.CenterHorizontal,
-                TextAlignment = TextAlignment.Center,
-                Text = "鎵弿浜岀淮鐮佽繃鎴�"
-            };
-            bodyView.AddChidren(btnEmailOption);
-
-          
         }
 
+        #endregion
+
+        #region 鈻� 鎼滅储璐﹀彿___________________________
+
+        /// <summary>
+        /// 鎼滅储璐﹀彿淇℃伅
+        /// </summary>
+        /// <param name="i_account">鎼滅储鐨勮处鍙�</param>
+        /// <returns></returns>
+        private AccountInfoResult SearchAccountInfoByAccount(string i_account)
+        {
+            var result = new DAL.Server.HttpServerRequest().GetMemberInfoByAccount(i_account);
+            if (result.Code == DAL.Server.StateCode.ACCOUNT_NOT_EXIST)
+            {
+                //鐩爣璐﹀彿骞朵笉瀛樺湪
+                HdlMessageLogic.Current.ShowMassage(ShowMsgType.Tip, Language.StringByID(StringId.TargetAcountDoesNotExist));
+                return null;
+            }
+            if (result.Code != DAL.Server.StateCode.SUCCESS)
+            {
+                DAL.Server.IMessageCommon.Current.ShowErrorInfoAlter(result.Code);
+                return null;
+            }
+            var accountInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<AccountInfoResult>(result.Data.ToString());
+            accountInfo.Account = i_account;
+            if (accountInfo.MemberName == string.Empty)
+            {
+                accountInfo.MemberName = accountInfo.Account;
+            }
+            return accountInfo;
+        }
+
+        #endregion
     }
-
 }

--
Gitblit v1.8.0