From ec35d79add60d1438dff5291389f7e69c579d9f9 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期四, 21 十一月 2019 18:18:25 +0800
Subject: [PATCH] 完成面板楼层显示处理和下拉刷新处理,请合并最新代码

---
 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs | 1020 +++++++++++++++++++++++++++++++++--------------------------
 1 files changed, 570 insertions(+), 450 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
old mode 100755
new mode 100644
index 6bd28b7..76083c2
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
@@ -2,11 +2,39 @@
 using System.Collections.Generic;
 using System.ComponentModel;
 using Shared.Common;
+using ZigBee.Device;
 
 namespace Shared.Phone.UserCenter.DoorLock
 {
-    public class UnLockMethod : DoorLockCommonLayout
+    public class UnLockMethod : DoorLockCommonLayout, ZigBee.Common.IStatus
     {
+        /// <summary>
+        /// 澶勭悊鍙樺寲浜嬩欢
+        /// </summary>
+        /// <param name="common"></param>
+        /// <param name="typeTag"></param>
+        public void DeviceInfoChange(CommonDevice tempDevice, string typeTag)
+        {
+            if (typeTag == "DoorLockProgrammingEventNotificationCommand" && tempDevice != null)
+            {
+                if (tempDevice != null)
+                {
+                    if (tempDevice.DeviceEpoint == doorLock.DeviceEpoint
+                                      && tempDevice.DeviceAddr == doorLock.DeviceAddr)
+                    {
+                        var doorLock = tempDevice as ZigBee.Device.DoorLock;
+                        if (doorLock.doorLockProgrammingEventNotificationCommand != null)
+                        {
+
+                            Application.RunOnMainThread(() =>
+                            {
+
+                            });
+                        }
+                    }
+                }
+            }
+        }
         /// 鏋勯�犲嚱鏁�
         /// </summary>
         /// <param name="doorLock"></param>
@@ -19,7 +47,7 @@
 
         #region 鈼� 鍙橀噺鐢虫槑__________________________
         ZigBee.Device.DoorLock doorLock;
-        VerticalScrolViewLayout bodyView;
+        VerticalRefreshLayout bodyView;
         Button currentMethod;// 褰撳墠閫夋嫨鐨勬柟寮�
         Shared.Phone.UserCenter.MemberInfoRes curAccountObj;
         Button entryStatusPic;
@@ -32,10 +60,17 @@
         {
             System.Threading.Tasks.Task.Run(async () =>
             {
-                Application.RunOnMainThread(() => { CommonPage.Loading.Start("Loading..."); });
                 try
                 {
-                    await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetLocaDoorLocklist(doorLock, curAccountObj);
+                    var list = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockAllAcountUserlist(doorLock);
+                    if (doorLock.IsFailedToGetDoorLockInfo[curAccountObj.SubAccountDistributedMark] == true)
+                    {
+                        //鏁版嵁濡傛灉鍦ㄩ棬閿佷笂闈㈡槸绌虹殑鏃跺�欙紝鏁版嵁涔熸槸娌℃湁鐨�
+                        Application.RunOnMainThread(() =>
+                        {
+                            new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
+                        });
+                    }
                 }
                 catch { }
                 finally
@@ -58,7 +93,7 @@
             this.btnTitleLine.Visible = false;
             EventHandler<MouseEventArgs> eHandlerBack = (sender, e) =>
             {
-                RemoveFromParent();
+                this.RemoveFromParent();
             };
             this.btnBack.MouseUpEventHandler += eHandlerBack;
             this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack;
@@ -66,7 +101,7 @@
 
             var btnAddFrameLayout = new FrameLayout
             {
-                X = Application.GetRealWidth(953),
+                X = Application.GetRealWidth(953 - 116),
                 Height = Application.GetRealHeight(72),
                 Width = Application.GetRealWidth(72),
             };
@@ -79,11 +114,15 @@
                 UnSelectedImagePath = "DoorLock/AddIcon.png",
             };
             btnAddFrameLayout.AddChidren(btnAdd);
+            if (UserCenterResourse.UserInfo.AuthorityNo != 1)
+            {
+                btnAdd.Width = 0;
+            }
             btnAdd.MouseDownEventHandler += (sender, e) =>
             {
                 if (doorLock.IsFreezeAccount[curAccountObj.SubAccountDistributedMark] == true)
                 {
-                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.AccountIsFreezed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
+                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.AccountIsFreezed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
                 }
                 else
                 {
@@ -93,11 +132,30 @@
                     addUnLockMethod.Show();
                 }
             };
-            MidFrameLayoutContent();
+            if (UserCenterResourse.UserInfo.AuthorityNo == 3)
+            {
+                btnAddFrameLayout.Width = 0;
+            }
+            else
+            {
+                btnAddFrameLayout.Width = Application.GetRealWidth(72);
+            }
+
+            if (doorLock.IsFailedToGetDoorLockInfo[curAccountObj.SubAccountDistributedMark] == true)
+            {
+                CommonPage.Loading.Start("Loading...");
+                ReadDoorLockUserInfo();
+            }
+            else
+            {
+                MidFrameLayoutContent();
+                RefreshList();
+            }
         }
         //涓儴甯冨眬
         void MidFrameLayoutContent()
         {
+            #region 寮�閿佹柟寮廢I
             var midTopFrameLayout = new FrameLayout()
             {
                 Height = Application.GetRealHeight(115),
@@ -111,8 +169,8 @@
                 Width = Application.GetRealWidth(141 + 100),
                 Y = Application.GetRealHeight(35),
                 X = Application.GetRealWidth(812 - 100),
-                TextAlignment = TextAlignment.Center,
-                Text = Language.StringByID(R.MyInternationalizationString.LockMethod),
+                TextAlignment = TextAlignment.CenterRight,
+                Text = Language.StringByID(R.MyInternationalizationString.AllMethod),
                 TextColor = Shared.Common.ZigbeeColor.Current.XMTopTitleText,
                 TextSize = 12,
             };
@@ -129,22 +187,33 @@
             };
             midTopFrameLayout.AddChidren(btnNext);
 
+            btnNext.MouseUpEventHandler += (sender, e) =>
+            {
+                SideslipFramelayout();
+            };
+            var btnLine = new Button
+            {
+                Y = midTopFrameLayout.Bottom,
+                Height = 1,
+                BackgroundColor = Shared.Common.ZigbeeColor.Current.XMTitleLine,
+            };
+            this.midFrameLayout.AddChidren(btnLine);
+            #endregion
+
             entryStatusPic = new Button
             {
                 X = Application.GetRealWidth(164),
-                Y = Application.GetRealHeight(492),
-                Height = Application.GetRealHeight(435),
-                Width = Application.GetRealWidth(757),
+                Y = Application.GetRealHeight(377),
                 Visible = false,
                 UnSelectedImagePath = "DoorLock/UnLockBlankPic.png",
             };
             this.midFrameLayout.AddChidren(entryStatusPic);
 
+            #region 绌哄浘鐗�
             btnPicTip = new Button
             {
                 X = Application.GetRealWidth(397),
-                Y = Application.GetRealHeight(1143 - 184),
-                Height = Application.GetRealHeight(98 / 2),
+                Y = Application.GetRealHeight(844),
                 Text = Language.StringByID(R.MyInternationalizationString.NoPasswordInformation),
                 TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
                 Gravity = Gravity.CenterHorizontal,
@@ -156,40 +225,25 @@
             {
                 X = Application.GetRealWidth(397),
                 Y = btnPicTip.Bottom,
-                Height = Application.GetRealHeight(98 / 2),
                 Text = Language.StringByID(R.MyInternationalizationString.NoPasswordInformation1),
                 TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
                 Gravity = Gravity.CenterHorizontal,
                 Visible = false,
             };
             this.midFrameLayout.AddChidren(btnPicTip1);
+            #endregion
 
-            var btnLine = new Button
-            {
-                Y = midTopFrameLayout.Bottom,
-                Height = 1,
-                BackgroundColor = Shared.Common.ZigbeeColor.Current.XMTitleLine,
-            };
-            this.midFrameLayout.AddChidren(btnLine);
-
-            bodyView = new VerticalScrolViewLayout()
+            bodyView = new VerticalRefreshLayout()
             {
                 Y = btnLine.Bottom,
             };
             this.midFrameLayout.AddChidren(bodyView);
-
-            btnNext.MouseUpEventHandler += (sender, e) =>
+            bodyView.BeginHeaderRefreshingAction += () =>
             {
-                SideslipFramelayout();
-            };
-            if (doorLock.IsFailedToGetDoorLockInfo[curAccountObj.SubAccountDistributedMark] == true)
-            {
+                bodyView.BeginHeaderRefreshing();
                 ReadDoorLockUserInfo();
-            }
-            else
-            {
-                RefreshList();
-            }
+                bodyView.EndHeaderRefreshing();
+            };
         }
 
         /// <summary>
@@ -199,14 +253,10 @@
         /// <param name="key"></param>
         public void RefreshList()
         {
-            if (doorLock.IsFailedToGetDoorLockInfo[curAccountObj.SubAccountDistributedMark] == true)
-            {
-                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
-                return;
-            }
+            this.midFrameLayout.RemoveAll();
+            MidFrameLayoutContent();
             bodyView.RemoveAll();
             var curAccountDoorLockUserList = new Dictionary<int, ZigBee.Device.DoorLock.LocaDoorLockObj>();
-
             foreach (var curUserId in doorLock.localDoorLockUserList.Keys)
             {
                 var curDoorLockUser = doorLock.localDoorLockUserList[curUserId];
@@ -226,231 +276,207 @@
                 entryStatusPic.Visible = true;
                 btnPicTip.Visible = true;
                 btnPicTip1.Visible = true;
+                entryStatusPic.Height = Application.GetRealHeight(435);
+                entryStatusPic.Width = Application.GetRealHeight(757);
+                btnPicTip.Height = Application.GetRealHeight(98 / 2);
+                btnPicTip1.Height = Application.GetRealHeight(98 / 2);
+                bodyView.Height = Application.GetRealHeight(0);
             }
             else
             {
+                bodyView.Height = Application.GetRealHeight(1921 - 184 - 116);
                 entryStatusPic.Visible = false;
                 btnPicTip.Visible = false;
                 btnPicTip1.Visible = false;
-            }
-
-            foreach (var curUserId in curAccountDoorLockUserList.Keys)
-            {
-                var curDoorLockUser = curAccountDoorLockUserList[curUserId];
-                #region UI
-                var rowFrameLayout = new RowLayout()
+                entryStatusPic.Height = Application.GetRealHeight(0);
+                entryStatusPic.Width = Application.GetRealHeight(0);
+                btnPicTip.Height = Application.GetRealHeight(0);
+                btnPicTip1.Height = Application.GetRealHeight(0);
+                var frameLayoutRow = new FrameLayout()
                 {
-                    Height = Application.GetRealHeight(173),
-                    X = Application.GetRealWidth(58),
-                    Width = Application.GetRealWidth(965),
-                    LineColor = Shared.Common.ZigbeeColor.Current.XMRowLine,
+                    Height = Application.GetMinRealAverage(0),
+                    BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite,
                 };
-                bodyView.AddChidren(rowFrameLayout);
+                bodyView.AddChidren(frameLayoutRow);
+                int i = 0;
+                foreach (var curUserId in curAccountDoorLockUserList.Keys)
+                {
+                    var curDoorLockUser = curAccountDoorLockUserList[curUserId];
+                    #region UI
+                    var rowFrameLayout = new RowLayout()
+                    {
+                        Height = Application.GetRealHeight(127 + 23),
+                        X = Application.GetRealWidth(58),
+                        Y = i * Application.GetRealHeight(150),
+                        Width = Application.GetRealWidth(965),
+                        LineColor = Shared.Common.ZigbeeColor.Current.XMRowLine,
+                        BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite,
+                    };
+                    frameLayoutRow.AddChidren(rowFrameLayout);
 
-                var btnPicFrameLayout = new FrameLayout()
-                {
-                    Width = Application.GetRealWidth(81),
-                    Height = Application.GetRealHeight(81),
-                    X = Application.GetRealWidth(40),
-                    Y = Application.GetRealHeight(49),
-                };
-                rowFrameLayout.AddChidren(btnPicFrameLayout);
+                    var btnPicFrameLayout = new FrameLayout()
+                    {
+                        Width = Application.GetRealWidth(81),
+                        Height = Application.GetRealHeight(81),
+                        X = Application.GetRealWidth(40),
+                        Y = Application.GetRealHeight(49),
+                    };
+                    rowFrameLayout.AddChidren(btnPicFrameLayout);
 
-                var btnPic = new Button()
-                {
-                    Width = Application.GetRealWidth(84),
-                    Height = Application.GetRealHeight(84),
-                    UnSelectedImagePath = "DoorLock/DoorLockUserPic.png",
-                };
-                btnPicFrameLayout.AddChidren(btnPic);
+                    var btnPic = new Button()
+                    {
+                        Width = Application.GetRealWidth(84),
+                        Height = Application.GetRealHeight(84),
+                        UnSelectedImagePath = "DoorLock/DoorLockUserPic.png",
+                    };
+                    btnPicFrameLayout.AddChidren(btnPic);
 
-                var btnDoorlockUser = new EditText()
-                {
-                    Width = Application.GetRealWidth(1080 - 173),
-                    Height = Application.GetRealHeight(60),
-                    X = Application.GetRealWidth(173),
-                    Y = Application.GetRealHeight(35),
-                    TextSize = 14,
-                    PlaceholderTextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
-                    TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
-                    TextAlignment = TextAlignment.CenterLeft,
-                };
-                rowFrameLayout.AddChidren(btnDoorlockUser);
+                    var btnDoorlockUser = new EditText()
+                    {
+                        Width = Application.GetRealWidth(1080 - 173),
+                        Height = Application.GetRealHeight(60),
+                        X = Application.GetRealWidth(173),
+                        Y = Application.GetRealHeight(35),
+                        TextSize = 14,
+                        PlaceholderTextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
+                        TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
+                        TextAlignment = TextAlignment.CenterLeft,
+                    };
+                    rowFrameLayout.AddChidren(btnDoorlockUser);
 
-                var btnMember = new Button()
-                {
-                    Width = Application.GetRealWidth(1080 - 173),
-                    Height = Application.GetRealHeight(49),
-                    X = Application.GetRealWidth(173),
-                    Y = Application.GetRealHeight(95),
-                    TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
-                    TextSize = 14,
-                    TextAlignment = TextAlignment.CenterLeft,
-                };
-                rowFrameLayout.AddChidren(btnMember);
+                    var btnMember = new Button()
+                    {
+                        Width = Application.GetRealWidth(1080 - 173),
+                        Height = Application.GetRealHeight(49),
+                        X = Application.GetRealWidth(173),
+                        Y = Application.GetRealHeight(95),
+                        TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
+                        TextSize = 14,
+                        TextAlignment = TextAlignment.CenterLeft,
+                    };
+                    rowFrameLayout.AddChidren(btnMember);
 
-                var btnDel = new Button()
-                {
-                    Width = Application.GetRealWidth(1080 - 173),
-                    Height = Application.GetRealHeight(49),
-                    X = Application.GetRealWidth(173),
-                    Y = Application.GetRealHeight(95),
-                    Text = Language.StringByID(R.MyInternationalizationString.DelBindDevice),
-                    TextColor = Shared.Common.ZigbeeColor.Current.XMWhite,
-                    TextSize = 12,
-                    TextAlignment = TextAlignment.Center,
-                    BackgroundColor = Shared.Common.ZigbeeColor.Current.XMDel,
-                };
-                rowFrameLayout.AddRightView(btnDel);
-                #endregion 
-                #region 鏁版嵁澶勭悊
-                switch (curDoorLockUser.UnlockType)
-                {
-                    case 0:
-                        if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
-                        {
-                            btnDoorlockUser.Text = curDoorLockUser.UserName;
-                        }
-                        else
-                        {
-                            btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.Password) + "ID" + curDoorLockUser.UserID;
-                        }
-                        break;
-                    case 3:
-                        if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
-                        {
-                            btnDoorlockUser.Text = curDoorLockUser.UserName;
-                        }
-                        else
-                        {
-                            btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.IcCard) + "ID" + curDoorLockUser.UserID;
-                        }
-                        break;
-                    case 15:
-                        if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
-                        {
-                            btnDoorlockUser.Text = curDoorLockUser.UserName;
-                        }
-                        else
-                        {
-                            btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.Fingerprint) + "ID" + +curDoorLockUser.UserID;
-                        }
-                        break;
-                }
+                    var btnDel = new Button()
+                    {
+                        Width = Application.GetRealWidth(184),
+                        Text = Language.StringByID(R.MyInternationalizationString.DelBindDevice),
+                        TextColor = Shared.Common.ZigbeeColor.Current.XMWhite,
+                        TextSize = 12,
+                        TextAlignment = TextAlignment.Center,
+                        BackgroundColor = Shared.Common.ZigbeeColor.Current.XMDel,
+                    };
+                    rowFrameLayout.AddRightView(btnDel);
+                    #endregion
+                    #region 鏁版嵁澶勭悊
+                    int currentIndex = i;
+                    if (currentIndex == curAccountDoorLockUserList.Keys.Count - 1)
+                    {
+                        rowFrameLayout.LineColor = Shared.Common.ZigbeeColor.Current.XMWhite;
+                    }
 
-                if (curAccountObj.UserName == "" || curAccountObj.UserName == null)
-                {
-                    btnMember.Text = curAccountObj.Account;
-                }
-                else
-                {
-                    btnMember.Text = curAccountObj.UserName;
-                }
+                    switch (curDoorLockUser.UnlockType)
+                    {
+                        case 0:
+                            if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
+                            {
+                                btnDoorlockUser.Text = curDoorLockUser.UserName;
+                            }
+                            else
+                            {
+                                btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.Password) + "ID" + curDoorLockUser.UserID;
+                            }
+                            break;
+                        case 3:
+                            if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
+                            {
+                                btnDoorlockUser.Text = curDoorLockUser.UserName;
+                            }
+                            else
+                            {
+                                btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.IcCard) + "ID" + curDoorLockUser.UserID;
+                            }
+                            break;
+                        case 15:
+                            if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
+                            {
+                                btnDoorlockUser.Text = curDoorLockUser.UserName;
+                            }
+                            else
+                            {
+                                btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.Fingerprint) + "ID" + +curDoorLockUser.UserID;
+                            }
+                            break;
+                    }
 
-                Action<Shared.View> action = async (obj) =>
-                 {
-                     var refreshDoorLockData = new ZigBee.Device.DoorLock.RefreshDoorLockData();
-                     if (UserCenterResourse.UserInfo.AuthorityNo != 1)
+                    if (curAccountObj.UserName == "" || curAccountObj.UserName == null)
+                    {
+                        btnMember.Text = curAccountObj.Account;
+                    }
+                    else
+                    {
+                        btnMember.Text = curAccountObj.UserName;
+                    }
+
+                    Action<Shared.View> action = async (obj) =>
                      {
-                         refreshDoorLockData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
-                         refreshDoorLockData.IsOtherAccountCtrl = true;
-                     }
-                     if (doorLock.DeviceAddr != null)
-                     {
-                         refreshDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
-                     }
-                     refreshDoorLockData.OpenLockMode = curDoorLockUser.UnlockType;
-                     refreshDoorLockData.DoorLockLocalUserId = curDoorLockUser.UserID.ToString();
-                     refreshDoorLockData.PrimaryId = curDoorLockUser.PrimaryId;
-                     refreshDoorLockData.UserIdRemarks = btnDoorlockUser.Text;
-                     var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/UpdateDoorLock", refreshDoorLockData);
-                     if (result != null)
-                     {
-                         if (result.StateCode == "Success")
+                         var refreshDoorLockData = new ZigBee.Device.DoorLock.RefreshDoorLockData();
+                         if (UserCenterResourse.UserInfo.AuthorityNo != 1)
                          {
-                             if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID))
+                             refreshDoorLockData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
+                             refreshDoorLockData.IsOtherAccountCtrl = true;
+                         }
+                         if (doorLock.DeviceAddr != null)
+                         {
+                             refreshDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
+                         }
+                         refreshDoorLockData.OpenLockMode = curDoorLockUser.UnlockType;
+                         refreshDoorLockData.DoorLockLocalUserId = curDoorLockUser.UserID.ToString();
+                         refreshDoorLockData.PrimaryId = curDoorLockUser.PrimaryId;
+                         refreshDoorLockData.UserIdRemarks = btnDoorlockUser.Text;
+                         var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/UpdateDoorLock", refreshDoorLockData);
+                         if (result != null)
+                         {
+                             if (result.StateCode == "Success")
                              {
-                                 doorLock.localDoorLockUserList.Remove(curDoorLockUser.UserID);
-                                 var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
-                                 localDoorLockObj.UserID = curDoorLockUser.UserID;
-                                 localDoorLockObj.UnlockType = curDoorLockUser.UnlockType;
-                                 localDoorLockObj.EntryTime = curDoorLockUser.EntryTime;
-                                 localDoorLockObj.UserName = refreshDoorLockData.UserIdRemarks;
-                                 localDoorLockObj.ConnectedAccount = curAccountObj.SubAccountDistributedMark;
-                                 doorLock.localDoorLockUserList.Add(curDoorLockUser.UserID, localDoorLockObj);
-                                 RefreshList();
+                                 if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID))
+                                 {
+                                     doorLock.localDoorLockUserList.Remove(curDoorLockUser.UserID);
+                                     var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
+                                     localDoorLockObj.UserID = curDoorLockUser.UserID;
+                                     localDoorLockObj.UnlockType = curDoorLockUser.UnlockType;
+                                     localDoorLockObj.EntryTime = curDoorLockUser.EntryTime;
+                                     localDoorLockObj.UserName = refreshDoorLockData.UserIdRemarks;
+                                     localDoorLockObj.ConnectedAccount = curAccountObj.SubAccountDistributedMark;
+                                     doorLock.localDoorLockUserList.Add(curDoorLockUser.UserID, localDoorLockObj);
+                                     RefreshList();
+                                 }
+                             }
+                             else
+                             {
+                                 new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ModigfyFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                              }
                          }
                          else
                          {
-                             new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ModigfyFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
+                             new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                          }
-                     }
-                     else
-                     {
-                         new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
-                     }
-                 };
-                btnDoorlockUser.EditorEnterAction += action;
+                     };
+                    btnDoorlockUser.EditorEnterAction += action;
 
-                btnDel.MouseUpEventHandler += (sender, e) =>
-                {
-                    var alert = new Alert(Language.StringByID(R.MyInternationalizationString.Tip), Language.StringByID(R.MyInternationalizationString.SureToDelUnlockMethod),
-                                                  Language.StringByID(R.MyInternationalizationString.Cancel), Language.StringByID(R.MyInternationalizationString.Confrim));
-                    alert.Show();
-                    alert.ResultEventHandler += async (sender1, e1) =>
+                    btnDel.MouseUpEventHandler += (sender, e) =>
                     {
-                        if (e1)
+                        var alert = new Alert(Language.StringByID(R.MyInternationalizationString.Tip), Language.StringByID(R.MyInternationalizationString.SureToDelUnlockMethod),
+                                                      Language.StringByID(R.MyInternationalizationString.Cancel), Language.StringByID(R.MyInternationalizationString.Confrim));
+                        alert.Show();
+                        alert.ResultEventHandler += async (sender1, e1) =>
                         {
-                            var passData = doorLock.SetUserAccessData(curDoorLockUser.UserID, ZigBee.Device.DoorLock.AccessType.DelCurrentUser);
-                            var resultData = await doorLock.DefaultControlAsync(passData);
-                            if (resultData != null && resultData.defaultControlResponseData != null)
+                            if (e1)
                             {
-                                if (resultData.defaultControlResponseData.status == 0 || resultData.defaultControlResponseData.status == 2)
+                                var passData = doorLock.SetUserAccessData(curDoorLockUser.UserID, ZigBee.Device.DoorLock.AccessType.DelCurrentUser);
+                                var resultData = await doorLock.DefaultControlAsync(passData);
+                                if (resultData != null && resultData.defaultControlResponseData != null)
                                 {
-                                    var deleteDoorLockData = new ZigBee.Device.DoorLock.DeleteDoorLockData();
-                                    if (UserCenterResourse.UserInfo.AuthorityNo != 1)
-                                    {
-                                        deleteDoorLockData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
-                                        deleteDoorLockData.IsOtherAccountCtrl = true;
-                                    }
-                                    if (doorLock.DeviceAddr != null)
-                                    {
-                                        deleteDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
-                                    }
-                                    deleteDoorLockData.DoorLockLocalUserId = curDoorLockUser.UserID.ToString();
-                                    deleteDoorLockData.PrimaryId = curDoorLockUser.PrimaryId;
-                                    deleteDoorLockData.DelDoorLockDelType = 2;
-                                    var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/DelDoorLock", deleteDoorLockData);
-                                    if (result != null)
-                                    {
-                                        if (result.StateCode == "Success")
-                                        {
-                                            isSecondDel = false;
-                                            if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID))
-                                            {
-                                                doorLock.localDoorLockAccountList.Remove(curDoorLockUser.ConnectedAccount);
-                                                var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
-                                                localDoorLockObj.UserID = curDoorLockUser.UserID;
-                                                doorLock.localDoorLockUserList.Remove(curUserId);
-                                                doorLock.ReSave();
-                                                RefreshList();
-                                            }
-                                        }
-                                        else
-                                        {
-                                            new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
-                                        }
-                                    }
-                                    else
-                                    {
-                                        isSecondDel = true;
-                                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
-                                    }
-                                }
-                                else
-                                {
-                                    if (isSecondDel)
+                                    if (resultData.defaultControlResponseData.status == 0 || resultData.defaultControlResponseData.status == 2)
                                     {
                                         var deleteDoorLockData = new ZigBee.Device.DoorLock.DeleteDoorLockData();
                                         if (UserCenterResourse.UserInfo.AuthorityNo != 1)
@@ -473,15 +499,17 @@
                                                 isSecondDel = false;
                                                 if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID))
                                                 {
-                                                    doorLock.localDoorLockUserList.Remove(curDoorLockUser.UserID);
+                                                    doorLock.localDoorLockAccountList.Remove(curDoorLockUser.ConnectedAccount);
                                                     var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
                                                     localDoorLockObj.UserID = curDoorLockUser.UserID;
                                                     doorLock.localDoorLockUserList.Remove(curUserId);
+                                                    doorLock.ReSave();
                                                     RefreshList();
                                                 }
                                             }
                                             else
                                             {
+                                                //寮�鍏冲浘鏍�
                                                 new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                                             }
                                         }
@@ -493,25 +521,71 @@
                                     }
                                     else
                                     {
-                                        if (curDoorLockUser.UserID < 10)
+                                        if (isSecondDel)
                                         {
-                                            new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.OnlyBeDeletedOnTheDevice), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
+                                            var deleteDoorLockData = new ZigBee.Device.DoorLock.DeleteDoorLockData();
+                                            if (UserCenterResourse.UserInfo.AuthorityNo != 1)
+                                            {
+                                                deleteDoorLockData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
+                                                deleteDoorLockData.IsOtherAccountCtrl = true;
+                                            }
+                                            if (doorLock.DeviceAddr != null)
+                                            {
+                                                deleteDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
+                                            }
+                                            deleteDoorLockData.DoorLockLocalUserId = curDoorLockUser.UserID.ToString();
+                                            deleteDoorLockData.PrimaryId = curDoorLockUser.PrimaryId;
+                                            deleteDoorLockData.DelDoorLockDelType = 2;
+                                            var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/DelDoorLock", deleteDoorLockData);
+                                            if (result != null)
+                                            {
+                                                if (result.StateCode == "Success")
+                                                {
+                                                    isSecondDel = false;
+                                                    if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID))
+                                                    {
+                                                        doorLock.localDoorLockUserList.Remove(curDoorLockUser.UserID);
+                                                        var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
+                                                        localDoorLockObj.UserID = curDoorLockUser.UserID;
+                                                        doorLock.localDoorLockUserList.Remove(curUserId);
+                                                        RefreshList();
+                                                    }
+                                                }
+                                                else
+                                                {
+                                                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
+                                                }
+                                            }
+                                            else
+                                            {
+                                                isSecondDel = true;
+                                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
+                                            }
                                         }
                                         else
                                         {
-                                            new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
+                                            if (curDoorLockUser.UserID < 10)
+                                            {
+                                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.OnlyBeDeletedOnTheDevice), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
+                                            }
+                                            else
+                                            {
+                                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
+                                            }
                                         }
                                     }
                                 }
+                                else
+                                {
+                                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel);
+                                }
                             }
-                            else
-                            {
-                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel);
-                            }
-                        }
+                        };
                     };
-                };
-                #endregion 
+                    #endregion
+                    i++;
+                }
+                frameLayoutRow.Height = i * Application.GetRealHeight(150);
             }
         }
 
@@ -698,255 +772,301 @@
 
             if (curAccountDoorLockUserList.Count == 0)
             {
+                bodyView.Height = Application.GetRealHeight(0);
                 entryStatusPic.Visible = true;
                 btnPicTip.Visible = true;
                 btnPicTip1.Visible = true;
+                entryStatusPic.Height = Application.GetRealHeight(435);
+                entryStatusPic.Width = Application.GetRealHeight(757);
+                btnPicTip.Height = Application.GetRealHeight(98 / 2);
+                btnPicTip1.Height = Application.GetRealHeight(98 / 2);
             }
             else
             {
                 entryStatusPic.Visible = false;
                 btnPicTip.Visible = false;
                 btnPicTip1.Visible = false;
-            }
+                entryStatusPic.Height = Application.GetRealHeight(0);
+                entryStatusPic.Width = Application.GetRealHeight(0);
+                btnPicTip.Height = Application.GetRealHeight(0);
+                btnPicTip1.Height = Application.GetRealHeight(0);
+                bodyView.Height = Application.GetRealHeight(1921 - 184 - 116);
 
-            foreach (var curUserId in curAccountDoorLockUserList.Keys)
-            {
-                var curDoorLockUser = curAccountDoorLockUserList[curUserId];
-                if (curDoorLockUser.UnlockType != unlockMethod)
+                var frameLayoutRow = new FrameLayout()
                 {
-                    continue;
-                }
-                #region UI
-                var rowFrameLayout = new RowLayout()
-                {
-                    Height = Application.GetRealHeight(173),
-                    X = Application.GetRealWidth(58),
-                    Width = Application.GetRealWidth(965),
-                    LineColor = Shared.Common.ZigbeeColor.Current.XMRowLine,
+                    Height = Application.GetMinRealAverage(0),
+                    BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite,
                 };
-                bodyView.AddChidren(rowFrameLayout);
-
-                var btnPicFrameLayout = new FrameLayout()
+                bodyView.AddChidren(frameLayoutRow);
+                int i = 0;
+                foreach (var curUserId in curAccountDoorLockUserList.Keys)
                 {
-                    Width = Application.GetRealWidth(81),
-                    Height = Application.GetRealHeight(81),
-                    X = Application.GetRealWidth(40),
-                    Y = Application.GetRealHeight(49),
-                };
-                rowFrameLayout.AddChidren(btnPicFrameLayout);
-
-                var btnPic = new Button()
-                {
-                    Width = Application.GetRealWidth(84),
-                    Height = Application.GetRealHeight(84),
-                    UnSelectedImagePath = "DoorLock/DoorLockUserPic.png",
-                };
-                btnPicFrameLayout.AddChidren(btnPic);
-
-                var btnDoorlockUser = new EditText()
-                {
-                    Width = Application.GetRealWidth(1080 - 173),
-                    Height = Application.GetRealHeight(60),
-                    X = Application.GetRealWidth(173),
-                    Y = Application.GetRealHeight(35),
-                    TextSize = 14,
-                    PlaceholderTextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
-                    TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
-                    TextAlignment = TextAlignment.CenterLeft,
-                };
-                rowFrameLayout.AddChidren(btnDoorlockUser);
-
-                var btnMember = new Button()
-                {
-                    Width = Application.GetRealWidth(1080 - 173),
-                    Height = Application.GetRealHeight(49),
-                    X = Application.GetRealWidth(173),
-                    Y = Application.GetRealHeight(95),
-                    TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
-                    TextSize = 14,
-                    TextAlignment = TextAlignment.CenterLeft,
-                };
-                rowFrameLayout.AddChidren(btnMember);
-
-                var btnDel = new Button()
-                {
-                    Width = Application.GetRealWidth(1080 - 173),
-                    Height = Application.GetRealHeight(49),
-                    X = Application.GetRealWidth(173),
-                    Y = Application.GetRealHeight(95),
-                    Text = Language.StringByID(R.MyInternationalizationString.DelBindDevice),
-                    TextColor = Shared.Common.ZigbeeColor.Current.XMWhite,
-                    TextSize = 12,
-                    TextAlignment = TextAlignment.Center,
-                    BackgroundColor = Shared.Common.ZigbeeColor.Current.XMDel,
-                };
-                rowFrameLayout.AddRightView(btnDel);
-                #endregion 
-                #region 鏁版嵁澶勭悊
-                switch (curDoorLockUser.UnlockType)
-                {
-                    case 0:
-                        if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
-                        {
-                            btnDoorlockUser.Text = curDoorLockUser.UserName;
-                        }
-                        else
-                        {
-                            btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.Password) + "ID" + curDoorLockUser.UserID;
-                        }
-                        break;
-                    case 3:
-                        if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
-                        {
-                            btnDoorlockUser.Text = curDoorLockUser.UserName;
-                        }
-                        else
-                        {
-                            btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.IcCard) + "ID" + curDoorLockUser.UserID;
-                        }
-                        break;
-                    case 15:
-                        if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
-                        {
-                            btnDoorlockUser.Text = curDoorLockUser.UserName;
-                        }
-                        else
-                        {
-                            btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.Fingerprint) + "ID" + +curDoorLockUser.UserID;
-                        }
-                        break;
-                }
-
-                if (curAccountObj.UserName == "" || curAccountObj.UserName == null)
-                {
-                    btnMember.Text = curAccountObj.Account;
-                }
-                else
-                {
-                    btnMember.Text = curAccountObj.UserName;
-                }
-
-                Action<Shared.View> action = async (obj) =>
-                {
-                    var refreshDoorLockData = new ZigBee.Device.DoorLock.RefreshDoorLockData();
-                    if (UserCenterResourse.UserInfo.AuthorityNo != 1)
+                    var curDoorLockUser = curAccountDoorLockUserList[curUserId];
+                    if (curDoorLockUser.UnlockType != unlockMethod)
                     {
-                        refreshDoorLockData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
-                        refreshDoorLockData.IsOtherAccountCtrl = true;
+                        continue;
                     }
-                    if (doorLock.DeviceAddr != null)
+                    #region UI
+                    var rowFrameLayout = new RowLayout()
                     {
-                        refreshDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
+                        Height = Application.GetRealHeight(127 + 23),
+                        X = Application.GetRealWidth(58),
+                        Y = i * Application.GetRealHeight(150),
+                        Width = Application.GetRealWidth(965),
+                        LineColor = Shared.Common.ZigbeeColor.Current.XMRowLine,
+                    };
+                    frameLayoutRow.AddChidren(rowFrameLayout);
+
+                    var btnPicFrameLayout = new FrameLayout()
+                    {
+                        Width = Application.GetRealWidth(81),
+                        Height = Application.GetRealHeight(81),
+                        X = Application.GetRealWidth(40),
+                        Y = Application.GetRealHeight(49),
+                    };
+                    rowFrameLayout.AddChidren(btnPicFrameLayout);
+
+                    var btnPic = new Button()
+                    {
+                        Width = Application.GetRealWidth(84),
+                        Height = Application.GetRealHeight(84),
+                        UnSelectedImagePath = "DoorLock/DoorLockUserPic.png",
+                    };
+                    btnPicFrameLayout.AddChidren(btnPic);
+
+                    var btnDoorlockUser = new EditText()
+                    {
+                        Width = Application.GetRealWidth(1080 - 173),
+                        Height = Application.GetRealHeight(60),
+                        X = Application.GetRealWidth(173),
+                        Y = Application.GetRealHeight(35),
+                        TextSize = 14,
+                        PlaceholderTextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
+                        TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
+                        TextAlignment = TextAlignment.CenterLeft,
+                    };
+                    rowFrameLayout.AddChidren(btnDoorlockUser);
+
+                    var btnMember = new Button()
+                    {
+                        Width = Application.GetRealWidth(1080 - 173),
+                        Height = Application.GetRealHeight(49),
+                        X = Application.GetRealWidth(173),
+                        Y = Application.GetRealHeight(95),
+                        TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
+                        TextSize = 14,
+                        TextAlignment = TextAlignment.CenterLeft,
+                    };
+                    rowFrameLayout.AddChidren(btnMember);
+
+                    var btnDel = new Button()
+                    {
+                        Width = Application.GetRealWidth(1080 - 173),
+                        Height = Application.GetRealHeight(49),
+                        X = Application.GetRealWidth(173),
+                        Y = Application.GetRealHeight(95),
+                        Text = Language.StringByID(R.MyInternationalizationString.DelBindDevice),
+                        TextColor = Shared.Common.ZigbeeColor.Current.XMWhite,
+                        TextSize = 12,
+                        TextAlignment = TextAlignment.Center,
+                        BackgroundColor = Shared.Common.ZigbeeColor.Current.XMDel,
+                    };
+                    rowFrameLayout.AddRightView(btnDel);
+                    #endregion
+                    #region 鏁版嵁澶勭悊
+                    int currentIndex = i;
+                    if (currentIndex == curAccountDoorLockUserList.Keys.Count - 1)
+                    {
+                        rowFrameLayout.LineColor = Shared.Common.ZigbeeColor.Current.XMWhite;
                     }
-                    refreshDoorLockData.OpenLockMode = curDoorLockUser.UnlockType;
-                    refreshDoorLockData.DoorLockLocalUserId = curDoorLockUser.UserID.ToString();
-                    refreshDoorLockData.PrimaryId = curDoorLockUser.PrimaryId;
-                    refreshDoorLockData.UserIdRemarks = btnDoorlockUser.Text;
-                    var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/UpdateDoorLock", refreshDoorLockData);
-                    if (result != null)
+                    switch (curDoorLockUser.UnlockType)
                     {
-                        if (result.StateCode == "Success")
-                        {
-                            if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID))
+                        case 0:
+                            if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
                             {
-                                doorLock.localDoorLockUserList.Remove(curDoorLockUser.UserID);
-                                var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
-                                localDoorLockObj.UserID = curDoorLockUser.UserID;
-                                localDoorLockObj.UnlockType = curDoorLockUser.UnlockType;
-                                localDoorLockObj.EntryTime = curDoorLockUser.EntryTime;
-                                localDoorLockObj.UserName = refreshDoorLockData.UserIdRemarks;
-                                localDoorLockObj.ConnectedAccount = curAccountObj.SubAccountDistributedMark;
-                                doorLock.localDoorLockUserList.Add(curDoorLockUser.UserID, localDoorLockObj);
-                                RefreshList();
+                                btnDoorlockUser.Text = curDoorLockUser.UserName;
+                            }
+                            else
+                            {
+                                btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.Password) + "ID" + curDoorLockUser.UserID;
+                            }
+                            break;
+                        case 3:
+                            if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
+                            {
+                                btnDoorlockUser.Text = curDoorLockUser.UserName;
+                            }
+                            else
+                            {
+                                btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.IcCard) + "ID" + curDoorLockUser.UserID;
+                            }
+                            break;
+                        case 15:
+                            if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
+                            {
+                                btnDoorlockUser.Text = curDoorLockUser.UserName;
+                            }
+                            else
+                            {
+                                btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.Fingerprint) + "ID" + +curDoorLockUser.UserID;
+                            }
+                            break;
+                    }
+
+                    if (curAccountObj.UserName == "" || curAccountObj.UserName == null)
+                    {
+                        btnMember.Text = curAccountObj.Account;
+                    }
+                    else
+                    {
+                        btnMember.Text = curAccountObj.UserName;
+                    }
+
+                    Action<Shared.View> action = async (obj) =>
+                    {
+                        var refreshDoorLockData = new ZigBee.Device.DoorLock.RefreshDoorLockData();
+                        if (UserCenterResourse.UserInfo.AuthorityNo != 1)
+                        {
+                            refreshDoorLockData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
+                            refreshDoorLockData.IsOtherAccountCtrl = true;
+                        }
+                        if (doorLock.DeviceAddr != null)
+                        {
+                            refreshDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
+                        }
+                        refreshDoorLockData.OpenLockMode = curDoorLockUser.UnlockType;
+                        refreshDoorLockData.DoorLockLocalUserId = curDoorLockUser.UserID.ToString();
+                        refreshDoorLockData.PrimaryId = curDoorLockUser.PrimaryId;
+                        refreshDoorLockData.UserIdRemarks = btnDoorlockUser.Text;
+                        var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/UpdateDoorLock", refreshDoorLockData);
+                        if (result != null)
+                        {
+                            if (result.StateCode == "Success")
+                            {
+                                if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID))
+                                {
+                                    doorLock.localDoorLockUserList.Remove(curDoorLockUser.UserID);
+                                    var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
+                                    localDoorLockObj.UserID = curDoorLockUser.UserID;
+                                    localDoorLockObj.UnlockType = curDoorLockUser.UnlockType;
+                                    localDoorLockObj.EntryTime = curDoorLockUser.EntryTime;
+                                    localDoorLockObj.UserName = refreshDoorLockData.UserIdRemarks;
+                                    localDoorLockObj.ConnectedAccount = curAccountObj.SubAccountDistributedMark;
+                                    doorLock.localDoorLockUserList.Add(curDoorLockUser.UserID, localDoorLockObj);
+                                    RefreshList();
+                                }
+                            }
+                            else
+                            {
+                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ModigfyFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                             }
                         }
                         else
                         {
-                            new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ModigfyFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
+                            new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                         }
-                    }
-                    else
-                    {
-                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
-                    }
-                };
-                btnDoorlockUser.EditorEnterAction += action;
+                    };
+                    btnDoorlockUser.EditorEnterAction += action;
 
-                btnDel.MouseUpEventHandler += (sender, e) =>
-                {
-                    var alert = new Alert(Language.StringByID(R.MyInternationalizationString.Tip), Language.StringByID(R.MyInternationalizationString.SureToDelUnlockMethod),
-                                                  Language.StringByID(R.MyInternationalizationString.Cancel), Language.StringByID(R.MyInternationalizationString.Confrim));
-                    alert.Show();
-                    alert.ResultEventHandler += async (sender1, e1) =>
+                    btnDel.MouseUpEventHandler += (sender, e) =>
                     {
-                        if (e1)
+                        var alert = new Alert(Language.StringByID(R.MyInternationalizationString.Tip), Language.StringByID(R.MyInternationalizationString.SureToDelUnlockMethod),
+                                                      Language.StringByID(R.MyInternationalizationString.Cancel), Language.StringByID(R.MyInternationalizationString.Confrim));
+                        alert.Show();
+                        alert.ResultEventHandler += async (sender1, e1) =>
                         {
-                            var passData = doorLock.SetUserAccessData(curDoorLockUser.UserID, ZigBee.Device.DoorLock.AccessType.DelCurrentUser);
-                            var resultData = await doorLock.DefaultControlAsync(passData);
-                            if (resultData != null && resultData.defaultControlResponseData != null)
+                            if (e1)
                             {
-                                if (resultData.defaultControlResponseData.status == 0)
+                                var passData = doorLock.SetUserAccessData(curDoorLockUser.UserID, ZigBee.Device.DoorLock.AccessType.DelCurrentUser);
+                                var resultData = await doorLock.DefaultControlAsync(passData);
+                                if (resultData != null && resultData.defaultControlResponseData != null)
                                 {
-                                    var deleteDoorLockData = new ZigBee.Device.DoorLock.DeleteDoorLockData();
-                                    if (UserCenterResourse.UserInfo.AuthorityNo != 1)
+                                    if (resultData.defaultControlResponseData.status == 0)
                                     {
-                                        deleteDoorLockData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
-                                        deleteDoorLockData.IsOtherAccountCtrl = true;
-                                    }
-                                    if (doorLock.DeviceAddr != null)
-                                    {
-                                        deleteDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
-                                    }
-                                    deleteDoorLockData.DoorLockLocalUserId = curDoorLockUser.UserID.ToString();
-                                    deleteDoorLockData.PrimaryId = curDoorLockUser.PrimaryId;
-                                    deleteDoorLockData.DelDoorLockDelType = 2;
-                                    var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/DelDoorLock", deleteDoorLockData);
-                                    if (result != null)
-                                    {
-                                        if (result.StateCode == "Success")
+                                        var deleteDoorLockData = new ZigBee.Device.DoorLock.DeleteDoorLockData();
+                                        if (UserCenterResourse.UserInfo.AuthorityNo != 1)
                                         {
-                                            if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID))
+                                            deleteDoorLockData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
+                                            deleteDoorLockData.IsOtherAccountCtrl = true;
+                                        }
+                                        if (doorLock.DeviceAddr != null)
+                                        {
+                                            deleteDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
+                                        }
+                                        deleteDoorLockData.DoorLockLocalUserId = curDoorLockUser.UserID.ToString();
+                                        deleteDoorLockData.PrimaryId = curDoorLockUser.PrimaryId;
+                                        deleteDoorLockData.DelDoorLockDelType = 2;
+                                        var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/DelDoorLock", deleteDoorLockData);
+                                        if (result != null)
+                                        {
+                                            if (result.StateCode == "Success")
                                             {
-                                                doorLock.localDoorLockUserList.Remove(curDoorLockUser.UserID);
-                                                var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
-                                                localDoorLockObj.UserID = curDoorLockUser.UserID;
-                                                doorLock.localDoorLockUserList.Remove(curUserId);
-                                                RefreshList();
+                                                if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID))
+                                                {
+                                                    doorLock.localDoorLockUserList.Remove(curDoorLockUser.UserID);
+                                                    var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
+                                                    localDoorLockObj.UserID = curDoorLockUser.UserID;
+                                                    doorLock.localDoorLockUserList.Remove(curUserId);
+                                                    RefreshList();
+                                                }
+                                            }
+                                            else
+                                            {
+                                                if (curDoorLockUser.UserID < 10)
+                                                {
+                                                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.OnlyBeDeletedOnTheDevice), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
+                                                }
+                                                else
+                                                {
+                                                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
+                                                }
                                             }
                                         }
                                         else
                                         {
-                                            if (curDoorLockUser.UserID < 10)
-                                            {
-                                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.OnlyBeDeletedOnTheDevice), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
-                                            }
-                                            else
-                                            {
-                                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
-                                            }
+                                            new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                                         }
                                     }
                                     else
                                     {
-                                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
+                                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel);
                                     }
+
                                 }
                                 else
                                 {
-                                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel);
+                                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel);
                                 }
-
                             }
-                            else
-                            {
-                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel);
-                            }
-                        }
+                        };
                     };
-                };
-                #endregion
+                    #endregion
+                    i++;
+                }
+                frameLayoutRow.Height = i * Application.GetRealHeight(127 + 23);
             }
         }
 
+        /// <summary>
+        /// 閲嶅啓绉婚櫎鏂规硶
+        /// </summary>
+        public override void RemoveFromParent()
+        {
+            ZbGateway.StatusList.Remove(this);
+            base.RemoveFromParent();
+        }
+
+
+
+        public void Changed(CommonDevice common)
+        {
+        }
+        public void ChangedILogicStatus(ZigBee.Device.Logic logic)
+        {
+        }
+
+        public void ChangedISceneStatus(Scene scene)
+        {
+        }
     }
 }

--
Gitblit v1.8.0