WJC
2019-12-13 9c6bd67d66859e48f0e794cd2746aef9310ce71d
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs
@@ -12,8 +12,8 @@
        {
            Tag = "LockLogicList";
        }
        VerticalScrolViewLayout middle;
        public async void Show()
        VerticalRefreshLayout middle;
        public void Show()
        {
            #region  最上面的布局代码
@@ -27,7 +27,7 @@
            var titleName = new Button
            {
                TextSize = 16,
                TextSize = 17,
                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                TextAlignment = TextAlignment.CenterLeft,
                X = Application.GetRealWidth(176),
@@ -35,6 +35,7 @@
                Height = Application.GetRealHeight(69),
                Y = Application.GetRealHeight(92),
                TextID = MyInternationalizationString.linkageevent,
                IsBold = true,
            };
            topRowLayout.AddChidren(titleName);
@@ -81,11 +82,6 @@
                Common.Logic.CurrentLogic.IsEnable = 1;//默认为开
                Common.Logic.CurrentLogic.LogicType = 1;
                Common.Logic.CurrentLogic.Relationship = 1;
                //Config.Instance.Guid用来识别账号身份;
                var accounts = new System.Collections.Generic.Dictionary<string, string>();
                accounts.Add("Type","1");
                accounts.Add("Account", Config.Instance.Guid);
                Common.Logic.CurrentLogic.Accounts.Add(accounts);
                Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.automation1);
                var lockLogicCommunalPage = new LockLogicCommunalPage();
                UserView.HomePage.Instance.AddChidren(lockLogicCommunalPage);
@@ -94,14 +90,29 @@
            };
            #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列表
                Common.Logic.LockLogicList.Clear();
                Read();
                //关闭刷新View;
                middle.EndHeaderRefreshing();
            };
            Read();
        }
        /// <summary>
        /// 读取自动化数据
        /// </summary>
        public async void Read()
        {
            CommonPage.Loading.Start();
            if (Common.Logic.LockLogicList.Count == 0)
            {
@@ -134,12 +145,13 @@
                    }
                }
            }
            //自动化
            Automationview();
            CommonPage.Loading.Hide();
        }
        void Automationview()
        /// <summary>
        /// 加载自动化列表的界面
        /// </summary>
        public void Automationview()
        {
            middle.RemoveAll();
            for (int i = 0; i < Common.Logic.LockLogicList.Count; i++)
@@ -164,6 +176,7 @@
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                    Gravity = Gravity.CenterVertical,
                    TextSize = 15,
                };
                logicRowlayout.AddChidren(logicnameBtn);