From 9a4b76398009cf76c508d61f7e48fb6f5cb7ac2d Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期二, 21 七月 2020 09:46:53 +0800
Subject: [PATCH] 请合并最新多功能面板代码

---
 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethod.cs |  151 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 151 insertions(+), 0 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethod.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethod.cs
new file mode 100755
index 0000000..554ba28
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethod.cs
@@ -0,0 +1,151 @@
+锘縰sing System;
+using ZigBee.Device;
+
+namespace Shared.Phone.UserCenter.DoorLock
+{
+    public class AddUnLockMethod : DoorLockCommonLayout
+    {
+        /// 鏋勯�犲嚱鏁�
+        /// </summary>
+        /// <param name="doorLock"></param>
+        public AddUnLockMethod(ZigBee.Device.DoorLock doorLock, Shared.Phone.UserCenter.MemberInfoRes accountObj)
+        {
+            this.doorLock = doorLock;
+            this.curAccountObj = accountObj;
+            BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor;
+        }
+
+        #region 鍙橀噺鐢虫槑
+        /// <summary>
+        /// 褰撳墠闂ㄩ攣
+        /// </summary>
+        ZigBee.Device.DoorLock doorLock;
+        /// <summary>
+        /// 褰撳墠璐︽埛
+        /// </summary>
+        Shared.Phone.UserCenter.MemberInfoRes curAccountObj;
+        #endregion
+
+        /// <summary>
+        /// UI鏄剧ず 
+        /// </summary>
+        public void Show()
+        {
+            this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.AddNewUnlockMethod));
+
+            EventHandler<MouseEventArgs> eHandlerBack = (sender, e) =>
+            {
+                RemoveFromParent();
+            };
+            this.btnBack.MouseUpEventHandler += eHandlerBack;
+            this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack;
+            this.MidFrameLayout(this);
+
+            MidFrameLayoutContent();
+        }
+       
+        /// <summary>
+        /// 涓儴甯冨眬
+        /// </summary>
+        public void MidFrameLayoutContent()
+        {
+            var bodyView = new VerticalScrolViewLayout()
+            {
+            };
+            this.midFrameLayout.AddChidren(bodyView);
+
+            for (int i = 0; i < 3; i++)
+            {
+                var RowView = new FrameLayout()
+                {
+                    Height = Application.GetRealHeight(161),
+                    BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite,
+                };
+                bodyView.AddChidren(RowView);
+
+                var btnText = new Button()
+                {
+                    X = Application.GetRealWidth(58),
+                    Width = Application.GetRealWidth(300),
+                    Height = Application.GetRealHeight(300),
+                    TextAlignment = TextAlignment.CenterLeft,
+                    TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
+                    Gravity = Gravity.CenterVertical,
+                    TextSize=14,
+                };
+                RowView.AddChidren(btnText);
+
+                var btnRightFrameLayout = new FrameLayout()
+                {
+                    Height = Application.GetRealHeight(110),
+                    Width = Application.GetRealWidth(110),
+                    X = Application.CurrentWidth - Application.GetRealWidth(150),
+                    Y = Application.GetRealHeight(25),
+                };
+                RowView.AddChidren(btnRightFrameLayout);
+
+                var btnRight = new Button()
+                {
+                    Height = Application.GetRealHeight(60),
+                    Width = Application.GetRealWidth(60),
+                    UnSelectedImagePath = "DoorLock/RightIcon.png",
+                    Gravity = Gravity.Center,
+                };
+                btnRightFrameLayout.AddChidren(btnRight);
+
+                var line2 = new Button()
+                {
+                    Y = RowView.Height - 1,
+                    X = Application.GetRealWidth(58),
+                    Width = Application.GetRealWidth(965),
+                    Height = 1,
+                    BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine,
+                };
+                RowView.AddChidren(line2);
+
+                if (i == 0)
+                {
+                    btnText.TextID = R.MyInternationalizationString.AddPassword;
+                }
+                else if (i == 1)
+                {
+                    btnText.TextID = R.MyInternationalizationString.AddFingerprint;
+                }
+                else if (i == 2)
+                {
+                    btnText.TextID = R.MyInternationalizationString.AddIcCard;
+                    line2.Visible = false;
+                }
+
+                int currentIndex = i;
+                EventHandler<MouseEventArgs> eHandler = (sender, e) =>
+                {
+                    if (currentIndex == 0)
+                    {
+                        var addUnLockMethodTip = new AddUnLockMethodTip(doorLock, curAccountObj, "password");
+                        Shared.Phone.UserView.HomePage.Instance.AddChidren(addUnLockMethodTip);
+                        Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
+                        addUnLockMethodTip.Show();
+                    }
+                    else if (currentIndex == 1)
+                    {
+                        var addUnLockMethodTip = new AddUnLockMethodTip(doorLock, curAccountObj, "fingerprint");
+                        Shared.Phone.UserView.HomePage.Instance.AddChidren(addUnLockMethodTip);
+                        Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
+                        addUnLockMethodTip.Show();
+                    }
+                    else if (currentIndex == 2)
+                    {
+                        var addUnLockMethodTip = new AddUnLockMethodTip(doorLock, curAccountObj, "proximity");
+                        Shared.Phone.UserView.HomePage.Instance.AddChidren(addUnLockMethodTip);
+                        Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
+                        addUnLockMethodTip.Show();
+                    }
+                };
+                btnRight.MouseUpEventHandler += eHandler;
+                RowView.MouseUpEventHandler += eHandler;
+                btnText.MouseUpEventHandler += eHandler;
+            }
+        }
+    }
+}

--
Gitblit v1.8.0