黄学彪
2019-12-05 b3e96fce4cc01113128ddf8e0a18fc19594a9e56
ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs
@@ -15,12 +15,14 @@
        }
        Button selectedIcon = new Button();
        public static bool edit = false;
        VerticalScrolViewLayout middle;
        VerticalRefreshLayout middle;
        CommonDevice common;
        Dictionary<string, string> editdeviceConditionsInfo;
        public async void Show(CommonDevice common, Dictionary<string, string> editdeviceConditionsInfo = null)
        public void Show(CommonDevice commondevice, Dictionary<string, string> editdeviceConditions = null)
        {
            common = commondevice;
            editdeviceConditionsInfo = editdeviceConditions;
            UserView.HomePage.Instance.ScrollEnabled = false;
            this.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
            #region  最上面的布局代码
@@ -73,14 +75,36 @@
            };
            #endregion
            middle = new VerticalScrolViewLayout
            middle = new VerticalRefreshLayout
            {
                Y = topRowLayout.Bottom,
                Height = Application.GetRealHeight(1920 - 184),
                BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
            };
            this.AddChidren(middle);
            middle.BeginHeaderRefreshingAction += () =>
            {
                //重新刷新logic列表
                string macport = common.DeviceAddr + "_" + common.DeviceEpoint.ToString();
                for (int i = 0; i < Send.LockList.Count; i++)
                {
                    if (Send.LockList[i].DoorLockMacPort == macport)
                    {
                        ///从列表移除当前门锁全部的旧数据;
                        Send.LockList.Remove(Send.LockList[i]);
                    }
                }
                Read();
                //关闭刷新View;
                middle.EndHeaderRefreshing();
            };
            Read();
        }
        /// <summary>
        /// 读取当前门锁的云端数据;
        /// </summary>
        public async void Read()
        {
            bool d = false;
            string macport = common.DeviceAddr + "_" + common.DeviceEpoint.ToString();
@@ -100,14 +124,14 @@
                var allMemberslist = await Send.AllMembers(common.DeviceAddr);
                Send.LockList.AddRange(allMemberslist);
            }
            UserList(macport, common, editdeviceConditionsInfo);
            UserList(macport);
            CommonPage.Loading.Hide();
        }
        /// <summary>
        /// 成员列表的方法
        /// </summary>
        /// <param name="macport"></param>
        void UserList(string macport, CommonDevice common, Dictionary<string, string> editdeviceConditionsInfo)
        public void UserList(string macport)
        {
            foreach (var user in Send.LockList)
@@ -156,7 +180,7 @@
                EventHandler<MouseEventArgs> useridclick = (sender, e) =>
                {
                    User(user, common, editdeviceConditionsInfo);
                    User(user);
                };
                userBtn.MouseUpEventHandler += useridclick;
@@ -167,12 +191,12 @@
            }
        }
        }
        /// <summary>
        /// 当前成员信息的方法
        /// </summary>
        /// <param name="user"></param>
        void User(Send.MembershipIfon user, CommonDevice common, Dictionary<string, string> editdeviceConditionsInfo)
        public void User(Send.MembershipIfon user)
        {
            var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
            this.AddChidren(flMain);