From d6fb0646531172f23648441c224cdcccd721b894 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期一, 14 十二月 2020 09:59:01 +0800
Subject: [PATCH] 请合并代码,完成晾衣架最终功能。

---
 ZigbeeApp/Shared/Phone/UserCenter/Transfer/TransferResidenceMainForm.cs |  180 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 180 insertions(+), 0 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Transfer/TransferResidenceMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Transfer/TransferResidenceMainForm.cs
new file mode 100755
index 0000000..e170e76
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Transfer/TransferResidenceMainForm.cs
@@ -0,0 +1,180 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shared.Phone.UserCenter.Transfer
+{
+    /// <summary>
+    /// 浣忓畢杩囨埛鐨勪富鐣岄潰
+    /// </summary>
+    public class TransferResidenceMainForm : EditorCommonForm
+    {
+        #region 鈻� 鍙橀噺澹版槑___________________________
+
+        /// <summary>
+        /// 1:绉讳氦缁欑敤鎴�  2:鎺堟潈缁欒皟璇曚汉鍛�
+        /// </summary>
+        private int TransferDiv = 0;
+
+        #endregion
+
+        #region 鈻� 鍒濆鍖朹____________________________
+
+        /// <summary>
+        /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+        /// </summary>
+        /// <param name="i_TransferDiv">1:绉讳氦缁欑敤鎴�  2:鎺堟潈缁欒皟璇曚汉鍛�</param>
+        public void ShowForm(int i_TransferDiv)
+        {
+            this.TransferDiv = i_TransferDiv;
+            //璁剧疆澶撮儴淇℃伅
+            base.SetTitleText(i_TransferDiv == 1
+                ? Language.StringByID(R.MyInternationalizationString.HandoverToUser).Replace("{0}", string.Empty)
+                : Language.StringByID(R.MyInternationalizationString.AuthorizedToCommissioningPersonnel).Replace("{0}", string.Empty));
+
+            //鍒濆鍖栦腑閮ㄤ俊鎭�
+            this.InitMiddleFrame();
+        }
+
+        /// <summary>
+        /// 鍒濆鍖栦腑閮ㄤ俊鎭�
+        /// </summary>
+        private void InitMiddleFrame()
+        {
+            //杞Щ鍥剧墖
+            var btnPictrue = new PicViewControl(804, 268);
+            btnPictrue.Gravity = Gravity.CenterHorizontal;
+            btnPictrue.Y = Application.GetRealHeight(222);
+            btnPictrue.UnSelectedImagePath = "Item/TransferOfResidence.png";
+            bodyFrameLayout.AddChidren(btnPictrue);
+
+            //杞Щ浣忓畢鍒板叾浠朎voyo Home璐﹀彿
+            var btnMsg1 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(90), false);
+            btnMsg1.Y = Application.GetRealHeight(593);
+            btnMsg1.TextSize = 20;
+            btnMsg1.IsBold = true;
+            btnMsg1.TextAlignment = TextAlignment.Center;
+            btnMsg1.Text = this.TransferDiv == 1 ? "杞Щ浣忓畢鍒板叾浠栫敤鎴疯处鍙�" : "杞Щ浣忓畢鍒板叾浠栬皟璇曚汉鍛樿处鍙�";
+            bodyFrameLayout.AddChidren(btnMsg1);
+
+            //璇ユ搷浣滀笉鍙�嗭紝璇锋敞鎰忥細
+            var btnTip = new NormalViewControl(900, 60, true);
+            btnTip.X = Application.GetRealWidth(135);
+            btnTip.Y = btnMsg1.Bottom + Application.GetRealHeight(257);
+            btnTip.TextID = R.MyInternationalizationString.uThisOperationIsIrreversiblePleaseNote;
+            bodyFrameLayout.AddChidren(btnTip);
+            //1.鎺ユ敹鏂逛负鏈夋晥娉ㄥ唽璐﹀彿
+            var btnTipMsg1 = new NormalViewControl(900, 55, true);
+            btnTipMsg1.X = btnTip.X;
+            btnTipMsg1.Y = btnTip.Bottom + Application.GetRealHeight(30);
+            btnTipMsg1.TextSize = 12;
+            btnTipMsg1.TextColor = UserCenterColor.Current.TextGrayColor1;
+            btnTipMsg1.Text = "1.鎺ユ敹鏂逛负鏈夋晥娉ㄥ唽璐﹀彿";
+            bodyFrameLayout.AddChidren(btnTipMsg1);
+            //2.鎺ユ敹鏂逛笌杞Щ鏂逛笉鍙互涓哄悓涓�涓处鍙�
+            var btnTipMsg2 = new NormalViewControl(900, 55, true);
+            btnTipMsg2.X = btnTip.X;
+            btnTipMsg2.Y = btnTipMsg1.Bottom + Application.GetRealHeight(30);
+            btnTipMsg2.TextSize = 12;
+            btnTipMsg2.TextColor = UserCenterColor.Current.TextGrayColor1;
+            btnTipMsg2.Text = "2.鎺ユ敹鏂逛笌杞Щ鏂逛笉鍙互涓哄悓涓�涓处鍙�";
+            bodyFrameLayout.AddChidren(btnTipMsg2);
+            //3.杞Щ鎴愬姛鍚庯紝灏嗗彇娑堣浆绉绘柟鎴愬憳瀵硅浣忓畢鐨勪娇鐢ㄦ潈
+            var btnTipMsg3 = new NormalViewControl(900, 55, true);
+            btnTipMsg3.X = btnTip.X;
+            btnTipMsg3.Y = btnTipMsg2.Bottom + Application.GetRealHeight(30);
+            btnTipMsg3.TextSize = 12;
+            btnTipMsg3.TextColor = UserCenterColor.Current.TextGrayColor1;
+            btnTipMsg3.Text = "3.杞Щ鎴愬姛鍚庯紝灏嗗彇娑堣浆绉绘柟鎴愬憳瀵硅浣忓畢鐨勪娇鐢ㄦ潈";
+            bodyFrameLayout.AddChidren(btnTipMsg3);
+
+            //杈撳叆璐﹀彿
+            var btnInputAccount = new BottomClickButton(372);
+            btnInputAccount.Gravity = Gravity.Frame;
+            btnInputAccount.X = Application.GetRealWidth(115);
+            btnInputAccount.TextID = R.MyInternationalizationString.uInputAccount;
+            bodyFrameLayout.AddChidren(btnInputAccount);
+            btnInputAccount.ButtonClickEvent += (sender, e) =>
+            {
+                var form = new TransferResidenceByIdForm();
+                form.AddForm(this.TransferDiv);
+            };
+
+            //鎵弿浜岀淮鐮佺殑鑳屾櫙
+            var btnScanGroud = new NormalViewControl(429, 184, true);
+            btnScanGroud.Y = Application.GetRealHeight(1454);
+            btnScanGroud.X = btnInputAccount.Right + Application.GetRealWidth(78);
+            btnScanGroud.UnSelectedImagePath = "Item/ScanQrCodeGroud.png";
+            bodyFrameLayout.AddChidren(btnScanGroud);
+            //鎵弿浜岀淮鐮�
+            var btnScanQrCode = new BottomClickButton(372);
+            btnScanQrCode.Gravity = Gravity.Frame;
+            btnScanQrCode.X = btnScanGroud.X + Application.GetRealWidth(28);
+            btnScanQrCode.TextID = R.MyInternationalizationString.uScanQRcode;
+            btnScanQrCode.BackgroundColor = UserCenterColor.Current.Transparent;
+            btnScanQrCode.UseClickStatu = false;
+            bodyFrameLayout.AddChidren(btnScanQrCode);
+            btnScanQrCode.ButtonClickEvent += (sender, e) =>
+            {
+                QRCode.ScanQRcode((qrCode) =>
+                {
+                    if (string.IsNullOrEmpty(qrCode) == true)
+                    {
+                        return;
+                    }
+                    //鎼滅储ID
+                    HdlThreadLogic.Current.RunThread(() =>
+                    {
+                        this.SearchMemberInfo(qrCode);
+                    });
+                }, 
+                Language.StringByID(R.MyInternationalizationString.uCancel),
+                Language.StringByID(R.MyInternationalizationString.uFlashlamp),
+                Language.StringByID(R.MyInternationalizationString.uScanQRcode));
+            };
+        }
+
+        #endregion
+
+        #region 鈻� 鎼滅储ID_____________________________
+
+        /// <summary>
+        /// 鎼滅储鎸囧畾ID鐨勪俊鎭�
+        /// </summary>
+        /// <param name="accountId">鎴愬憳ID</param>
+        /// <param name="txtMsg">淇℃伅鎺т欢</param>
+        private void SearchMemberInfo(string accountId)
+        {
+            var pra = new AccountInfoPra();
+            pra.Account = accountId;
+            var byteData = UserCenterLogic.GetByteResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountInfo", false, pra, new List<string> { "NotCheck" });
+            if (byteData == null)
+            {
+                //寮傚父
+                return;
+            }
+            var revertObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.ResponseEntity.ResponsePack>(System.Text.Encoding.UTF8.GetString(byteData));
+            if (revertObj.StateCode == "AccountNoExists")
+            {
+                HdlThreadLogic.Current.RunMain(() =>
+                {
+                    //璐﹀彿淇℃伅
+                    var form = new Member.MemberNotEsixtForm();
+                    form.AddForm(Language.StringByID(R.MyInternationalizationString.uAccountInfo));
+                });
+                return;
+            }
+
+            var infoResult = Newtonsoft.Json.JsonConvert.DeserializeObject<AccountInfoResult>(revertObj.ResponseData.ToString());
+            infoResult.Account = accountId;
+
+            HdlThreadLogic.Current.RunMain(() =>
+            {
+                var form2 = new AddMemberInfoForm();
+                form2.AddForm(infoResult, this.TransferDiv);
+            });
+        }
+
+        #endregion
+    }
+}

--
Gitblit v1.8.0