| | |
| | | { |
| | | TypeRefresh(); |
| | | CommonPage.Loading.Hide(); |
| | | bodyView.EndHeaderRefreshing(); |
| | | }); |
| | | } |
| | | }); |
| | |
| | | { |
| | | bodyView.BeginHeaderRefreshing(); |
| | | ReadDoorLockUserInfo(); |
| | | bodyView.EndHeaderRefreshing(); |
| | | }; |
| | | } |
| | | |
| | |
| | | { |
| | | Y = rowFrameLayout.Height - 1, |
| | | X = Application.GetRealWidth(176), |
| | | Width = Application.GetRealWidth(965), |
| | | Width = Application.GetRealWidth(847), |
| | | Height = 1, |
| | | BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, |
| | | }; |
| | |
| | | { |
| | | if (doorLock.IsFreezeAccount[currentAccount.SubAccountDistributedMark] == true) |
| | | { |
| | | |
| | | new Tip() { MaxWidth = 150, Text = btnUserName.Text + Language.StringByID(R.MyInternationalizationString.AccountIsFreezed), Direction = AMPopTipDirection.Down, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = btnUserName.Text + Language.StringByID(R.MyInternationalizationString.AccountIsFreezed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | }); |
| | | return; |
| | | } |
| | | |
| | |
| | | bottomFrameLayout.RemoveAll(); |
| | | }; |
| | | |
| | | btnFinish.MouseUpEventHandler += async (sender, e) => |
| | | { |
| | | if (curAccountId == "") |
| | | { |
| | | flMain.RemoveFromParent(); |
| | | bottomFrameLayout.RemoveAll(); |
| | | } |
| | | else |
| | | { |
| | | var addLockInfo = new ZigBee.Device.DoorLock.AddDoorLockData(); |
| | | if (UserCenterResourse.UserInfo.AuthorityNo != 1) |
| | | { |
| | | addLockInfo.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); |
| | | addLockInfo.IsOtherAccountCtrl = true; |
| | | } |
| | | addLockInfo.CloudAccountId = curAccountId; |
| | | if (doorLock.DeviceAddr != null) |
| | | { |
| | | addLockInfo.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint; |
| | | } |
| | | addLockInfo.OpenLockMode = curDoorLockUser.UnlockType; |
| | | addLockInfo.DoorLockLocalUserId = curDoorLockUser.UserID.ToString(); |
| | | |
| | | switch (curDoorLockUser.UnlockType) |
| | | { |
| | | case 0: |
| | | if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null) |
| | | { |
| | | addLockInfo.UserIdRemarks = curDoorLockUser.UserName; |
| | | } |
| | | else |
| | | { |
| | | addLockInfo.UserIdRemarks = Language.StringByID(R.MyInternationalizationString.Password) + "ID" + curDoorLockUser.UserID; |
| | | } |
| | | break; |
| | | case 3: |
| | | if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null) |
| | | { |
| | | addLockInfo.UserIdRemarks = curDoorLockUser.UserName; |
| | | } |
| | | else |
| | | { |
| | | addLockInfo.UserIdRemarks = Language.StringByID(R.MyInternationalizationString.IcCard) + "ID" + curDoorLockUser.UserID; |
| | | } |
| | | break; |
| | | case 15: |
| | | if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null) |
| | | { |
| | | addLockInfo.UserIdRemarks = curDoorLockUser.UserName; |
| | | } |
| | | else |
| | | { |
| | | addLockInfo.UserIdRemarks = Language.StringByID(R.MyInternationalizationString.Fingerprint) + "ID" + +curDoorLockUser.UserID; |
| | | } |
| | | break; |
| | | } |
| | | |
| | | addLockInfo.EntryTime = curDoorLockUser.EntryTime; |
| | | var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/AddDoorLock", addLockInfo); |
| | | if (result != null) |
| | | { |
| | | if (result.StateCode == "Success") |
| | | { |
| | | //存门锁信息 |
| | | var resultList = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetCloudLocalDoorLocklist(doorLock, curAccountId); |
| | | var uList = new List<int> { }; |
| | | if (resultList != null) |
| | | { |
| | | foreach (var a in resultList.Keys) |
| | | { |
| | | uList.Add(a); |
| | | } |
| | | } |
| | | var d = uList.Find((value) => { return value == curDoorLockUser.UserID; }); |
| | | if (d != null) |
| | | { |
| | | TypeRefresh(); |
| | | flMain.RemoveFromParent(); |
| | | bottomFrameLayout.RemoveAll(); |
| | | } |
| | | else |
| | | { |
| | | 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.Down, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | flMain.RemoveFromParent(); |
| | | bottomFrameLayout.RemoveAll(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinish); |
| | | flMain.RemoveFromParent(); |
| | | bottomFrameLayout.RemoveAll(); |
| | | } |
| | | } |
| | | }; |
| | | btnFinish.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | System.Threading.Tasks.Task.Run(async () => |
| | | { |
| | | try |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Start(""); |
| | | }); |
| | | if (curAccountId == "") |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | flMain.RemoveFromParent(); |
| | | bottomFrameLayout.RemoveAll(); |
| | | CommonPage.Loading.Hide (); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | var addLockInfo = new ZigBee.Device.DoorLock.AddDoorLockData(); |
| | | if (UserCenterResourse.UserInfo.AuthorityNo != 1) |
| | | { |
| | | addLockInfo.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); |
| | | addLockInfo.IsOtherAccountCtrl = true; |
| | | } |
| | | addLockInfo.CloudAccountId = curAccountId; |
| | | if (doorLock.DeviceAddr != null) |
| | | { |
| | | addLockInfo.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint; |
| | | } |
| | | addLockInfo.OpenLockMode = curDoorLockUser.UnlockType; |
| | | addLockInfo.DoorLockLocalUserId = curDoorLockUser.UserID.ToString(); |
| | | switch (curDoorLockUser.UnlockType) |
| | | { |
| | | case 0: |
| | | if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null) |
| | | { |
| | | addLockInfo.UserIdRemarks = curDoorLockUser.UserName; |
| | | } |
| | | else |
| | | { |
| | | addLockInfo.UserIdRemarks = Language.StringByID(R.MyInternationalizationString.Password) + "ID" + curDoorLockUser.UserID; |
| | | } |
| | | break; |
| | | case 3: |
| | | if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null) |
| | | { |
| | | addLockInfo.UserIdRemarks = curDoorLockUser.UserName; |
| | | } |
| | | else |
| | | { |
| | | addLockInfo.UserIdRemarks = Language.StringByID(R.MyInternationalizationString.IcCard) + "ID" + curDoorLockUser.UserID; |
| | | } |
| | | break; |
| | | case 15: |
| | | if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null) |
| | | { |
| | | addLockInfo.UserIdRemarks = curDoorLockUser.UserName; |
| | | } |
| | | else |
| | | { |
| | | addLockInfo.UserIdRemarks = Language.StringByID(R.MyInternationalizationString.Fingerprint) + "ID" + +curDoorLockUser.UserID; |
| | | } |
| | | break; |
| | | } |
| | | addLockInfo.EntryTime = curDoorLockUser.EntryTime; |
| | | var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/AddDoorLock", addLockInfo); |
| | | if (result != null) |
| | | { |
| | | if (result.StateCode == "Success") |
| | | { |
| | | //存门锁信息 |
| | | var resultList = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetCloudLocalDoorLocklist(doorLock, curAccountId); |
| | | var uList = new List<int> { }; |
| | | if (resultList != null) |
| | | { |
| | | foreach (var a in resultList.Keys) |
| | | { |
| | | uList.Add(a); |
| | | } |
| | | } |
| | | var d = uList.Find((value) => { return value == curDoorLockUser.UserID; }); |
| | | if (d != null) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | TypeRefresh(); |
| | | CommonPage.Loading.Hide(); |
| | | flMain.RemoveFromParent(); |
| | | bottomFrameLayout.RemoveAll(); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.Down, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | }); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.Down, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(btnFinish); |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | catch { } |
| | | }); |
| | | }; |
| | | } |
| | | |
| | | // 侧边导航栏 |