黄学彪
2019-11-25 5727cf0b9b54da0a191dd1e23cb5abf21320fbff
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MasterManagementPage.cs
@@ -1,4 +1,5 @@
using System;
using Shared.Common;
using ZigBee.Device;
namespace Shared.Phone.UserCenter.DoorLock
{
@@ -20,12 +21,42 @@
        Shared.Phone.UserCenter.MemberInfoRes accountObj;
        #endregion
        void ReadDoorLockUserInfo()
        {
            System.Threading.Tasks.Task.Run(async () =>
            {
                Application.RunOnMainThread(() => { CommonPage.Loading.Start("Loading..."); });
                try
                {
                    await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetLocaDoorLocklist(doorLock, accountObj);
                }
                catch { }
                finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        MidFrameLayoutContent();
                        CommonPage.Loading.Hide();
                    });
                }
            });
        }
        /// <summary>
        /// UI显示 
        /// </summary>
        public void Show()
        {
            this.TopFrameLayout(this, accountObj.Account);
            string accountTitle = "";
            if (accountObj.UserName != null)
            {
                accountTitle = accountObj.UserName;
            }
            else
            {
                accountTitle = accountObj.Account;
            }
            this.TopFrameLayout(this, accountTitle);
            EventHandler<MouseEventArgs> eHandlerBack = (sender, e) =>
            {
@@ -34,8 +65,7 @@
            this.btnBack.MouseUpEventHandler += eHandlerBack;
            this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack;
            this.MidFrameLayout(this);
            MidFrameLayoutContent();
            ReadDoorLockUserInfo();
        }
        public void MidFrameLayoutContent()
@@ -106,8 +136,31 @@
                        unLockMethod.Show();
                    }
                    else
                    {
                    {
                        ///备注:WJC的
                        ///记录当前用户信息
                        Phone.Device.Logic.Send.UserMemberInfoRes = accountObj;
                        Phone.Device.Logic.Send.CurrentDoorLock = doorLock;
                        if (accountObj == null)
                        {
                            ///防止抛异常
                            Phone.Device.Logic.Send.UserMemberInfoRes = new MemberInfoRes();
                        }
                        if (doorLock == null)
                        {
                            ///防止抛异常
                            Phone.Device.Logic.Send.CurrentDoorLock = new ZigBee.Device.DoorLock();
                        }
                        ///进来刷新一次设备列表;
                        Common.Logic.LogicDviceList.Clear();
                        if (Common.Logic.LogicDviceList.Count == 0)
                        {
                            Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray());
                        }
                        var doorLockLogicList = new Phone.Device.Logic.DoorLockLogic.LockLogicList();
                        UserView.HomePage.Instance.AddChidren(doorLockLogicList);
                        UserView.HomePage.Instance.PageIndex += 1;
                        doorLockLogicList.Show();
                    }
                };
                btnRight.MouseUpEventHandler += eHandler;