From 8b9ce384b26c414db32f98e94e088f5334869c2d Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期三, 13 十一月 2019 15:36:28 +0800
Subject: [PATCH] 全部合并了代码,安卓和 IOS 都测试通过了

---
 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSettingSub.cs |   74 ++++++++++++++++++++----------------
 1 files changed, 41 insertions(+), 33 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSettingSub.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSettingSub.cs
index 5198645..fe70ffa 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSettingSub.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSettingSub.cs
@@ -27,7 +27,7 @@
         /// </summary>
         public void Show()
         {
-            this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.FunctionSetting));
+            this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.DoorLockFunctionSetting));
 
             EventHandler<MouseEventArgs> eHandlerBack = (sender, e) =>
             {
@@ -90,7 +90,7 @@
                 Text = Language.StringByID(R.MyInternationalizationString.InformationEdit),
                 TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                 TextAlignment = TextAlignment.CenterLeft,
-                TextSize = 12,
+                TextSize = 15,
             };
             bottomFrameLayout2.AddChidren(informationEdit);
 
@@ -109,7 +109,7 @@
                     X = Application.GetRealWidth(58),
                     TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                     TextAlignment = TextAlignment.CenterLeft,
-                    TextSize = 12,
+                    TextSize = 14,
                 };
                 bottomRowLayout.AddChidren(btnName);
 
@@ -132,7 +132,7 @@
                 var btnLine = new FrameLayout()
                 {
                     Width = Application.GetRealWidth(965),
-                    Height = Application.GetRealHeight(2),
+                    Height = 1,
                     X = Application.GetRealWidth(58),
                     BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine,
                     Visible = false,
@@ -188,7 +188,7 @@
                 }
                 else if (i == 3)
                 {
-                    bottomRowLayout.Y = Application.GetRealHeight(723 + 35);
+                    bottomRowLayout.Y = Application.GetRealHeight(585 + 35);
                     btnNext.X = Application.GetRealWidth(0);
                     btnName.Text = Language.StringByID(R.MyInternationalizationString.RemotelyUnlock);
                     btnNext.Width = Application.GetRealWidth(104);
@@ -196,8 +196,8 @@
                     btnNext.UnSelectedImagePath = "DoorLock/Switch.png";
                     btnNext.SelectedImagePath = "DoorLock/SwitchOn.png";
                     btnLine.Visible = true;
-                    btnLine.Y = Application.GetRealHeight(853);
-                    if (ZigBee.Device.DoorLock.RemoteUnlockPassword == "")
+                    btnLine.Y = Application.GetRealHeight(714);
+                    if (doorLock.RemoteUnlockPassword == "")
                     {
                         btnNext.IsSelected = false;
                     }
@@ -208,32 +208,40 @@
                 }
 
                 int currentIndex = i;
-                EventHandler<MouseEventArgs> eHandler = (sender, e) =>
-                {
-                    if (currentIndex == 3)
-                    {
-                        //if (doorLock.HasRemoteUnlockAccess[acc.SubAccountDistributedMark] == true)
-                        //{
-
-                        //}
-                        //else
-                        //{
-
-                        //}
-                        btnNext.IsSelected = !btnNext.IsSelected;
-                        if (btnNext.IsSelected)
-                        {
-                            if (ZigBee.Device.DoorLock.RemoteUnlockPassword == "")
-                            {
-                                RemotePasswordDialog(doorLock, btnNext);
-                            }
-                        }
-                        else
-                        {
-                            ZigBee.Device.DoorLock.RemoteUnlockPassword = "";
-                        }
-                    }
-                };
+                EventHandler<MouseEventArgs> eHandler = async (sender, e) =>
+                 {
+                     if (currentIndex == 3)
+                     {
+                         var result = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockOperateAccess(doorLock, Shared.Common.Config.Instance.Guid);
+                         if (result == false)
+                         {
+                             var result1 = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockUnlockAccess(doorLock, Shared.Common.Config.Instance.Guid);
+                             if (result1 == true)
+                             {
+                                 btnNext.IsSelected = !btnNext.IsSelected;
+                                 if (btnNext.IsSelected)
+                                 {
+                                     if (doorLock.RemoteUnlockPassword == "")
+                                     {
+                                         RemotePasswordDialog(doorLock, btnNext);
+                                     }
+                                 }
+                                 else
+                                 {
+                                     doorLock.RemoteUnlockPassword = "";
+                                 }
+                             }
+                             else
+                             {
+                                 new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.NoAccess), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
+                             }
+                         }
+                         else
+                         {
+                             new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.AccountIsFreezed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
+                         }
+                     }
+                 };
                 bottomRowLayout.MouseDownEventHandler += eHandler;
                 btnNext.MouseDownEventHandler += eHandler;
                 btnName.MouseDownEventHandler += eHandler;

--
Gitblit v1.8.0