| | |
| | | using ZigBee.Device; |
| | | namespace Shared.Phone.UserCenter.DoorLock |
| | | { |
| | | public class UndistributeDoorlockUserPage : DoorLockCommonLayout, ZigBee.Common.IStatus |
| | | public class UndistributeDoorlockUserPage : DoorLockCommonLayout |
| | | { |
| | | /// <summary> |
| | | /// 构造函数 |
| | | /// </summary> |
| | | /// <param name="doorLock"></param> |
| | | public UndistributeDoorlockUserPage(ZigBee.Device.DoorLock doorLock, List<Shared.Phone.UserCenter.MemberInfoRes> localAccountList) |
| | | public UndistributeDoorlockUserPage(ZigBee.Device.DoorLock doorLock, List<MemberInfoRes> localAccountList) |
| | | { |
| | | this.doorLock = doorLock; |
| | | this.localAccountList = localAccountList; |
| | |
| | | /// <summary> |
| | | /// 本地账户列表 |
| | | /// </summary> |
| | | List<Shared.Phone.UserCenter.MemberInfoRes> localAccountList; |
| | | List<MemberInfoRes> localAccountList; |
| | | /// <summary> |
| | | /// 滑动布局View |
| | | /// </summary> |
| | |
| | | }); |
| | | } |
| | | |
| | | /// <summary>
|
| | | /// UI显示
|
| | | /// <summary> |
| | | /// UI显示 |
| | | /// </summary> |
| | | public void Show() |
| | | { |
| | |
| | | Y = Application.GetRealHeight(35), |
| | | Height = Application.GetRealHeight(63), |
| | | Width = Application.GetRealWidth(762), |
| | | Text = Language.StringByID(R.MyInternationalizationString.MatchPerson), |
| | | Text = Language.StringByID(R.MyInternationalizationString.MatchUser), |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, |
| | | TextSize = 16, |
| | | TextAlignment = TextAlignment.Center, |
| | |
| | | |
| | | var btnChoose = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(60), |
| | | Height = Application.GetRealHeight(60), |
| | | Width = Application.GetMinRealAverage(60), |
| | | Height = Application.GetMinRealAverage(60), |
| | | X = Application.GetRealWidth(861 + 81), |
| | | Y = Application.GetRealHeight(35), |
| | | SelectedImagePath = "DoorLock/SelectedIcon.png", |
| | |
| | | btnLine.Visible = false; |
| | | } |
| | | |
| | | if (!string.IsNullOrEmpty(currentAccount.UserName)) |
| | | { |
| | | btnUserName.Text = currentAccount.UserName; |
| | | } |
| | | else |
| | | { |
| | | btnUserName.Text = currentAccount.Account; |
| | | } |
| | | btnUserName.Text = currentAccount.ShowName; |
| | | |
| | | EventHandler<MouseEventArgs> eHandler = (sender, e) => |
| | | { |
| | | if (doorLock.IsFreezeAccount[currentAccount.SubAccountDistributedMark] == true) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = btnUserName.Text + Language.StringByID(R.MyInternationalizationString.AccountIsFreezed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | }); |
| | | return; |
| | | } |
| | | //☆マーク☆ |
| | | //if (doorLock.IsFreezeAccount[currentAccount.SubAccountDistributedMark] == true) |
| | | //{ |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // new Tip() { MaxWidth = 150, Text = btnUserName.Text + Language.StringByID(R.MyInternationalizationString.AccountIsFreezed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | // }); |
| | | // return; |
| | | //} |
| | | |
| | | if (!btnChoose.IsSelected) |
| | | { |
| | |
| | | oldbuttonChoose.IsSelected = true; |
| | | oldbuttonChoose.Visible = true; |
| | | oldUserName.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | curAccountId = currentAccount.SubAccountDistributedMark; |
| | | //☆マーク☆ |
| | | //curAccountId = currentAccount.SubAccountDistributedMark; |
| | | } |
| | | }; |
| | | btnChoose.MouseUpEventHandler += eHandler; |
| | |
| | | else |
| | | { |
| | | var addLockInfo = new ZigBee.Device.DoorLock.AddDoorLockData(); |
| | | if (UserCenterResourse.UserInfo.AuthorityNo != 1) |
| | | if (HdlUserCenterResourse.ResidenceOption.AuthorityNo != 1) |
| | | { |
| | | addLockInfo.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); |
| | | //☆マーク☆ |
| | | //addLockInfo.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); |
| | | addLockInfo.IsOtherAccountCtrl = true; |
| | | } |
| | | addLockInfo.CloudAccountId = curAccountId; |
| | |
| | | var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/AddDoorLock", addLockInfo); |
| | | if (result != null) |
| | | { |
| | | if (result.StateCode == "Success") |
| | | if (result.Code == HttpMessageEnum.A成功) |
| | | { |
| | | //存门锁信息 |
| | | var resultList = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetCloudLocalDoorLocklist(doorLock, curAccountId); |
| | |
| | | RefreshList(); |
| | | } |
| | | } |
| | | #region 接口实现 |
| | | /// <summary> |
| | | /// 处理变化事件 --将弃用 改用DeviceInfoChange() |
| | | /// </summary> |
| | | /// <returns>The changed.</returns> |
| | | /// <param name="common">Common.</param> |
| | | public void Changed(CommonDevice common) |
| | | { |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 处理变化事件 |
| | | /// </summary> |
| | | /// <param name="common"></param> |
| | | /// <param name="typeTag"></param> |
| | | public void DeviceInfoChange(CommonDevice common, string typeTag) |
| | | { |
| | | } |
| | | /// <summary> |
| | | /// Changeds the IL ogic status. |
| | | /// </summary> |
| | | /// <param name="logic">Logic.</param> |
| | | public void ChangedILogicStatus(ZigBee.Device.Logic logic) |
| | | { |
| | | } |
| | | /// <summary> |
| | | /// Changeds the IS cene status. |
| | | /// </summary> |
| | | /// <param name="scene">Scene.</param> |
| | | public void ChangedISceneStatus(Scene scene) |
| | | { |
| | | } |
| | | #endregion |
| | | } |
| | | } |