| | |
| | | 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); |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | RefreshList(); |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | void ReadDoorLockUserInfo1() |
| | | { |
| | | System.Threading.Tasks.Task.Run(async () => |
| | | { |
| | | Application.RunOnMainThread(() => { CommonPage.Loading.Start("Loading..."); }); |
| | | try |
| | | { |
| | | var getDoorLockInfo = await doorLock.GetDoorlockUserInfoAsync(); |
| | | if (getDoorLockInfo != null && getDoorLockInfo.doorLockUserDetailData != null) |
| | | { |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip); |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | return; |
| | | }); |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | //数据如果在门锁上面是空的时候,数据也是没有的 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip); |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | }); |
| | | } |
| | | } |
| | |
| | | EventHandler<MouseEventArgs> eHandlerBack = (sender, e) => |
| | | { |
| | | RemoveFromParent(); |
| | | this.btnTip.Visible = false; |
| | | }; |
| | | this.btnBack.MouseUpEventHandler += eHandlerBack; |
| | | this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack; |
| | | this.MidFrameLayout(this); |
| | | |
| | | ReadDoorLockUserInfo(); |
| | | MidFrameLayoutContent(); |
| | | if (doorLock.localDoorLockUserList.Count == 0) |
| | | { |
| | | ReadDoorLockUserInfo(); |
| | | } |
| | | RefreshList(); |
| | | } |
| | | |
| | | public void MidFrameLayoutContent() |
| | |
| | | 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, |
| | | }; |
| | |
| | | Height = Application.GetRealHeight(1921 - 184 - 115 - 1), |
| | | }; |
| | | this.midFrameLayout.AddChidren(bodyView); |
| | | |
| | | RefreshList(); |
| | | } |
| | | |
| | | void RefreshList() |
| | | { |
| | | bodyView.RemoveAll(); |
| | | var curLocalDoorLockUserList = new Dictionary<int, DoorLockCommonInfo.LocaDoorLockObj>(); |
| | | |
| | | foreach (var curUserId in doorLock.localDoorLockUserList.Keys) |
| | | { |
| | | var curDoorLockUser = doorLock.localDoorLockUserList[curUserId]; |
| | |
| | | { |
| | | continue; |
| | | } |
| | | var RowView = new FrameLayout() |
| | | curLocalDoorLockUserList.Add(curUserId, curDoorLockUser); |
| | | } |
| | | |
| | | int i = 0; |
| | | foreach (var curUserId in curLocalDoorLockUserList.Keys) |
| | | { |
| | | var curDoorLockUser = curLocalDoorLockUserList[curUserId]; |
| | | var rowFrameLayout = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(161), |
| | | Height = Application.GetRealHeight(127 + 23), |
| | | BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite, |
| | | }; |
| | | bodyView.AddChidren(RowView); |
| | | bodyView.AddChidren(rowFrameLayout); |
| | | |
| | | var btnDistributeUnlockIconFrameLayout = new FrameLayout() |
| | | { |
| | |
| | | X = Application.GetRealWidth(58), |
| | | Y = Application.GetRealHeight(43), |
| | | }; |
| | | RowView.AddChidren(btnDistributeUnlockIconFrameLayout); |
| | | rowFrameLayout.AddChidren(btnDistributeUnlockIconFrameLayout); |
| | | |
| | | var btnDistributeUnlockIcon = new Button() |
| | | { |
| | |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, |
| | | Gravity = Gravity.CenterVertical, |
| | | }; |
| | | RowView.AddChidren(btnText); |
| | | rowFrameLayout.AddChidren(btnText); |
| | | |
| | | var line2 = new Button() |
| | | { |
| | | Y = RowView.Height - 1, |
| | | Y = rowFrameLayout.Height - 1, |
| | | X = Application.GetRealWidth(58), |
| | | Width = Application.GetRealWidth(965), |
| | | Height = 1, |
| | | BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, |
| | | }; |
| | | RowView.AddChidren(line2); |
| | | rowFrameLayout.AddChidren(line2); |
| | | |
| | | #region 数据处理 |
| | | int currentIndex = i; |
| | | if (currentIndex == curLocalDoorLockUserList.Keys.Count - 1) |
| | | { |
| | | line2.Visible = false; |
| | | } |
| | | switch (curDoorLockUser.UnlockType) |
| | | { |
| | | case 0: |
| | |
| | | }; |
| | | btnDistributeUnlockIcon.MouseUpEventHandler += eHandler; |
| | | btnDistributeUnlockIconFrameLayout.MouseUpEventHandler += eHandler; |
| | | RowView.MouseUpEventHandler += eHandler; |
| | | rowFrameLayout.MouseUpEventHandler += eHandler; |
| | | btnText.MouseUpEventHandler += eHandler; |
| | | #endregion |
| | | i++; |
| | | } |
| | | } |
| | | |
| | |
| | | if (doorLock.IsFreezeAccount[currentAccount.SubAccountDistributedMark] == true) |
| | | { |
| | | |
| | | new Tip() { MaxWidth = 150, Text = btnUserName.Text + Language.StringByID(R.MyInternationalizationString.AccountIsFreezed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip); |
| | | new Tip() { MaxWidth = 150, Text = btnUserName.Text + Language.StringByID(R.MyInternationalizationString.AccountIsFreezed), Direction = AMPopTipDirection.Down, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | return; |
| | | } |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip); |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Down, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinish); |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.Down, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | flMain.RemoveFromParent(); |
| | | bottomFrameLayout.RemoveAll(); |
| | | } |
| | |
| | | void DisplayByType(int unlockMethod) |
| | | { |
| | | bodyView.RemoveAll(); |
| | | |
| | | var curLocalDoorLockUserList = new Dictionary<int, DoorLockCommonInfo.LocaDoorLockObj>(); |
| | | |
| | | foreach (var curUserId in doorLock.localDoorLockUserList.Keys) |
| | | { |
| | | var curDoorLockUser = doorLock.localDoorLockUserList[curUserId]; |
| | |
| | | { |
| | | continue; |
| | | } |
| | | var RowView = new FrameLayout() |
| | | curLocalDoorLockUserList.Add(curUserId, curDoorLockUser); |
| | | } |
| | | |
| | | int i = 0; |
| | | foreach (var curUserId in curLocalDoorLockUserList.Keys) |
| | | { |
| | | var curDoorLockUser = curLocalDoorLockUserList[curUserId]; |
| | | |
| | | var rowFrameLayout = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(161), |
| | | Height = Application.GetRealHeight(150), |
| | | BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite, |
| | | }; |
| | | bodyView.AddChidren(RowView); |
| | | bodyView.AddChidren(rowFrameLayout); |
| | | |
| | | var btnDistributeUnlockIconFrameLayout = new FrameLayout() |
| | | { |
| | |
| | | X = Application.GetRealWidth(58), |
| | | Y = Application.GetRealHeight(43), |
| | | }; |
| | | RowView.AddChidren(btnDistributeUnlockIconFrameLayout); |
| | | rowFrameLayout.AddChidren(btnDistributeUnlockIconFrameLayout); |
| | | |
| | | var btnDistributeUnlockIcon = new Button() |
| | | { |
| | |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, |
| | | Gravity = Gravity.CenterVertical, |
| | | }; |
| | | RowView.AddChidren(btnText); |
| | | rowFrameLayout.AddChidren(btnText); |
| | | |
| | | var line2 = new Button() |
| | | { |
| | | Y = RowView.Height - 1, |
| | | Y = rowFrameLayout.Height - 1, |
| | | X = Application.GetRealWidth(58), |
| | | Width = Application.GetRealWidth(965), |
| | | Height = 1, |
| | | BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, |
| | | }; |
| | | RowView.AddChidren(line2); |
| | | rowFrameLayout.AddChidren(line2); |
| | | |
| | | #region 数据处理 |
| | | int currentIndex = i; |
| | | if (currentIndex == curLocalDoorLockUserList.Keys.Count - 1) |
| | | { |
| | | line2.Visible = false; |
| | | } |
| | | |
| | | switch (curDoorLockUser.UnlockType) |
| | | { |
| | | case 0: |
| | |
| | | }; |
| | | btnDistributeUnlockIcon.MouseUpEventHandler += eHandler; |
| | | btnDistributeUnlockIconFrameLayout.MouseUpEventHandler += eHandler; |
| | | RowView.MouseUpEventHandler += eHandler; |
| | | rowFrameLayout.MouseUpEventHandler += eHandler; |
| | | btnText.MouseUpEventHandler += eHandler; |
| | | #endregion |
| | | i++; |
| | | } |
| | | } |
| | | #region ◆ 接口实现__________________________ |