HDL Home App 第二版本 旧平台金堂用 正在使用
xm
2019-11-21 ec35d79add60d1438dff5291389f7e69c579d9f9
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
@@ -47,7 +47,7 @@
        #region ◆ 变量申明__________________________
        ZigBee.Device.DoorLock doorLock;
        VerticalScrolViewLayout bodyView;
        VerticalRefreshLayout bodyView;
        Button currentMethod;// 当前选择的方式
        Shared.Phone.UserCenter.MemberInfoRes curAccountObj;
        Button entryStatusPic;
@@ -60,7 +60,6 @@
        {
            System.Threading.Tasks.Task.Run(async () =>
            {
                Application.RunOnMainThread(() => { CommonPage.Loading.Start("Loading..."); });
                try
                {
                    var list = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockAllAcountUserlist(doorLock);
@@ -141,11 +140,22 @@
            {
                btnAddFrameLayout.Width = Application.GetRealWidth(72);
            }
            if (doorLock.IsFailedToGetDoorLockInfo[curAccountObj.SubAccountDistributedMark] == true)
            {
                CommonPage.Loading.Start("Loading...");
                ReadDoorLockUserInfo();
            }
            else
            {
            MidFrameLayoutContent();
                RefreshList();
            }
        }
        //中部布局
        void MidFrameLayoutContent()
        {
            #region 开锁方式UI
            var midTopFrameLayout = new FrameLayout()
            {
                Height = Application.GetRealHeight(115),
@@ -177,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,
@@ -204,41 +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,
                BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite,
            };
            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>
@@ -248,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.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
                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];
@@ -275,18 +276,28 @@
                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;
            }
            if (curAccountDoorLockUserList.Keys.Count == 0)
                entryStatusPic.Height = Application.GetRealHeight(0);
                entryStatusPic.Width = Application.GetRealHeight(0);
                btnPicTip.Height = Application.GetRealHeight(0);
                btnPicTip1.Height = Application.GetRealHeight(0);
                var frameLayoutRow = new FrameLayout()
            {
                return;
            }
            bodyView.Height = curAccountDoorLockUserList.Keys.Count * Application.GetRealHeight(127 + 23);
                    Height = Application.GetMinRealAverage(0),
                    BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite,
                };
                bodyView.AddChidren(frameLayoutRow);
            int i = 0;
            foreach (var curUserId in curAccountDoorLockUserList.Keys)
            {
@@ -296,11 +307,12 @@
                {
                    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,
                };
                bodyView.AddChidren(rowFrameLayout);
                    frameLayoutRow.AddChidren(rowFrameLayout);
                var btnPicFrameLayout = new FrameLayout()
                {
@@ -346,10 +358,7 @@
                var btnDel = new Button()
                {
                    Width = Application.GetRealWidth(1080 - 173),
                    Height = Application.GetRealHeight(49),
                    X = Application.GetRealWidth(173),
                    Y = Application.GetRealHeight(95),
                        Width = Application.GetRealWidth(184),
                    Text = Language.StringByID(R.MyInternationalizationString.DelBindDevice),
                    TextColor = Shared.Common.ZigbeeColor.Current.XMWhite,
                    TextSize = 12,
@@ -576,6 +585,8 @@
                #endregion
                i++;
            }
                frameLayoutRow.Height = i * Application.GetRealHeight(150);
            }
        }
        // 侧边导航栏
@@ -761,20 +772,32 @@
            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;
            }
            if (curAccountDoorLockUserList.Keys.Count == 0)
                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);
                var frameLayoutRow = new FrameLayout()
            {
                return;
            }
                    Height = Application.GetMinRealAverage(0),
                    BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite,
                };
                bodyView.AddChidren(frameLayoutRow);
            int i = 0;
            foreach (var curUserId in curAccountDoorLockUserList.Keys)
            {
@@ -788,10 +811,11 @@
                {
                    Height = Application.GetRealHeight(127 + 23),
                    X = Application.GetRealWidth(58),
                        Y = i * Application.GetRealHeight(150),
                    Width = Application.GetRealWidth(965),
                    LineColor = Shared.Common.ZigbeeColor.Current.XMRowLine,
                };
                bodyView.AddChidren(rowFrameLayout);
                    frameLayoutRow.AddChidren(rowFrameLayout);
                var btnPicFrameLayout = new FrameLayout()
                {
@@ -1019,8 +1043,8 @@
                #endregion
                i++;
            }
            bodyView.Height = i * Application.GetRealHeight(127 + 23);
                frameLayoutRow.Height = i * Application.GetRealHeight(127 + 23);
            }
        }
        /// <summary>